/* Cloud Systems brand: logo blue #007bff, logo red #c51717, Roboto. */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("brand/fonts/roboto-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("brand/fonts/roboto-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --surface-3: #e8e7e2;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7a7873;
  /* --brand is the logo blue; --accent is its AA-contrast shade for text and buttons. */
  --brand: #007bff;
  --brand-red: #c51717;
  --accent: #0069d9;
  --accent-ink: #ffffff;
  --accent-wash: rgba(0, 123, 255, 0.10);
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-text: #b42626;
  --series-1: #007bff;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-other: #b5b3ab;
  --seq-0: #cde2fb;
  --seq-1: #0d366b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --surface-3: #2c2c2a;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #8f8d87;
    --brand: #3d8ef0;
    --accent: #4d9fff;
    --accent-ink: #0b0b0b;
    --accent-wash: rgba(77, 159, 255, 0.16);
    --grid: #2c2c2a;
    --axis: #383835;
    --good-text: #0ca30c;
    --critical-text: #e66767;
    --series-1: #3d8ef0;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-other: #5d5c57;
    --seq-0: #1c2a3d;
    --seq-1: #6da7ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --surface-3: #2c2c2a;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #8f8d87;
  --brand: #3d8ef0;
  --accent: #4d9fff;
  --accent-ink: #0b0b0b;
  --accent-wash: rgba(77, 159, 255, 0.16);
  --grid: #2c2c2a;
  --axis: #383835;
  --good-text: #0ca30c;
  --critical-text: #e66767;
  --series-1: #3d8ef0;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-other: #5d5c57;
  --seq-0: #1c2a3d;
  --seq-1: #6da7ec;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 18px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: block; padding: 20px 18px 14px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 58px; width: auto; max-width: 100%; }
.brand .logo-dark { display: none; }
.brand-sub {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  color: var(--text-2); font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
}
.brand-sub .product { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.brand-sub .org { color: var(--muted); font-family: var(--mono); font-size: 11px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo-light { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: block; }
}
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.nav svg, .icon-btn svg, .btn svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.sidebar-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--border); font-size: 12.5px; }
.sidebar-foot .who { font-weight: 600; word-break: break-all; }
.sidebar-foot .sub { color: var(--muted); margin-top: 2px; word-break: break-all; }
.sidebar-foot .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-top: 3px solid var(--brand);
  padding: 12px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin-right: auto; }
.menu-btn { display: none; }
.period { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period-range { color: var(--muted); font-size: 12.5px; }
.view { padding: 20px 24px 48px; max-width: 1480px; width: 100%; outline: none; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------- controls ---------- */
.btn, .icon-btn, select, input[type=text], input[type=email], input[type=date], input[type=search], textarea {
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px;
}
select, input[type=text], input[type=email], input[type=date], input[type=search], textarea {
  padding: 6px 10px; min-height: 34px;
}
input[type=search] { min-width: 220px; }
textarea { width: 100%; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; min-height: 34px; cursor: pointer; font-weight: 500;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.topbar .mark { display: none; height: 26px; width: auto; }
.btn.danger { color: var(--critical-text); }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
label.check { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.seg button {
  font: inherit; background: var(--surface); color: var(--text-2);
  border: 0; padding: 6px 12px; cursor: pointer; min-height: 32px;
}
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.on { background: var(--accent-wash); color: var(--accent); font-weight: 600; }

/* ---------- layout ---------- */
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.side-main { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0;
}
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px 0;
}
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 14px 16px 16px; }
.card-body.flush { padding: 10px 0 0; }

/* ---------- KPI tiles ---------- */
.kpi { padding: 16px; }
.kpi .label { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 650; margin-top: 6px; letter-spacing: -0.02em; }
.kpi .foot { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.delta.up { color: var(--critical-text); }
.delta.down { color: var(--good-text); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); position: sticky; top: 0;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th .arrow { color: var(--accent); }
td.num, th.num { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
td .sub { color: var(--muted); font-size: 12px; }
td.wrap { white-space: normal; }
.empty { color: var(--muted); padding: 28px 16px; text-align: center; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 16px; color: var(--muted); font-size: 12.5px; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge.plain::before { display: none; }
.badge.good { color: var(--good-text); background: color-mix(in srgb, var(--good) 14%, transparent); }
.badge.warn { color: #8a5d00; background: color-mix(in srgb, var(--warning) 22%, transparent); }
.badge.bad { color: var(--critical-text); background: color-mix(in srgb, var(--critical) 14%, transparent); }
.badge.info { color: var(--accent); background: var(--accent-wash); }
:root[data-theme="dark"] .badge.warn { color: var(--warning); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.warn { color: var(--warning); } }
.chip {
  display: inline-flex; gap: 4px; align-items: center;
  font-size: 11.5px; padding: 1px 7px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  margin: 1px 2px 1px 0;
}
.chip b { font-weight: 600; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  font: inherit; font-size: 12.5px; cursor: pointer;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
}
.filter-chip b { color: var(--text); margin-left: 4px; }
.filter-chip.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }

/* ---------- org tree ---------- */
.tree { list-style: none; margin: 0; padding: 6px; }
.tree ul { list-style: none; margin: 0; padding-left: 14px; border-left: 1px solid var(--border); margin-left: 12px; }
.tree button {
  width: 100%; display: flex; align-items: center; gap: 8px;
  font: inherit; color: var(--text-2); background: none; border: 0;
  padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left;
}
.tree button:hover { background: var(--surface-2); color: var(--text); }
.tree button.on { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.tree .count { margin-left: auto; color: var(--muted); font-size: 12px; }
.tree svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .col:hover .hit { fill: var(--text); fill-opacity: 0.04; }
.chart .hit { fill: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 0 10px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 13px; }
.bar-row .val { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text); text-align: right; }
.bar-row .val .sub { color: var(--muted); font-size: 12px; margin-left: 6px; }
.bar-track { grid-column: 1 / -1; height: 10px; border-radius: 0 4px 4px 0; background: transparent; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
a.bar-row:hover { text-decoration: none; }
a.bar-row:hover .name { color: var(--accent); }

.heat td.cell { text-align: right; font-size: 12.5px; }

/* ---------- details page ---------- */
.detail-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head h2 { font-size: 20px; }
.detail-head .meta { color: var(--text-2); display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; }
.detail-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-all; }

/* ---------- shell & S3 ---------- */
.term {
  height: calc(100vh - 250px); min-height: 320px;
  background: #0b0f14; border-radius: var(--radius); padding: 8px 4px 8px 10px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.term .xterm { height: 100%; }
.term .xterm-viewport { border-radius: 6px; }
.codebox {
  display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.codebox code { white-space: pre-wrap; word-break: break-all; }
.s3-name { display: inline-flex; align-items: center; gap: 8px; }
.s3-icon { width: 15px; height: 15px; fill: none; stroke: var(--text-2); stroke-width: 1.4; stroke-linejoin: round; }
tr.clickable .s3-icon { stroke: var(--accent); }
[hidden] { display: none !important; }

/* ---------- insights ---------- */
.insight { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: flex-start; }
.insight:first-child { border-top: 0; }
.insight .icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 14px; }
.insight .icon.warn { background: color-mix(in srgb, var(--warning) 22%, transparent); color: #8a5d00; }
.insight .icon.bad { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical-text); }
.insight .icon.info { background: var(--accent-wash); color: var(--accent); }
.insight .title { font-weight: 600; }
.insight .desc { color: var(--text-2); font-size: 13px; margin-top: 2px; }

/* ---------- banner, toasts, tooltip, modal ---------- */
#banner:empty { display: none; }
.banner {
  margin: 16px 24px 0; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  display: flex; gap: 10px; align-items: flex-start; font-size: 13px;
}
.banner.error { border-color: color-mix(in srgb, var(--critical) 50%, transparent); background: color-mix(in srgb, var(--critical) 8%, var(--surface)); }
.banner.warn { border-color: color-mix(in srgb, var(--warning) 60%, transparent); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.banner .grow { flex: 1; word-break: break-word; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: 8px;
  box-shadow: var(--shadow); max-width: 380px; font-size: 13px; animation: rise 0.18s ease-out;
}
.toast.error { background: var(--critical); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
#tooltip {
  position: fixed; pointer-events: none; z-index: 200; display: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px;
  max-width: 320px; font-variant-numeric: tabular-nums;
}
#tooltip .tt-title { font-weight: 600; margin-bottom: 4px; }
#tooltip .tt-row { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
#tooltip .tt-row span:first-child { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tooltip .tt-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
#tooltip .tt-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; font-weight: 600; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 50;
  display: grid; place-items: center; padding: 16px;
}
.modal {
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow);
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  border: 1px solid var(--border);
}
.modal header { padding: 18px 20px 4px; }
.modal header p { color: var(--text-2); margin: 6px 0 0; font-size: 13px; }
.modal .body { padding: 14px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal footer { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field select { width: 100%; }
.tag-rows { display: flex; flex-direction: column; gap: 6px; }
.tag-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }
.notice {
  font-size: 13px; padding: 10px 12px; border-radius: 8px;
  background: color-mix(in srgb, var(--warning) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
}
.form-error { color: var(--critical-text); font-size: 13px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.main-side, .grid.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform 0.18s; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 30; }
  .menu-btn { display: inline-grid; }
  .topbar .mark { display: block; }
  .topbar { padding: 10px 16px; }
  .view { padding: 16px 16px 40px; }
  .term { height: calc(100vh - 230px); }
  .banner { margin: 12px 16px 0; }
  .grid.side-main { grid-template-columns: minmax(0, 1fr); }
  input[type=search] { min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
  .grid.kpis { grid-template-columns: minmax(0, 1fr); }
  .period { width: 100%; order: 10; }
  .period-range { display: none; }
  .period select, .period input[type=date] { flex: 1 1 30%; min-width: 0; }
}
@media (forced-colors: active) {
  .bar-fill, .legend i { forced-color-adjust: none; }
}
