/* Styles for the signed-in app pages. Shares the design tokens with the marketing site. */
:root{
  --ground:#FBFBFD; --surface:#FFFFFF; --surface-2:#F4F5F8;
  --ink:#12141A; --ink-2:#3D434F; --muted:#697082;
  --line:#E3E6EC; --line-strong:#CFD4DE;
  --accent:#0A7A57; --accent-ink:#065F44; --accent-wash:#E6F4EF;
  --danger:#B3261E; --danger-wash:#FBEAE9;
  --shadow:0 1px 2px rgba(18,20,26,.05), 0 8px 24px -12px rgba(18,20,26,.14);
  --f-display:"Manrope","Helvetica Neue",Arial,sans-serif;
  --f-body:"Instrument Sans","Helvetica Neue",Arial,sans-serif;
  --f-mono:"JetBrains Mono","SF Mono",Menlo,monospace;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --ground:#0C0E12; --surface:#14171D; --surface-2:#1A1E25;
  --ink:#F0F2F6; --ink-2:#C2C8D2; --muted:#98A0AE;
  --line:#232830; --line-strong:#333A45;
  --accent:#34D399; --accent-ink:#6EE7B7; --accent-wash:#10281F;
  --danger:#F2837C; --danger-wash:#2C1615;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
}}
:root[data-theme="dark"]{
  --ground:#0C0E12; --surface:#14171D; --surface-2:#1A1E25;
  --ink:#F0F2F6; --ink-2:#C2C8D2; --muted:#98A0AE;
  --line:#232830; --line-strong:#333A45;
  --accent:#34D399; --accent-ink:#6EE7B7; --accent-wash:#10281F;
  --danger:#F2837C; --danger-wash:#2C1615;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
}
*{box-sizing:border-box}
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--f-body);
  font-size:16px;line-height:1.6;-webkit-font-smoothing:antialiased}
h1,h2,h3{font-family:var(--f-display);margin:0;letter-spacing:-.022em;line-height:1.15;text-wrap:balance}
p{margin:0}
a{color:var(--ink)}
.wrap{max-width:1120px;margin:0 auto;padding:0 24px}
.eyebrow{font-family:var(--f-mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.mono{font-family:var(--f-mono);font-variant-numeric:tabular-nums}

/* nav */
.nav{border-bottom:1px solid var(--line);background:var(--ground);position:sticky;top:0;z-index:20}
.nav-in{display:flex;align-items:center;gap:28px;min-height:64px;flex-wrap:wrap;
  /* Top and bottom only. "padding:8px 0" would also reset the 24px side padding
     that .wrap provides, pushing the nav against the screen edge. */
  padding-top:8px;padding-bottom:8px}
.brand{display:flex;align-items:center;gap:9px;font-family:var(--f-display);font-weight:800;
  font-size:17px;letter-spacing:-.02em;text-decoration:none;color:var(--ink)}
.mark{width:22px;height:22px;border-radius:6px;background:var(--ink);display:grid;place-items:center;flex:none}
.mark span{display:block;width:9px;height:9px;border-radius:2px;border:2px solid var(--ground);
  border-right-color:transparent;border-bottom-color:transparent;transform:rotate(45deg) translate(1px,1px)}
/* The nav items are wider than the bar: .nav-in caps at 1120px, but the links
   alone need 793px. overflow-x:auto was tried and silently clipped the last two
   items - invisible and no error, which is worse than ugly. Wrapping instead:
   anything that does not fit drops to a second line and stays reachable.
   nowrap keeps "API tokens" from breaking mid-phrase. */
/* Two fixed rows: identity and sign-out above, navigation below. The alternative
   is pixel-tuning - there are 10 nav items (11 with a dedicated machine), needing
   1121px in a 1072px bar. Tuning it to just fit breaks on the next item added,
   and it breaks by silently clipping the last few. */
.nav-links{display:flex;gap:20px;flex-wrap:wrap;order:3;width:100%}
.nav-links a{font-size:14.5px;color:var(--ink-2);text-decoration:none;white-space:nowrap}
.nav-links a:hover,.nav-links a.on{color:var(--ink)}
.nav-right{margin-left:auto;display:flex;align-items:center;gap:14px}
.nav-email{font-size:13.5px;color:var(--muted)}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 20px;
  border-radius:10px;font-family:var(--f-body);font-size:14.5px;font-weight:600;text-decoration:none;
  border:1px solid transparent;cursor:pointer;white-space:nowrap}
.btn-primary{background:var(--ink);color:var(--ground)}
.btn-primary:hover{opacity:.88}
.btn-ghost{border-color:var(--line-strong);color:var(--ink);background:var(--surface)}
.btn-ghost:hover{border-color:var(--muted)}
.btn-danger{border-color:var(--line-strong);color:var(--danger);background:var(--surface)}
.btn-danger:hover{border-color:var(--danger)}
.btn-sm{height:34px;padding:0 13px;font-size:13.5px;border-radius:8px}
.btn-block{width:100%}

/* forms */
label{display:block;font-size:13.5px;font-weight:500;color:var(--ink-2);margin-bottom:7px}
input[type=text],input[type=email],input[type=password],input[type=number],input:not([type]),select,textarea{
  width:100%;height:46px;padding:0 14px;border:1px solid var(--line-strong);border-radius:10px;
  background:var(--surface);color:var(--ink);font-family:var(--f-body);font-size:15px}
textarea{height:auto;min-height:96px;padding:12px 14px;line-height:1.5;resize:vertical}
input:focus,select:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:transparent}
.field{margin-bottom:18px}
.hint{margin-top:7px;font-size:13px;color:var(--muted)}
.code-input{font-family:var(--f-mono);font-size:22px;letter-spacing:.3em;text-align:center}

/* auth card */
.auth{min-height:calc(100vh - 64px);display:grid;place-items:center;padding:48px 24px}
.card{width:100%;max-width:436px;background:var(--surface);border:1px solid var(--line);
  border-radius:16px;padding:34px;box-shadow:var(--shadow)}
.card h1{font-size:25px;font-weight:800}
.card .sub{margin-top:10px;margin-bottom:26px;font-size:15px;color:var(--muted)}
.alt{margin-top:22px;padding-top:20px;border-top:1px solid var(--line);font-size:14.5px;color:var(--muted);text-align:center}
.alt a{color:var(--ink);text-decoration:underline;text-underline-offset:3px}

/* flash */
.flash{display:flex;gap:10px;padding:12px 15px;border-radius:10px;font-size:14.5px;margin-bottom:20px;line-height:1.45}
.flash-error{background:var(--danger-wash);color:var(--danger);border:1px solid color-mix(in srgb,var(--danger) 28%,transparent)}
.flash-ok{background:var(--accent-wash);color:var(--accent-ink);border:1px solid color-mix(in srgb,var(--accent) 28%,transparent)}

/* app pages */
.page{padding:44px 0 80px}
.page-head{margin-bottom:32px}
.page-head h1{font-size:29px;font-weight:800}
.page-head p{margin-top:10px;color:var(--muted)}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:14px;margin-bottom:20px;overflow:hidden}
.panel-head{padding:20px 24px;border-bottom:1px solid var(--line);display:flex;
  justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.panel-head h2{font-size:17px;font-weight:700}
.panel-head p{margin-top:5px;font-size:14px;color:var(--muted)}
.panel-body{padding:24px}
.panel-body.tight{padding:0}

table{width:100%;border-collapse:collapse}
th{text-align:left;font-family:var(--f-mono);font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;
  color:var(--muted);font-weight:400;padding:12px 24px;border-bottom:1px solid var(--line)}
td{padding:15px 24px;border-bottom:1px solid var(--line);font-size:14.5px;vertical-align:middle}
tr:last-child td{border-bottom:0}
.empty{padding:34px 24px;text-align:center;color:var(--muted);font-size:14.5px}

.tag{display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:6px;
  font-family:var(--f-mono);font-size:11px;letter-spacing:.04em;border:1px solid var(--line-strong);color:var(--ink-2)}
.tag-active{background:var(--accent-wash);color:var(--accent-ink);border-color:transparent}
.tag-off{color:var(--muted)}

/* The hidden attribute is implemented as display:none, so any display rule in a
   stylesheet overrides it - .grid2{display:grid} left two fields on the secrets
   page permanently visible that were meant to be hidden. This high-specificity
   rule closes that off for good: hidden always hides, whatever else is set. */
[hidden]{display:none!important}

.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:20px}
.reveal{background:var(--surface-2);border:1px dashed var(--line-strong);border-radius:10px;
  padding:16px;font-family:var(--f-mono);font-size:13.5px;word-break:break-all;line-height:1.6}
.qr{background:#fff;padding:14px;border-radius:12px;width:190px;height:190px;display:grid;place-items:center;border:1px solid var(--line)}
.qr svg{width:100%;height:100%;display:block}

footer{border-top:1px solid var(--line);padding:28px 0;font-size:12.5px;color:var(--muted)}
footer p+p{margin-top:8px}

@media (max-width:760px){
  /* Wide tables scroll inside their own box on phones instead of widening
     the page. Desktop layout is left exactly as it was - display:block on a
     table changes how columns are sized, and the pricing comparison table is
     the one that would show it. */
  table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  table thead,table tbody{display:table;width:100%;}

  .grid2{grid-template-columns:1fr}
  /* This used to hide the nav entirely on narrow screens. The signed-in footer has
     only a copyright line and no links, so hiding it left phone users with no
     navigation at all - they could see one page and had to type URLs to go
     anywhere else. Checking a build from a phone after a push is one of the most
     common things people do. Horizontal scrolling instead: every link stays one
     tap away and it costs no vertical space. */
  /* Give the links their own full-width row on phones. Sharing the first row with
     the email address and Sign out squeezes them to a few dozen pixels, and a strip
     that narrow is unusable even though it scrolls. */
  .nav-in{gap:12px}
  .nav-links{gap:18px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .nav-links::-webkit-scrollbar{width:0;height:0}
  /* The email address takes half a row on a phone and is not tappable. Hide it;
     keep Sign out. */
  .nav-email{display:none}
  th,td{padding-left:16px;padding-right:16px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
a:focus-visible,.btn:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

/* Billing page */
.bal-row{display:grid;grid-template-columns:repeat(3,1fr);gap:28px}
.bal-cell{display:flex;flex-direction:column;gap:6px}
.bal-k{font-family:var(--f-mono);font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.bal-v{font-family:var(--f-display);font-size:30px;font-weight:700;letter-spacing:-.02em;line-height:1.1}
.bal-lead{font-family:var(--f-display);font-size:30px;font-weight:700;letter-spacing:-.02em}
.meter{height:5px;border-radius:3px;background:var(--surface-2);overflow:hidden;margin-top:2px}
.meter span{display:block;height:100%;background:var(--accent);border-radius:3px}
.mono-sm{font-family:var(--f-mono);font-size:12.5px;color:var(--ink-2);white-space:nowrap}
@media(max-width:720px){.bal-row{grid-template-columns:1fr;gap:20px}}
.buy-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px}
.buy{display:flex;flex-direction:column;gap:6px;padding:20px;border:1px solid var(--line);
  border-radius:12px;background:var(--surface-2)}
.buy-name{font-family:var(--f-display);font-weight:700;font-size:15px}
.buy-price{font-family:var(--f-display);font-weight:800;font-size:26px;letter-spacing:-.02em}
.buy-price small{font-family:var(--f-body);font-size:13px;font-weight:500;color:var(--muted)}
.buy .btn{margin-top:12px;justify-content:center}
.buy .hint{min-height:3.2em}
