/* Relay stats (static/relay/stats.html). Colors and the header come from /comms/calls_page.css, like the portal. The
 * chart colors were checked on the panel surface (#111a2e) with the dataviz validator: blue, orange and aqua pass every
 * check as a set; the outcome bar's two grays differ by lightness and are always labeled. */
:root {
    --s-opens: #3987e5; --s-conversations: #d95926; --s-handoffs: #199e70;
    --s-answered: #199e70; --s-missed: #64748b; --s-left: #94a3b8; --s-signups: #2dd4bf;
    --grid: rgba(148, 163, 184, .14); --good: #0ca30c;
}
body { height: auto; min-height: 100%; }
.st-month { background: var(--bg-panel); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 6px; padding: .3rem .45rem; font: inherit; }
.st-month[hidden], .st-main[hidden], .st-warn[hidden], .st-tip[hidden] { display: none; }
.st-link { color: var(--accent); font-size: .85rem; text-decoration: none; }
.st-link:hover { text-decoration: underline; }
.st-btn { background: var(--accent); color: #062a26; border: 0; border-radius: 8px; padding: .5rem .9rem; font: inherit; font-weight: 600; cursor: pointer; }
.st-btn.ghost { background: none; color: var(--text-primary); border: 1px solid var(--border-color); }
.st-btn[hidden] { display: none; }

.st-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.st-warn { background: rgba(250, 178, 25, .12); border: 1px solid rgba(250, 178, 25, .5); border-radius: 8px; padding: .55rem .8rem; font-size: .88rem; }
.st-section { margin: 0 0 2rem; }
.st-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin: 0 0 .7rem; }
.st-head h2 { margin: 0; font-size: 1.25rem; }
.st-head h2 small { color: var(--text-muted); font-weight: 500; font-size: .9rem; }
.st-note { color: var(--text-muted); font-size: .85rem; margin: 0; max-width: 46rem; }
.st-check { color: var(--text-muted); font-size: .88rem; display: flex; gap: .4rem; align-items: center; cursor: pointer; }
.st-check input { accent-color: var(--accent); }

.st-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: .8rem; margin: 0 0 .8rem; }
.st-cards { display: grid; gap: .8rem; }
.st-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-cards-6 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 .8rem; }
.st-card { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; padding: .9rem 1rem; margin: 0; min-width: 0; }
.st-card h3 { margin: 0 0 .5rem; font-size: 1rem; }
.st-stat .st-label { color: var(--text-muted); font-size: .82rem; font-weight: 600; }
.st-stat .st-value { font-size: 1.9rem; font-weight: 700; line-height: 1.15; margin: .2rem 0 .1rem; font-variant-numeric: tabular-nums; }
.st-stat .st-sub { color: var(--text-muted); font-size: .82rem; }
.st-stat .st-meter { display: block; height: 6px; margin-top: .5rem; background: rgba(148, 163, 184, .2); border-radius: 3px; overflow: hidden; }
.st-stat .st-meter span { display: block; height: 100%; background: var(--s-answered); border-radius: 3px; }

.st-chart figcaption { color: var(--text-muted); font-size: .82rem; font-weight: 600; margin: 0 0 .3rem; }
.st-plot { position: relative; height: 150px; }
.st-plot-tall { height: 240px; }
.st-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.st-plot .axis { fill: var(--text-muted); font-size: 11px; font-family: var(--font-sans); }
.st-plot .grid { stroke: var(--grid); stroke-width: 1; }
.st-plot .cross { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.st-plot .end-label { font-size: 11px; font-weight: 600; fill: var(--text-primary); font-family: var(--font-sans); }
.st-plot .bar-value { font-size: 11px; font-weight: 700; fill: var(--text-primary); font-family: var(--font-sans); }
.st-empty { color: var(--text-muted); font-size: .88rem; display: flex; align-items: center; justify-content: center; height: 100%; text-align: center; }
.st-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .82rem; color: var(--text-muted); margin: 0 0 .4rem; }
.st-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.st-legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; }
.st-legend i.sq { height: 10px; width: 10px; border-radius: 3px; }
.st-details { margin-top: .5rem; font-size: .85rem; }
.st-details summary { color: var(--accent); cursor: pointer; }
.st-scroll { overflow-x: auto; }

.st-tip { position: fixed; z-index: 20; pointer-events: none; background: #1e293b; border: 1px solid var(--border-color); border-radius: 8px; padding: .45rem .6rem; font-size: .8rem; line-height: 1.45; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); max-width: 260px; }
.st-tip b { display: block; margin-bottom: .1rem; }
.st-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; }

.st-list { padding: .3rem .6rem .6rem; overflow-x: auto; }
#st-signup-rows td:first-child { overflow-wrap: anywhere; }
#st-signup-rows td:nth-child(2) { white-space: nowrap; }
.st-table small.st-show-sm { display: none; }
.st-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.st-table th, .st-table td { text-align: left; padding: .5rem .45rem; border-top: 1px solid var(--border-color); vertical-align: top; }
.st-table th { color: var(--text-muted); font-weight: 600; border-top: 0; font-size: .8rem; }
.st-table.st-num td, .st-table.st-num th { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-table.st-num td:first-child, .st-table.st-num th:first-child { text-align: left; }
.st-table small { display: block; color: var(--text-muted); font-size: .8rem; }
.st-table tr.st-dim td { opacity: .55; }
.st-list .st-btn { margin: .4rem 0 0 .45rem; }
.st-chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: .08rem .45rem; border-radius: 999px; border: 1px solid var(--border-color); color: var(--text-muted); margin: .15rem .25rem 0 0; white-space: nowrap; }
.st-chip.live { color: var(--good); border-color: rgba(12, 163, 12, .55); }
.st-chip.code { color: var(--accent); border-color: rgba(45, 212, 191, .5); }
.st-chip.skip { color: #fab219; border-color: rgba(250, 178, 25, .5); cursor: help; }
.st-steps { display: flex; gap: 3px; margin-top: .3rem; max-width: 160px; }
.st-steps span { flex: 1; height: 4px; border-radius: 2px; background: rgba(148, 163, 184, .25); }
.st-steps span.done { background: var(--accent); }

.st-kind { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: .4rem .8rem; align-items: center; padding: .45rem 0; border-top: 1px solid var(--border-color); }
.st-kind:first-of-type { border-top: 0; }
.st-kind b { font-size: .9rem; }
.st-kind .st-nums { color: var(--text-muted); font-size: .82rem; white-space: nowrap; text-align: right; }
.st-seg { display: flex; gap: 2px; height: 14px; }
.st-seg span { display: block; min-width: 4px; height: 100%; }
.st-seg span:first-child { border-radius: 4px 0 0 4px; }
.st-seg span:last-child { border-radius: 0 4px 4px 0; }
.st-seg span:only-child { border-radius: 4px; }
.st-seg .none { flex: 1; background: rgba(148, 163, 184, .14); border-radius: 4px; }

.st-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .8rem; }
.st-site h3 { margin: 0; font-size: 1rem; display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.st-site h3 small { color: var(--text-muted); font-weight: 500; font-size: .78rem; white-space: nowrap; }
.st-site .st-id { color: var(--text-muted); font-size: .78rem; font-family: var(--font-mono); }
.st-site dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .6rem 0 .3rem; }
.st-site dt { color: var(--text-muted); font-size: .72rem; font-weight: 600; }
.st-site dd { margin: .1rem 0 0; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-site dd small { color: var(--text-muted); font-size: .72rem; font-weight: 500; }
.st-site.st-dim { opacity: .6; }
.st-spark { height: 30px; margin-top: .3rem; }
.st-spark svg { display: block; width: 100%; height: 100%; }
.st-spark-label { color: var(--text-muted); font-size: .72rem; }

@media (max-width: 760px) {
    .st-row { grid-template-columns: minmax(0, 1fr); }
    .cp-head { flex-wrap: wrap; }
    .st-kind { grid-template-columns: minmax(0, 1fr) auto; }
    .st-kind .st-seg { grid-column: 1 / -1; grid-row: 2; }
    .st-table .st-hide-sm { display: none; }
    .st-table small.st-show-sm { display: block; }
}
@media (forced-colors: active) {
    .st-seg span, .st-legend i, .st-steps span { forced-color-adjust: none; border: 1px solid CanvasText; }
}
