/* ping.css — Carino Ping. Fleet design tokens: single gold accent on near
   black, IBM Plex Sans/Mono, Red Hat Display for the brand. Green reads "good
   line", red reads "loss" — the Data Viz convention, not decoration.

   Replaces the Tailwind play CDN the previous version loaded on every page
   view. That script compiles a stylesheet in the browser on every load, warns
   in the console that it is not for production, and put a Google Fonts @import
   in the page — three things the fleet conventions each rule out on their own.

   SHAPE: this is a fixed-viewport app, not a document. The page itself never
   scrolls — `body` is exactly the viewport tall with overflow hidden, the navbar
   takes its 60px, and `.app` takes the rest. Anything that can outgrow its box
   (the target cards, the sample log) scrolls inside its own pane, and the long
   prose lives in a dialog rather than below the fold. */

:root{
  /* Fleet tokens come from carino-ui.css; these are Ping's own additions. */
  --accent-hi:#fbbf24;
  --border-hi:#3a3a3a;
  --gap:10px;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}

/* 100dvh, not 100vh: on mobile Safari and Chrome the visual viewport shrinks
   when the URL bar is showing, and 100vh is the *larger* of the two — which is
   exactly how a "no scroll" layout ends up scrolling by 60px on a phone. */
html,body{height:100%;}
body{background:var(--bg);color:var(--text);font-family:var(--sans);
  height:100dvh;overflow:hidden;display:flex;flex-direction:column;}

a{color:var(--accent);}
code{font-family:var(--mono);font-size:.92em;color:var(--accent-hi);}
.num{font-variant-numeric:tabular-nums;}
.muted{color:var(--text-muted);}
.small{font-size:.72rem;line-height:1.55;}
.accent{color:var(--accent);}
.spacer{flex:1;}

::-webkit-scrollbar{width:8px;height:8px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:#333;border-radius:4px;}
::-webkit-scrollbar-thumb:hover{background:var(--accent);}

/* ---- the shell ----
   .app is the only flex child that grows, and min-height:0 is what lets it
   actually shrink below its content instead of pushing the page taller. */
.app{flex:1;min-height:0;display:flex;flex-direction:column;gap:var(--gap);
  padding:var(--gap) 16px 8px;max-width:1800px;width:100%;margin:0 auto;}

/* ---- app controls, relocated into the navbar ---- */
.cs-header{display:none;}
.cs-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:32px;min-width:32px;padding:0 10px;
  background:transparent;border:1px solid var(--border);border-radius:5px;color:var(--text-sec);
  font-family:var(--mono);font-size:.72rem;cursor:pointer;transition:.15s;white-space:nowrap;}
.cs-btn:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-faint);}
.cs-btn.active{border-color:var(--accent);color:var(--accent);background:var(--accent-faint);}
.cs-btn:disabled{opacity:.45;cursor:not-allowed;}
/* Filled gold comes from carino-ui.css's .cs-btn.primary; running turns it red. */
.cs-btn.primary{min-width:74px;}
.cs-btn.primary.running{background:var(--err);border-color:var(--err);color:#050505;}
.cs-btn.primary.running:hover{background:#f87171;border-color:#f87171;color:#050505;}
.cs-btn.tiny{height:24px;font-size:.62rem;padding:0 8px;min-width:0;}
.cs-select{padding:0 6px;}
select.cs-select{-webkit-appearance:none;appearance:none;}
.seg{display:inline-flex;border:1px solid var(--border);border-radius:5px;overflow:hidden;}
.seg .seg-btn{border:none;border-radius:0;height:30px;}
.seg .seg-btn+.seg-btn{border-left:1px solid var(--border);}

/* ---- target strip ---- */
.strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;flex-shrink:0;
  border:1px solid var(--border);border-radius:8px;background:var(--bg-card);padding:9px 12px;}
.slabel{font-family:var(--mono);font-size:.6rem;letter-spacing:.09em;text-transform:uppercase;
  color:var(--text-muted);flex-shrink:0;}
.input{height:32px;padding:0 10px;background:#000;border:1px solid var(--border);border-radius:5px;color:var(--text);
  font-family:var(--mono);font-size:.76rem;transition:.15s;min-width:0;}
.input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-faint);}
.input:disabled{opacity:.5;}
.input::placeholder{color:#4a4a4a;}
.input.sm{height:26px;font-size:.68rem;width:150px;}
.strip .grow{flex:4 1 260px;}
.strip .path{flex:1 1 130px;max-width:190px;}
.opt{display:flex;align-items:center;gap:7px;font-size:.68rem;color:var(--text-muted);cursor:pointer;flex-shrink:0;}
.opt input{accent-color:var(--accent);flex-shrink:0;}

.notice{flex-shrink:0;padding:7px 11px;border-radius:5px;font-size:.73rem;line-height:1.5;border:1px solid;}
.notice[hidden]{display:none;}
.notice.warn{color:var(--accent-hi);border-color:var(--accent-dim);background:var(--accent-faint);}
.notice.err{color:#fca5a5;border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.07);}

/* ---- connection fields ----
   The strip these lived in is gone. The readouts moved into the Method dialog,
   where the prose that explains what they mean already is; only the client id
   stayed on screen, at the end of the targets row. */
.cfield{display:flex;align-items:baseline;gap:6px;min-width:0;font-family:var(--mono);font-size:.68rem;}
.cfield i{font-style:normal;font-size:.55rem;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted);}
.cfield b{color:var(--accent);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:22ch;}
/* The client id ends the targets row and must not shove the inputs about: it
   never grows, never wraps, and is pushed to the far edge. */
.cfield.idtag{flex:0 0 auto;margin-left:auto;}
/* The readouts the strip used to hold, now inside the dialog. */
.connrow{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:10px 0 14px;}
/* The reverse-resolved host is the one field worth reading in full — it names
   the ISP and often the access technology — so it gets the room the others do
   not need. The full value is in the title either way. */
#connHost{max-width:38ch;}

/* ---- headline tiles ---- */
.tiles{flex-shrink:0;display:grid;grid-template-columns:repeat(7,1fr);gap:var(--gap);}
.stat-tile{border:1px solid var(--border);border-radius:7px;background:var(--bg-card);padding:8px 12px;
  display:flex;flex-direction:column;gap:1px;min-width:0;}
.stat-tile .st-label{font-family:var(--mono);font-size:.57rem;letter-spacing:.09em;text-transform:uppercase;color:var(--text-muted);}
.stat-tile .st-value{font-family:var(--mono);font-size:1.16rem;font-weight:700;line-height:1.25;white-space:nowrap;}
.stat-tile .st-sub{font-size:.58rem;color:var(--text-muted);line-height:1.3;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.stat-tile.warn{border-color:var(--accent-dim);}
.stat-tile.warn .st-value{color:var(--accent-hi);}
.stat-tile.bad{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.05);}
.stat-tile.bad .st-value{color:var(--err);}

/* The verdict is a navbar badge now, not a bar across the page. It names the
   conclusion in one or two words and carries the full sentence in its tooltip,
   which is also what the report prints. Prefixed with `body` for the same
   reason the other navbar rules are: carino-navbar.js injects its stylesheet
   after this file, so equal weight loses on source order. */
.verdict-badge{font-family:var(--mono);font-size:.6rem;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;white-space:nowrap;border:1px solid var(--border);border-radius:4px;
  padding:3px 7px;color:var(--text-muted);cursor:help;transition:.15s;}
.verdict-badge[data-key="good"]{color:var(--ok);border-color:rgba(34,197,94,.45);background:rgba(34,197,94,.09);}
.verdict-badge[data-key="ok"]{color:var(--text-sec);border-color:var(--border-hi);}
.verdict-badge[data-key="warn"]{color:var(--accent-hi);border-color:var(--accent-dim);background:var(--accent-faint);}
.verdict-badge[data-key="bad"]{color:#fca5a5;border-color:rgba(239,68,68,.5);background:rgba(239,68,68,.09);}

/* ---- the growing area ---- */
.grid{flex:1;min-height:0;display:grid;grid-template-columns:minmax(280px,340px) 1fr;gap:var(--gap);}
.rightcol{min-width:0;min-height:0;display:flex;flex-direction:column;gap:var(--gap);}
.panel{border:1px solid var(--border);border-radius:8px;background:var(--bg-card);}
.pane{display:flex;flex-direction:column;min-height:0;overflow:hidden;}
.pane-head{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:9px 12px;border-bottom:1px solid var(--border);}
.pane-head h2{font-family:var(--display);font-size:.82rem;font-weight:700;white-space:nowrap;}
.pane-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;}
.chartpane{flex:2 1 0;min-height:150px;}
.logpane{flex:3 1 0;min-height:130px;}

/* ---- per-target cards ---- */
/* The cards are a bare column in the grid now — no panel, no heading. They
   carry their own scroll (the .pane-body that used to do it went with the
   chrome) and no frame of their own: every card already has one, and a border
   around a list of bordered things is just a second line. */
.cards{min-height:0;overflow-y:auto;overflow-x:hidden;padding:0 2px 2px 0;
  display:flex;flex-direction:column;gap:10px;}
.cards>.muted{font-size:.75rem;line-height:1.5;padding:4px 2px;}
.tcard{border:1px solid var(--border);border-radius:7px;background:var(--bg-elev);padding:10px 11px;
  display:flex;flex-direction:column;gap:8px;min-width:0;flex-shrink:0;}
.tcard header{display:flex;align-items:center;gap:7px;min-width:0;}
.tcard .tdot{width:8px;height:8px;border-radius:50%;flex-shrink:0;}
.tcard .tname{font-family:var(--mono);font-size:.76rem;font-weight:600;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;}
.chip{font-family:var(--mono);font-size:.53rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--text-muted);border:1px solid var(--border);border-radius:4px;padding:2px 5px;flex-shrink:0;cursor:help;}
.chip.good{color:var(--ok);border-color:rgba(34,197,94,.4);}
.tgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px 9px;}
.tgrid div{display:flex;flex-direction:column;gap:0;min-width:0;}
.tgrid label{font-family:var(--mono);font-size:.53rem;letter-spacing:.07em;text-transform:uppercase;color:var(--text-muted);}
.tgrid b{font-family:var(--mono);font-size:.78rem;font-weight:700;white-space:nowrap;}
.tgrid .warn b{color:var(--accent-hi);}
.tgrid .bad b{color:var(--err);}
.spark{width:100%;height:30px;display:block;}
.phasebar{display:flex;height:5px;border-radius:3px;overflow:hidden;background:#1a1a1a;}
.phasebar .ph{display:block;height:100%;}
.coldnote{font-size:.6rem;color:var(--text-muted);line-height:1.4;}

/* ---- chart ---- */
.canvas-wrap{flex:1;min-height:0;position:relative;padding:8px 10px 6px;}
#chart{width:100%;height:100%;display:block;}

/* ---- sample log ---- */
.lhead,.lrow{display:grid;grid-template-columns:50px 78px minmax(110px,1.3fr) 86px minmax(140px,1.5fr) 118px;
  gap:9px;align-items:center;padding:5px 12px;}
.lhead{flex-shrink:0;font-family:var(--mono);font-size:.55rem;letter-spacing:.09em;text-transform:uppercase;
  color:var(--text-muted);border-bottom:1px solid var(--border);}
.lrow{font-family:var(--mono);font-size:.69rem;border-bottom:1px solid #141414;color:var(--text-sec);}
.lrow:hover{background:#121212;}
.lrow[hidden]{display:none;}
.lrow.lost{background:rgba(239,68,68,.045);}
.lrow .c-seq,.lrow .c-time{color:var(--text-muted);}
.lrow .c-tgt{display:flex;align-items:center;gap:6px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lrow .c-tgt .tdot{width:6px;height:6px;border-radius:50%;flex-shrink:0;}
.lrow .c-rtt{color:var(--accent);font-weight:600;}
.lrow .c-ph{color:var(--text-muted);font-size:.63rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lrow .c-st.ok{color:var(--ok);}
.lrow .c-st.err{color:var(--err);}
.lrow .cold{font-style:normal;color:#38bdf8;border:1px solid rgba(56,189,248,.4);border-radius:3px;
  padding:0 3px;font-size:.56rem;cursor:help;}
.empty{padding:18px 10px;text-align:center;color:var(--text-muted);font-size:.74rem;}
.empty[hidden]{display:none;}

/* ---- method dialog ---- */
/* margin:auto is what centres a modal <dialog>; the reset at the top of this
   file zeroes it, which pinned every dialog to the top-left corner. */
.dlg{margin:auto;border:1px solid var(--border);border-radius:10px;background:var(--bg-card);color:var(--text);
  width:min(760px,calc(100vw - 32px));max-height:min(80dvh,760px);padding:0;
  display:flex;flex-direction:column;overflow:hidden;}
.dlg::backdrop{background:rgba(0,0,0,.72);}
.dlg:not([open]){display:none;}
.dlg-head{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:13px 16px;border-bottom:1px solid var(--border);}
.dlg-head h2{font-family:var(--display);font-size:1rem;font-weight:700;}
.dlg-body{flex:1;min-height:0;overflow-y:auto;padding:16px;}
.dlg-body h3{font-family:var(--display);font-size:.84rem;font-weight:700;margin:18px 0 8px;color:var(--accent);}
.dlg-body p{font-size:.79rem;line-height:1.65;color:var(--text-sec);margin-bottom:9px;}
.dlg-body ul{list-style:none;display:flex;flex-direction:column;gap:9px;margin:12px 0;}
.dlg-body li{font-size:.77rem;line-height:1.6;color:var(--text-sec);padding-left:15px;position:relative;}
.dlg-body li::before{content:'';position:absolute;left:0;top:.62em;width:5px;height:5px;border-radius:50%;background:var(--accent);}
.dlg-body strong{color:var(--text);font-weight:600;}
.dlg-body em{color:var(--accent-hi);font-style:normal;}
/* The ICMP-vs-this-tool table is the whole argument of the dialog, so it gets
   real table styling rather than being squeezed into a paragraph. */
.dlg-body table.cmp{width:100%;border-collapse:collapse;margin:10px 0 12px;font-family:var(--mono);font-size:.72rem;}
.dlg-body table.cmp th{text-align:left;font-size:.56rem;letter-spacing:.08em;text-transform:uppercase;
  color:var(--text-muted);border-bottom:1px solid var(--border);padding:5px 8px;font-weight:600;}
.dlg-body table.cmp td{padding:5px 8px;border-bottom:1px solid #141414;color:var(--text-sec);}
.dlg-body table.cmp td:first-child{color:var(--text);}
.dlg-body table.cmp td.ok{color:var(--ok);}
.dlg-body table.cmp td.warn{color:var(--accent-hi);}
.dlg-body table.cmp td.bad{color:var(--err);font-weight:700;}

/* ---- modes ----
   One page, two screens. The navbar controls that only make sense for one of
   them carry data-only and are hidden in the other. [hidden] is made absolute
   here because several of the elements it is used on set their own display. */
[hidden]{display:none !important;}
body[data-mode="log"] [data-only="live"],
body:not([data-mode="log"]) [data-only="log"]{display:none !important;}
.modeseg .seg-btn[aria-pressed="true"]{color:var(--accent);background:var(--accent-faint);}

/* ---- the slimmer navbar ----
   One primary action per mode; Clear and Method are icons, the four downloads
   one menu. A hairline separates the status (mode, verdict) from the actions. */
.navsep{width:1px;height:20px;background:var(--border);flex-shrink:0;}
.cs-btn.icon{width:32px;padding:0;}
.cs-btn.icon svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;}
#btnExport .caret{width:10px;height:10px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s;}
#btnExport[aria-expanded="true"]{border-color:var(--accent);color:var(--accent);}
#btnExport[aria-expanded="true"] .caret{transform:rotate(180deg);}
.rundot{display:none;width:7px;height:7px;border-radius:50%;background:currentColor;}
.cs-btn.primary.running .rundot{display:inline-block;animation:pulse 1.2s ease-in-out infinite;}
@keyframes pulse{50%{opacity:.25;}}
@media (prefers-reduced-motion:reduce){.cs-btn.primary.running .rundot{animation:none;}}

.menu{position:fixed;z-index:60;min-width:230px;padding:5px;border:1px solid var(--border-hi);border-radius:8px;
  background:#0a0a0a;box-shadow:0 12px 32px rgba(0,0,0,.65);display:flex;flex-direction:column;}
.menu .mi{display:flex;flex-direction:column;align-items:flex-start;gap:1px;width:100%;padding:7px 10px;border:0;
  border-radius:5px;background:transparent;color:var(--text);cursor:pointer;text-align:left;}
.menu .mi b{font-family:var(--mono);font-size:.72rem;font-weight:600;}
.menu .mi small{font-size:.62rem;color:var(--text-muted);}
.menu .mi:hover,.menu .mi:focus-visible{background:var(--accent-faint);outline:none;}
.menu .mi:hover b,.menu .mi:focus-visible b{color:var(--accent);}
.msep{height:1px;background:var(--border);margin:4px 6px;}

/* ---- log file mode ---- */
.analyze{position:relative;}
/* In a log the chart is the finding and the table is the evidence, so the
   chart gets the larger share — the reverse of the live screen. */
.analyze .chartpane{flex:3 1 0;}
.analyze .logpane{flex:2 1 0;}
.loaded{flex:1;min-height:0;display:flex;flex-direction:column;gap:var(--gap);}

.dropzone{flex:1;min-height:0;overflow-y:auto;border:1px dashed var(--border-hi);border-radius:10px;
  background:var(--bg-card);display:flex;}
.dz-inner{margin:auto;width:min(680px,100%);padding:24px 18px;display:flex;flex-direction:column;gap:12px;}
.dz-inner h2{font-family:var(--display);font-size:1.2rem;font-weight:700;}
.dz-lead{font-size:.82rem;line-height:1.6;color:var(--text-sec);}
.dz-actions{display:flex;gap:8px;flex-wrap:wrap;}
.input.paste{height:auto;min-height:110px;padding:9px 10px;resize:vertical;line-height:1.45;font-size:.7rem;}
.dz-formats{list-style:none;display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:6px 14px;
  font-size:.72rem;color:var(--text-muted);margin-top:4px;}
.dz-formats b{color:var(--text-sec);font-weight:600;margin-right:4px;}

.srcstrip{gap:8px;}
.srcstrip .filetag{flex:1 1 auto;min-width:120px;}
.srcstrip .filetag b{max-width:36ch;}
.srcstrip .filetag small{font-size:.62rem;white-space:nowrap;}
.chip.basis{cursor:help;font-size:.58rem;padding:4px 7px;}
.chip.basis[data-basis="absolute"]{color:var(--ok);border-color:rgba(34,197,94,.4);}
.chip.basis[data-basis="estimated"]{color:var(--accent-hi);border-color:var(--accent-dim);}
.chip-btn{background:transparent;cursor:pointer;font-size:.58rem;padding:4px 7px;}
.chip-btn:hover{border-color:var(--accent);}
.chip.good{color:var(--ok);border-color:rgba(34,197,94,.4);}
.chip.bad,.chip.warn{color:#fca5a5;border-color:rgba(239,68,68,.45);}

.tabs{display:flex;gap:2px;min-width:0;overflow-x:auto;scrollbar-width:none;}
.tabs::-webkit-scrollbar{display:none;}
.tab{background:transparent;border:1px solid transparent;border-radius:5px;color:var(--text-muted);
  font-family:var(--mono);font-size:.66rem;padding:4px 9px;cursor:pointer;white-space:nowrap;}
.tab:hover:not(:disabled){color:var(--text);}
.tab.active{color:var(--accent);border-color:var(--accent-dim);background:var(--accent-faint);}
.tab:disabled{opacity:.35;cursor:not-allowed;}
.rangechip{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:.62rem;color:var(--accent);
  border:1px solid var(--accent-dim);border-radius:4px;padding:2px 3px 2px 7px;white-space:nowrap;margin-left:auto;}
.rangechip button{background:transparent;border:0;color:inherit;cursor:pointer;font-size:.7rem;padding:0 4px;}
.chartpane .pane-head{gap:8px;}
.legend{display:flex;flex-wrap:wrap;gap:4px 14px;padding:6px 12px 0;font-family:var(--mono);font-size:.62rem;color:var(--text-sec);}
.legend:empty{display:none;}
.lg-item{display:inline-flex;align-items:center;gap:6px;}
.lg-item i{display:inline-block;width:14px;height:2px;border-radius:1px;}
.analyze .canvas-wrap{cursor:crosshair;touch-action:pan-y;}
#aChart{width:100%;height:100%;display:block;}
.crosshair{position:absolute;top:18px;bottom:24px;width:1px;background:var(--text-muted);opacity:.6;pointer-events:none;}
.tip{position:absolute;z-index:3;pointer-events:none;min-width:150px;max-width:280px;background:#000;
  border:1px solid var(--border-hi);border-radius:6px;padding:7px 9px;font-family:var(--mono);font-size:.64rem;
  box-shadow:0 6px 20px rgba(0,0,0,.6);}
.tip-head{color:var(--text-muted);margin-bottom:4px;white-space:nowrap;}
.tip-row{display:flex;align-items:center;gap:7px;line-height:1.55;}
.tip-row i{flex:0 0 12px;height:2px;border-radius:1px;}
.tip-row b{color:var(--text);font-weight:700;white-space:nowrap;}
.tip-row span{color:var(--text-sec);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.chartnote{flex-shrink:0;padding:0 12px 7px;font-size:.6rem;color:var(--text-muted);line-height:1.4;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

.pane-head.filters{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;}
.pane-head.filters h2{margin-right:auto;display:flex;align-items:baseline;gap:6px;}
.pane-head.filters h2 small{font-family:var(--mono);font-size:.6rem;font-weight:400;}
.pane-head.filters .cs-btn{height:26px;font-size:.64rem;flex-shrink:0;}
.input.xs{height:26px;width:58px;padding:0 6px;font-size:.66rem;}

/* The virtual table: a spacer as tall as every row would be, and only the rows
   in view rendered inside it, absolutely placed. */
.vpane{position:relative;}
.vspacer{position:relative;}
.lhead.ahead,.lrow.arow{grid-template-columns:58px 118px minmax(100px,1.2fr) minmax(100px,1.2fr) 56px 40px 78px 150px;}
.arow{position:absolute;left:0;right:0;height:26px;padding-top:0;padding-bottom:0;}
.arow .c-line,.arow .c-seq,.arow .c-ttl{color:var(--text-muted);}
.arow .c-from{color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.64rem;}
.arow.dup{opacity:.55;}
.arow .c-st.dupst{color:#38bdf8;}
.arow .inf{font-style:normal;color:var(--text-muted);border:1px solid var(--border-hi);border-radius:3px;
  padding:0 3px;font-size:.54rem;margin-left:3px;}

.tcard .facts{list-style:none;display:flex;flex-direction:column;gap:3px;font-size:.62rem;color:var(--text-muted);line-height:1.4;}
.tcard .facts li{cursor:help;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.tcard .facts b{color:var(--text-sec);font-family:var(--mono);font-weight:600;}
.tcard .facts li.good{color:var(--ok);}
.tcard .facts li.bad,.tcard .facts li.warn{color:var(--accent-hi);}

.busy{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;padding:16px;
  background:rgba(5,5,5,.78);}
/* The load card: which step, how far, how many lines and samples so far. */
.pcard{width:min(440px,100%);border:1px solid var(--border-hi);border-radius:10px;background:var(--bg-card);
  padding:16px 18px;display:flex;flex-direction:column;gap:12px;box-shadow:0 12px 40px rgba(0,0,0,.6);}
.pc-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;min-width:0;}
.pc-head b{font-family:var(--mono);font-size:.78rem;color:var(--accent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pc-head span{font-family:var(--mono);font-size:.66rem;flex-shrink:0;}
.pc-steps{list-style:none;display:grid;grid-template-columns:repeat(3,1fr);gap:6px;counter-reset:st;}
.pc-steps li{counter-increment:st;font-family:var(--mono);font-size:.6rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--text-muted);display:flex;align-items:center;gap:6px;}
.pc-steps li::before{content:counter(st);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;
  width:17px;height:17px;border-radius:50%;border:1px solid var(--border-hi);font-size:.56rem;}
.pc-steps li[data-state="active"]{color:var(--accent);}
.pc-steps li[data-state="active"]::before{border-color:var(--accent);background:var(--accent-faint);}
.pc-steps li[data-state="done"]{color:var(--text-sec);}
.pc-steps li[data-state="done"]::before{content:'✓';border-color:rgba(34,197,94,.5);color:var(--ok);}
.pbar{height:6px;border-radius:3px;background:#1a1a1a;overflow:hidden;position:relative;}
.pbar i{display:block;height:100%;width:0;background:var(--accent);border-radius:3px;transition:width .18s ease-out;}
/* No measure for this step (decode, draw): the filled part breathes instead
   of pretending to a percentage. */
.pbar.indet i{animation:breathe 1.1s ease-in-out infinite alternate;}
@keyframes breathe{from{opacity:1;}to{opacity:.45;}}
.pc-foot{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-family:var(--mono);font-size:.66rem;color:var(--text-sec);}
.pc-foot .num{color:var(--text-muted);}
.pcard #aCancel{align-self:flex-end;}
@media (prefers-reduced-motion:reduce){.pbar i{transition:none;}.pbar.indet i{animation:none;}}
.dropover{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;
  background:rgba(5,5,5,.82);pointer-events:none;}
.dropover div{border:2px dashed var(--accent);border-radius:12px;padding:34px 40px;color:var(--accent);
  font-family:var(--display);font-size:1.05rem;font-weight:700;text-align:center;max-width:min(520px,90vw);}
.rawlines{font-family:var(--mono);font-size:.66rem;line-height:1.5;color:var(--text-sec);background:#000;
  border:1px solid var(--border);border-radius:6px;padding:8px 10px;max-height:260px;overflow:auto;white-space:pre;margin:6px 0 10px;}

/* ---- narrow ----
   The navbar fits itself: on a narrow screen carino-navbar.js folds the app's
   controls into its ⋯ menu and keeps the ones marked data-priority="1" (Start,
   or Open log) in the bar, so nothing here reaches into the shared chrome. */
@media (max-width:1100px){
  .tiles{grid-template-columns:repeat(4,1fr);}
  .grid{grid-template-columns:minmax(240px,290px) 1fr;}
}
@media (max-width:860px){
  .cs-btn{padding:0 8px;font-size:.68rem;}
  .cs-btn.primary{min-width:62px;}

  .app{padding:8px 10px 6px;--gap:8px;}
  .tiles{display:flex;overflow-x:auto;scrollbar-width:none;}
  .tiles::-webkit-scrollbar{display:none;}
  .stat-tile{flex:0 0 118px;}
  .strip .path{max-width:none;}
  /* The client id is the last thing worth losing on a phone, but it is also
     the least urgent — margin-left:auto would strand it on a row of its own. */
  .cfield.idtag{margin-left:0;}
  .lhead .c-ph,.lrow .c-ph{display:none;}
  .lhead,.lrow{grid-template-columns:40px 66px minmax(84px,1fr) 74px 100px;}
  }
@media (max-width:860px){
  .ahead .c-from,.arow .c-from,.ahead .c-line,.arow .c-line,.ahead .c-ttl,.arow .c-ttl{display:none;}
  .lhead.ahead,.lrow.arow{grid-template-columns:96px minmax(80px,1fr) 46px 70px 112px;}
}
@media (max-width:860px) and (min-height:620px){
  .srcstrip .filetag{flex-basis:100%;}
}
/* Short screens: the log's source strip becomes one scrolling row, like the
   navbar's controls, and the chart's caption goes first. */
@media (max-height:700px){
  .chartnote,.legend{display:none;}
  .analyze .tcard .facts{display:none;}
  .srcstrip{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;}
  .srcstrip::-webkit-scrollbar{display:none;}
  .srcstrip>*{flex-shrink:0;}
  .srcstrip .filetag{flex:0 0 auto;}
}
@media (max-width:520px){
  /* On a phone the navbar keeps the actions; the verdict is still on screen,
     in the Loss tile and on every card. */
  .verdict-badge,.navsep{display:none;}
  .ahead .c-seq,.arow .c-seq{display:none;}
  .lhead.ahead,.lrow.arow{grid-template-columns:82px minmax(70px,1fr) 66px 96px;}
  .chartnote{display:none;}
  .lhead,.lrow{grid-template-columns:60px minmax(74px,1fr) 70px 88px;}
  .lhead .c-seq,.lrow .c-seq{display:none;}
  .slabel{display:none;}
  .strip{padding:7px 9px;gap:7px;}
  .opt span{max-width:150px;}
}
/* Narrow AND tall — a phone held upright. Here height is affordable, so the
   cards become a short horizontal rail above a full-width chart and log. In
   landscape (below) the opposite is true and the two-column layout stays. */
@media (max-width:860px) and (min-height:620px){
  .grid{grid-template-columns:1fr;grid-template-rows:minmax(0,auto) minmax(0,1fr);}
  .cards{max-height:min(190px,23dvh);}
  .cards{flex-direction:row;overflow-x:auto;padding:8px;}
  .cards>.tcard{flex:0 0 230px;}
  .cards>.muted{flex:1 1 auto;}
  /* In the horizontal rail the card is height-capped, and a footnote that gets
     cut off mid-sentence reads as a bug rather than a note. The cold figure is
     still in the export and on the sample row. */
  .cards .coldnote{display:none;}
}

/* ---- short viewports ----

   The page may not scroll, so when height runs out something has to give, and
   it gives in a deliberate order: first the tiles' caption line, then the
   panes' minimums, then the connection strip's labels. The verdict used to be
   third on that list; moving it into the navbar as a badge removed a whole row
   from the layout and took it off the list entirely.
   The thresholds were set by measuring, not guessed: 360x640 and 740x360 both
   overflowed before these existed. */
@media (max-height:760px){
  .chartpane{min-height:110px;}
  .logpane{min-height:100px;}
  .cards{max-height:min(170px,22dvh);}
}
@media (max-height:700px){
  .stat-tile .st-sub{display:none;}
  .stat-tile{padding:6px 11px;}
  .stat-tile .st-value{font-size:1.02rem;}
  .chartpane{min-height:86px;}
  .logpane{min-height:78px;}
  .cards{max-height:min(140px,24dvh);}
}
@media (max-height:460px){
    .strip{padding:5px 9px;}
  .input{height:28px;}
  .chartpane{min-height:60px;}
  .logpane{min-height:54px;}
  .cards{max-height:min(120px,34dvh);}
  .pane-head{padding:5px 10px;}
  .pane-head h2{font-size:.72rem;}
}

