/* Obsidian and champagne. One spacing grid (4/8/12/16/22), hairline edges that catch light, gold used sparingly, motion that eases and settles.
   Change the accent in one place: --gold, --gold2, --goldg. */
@font-face { font-family: "Instrument Sans"; src: url(fonts/InstrumentSans_400Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(fonts/InstrumentSans_500Medium.ttf); font-weight: 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(fonts/InstrumentSans_600SemiBold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(fonts/InstrumentSerif-Regular.ttf); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(fonts/InstrumentSerif-Italic.ttf); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url(fonts/Geist_300Light.ttf); font-weight: 300; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(fonts/GeistMono_400Regular.ttf); font-weight: 400; font-display: swap; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

:root {
  --bg: #060608; --s1: #0d0d12; --s2: #15151c; --hair: rgba(255,255,255,.075); --hair2: rgba(255,255,255,.17);
  --ink: #f5f2ec; --muted: #a2a0ab; --dim: #74727e;
  --gold: #ead4a4; --gold2: #cba35e; --gold3: #8f6a30; --goldg: linear-gradient(135deg, #f6e6bf 0%, #dcb872 44%, #a98040 100%);
  --ok: #86e3b0; --warn: #f0c36d; --danger: #ff8282;
  --r: 26px; --r-in: 15px; --pad: 22px;
  --ease: cubic-bezier(.22,.8,.2,1); --spring: cubic-bezier(.2,.9,.25,1.12);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.5 "Instrument Sans", system-ui, sans-serif; min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
/* Slow-drifting light behind everything, and a whisper of film grain. */
body::before { content: ""; position: fixed; inset: -20%; pointer-events: none; z-index: -2; animation: drift 38s ease-in-out infinite alternate;
  background: radial-gradient(46vw 38vh at 14% 6%, rgba(104,120,255,.15), transparent 70%), radial-gradient(40vw 34vh at 92% 12%, rgba(176,120,230,.08), transparent 70%), radial-gradient(52vw 40vh at 80% 100%, rgba(214,170,96,.10), transparent 70%); }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; background: var(--noise); opacity: .05; }
@keyframes drift { to { transform: translate3d(3%, 2%, 0) scale(1.06); } }
h1, h2, h3, p { margin: 0; }
h1 { font: 400 clamp(36px, 10vw, 48px)/1.03 "Instrument Serif", Georgia, serif; letter-spacing: -.012em; text-wrap: balance; }
h1 em, h2 em, .gold { font-style: italic; background: var(--goldg); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
h2 { font: 400 25px/1.15 "Instrument Serif", Georgia, serif; letter-spacing: -.005em; }
h3 { font-size: 15px; font-weight: 600; }
a { color: var(--gold); text-underline-offset: 3px; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 15px; } .mono { font-family: "Geist Mono", ui-monospace, monospace; font-size: 14px; }
.eyebrow { font: 400 11.5px/1.2 "Geist Mono", ui-monospace, monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.eyebrow.gold { color: var(--gold2); background: none; -webkit-text-fill-color: initial; font-style: normal; }
.num { font: 300 38px/1.05 "Geist", sans-serif; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.num.xl { font-size: 56px; } .num small { font-size: .42em; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
[hidden] { display: none !important; }
::selection { background: rgba(203,163,94,.35); }

/* ---------- Layout ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: calc(18px + var(--safe-t)) 18px calc(128px + var(--safe-b)); display: grid; gap: 16px; align-content: start; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 10px; font: 500 14px/1 "Instrument Sans", sans-serif; letter-spacing: .02em; color: var(--muted); }
.brand .mk { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(160deg, #1b1b25, #0c0c11); box-shadow: 0 0 0 1px var(--hair2) inset, 0 6px 16px -6px rgba(203,163,94,.45); color: var(--gold); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .between { justify-content: space-between; }
.stack { display: grid; gap: 8px; } .stack-4 { display: grid; gap: 4px; } .stack-16 { display: grid; gap: 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.sep { height: 1px; background: linear-gradient(90deg, transparent, var(--hair2), transparent); border: 0; margin: 0; }

/* ---------- Cards: a slab with a hairline that catches light ---------- */
.card { position: relative; isolation: isolate; border-radius: var(--r); padding: var(--pad); display: grid; gap: 16px; align-content: start;
  background: linear-gradient(180deg, rgba(255,255,255,.058), rgba(255,255,255,.018) 55%), var(--s1);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 34px 60px -34px rgba(0,0,0,.9), 0 2px 10px rgba(0,0,0,.35); }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(155deg, rgba(255,255,255,.24), rgba(255,255,255,.05) 32%, rgba(255,255,255,.02) 64%, rgba(234,212,164,.2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s; z-index: -1;
  background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 0%), rgba(234,212,164,.09), transparent 62%); }
@media (hover: hover) { .card:hover::after { opacity: 1; } }
.card.hero { padding-top: 26px; background: radial-gradient(90% 60% at 50% 0%, rgba(203,163,94,.16), transparent 70%), linear-gradient(180deg, rgba(255,255,255,.058), rgba(255,255,255,.018) 55%), var(--s1); }
.card.glow { background: radial-gradient(120% 80% at 0% 0%, rgba(203,163,94,.17), transparent 62%), linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.016)), var(--s1); }
.card.alert { background: radial-gradient(120% 80% at 0% 0%, rgba(255,130,130,.15), transparent 62%), linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.016)), var(--s1); }
.card.calm { background: radial-gradient(120% 80% at 0% 0%, rgba(134,227,176,.11), transparent 62%), linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.016)), var(--s1); }
.card > header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.enter .card, .enter .rise { animation: rise .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(4px); } }

/* ---------- Pills and states ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(134,227,176,.14), 0 0 14px var(--ok); } .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(240,195,109,.12); } .dot.danger { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,130,130,.14); }
.dot.ok { animation: breathe 3.2s ease-in-out infinite; } @keyframes breathe { 50% { box-shadow: 0 0 0 5px rgba(134,227,176,.06), 0 0 8px var(--ok); } }
.state { display: inline-flex; align-items: center; gap: 9px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; font-size: 13.5px; line-height: 1.2; background: rgba(255,255,255,.05); box-shadow: 0 0 0 1px var(--hair) inset; color: var(--muted); white-space: nowrap; }
.pill.gold { color: var(--gold); background: rgba(203,163,94,.1); box-shadow: 0 0 0 1px rgba(203,163,94,.28) inset; }
.pill.ok { color: var(--ok); background: rgba(134,227,176,.08); box-shadow: 0 0 0 1px rgba(134,227,176,.25) inset; } .pill.danger { color: var(--danger); background: rgba(255,130,130,.09); box-shadow: 0 0 0 1px rgba(255,130,130,.28) inset; } .pill.warn { color: var(--warn); background: rgba(240,195,109,.09); box-shadow: 0 0 0 1px rgba(240,195,109,.26) inset; }

/* ---------- Buttons: default, hover (mouse only), focus, pressed, loading, disabled ---------- */
.btn { appearance: none; border: 0; position: relative; overflow: hidden; border-radius: 16px; min-height: 52px; padding: 0 24px; font: 600 16px/1 "Instrument Sans", system-ui, sans-serif; letter-spacing: .01em;
  color: #1c1306; background: var(--goldg); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 -1px 0 rgba(0,0,0,.22) inset, 0 16px 32px -12px rgba(203,163,94,.6);
  transition: transform .25s var(--spring), box-shadow .3s, opacity .2s, background-color .2s; }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.5) 50%, transparent 62%); transform: translateX(-130%); pointer-events: none; }
@media (hover: hover) { .btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 -1px 0 rgba(0,0,0,.22) inset, 0 20px 38px -12px rgba(203,163,94,.75); } .btn:hover::after { transform: translateX(130%); transition: transform .9s var(--ease); } }
.btn.ghost { background: rgba(255,255,255,.055); color: var(--ink); box-shadow: 0 0 0 1px var(--hair2) inset; }
.btn.quiet { background: none; color: var(--muted); box-shadow: none; padding: 0 12px; min-height: 44px; font-size: 15px; font-weight: 500; }
.btn.danger { background: rgba(255,130,130,.1); color: var(--danger); box-shadow: 0 0 0 1px rgba(255,130,130,.3) inset; }
.btn.sm { min-height: 44px; padding: 0 18px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
@media (hover: hover) { .btn.ghost:hover, .btn.quiet:hover, .btn.danger:hover { background-color: rgba(255,255,255,.1); color: var(--ink); box-shadow: 0 0 0 1px var(--hair2) inset; transform: translateY(-1px); } .btn.ghost:hover::after, .btn.quiet:hover::after, .btn.danger:hover::after { display: none; } .btn.danger:hover { color: var(--danger); background-color: rgba(255,130,130,.16); } .btn.quiet:hover { box-shadow: none; } }
.btn.ghost::after, .btn.quiet::after, .btn.danger::after { display: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
.btn:active { transform: scale(.965); transition-duration: .08s; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .85; }
.btn[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.done { background: var(--ok); color: #06240f; box-shadow: none; }
.btn.done::after { display: none; }
@keyframes spin { to { transform: rotate(1turn); } }
.btn.hold { position: relative; overflow: hidden; } .btn.hold::after { display: block; content: ""; position: absolute; inset: 0; background: rgba(255,130,130,.3); transform: scaleX(0); transform-origin: left; }
.btn.hold.holding::after { transform: scaleX(1); transition: transform var(--hold, 1.2s) linear; }
.btn svg { flex: none; }

/* ---------- Forms ---------- */
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); letter-spacing: .01em; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--ink); background: rgba(0,0,0,.4); border: 0; border-radius: var(--r-in); padding: 0 16px; min-height: 52px; width: 100%; box-shadow: 0 0 0 1px var(--hair) inset; transition: box-shadow .2s, background-color .2s; }
textarea { padding: 14px 16px; resize: none; min-height: 120px; max-height: 9.5em; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 0; box-shadow: 0 0 0 1.5px var(--gold2) inset, 0 0 0 5px rgba(203,163,94,.13); background-color: rgba(0,0,0,.55); }
input[type="checkbox"] { appearance: none; width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 8px; flex: none; display: grid; place-items: center; background: rgba(0,0,0,.4); box-shadow: 0 0 0 1.5px rgba(255,255,255,.28) inset; cursor: pointer; transition: background .2s, box-shadow .2s; }
input[type="checkbox"]::after { content: ""; width: 12px; height: 7px; border: solid #1c1306; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform .25s var(--spring); }
input[type="checkbox"]:checked { background: var(--goldg); box-shadow: none; } input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1); }
input[type="range"] { appearance: none; padding: 0; background: none; box-shadow: none; min-height: 44px; accent-color: var(--gold2); }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--gold2), rgba(255,255,255,.12) 0); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 26px; height: 26px; border-radius: 50%; margin-top: -11px; background: var(--goldg); box-shadow: 0 4px 14px rgba(203,163,94,.5); }
.check { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 16px; min-height: 44px; cursor: pointer; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 22px; border: 0; box-shadow: 0 0 0 1px var(--hair2) inset; background: none; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; transition: transform .2s var(--spring), background-color .2s, color .2s; }
.chip[aria-pressed="true"] { background: var(--goldg); color: #1c1306; box-shadow: none; font-weight: 600; } .chip:active { transform: scale(.95); }

/* ---------- Site previews, code blocks, checklists ---------- */
.thumb { all: unset; cursor: pointer; flex: none; width: 132px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--hair2); transition: transform .25s var(--spring); }
.thumb:focus-visible, .linkbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; } .thumb:active { transform: scale(.97); }
.thumb img, .shot, .mini { display: block; width: 100%; height: auto; object-fit: cover; }
.mini { width: 56px; height: 36px; border-radius: 6px; box-shadow: 0 0 0 1px var(--hair2); }
.shot { border-radius: 14px; box-shadow: 0 0 0 1px var(--hair2); }
.linkbtn { all: unset; cursor: pointer; color: var(--gold2); text-decoration: underline; text-underline-offset: 3px; min-height: 24px; }
dialog.wide { width: min(900px, 100vw); }
pre.code { margin: 0; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.35); box-shadow: 0 0 0 1px var(--hair) inset; font: 400 13px/1.5 "Geist Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.bullets { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: #d9d6de; }

/* ---------- Build path (client hero) ---------- */
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.path::before, .path::after { content: ""; position: absolute; top: 8px; left: 10%; height: 2px; border-radius: 2px; }
.path::before { right: 10%; background: rgba(255,255,255,.09); }
.path::after { width: calc(80% * var(--prog, 0)); background: var(--goldg); box-shadow: 0 0 14px rgba(203,163,94,.7); transform-origin: left; animation: grow 1.4s var(--ease) .3s both; }
@keyframes grow { from { transform: scaleX(0); } }
.path li { display: grid; justify-items: center; gap: 10px; position: relative; font-size: 12px; line-height: 1.2; color: var(--dim); text-align: center; letter-spacing: .02em; }
.path li i { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 1.5px rgba(255,255,255,.14) inset; position: relative; z-index: 1; }
.path li.done { color: var(--muted); } .path li.done i { background: var(--goldg); box-shadow: 0 0 16px rgba(203,163,94,.5); }
.path li.done i::after { content: ""; position: absolute; left: 5px; top: 4.5px; width: 7px; height: 4px; border: solid #1c1306; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.path li.now { color: var(--ink); } .path li.now i { box-shadow: 0 0 0 1.5px var(--gold2) inset; background: var(--bg); }
.path li.now i::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--gold2); animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }

/* ---------- Thread ---------- */
.thread { display: grid; gap: 10px; }
.day { font: 400 11.5px/1 "Geist Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); text-align: center; padding: 10px 0 0; }
.bubble { max-width: 86%; padding: 12px 16px; border-radius: 20px 20px 20px 6px; background: rgba(255,255,255,.065); box-shadow: 0 0 0 1px var(--hair) inset; justify-self: start; overflow-wrap: anywhere; animation: pop .5s var(--spring) both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.bubble .txt { white-space: pre-wrap; display: block; }
.bubble.me { justify-self: end; border-radius: 20px 20px 6px 20px; background: linear-gradient(160deg, rgba(234,212,164,.2), rgba(203,163,94,.1)); box-shadow: 0 0 0 1px rgba(203,163,94,.28) inset; }
.bubble.sys { max-width: 100%; justify-self: stretch; background: none; box-shadow: none; border: 1px dashed var(--hair2); border-radius: 14px; color: var(--muted); font-size: 15px; text-align: center; }
.bubble .meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }

/* ---------- Lists, tables, details ---------- */
.list { display: grid; } .list > * { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--hair); min-height: 52px; }
.list > *:first-child { border-top: 0; } .list button.line { all: unset; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; min-height: 24px; border-top: 1px solid var(--hair); transition: padding .25s var(--spring); }
.list button.line:first-child { border-top: 0; } .list button.line:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (hover: hover) { .list button.line:hover { padding-left: 8px; } }
details > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; width: 8px; height: 8px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .3s var(--spring); margin-right: 4px; }
details[open] > summary::after { transform: rotate(225deg); }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; } table.t th { text-align: left; font: 400 11.5px/1 "Geist Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding: 8px 12px 12px 0; } table.t td { padding: 14px 12px 14px 0; border-top: 1px solid var(--hair); vertical-align: top; }

/* ---------- Sheets: a bottom sheet on phones, a centered panel on desktop ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); width: min(580px, 100vw); max-width: 100vw; max-height: 100dvh; margin: auto; overflow: visible; }
dialog .pane { position: relative; display: grid; gap: 16px; padding: 12px var(--pad) calc(var(--pad) + var(--safe-b)); border-radius: 30px; max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02) 40%), #101016; box-shadow: 0 0 0 1px var(--hair2) inset, 0 40px 90px rgba(0,0,0,.7); }
dialog .grab { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.2); justify-self: center; margin: 2px 0 6px; touch-action: none; cursor: grab; }
dialog[open] { animation: fade .3s ease backwards; } dialog[open] .pane { animation: sheet .5s var(--ease) backwards; }
dialog::backdrop { background: rgba(2,2,5,.66); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade .3s ease backwards; }
@keyframes sheet { from { transform: translateY(40px) scale(.98); opacity: 0; } } @keyframes fade { from { opacity: 0; } }
@media (max-width: 640px) { dialog { margin: auto 0 0; } dialog .pane { border-radius: 30px 30px 0 0; } dialog[open] .pane { animation-name: sheetup; } }
@keyframes sheetup { from { transform: translateY(100%); } }
.doc { display: grid; gap: 18px; } .doc h3 { font: 400 11.5px/1 "Geist Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--gold2); margin-bottom: 8px; } .doc p { color: #d9d6de; }
.inv { display: grid; gap: 18px; } .inv table { width: 100%; border-collapse: collapse; } .inv td { padding: 10px 0; border-top: 1px solid var(--hair); vertical-align: top; } .inv td:last-child { text-align: right; white-space: nowrap; font-family: "Geist Mono", monospace; font-size: 15px; }
.inv .total td { font-weight: 600; border-top: 1px solid var(--gold2); font-size: 17px; }
.sig { font: italic 400 40px/1.1 "Instrument Serif", serif; min-height: 56px; padding: 6px 0 4px; border-bottom: 1px solid var(--gold2); color: var(--gold); overflow-wrap: anywhere; }
.sig:empty::before { content: "Your signature"; color: var(--dim); font-size: 28px; }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); background: rgba(24,24,32,.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-radius: 16px; padding: 14px 20px; box-shadow: 0 0 0 1px var(--hair2) inset, 0 20px 50px rgba(0,0,0,.6); animation: pop .4s var(--spring) both; z-index: 40; max-width: calc(100vw - 32px); font-size: 15px; }
.banner { background: rgba(240,195,109,.09); box-shadow: 0 0 0 1px rgba(240,195,109,.26) inset; color: var(--warn); border-radius: 16px; padding: 12px 16px; font-size: 15px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.sk { border-radius: var(--r); background: linear-gradient(100deg, rgba(255,255,255,.04) 40%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 60%); background-size: 200% 100%; animation: sk 1.5s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Welcome and success moments ---------- */
.hello { min-height: 78dvh; display: grid; align-content: center; justify-items: start; gap: 22px; }
.tick { width: 72px; height: 72px; color: var(--gold); filter: drop-shadow(0 0 18px rgba(203,163,94,.55)); } .tick circle, .tick path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw 1s var(--ease) .1s forwards; }
.tick path { animation-delay: .55s; } @keyframes draw { to { stroke-dashoffset: 0; } }
.burst { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- Dock: the app's navigation, a floating glass bar ---------- */
.dock { position: fixed; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); width: min(392px, calc(100vw - 24px)); height: 70px; border-radius: 28px; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center;
  background: rgba(16,16,22,.74); -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5); box-shadow: 0 0 0 1px var(--hair2) inset, 0 24px 60px -10px rgba(0,0,0,.85), 0 0 40px -10px rgba(203,163,94,.18); animation: dockin .9s var(--ease) .25s both; }
@keyframes dockin { from { transform: translate(-50%, 140%); } }
.dock button { all: unset; box-sizing: border-box; cursor: pointer; display: grid; justify-items: center; align-content: center; gap: 5px; height: 100%; color: var(--dim); font-size: 11px; letter-spacing: .03em; position: relative; transition: color .25s; -webkit-tap-highlight-color: transparent; }
.dock button:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; border-radius: 22px; }
.dock button svg { transition: transform .35s var(--spring); } .dock button:active svg { transform: scale(.86); }
.dock button[aria-current="page"] { color: var(--gold); } .dock button[aria-current="page"] svg { transform: translateY(-1px); filter: drop-shadow(0 0 8px rgba(203,163,94,.6)); }
.dock button[aria-current="page"]::after { content: ""; position: absolute; bottom: 7px; width: 16px; height: 2.5px; border-radius: 2px; background: var(--goldg); animation: grow .5s var(--ease) both; }

/* ---------- Admin ---------- */
.frame { display: block; } .stage { max-width: 1060px; margin: 0 auto; padding: calc(18px + var(--safe-t)) 18px calc(128px + var(--safe-b)); display: grid; gap: 16px; align-content: start; }
.rail { display: none; }
@media (min-width: 980px) {
  .frame { display: grid; grid-template-columns: 252px 1fr; }
  .rail { display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; padding: 28px 18px; box-shadow: -1px 0 0 var(--hair) inset; }
  .rail nav { display: grid; gap: 4px; }
  .rail nav button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 16px; border-radius: 15px; color: var(--muted); font-size: 16px; transition: background-color .2s, color .2s, padding .25s var(--spring); position: relative; }
  .rail nav button:hover { color: var(--ink); padding-left: 20px; } .rail nav button:focus-visible { outline: 2px solid var(--gold); }
  .rail nav button[aria-current="page"] { color: var(--ink); background: linear-gradient(90deg, rgba(203,163,94,.16), rgba(203,163,94,.03)); box-shadow: 0 0 0 1px rgba(203,163,94,.2) inset; }
  .rail nav button[aria-current="page"] svg { color: var(--gold); }
  .stage { padding: 36px 40px 80px; width: 100%; } .dock.admin { display: none; } .stage .top.mobile { display: none; }
}
.dock.admin { width: min(420px, calc(100vw - 24px)); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { padding: 20px; gap: 10px; } .kpi .ico { color: var(--gold2); }
.rowcard { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 56px 1.5fr 1fr 1.2fr; gap: 16px; align-items: center; padding: 14px 8px 14px 0; border-top: 1px solid var(--hair); width: 100%; transition: padding .3s var(--spring), background-color .2s; border-radius: 0; }
.rowcard:first-of-type { border-top: 0; } .rowcard:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 12px; }
@media (hover: hover) { .rowcard:hover { padding-left: 10px; } }
@media (max-width: 700px) { .rowcard { grid-template-columns: 56px 1fr auto; } .rowcard .hide-s { display: none; } }
.ring { --p: 0; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold2) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); animation: fill 1.4s var(--ease) both; }
.ring i { font: normal 400 22px/1 "Instrument Serif", serif; width: 40px; height: 40px; border-radius: 50%; background: var(--s1); display: grid; place-items: center; color: var(--ink); }
.ring.big { width: 64px; height: 64px; } .ring.big i { width: 54px; height: 54px; font-size: 28px; }
@keyframes fill { from { --p: 0; } }
.two { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; align-items: start; } @media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.fields { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; } .fields .full { grid-column: 1 / -1; } @media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }
.zone { border-radius: 18px; padding: 16px; display: grid; gap: 10px; box-shadow: 0 0 0 1px rgba(255,130,130,.28) inset; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checks li { display: flex; align-items: center; gap: 14px; min-height: 48px; color: var(--muted); animation: pop .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 90ms + .2s); }
.checks li b { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; box-shadow: 0 0 0 1.5px var(--hair2) inset; color: transparent; }
.checks li.ok { color: var(--ink); } .checks li.ok b { background: var(--goldg); box-shadow: 0 0 18px rgba(203,163,94,.4); color: #1c1306; }
.checks li small { margin-left: auto; color: var(--dim); font-size: 13px; }
.meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; } .meter i { display: block; height: 100%; width: calc(var(--v, 0) * 100%); background: var(--goldg); box-shadow: 0 0 14px rgba(203,163,94,.6); transform-origin: left; animation: grow 1.2s var(--ease) both; }
.reasons { display: grid; gap: 2px; font-size: 15px; } .reasons > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--hair); color: var(--muted); } .reasons > div:first-child { border-top: 0; } .reasons b { color: var(--gold); font: 400 14px "Geist Mono", monospace; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; } .tick circle, .tick path { stroke-dashoffset: 0; } .burst { display: none; } }
@media print {
  body { background: #fff; color: #000; } body::before, body::after { display: none; } body > *:not(dialog[open]) { display: none !important; }
  dialog[open] { position: static; width: 100%; } dialog .pane { box-shadow: none; background: #fff; color: #000; padding: 0; max-height: none; } dialog .grab { display: none; }
  .no-print { display: none !important; } .muted, .doc p { color: #444; } .doc h3 { color: #6a5020; } .inv td { border-color: #ccc; } .inv .total td { border-color: #000; }
}

/* Go-live buttons pulse and glow gold while they are being held */
.btn.pulse.hold::after { background: rgba(255,255,255,.38); }
.btn.pulse.holding { animation: holdpulse .8s ease-in-out infinite; }
@keyframes holdpulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220,184,114,.55); } 50% { transform: scale(1.045); box-shadow: 0 0 0 14px rgba(220,184,114,0); } }
@media (prefers-reduced-motion: reduce) { .btn.pulse.holding { animation: none; } }

/* ---- the gold circle: sits on the chosen tab and glides to the next one ---- */
.dock .orb { position: absolute; top: -26px; left: var(--t); width: 62px; height: 62px; margin-left: -31px; border-radius: 50%; color: #1c1306; background: var(--goldg); display: grid; place-items: center; pointer-events: none; z-index: 2;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 14px 30px -6px rgba(203,163,94,.75), 0 0 0 6px rgba(6,6,8,.9); animation: orbgo .62s var(--spring) both; }
.dock .orb::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--gold2); opacity: 0; animation: ping 3.4s var(--ease) 1.4s infinite; }
@keyframes orbgo { 0% { left: var(--f); transform: scale(.8); } 55% { transform: scale(1.14); } 100% { left: var(--t); transform: scale(1); } }
.dock button[aria-current="page"]::after { display: none; }
.dock button[aria-current="page"] svg, .dock button[aria-current="page"] span { opacity: 0; filter: none; }
@media (prefers-reduced-motion: reduce) { .dock .orb { animation: none; } }

/* ---- alerts in a chat are events, not messages ---- */
.event { justify-self: center; display: inline-flex; align-items: center; gap: 8px; max-width: 92%; padding: 6px 14px 6px 8px; border-radius: 999px; background: rgba(203,163,94,.1); box-shadow: 0 0 0 1px rgba(203,163,94,.22) inset; color: var(--muted); font-size: 13.5px; line-height: 1.3; text-align: left; animation: pop .4s var(--ease) both; }
.event .ev { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%; color: #1c1306; background: var(--goldg); }
.event .ev svg { width: 12px; height: 12px; }

/* ---- iMessage-style composer above the dock ---- */
.composer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(114px + var(--safe-b)); width: min(392px, calc(100vw - 24px)); display: flex; align-items: flex-end; gap: 8px; z-index: 28; padding: 6px 6px 6px 14px; border-radius: 26px;
  background: rgba(16,16,22,.82); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); box-shadow: 0 0 0 1px var(--hair2) inset, 0 16px 40px -12px rgba(0,0,0,.8); }
.composer textarea { flex: 1; min-height: 36px; max-height: 120px; padding: 8px 0; border: 0; outline: 0; resize: none; background: none; box-shadow: none; color: var(--ink); font: inherit; field-sizing: content; }
.composer .send { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 600; color: #1c1306; background: var(--goldg); transition: transform .25s var(--spring); }
.composer .send:active { transform: scale(.88); }

.chatscroll { max-height: 56dvh; overflow-y: auto; padding: 4px 2px 8px; scroll-behavior: smooth; }
.composer.inline { position: static; transform: none; width: auto; bottom: auto; margin-top: 8px; box-shadow: 0 0 0 1px var(--hair2) inset; background: rgba(255,255,255,.04); }

/* Client portal only: the body scrolls, not the page. On iPhone Safari a page scroll (every tab tap scrolls to the top or bottom) collapses and expands the browser toolbar, and the fixed tab bar visibly jumps with it. */
@media screen { /* not in print, so a long agreement or invoice still prints on every page */
  html.app-scroll, html.app-scroll body { height: 100%; overflow: hidden; }
  html.app-scroll body { height: 100dvh; overflow-y: auto; overscroll-behavior-y: none; -webkit-overflow-scrolling: touch; }
}
