/* IT PC/Laptop PM Inventory Dashboard — styles (UTF-8, offline, no web fonts) */
:root {
  --font-sans: "Segoe UI", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  --radius: 6px;
  --gap: 14px;
}

/* ---------- Dark (default) ---------- */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0e10;
  --surface-1: #16181b;
  --surface-2: #1d2024;
  --surface-3: #252930;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #9a988f;
  --grid: #2a2d31;
  --axis: #3d4046;
  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);
  --accent: #3987e5;
  --accent-wash: rgba(57,135,229,0.16);
  --focus: #86b6ef;
  --link: #86b6ef;
  /* result (severity) */
  /* validated (dataviz validate_palette.js, adjacent pairs, surface #16181b) */
  --res-rm: #e45c5e;
  --res-prm: #a35303;
  --res-rb: #b88c19;
  --res-prb: #6556c8;
  --res-ok: #4ea739;
  /* categorical slots (dark steps) */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --neutral-fill: #6b6a64;
  --seq: #3987e5;
  --seq-track: #1c3556;
  --good-text: #3ccf3c;
  --bad-text: #ff8a8a;
  --warn-text: #ffc94d;
  --tip-bg: #f0efec;
  --tip-fg: #0b0b0b;
}

/* ---------- Light ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f4f4f1;
  --surface-1: #fcfcfb;
  --surface-2: #f3f3f0;
  --surface-3: #e9e8e3;
  --text-primary: #0b0b0b;
  --text-secondary: #42413e;
  --text-muted: #67655f;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11,11,11,0.12);
  --border-strong: rgba(11,11,11,0.22);
  --accent: #2a78d6;
  --accent-wash: rgba(42,120,214,0.12);
  --focus: #1c5cab;
  --link: #1c5cab;
  /* validated (adjacent pairs, surface #fcfcfb) — sub-3:1 slots rely on visible labels + tables */
  --res-rm: #a61b1b;
  --res-prm: #d95926;
  --res-rb: #eda100;
  --res-prb: #6250d6;
  --res-ok: #0ca30c;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --neutral-fill: #a9a79f;
  --seq: #2a78d6;
  --seq-track: #cde2fb;
  --good-text: #006300;
  --bad-text: #b02525;
  --warn-text: #8a5a00;
  --tip-bg: #1a1a19;
  --tip-fg: #f0efec;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--page);
  color: var(--text-primary);
  min-width: 360px;
}
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, select, input { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.app-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); flex: none; }
.brand h1 { font-size: 15px; font-weight: 600; margin: 0; white-space: nowrap; }
.meta-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-secondary); flex: 1; min-width: 0; }
.meta-strip span b { color: var(--text-primary); font-weight: 500; }
.meta-strip .mono { font-size: 12px; }
.btn {
  border: 1px solid var(--border-strong); background: var(--surface-2);
  border-radius: var(--radius); padding: 5px 10px; cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 52px); }
.sidenav {
  border-right: 1px solid var(--border); background: var(--surface-1);
  padding: 12px 8px; position: sticky; top: 52px; height: calc(100vh - 52px); overflow: auto;
}
.sidenav ol { list-style: none; margin: 0; padding: 0; counter-reset: nav; }
.sidenav a {
  display: flex; gap: 8px; align-items: baseline; padding: 7px 10px; border-radius: var(--radius);
  color: var(--text-secondary); text-decoration: none; font-size: 13.5px;
}
.sidenav a .idx { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); width: 16px; }
.sidenav a:hover { background: var(--surface-2); color: var(--text-primary); }
.sidenav a[aria-current="page"] { background: var(--accent-wash); color: var(--text-primary); box-shadow: inset 2px 0 0 var(--accent); }
.sidenav .nav-note { font-size: 11px; color: var(--text-muted); padding: 10px; border-top: 1px solid var(--border); margin-top: 10px; }
main { min-width: 0; padding: 0 18px 40px; }

/* ---------- Filter bar ---------- */
.filterbar {
  position: sticky; top: 52px; z-index: 20;
  background: var(--page);
  padding: 10px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.filter-row label { display: flex; flex-direction: column; font-size: 11px; color: var(--text-muted); gap: 2px; }
.filter-row select, .filter-row input[type="search"], .control {
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 5px 8px; font-size: 13px; min-width: 130px; max-width: 240px;
}
.filter-count { margin-left: auto; font-size: 12px; color: var(--text-secondary); align-self: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px 4px 2px 10px; background: var(--surface-1);
}
.chip .k { color: var(--text-muted); }
.chip button { border: 0; background: transparent; cursor: pointer; border-radius: 999px; width: 20px; height: 20px; line-height: 1; color: var(--text-secondary); }
.chip button:hover { background: var(--surface-3); }
.filterbar.disabled .filter-row, .filterbar.disabled .chips { display: none; }
.filterbar .scope-note { font-size: 12px; color: var(--text-muted); display: none; }
.filterbar.disabled .scope-note { display: block; }

/* ---------- Sections / cards ---------- */
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 0 12px; }
.section-head h2 { font-size: 18px; margin: 0; font-weight: 600; }
.section-head p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; min-width: 0;
}
.card h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card .sub { margin: 2px 0 10px; font-size: 12px; color: var(--text-muted); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.card-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.chart { width: 100%; min-height: 40px; position: relative; }
.chart svg { display: block; overflow: visible; }
.empty { color: var(--text-muted); font-size: 13px; padding: 18px 0; text-align: center; }

/* KPI tiles */
.kpis { display: grid; gap: var(--gap); grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: var(--gap); }
.kpi { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.kpi .label { font-size: 12px; color: var(--text-secondary); }
.kpi .value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; letter-spacing: -0.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; color: var(--text-secondary); font-weight: 400; margin-left: 4px; }
.kpi .foot { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.kpi .bar { height: 4px; background: var(--seq-track); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.kpi .bar > i { display: block; height: 100%; background: var(--seq); border-radius: 0 2px 2px 0; }

/* Insights */
.insights { border-left: 2px solid var(--accent); }
.insights ul { margin: 6px 0 0; padding-left: 18px; }
.insights li { margin: 3px 0; color: var(--text-secondary); }
.insights li b { color: var(--text-primary); font-weight: 600; }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-secondary); margin: 2px 0 8px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend svg { vertical-align: -2px; margin-right: 5px; }

/* SVG text */
.ax { font-family: var(--font-mono); font-size: 11px; fill: var(--text-muted); }
.lbl { font-family: var(--font-sans); font-size: 12px; fill: var(--text-secondary); }
.val { font-family: var(--font-mono); font-size: 11.5px; fill: var(--text-primary); }
.val-muted { font-family: var(--font-mono); font-size: 11px; fill: var(--text-muted); }
.gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.axisline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.thresh { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 4 3; }
.thresh-lbl { font-family: var(--font-mono); font-size: 11px; fill: var(--text-secondary); }
.hit { fill: transparent; cursor: default; }
.hit.clickable { cursor: pointer; }
.hit:hover, .hit:focus { fill: var(--accent-wash); }
.hit:focus { outline: none; stroke: var(--focus); stroke-width: 1.5; }
.row-selected { fill: var(--accent-wash); }
.dot { stroke: var(--surface-1); stroke-width: 1.5; }
.dot:hover { stroke: var(--text-primary); }

/* Tooltip */
#tip {
  position: fixed; z-index: 100; pointer-events: none; max-width: 340px;
  background: var(--tip-bg); color: var(--tip-fg); font-size: 12px; line-height: 1.45;
  padding: 7px 10px; border-radius: 6px; white-space: pre-line;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35); opacity: 0; transition: opacity .08s;
  font-family: var(--font-sans);
}
#tip.show { opacity: 1; }

/* Meters (compliance) */
.meter-row { display: grid; grid-template-columns: 170px 1fr 150px; gap: 10px; align-items: center; padding: 5px 0; }
.meter-row .name { font-size: 13px; color: var(--text-secondary); }
.meter-track { height: 10px; background: var(--seq-track); border-radius: 2px; overflow: hidden; }
.meter-track > i { display: block; height: 100%; background: var(--seq); border-radius: 0 3px 3px 0; }
.meter-row .v { font-family: var(--font-mono); font-size: 12.5px; text-align: right; }
.meter-row .v .no { color: var(--text-muted); }

/* Tables */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { padding: 6px 9px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { background: var(--surface-2); font-weight: 600; color: var(--text-secondary); position: sticky; top: 0; z-index: 1; white-space: nowrap; font-size: 12px; }
table.data th button.sort { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
table.data th button.sort .arr { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
table.data tfoot td { font-weight: 600; background: var(--surface-2); }
.inline-bar { display: flex; align-items: center; gap: 6px; min-width: 84px; }
.inline-bar .trk { flex: 1; height: 7px; background: var(--seq-track); border-radius: 2px; overflow: hidden; min-width: 34px; }
#srvTable th, #srvTable td { padding: 6px 6px; }
#srvTable td details { min-width: 190px; }
.inline-bar .trk > i { display: block; height: 100%; background: var(--seq); border-radius: 0 2px 2px 0; }
.inline-bar .trk > i.hot { background: var(--res-rm); }
.inline-bar .trk > i.warm { background: var(--res-rb); }
.inline-bar span { font-family: var(--font-mono); font-size: 11.5px; min-width: 42px; text-align: right; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 8px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }

/* Result badge */
.badge { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; }
.badge .sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-secondary); white-space: nowrap; margin: 1px 2px 1px 0; }
.tag.bad { color: var(--bad-text); border-color: currentColor; }
.tag.warn { color: var(--warn-text); border-color: currentColor; }
.tag.good { color: var(--good-text); border-color: currentColor; }
.yes { color: var(--good-text); } .no { color: var(--bad-text); } .na { color: var(--text-muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 60; display: none; }
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 100vw); z-index: 70;
  background: var(--surface-1); border-left: 1px solid var(--border-strong);
  transform: translateX(100%); transition: transform .18s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.drawer-head h3 { margin: 0; font-size: 16px; }
.drawer-head .sub { font-size: 12px; color: var(--text-muted); }
.drawer-body { padding: 12px 16px 30px; overflow: auto; flex: 1; }
.drawer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin: 16px 0 6px; font-weight: 600; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 3px 10px; margin: 0; font-size: 12.5px; }
dl.kv dt { color: var(--text-muted); }
dl.kv dd { margin: 0; word-break: break-word; }
.hist-card { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; background: var(--surface-2); }
.hist-card .yr { font-family: var(--font-mono); font-weight: 600; margin-right: 8px; }

/* Lists / notes */
.notes-list { margin: 0; padding-left: 18px; }
.notes-list li { margin: 6px 0; }
.finding { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); }
.finding .ft { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.finding .fd { color: var(--text-secondary); font-size: 12.5px; margin-top: 4px; }
details summary { cursor: pointer; color: var(--text-secondary); font-size: 12.5px; }
details[open] summary { margin-bottom: 4px; }
.plan-group { margin-bottom: 16px; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.seg-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.seg-toggle button { border: 0; background: var(--surface-2); padding: 4px 10px; cursor: pointer; font-size: 12.5px; }
.seg-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.cost-input { width: 140px; }
/* Section: สรุป Replace ≥ 5 ปี (rm5y) */
.rm5y .rm-type { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; }
.rm5y details.rm-group > summary { font-size: 13.5px; color: var(--text); padding: 4px 0; }
.rm5y details.rm-group { scroll-margin-top: 12px; }

/* ---------- Section: Laptop ≥ 5 ปี (scoped under .l5y; ported from laptop-5y.css) ---------- */
.l5y { --ink-lo: #0b0b0b; --ink-mid: #0b0b0b; --ink-hi: #0b0b0b; } /* in-segment count ink, dark theme */
:root[data-theme="light"] .l5y { --ink-lo: #ffffff; --ink-mid: #0b0b0b; --ink-hi: #ffffff; }
.l5y .l5-controls { margin-bottom: var(--gap); }
.l5y .ctl-grid { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-start; }
.l5y .ctl { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.l5y .lab { font-size: 11.5px; color: var(--text-muted); }
.l5y .ctl-q { flex: 1 1 220px; }
.l5y .ctl-q .control { max-width: none; width: 100%; }
.l5y .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.l5y .chk input { margin: 0; }
.l5y .chk .n { font-size: 11px; color: var(--text-muted); }
.l5y .type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.l5y .type-chips .btn .n { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.l5y .type-chips .btn[aria-pressed="false"] { color: var(--text-secondary); }
.l5y .type-chips .btn .ck { font-family: var(--font-mono); width: 12px; display: inline-block; }
.l5y .range-row { display: flex; flex-wrap: wrap; gap: 6px 36px; }
.l5y .perf-box { margin-top: 14px; flex: 1 1 320px; max-width: 620px; }
.l5y .perf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.l5y .perf-readout { font-size: 13px; color: var(--text-primary); }
.l5y .dual { position: relative; height: 30px; margin: 4px 0 6px; }
.l5y .dual .trk, .l5y .dual .fill { position: absolute; top: 13px; height: 4px; border-radius: 2px; pointer-events: none; }
.l5y .dual .trk { left: 8px; right: 8px; background: var(--seq-track); }
.l5y .dual .fill { background: var(--seq); }
.l5y .dual input[type="range"] {
  position: absolute; left: 0; top: 0; width: 100%; height: 30px; margin: 0; padding: 0;
  background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.l5y .dual input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 30px; border: 0; }
.l5y .dual input[type="range"]::-moz-range-track { background: transparent; border: 0; }
.l5y .dual input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: pointer;
  width: 16px; height: 16px; border-radius: 50%; margin-top: 7px;
  background: var(--surface-1); border: 2px solid var(--accent);
}
.l5y .dual input[type="range"]::-moz-range-thumb {
  pointer-events: auto; cursor: pointer; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface-1); border: 2px solid var(--accent);
}
.l5y .dual input[type="range"]:focus { outline: none; }
.l5y .dual input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--focus); }
.l5y .dual input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--focus); }
.l5y .presets { display: flex; flex-wrap: wrap; gap: 6px; }
.l5y .presets .btn { font-size: 12.5px; padding: 3px 9px; }
.l5y .perf-note { margin: 8px 0 0; }
/* multi-select dropdowns (details/summary + checkbox list) */
.l5y .l5-facets { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.l5y details.l5-ms { position: relative; }
.l5y details.l5-ms > summary { list-style: none; cursor: pointer; display: block; min-width: 150px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 22px; position: relative; }
.l5y details.l5-ms > summary::-webkit-details-marker { display: none; }
.l5y details.l5-ms > summary::after { content: "▾"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 11px; }
.l5y details.l5-ms.on > summary { border-color: var(--accent); background: var(--accent-wash); }
.l5y .l5-ms-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 15; min-width: 260px; max-width: min(420px, 90vw);
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.30); padding: 8px;
}
.l5y .l5-ms-tools { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.l5y .l5-ms-tools .btn { font-size: 12px; padding: 2px 8px; }
.l5y .l5-ms-tools .control { min-width: 0; font-size: 12px; padding: 2px 6px; }
.l5y .l5-ms-list { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.l5y .l5-ms-list .chk { display: flex; align-items: flex-start; padding: 3px 4px; border-radius: 4px; }
.l5y .l5-ms-list .chk:hover { background: var(--surface-2); }
.l5y .l5-ms-list .chk input { margin-top: 3px; flex: none; }
.l5y .l5-ms-list .chk .t { flex: 1; color: var(--text-primary); overflow-wrap: anywhere; }
.l5y .l5-ms-list .chk .n { flex: none; }
.l5y .l5-ms-list .chk.zero .t { color: var(--text-muted); }
.l5y .l5-active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.l5y .l5-count { font-size: 12.5px; font-weight: 600; margin-right: 6px; }
.l5y .l5-notice {
  margin: 12px 0 0; font-size: 12.5px; color: var(--warn-text);
  border-left: 2px solid var(--res-rb); background: var(--surface-2); padding: 6px 10px; border-radius: 0 6px 6px 0;
  overflow-wrap: anywhere;
}
.l5y .l5-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.l5y .l5-scroll { max-height: 520px; }
.l5y .l5-devwrap { max-height: 70vh; }
.l5y table.data td.wrap { white-space: normal; min-width: 160px; }
.l5y table.data td.nowrap { white-space: nowrap; }
.l5y table.data tbody tr.is-selected { background: var(--accent-wash); }
.l5y .pbadge { display: inline-block; font-family: var(--font-mono); font-size: 12px; padding: 0 7px; border-radius: 999px; border: 1px solid currentColor; }
.l5y .pbadge.bad { color: var(--bad-text); }
.l5y .pbadge.good { color: var(--good-text); }
.l5y .seg-lbl { font-family: var(--font-mono); font-size: 11px; font-weight: 600; pointer-events: none; }
.l5y .l5-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.l5y .l5-foot p { margin: 4px 0; }
.l5y .l5-foot b { color: var(--text-secondary); }
@media (max-width: 1180px) { .l5y .l5-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .l5y .l5-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { .l5y .l5-controls .card-tools, .l5y #l5CsvBtn, .l5y .l5-ms-panel { display: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { position: sticky; top: 0; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 6px; z-index: 25; }
  .sidenav ol { display: flex; overflow-x: auto; gap: 2px; }
  .sidenav a { white-space: nowrap; }
  .sidenav .nav-note { display: none; }
  .app-header { position: static; }
  .filterbar { top: 44px; }
  .meter-row { grid-template-columns: 120px 1fr 120px; }
  dl.kv { grid-template-columns: 120px 1fr; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: span 12; }
}
@media (forced-colors: active) {
  .hit:focus { stroke: Highlight; }
}
@media print {
  .sidenav, .filterbar, .app-header .btn { display: none; }
  .layout { grid-template-columns: 1fr; }
}
