:root {
  --bg: #FAF9F5;
  --surface: #FFFFFF;
  --surface-2: #F4F3EE;
  --text: #141413;
  --muted: #87867F;
  --line: #DEDCD1;
  --line-soft: #ECEAE2;
  --ok: #76AD2A;
  --degraded: #FAA72A;
  --partial: #E86235;
  --major: #E04343;
  --maint: #2C84DB;
  --nodata: #D6D4CB;
  --banner: #E04343;
  --banner-text: #FFFFFF;
  --link: #2C84DB;
  --accent: #5B4BF0;
  --shadow: 0 1px 2px rgba(20, 20, 19, .04);
  --tip-shadow: 0 10px 30px rgba(20, 20, 19, .14), 0 2px 6px rgba(20, 20, 19, .06);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F1E1D; --surface: #262624; --surface-2: #2E2D2A; --text: #F0EEE6; --muted: #A3A198; --line: #3A3935;
    --line-soft: #302F2C; --nodata: #4A4944; --link: #6AAEF0; --accent: #9C8CFF; --shadow: none;
    --tip-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --bg: #1F1E1D; --surface: #262624; --surface-2: #2E2D2A; --text: #F0EEE6; --muted: #A3A198; --line: #3A3935;
  --line-soft: #302F2C; --nodata: #4A4944; --link: #6AAEF0; --accent: #9C8CFF; --shadow: none;
  --tip-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.wrap { max-width: 940px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
h2 { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.block { margin-top: 22px; }

/* ─── banners ─── */
.banner { background: var(--banner); color: var(--banner-text); }
.banner.maint { background: var(--maint); }
.banner .wrap { display: flex; gap: 10px; align-items: flex-start; padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
.banner .bang { flex: none; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-top: 1px; }
.banner a { color: inherit; text-decoration: underline; }
.banner-meta { opacity: .85; }

/* ─── header ─── */
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding-top: 22px; padding-bottom: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.brand-accent { background: linear-gradient(90deg, #22b8f0, #6d4bf5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 13px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--text); }
.pill-link:hover { border-color: var(--muted); text-decoration: none; }
.pill-bell { cursor: pointer; font: inherit; font-size: 13px; }
.pill-bell:hover { border-color: var(--muted); }
.pill-bell.on { border-color: color-mix(in srgb, var(--ok) 60%, var(--line)); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--nodata); flex: none; }
.dot.st-OPERATIONAL { background: var(--ok); }
.dot.st-DEGRADED { background: var(--degraded); }
.dot.st-PARTIAL_OUTAGE { background: var(--partial); }
.dot.st-MAJOR_OUTAGE, .dot.st-OUTAGE { background: var(--major); }
.dot.st-MAINTENANCE { background: var(--maint); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 14px; font-size: 14px; cursor: pointer; color: var(--text); }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.small-btn { padding: 6px 12px; font-size: 13px; }
.btn.report { color: var(--partial); border-color: color-mix(in srgb, var(--partial) 40%, var(--line)); }

/* ─── overall ─── */
.overall { border-radius: var(--radius); padding: 14px 18px; color: #fff; font-size: 17px; font-weight: 600; background: var(--ok); }
.overall.minor { background: var(--degraded); }
.overall.partial { background: var(--partial); }
.overall.major { background: var(--major); }
.overall.maintenance { background: var(--maint); }
.overall.unknown { background: var(--muted); }
.overall-meta { margin: 8px 2px 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 14px; }
.overall-meta b { color: var(--text); font-weight: 600; }
.notice { margin-top: 10px; border: 1px solid var(--line); border-left: 3px solid var(--degraded); background: var(--surface); padding: 9px 14px; font-size: 13.5px; }

/* ─── active incident & planned ─── */
.incident-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--partial); padding: 12px 16px; margin-bottom: 10px; }
.incident-card.impact-major { border-left-color: var(--major); }
.incident-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.stage { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--partial); white-space: nowrap; }
.upd { margin: 6px 0 0; font-size: 14px; }
.planned { display: grid; gap: 8px; }
.plan-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.plan-date { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line-soft); padding-right: 10px; font-size: 12px; color: var(--muted); }
.plan-date b { font-size: 15px; color: var(--text); }
.plan-title { font-weight: 500; margin-top: 2px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.k-update { background: color-mix(in srgb, var(--banner) 12%, transparent); color: var(--banner); }
.badge.k-maintenance { background: color-mix(in srgb, var(--maint) 14%, transparent); color: var(--maint); }
.badge.k-outage_notice, .badge.impact-major { background: color-mix(in srgb, var(--major) 14%, transparent); color: var(--major); }
.badge.impact-partial { background: color-mix(in srgb, var(--partial) 14%, transparent); color: var(--partial); }
.badge.k-restored { background: color-mix(in srgb, var(--ok) 16%, transparent); color: #4f7d16; }

/* ─── toolbar ─── */
.toolbar { position: sticky; top: 0; z-index: 20; margin-top: 18px; padding: 10px 0; background: var(--bg); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { flex: 1 1 280px; }
.search input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; background: var(--surface); color: var(--text); font-size: 14.5px; outline: none; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.toolbar-row { display: flex; gap: 10px; align-items: center; max-width: 100%; }
.chips, .seg { display: flex; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip span { color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .7; }
.seg { border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); gap: 0; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }

/* ─── tiles ─── */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tiles-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tiles-head h2 { margin-bottom: 8px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.tile-open { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; background: none; border: 0; padding: 10px 34px 10px 12px; cursor: pointer; min-width: 0; }
.tile-star { position: absolute; top: 5px; right: 4px; }
.tile:hover { border-color: var(--muted); }
.tile-name { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-status { font-size: 12.5px; }
.tile.t-DEGRADED, .tile.t-PARTIAL_OUTAGE, .tile.t-MAJOR_OUTAGE { border-color: color-mix(in srgb, var(--partial) 55%, var(--line)); }

/* ─── groups & rows ─── */
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); overflow: hidden; }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; background: var(--surface-2); border: 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; text-align: left; }
.group-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.gname { font-weight: 700; font-size: 15px; }
.ghint { font-size: 12.5px; color: var(--muted); }
.group.collapsed .group-body { display: none; }
.group.collapsed .group-head { border-bottom: 0; }
.chev { color: var(--muted); margin-left: 6px; display: inline-block; transition: transform .15s; }
.group.collapsed .chev { transform: rotate(-90deg); }

.svc { border-bottom: 1px solid var(--line-soft); }
.svc:last-child { border-bottom: 0; }
.svc.problem { background: color-mix(in srgb, var(--degraded) 6%, transparent); }
.svc-main { display: grid; grid-template-columns: 28px minmax(0, 1fr) 150px 52px 150px; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; min-height: 48px; }
.star { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; color: var(--nodata); font-size: 17px; border-radius: 6px; }
.star:hover { color: var(--muted); background: var(--surface-2); }
.star.on { color: #E8A317; }
.svc-title { min-width: 0; }
.svc-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.name-text { font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-text:hover { text-decoration: underline; }
.svc-sub { display: flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.site-link { color: var(--muted); }
.page-link { flex: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.page-link:hover { color: var(--text); text-decoration: none; }
.reports { color: var(--partial); }
.info { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font: italic 600 10.5px/1 Georgia, serif; cursor: help; }
.info:hover, .info:focus { color: var(--text); border-color: var(--muted); outline: none; }
.flag { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--banner); color: #fff; font-size: 11px; font-weight: 700; cursor: help; }
.svc-uptime { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.svc-status { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; font-size: 13.5px; border: 0; background: none; cursor: pointer; padding: 0; white-space: nowrap; }
.s-OPERATIONAL { color: #5E9120; }
.s-DEGRADED { color: #C98311; }
.s-PARTIAL_OUTAGE { color: var(--partial); }
.s-MAJOR_OUTAGE { color: var(--major); }
.s-MAINTENANCE { color: var(--maint); }
.s-UNKNOWN { color: var(--muted); }
.svc-reason { font-size: 12.5px; color: var(--muted); padding: 0 16px 8px 46px; margin-top: -4px; }

.mini-bars, .bars { display: flex; gap: 1px; align-items: stretch; }
.mini-bars { height: 18px; }
.bars { height: 30px; gap: 2px; }
.bar { flex: 1; min-width: 1px; border-radius: 1.5px; background: var(--nodata); position: relative; cursor: default; }
.bar.b-OPERATIONAL { background: var(--ok); }
.bar.b-DEGRADED { background: var(--degraded); }
.bar.b-PARTIAL_OUTAGE { background: var(--partial); }
.bar.b-MAJOR_OUTAGE { background: var(--major); }
.bar.b-MAINTENANCE { background: var(--maint); }
.bar.has-update::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--banner); border-radius: 1.5px 1.5px 0 0; }
.bar:hover { filter: brightness(.9); }
.bars-legend { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.bars-legend .line { flex: 1; border-bottom: 1px solid var(--line-soft); margin: 0 10px; }

/* ─── row detail ─── */
.detail { padding: 4px 16px 16px 46px; font-size: 13.5px; }
.detail-actions { margin: 12px 0 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.detail-body { margin-top: 8px; }
.detail h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.stat { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.stat .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.detail-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
.check-list li:last-child { border-bottom: 0; }
.check-sub { color: var(--muted); font-size: 12.5px; }
.mini-entry { font-size: 13px; padding: 3px 0; }
.spark { width: 100%; height: 44px; display: block; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.empty { padding: 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin: 6px 4px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--nodata); }
.lg-ok { background: var(--ok); } .lg-degraded { background: var(--degraded); } .lg-partial { background: var(--partial); }
.lg-major { background: var(--major); } .lg-maint { background: var(--maint); }
.lg-update { display: inline-block; width: 10px; height: 4px; border-radius: 1px; background: var(--banner); }

/* ─── history ─── */
.history { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin-top: 28px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin: 0 -16px 12px; padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 8px 10px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.timeline { display: flex; flex-direction: column; }
.tl-month { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 0 4px; }
.tl-month:first-child { padding-top: 0; }
.tl-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 170px; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); align-items: start; }
.tl-row:last-child { border-bottom: 0; }
.tl-date { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.tl-service { font-size: 12.5px; color: var(--muted); }
.tl-title { font-size: 14px; margin-top: 2px; }
.tl-body { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tl-src { font-size: 12.5px; color: var(--muted); text-align: right; }
.tl-src a { color: var(--muted); }
.more { background: none; border: 0; color: var(--link); cursor: pointer; padding: 10px 0 0; font-size: 14px; }
.empty-state { padding: 18px 0; }
.rules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0 12px; }
.rule { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
#rules p { margin: 0; font-size: 14px; }

footer { margin: 36px 0 32px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
footer .wrap { display: flex; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }

/* ─── tooltip ─── */
.tip { position: fixed; z-index: 60; width: max-content; max-width: min(300px, calc(100vw - 16px)); background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.4; box-shadow: var(--tip-shadow); pointer-events: none; }
.tip::after { content: ""; position: absolute; left: var(--arrow-x, 50%); width: 10px; height: 10px; background: var(--surface); border: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.tip[data-side="top"]::after { bottom: -6px; border-top: 0; border-left: 0; }
.tip[data-side="bottom"]::after { top: -6px; border-bottom: 0; border-right: 0; }
.tip-head { display: flex; align-items: center; gap: 7px; font-weight: 700; margin-bottom: 6px; }
.tip-row { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.tip-k { color: var(--muted); }
.tip-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-note { color: var(--muted); }
.tip-list { margin: 0 0 6px; padding-left: 16px; }
.tip-list li { margin: 1px 0; }
.tip-item { display: flex; gap: 6px; align-items: baseline; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.tip-item .badge { flex: none; }

/* ─── dialog ─── */
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); padding: 20px; max-width: 440px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(20,20,19,.4); }
dialog h3 { margin: 0 0 4px; font-size: 17px; }
.symptoms { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.symptoms label { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.symptoms label:has(input:checked) { border-color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.report-result { min-height: 18px; }

/* ─── tablet ─── */
@media (max-width: 860px) {
  .svc-main { grid-template-columns: 28px minmax(0, 1fr) 110px 132px; }
  .svc-uptime { display: none; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── mobile ─── */
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 12px; }
  header.top .wrap { padding-top: 14px; padding-bottom: 12px; }
  .brand-name { font-size: 18px; }
  .top-actions { width: 100%; }
  .pill-link { display: none; }
  .top-actions .pill { flex: 1; justify-content: center; }
  .overall { font-size: 16px; padding: 12px 14px; }
  .toolbar { margin-top: 12px; padding: 8px 0; gap: 8px; }
  .search { flex-basis: 100%; }
  .toolbar-row { width: 100%; justify-content: space-between; gap: 6px; min-width: 0; }
  .chips { gap: 4px; min-width: 0; }
  .chip { padding: 6px 9px; font-size: 12.5px; }
  .seg { flex: none; }
  .seg button { padding: 4px 9px; font-size: 15px; }
  .seg-label { display: none; }
  .toolbar-row::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tile { padding: 9px 10px; }
  .tile-name { font-size: 13.5px; }
  .group-head { padding: 10px 12px; }
  .ghint { display: none; }
  .svc-main { grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "star title status" ". bars bars"; row-gap: 6px; padding: 9px 12px 10px 4px; }
  .star { grid-area: star; width: 30px; height: 34px; }
  .svc-title { grid-area: title; }
  .svc-status { grid-area: status; min-height: 34px; font-size: 13px; }
  .mini-bars { grid-area: bars; height: 14px; }
  .svc-uptime { display: none; }
  .name-text { white-space: normal; }
  .svc-reason { padding: 0 12px 8px 34px; }
  .detail { padding: 2px 12px 14px 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-cols { grid-template-columns: 1fr; gap: 4px; }
  .bars { gap: 1px; }
  .plan-item { grid-template-columns: 52px 1fr; padding: 10px; }
  .history { padding: 12px; }
  .tabs { margin: 0 -12px 10px; padding: 0 8px; }
  .tl-row { grid-template-columns: 52px minmax(0, 1fr); }
  .tl-src { grid-column: 2; text-align: left; }
  .rules-grid { grid-template-columns: 1fr; }
  dialog { position: fixed; margin: auto auto 0; max-width: none; width: 100%; border-radius: 16px 16px 0 0; padding: 18px 16px 22px; }
  .symptoms label { padding: 12px; }
  .dialog-actions .btn { flex: 1; justify-content: center; padding: 10px; }
}

/* ─── language switch, crowd reports, last outage (i18n iteration) ─── */
.lang-switch { font-weight: 600; text-decoration: none; }
.lang-switch:hover { text-decoration: none; background: var(--surface-2); }
.svc-sub { align-items: center; row-gap: 3px; }
.last-outage { color: var(--muted); white-space: nowrap; cursor: help; border-bottom: 1px dotted var(--line); }
.last-outage:focus { outline: none; color: var(--text); }
.reports-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 12px; line-height: 18px;
  color: var(--partial); background: color-mix(in srgb, var(--partial) 12%, transparent); border: 1px solid color-mix(in srgb, var(--partial) 35%, transparent);
  white-space: nowrap; cursor: help; }
.reports-badge b { font-weight: 700; font-variant-numeric: tabular-nums; }
.reports-badge .rb-icon { font-size: 11px; }
.reports-badge.hot { color: #fff; background: var(--major); border-color: var(--major); }
.reports-badge.compact { padding: 0 6px 0 5px; font-size: 11.5px; cursor: inherit; }
.legend-badge { vertical-align: middle; }
.report-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--partial); cursor: pointer; white-space: nowrap; }
.report-link:hover { text-decoration: underline; }
.tile-status + .reports-badge, .tile-open .reports-badge { margin-top: 3px; align-self: flex-start; }
.rchart-wrap { margin: 12px 0 4px; }
.rchart-wrap h4 { margin: 0 0 6px; }
.rchart { display: flex; align-items: flex-end; gap: 3px; height: 44px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.rcol { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.rfill { width: 100%; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--partial) 70%, transparent); min-height: 0; }
.rcol.hot .rfill { background: var(--major); }
.rcol:hover .rfill { filter: brightness(.9); }
.tl-dur { font-weight: 600; }
.nowrap { white-space: nowrap; }
.record-actions-right { display: inline-flex; gap: 12px; align-items: center; }
@media (max-width: 640px) {
  .top-actions .lang-switch { flex: none; padding-left: 12px; padding-right: 12px; }
  .svc-sub { gap: 4px 10px; }
  .report-link { font-size: 12.5px; padding: 4px 0; }
  .rchart { gap: 2px; }
}
@media (max-width: 640px) {
  .top-actions { flex-wrap: wrap; gap: 6px; }
  .top-actions .pill-bell { flex-basis: 100%; }
}

/* language switch: «Қаз | Рус» */
.lang-seg { display: inline-flex; flex: none; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.lang-seg a { padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; line-height: 1.2; }
.lang-seg a:hover { color: var(--text); text-decoration: none; }
.lang-seg a[aria-current="true"] { background: var(--text); color: var(--bg); }
.tile-name { white-space: normal; overflow: visible; text-overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.tile-name .dot { vertical-align: 1px; margin-right: 6px; }
.top-actions .lang-seg { margin-left: auto; order: 99; }
@media (max-width: 640px) {
  .top-actions .lang-seg { order: 99; flex: none; margin-left: auto; }
  .top-actions .lang-seg a { padding: 6px 14px; }
}
