/* Poppins (SIL OFL 1.1, vendor/fonts/Poppins-OFL.txt), Latin subset, served locally */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("vendor/fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("vendor/fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("vendor/fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("vendor/fonts/poppins-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 800; font-display: swap; src: url("vendor/fonts/poppins-latin-800-normal.woff2") format("woff2"); }
:root {
  /* one type scale for every page */
  --fs-xs: 10.5px; --fs-sm: 11.5px; --fs-md: 12.5px; --fs-lg: 14px; --fs-xl: 18px; --fs-2xl: 24px;
}
/* Dark dashboard theme: slate cards with a teal hairline, bold geometric headings, muted meta on the right. */
:root {
  --bg: #161b21; --panel: #1d232b; --panel-2: #222a33; --ink: #e9eef3; --ink-2: #c3ccd6; --muted: #8592a3; --faint: #5d6a79;
  --line: #2c3740; --edge: #34464d; --track: #26313a;
  --accent: #5fd4bc; --accent-2: #3fb8a0; --accent-soft: rgba(95, 212, 188, .12); --accent-ink: #0d2a25;
  --ok: #5cbf74; --ok-soft: rgba(92, 191, 116, .14);
  --warn: #e8a94a; --warn-soft: rgba(232, 169, 74, .14);
  --bad: #e06a66; --bad-soft: rgba(224, 106, 102, .14);
  --slate: #5b6579; --vio: #9b8cf2;
  --side: #12161b; --side-ink: #aab5c2;
  --head: "Poppins", "Avenir Next", "Montserrat", -apple-system, "Segoe UI", sans-serif;
  --body: "Poppins", "Avenir Next", -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --r: 10px; --r-sm: 7px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: var(--fs-md)/1.5 var(--body); color: var(--ink); background: var(--bg); display: flex; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
::selection { background: rgba(95, 212, 188, .3); }

/* ---------- shell ---------- */
.side { width: 184px; flex: none; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); }
.brand { display: flex; gap: 9px; align-items: center; padding: 14px 14px 16px; }
.brand b { display: block; color: var(--ink); font: 800 var(--fs-lg)/1.15 var(--head); letter-spacing: -.1px; }
.brand img { flex: none; }
.brand span { font-size: var(--fs-sm); color: var(--muted); }
.side nav { display: flex; flex-direction: column; padding: 0 10px; gap: 3px; }
.side nav a { color: var(--side-ink); text-decoration: none; padding: 7px 11px; border-radius: var(--r-sm); display: flex; gap: 10px; align-items: center; font-weight: 500; }
.side nav a .nl { flex: 1; }
.side nav .ni { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.side nav a:hover .ni { opacity: 1; }
.side nav a.active .ni { opacity: 1; stroke: var(--accent); }
.side nav a:hover { background: #1b222a; color: var(--ink); }
.side nav a.active { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--edge); }
.side-foot { margin-top: auto; padding: 16px 18px; font-size: var(--fs-xs); color: var(--faint); font-family: var(--mono); word-break: break-all; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 0 7px; font-size: var(--fs-xs); font-weight: 700; }
.hidden { display: none !important; }
main { flex: 1; min-width: 0; padding: 18px 22px 48px; }
h1 { font: 700 var(--fs-xl)/1.2 var(--head); margin: 0; letter-spacing: -.2px; }
h2 { font: 700 var(--fs-lg)/1.3 var(--head); margin: 0 0 12px; color: var(--ink); }
h3 { font-size: var(--fs-xs); margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; }
.head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.head .sp { flex: 1; }
.sub { color: var(--muted); font-size: var(--fs-md); }

/* ---------- cards ---------- */
.panel, .kpi, .chartbox, .scn, .ready-card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.panel { padding: 14px 16px; margin-bottom: 12px; }
.panel.sub { color: var(--muted); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head .meta { color: var(--muted); font-size: var(--fs-md); }
.big { font: 800 var(--fs-2xl)/1.05 var(--head); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.big small { font: 400 var(--fs-lg) var(--body); color: var(--ink-2); margin-left: 8px; letter-spacing: 0; }

/* ---------- controls ---------- */
.btn { appearance: none; border: 1px solid var(--edge); background: var(--panel-2); color: var(--ink); padding: 5px 11px; border-radius: var(--r-sm); cursor: pointer; font: inherit; font-size: var(--fs-md); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: #4a5e66; background: #28313b; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #79e0cb; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { padding: 3px 8px; font-size: var(--fs-sm); }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input[type=text], input[type=number], input[type=password], select, textarea { width: 100%; border: 1px solid var(--edge); border-radius: var(--r-sm); padding: 6px 9px; font: inherit; background: #171d24; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(95, 212, 188, .35); border-color: var(--accent); }
textarea { font-family: var(--mono); font-size: var(--fs-sm); min-height: 90px; }
textarea.code { min-height: 420px; white-space: pre; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; padding-top: 4px; }
.check input, input[type=radio], input[type=checkbox] { accent-color: var(--accent); }
.check input { width: 16px; height: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.f label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 5px; color: var(--ink-2); }
.f .help { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.f.wide { grid-column: 1 / -1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; background: var(--panel); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #222a33; }

/* ---------- chips and notes ---------- */
.chip, .tag, .env-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--edge); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.running, .chip.preparing, .chip.draining, .tag.run { background: var(--accent-soft); color: var(--accent); border-color: rgba(95, 212, 188, .35); }
.chip.finished, .tag.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(92, 191, 116, .35); }
.chip.failed, .chip.interrupted, .tag.bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(224, 106, 102, .35); }
.chip.stopped, .chip.stopping, .tag.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(232, 169, 74, .35); }
.tag { font-size: var(--fs-xs); padding: 1px 9px; }
.tag.vio { background: rgba(155, 140, 242, .14); color: var(--vio); border-color: rgba(155, 140, 242, .35); }
.env-chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.note { padding: 10px 14px; border-radius: var(--r-sm); font-size: var(--fs-md); margin: 10px 0; border: 1px solid transparent; }
.note.warn { background: var(--warn-soft); color: #f3c98a; border-color: rgba(232, 169, 74, .3); }
.note.bad { background: var(--bad-soft); color: #f2a7a4; border-color: rgba(224, 106, 102, .3); }
.note.ok { background: var(--ok-soft); color: #9fdcad; border-color: rgba(92, 191, 116, .3); }
.note.info { background: var(--accent-soft); color: #a6eadb; border-color: rgba(95, 212, 188, .3); }
.dirty { color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.right { text-align: right; }
.mt { margin-top: 14px; }
pre, .mono { font-family: var(--mono); font-size: var(--fs-sm); }
pre.log, .cmd { background: #11161b; border: 1px solid var(--line); color: #cfe3e1; padding: 10px 12px; border-radius: var(--r-sm); }
pre.log { max-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
.cmd { color: var(--accent); font-family: var(--mono); font-size: var(--fs-sm); word-break: break-all; }
.ladder { font-family: var(--mono); font-size: var(--fs-sm); background: #11161b; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; white-space: pre; overflow: auto; }

/* ---------- stat tiles (KPIs) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { padding: 10px 14px; box-shadow: none; background: #1a2027; }
.kpi .l { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: 1.3px; font-weight: 600; }
.kpi .v { font: 700 var(--fs-xl)/1.25 var(--head); font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi .s { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.kpi.good .v { color: var(--ok); } .kpi.bad .v { color: var(--bad); }
.totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.totals .kpi { background: var(--panel); padding: 12px 16px; }
.totals .kpi .l { text-transform: none; letter-spacing: 0; font-size: var(--fs-md); color: var(--ink); }
.totals .kpi .v { font-size: var(--fs-2xl); font-weight: 800; }

/* ---------- run overview cards (gauge, latency bands, cost) ---------- */
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.overview .panel { margin: 0; }
.gauge-wrap { display: grid; grid-template-columns: minmax(140px, 180px) 1fr; gap: 16px; align-items: center; }
.gauge { position: relative; }
.gauge svg { width: 100%; display: block; overflow: visible; }
.gauge .gv { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.gauge .gv b { display: block; font: 800 var(--fs-2xl)/1 var(--head); font-variant-numeric: tabular-nums; }
.gauge .gv span { color: var(--ink-2); font-size: var(--fs-md); }
.legend-rows > div { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-md); color: var(--ink-2); }
.legend-rows > div:last-child { border-bottom: 0; }
.legend-rows i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend-rows b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.bands { display: grid; grid-template-columns: minmax(120px, auto) 1fr auto; gap: 10px 14px; align-items: center; margin-top: 12px; font-size: var(--fs-md); color: var(--ink-2); }
.band-track { height: 9px; background: var(--track); border-radius: 99px; overflow: hidden; }
.band-track > span { display: block; height: 100%; border-radius: 99px; min-width: 9px; }
.band-track > span.zero { min-width: 0; }
.bands .n { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--edge); border-radius: 999px; background: #18323a33; font-weight: 700; font-size: var(--fs-md); }
.pill i { width: 9px; height: 9px; border-radius: 50%; }
@media (max-width: 1400px) { .overview { grid-template-columns: 1fr 1fr; } }
@media (max-width: 980px) { .overview { grid-template-columns: 1fr; } .gauge-wrap { grid-template-columns: 1fr; } }

/* ---------- cost ---------- */
.cost-bar { display: flex; height: 9px; border-radius: 99px; overflow: hidden; background: var(--track); margin: 10px 0 8px; gap: 2px; }
.cost-bar span { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* ---------- charts ---------- */
.charts, .charts4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.charts4 .panel, .charts3 .panel { margin-bottom: 0; }
.charts4 { margin-bottom: 12px; }
.charts3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.chartbox { padding: 18px 20px; }
.chartbox .cv { position: relative; height: 240px; }
.chart-box { position: relative; height: 210px; }
.chart-box.sm { height: 170px; }
@media (max-width: 1300px) { .charts3 { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .charts, .charts4 { grid-template-columns: 1fr; } }
.progress { height: 9px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 99px; transition: width .5s; }

/* ---------- scenarios, setup, editor ---------- */
.scn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.scn { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.scn:hover { border-color: #4a6168; }
.scn .t { font: 700 var(--fs-lg)/1.3 var(--head); }
.scn .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: var(--fs-sm); color: var(--muted); padding-top: 10px; border-top: 1px solid var(--line); }
.scn .meta b { color: var(--ink); font-weight: 600; }
.scn .row { margin-top: auto; padding-top: 6px; }
.ready { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; margin-bottom: 10px; }
.ready-card { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--edge); }
.ready-card.good { border-top-color: var(--ok); }
.ready-card.badc { border-top-color: var(--bad); }
.ready-card .help { font-size: var(--fs-xs); color: var(--muted); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--edge); border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer; background: #1a2027; }
.mode-card.on { border-color: var(--accent); background: var(--accent-soft); }
.mode-card input { margin-top: 3px; }
.prof-table { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.prof-table input { padding: 4px 6px; font-family: var(--mono); font-size: var(--fs-sm); }
.prof-table td { padding: 4px 6px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.steps, .dsteps { display: flex; flex-direction: column; gap: 8px; }
.step { display: grid; grid-template-columns: 28px 250px 1fr 170px auto; gap: 8px; align-items: center; background: #1a2027; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 9px; }
.step-n { font-family: var(--mono); color: var(--muted); text-align: right; }
.step-p { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ink-2); }
.step-p input, .step-p select { width: auto; padding: 4px 6px; }
.step-note { font-size: var(--fs-sm); padding: 4px 6px !important; }
.step-b { display: flex; gap: 4px; }
.dstep { display: grid; grid-template-columns: 28px 1fr 1.3fr 40px; gap: 10px; align-items: start; background: #1a2027; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; }
.dcell label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.dstep textarea { font-family: inherit; font-size: var(--fs-md); min-height: 0; resize: vertical; }
.dstep .step-n { padding-top: 24px; }

/* ---------- run: calls and conversation ---------- */
.dlg-split { display: grid; grid-template-columns: 250px 1fr; gap: 12px; align-items: start; }
.list-title { font: 700 var(--fs-lg) var(--head); padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.list-title .btn { font-family: var(--body); }
.filters .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.call-list { max-height: 70vh; overflow: auto; }
.call-item { padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.call-item:last-child { border-bottom: 0; }
.call-item:hover { background: #222a33; }
.call-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.chat { display: flex; flex-direction: column; gap: 9px; }
.msg { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.msg.bot { align-self: flex-start; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .who { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.msg .bubble { padding: 7px 11px; border-radius: 13px; font-size: var(--fs-md); line-height: 1.45; }
.msg.bot .bubble { background: var(--panel-2); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.me .bubble { background: #1f4a43; color: #e6fbf6; border: 1px solid #2c6a5f; border-top-right-radius: 4px; }
.msg .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.msg.live .bubble { opacity: .6; font-style: italic; }
audio { filter: invert(.88) hue-rotate(180deg); border-radius: 99px; }

/* ---------- overlays ---------- */
.modal { position: fixed; inset: 0; background: rgba(5, 8, 11, .65); display: flex; align-items: flex-start; justify-content: center; z-index: 50; padding: 40px 16px; overflow: auto; backdrop-filter: blur(2px); }
.modal-box { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r); width: min(900px, 100%); padding: 16px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.modal-box h2 { font-size: var(--fs-lg); margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #213a36; border: 1px solid #2f5d55; color: #e6fffb; padding: 11px 15px; border-radius: var(--r-sm); font-size: var(--fs-md); max-width: 420px; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); }
.toast.bad { background: #3d1d1c; border-color: #6b2c29; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); vertical-align: middle; margin-right: 4px; }
.live-dot.on { background: var(--accent); box-shadow: 0 0 0 3px rgba(95, 212, 188, .2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c3740; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .step { grid-template-columns: 28px 1fr; }
  .dlg-split { grid-template-columns: 1fr; } .modes { grid-template-columns: 1fr; }
  .dstep { grid-template-columns: 28px 1fr 40px; } .dstep .dcell { grid-column: 2; } .dstep .step-b { grid-column: 3; grid-row: 1; }
}
@media (max-width: 760px) { body { flex-direction: column; } .side { width: 100%; height: auto; position: static; } .side nav { flex-direction: row; } .side-foot { display: none; } main { padding: 16px; } }
.overview > .panel { container-type: inline-size; }
@container (max-width: 520px) {
  .gauge-wrap { grid-template-columns: 1fr; gap: 10px; }
  .gauge { width: min(180px, 100%); margin: 0 auto; }
}
.legend-rows > div { white-space: nowrap; }
td.num, th { white-space: nowrap; }

/* ---------- interaction player ---------- */
.player { padding: 12px 16px 10px; outline: none; }
.player:focus-visible { box-shadow: 0 0 0 2px rgba(95, 212, 188, .35); }
.pl-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pl-title { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.pl-ic { display: inline-flex; width: 20px; height: 20px; }
.pl-ic svg { width: 100%; height: 100%; }
.pl-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pl-play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #2ad1c0; color: #0c2421; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; box-shadow: 0 0 0 4px rgba(42, 209, 192, .12); }
.pl-play:hover { background: #4fe0d0; }
.pl-play .pl-ic { width: 19px; height: 19px; }
.pl-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--edge); background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; text-decoration: none; }
.pl-btn:hover { background: #26303a; color: var(--ink); }
.pl-btn.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.pl-btn.ghost { border-color: transparent; width: 30px; height: 30px; }
.pl-time { font: 500 var(--fs-md) var(--body); color: var(--ink-2); font-variant-numeric: tabular-nums; margin: 0 6px 0 4px; white-space: nowrap; }
.pl-speed-wrap { position: relative; }
.pl-speed { width: auto; padding: 7px 30px 7px 14px; border-radius: var(--r-sm); background: transparent; font-weight: 500; font-size: var(--fs-md); appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab5c2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; margin-right: 8px; }
.pl-zoom { min-width: 52px; text-align: center; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pl-auto { display: inline-flex; align-items: center; gap: 12px; padding: 6px 8px 6px 16px; border: 1px solid var(--edge); border-radius: 999px; font-weight: 600; cursor: pointer; user-select: none; }
.pl-auto input { position: absolute; opacity: 0; pointer-events: none; }
.pl-switch { width: 34px; height: 19px; border-radius: 99px; background: #3a4650; position: relative; transition: background .15s; }
.pl-switch::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.pl-auto input:checked + .pl-switch { background: #2ad1c0; }
.pl-auto input:checked + .pl-switch::after { transform: translateX(15px); }
.pl-body { display: grid; grid-template-columns: 170px 1fr; gap: 0 18px; }
.pl-labels { display: flex; flex-direction: column; }
.pl-label { height: 60px; display: flex; align-items: center; gap: 9px; }
.pl-av { width: 28px; height: 28px; border-radius: 50%; background: #18242a; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--fs-md); color: var(--ink); flex: none; }
.pl-name { font-size: var(--fs-lg); color: var(--ink-2); flex: 1; }
.pl-mute { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; display: inline-flex; }
.pl-mute:hover { color: var(--ink); }
.pl-mute.off { color: var(--bad); }
.pl-sep { height: 1px; background: var(--edge); margin: 7px 0; flex: none; }
.pl-scroll { overflow-x: auto; overflow-y: hidden; min-width: 0; }
.pl-inner { position: relative; cursor: pointer; touch-action: none; }
.pl-track { height: 60px; background: #26313a; border-radius: 8px; overflow: hidden; }
.pl-track canvas { display: block; }
.pl-axis { display: block; margin-top: 8px; }
.pl-head { position: absolute; top: -4px; left: 0; width: 2px; height: calc(60px * 2 + 15px + 8px); margin-left: -1px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none; }
.pl-head::before { content: ""; position: absolute; top: -3px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.pl-status { margin-top: 6px; }
.msg[data-turn] .bubble { cursor: pointer; transition: box-shadow .15s; }
.msg.playing .bubble { box-shadow: 0 0 0 2px #e8a94a; }
@media (max-width: 900px) { .pl-body { grid-template-columns: 110px 1fr; } .pl-name { font-size: var(--fs-md); } }
/* compact player */
.player { padding: 10px 14px 8px; }
.pl-top { margin-bottom: 6px; }
.pl-title { font-size: var(--fs-xs); letter-spacing: 1.2px; }
.pl-ctrl { gap: 6px; margin-bottom: 8px; }
.pl-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pl-play { width: 26px; height: 26px; box-shadow: 0 0 0 3px rgba(42, 209, 192, .12); }
.pl-play .pl-ic { width: 15px; height: 15px; }
.pl-btn { width: 24px; height: 24px; }
.pl-btn .pl-ic { width: 13px; height: 13px; }
.pl-btn.ghost { width: 22px; height: 22px; }
.pl-time { font-size: var(--fs-sm); margin: 0 4px 0 2px; }
.pl-speed { font-size: var(--fs-sm); padding: 2px 20px 2px 8px; margin-right: 2px; background-size: 12px; background-position: right 5px center; }
.pl-zoom { min-width: 36px; font-size: var(--fs-sm); }
.pl-auto { gap: 6px; padding: 2px 3px 2px 9px; font-size: var(--fs-sm); }
.pl-switch { width: 26px; height: 15px; }
.pl-switch::after { top: 2px; left: 2px; width: 11px; height: 11px; }
.pl-auto input:checked + .pl-switch::after { transform: translateX(11px); }
.pl-body { grid-template-columns: 92px 1fr; gap: 0 10px; }
.pl-label { height: 38px; gap: 7px; }
.pl-av { width: 20px; height: 20px; font-size: var(--fs-xs); }
.pl-name { font-size: var(--fs-sm); }
.pl-mute { padding: 2px; }
.pl-mute .pl-ic { width: 14px; height: 14px; }
.pl-sep { margin: 4px 0; }
.pl-track { height: 38px; border-radius: 6px; }
.pl-axis { margin-top: 4px; }
.pl-head { top: -3px; height: calc(38px * 2 + 9px + 6px); }
.pl-head::before { top: -2px; left: -3px; width: 8px; height: 8px; }
.pl-lane { display: block; margin: 3px 0; }
.pl-lane-label { height: 24px; display: flex; align-items: center; font-size: var(--fs-xs); color: var(--muted); padding-left: 27px; white-space: nowrap; }
.pl-head { height: calc(38px * 2 + 24px + 6px); }

/* native date/time pickers in the dark theme */
input[type=date], input[type=time] { color-scheme: dark; }

/* call view tabs */
.call-tabs { margin: 4px 0 12px; }
.call-tabs button { padding: 8px 14px; display: inline-flex; align-items: center; }
.tag.cache { background: rgba(90, 169, 230, .14); color: #5aa9e6; border-color: rgba(90, 169, 230, .35); }
.tag.blue { background: rgba(90, 169, 230, .10); color: #8ec5ee; border-color: rgba(90, 169, 230, .28); }

/* hints: "?" icons and the shared tooltip */
.hint { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 5px; border-radius: 50%;
  border: 1px solid var(--edge); color: var(--muted); font: 600 9.5px/1 var(--body); cursor: help; vertical-align: 1px; flex: none;
  text-transform: none; letter-spacing: 0; user-select: none; }
.hint:hover, .hint:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.has-hint { cursor: help; text-decoration: underline dotted rgba(233, 238, 243, .35); text-underline-offset: 3px; }
.tag.has-hint { text-decoration: none; }
.tip { position: fixed; z-index: 1000; max-width: 320px; padding: 8px 10px; border-radius: 8px; background: #0f1419; color: var(--ink);
  border: 1px solid var(--edge); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); font: 400 var(--fs-sm)/1.45 var(--body); pointer-events: none; white-space: pre-line; }
.ev-legend { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: var(--fs-sm); margin-top: 10px; }
.ev-legend code { color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 8px; overflow: hidden; }
.seg button { white-space: nowrap; background: transparent; color: var(--muted, #9aa7b0); border: 0; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--edge); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.head .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
table.step-stats td { vertical-align: top; }
table.step-stats td:first-child, table.step-stats th:first-child { padding-left: 16px; width: 28px; }
table.step-stats td:last-child, table.step-stats th:last-child { padding-right: 16px; }
.step-txt { min-width: 200px; }
.step-txt .small { margin-top: 3px; }
.step-fail { max-width: 340px; min-width: 120px; }
.delta.worse { color: var(--bad); font-weight: 600; }
.delta.better { color: var(--ok); font-weight: 600; }
.stepcell { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.stepbar { width: 80px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; flex: none; }
.stepbar i { display: block; height: 100%; background: var(--muted); }
.stepbar i.ok { background: var(--ok); } .stepbar i.warn { background: var(--warn); } .stepbar i.bad { background: var(--bad); }
/* selects: own chevron (the native one sits on the border), dark option list */
select { -webkit-appearance: none; appearance: none; color-scheme: dark; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238592a3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; text-overflow: ellipsis; }
select:hover { border-color: var(--faint); }
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select option { background: #171d24; color: var(--ink); }
.step-p select { padding-right: 26px; background-position: right 7px center; }
/* dashboard */
.dash-kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.dash-kpis .s .delta { font-weight: 600; }
.dash-charts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.dash-charts .panel, .dash-grid .panel { margin: 0; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.dash-grid.two { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.dash-grid > div > .panel { height: 100%; box-sizing: border-box; }
@media (max-width: 1100px) { .dash-charts, .dash-grid, .dash-grid.two { grid-template-columns: minmax(0, 1fr); } }
table.dash-table td:first-child, table.dash-table th:first-child { padding-left: 16px; }
table.dash-table td:last-child, table.dash-table th:last-child { padding-right: 16px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.spark circle { fill: var(--accent); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.weak-list { display: flex; flex-direction: column; }
.weak { padding: 9px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.weak:first-child { border-top: 0; padding-top: 0; }
.recent { display: flex; flex-direction: column; }
.recent-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.recent-row:first-child { border-top: 0; }
.recent-row:hover { background: var(--panel-2); }
.updated { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.updated .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

/* ---------- run dialog: dials for the load profile ---------- */
.dials { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 10px; }
.dial { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 8px 8px; text-align: center; min-width: 0; }
.dial-l { color: var(--ink-2); font-weight: 600; font-size: var(--fs-md); display: flex; justify-content: center; align-items: center; gap: 4px; }
.dial-body { position: relative; max-width: 132px; margin: 0 auto; }
.dial-arc { cursor: grab; touch-action: none; outline: none; border-radius: 50%; }
.dial-arc.drag { cursor: grabbing; }
.dial-arc:focus-visible { box-shadow: 0 0 0 2px var(--accent-soft); }
.dial-arc svg { width: 100%; display: block; overflow: visible; }
.dial-val { position: absolute; left: 16%; right: 16%; top: 34%; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.dial input.dial-num { pointer-events: auto; width: 100%; background: transparent; border: 1px solid transparent; border-radius: var(--r-sm); text-align: center;
  font: 800 var(--fs-xl)/1.1 var(--head); color: var(--ink); font-variant-numeric: tabular-nums; padding: 0 2px; }
.dial input.dial-num:hover { border-color: var(--line); }
.dial input.dial-num:focus { border-color: var(--edge); background: var(--panel); outline: none; }
.dial-val span { color: var(--muted); font-size: var(--fs-sm); }
.dial-sub { color: var(--muted); font-size: var(--fs-sm); min-height: 16px; margin-top: -6px; }
.dial-btns { display: flex; justify-content: center; gap: 6px; margin-top: 4px; }
.dial-btns .btn { min-width: 30px; justify-content: center; }
@media (max-width: 900px) { .dials { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dials-est { margin: 0; }
.dials-est .note { margin: 0; }
/* run dialog: compact rows, every note about the run in one stack under the dials */
.run-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; margin-bottom: 12px; align-items: start; }
.run-row .f { margin: 0; min-width: 0; }
.run-judge { align-self: end; padding-bottom: 8px; }
.run-presets { margin-bottom: 8px; }
.run-notes { display: flex; flex-direction: column; gap: 6px; margin: 0 0 10px; }
.run-notes .note, .run-notes .dials-est { margin: 0; }
.run-notes:empty { display: none; }
.run-notes > div { display: flex; flex-direction: column; gap: 6px; }
.run-notes > div:empty { display: none; }
.run-row > .f.wide { grid-column: auto; }
.modal-box:has(.dials) { width: min(1120px, 100%); }
.run-row.who { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto; }
.run-row .seg { flex-wrap: nowrap; }
.run-row .seg button { white-space: nowrap; }
@media (max-width: 900px) { .run-row.who { grid-template-columns: 1fr; } }
/* the run dialog fits the window: it is as tall as the screen at most, and the chart gives up height first */
.modal:has(.dials) { padding: 12px 16px; align-items: center; }
.modal-box:has(.dials) { max-height: calc(100vh - 24px); display: flex; flex-direction: column; overflow: auto; padding: 12px 16px; }
.modal-box:has(.dials) > * { flex: none; }
.modal-box:has(.dials) > h2 { margin-bottom: 10px; padding-bottom: 8px; }
.modal-box:has(.dials) > .run-chart { flex: 1 1 170px; min-height: 80px; height: auto; }
@media (max-height: 820px) {
  .modal-box:has(.dials) .run-row { margin-bottom: 8px; }
  .dial-body { max-width: 112px; }
  .dial-btns { display: none; }
  .run-notes .note { padding: 6px 10px; }
}
.run-foot { position: sticky; bottom: -12px; background: var(--panel); padding: 10px 0 12px; margin-bottom: -12px; border-top: 1px solid var(--line); z-index: 2; }
@media (max-height: 720px) {
  .dial-body { max-width: 96px; }
  .dial { padding: 6px; }
  .modal-box:has(.dials) .run-notes .note { font-size: var(--fs-sm); padding: 5px 9px; }
  .modal-box:has(.dials) > .run-chart { min-height: 70px; }
}

/* PDF report dialog: fields on the left, the report's sections on the right */
.modal-box:has(.pdf-dlg) { width: min(940px, 100%); max-height: calc(100vh - 24px); overflow: auto; }
.pdf-dlg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 18px; align-items: start; }
.pdf-fields { display: grid; gap: 10px; }
.pdf-fields p { margin: 0; }
.pdf-sec-box { border: 1px solid var(--edge); border-radius: var(--r-sm); background: #171d24; padding: 10px 12px; }
.pdf-sec-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.pdf-secs { display: grid; gap: 2px; }
.pdf-secs .check { padding: 4px 0; font-weight: 400; }
.pdf-secs .check.off { opacity: .45; cursor: default; }
.pdf-secs input[type=checkbox], .pdf-secs input { color-scheme: dark; }
@media (max-width: 720px) { .pdf-dlg { grid-template-columns: 1fr; } }
.pdf-sec-head .sp { flex: 1; }
input[type=checkbox], input[type=radio] { color-scheme: dark; }
.pdf-group + .pdf-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.pdf-secs .check.grp { font-weight: 600; }
.pdf-secs .check.grp .small { font-weight: 400; margin-left: 2px; }
.pdf-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; padding-left: 22px; }
.warn-text { color: var(--warn); }

/* ---------- Caller (browser softphone) ---------- */
.caller-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 12px; align-items: start; }
.caller-grid .grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .caller-grid { grid-template-columns: 1fr; } }
.hdr-table td { padding: 3px 4px 3px 0; border: 0; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); cursor: pointer; margin-right: 10px; }
.phone .row { gap: 10px; }
.call-btn { min-width: 110px; justify-content: center; font-size: var(--fs-lg, 15px); padding: 8px 18px; }
.btn.active { border-color: var(--warn); color: var(--warn); }
.call-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: 6px; }
.call-state .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.call-state .dot.dialing, .call-state .dot.ringing { background: var(--warn); animation: blink 1s infinite; }
.call-state .dot.answered { background: var(--ok); }
.call-state .dot.ended { background: var(--bad); }
.call-state .timer { font-size: var(--fs-lg, 15px); }
@keyframes blink { 50% { opacity: .25; } }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 14px 0 10px; }
.meter { display: grid; grid-template-columns: 34px 1fr 52px; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.meter .bar { height: 8px; background: #1a2027; border: 1px solid var(--edge); border-radius: 5px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok) 0 70%, var(--warn) 70% 90%, var(--bad) 90%); transition: width .12s; }
.meter b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.kp-wrap { position: relative; display: inline-flex; }
.kp-ic { display: inline-flex; }
.kp-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 216px; padding: 10px; background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r); box-shadow: 0 14px 36px rgba(0, 0, 0, .45); }
.kp-sent { min-height: 22px; padding: 2px 6px 8px; font-size: var(--fs-lg); letter-spacing: 2px; text-align: center; color: var(--ink); overflow: hidden; white-space: nowrap; }
.kp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kp-key { appearance: none; border: 1px solid var(--edge); background: var(--panel-2); color: var(--ink); border-radius: var(--r-sm); height: 44px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font: inherit; }
.kp-key b { font-size: 17px; font-weight: 600; line-height: 1.1; }
.kp-key small { font-size: 8.5px; letter-spacing: 1px; color: var(--muted); min-height: 10px; }
.kp-key:hover { background: #28313b; border-color: #4a5e66; }
.kp-key.down, .kp-key:active { background: var(--accent); color: var(--accent-ink); }
.kp-foot { text-align: center; margin-top: 8px; }
.kpi.warn .v { color: var(--warn); }
td.good { color: var(--ok); } td.warn { color: var(--warn); } td.bad, .small.bad, .call-log .bad { color: var(--bad); }
.call-info div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.call-info span { color: var(--muted); }
.call-info b { font-weight: 500; overflow-wrap: anywhere; text-align: right; }
.call-log { max-height: 220px; overflow: auto; line-height: 1.6; }
.call-log .hdrs { margin: 0 0 4px 16px; color: var(--ink-2); }
.mini-audio { height: 28px; width: 220px; }
tr.sel td { background: rgba(95, 212, 188, .07); }
.env-sum div { align-items: flex-start; }
.live-wave { margin-top: 12px; grid-template-columns: 92px 1fr; gap: 0 10px; }
.live-wave .pl-label { height: 38px; gap: 7px; }
.live-wave .pl-av { width: 20px; height: 20px; font-size: var(--fs-xs); }
.live-wave .pl-name { font-size: var(--fs-sm); }
.live-wave .pl-track { height: 38px; border-radius: 6px; margin-bottom: 4px; }
.lw-tracks { min-width: 0; }
.caller-recent tr.clickable { cursor: pointer; }
.caller-recent tr.clickable:hover td { background: rgba(255, 255, 255, .025); }
.caller-recent .caret { color: var(--muted); display: inline-block; width: 10px; }
.caller-recent tr.pl-row > td { padding: 4px 0 12px; background: transparent; }
.caller-recent tr.pl-row .player { margin: 0; }
.pager { justify-content: flex-end; }
/* ---------- scenario generator ---------- */
.modal-box:has(.gen-dlg) { width: min(980px, 100%); max-height: calc(100vh - 24px); overflow: auto; }
.gen-dlg { display: flex; flex-direction: column; gap: 14px; }
.gen-dlg textarea { width: 100%; resize: vertical; }
.gen-out { display: flex; flex-direction: column; gap: 8px; }
.gen-bar { border-top: 1px solid var(--line); padding-top: 12px; }
.gen-card { border: 1px solid var(--edge); border-radius: var(--r-sm); padding: 10px 12px; background: #1a2027; display: flex; flex-direction: column; gap: 6px; }
.gen-card.off { opacity: .5; }
.gen-card .gen-name { flex: 1; min-width: 200px; font-weight: 600; }
.gen-card summary { cursor: pointer; }
.gen-steps { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.gen-goal { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.scn-steps { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; counter-reset: st; position: relative; }
.scn-steps li { counter-increment: st; padding: 6px 8px 6px 30px; position: relative; border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer; font-size: var(--fs-sm); }
.scn-steps li::before { content: counter(st); position: absolute; left: 9px; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: #26313a; color: var(--muted); font-size: 10px; display: flex; align-items: center; justify-content: center; }
.scn-steps li.cur { background: rgba(95, 212, 188, .08); border-color: rgba(95, 212, 188, .35); }
.scn-steps li.cur:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(95, 212, 188, .25); }
.scn-steps li.cur::before { background: var(--accent); color: var(--accent-ink); }
.scn-steps li.done { opacity: .55; }
.scn-steps li.done::before { content: '✓'; background: var(--ok-soft); color: var(--ok); }
.scn-steps li.bye::before { content: '👋'; background: transparent; }
.scn-steps li .check { margin-top: 2px; }

/* SIP trace ladder (views.js sipLadder) */
.sip-ladder { font-size: var(--fs-sm); }
.sip-row { display: grid; grid-template-columns: 78px 1fr; align-items: end; cursor: pointer; border-radius: var(--r-sm); }
.sip-row:hover { background: rgba(255, 255, 255, .03); }
.sip-row.open { background: rgba(95, 212, 188, .06); }
.sip-head { cursor: default; align-items: center; margin-bottom: 4px; }
.sip-head:hover { background: none; }
.sip-lanes { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 0 4px; }
.sip-t { color: var(--muted); font-size: 11px; padding: 0 0 4px 4px; }
.sip-arr { position: relative; height: 30px; margin: 0 2px; border-left: 2px solid #34404b; border-right: 2px solid #34404b; }
.sip-arr .lb { position: absolute; left: 0; right: 0; top: 3px; text-align: center; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 14px; }
.sip-arr .ln { position: absolute; left: 6px; right: 6px; bottom: 7px; border-top: 2px solid currentColor; }
.sip-arr .ln::after { content: ''; position: absolute; top: -6px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.sip-arr.out .ln::after { right: -2px; border-left: 9px solid currentColor; }
.sip-arr.in .ln::after { left: -2px; border-right: 9px solid currentColor; }
.sip-arr.req { color: var(--accent); }
.sip-arr.prov { color: var(--muted); }
.sip-arr.ok { color: var(--ok); }
.sip-arr.warn { color: var(--warn); }
.sip-arr.bad { color: var(--bad); }
.sip-raw { margin: 4px 0 8px 78px; padding: 8px 10px; background: #0f1418; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 11.5px; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow: auto; }
.sip-det > summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }

/* run dialog: the estimate as metric tiles */
.est-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
@media (max-width: 720px) { .est-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.est-kpis .kpi { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line, rgba(255,255,255,.06)); }
.est-kpis .kpi .v { font-size: 16px; margin-top: 2px; }
.est-kpis .kpi .s { font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* run dialog: the 8 estimate tiles in one row on a wide window, and the chart keeps a readable height
   (the dialog scrolls instead of squeezing it) */
@media (min-width: 1000px) { .est-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; } }
.est-kpis .kpi { padding: 6px 10px; }
.est-kpis .kpi .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-kpis .kpi .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-box:has(.dials) > .run-chart { flex: 1 0 180px; min-height: 180px; }
@media (max-height: 720px) { .modal-box:has(.dials) > .run-chart { flex-basis: 150px; min-height: 150px; } }
.est-kpis .kpi .l { letter-spacing: .4px; }
/* a tile's problem: a triangle in its top right corner, the advice in the tooltip */
.kpi { position: relative; }
.kpi-alert { position: absolute; top: 8px; right: 8px; display: inline-flex; cursor: help; line-height: 0; outline: none; }
.kpi-alert.warn { color: var(--warn, #e0a83c); }
.kpi-alert.bad { color: var(--bad, #e05a5a); }
.kpi-alert:hover, .kpi-alert:focus-visible { filter: brightness(1.25); }
/* run dialog, compact top: each picker and its value on one line, the help lines tight under the field */
.modal-box:has(.dials) .run-row { gap: 8px 12px; margin-bottom: 10px; }
.modal-box:has(.dials) .f label { margin-bottom: 4px; }
.modal-box:has(.dials) .f .help { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-box:has(.dials) .run-row.who { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) auto; align-items: end; }
.run-row.who .f > div:not(.help) { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.run-row.who .f > div:not(.help) > div { margin-top: 0 !important; min-width: 0; }
.run-row.who .f > div:not(.help) > div:last-child { flex: 1 1 auto; }
.run-row.who .seg { flex: none; }
.run-row.who .seg button { padding: 6px 10px; }
.run-row.who .f select { min-width: 150px; }
.run-row.who .row.small { min-height: 0 !important; }
.run-row.who .caller-every { display: none; }
.modal-box:has(.dials) .run-judge { padding-bottom: 6px; }
@media (max-width: 900px) { .modal-box:has(.dials) .run-row.who { grid-template-columns: 1fr; } }
.modal-box:has(.dials) .run-row.who { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) auto; align-items: start; }
.modal-box:has(.dials) .run-row.who .run-judge { align-self: end; }
.run-row.who .row.small > * { white-space: nowrap; flex: none; }
.run-row.who .caller-eg { display: none; }
.run-row.who .seg button { padding: 6px 9px; }

/* ---------- sign-in, profile, password (account.js) ---------- */
body.signed-out .side { display: none; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; width: 100%; }
.auth-card { width: 100%; max-width: 380px; padding: 28px 28px 24px; }
.auth-card h1 { margin: 18px 0 6px; }
.auth-card .f { margin-top: 12px; }
.auth-card form .row { margin-top: 16px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand b { display: block; font-size: var(--fs-lg, 16px); }
.auth-brand span { font-size: var(--fs-sm); color: var(--muted); }
.auth-btn { width: 100%; justify-content: center; margin-top: 16px; padding: 8px 11px; }
.pw-rules { list-style: none; padding: 0; margin: 10px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.pw-rules li::before { content: "○"; display: inline-block; width: 18px; color: var(--faint); }
.pw-rules li.ok { color: var(--ink-2); }
.pw-rules li.ok::before { content: "✓"; color: var(--accent); }
.pw-form .f { margin-top: 12px; }
.pw-form .row { margin-top: 16px; }
.acct { max-width: 520px; }
.acct .f { margin-top: 12px; }
.acct form .row, form.acct .row { margin-top: 16px; }
.acct h2 { margin-top: 0; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; max-width: 1060px; }
.acct-grid .acct { max-width: none; }
.acct-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; font-size: var(--fs-md); }
.acct-facts dt { color: var(--muted); }
.acct-facts dd { margin: 0; }
input:disabled { opacity: .6; }
.side-user { display: flex; align-items: center; gap: 4px; margin: auto 10px 0; padding: 6px; border-top: 1px solid var(--line); }
.side-user + .side-foot { margin-top: 0; padding-top: 8px; }
.su-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: var(--r-sm); color: var(--side-ink, var(--ink-2)); text-decoration: none; }
.su-link:hover, .su-link.active { background: var(--panel); color: var(--ink); }
.su-av { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.su-name { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-out { flex: none; appearance: none; background: none; border: 0; padding: 6px; border-radius: var(--r-sm); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.su-out:hover { background: var(--panel); color: var(--ink); }
.su-out svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.signed-out main { padding: 0; }

/* ---------- Server Performance (perf.js) ---------- */
@media (min-width:1000px) { .perf-kpis { grid-template-columns: repeat(8, minmax(0,1fr)); } }
.perf-kpis .kpi .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 14px; margin-top: 14px; }
.perf-chart { padding-bottom: 10px; min-width: 0; overflow: hidden; }
.perf-chart .card-head { margin-bottom: 6px; padding-bottom: 6px; }
.perf-chart h2 { margin: 0; }
.perf-cv { position: relative; height: 210px; }
.perf-guide { margin-top: 14px; }
.perf-guide summary { cursor: pointer; }
.perf-guide table td { padding: 6px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.perf-guide table th { text-align: left; padding: 6px 10px; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .6px; }
.perf-guide td.num, .perf-guide th.num { text-align: right; white-space: nowrap; }
