:root {
    color-scheme: dark;
    font-family: Inter, Geist, system-ui, sans-serif;
    background: #0f1115;
    color: #f8f9fb;
    --surface: #151921;
    --inset: #101318;
    --line: #272e39;
    --muted: #bdc3ce;
    --accent: #ff78ad;
    --brand-pink: #ff398e;
    --brand-blue: #459bd0;
    --blue: #76b9e4;
    --action: #17618f;
    --warm: #f1c885;
    --danger: #ff819c;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; background: #0f1115; }
a { color: var(--blue); text-underline-offset: 0.25em; }
a:hover { color: #a8d8f7; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { max-width: 1560px; margin: 0 auto; padding: 0 clamp(15px, 4vw, 58px) 56px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px 0 25px; border-bottom: 1px solid var(--line); }
.wordmark, .masthead-actions { display: flex; align-items: center; gap: 15px; }
.wordmark h1 { margin: 0; font-size: clamp(1.4rem, 3.3vw, 2.5rem); font-weight: 790; letter-spacing: -0.065em; line-height: 1; }
.wordmark h1 span { font-weight: 900; letter-spacing: -0.035em; }
.brand-kajo { color: var(--brand-pink); }
.brand-mat { color: var(--brand-blue); }
.signal { width: 42px; height: 42px; flex: 0 0 42px; display: flex; align-items: center; justify-content: center; gap: 3px; color: var(--accent); background: var(--inset); border: 1px solid var(--line); border-radius: 11px; transform: rotate(-5deg); }
.signal i { display: block; width: 3px; height: 11px; border-radius: 2px; background: currentColor; }
.signal i:nth-child(2) { height: 22px; }
.signal i:nth-child(3) { height: 16px; }
.signal i:nth-child(4) { height: 8px; }
.button { border: 1px solid #394758; border-radius: 8px; color: #f0f3f9; background: #1e2835; min-height: 38px; padding: 8px 12px; font-size: .82rem; font-weight: 700; line-height: 1.25; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.button:hover:enabled, a.button:hover { background: #2b3b4c; color: white; }
.button.primary { background: var(--action); color: #f5f8ff; border-color: #2e78a7; }
.button.primary:hover:enabled, a.primary:hover { background: #2474a4; color: #f5f8ff; }
.button:disabled { opacity: .52; cursor: default; }
.button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.button.refresh { min-width: 40px; height: 40px; padding: 0; font-size: 1.3rem; }
.desk-info { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; column-gap: 18px; padding: 14px 0 23px; color: var(--muted); }
.desk-info p { margin: 4px 0; font-size: .86rem; }
.desk-clock time { color: #f1f3f8; font-weight: 680; font-variant-numeric: tabular-nums; }
.desk-clock span { margin-left: 6px; }
.last-fetch time { color: #f1f3f8; margin-left: 4px; }
.dot { display: inline-block; vertical-align: .06em; flex: 0 0 7px; height: 7px; width: 7px; margin-right: 6px; border-radius: 100%; background: #818b9a; }
.dot.ok { background: var(--blue); box-shadow: 0 0 10px #72b8e23d; }
.dot.partial, .dot.stale, .dot.busy { background: var(--warm); }
.dot.error { background: var(--danger); }
.desk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.desk-panel { min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; box-shadow: 0 15px 44px #07090e55; }
.panel-header { min-height: 107px; padding: 22px 20px 19px; display: flex; align-items: center; justify-content: space-between; gap: 9px; border-bottom: 1px solid var(--line); background: #191e27; }
.panel-header h2 { color: #fff; font-weight: 880; letter-spacing: -0.052em; font-size: clamp(1.65rem, 2.9vw, 2.55rem); line-height: 1; margin: 0 0 7px; }
.panel-header p { color: #bdc3ce; font-size: .77rem; font-weight: 610; margin: 0; }
.panel-body { padding: 15px; }
.panel-status { color: var(--muted); margin: 0 0 14px; font-size: .78rem; min-height: 1.15em; }
.script { border: 1px solid #303a48; border-radius: 11px; padding: 13px 15px 15px; background: var(--inset); }
.script-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.script-header h3, .detail-heading { margin: 0; font-size: .78rem; font-weight: 820; letter-spacing: .075em; text-transform: uppercase; }
.script-header h3 { color: var(--accent); }
.copy { min-height: 33px; padding: 5px 10px; }
.script-text { margin: 10px 0 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.58; font-size: .93rem; }
.script-text.empty { color: var(--muted); font-size: .86rem; }
.messages { margin: 13px 0 0; padding: 10px 12px 10px 26px; border-radius: 9px; border: 1px solid #623649; background: #261c25; color: #ffd3e2; font-size: .82rem; line-height: 1.45; }
.messages li + li { margin-top: 5px; }
.details:not(:empty) { margin-top: 18px; }
.detail-heading { margin-bottom: 9px; }
.source-card, .traffic-card { border-top: 1px solid var(--line); padding: 10px 0; }
.source-card h4, .traffic-card h4 { margin: 0; font-size: .93rem; line-height: 1.35; }
.meta-line { display: flex; flex-wrap: wrap; gap: 5px 11px; color: var(--muted); }
.meta-line a, .meta-line span { font-size: .77rem; overflow-wrap: anywhere; }
.source-card p, .traffic-card p { margin: 4px 0; }
.traffic-list, .forecast-list { list-style: none; padding: 0; margin: 0; }
.traffic-top, .place-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.traffic-top > div:nth-child(2) { flex: 1; }
.traffic-top p { font-size: .81rem; color: var(--muted); }
.rank { display: grid; place-items: center; flex: 0 0 28px; height: 28px; background: #2b202c; border: 1px solid #604254; border-radius: 7px; color: var(--accent); font-size: .8rem; font-weight: 820; }
.delay { display: flex; flex-direction: column; text-align: right; line-height: 1; gap: 4px; }
.delay strong { color: var(--accent); font-size: 1.64rem; font-variant-numeric: tabular-nums; }
.delay span, .muted { color: var(--muted); font-size: .77rem; }
.traffic-route { font-size: .88rem; }
.coverage { margin: 9px 0 0; }
.forecast, .warning { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 9px; background: #11151c; padding: 9px 10px; }
.forecast summary, .warning summary { font-size: .84rem; line-height: 1.4; font-weight: 740; cursor: pointer; }
.forecast-list { margin-top: 8px; }
.place { padding: 8px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.place-top > div { display: flex; flex-direction: column; gap: 2px; }
.place-top > div > span, .temps > span { color: var(--muted); font-size: .76rem; }
.temps strong { color: var(--blue); font-size: 1.12rem; }
.place p, .warning p { margin: 5px 0 0; line-height: 1.35; }
.warnings { margin-top: 16px; }
.warning { border-color: #57472f; }
.warning summary { color: var(--warm); }
.warning p { font-size: .78rem; }
.panel-footer:not(:empty) { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; font-size: .76rem; color: var(--muted); }
.panel-footer p { margin: 0 0 7px; }
.login { display: grid; place-items: center; padding: clamp(55px, 15vh, 155px) 0; }
.login-card { width: min(100%, 460px); padding: clamp(22px, 5vw, 37px); border: 1px solid #343e4c; border-radius: 17px; background: var(--surface); box-shadow: 0 18px 68px #08090e90; }
.login-card h2 { margin: 0; font-size: 1.75rem; letter-spacing: -.05em; }
.login-card p { color: var(--muted); line-height: 1.55; }
.login-card p.messages { padding-left: 12px; color: #ffd3e2; }
.login-card a { margin-top: 8px; }
@media (max-width: 1000px) {
    .desk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #traffic { grid-column: 1 / -1; }
    .traffic-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 680px) {
    .masthead { flex-wrap: wrap; gap: 14px; padding-top: 19px; }
    .masthead-actions { gap: 5px; width: 100%; justify-content: space-between; }
    .desk-grid, .traffic-list { grid-template-columns: minmax(0, 1fr); }
    .traffic-list { gap: 0; }
    .panel-header { min-height: 90px; padding: 16px; }
    .desk-info { padding-bottom: 16px; }
}
