/* osir.co.uk: True Speed & Lag Test */

/* Series colours (validated for colour-blind separation on both themes) and status colours */
:root { --st-dl: #2a78d6; --st-ul: #eb6834; --st-good: #0ca30c; --st-warn: #d99000; --st-serious: #e0703f; --st-bad: #d03b3b; --st-grid: rgba(16, 24, 48, .08); }
:root[data-theme="dark"] { --st-dl: #3987e5; --st-ul: #d95926; --st-good: #2fbf4a; --st-warn: #fab219; --st-serious: #ec835a; --st-bad: #e66767; --st-grid: rgba(255, 255, 255, .08); }

.st-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin: 0 4px 0 2px; }
.st-key-dl { background: var(--st-dl); }
.st-key-ul { background: var(--st-ul); }

/* Settings */
.st-adv { margin-top: 14px; }
.st-adv summary { cursor: pointer; font-weight: 650; font-size: 14px; color: var(--text-2); }
.st-adv-grid { display: grid; gap: 12px; margin-top: 12px; }
.st-adv-grid > div > span { display: block; font-size: 13px; font-weight: 650; color: var(--text-2); margin-bottom: 4px; }
.st-adv-grid .t-tab { padding: 5px 10px; font-size: 13px; }
.st-adv-grid .is-muted { opacity: .45; }
.st-seg .t-tab:disabled { cursor: not-allowed; }

/* Live panel */
.st-live-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; }
.st-phases { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.st-phases li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; font-size: 13px; font-weight: 650; color: var(--muted); background: var(--surface-2); }
.st-phases li span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11.5px; background: var(--border-strong); color: var(--text-2); }
.st-phases li.is-active { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--brand-1); }
.st-phases li.is-active span { background: var(--brand-1); color: #fff; }
.st-phases li.is-done span { background: var(--st-good); color: #fff; }
.st-progress { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 14px 0 8px; }
.st-progress i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--grad); transition: width .4s var(--ease); }

.st-readouts { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.st-ro { padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.st-ro span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.st-ro b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-ro small { font-size: 12px; color: var(--muted); font-weight: 600; }
.st-ro-dl { box-shadow: inset 3px 0 0 var(--st-dl); }
.st-ro-ul { box-shadow: inset 3px 0 0 var(--st-ul); }
.st-tone-good { color: var(--st-good); }
.st-tone-warn { color: var(--st-warn); }
.st-tone-serious { color: var(--st-serious); }
.st-tone-bad { color: var(--st-bad); }

.st-chart { margin: 16px 0 0; }
.st-chart canvas { display: block; width: 100%; height: 190px; }
.st-legend { margin-top: 6px; font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.st-legend .st-key + * { margin-right: 10px; }
.st-svg-wrap { position: relative; }
.st-svg-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.st-svg-wrap .ax { stroke: var(--border-strong); stroke-width: 1; }
.st-svg-wrap .grid { stroke: var(--st-grid); stroke-width: 1; }
.st-svg-wrap .lbl { fill: var(--muted); font-size: 11.5px; font-family: var(--font); }
.st-svg-wrap .lbl-strong { fill: var(--text-2); font-size: 12px; font-weight: 650; }
.st-svg-wrap .ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; }
.st-svg-wrap .limit { stroke: var(--st-bad); stroke-width: 1.2; stroke-dasharray: 5 4; opacity: .8; }
.st-svg-wrap .limit-lbl { fill: var(--st-bad); font-size: 11.5px; font-weight: 650; }
.st-svg-wrap .line-dl { fill: none; stroke: var(--st-dl); stroke-width: 2; stroke-linejoin: round; }
.st-svg-wrap .line-ul { fill: none; stroke: var(--st-ul); stroke-width: 2; stroke-linejoin: round; }
.st-svg-wrap .pt-dl { fill: var(--st-dl); stroke: var(--surface-solid); stroke-width: 2; }
.st-svg-wrap .pt-ul { fill: var(--st-ul); stroke: var(--surface-solid); stroke-width: 2; }
.st-svg-wrap .pt-unsat { fill: var(--surface-solid); stroke-width: 2; }
.st-svg-wrap .pt-dl.pt-unsat { stroke: var(--st-dl); }
.st-svg-wrap .pt-ul.pt-unsat { stroke: var(--st-ul); }
.st-svg-wrap .hit { fill: transparent; cursor: pointer; }
.st-svg-wrap .hover-line { stroke: var(--border-strong); stroke-width: 1; }
.st-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 170px; padding: 8px 10px; border-radius: 10px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 12.5px; line-height: 1.45; }
.st-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.st-tip .st-key { width: 9px; height: 9px; }

/* Summary */
.st-headline { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.st-grade { flex: none; display: grid; place-items: center; width: 92px; height: 92px; border-radius: 24px; font-size: 46px; font-weight: 850; letter-spacing: -.04em; color: #fff; background: var(--muted); }
.st-grade.g-good { background: var(--st-good); }
.st-grade.g-warn { background: var(--st-warn); color: #1d1300; }
.st-grade.g-serious { background: var(--st-serious); color: #1d0b00; }
.st-grade.g-bad { background: var(--st-bad); }
.st-headline > div:last-child { flex: 1 1 300px; }
.st-grade-label { font-size: 13px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.st-grade-text { margin-top: 4px; font-size: 16px; color: var(--text-2); }
.st-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.st-tile { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.st-tile span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.st-tile b { display: block; font-size: 28px; font-weight: 850; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.st-tile small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.st-dir h2 .st-key { width: 14px; height: 14px; }
.st-meter { height: 10px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 16px; }
.st-meter i { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; background: var(--muted); transition: width .5s var(--ease); }
.st-dir-dl .st-meter i { background: var(--st-dl); }
.st-dir-ul .st-meter i { background: var(--st-ul); }
.st-dir .t-kv dd { font-variant-numeric: tabular-nums; }

.st-h3 { font-size: 15px; font-weight: 750; margin: 18px 0 0; }
.st-table td, .st-table th { white-space: nowrap; }
.st-table td { font-variant-numeric: tabular-nums; }
.st-table tr.is-unsat td { color: var(--muted); }
.st-table .t-badge { font-size: 11.5px; }

/* Call quality */
.st-codecs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.st-codec { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.st-codec h3 { font-size: 15px; font-weight: 800; }
.st-codec .st-codec-desc { font-size: 12.5px; color: var(--muted); }
.st-codec .st-mos { font-size: 34px; font-weight: 850; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.st-codec .st-mos-sub { font-size: 12.5px; color: var(--muted); }
.st-codec .st-meter { margin-top: 8px; height: 8px; }
.st-codec .st-codec-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.st-matrix td.mos { font-weight: 700; }
.st-matrix tr.is-unsat td { opacity: .55; }

/* Log */
.st-log-wrap summary { cursor: pointer; font-weight: 700; }
.st-log { margin-top: 12px; max-height: 300px; overflow: auto; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font-family: var(--mono); font-size: 12px; line-height: 1.55; }
.st-log div { white-space: pre-wrap; word-break: break-word; }
.st-log .l-time { color: var(--muted); margin-right: 8px; }
.st-log .l-warn { color: var(--st-warn); }
.st-log .l-err { color: var(--st-bad); }
.st-log .l-ok { color: var(--st-good); }
.st-log .l-phase { font-weight: 700; }

@media (max-width: 1100px) { .st-readouts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .st-tiles, .st-codecs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .st-readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-ro b { font-size: 20px; }
  .st-tile b { font-size: 24px; }
  .st-grade { width: 72px; height: 72px; font-size: 36px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { .st-progress i, .st-meter i { transition: none; } }

@media print {
  body { background: #fff !important; }
  .site-header, .site-footer, .ambient, .no-print, .related, .skip, #st-live { display: none !important; }
  .t-card { box-shadow: none; break-inside: avoid; }
  .tool-hero .tool-badges { display: none; }
}
