/* Portal surfaces: auth screens and the dashboard. Extends site.css. */

/* ---- auth ---- */
.authwrap{min-height:calc(100vh - 62px);display:flex;align-items:center;justify-content:center;padding:48px 24px}
.authcard{width:100%;max-width:428px;background:linear-gradient(180deg,var(--panel),var(--panel2));
  border:1px solid var(--line);border-radius:16px;padding:34px 32px 30px;
  box-shadow:0 34px 80px -40px rgba(0,0,0,.95)}
.authcard h1{font-size:26px;letter-spacing:-.6px;margin:0 0 8px}
.authcard .sub{margin:0 0 26px;font-size:15px}
.field{margin:0 0 16px}
.field label{display:block;font-size:12px;letter-spacing:.7px;text-transform:uppercase;color:var(--dim2);
  margin:0 0 7px;font-weight:600}
.field input{width:100%;background:#050a12;border:1px solid var(--line2);color:var(--txt);border-radius:9px;
  padding:12px 13px;font-size:15px;font-family:inherit;transition:.15s}
.field input:focus{outline:none;border-color:var(--teal);box-shadow:0 0 0 3px rgba(110,231,208,.12)}
.field .help{font-size:12.5px;color:var(--dim2);margin-top:6px}
.btn.full{width:100%;justify-content:center}
.formmsg{display:none;border-radius:9px;padding:11px 14px;font-size:14px;margin:0 0 18px;line-height:1.55}
.formmsg.show{display:block}
.formmsg.err{background:rgba(255,107,107,.12);border:1px solid rgba(255,107,107,.4);color:#ffc0c0}
.formmsg.ok{background:rgba(61,220,151,.12);border:1px solid rgba(61,220,151,.4);color:#b6f0d4}
.authfoot{margin:22px 0 0;text-align:center;font-size:14.5px;color:var(--dim)}

/* ---- dashboard shell ---- */
.appbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:0 0 26px}
.appbar h1{font-size:25px;margin:0;letter-spacing:-.5px}
.appbar .spacer{flex:1 1 auto}
.who{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--dim)}
.avatar{width:30px;height:30px;border-radius:50%;background:rgba(110,231,208,.16);color:var(--teal);
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex:none}
.rolechip{font-size:10.5px;font-weight:700;letter-spacing:.8px;text-transform:uppercase;padding:3px 8px;
  border-radius:5px;background:rgba(179,157,219,.16);color:#d3c4f0;border:1px solid rgba(179,157,219,.34)}
.btn.sm{padding:8px 14px;font-size:14px;border-radius:8px}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin:0 0 26px;overflow-x:auto}
.tabs button{background:none;border:none;border-bottom:2px solid transparent;color:var(--dim);
  font:inherit;font-size:14.5px;font-weight:550;padding:11px 16px;cursor:pointer;white-space:nowrap}
.tabs button:hover{color:var(--txt)}
.tabs button.on{color:var(--teal);border-bottom-color:var(--teal)}
.panel{display:none}
.panel.on{display:block}

/* ---- key rows ---- */
.keyrow{display:flex;align-items:center;gap:14px;padding:15px 18px;border:1px solid var(--line);
  border-radius:11px;background:var(--panel2);margin:0 0 10px;flex-wrap:wrap}
.keyrow.dead{opacity:.5}
.keymono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13.5px;color:#cfe0f5}
.keymeta{font-size:12.5px;color:var(--dim2);margin-top:3px}
.keyrow .grow{flex:1 1 220px;min-width:0}
.badge{font-size:10.5px;font-weight:700;letter-spacing:.7px;text-transform:uppercase;padding:3px 8px;
  border-radius:5px;flex:none}
.badge.live{background:rgba(61,220,151,.15);color:#8cecc0;border:1px solid rgba(61,220,151,.35)}
.badge.dead{background:rgba(255,107,107,.13);color:#ffb0b0;border:1px solid rgba(255,107,107,.32)}
.btn.danger{border:1px solid rgba(255,107,107,.4);color:#ffb0b0;background:rgba(255,107,107,.08)}
.btn.danger:hover{border-color:var(--red);background:rgba(255,107,107,.16);text-decoration:none}

/* ---- the one-time secret reveal ---- */
.reveal{border:1px solid rgba(61,220,151,.45);background:rgba(61,220,151,.07);border-radius:12px;
  padding:20px 22px;margin:0 0 22px}
.reveal h3{color:var(--green);margin:0 0 6px;font-size:16.5px}
.secretbox{display:flex;align-items:center;gap:10px;margin:14px 0 10px;flex-wrap:wrap}
.secretbox code{flex:1 1 320px;min-width:0;overflow-x:auto;white-space:nowrap;background:#050a12;
  border:1px solid var(--line2);border-radius:9px;padding:12px 14px;font-size:13.5px;color:var(--teal)}

/* ---- charts ---- */
.chartcard{background:var(--panel2);border:1px solid var(--line);border-radius:12px;padding:20px 22px 16px}
.chartcard h3{font-size:15.5px;margin:0 0 4px}
.chartcard .small{margin:0 0 16px}
.bars{display:flex;align-items:flex-end;gap:3px;height:150px;padding:0 0 4px}
.bars .b{flex:1 1 0;min-width:2px;background:linear-gradient(180deg,var(--teal),rgba(110,231,208,.28));
  border-radius:3px 3px 0 0;position:relative;min-height:2px;transition:.15s}
.bars .b.zero{background:rgba(255,255,255,.07)}
.bars .b:hover{filter:brightness(1.25)}
.bars .b span{display:none;position:absolute;bottom:100%;left:50%;transform:translateX(-50%);
  background:#04080f;border:1px solid var(--line2);border-radius:7px;padding:6px 9px;font-size:12px;
  white-space:nowrap;margin-bottom:7px;z-index:5;color:var(--txt)}
.bars .b:hover span{display:block}
.axis{display:flex;justify-content:space-between;font-size:11.5px;color:var(--dim2);margin-top:8px}
.empty{text-align:center;color:var(--dim2);padding:44px 20px;font-size:14.5px;
  border:1px dashed var(--line2);border-radius:12px}
.spinner{display:inline-block;width:15px;height:15px;border:2px solid rgba(255,255,255,.2);
  border-top-color:var(--teal);border-radius:50%;animation:spin .7s linear infinite;vertical-align:-2px}
@keyframes spin{to{transform:rotate(360deg)}}
/* Numeric columns. site.css sets `.tbl th{text-align:left}` at specificity
 * (0,1,1), which silently beat a bare `.right` at (0,1,0) - so every numeric
 * HEADER sat left while its VALUES sat right, up to 124px apart, and you could
 * not tell which column a header belonged to. These selectors outrank it.
 * Keep th and td on the same rule so they can never drift apart again. */
.right{text-align:right}
.tbl th.right,.tbl td.right,
.chartcard .tbl th.right,.chartcard .tbl td.right{text-align:right}
/* Tabular figures on every numeric cell so digits sit in a true column and
 * the decimal points line up down the table. */
.tbl th.right,.tbl td.right{font-variant-numeric:tabular-nums}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
@media(max-width:680px){
  .authcard{padding:26px 22px}
  .keyrow{gap:10px}
}

/* ======================================================================
 * Dashboard polish: a primary stat, a readable chart, denser tables and a
 * footer that belongs to an app rather than to a marketing site.
 * ==================================================================== */

/* ---- tabs: bigger targets, readable when inactive ---- */
.tabs button{font-size:15px;padding:13px 18px;color:#93a9c6}
.tabs button:hover{color:var(--txt)}
.tabs{margin-bottom:24px}

/* ---- the stat row: spend leads, the rest support ---- */
.statgrid{display:grid;gap:16px;grid-template-columns:1.5fr 1fr 1fr 1fr}
.statgrid .stat{padding:18px 20px 16px;display:flex;flex-direction:column;gap:6px}
.statgrid .stat .l{margin:0;font-size:12px;letter-spacing:.9px;text-transform:uppercase;
  color:#9fb4d0;font-weight:600;display:flex;align-items:baseline;gap:8px}
.statgrid .stat .l .win{text-transform:none;letter-spacing:0;font-weight:400;color:var(--dim2);
  font-size:12px}
.statgrid .stat .n{font-size:28px;line-height:1.1}
.stat.hero{background:linear-gradient(145deg,rgba(110,231,208,.08),var(--panel2) 62%);
  border-color:rgba(110,231,208,.3)}
.stat.hero .n{font-size:38px;letter-spacing:-1.4px}
.statfoot{display:flex;align-items:center;gap:10px;font-size:12.5px;color:var(--dim2);
  min-height:19px;flex-wrap:wrap}
.delta{font-size:12px;font-weight:650;padding:2px 7px;border-radius:5px;white-space:nowrap}
.delta.up{background:rgba(255,176,82,.14);color:#ffc98a;border:1px solid rgba(255,176,82,.3)}
.delta.down{background:rgba(61,220,151,.13);color:#8cecc0;border:1px solid rgba(61,220,151,.3)}
.delta.flat{background:rgba(255,255,255,.06);color:#9fb4d0;border:1px solid var(--line2)}

/* ---- chart: a y-axis, a midline, and room sized to the data ---- */
.cardhead{display:flex;align-items:flex-start;gap:16px;margin-bottom:14px;flex-wrap:wrap}
.cardhead>div:first-child{flex:1 1 220px}
.cardhead .small{margin:0}
.seg{display:flex;gap:2px;background:#050a12;border:1px solid var(--line2);border-radius:8px;padding:3px}
.seg button{background:none;border:none;color:var(--dim);font:inherit;font-size:13px;font-weight:600;
  padding:6px 12px;border-radius:6px;cursor:pointer;line-height:1}
.seg button:hover{color:var(--txt)}
.seg button.on{background:rgba(110,231,208,.15);color:var(--teal)}
.plot{display:flex;gap:12px}
.yaxis{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;
  height:132px;font-size:11.5px;color:var(--dim2);font-variant-numeric:tabular-nums;flex:none;
  min-width:46px;padding-bottom:1px}
.bars{height:132px;flex:1 1 auto;padding:0;position:relative;
  background:linear-gradient(to top,var(--line2) 1px,transparent 1px) 0 100%/100% 100% no-repeat,
             linear-gradient(to top,var(--line2) 1px,transparent 1px) 0 50%/100% 50% no-repeat}
.bars .b{border-radius:2px 2px 0 0}
.axis{margin-top:9px;padding-left:58px}
.axis span:nth-child(2){color:var(--teal)}

/* ---- tables: a size you can actually read ---- */
.chartcard .tbl{font-size:14.5px}
.chartcard .tbl th{font-size:11.5px;letter-spacing:1px;color:#c2d3e8;padding:11px 13px}
.chartcard .tbl td{padding:11px 13px}
.chartcard .tblwrap{border:none;background:none}
.chartcard .tbl td.right,.chartcard .tbl th.right{font-variant-numeric:tabular-nums}
.keymeta{font-size:12px}

/* ---- an app footer, not a marketing footer ---- */
footer.appfoot{margin-top:56px;border-top:1px solid var(--line);padding:18px 0}
footer.appfoot .wrap{display:flex;align-items:center;gap:18px;flex-wrap:wrap;font-size:13px;
  color:var(--dim2)}
footer.appfoot .spacer{flex:1 1 auto}
footer.appfoot a{color:var(--dim);text-decoration:none}
footer.appfoot a:hover{color:var(--teal)}

@media(max-width:980px){
  .statgrid{grid-template-columns:1fr 1fr}
  .stat.hero{grid-column:1 / -1}
}
@media(max-width:560px){
  .statgrid{grid-template-columns:1fr}
  .stat.hero .n{font-size:32px}
  .yaxis{min-width:40px}
  .axis{padding-left:52px}
}

/* ---- second pass: hierarchy, chart legibility, no dead space ---- */
.stat.hero .n{font-size:44px}
.statgrid .stat:not(.hero) .n{font-size:26px}
.statgrid .stat:not(.hero) .n.a{color:#c9b98a}   /* amber was shouting louder than spend */
.heroline{font-size:12.5px;color:#93a9c6;margin-top:2px}
.heroline b{color:#cfe0f5;font-weight:650}
.rolechip{margin-left:2px;padding:4px 9px;font-size:11px}

/* chart header reads as a toolbar, aligned with the title */
.cardhead{align-items:center;margin-bottom:18px}
.seg{padding:4px}
.seg button{padding:7px 14px;font-size:13.5px}

/* a real scale: five gridlines, five labels, five date markers */
.plot{gap:14px}
.yaxis,.bars{height:148px}
.yaxis{min-width:56px;font-size:11.5px;color:#93a9c6}
.bars{background:repeating-linear-gradient(to top,
  transparent 0,transparent calc(25% - 1px),var(--line2) calc(25% - 1px),var(--line2) 25%)}
.bars .b{gap:0}
.axis{padding-left:70px;font-size:11.5px;color:#93a9c6}
.axis span{flex:1 1 0;text-align:center}
.axis span:first-child{text-align:left}
.axis span:last-child{text-align:right}
.peaknote{margin:12px 0 0;padding-left:70px;font-size:12.5px;color:#a9bdd6}
.peaknote b{color:var(--teal);font-weight:650}

/* cards size to their content instead of stretching into a void */
.grid.g2{align-items:start}

/* readable secondary text */
.chartcard .small{color:#9db1cb}
.chartcard .tbl td{color:#dbe6f4}
.chartcard .tbl td.right{color:#eef4fb}
footer.appfoot .wrap{color:#8fa4c0;font-size:13.5px}
footer.appfoot{margin-top:40px}

@media(max-width:560px){
  .axis,.peaknote{padding-left:52px}
  .yaxis{min-width:44px}
  .stat.hero .n{font-size:34px}
}

/* ---- third pass: a decisive hero, a filled right column, legible data ---- */
.statgrid{grid-template-columns:1.9fr 1fr 1fr 1fr}
.stat.hero{background:linear-gradient(145deg,rgba(110,231,208,.13),rgba(110,231,208,.04) 48%,var(--panel2));
  border-color:rgba(110,231,208,.42);box-shadow:0 18px 44px -30px rgba(110,231,208,.55)}
.statgrid .stat .l{color:#adc0da}

/* data text should be brighter than the prose around it */
.yaxis,.axis{color:#a9bdd6}
.peaknote{color:#b7c9e0}
.chartcard .tbl td{color:#e3ecf7}
.chartcard .tbl th{color:#cbdaee}
.bars{background:repeating-linear-gradient(to top,
  transparent 0,transparent calc(25% - 1px),#2a3a58 calc(25% - 1px),#2a3a58 25%)}
.bars::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:#3c5178}

/* bottom row: a tall table beside a stacked column, no dead space */
.botgrid{display:grid;gap:18px;grid-template-columns:1fr 1fr;align-items:start}
.botcol{display:flex;flex-direction:column;gap:18px}
.bigkey{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin:0 0 6px}
.bigkey .v{font-size:26px;font-weight:700;letter-spacing:-.8px;color:var(--teal);line-height:1.1}
.bigkey .k{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;color:#cfe0f5}
.keyfacts{display:flex;gap:18px;flex-wrap:wrap;font-size:13px;color:#a9bdd6}
.keyfacts b{color:#e3ecf7;font-weight:650}

@media(max-width:900px){ .botgrid{grid-template-columns:1fr} }

/* ---- final pass: contrast where it carries meaning ---- */
.chartcard .small,.heroline,.statfoot{color:#a5b9d4}
.heroline b{color:#dfeaf7}
.keymeta{color:#a0b4cf}
footer.appfoot a{color:#a5b9d4}
.axis,.yaxis{color:#bacde4;font-size:12px}
.peaknote{color:#c6d6ea;font-size:13px}

/* gridlines recede behind the data */
.bars{background:repeating-linear-gradient(to top,
  transparent 0,transparent calc(25% - 1px),#233149 calc(25% - 1px),#233149 25%)}
.bars::after{background:#33476b}
.bars .b{background:linear-gradient(180deg,#8ef0dc,rgba(110,231,208,.34));min-height:3px}
.bars .b.zero{background:rgba(255,255,255,.055)}

/* busiest key: chips carry more weight than a run-on line */
.keyfacts{gap:10px 12px;margin-top:14px;line-height:1.35}
.keyfacts span{display:inline-flex;align-items:baseline;gap:6px;
  background:rgba(255,255,255,.045);border:1px solid var(--line2);border-radius:9px;
  padding:9px 13px;font-size:12.5px;color:#a5b9d4;white-space:nowrap}
.keyfacts b{color:#eef4fb;font-weight:700}
.bigkey .v{font-size:30px}

/* The "busiest day" note names a value; this makes the reader able to find the
 * bar it refers to without hovering, which a screenshot or printout cannot do. */
.bars .b.peak{background:linear-gradient(180deg,#ffd479,rgba(255,196,92,.42));
  box-shadow:0 0 0 1px rgba(255,212,121,.55)}
.peaknote b{color:#ffd479}

.peaknote i{font-style:normal;color:#dfeaf7;font-weight:650}

/* volume metrics: a rise is just growth, so it must not borrow the amber that
 * means "your bill went up". Neutral chip, arrow still carries the direction. */
.delta.vol{background:rgba(255,255,255,.06);color:#bcd0e8;border:1px solid var(--line2)}

/* upscale-minutes readouts */
.substat{margin-top:7px;font-size:12.5px;color:#a5b9d4;font-weight:600}
.enhtotal{color:#7fe3c4;font-weight:650}


/* The `hidden` attribute is only a UA-stylesheet `display:none`, so ANY class
 * that sets display beats it. `.btn{display:inline-flex}` did exactly that,
 * leaving "Stop polling" on screen before a request had even been sent. Make
 * the attribute authoritative so `hidden` means hidden everywhere. */
[hidden]{display:none!important}

/* ======================================================================
 * Test tab. A form that spends real money deserves to look deliberate:
 * every control is full width and labelled, the routing box states what is
 * about to happen before you press the button, and the timeline is
 * append-only so you can see exactly where a slow job is stuck.
 * ==================================================================== */
.tester{display:flex;flex-direction:column;gap:16px;margin-top:18px}
.tfield{display:flex;flex-direction:column;gap:7px}
.tfield label{font-size:12px;letter-spacing:1.1px;text-transform:uppercase;
  color:#a8bdd8;font-weight:700}
.tfield input,.tfield select,.tfield textarea{width:100%;background:#050a12;
  border:1px solid var(--line2);color:var(--txt);border-radius:9px;
  padding:11px 13px;font-size:14.5px;font-family:inherit}
.tfield textarea{resize:vertical;min-height:72px;line-height:1.5}
.tfield input:focus,.tfield select:focus,.tfield textarea:focus{outline:none;
  border-color:var(--teal);box-shadow:0 0 0 3px rgba(110,231,208,.14)}
.tkeyrow{display:flex;gap:9px;align-items:stretch}
.tkeyrow .grow{flex:1 1 auto;min-width:0}
.tkeyrow .btn{flex:none;align-self:stretch}
.hint{margin:0;font-size:13px;color:#9db2ce;line-height:1.55}
.trow{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}

/* the routing explainer - the whole product in one line */
.routebox{background:rgba(110,231,208,.05);border:1px solid rgba(110,231,208,.22);
  border-radius:11px;padding:14px 15px}
.rsteps{display:flex;align-items:center;gap:11px;flex-wrap:wrap;margin-bottom:7px}
.rstep{font-size:13.5px;color:#cfe0f2;background:rgba(255,255,255,.05);
  border:1px solid var(--line2);border-radius:8px;padding:7px 11px}
.rstep.hl{border-color:rgba(110,231,208,.5);color:#eafaf5;
  background:rgba(110,231,208,.12)}
.rstep b{color:#7fe3c4}
.rarrow{color:var(--teal);font-size:16px}

.tbuttons{display:flex;align-items:center;gap:11px;flex-wrap:wrap}
.tbuttons .spacer{flex:1 1 auto}
/* The running cost of the button you are about to press should not be the
 * quietest thing in the row. */
.tbuttons #t-est{font-size:14px;color:#c6d7ec}
.tbuttons #t-est b{color:#7fe3c4;font-size:15px}
.tbuttons .dim{color:#93a9c6}

/* append-only run log */
.ttimeline{border:1px solid var(--line2);border-radius:11px;background:#050a12;
  max-height:230px;overflow:auto;font-size:13px}
.tstep{display:flex;align-items:baseline;gap:10px;padding:9px 13px;
  border-bottom:1px solid rgba(255,255,255,.05)}
.tstep:last-child{border-bottom:none}
.tdot{width:7px;height:7px;border-radius:50%;background:#7a8ca6;flex:none}
.tstep.go .tdot{background:var(--teal)}
.tstep.ok .tdot{background:#5fd39a}
.tstep.wait .tdot{background:#ffd479}
.tstep.bad .tdot{background:#ff7d7d}
.tlabel{color:#dbe6f4;font-weight:600}
.tstep.bad .tlabel{color:#ffb4b4}
.tdetail{color:#93a9c6;font-size:12.5px;flex:1 1 auto;min-width:0;
  overflow-wrap:anywhere}
.tclock{font-variant-numeric:tabular-nums;font-size:11.5px;
  color:#6d819c;flex:none}

/* result */
.tvideo{width:100%;max-width:640px;border-radius:12px;border:1px solid var(--line2);
  background:#000;display:block;margin-bottom:14px}
.tsummary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}
.tsummary div{background:rgba(255,255,255,.04);border:1px solid var(--line2);
  border-radius:10px;padding:11px 13px}
.tsummary .l{display:block;font-size:11.5px;letter-spacing:.8px;
  text-transform:uppercase;color:var(--dim2);margin-bottom:4px}
.tsummary b{font-size:16px;color:#eef4fb}
.terr{background:rgba(255,125,125,.08);border:1px solid rgba(255,125,125,.35);
  border-radius:11px;padding:14px 15px;color:#ffd0d0}
.terr b{color:#ff9d9d;display:block;margin-bottom:5px}
.terr p{margin:0;font-size:13px;color:#e8c4c4;overflow-wrap:anywhere}

.traw summary{cursor:pointer;font-size:13.5px;color:var(--dim);padding:7px 0}
.traw summary:hover{color:var(--teal)}
.traw pre{background:#050a12;border:1px solid var(--line2);border-radius:10px;
  padding:14px;overflow-x:auto;font-size:12.5px;line-height:1.65;color:#cfe0f2;
  white-space:pre;margin:6px 0 0}

@media(max-width:760px){
  .trow{grid-template-columns:1fr}
  .tsummary{grid-template-columns:repeat(2,1fr)}
}
