:root {
  --bg: #0a0a0b;
  --panel: #141416;
  --panel-2: #1c1c1f;
  --line: #3b3322;
  --gold: #d4af37;
  --gold-hi: #f1d27a;
  --gold-lo: #a8841f;
  --text: #f3efe5;
  --muted: #b8b09c;
  --ok: #57c48a;
  --wait: #e8b84a;
  --err: #ff9b8a;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-hi); }
a:hover { color: #fff; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 16px; }

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; color: var(--gold-hi); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.55rem, 4vw, 2.35rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
p { margin: 0 0 1em; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--gold); margin-bottom: .4em; }
.lede { font-size: 1.15rem; color: var(--gold-hi); font-style: italic; }
.muted { color: var(--muted); }
.small, .small-text { font-size: .9rem; }
.req { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hero { position: relative; overflow: hidden; border-radius: var(--radius); isolation: isolate; }
.hero img { border-radius: var(--radius); border: 1px solid var(--line); animation: hero-arrive .7s ease-out both; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 228, 145, .08) 43%, rgba(255, 231, 151, .7) 50%, rgba(255, 228, 145, .08) 57%, transparent 68%);
  transform: translateX(-125%); animation: banner-gold-sweep 1.45s ease-in-out .45s both;
}
.founder { padding: 28px 4px 8px; }
.status-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.status { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; flex: 1 1 240px; }
.status strong { display: block; }
.status span { color: var(--muted); font-size: .92rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); }
.dot-wait { background: var(--wait); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block; cursor: pointer; border: 1px solid var(--gold); border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  color: #17130a; font-weight: 700; padding: 11px 22px; font-size: 1rem; text-decoration: none; letter-spacing: .02em;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn:not([disabled]):hover { filter: brightness(1.07); color: #000; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(212, 175, 55, .2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--gold-hi); }
.btn.ghost:hover { background: rgba(212, 175, 55, .12); color: #fff; }
.btn.small { padding: 6px 14px; font-size: .88rem; }
.btn.danger { background: transparent; border-color: var(--err); color: var(--err); }

#screens { margin: 28px 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery figcaption { padding: 10px 14px 14px; font-size: .92rem; }
.tag { display: block; color: var(--gold); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 2px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 22px 0; }
.card.narrow { max-width: 640px; margin: 40px auto; }
.subcard { border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.notice { border-left: 3px solid var(--gold); padding: 8px 12px; background: var(--panel-2); border-radius: 6px; }
.closed-note { padding: 12px 14px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--gold-lo); color: var(--gold-hi); margin-bottom: 12px; }

form label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 12px; }
.label { font-weight: 600; font-size: .95rem; margin: 6px 0; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=search], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--text);
  background: #0f0f11; border: 1px solid #4a4130; border-radius: 8px;
}
input[type=tel] {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--text);
  background: #0f0f11; border: 1px solid #4a4130; border-radius: 8px;
}
textarea { resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 16px 0; }
.feature-grid > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.feature-grid strong, .feature-grid span { display: block; }
.feature-grid span { color: var(--muted); margin-top: 5px; }
.motion-ready .feature-grid > div { opacity: 0; transform: translateY(28px) scale(.975); }
.motion-ready #about-saps.in-view .feature-grid > div { opacity: 1; transform: none; transition: opacity .58s ease, transform .58s cubic-bezier(.2,.75,.25,1); }
.motion-ready #about-saps.in-view .feature-grid > div:nth-child(2) { transition-delay: .10s; }
.motion-ready #about-saps.in-view .feature-grid > div:nth-child(3) { transition-delay: .20s; }
.motion-ready #about-saps.in-view .feature-grid > div:nth-child(4) { transition-delay: .30s; }
.motion-ready #about-saps.in-view .feature-grid > div:nth-child(5) { transition-delay: .40s; }
.motion-ready #about-saps.in-view .feature-grid > div:nth-child(6) { transition-delay: .50s; }
.sms-consent { border-left: 3px solid var(--gold-lo); padding: 10px 12px; margin: 12px 0; background: var(--panel-2); border-radius: 6px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 12px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin: 0 0 16px; }
legend { color: var(--gold-hi); font-family: Georgia, serif; font-size: 1.1rem; padding: 0 6px; }

.choices { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; }
.choice { margin: 0; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-block; min-width: 120px; text-align: center; padding: 12px 18px; border: 1px solid var(--gold-lo); border-radius: 10px; font-weight: 700; cursor: pointer; }
.choice input:checked + span { background: var(--gold); color: #17130a; border-color: var(--gold-hi); }
.choice input:focus-visible + span { outline: 3px solid var(--gold-hi); outline-offset: 2px; }

details > summary { list-style: none; margin: 4px 0 16px; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 20px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ts { margin: 6px 0 14px; min-height: 65px; }
.msg { min-height: 1.4em; margin-top: 10px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }
.success { border: 1px solid var(--ok); border-radius: var(--radius); padding: 16px; background: rgba(87, 196, 138, .08); }
.success a { word-break: break-all; }

.footer { text-align: center; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 30px; padding: 20px 0 8px; }
.footer p { margin: 0 0 6px; }

/* ---------- Owner dashboard ---------- */
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.tabs button { cursor: pointer; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font: inherit; }
.tabs button[aria-selected=true] { background: var(--gold); color: #17130a; border-color: var(--gold-hi); font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { display: block; font-size: 1.8rem; color: var(--gold-hi); font-family: Georgia, serif; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: .88rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 18px; }
.grid2 > .card { margin: 9px 0; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 72px; gap: 10px; align-items: center; margin: 6px 0; font-size: .92rem; }
.bar { height: 12px; background: #26231b; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.bar-row .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #2b271d; vertical-align: top; }
th { color: var(--gold); font-weight: 600; white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { border-color: var(--ok); color: var(--ok); }
.badge.err { border-color: var(--err); color: var(--err); }
.badge.wait { border-color: var(--wait); color: var(--wait); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid #2b271d; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--gold-lo); border-radius: var(--radius); width: min(920px, 96vw); max-height: 92vh; padding: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dialog-body { padding: 20px; overflow: auto; }
.detail-grid { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 4px 14px; font-size: .92rem; margin-bottom: 16px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.detail-grid h3 { grid-column: 1 / -1; margin: 12px 0 4px; font-size: 1.05rem; }

@keyframes hero-arrive {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes banner-gold-sweep {
  from { transform: translateX(-125%); }
  to { transform: translateX(125%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero img { animation: none; }
  .hero::after { animation: none; display: none; }
  .motion-ready .feature-grid > div { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
  .btn:not([disabled]):hover { transform: none; }
}

@media (max-width: 560px) {
  .card { padding: 16px; }
  .grid.three { gap: 0 8px; }
  .choice span { min-width: 92px; }
  .bar-row { grid-template-columns: 1fr 64px; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .detail-grid { grid-template-columns: 1fr; }
}
