/* The hosted front door: sign-up, sign-in, password reset and the dashboard.
   Tokens and faces come from /landing/fonts.css (DESIGN.md): off-white paper, white sheets,
   charcoal ink, one terracotta signal, pill buttons, 38px inputs with the label above. */

* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
::selection { background: var(--signal-soft); color: var(--ink); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 0.86em; }
.kicker { font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 12px; }

/* Buttons: primary solid ink, ghost white with a rule border, pill. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 120ms ease-out, filter 120ms ease-out; }
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: var(--sheet); color: var(--ink); border-color: var(--rule-2); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; height: 44px; font-size: 15px; }
.btn.danger { color: var(--err); }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--ink); }

/* Sheets: white on paper, 1px rule, no shadow. */
.sheet { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; }

/* Top bar. */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 44px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 19px/1 var(--display); letter-spacing: -0.02em; }
.brand svg { width: 26px; height: 26px; }
.brand svg .s1 { fill: var(--signal); }
.brand svg .s2 { fill: var(--ink); }
.bar .right { display: flex; align-items: center; gap: 10px; }
.bar .who { font-size: 13px; color: var(--ink-2); max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Forms: label above, 38px inputs (42px on the auth pages), focus ring in `focus`. */
.form { display: grid; gap: 14px; }
.form label, .form .field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form .label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.form input { height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--sheet); outline: none; width: 100%; font-size: 15px; font-weight: 400; color: var(--ink); }
.form input::placeholder { color: var(--muted); }
.form input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.form input[readonly] { background: var(--sheet-2); color: var(--ink-2); }
.form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.form .note { font-size: 13px; color: var(--muted); }
.form .note a, .form label.terms a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* "I agree to the Terms": a box beside its line, not a field under a label. */
.form label.terms { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--ink-2); }
.form label.terms input, .auth-panel .form label.terms input { width: 16px; height: 16px; padding: 0; margin: 0; flex: none; accent-color: var(--ink); }
.form label.terms a { color: var(--ink); }
/* The human check (Turnstile) shows only when it has to ask. */
.captcha:empty { display: none; }
.error { font-size: 13px; color: var(--err); background: var(--err-soft); border-radius: 8px; padding: 8px 12px; }
.notice { font-size: 13px; color: var(--ok); background: var(--ok-soft); border-radius: 8px; padding: 8px 12px; }
@media (max-width: 520px) { .form .pair { grid-template-columns: 1fr; } }

.btn.google { gap: 10px; }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 12px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.auth-panel .lead { margin: -16px 0 22px; color: var(--ink-2); }

/* Tips ride the text they explain (no "?" buttons): a dotted underline and a charcoal bubble on hover and focus. */
.tip { display: none; }
.has-tip { position: relative; cursor: help; text-decoration: underline dotted transparent; text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: text-decoration-color 120ms ease-out; }
.has-tip:hover, .has-tip:focus-visible { text-decoration-color: var(--rule-2); }
/* The bubble exists only while it shows: a hidden one still took room, so a tip near the right edge made a phone page scroll sideways. */
.has-tip::after { position: absolute; left: 0; bottom: calc(100% + 8px); width: max-content; max-width: min(36ch, calc(100vw - 32px)); padding: 8px 10px; border-radius: 8px; background: var(--ink); color: #fff; font: 400 13px/1.45 var(--body); letter-spacing: 0; text-transform: none; text-align: left; white-space: normal; pointer-events: none; z-index: 30; }
/* Hover waits 0.8 s, so a pointer passing by shows nothing; keyboard focus shows it at once. */
.has-tip:hover::after { content: attr(data-tip); animation: tip-in 120ms ease-out 800ms both; }
.has-tip:focus-visible::after { content: attr(data-tip); animation: tip-in 120ms ease-out; }
@keyframes tip-in { from { opacity: 0; } }
/* A card's status tip sits at its right edge: its bubble opens to the left, on screen. */
.status-row .has-tip::after { left: auto; right: 0; }

/* ---------- auth pages: the form on the left, a live example ad on the right ---------- */
.auth { display: grid; grid-template-rows: auto 1fr; }
.auth-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding: 8px 44px 44px; }
.auth-panel { align-self: center; justify-self: center; width: min(100%, 440px); padding: 24px 0; }
.auth-panel h1 { font: 650 clamp(32px, 4vw, 44px)/1.04 var(--display); letter-spacing: -0.03em; margin-bottom: 28px; }
.auth-panel .form input { height: 42px; }
.auth-panel .switch { margin-top: 22px; font-size: 14px; color: var(--ink-2); }
.auth-panel .switch a { font-weight: 600; color: var(--ink); text-underline-offset: 3px; }
.auth-panel .done { display: grid; gap: 14px; }
.auth-panel .done > .note { font-size: 14px; color: var(--ink-2); }
.auth-panel .done > .note:empty { display: none; }
.auth-visual { position: relative; display: grid; place-items: center; border-radius: var(--radius-lg); background: var(--sheet-2); border: 1px solid var(--rule); overflow: hidden; min-height: 560px; }
.auth-visual .stage { position: relative; width: min(64%, 300px); }
.auth-visual .frame { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--sheet); }
.auth-visual .frame > * { display: block; width: 100%; }
.auth-visual .side { position: absolute; width: 46%; right: -34%; bottom: 10%; }
.auth-visual .side.left { right: auto; left: -30%; top: 8%; bottom: auto; width: 40%; }
.auth-visual .stage.intro { width: min(72%, 340px, calc((100vh - 200px) * 9 / 16)); }
.auth-visual .intro video { aspect-ratio: 9 / 16; height: auto; object-fit: cover; cursor: pointer; }
.auth-visual .intro .sound { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgb(20 22 27 / 0.72); color: #fff; cursor: pointer; backdrop-filter: blur(6px); transition: background 120ms ease-out; }
.auth-visual .intro .sound:hover { background: rgb(20 22 27 / 0.9); }
.auth-visual .intro .sound:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.auth-visual .intro .sound svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-visual .intro .sound svg path:first-child { fill: currentColor; }
.auth-visual .tag { display: block; margin-top: 8px; font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center; }
@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr; padding: 0 16px 32px; }
  .auth-visual { display: none; }
  .auth-panel { align-self: start; padding-top: 32px; }
  .bar { padding: 12px 16px; }
}

/* ---------- dashboard ---------- */
.dash { max-width: 1080px; margin: 0 auto; padding: 16px 44px 64px; display: grid; gap: 28px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { font: 650 clamp(30px, 3.4vw, 42px)/1.04 var(--display); letter-spacing: -0.03em; }
.section-title { display: flex; align-items: center; gap: 8px; font: 600 15px/1.3 var(--body); margin-bottom: 12px; }
.companies { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.company { display: grid; align-content: start; }
.company { gap: 16px; }
.company-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.status-row { display: inline-flex; align-items: center; gap: 6px; }
.company-name { display: grid; gap: 4px; min-width: 0; }
.company-name h2 { font: 650 22px/1.15 var(--display); letter-spacing: -0.02em; overflow-wrap: break-word; }
.company-name .site { font: 500 12px/1.4 var(--mono); color: var(--muted); text-decoration: none; overflow-wrap: break-word; justify-self: start; }
.company-name a.site:hover { color: var(--ink); text-decoration: underline; }
.plate { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--hl, var(--hl-teal)); font: 700 17px/1 var(--display); color: var(--ink); }

/* Status: a dot plus the word, never color alone. */
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 600 12px/1 var(--body); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.status.requested { background: var(--warn-soft); color: var(--warn); }
.status.onboarding { background: var(--signal-soft); color: var(--signal-text); }
.status.ready { background: var(--ok-soft); color: var(--ok); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps li { display: grid; gap: 8px; font-size: 12.5px; color: var(--muted); }
.steps li::before { content: ""; height: 4px; border-radius: 999px; background: var(--rule); }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--ink); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::before { background: linear-gradient(90deg, var(--signal) 50%, var(--rule) 50%); }
/* A company's stats (statsBlock in app.js): two by two on a soft panel, values on one line per row. */
.stats { padding: 12px 14px; border-radius: var(--radius); background: var(--sheet-2); border: 1px solid var(--rule); }
.stats dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: start; }
.stats .stat { display: grid; gap: 2px; min-width: 0; }
.stats dt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font: 650 18px/1.25 var(--display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stats dd small { font: 400 12px/1 var(--body); color: var(--muted); letter-spacing: 0; }
.stats .meter { display: block; height: 4px; margin-top: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--ink) var(--fill, 0%), var(--rule) var(--fill, 0%)); }
.stats .meter.full { background: linear-gradient(90deg, var(--signal) var(--fill, 0%), var(--rule) var(--fill, 0%)); }

.company-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--rule); }
.members { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.faces { display: flex; }
.faces i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; border: 2px solid var(--sheet); background: var(--hl, var(--hl-blue)); font: 600 11px/1 var(--body); font-style: normal; color: var(--ink); margin-left: -6px; }
.faces i:first-child { margin-left: 0; }
.company-foot .actions { display: flex; gap: 6px; }

.add-card { display: grid; place-items: center; align-content: center; gap: 10px; min-height: 220px; border: 1px dashed var(--rule-2); border-radius: var(--radius); background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 600; font-size: 14px; transition: border-color 120ms ease-out, color 120ms ease-out; }
.add-card:hover { border-color: var(--ink); color: var(--ink); }
.add-card svg { width: 22px; height: 22px; }
.empty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.empty h2 { font: 650 26px/1.1 var(--display); letter-spacing: -0.02em; margin-bottom: 8px; }
.empty p { color: var(--ink-2); }
@media (max-width: 760px) { .empty { grid-template-columns: 1fr; } }

.waitlist { display: grid; gap: 0; }
.waitlist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.waitlist-row div { display: grid; gap: 2px; min-width: 0; }
.waitlist-row b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waitlist-row span { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waitlist-row .when { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.waitlist-add { margin-top: 16px; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.section-title .count:empty { display: none; }
.section-title .count { font: 500 12px/1 var(--mono); color: var(--muted); }
.account { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.account .fact { display: grid; gap: 4px; min-width: 0; }
.account .fact span { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.account .fact b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .fact .linkish { justify-self: start; }
@media (max-width: 760px) { .account { grid-template-columns: 1fr; } }

/* Skeleton while the dashboard loads: the same shapes as the cards. */
.skeleton { background: linear-gradient(90deg, var(--sheet) 0%, var(--sheet-2) 50%, var(--sheet) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border: 1px solid var(--rule); border-radius: var(--radius); min-height: 220px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

@media (max-width: 760px) { .dash { padding: 8px 16px 48px; } }
/* A link into the studio skips the dashboard (opening.js): only this line shows until the studio opens. */
.opening-note { display: none; }
html.opening .dash { display: none; }
html.opening .opening-note { display: block; margin: 22vh auto 0; padding: 0 16px; text-align: center; color: var(--muted); font-size: 15px; }

/* Dialogs. */
.dialog { border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 24px; width: min(calc(100vw - 32px), 560px); background: var(--sheet); color: var(--ink); box-shadow: 0 12px 32px rgba(10, 11, 14, 0.18); }
.dialog::backdrop { background: rgba(10, 11, 14, 0.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.dialog-head h2 { font: 650 22px/1.1 var(--display); letter-spacing: -0.02em; }
.close { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--sheet); font-size: 18px; line-height: 1; cursor: pointer; }
.dialog .row { justify-content: flex-end; }

/* 404. */
.lost { display: grid; place-items: center; text-align: center; gap: 16px; padding: 80px 16px; }
.lost h1 { font: 650 clamp(32px, 4vw, 48px)/1.04 var(--display); letter-spacing: -0.03em; }

/* Docs (/docs): one readable column. */
.doc { max-width: 720px; margin: 0 auto; padding: 24px 24px 80px; display: grid; gap: 28px; }
.doc h1 { font: 650 clamp(30px, 3.4vw, 42px)/1.04 var(--display); letter-spacing: -0.03em; }
.doc .lead { color: var(--ink-2); font-size: 17px; margin-top: -12px; }
.doc section { display: grid; gap: 10px; }
.doc h2 { font: 600 19px/1.3 var(--body); }
.doc ol, .doc ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.doc code { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
.doc pre { margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
@media (max-width: 600px) { .doc { padding: 16px 16px 64px; } }

/* /pricing (wiki/billing.md) */
.doc.pricing { max-width: 1040px; }
.pricing .segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--rule); justify-self: start; }
.pricing .seg { border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.pricing .seg[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.price-plan, .price-pack, .price-enterprise { border: 1px solid var(--rule); border-radius: 16px; background: var(--sheet); padding: 20px; display: grid; gap: 8px; align-content: start; }
.price-num { font: 650 32px/1.05 var(--display); letter-spacing: -0.03em; margin: 0; }
.price-num small { font: 400 14px/1 var(--body); color: var(--muted); letter-spacing: 0; }
.price-limits { list-style: none; padding: 0 !important; }
.price-limits li::before { content: "✓ "; color: var(--ink-2); }
.price-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.price-rates { border-collapse: collapse; width: 100%; max-width: 640px; }
.price-rates th, .price-rates td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.price-rates td:last-child, .price-rates th:last-child { text-align: right; white-space: nowrap; }
