[hidden] { display: none !important; }
/* RW2 status page — the extension's palette (shared/ui.css). Themes: system (default), light, dark, OLED (pure black).
   Motion follows the extension: 0.26 s, cubic-bezier(.2,.8,.2,1); none with reduced motion. */
:root {
  --bg: #141414; --surface: #1c1c1c; --surface-2: #242424; --surface-3: #2d2d2d; --border: #2e2e2e; --border-strong: #404040;
  --text: #ececec; --muted: #8d8d8d; --accent: #d97757; --ok: #4bd18b; --warn: #e8a64a; --err: #ff7a6b; --none: #3a3a3a; --info: #6cb6ff;
  --c1: #6cb6ff; --c2: #4bd18b; --c3: #e8a64a; --c4: #c08cff; --c5: #ff7a6b; --c6: #8d8d8d;
  --serif: "Tiempos Headline", "Iowan Old Style", "Palatino Linotype", Palatino, "Noto Serif", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="oled"]) { --bg: #f3f3f3; --surface: #fff; --surface-2: #f6f6f6; --surface-3: #ececec; --border: #e3e3e3; --border-strong: #cdcdcd;
    --text: #191919; --muted: #6d6d6d; --accent: #c4623f; --ok: #1c9b62; --warn: #b06a00; --err: #d2402f; --none: #dedede; --info: #1f6fd1;
    --c1: #1f6fd1; --c2: #1c9b62; --c3: #b06a00; --c4: #7a4fd0; --c5: #d2402f; --c6: #6d6d6d; color-scheme: light; }
}
:root[data-theme="light"] { --bg: #f3f3f3; --surface: #fff; --surface-2: #f6f6f6; --surface-3: #ececec; --border: #e3e3e3; --border-strong: #cdcdcd;
  --text: #191919; --muted: #6d6d6d; --accent: #c4623f; --ok: #1c9b62; --warn: #b06a00; --err: #d2402f; --none: #dedede; --info: #1f6fd1;
  --c1: #1f6fd1; --c2: #1c9b62; --c3: #b06a00; --c4: #7a4fd0; --c5: #d2402f; --c6: #6d6d6d; color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="oled"] { --bg: #000; --surface: #000; --surface-2: #0b0b0b; --surface-3: #171717; --border: #1f1f1f; --border-strong: #2e2e2e; --none: #232323; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
.wrap { max-width: 920px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); display: grid; gap: 18px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
h1, h2 { margin: 0; font-weight: 500; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; } .brand b { font: 500 20px var(--serif); } .brand span { color: var(--muted); }
.ctrls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upd { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
.ring { width: 15px; height: 15px; flex: none; }
.ring circle { fill: none; stroke-width: 2.2; }
.ring .bgc { stroke: var(--border-strong); }
.ring .fg { stroke: var(--muted); stroke-linecap: round; stroke-dasharray: 37.7; transform: rotate(-90deg); transform-origin: 50% 50%; }
.upd.stale { color: var(--warn); } .upd.stale .fg { stroke: var(--warn); }
.upd.down { color: var(--err); } .upd.down .fg { stroke: var(--err); }

/* segmented switches with a sliding thumb */
.seg { position: relative; isolation: isolate; display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); }
.seg .thumb { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; background: var(--surface-3); z-index: -1;
  transition: transform .26s var(--ease), width .26s var(--ease); }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 4px 12px; border-radius: 999px; cursor: pointer; transition: color .2s; white-space: nowrap; }
.seg.sm button { padding: 3px 9px; font-size: 12px; }
.seg button[aria-pressed="true"] { color: var(--text); }
.seg:not(.ready) button[aria-pressed="true"] { background: var(--surface-3); }

/* the owner's notice */
.notice { border-radius: 18px; border: 1px solid var(--border); background: var(--surface); padding: 16px 18px; display: grid; gap: 10px; }
.notice[data-l=warn] { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.notice[data-l=down] { border-color: color-mix(in srgb, var(--err) 60%, var(--border)); background: color-mix(in srgb, var(--err) 6%, var(--surface)); }
.notice[data-l=maint] { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); border-style: dashed; }
.notice[data-l=info] { border-color: color-mix(in srgb, var(--info) 50%, var(--border)); }
.n-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice h2 { font: 500 21px/1.25 var(--serif); }
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tl li { display: grid; grid-template-columns: 140px 1fr; gap: 2px 14px; }
.tl .st { font-weight: 600; } .tl .when { grid-column: 2; color: var(--muted); font-size: 12px; }
@media (max-width: 560px) { .tl li { grid-template-columns: 1fr; } .tl .when { grid-column: 1; } }

.banner { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.banner h1 { font: 500 24px/1.2 var(--serif); }
.banner p { margin: 2px 0 0; color: var(--muted); }
.b-ico { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--none); position: relative; transition: background-color .3s; }
.b-ico::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.banner[data-s=ok] { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); } .banner[data-s=ok] .b-ico { background: var(--ok); }
.banner[data-s=warn] { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); } .banner[data-s=warn] .b-ico { background: var(--warn); }
.banner[data-s=down] { border-color: color-mix(in srgb, var(--err) 60%, var(--border)); } .banner[data-s=down] .b-ico { background: var(--err); }
.banner[data-s=maint] { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); border-style: dashed; }
.banner[data-s=maint] .b-ico { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, color-mix(in srgb, var(--warn) 35%, var(--surface)) 3px 6px); }

.card { padding: 16px 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 10px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card h2 { font: 500 18px var(--serif); }
.card > p { margin: -4px 0 0; }
.fade { transition: opacity .2s ease; } .fade.out { opacity: 0; }
.chart-wrap { position: relative; }
#chart { display: block; width: 100%; height: 220px; }
#chart .grid line { stroke: var(--border); }
#chart .axis text { fill: var(--muted); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
#chart .line { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
#chart .spike { opacity: .18; }
#chart .gap { fill: color-mix(in srgb, var(--err) 14%, transparent); }
#chart .cursor { stroke: var(--border-strong); }
#chart.swap { animation: chartIn .32s var(--ease); }
@keyframes chartIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tip { position: absolute; top: 6px; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 160px; z-index: 2; }
.tip .r { display: flex; align-items: center; gap: 6px; } .tip .r b { margin-left: auto; padding-left: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }

#groups { display: grid; gap: 18px; }
.comp { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.comp:first-of-type { border-top: 0; }
.c-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.c-name img { width: 21px; height: 15px; border-radius: 3px; object-fit: cover; flex: none; }
.c-right { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px 1px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap; }
.pill[data-s=ok] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.pill[data-s=warn] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.pill[data-s=down] { color: var(--err); border-color: color-mix(in srgb, var(--err) 55%, var(--border)); }
.pill[data-s=maint] { color: var(--warn); border-style: dashed; border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); }
.pill[data-s=info] { color: var(--info); border-color: color-mix(in srgb, var(--info) 50%, var(--border)); }
.bars { grid-column: 1 / -1; display: grid; gap: 2px; height: 30px; }
.bars i, .sw { background: var(--none); }
.bars i { display: block; border-radius: 2px; transform-origin: 50% 100%; cursor: default; }
.bars i.ok, .sw.ok { background: var(--ok); } .bars i.warn, .sw.warn { background: var(--warn); } .bars i.down, .sw.down { background: var(--err); }
.bars i.maint, .sw.maint { background: repeating-linear-gradient(135deg, var(--warn) 0 3px, color-mix(in srgb, var(--warn) 35%, var(--surface)) 3px 6px); }
.bars i.manual, .sw.manual { outline: 1px dashed var(--text); outline-offset: -1px; }
.bars i:hover { filter: brightness(1.25); }
.bars-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.daytip { position: fixed; z-index: 5; pointer-events: none; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 12px; max-width: 260px; }

.incidents { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.incidents li { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: baseline; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
.incidents li[data-open] { border-color: color-mix(in srgb, var(--err) 50%, var(--border)); }
.incidents li[data-open][data-s=warn] { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); }
.incidents li[data-open][data-s=maint] { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); border-style: dashed; }
.incidents .when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.incidents .empty { color: var(--muted); display: block; }
@media (max-width: 560px) { .incidents li { grid-template-columns: auto 1fr; } .incidents .when { grid-column: 1 / -1; } }
.btn { justify-self: start; border: 1px solid var(--border-strong); background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.inc-all { max-height: 420px; overflow: auto; display: grid; gap: 8px; padding-right: 4px; }
.inc-hint { text-align: center; padding: 6px; }
.legend-card { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.legend-card > span { display: inline-flex; align-items: center; gap: 6px; }
footer { text-align: center; }

/* theme change: colours glide instead of jumping */
html.theming, html.theming * { transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease), fill .35s, stroke .35s !important; }
.swap-t { transition: opacity .16s ease; } .swap-t.out { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .seg .thumb, .seg button, .fade, .swap-t, .b-ico { transition: none; } #chart.swap { animation: none; }
  html.theming, html.theming * { transition: none !important; }
}

/* before the data arrives: a spinner banner and grey placeholders (no fonts, no images; the text is in the HTML) */
html[lang=en] .ru, html:not([lang=en]) .en { display: none; }
.banner[data-s=load] .b-ico { background: conic-gradient(var(--muted) 0 28%, var(--none) 0); animation: rw2spin 1s linear infinite; }
@keyframes rw2spin { to { transform: rotate(1turn); } }
.sk { display: block; height: 12px; border-radius: 6px; background: var(--none); margin: 12px 0; }
.sk.w30 { width: 30%; height: 16px; } .sk.w40 { width: 45%; } .sk.bar { height: 30px; }
.chart-wrap.skel { min-height: 220px; border-radius: 12px; background: var(--none); }
.chart-wrap.skel svg { visibility: hidden; }
.skel-card .sk, .chart-wrap.skel { animation: rw2pulse 1.4s ease-in-out infinite; }
@keyframes rw2pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .banner[data-s=load] .b-ico, .skel-card .sk, .chart-wrap.skel { animation: none; } }

/* phones: the brand and "updated" share the first row, theme and language the second */
@media (max-width: 640px) {
  .top { flex-wrap: wrap; row-gap: 12px; }
  .top::before { content: ""; flex-basis: 100%; order: 3; }
  .ctrls { display: contents; }
  .brand { order: 1; flex: 1 1 auto; }
  .upd { order: 2; margin: 0; white-space: nowrap; }
  #theme { order: 4; }
  #lang { order: 5; margin-left: auto; }
}
@media (max-width: 400px) { .seg.sm button { padding: 4px 9px; } }
