/* Verner komponenter — bygget KUN på tokens.css. Klassenavne matcher facit i reference/.
   Grundregler og begrundelser: DESIGN.md. Farver kun via tokens (undtagen #fff og rgba-skygger/blur). */

/* ---------- grund ---------- */
* { box-sizing: border-box; }
html {
  background-color: var(--bg-3);
  background-image: radial-gradient(ellipse calc(100vw - var(--bg-x)) min(100vh, 1000px) at var(--bg-x) 0,
    var(--bg-0) 0%, var(--bg-1) 40%, var(--bg-2) 73%, var(--bg-3) 100%);
  background-attachment: fixed; background-repeat: no-repeat;
}
body { margin: 0; font-family: var(--font); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--c-text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: var(--focus); outline-offset: 2px; }
.nic { width: 20px; height: 20px; flex: 0 0 20px; }
.ic { width: 10px; height: 10px; display: block; }

/* ---------- sidehoved ---------- */
.eyebrow { margin: 0 0 var(--sp-1); color: var(--c-text-2); font-weight: var(--fw-medium); }
h1 { margin: 0; font-size: var(--fs-h2); line-height: var(--lh-title); font-weight: var(--fw-bold); color: var(--c-heading); letter-spacing: var(--ls-title); }
h1 .soft { color: var(--c-text-2); font-weight: var(--fw-regular); }
.meta { margin: var(--sp-1) 0 0; font-size: var(--fs-body); color: var(--c-text-2); font-weight: var(--fw-regular); } /* kommune · CTS-anlæg under h1 */
.when { display: flex; align-items: center; gap: var(--sp-1); margin: var(--sp-2) 0 0; color: var(--c-text-2); }
.when .nic { width: 16px; height: 16px; flex-basis: 16px; }

/* ---------- mærker ---------- */
.flag { display: inline-flex; padding: 2px var(--sp-2); border-radius: var(--r-tag); background: var(--c-sel); border: 1px solid var(--c-sel-bd); color: var(--c-heading); font-weight: var(--fw-medium); }
.badge { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-tag); font-weight: var(--fw-bold); line-height: 1; padding: 4px 6px; border-radius: var(--r-tag); border: 1px solid; font-variant-numeric: tabular-nums; }
.badge svg { width: 10px; height: 10px; }
.badge.up   { color: var(--trend-up-ink);   background: var(--trend-up-bg);   border-color: var(--trend-up-bd); }
.badge.flat { color: var(--trend-flat-ink); background: var(--trend-flat-bg); border-color: var(--trend-flat-bd); }
.badge.down { color: var(--trend-down-ink); background: var(--trend-down-bg); border-color: var(--trend-down-bd); }
.cnt { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 6px; border-radius: var(--r-tag); border: 1px solid; font-size: var(--fs-tag); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.cnt.teal   { color: var(--c-teal); background: var(--c-teal-bg); border-color: var(--c-teal-bd); }
.cnt.purple { color: var(--cnt-purple-ink); background: var(--cnt-purple-bg); border-color: var(--cnt-purple-bd); }
.cnt.blue   { color: var(--cnt-blue-ink); background: var(--cnt-blue-bg); border-color: var(--cnt-blue-bd); }
.cnt.red    { color: var(--cnt-red-ink); background: var(--cnt-red-bg); border-color: var(--cnt-red-bd); }
.pill { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 1px var(--sp-2) 1px 6px; border-radius: var(--r-tag); background: var(--trend-flat-bg); border: 1px solid var(--c-track); color: var(--c-text-2); font-weight: var(--fw-medium); }
.pill .nic { width: 16px; height: 16px; flex-basis: 16px; }

/* ---------- KPI-kort ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--sp-2); }
.kpi { position: relative; display: flex; flex-direction: column; min-width: 0; padding: var(--sp-3); border-radius: var(--r-panel); background: var(--c-surface); box-shadow: var(--shadow-card); overflow: hidden; }
.kpi.red { background: var(--g-red); } .kpi.yellow { background: var(--g-yellow); } .kpi.purple { background: var(--g-purple); }
.kpi.blue { background: var(--g-blue); } .kpi.teal { background: var(--g-teal); } .kpi.neutral { background: var(--g-neutral); }
.k-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-1); min-height: 28px; }
.k-label { min-width: 0; color: var(--c-heading); font-weight: var(--fw-bold); white-space: nowrap; }
.k-ic { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: grid; place-items: center; background: var(--c-surface); border: 1px solid var(--c-border); }
.k-ic .nic { width: 16px; height: 16px; flex-basis: 16px; }
.kpi.red .k-ic { color: var(--c-red); } .kpi.yellow .k-ic { color: var(--c-yellow); } .kpi.purple .k-ic { color: var(--c-purple); }
.kpi.blue .k-ic { color: var(--c-link); } .kpi.teal .k-ic { color: var(--c-teal); } .kpi.neutral .k-ic { color: var(--c-text-2); }
.k-val { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); margin-top: var(--sp-2); }
.k-n { font-size: var(--fs-kpi); line-height: 1; font-weight: var(--fw-bold); color: var(--c-heading); letter-spacing: var(--ls-kpi); font-variant-numeric: tabular-nums; }
.prog { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bar { display: block; height: 6px; border-radius: var(--r-pill); background: var(--c-track); overflow: hidden; }
.bar > span { display: block; height: 100%; min-width: 6px; border-radius: var(--r-pill); background: var(--c-teal); }
.pt { color: var(--c-text-2); }
/* link-kort: hele kortet er linket, label i linkfarve, INGEN pil */
a.kpi { cursor: pointer; transition: box-shadow .15s; }
a.kpi .k-label { color: var(--c-link); }
a.kpi:focus-visible { outline: var(--focus); outline-offset: 2px; }

/* ---------- liste-kort (fælles) ---------- */
.list { background: var(--c-surface); border-radius: var(--r-panel); box-shadow: var(--shadow-card); overflow: hidden; }
.t-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.t-head h2 { margin: 0; display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-row); font-weight: var(--fw-bold); color: var(--c-heading); }
.t-sub { margin: var(--sp-1) 0 0; color: var(--c-text-2); }
.legend { margin: 2px 0 0; color: var(--c-text-2); white-space: nowrap; }
.legend b { color: var(--c-heading); font-weight: var(--fw-bold); }
.l-head { background: var(--c-subtle); color: var(--c-muted); font-weight: var(--fw-medium); min-height: 52px; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.list > .l-head:first-child { border-top: 0; }
.chev { width: 16px; height: 16px; color: var(--c-muted); display: none; }

/* tabel: Bygninger */
/* 96 px: tre slags i én række (rød, gul, tvang) fylder 90 px. 76 px: «set 30. nov» fylder 72 px. */
.l-head.tbl, .row { display: grid; grid-template-columns: minmax(0,1fr) 96px 76px; column-gap: var(--sp-3); align-items: center; padding: 0 var(--sp-4); }
.l-head .r, .age { text-align: right; }
.l-head .x { display: none; }
.row { min-height: var(--row-min); }
.row + .row { border-top: 1px solid var(--c-border); }
/* Navne afkortes aldrig (LEARNINGS pkt. 8): et langt navn får flere linjer. */
.name { font-size: var(--fs-row); font-weight: var(--fw-bold); line-height: var(--lh-title); color: var(--c-heading); overflow-wrap: anywhere; }
.inds { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: center; }
.ind { display: inline-flex; align-items: center; gap: var(--sp-1); font-weight: var(--fw-bold); color: var(--c-text); font-variant-numeric: tabular-nums; }
.ind .ic { width: 9px; height: 9px; }
.ind.red .ic { color: var(--c-red); } .ind.yellow .ic { color: var(--c-yellow); }
.ind.purple .ic { color: var(--c-purple); width: 14px; height: 14px; margin: 0 -2px; }
.age { color: var(--c-text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* sagsrække: I dag (indbakke) */
/* Telefon: intet tal afkortes (LEARNINGS pkt. 49). */
.l-head.cs, .case { display: grid; grid-template-columns: 20px auto minmax(0,1fr); column-gap: var(--sp-3); padding: 0 var(--sp-4); }
.l-head.cs { align-items: center; }
.l-head.cs .h-d, .l-head.cs .x { display: none; }
/* rækken brydes som linjer: nummer og titel, derunder varighed og værdi. Er der ikke plads til værdien
   ved siden af varigheden (en lang status med CTS'ets ord), får den sin egen linje, og ordet står helt. */
.case { display: flex; flex-wrap: wrap; row-gap: var(--sp-1); align-items: flex-start; padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.case + .case { border-top: 1px solid var(--c-border); }
.case .rk { flex: 0 0 20px; color: var(--c-muted); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.35; padding-top: 1px; }
.c-main { flex: 0 0 calc(100% - 20px - var(--sp-3)); display: flex; flex-direction: column; min-width: 0; }
/* telefon: sagens navn fylder højst 2 linjer i rækken; hele navnet står i den åbnede sag. Beskrivelsen afkortes,
   koden i parentes sidst i navnet («(VEN04)») afkortes aldrig (Johnny 1. dec., LEARNINGS pkt. 65) */
.c-t { font-size: var(--fs-row); line-height: 1.35; }
.c-t:not(.coded), .c-t .c-h { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.c-t.coded { display: flex; align-items: flex-end; column-gap: var(--sp-1); }
.c-t .c-h { min-width: 0; }
.c-t .c-k { flex: none; white-space: nowrap; }
/* sagens navn fylder højst 2 linjer ved alle bredder; hele navnet står i sagen (Johnny 1. dec., LEARNINGS pkt. 72).
   Med JavaScript: beskrivelsen afkortes ord for ord, og koden står lige efter «…» med ét mellemrum.
   Hele navnet står stadig i siden for skærmlæsere (.c-h); den afkortede kopi (.c-cut) er skjult for dem. */
.c-cut { display: none; }
.c-t.coded.fitted { display: block; }
.c-t.fitted .c-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.c-t.fitted .c-cut { display: inline; }
/* bygning · anlæg: én linje med «…» ved alle bredder; hele teksten står i sagen (Johnny 1. dec., LEARNINGS pkt. 73) */
.c-p { color: var(--c-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-d { margin-left: calc(20px + var(--sp-3)); display: inline-flex; align-items: center; gap: var(--sp-1); white-space: nowrap; color: var(--c-text-2); }
.c-d .nic { width: 16px; height: 16px; flex-basis: 16px; color: var(--c-muted); }
.c-v { margin-left: auto; max-width: calc(100% - 20px - var(--sp-3)); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 0 var(--sp-2); min-width: 0; text-align: right; }
/* sidste udvej for ét ord, der er bredere end rækken: det brydes og står aldrig oven på varigheden */
.c-v .v { font-weight: var(--fw-bold); color: var(--c-text); overflow-wrap: anywhere; }
.c-v .sp { font-weight: var(--fw-regular); color: var(--c-text-2); white-space: nowrap; }
.d-unit { display: none; }
.case.new .c-t { font-weight: var(--fw-bold); color: var(--c-heading); }
.case.seen .c-t { font-weight: var(--fw-regular); color: var(--c-text-2); }
.case.seen .c-p, .case.seen .c-d, .case.seen .c-v .sp { color: var(--c-muted); }
.case.seen .c-v .v { font-weight: var(--fw-regular); color: var(--c-text-2); }
.case.seen .c-d .nic { color: var(--c-icon-dim); }
.case.sel { background: var(--c-selected); box-shadow: inset 3px 0 0 var(--c-link); }

/* «Mere i Verner» */
.more .t-head { padding-bottom: var(--sp-2); }
.m-row { display: grid; grid-template-columns: minmax(0,1fr) auto 16px; align-items: center; column-gap: var(--sp-3); min-height: var(--row-min); padding: 10px var(--sp-4); border-top: 1px solid var(--c-border); }
.m-l { display: flex; flex-direction: column; min-width: 0; }
.m-t { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-row); font-weight: var(--fw-bold); line-height: var(--lh-title); color: var(--c-heading); }
.m-t .lk { width: 12px; height: 12px; color: var(--c-purple); }
.m-s { color: var(--c-text-2); }
.m-n { font-weight: var(--fw-bold); color: var(--c-text); font-variant-numeric: tabular-nums; }
.m-row .chev { display: block; }

/* ---------- sagspanel ---------- */
.panel { background: var(--c-surface); border-radius: var(--r-panel); box-shadow: var(--shadow-card); overflow: hidden; }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--c-subtle); border-bottom: 1px solid var(--c-border); }
.p-n { color: var(--c-text-2); font-weight: var(--fw-medium); }
.p-body { padding: var(--sp-4); }
.crumb { margin: 0; color: var(--c-text-2); }
.crumb a { color: var(--c-link); text-decoration: underline; text-underline-offset: 2px; }
.p-t { margin: var(--sp-1) 0 var(--sp-4); font-size: var(--fs-h2); line-height: var(--lh-title); font-weight: var(--fw-bold); color: var(--c-heading); }
.strip { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border: 1px solid var(--c-border); border-radius: var(--r-inner); }
.strip > div { display: flex; flex-direction: column; gap: 2px; padding: 10px var(--sp-3); }
.strip > div + div { border-left: 1px solid var(--c-border); }
.s-l { color: var(--c-text-2); } .s-v { font-weight: var(--fw-bold); color: var(--c-heading); }
.p-note { margin: var(--sp-2) 0 var(--sp-4); color: var(--c-text-2); }
.assess { margin: 0 0 var(--sp-4); }
.assess .pill { margin-right: var(--sp-2); }
.sugg { padding: var(--sp-4); border-radius: var(--r-inner); border: 1px solid var(--c-teal-bd); background: linear-gradient(160deg, var(--c-sugg-top) 0%, var(--c-teal-bg) 100%); }
.sg-h { margin: 0 0 var(--sp-2); display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-bold); color: var(--c-teal); }
.fig { width: 28px; height: 28px; border-radius: var(--r-pill); display: grid; place-items: center; background: #fff; border: 1px solid var(--c-teal-bd); color: var(--c-teal); font-size: var(--fs-body); font-weight: var(--fw-bold); } /* 14 px: 13 px er kun for mærker og tællere (LEARNINGS pkt. 50) */
.sg-t { margin: 0; font-size: var(--fs-row); color: var(--c-text); }
.p-act { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-4); }

/* ---------- knapper ---------- */
.btn, .btn2, .lnk { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); font-weight: var(--fw-bold); }
.btn { padding: 0 var(--sp-4); border-radius: var(--r-field); background: var(--c-link); color: #fff; }
.btn2 { padding: 0 14px; border-radius: var(--r-field); background: #fff; border: 1px solid var(--c-border); color: var(--c-link); }
.lnk { color: var(--c-link); font-weight: var(--fw-medium); }
.btn .nic, .btn2 .nic { width: 16px; height: 16px; flex-basis: 16px; }
.btn:active, .btn2:active { transform: translateY(1px); }

/* ---------- hover: kun med mus ---------- */
@media (hover: hover) and (pointer: fine) {
  .row:hover, .case:hover, .m-row:hover { background: var(--c-hover); }
  a.kpi:hover, a.kpi.is-hover { box-shadow: var(--shadow-card-hover); }
  a.kpi:hover .k-label { text-decoration: underline; text-underline-offset: 2px; }
  .btn:hover { background: var(--c-link-hover); }
  .btn2:hover { border-color: var(--c-ring); background: var(--c-hover); }
  .lnk:hover { text-decoration: underline; text-underline-offset: 2px; }
  .s-item:hover { background: var(--c-subtle); }
}
/* demo-klasser, så tilstande kan ses på et stillbillede (brug ikke i appen) */
.is-hover { background: var(--c-hover) !important; }
a.kpi.is-hover { background: var(--g-neutral) !important; box-shadow: var(--shadow-card-hover); }
a.kpi.is-hover .k-label { text-decoration: underline; text-underline-offset: 2px; }
.btn.is-hover { background: var(--c-link-hover) !important; }
.is-focus { outline: var(--focus); outline-offset: 2px; }
.row.is-focus, .case.is-focus { outline-offset: -2px; }

/* ---------- sidemenu (fra 1024) ---------- */
.side { display: flex; flex-direction: column; gap: var(--sp-1); width: var(--side-w); background: var(--c-surface); padding: var(--sp-4) var(--sp-3); border-right: 1px solid var(--c-border); }
.s-brand { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2) var(--sp-4); font-size: var(--fs-row); font-weight: var(--fw-bold); color: var(--c-heading); }
.mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: var(--fw-bold); background: linear-gradient(135deg, var(--c-link), var(--c-heading)); }
.s-sec { margin: var(--sp-4) var(--sp-2) var(--sp-1); color: var(--c-muted); font-weight: var(--fw-medium); text-transform: uppercase; letter-spacing: .04em; }
.s-item { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding: 0 var(--sp-3); border-radius: var(--r-field); color: var(--c-text); font-weight: var(--fw-medium); }
.s-item .nic { color: var(--c-muted); }
.s-item.active { background: var(--c-sel); color: var(--c-heading); font-weight: var(--fw-bold); }
.s-item.active .nic { color: var(--c-link); }
.s-item .cnt { margin-left: auto; }

/* ---------- menu A: svævende pille (mobil, under 1024) ---------- */
.bnav { display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px; background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--c-menu-bd); border-radius: var(--r-pill); box-shadow: var(--shadow-menu); }
.bnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: var(--r-pill); color: var(--c-text-2); font-weight: var(--fw-medium); }
.bnav .ib { position: relative; display: inline-grid; place-items: center; }
.bnav .nic { color: var(--c-muted); }
.bnav .lb { line-height: 1.2; }
.bnav a[aria-current="page"] { color: var(--c-heading); font-weight: var(--fw-bold); }
.bnav a[aria-current="page"] .nic { color: var(--c-heading); }
.mcnt { position: absolute; top: -4px; left: calc(100% + 2px); display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: var(--r-tag); font-size: var(--fs-tag); font-weight: var(--fw-bold); color: var(--c-teal); background: var(--c-teal-bg); border: 1px solid var(--c-teal-bd); font-variant-numeric: tabular-nums; }
/* I appen: */
.app .bnav { position: fixed; left: var(--sp-4); right: var(--sp-4); bottom: calc(var(--menu-gap) + var(--sa)); z-index: 10; }
.app .main { padding-bottom: var(--main-pad-bottom); }

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  h1 { font-size: var(--fs-h1); line-height: 1.25; }
  .kpis { gap: var(--sp-4); }
  .kpi { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
  .k-ic { width: 32px; height: 32px; flex-basis: 32px; }
  .k-ic .nic { width: 18px; height: 18px; flex-basis: 18px; }
  .k-ic .ic { width: 12px; height: 12px; }
  .k-val { flex-direction: row; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); }
  .t-head { padding: var(--sp-5) var(--sp-6) var(--sp-3); }
  .chev { display: block; }
  .l-head.tbl, .row { grid-template-columns: minmax(0,1fr) 220px 120px 16px; column-gap: var(--sp-4); padding: 0 var(--sp-6); }
  .l-head .x { display: block; }
  .l-head.cs, .case { grid-template-columns: 24px minmax(0,1fr) 128px 132px 16px; column-gap: var(--sp-4); padding-left: var(--sp-6); padding-right: var(--sp-6); }
  .l-head.cs .h-d, .l-head.cs .x { display: block; }
  .case { display: grid; align-items: center; min-height: var(--row-min); padding-top: 10px; padding-bottom: 10px; }
  .case .c-d, .case .c-v { margin-left: 0; max-width: none; }
  .case .rk { align-self: baseline; }
  .case .c-v { flex-direction: column; align-items: flex-end; gap: 0; }
  .d-unit { display: inline; }
  .m-row { padding: 10px var(--sp-6); }
  .p-head { padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-6); }
  .p-body { padding: var(--sp-4) var(--sp-6) var(--sp-6); }
  .app .bnav { display: none; }
}

/* =====================================================================
   Tilføjet i pakken (1. dec. 2026) til sider uden facit: Bygning, Fund, Mail, Kørsler, undersider.
   Samme tokens og regler; Johnny har ikke set dem endnu → med i pilot-reviewet.
   ===================================================================== */

/* ---------- bemærkning / advarsel (aldrig fyldt farvefelt) ---------- */
.notice { display: grid; grid-template-columns: 28px minmax(0,1fr); column-gap: var(--sp-3); align-items: start; padding: var(--sp-3) var(--sp-4); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-inner); }
.notice .n-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--c-subtle); border: 1px solid var(--c-border); color: var(--c-link); }
.notice .n-ic .nic { width: 16px; height: 16px; flex-basis: 16px; }
.notice.warn .n-ic { color: var(--c-yellow); }
.notice .n-t { margin: 0; font-weight: var(--fw-bold); color: var(--c-heading); }
.notice .n-b { margin: 2px 0 0; color: var(--c-text); }
.notice ol, .notice ul { margin: var(--sp-1) 0 0; padding-left: 20px; }

/* ---------- filter-chips (Fund, I dag-undersider) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 14px; border-radius: var(--r-field); background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text-2); font-weight: var(--fw-medium); box-shadow: 0 1px 2px rgba(0,46,95,.04); }
.chip .ic { width: 9px; height: 9px; }
.chip .c-n { font-weight: var(--fw-bold); color: var(--c-text); font-variant-numeric: tabular-nums; }
.chip[aria-current="page"], .chip[aria-pressed="true"] { background: var(--c-sel); border-color: var(--c-sel-bd); color: var(--c-heading); font-weight: var(--fw-bold); }
.chip.red .ic { color: var(--c-red); } .chip.yellow .ic { color: var(--c-yellow); } .chip.purple .ic { color: var(--c-purple); width: 14px; height: 14px; }

/* ---------- fold (details/summary): virker uden JavaScript ---------- */
.fold { background: var(--c-surface); border-radius: var(--r-panel); box-shadow: var(--shadow-card); overflow: hidden; }
.fold + .fold { margin-top: var(--sp-3); }
.fold > summary { display: grid; grid-template-columns: minmax(0,1fr) auto 16px; align-items: center; column-gap: var(--sp-3); min-height: var(--row-min); padding: var(--sp-3) var(--sp-4); cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold .f-t { font-size: var(--fs-row); font-weight: var(--fw-bold); color: var(--c-heading); }
.fold .f-s { display: block; color: var(--c-text-2); font-size: var(--fs-body); font-weight: var(--fw-regular); }
.fold > summary .chev { display: block; transform: rotate(90deg); transition: transform .15s; }
.fold[open] > summary .chev { transform: rotate(-90deg); }
.fold > summary .inds { justify-content: flex-end; }
.fold .f-body { padding: 0 var(--sp-4) var(--sp-4); border-top: 1px solid var(--c-border); }
@media (prefers-reduced-motion: reduce) { .fold > summary .chev { transition: none; } }

/* ---------- formular: afkrydsningsrækker ---------- */
.checks { background: var(--c-surface); border-radius: var(--r-panel); box-shadow: var(--shadow-card); overflow: hidden; }
.check { display: grid; grid-template-columns: 24px minmax(0,1fr); column-gap: var(--sp-3); align-items: start; min-height: var(--row-min); padding: var(--sp-3) var(--sp-4); cursor: pointer; }
.check + .check { border-top: 1px solid var(--c-border); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--c-link); }
.check .ch-t { display: block; font-size: var(--fs-row); font-weight: var(--fw-bold); color: var(--c-heading); }
.check .ch-s { display: block; color: var(--c-text-2); }
.btn.wide { width: 100%; justify-content: center; }

/* ---------- tom tilstand ---------- */
.empty { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); background: var(--c-surface); border-radius: var(--r-panel); box-shadow: var(--shadow-card); }
.empty .e-ic { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; display: grid; place-items: center; background: var(--c-subtle); border: 1px solid var(--c-border); color: var(--c-text-2); } /* neutral: grøn er forbeholdt «ikke set» og Verners stemme */
.empty .e-t { margin: 0; font-weight: var(--fw-bold); color: var(--c-heading); }
.empty .e-s { margin: 0; color: var(--c-text-2); }

/* ---------- brødkrumme / tilbage ---------- */
.back { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--tap); color: var(--c-link-on-page); font-weight: var(--fw-medium); }
.back .nic { width: 16px; height: 16px; flex-basis: 16px; transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--c-ring); } .fold > summary:hover, .check:hover { background: var(--c-hover); } .back:hover { text-decoration: underline; text-underline-offset: 2px; } }

/* ---------- smalle telefoner (320–379 px): labels må bryde, aldrig afkortes ---------- */
@media (max-width: 379px) {
  .kpi { padding: 10px; }
  .k-ic { width: 24px; height: 24px; flex-basis: 24px; }
  .k-top { align-items: flex-start; }
  .k-label { white-space: normal; overflow: visible; }
  .k-n { font-size: 32px; }
  /* ikonet i ikke-alarm-kort er pynt; det giver plads til hele ordet («Alarmer») */
  .kpi.blue .k-ic, .kpi.teal .k-ic, .kpi.neutral .k-ic { display: none; }
}

/* ---------- tilstande fra Bygninger-piloten (1. dec. 2026, LEARNINGS pkt. 31–44) ---------- */
/* låsen i Tvang-kortets ikonfelt */
.kpi.purple .k-ic .ic { width: 13px; height: 13px; }
/* «Mindst»: ikke alle bygninger viser tallet på CTS-forsiden, så summen er en nedre grænse. Intet trendmærke. */
.k-pre { color: var(--c-text-2); font-weight: var(--fw-medium); line-height: 1; }
/* «ingen tal»: tallet vises ikke på CTS-forsiden. Aldrig 0. */
.unk { color: var(--c-text-2); white-space: nowrap; }
/* En række med flere linjer får luft. En ekstra linje i rækkens fulde bredde siger, når tallene er fra en
   tidligere kørsel (delvis kørsel, tal der ikke vises, bygning der ikke var med på CTS-forsiden). */
.row { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.row .sub { grid-column: 1 / -1; font-weight: var(--fw-regular); color: var(--c-text-2); }

/* «Mere» i menu A åbner Tvangsstyring, Kørsler og Mail over pillen, uden JavaScript (details/summary) */
.bnav-more { position: relative; }
.bnav summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: var(--r-pill); color: var(--c-text-2); font-weight: var(--fw-medium); cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.bnav summary::-webkit-details-marker { display: none; }
.bnav summary.current, .bnav-more[open] > summary { color: var(--c-heading); font-weight: var(--fw-bold); }
.bnav summary.current .nic, .bnav-more[open] > summary .nic { color: var(--c-heading); }
.bnav-pop { position: absolute; right: 0; bottom: calc(100% + var(--sp-3)); display: flex; flex-direction: column; gap: var(--sp-1); width: 240px; max-width: calc(100vw - var(--sp-8)); padding: var(--sp-2); border-radius: var(--r-panel); background: var(--c-surface); border: 1px solid var(--c-menu-bd); box-shadow: var(--shadow-menu); }
.bnav .bnav-pop a { flex-direction: row; justify-content: flex-start; gap: var(--sp-3); min-height: var(--tap); border-radius: var(--r-field); color: var(--c-text); font-weight: var(--fw-medium); }
.bnav .bnav-pop a.active { background: var(--c-sel); color: var(--c-heading); font-weight: var(--fw-bold); }
.bnav .bnav-pop a.active .nic { color: var(--c-link); }

/* «Kun læst» kan trykkes og viser én linje: «Verner ændrer aldrig noget i CTS.» (details/summary) */
.ro { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 2px var(--sp-2); border-radius: var(--r-tag); background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text-2); font-weight: var(--fw-medium); }
.ro .nic { width: 16px; height: 16px; flex-basis: 16px; color: var(--c-muted); }
.ro-more { position: relative; }
.ro-more > summary { display: inline-flex; align-items: center; min-height: var(--tap); cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.ro-more > summary::-webkit-details-marker, .s-more > summary::-webkit-details-marker { display: none; }
.ro-more > summary:focus-visible { outline: var(--focus); outline-offset: 2px; border-radius: var(--r-tag); }
.ro-pop { position: absolute; right: 0; top: 100%; z-index: 11; width: max-content; max-width: min(240px, calc(100vw - 96px)); margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-field); background: var(--c-surface); border: 1px solid var(--c-menu-bd); box-shadow: var(--shadow-menu); color: var(--c-text); }
.s-more > summary { cursor: pointer; list-style: none; }
.s-more > summary:focus-visible { outline: var(--focus); outline-offset: -2px; }
.s-note { margin: var(--sp-1) var(--sp-3) var(--sp-2); color: var(--c-text-2); }

@media (min-width: 1024px) {
  .kpi.purple .k-ic .ic { width: 15px; height: 15px; }
  /* listesider: <main class="main tbl-page">. Indholdet vokser med skærmen op til --table-max; kolonnerne står fast. */
  .main.tbl-page { max-width: calc(var(--table-max) + 2 * var(--sp-8)); }
}
@media (min-width: 1280px) {
  /* alarmerne tæt på navnet: navnet får højst --name-max. Et længere navn brydes. Fast gitter: alderen står
     lige efter alarmerne, ikke alene yderst til højre; den frie plads står før pilen (2. dec. 2026, LEARNINGS pkt. 105). */
  .l-head.tbl, .row { grid-template-columns: minmax(0, var(--name-max)) 220px 120px minmax(16px, 1fr); }
  .row > .chev { justify-self: end; }
  /* alderen står venstrestillet i sin kolonne, så den læses lige efter tallene */
  .row .age, .l-head.tbl .r { text-align: left; }
}
@media (min-width: 1440px) {
  /* listesider: rækker med navn og ét tal (m-row, fold) får samme faste gitter: navnet højst 560 px,
     tallet lige efter, den frie plads før pilen (pkt. 105) */
  .tbl-page .m-row, .tbl-page .fold > summary { grid-template-columns: minmax(0, 560px) auto minmax(16px, 1fr); }
  .tbl-page .m-row > .chev, .tbl-page .fold > summary > .chev { justify-self: end; }
}

/* Fund: én række pr. bygning med faste kolonner Røde · Gule · Tvang, tom celle, når der intet er
   (Johnny 1. dec.). Telefon: alderen står under navnet, så de tre kolonner har plads ved 320 px. */
.l-head.tbl.fc, .row.fc { grid-template-columns: minmax(0,1fr) 48px 48px 48px; column-gap: var(--sp-2); }
.row.fc .name { grid-column: 1; grid-row: 1; }
.row.fc .age { grid-column: 1; grid-row: 2; text-align: left; }
.row.fc .cell { grid-row: 1 / span 2; }
.row.fc .sub { grid-row: 3; }
.l-head.fc .h-age { display: none; }
@media (min-width: 1024px) {
  .l-head.tbl.fc, .row.fc { grid-template-columns: minmax(0,1fr) 72px 72px 72px 120px 16px; column-gap: var(--sp-4); }
  .row.fc .cell, .row.fc .age { grid-row: 1; }
  .row.fc .age { grid-column: 5; text-align: right; }
  .row.fc .sub { grid-row: 2; }
  .l-head.fc .h-age { display: block; }
}
@media (min-width: 1280px) {
  /* tallene tæt på navnet, som på Bygninger; alderen lige efter Tvang, den frie plads før pilen (pkt. 105) */
  .l-head.tbl.fc, .row.fc { grid-template-columns: minmax(0, var(--name-max)) 72px 72px 72px 120px minmax(16px, 1fr); }
  .row.fc .age { text-align: left; }
}
@media (hover: hover) and (pointer: fine) {
  .bnav summary:hover { color: var(--c-heading); }
}

/* ---------- tilstande fra «I dag» (1. dec. 2026, LEARNINGS pkt. 49 og frem) ---------- */
/* KPI-label: kort ord på telefon, hele ordet fra 1024 («Vigtige» / «Vigtige i dag») */
.k-label .l { display: none; }
/* liste + sagspanel. Under 1280 px skiftes de: sagen vises, når den er åbnet (class="today opened"). */
.col-l > * + *, .col-r > * + *, .cols > * + * { margin-top: var(--sp-4); }
.p-head { flex-wrap: wrap; row-gap: var(--sp-2); }
.p-back { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--tap); color: var(--c-link); font-weight: var(--fw-bold); }
.p-back .nic { width: 16px; height: 16px; flex-basis: 16px; transform: rotate(180deg); }
.p-pos { display: flex; align-items: center; gap: var(--sp-3); }
.p-nav { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
/* kun én af Status og Varighed: feltet fylder hele bredden */
.strip > div:only-child { grid-column: 1 / -1; }
.s-v .sp { font-weight: var(--fw-regular); color: var(--c-text-2); white-space: nowrap; }
.p-tags { margin: calc(-1 * var(--sp-2)) 0 var(--sp-4); }
@media (max-width: 1279px) {
  .today:not(.opened) .panel { display: none; }
  .today.opened .kpis, .today.opened > .note:not(.all-alarms), .today.opened .col-l, .today.opened .col-r > :not(.panel) { display: none; }
  /* sidens overskrift bliver stående for skærmlæsere; vejen til alle alarmer står under sagen */
  .today.opened .head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .today.opened .head .switch, .today.opened .head .when { display: none; }
  .today.opened .all-alarms { display: block; }
  /* uden panel ved siden af er ingen række valgt */
  .today:not(.opened) .case.sel { background: none; box-shadow: none; }
  .p-back + .p-n .p-grp { display: none; }
}
/* «Øvrige sager» står allerede i tilbage-linket */
.p-back.rest + .p-n .p-grp { display: none; }
.all-alarms { display: none; }
/* uden liste i venstre side (ingen sager, eller listerne læses ikke endnu) fylder højre side bredden */
.cols:not(:has(.col-l > *)) .col-l { display: none; }
@media (min-width: 1024px) {
  .k-label .s { display: none; }
  .k-label .l { display: inline; }
}
@media (min-width: 1280px) {
  .cols { display: grid; grid-template-columns: minmax(0,1fr) 420px; gap: var(--sp-4); align-items: start; }
  .cols > * + * { margin-top: 0; }
  .cols:not(:has(.col-l > *)) { grid-template-columns: minmax(0,1fr); }
  .p-back:not(.rest) { display: none; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
  /* listen ved siden af sagen: sagens navn får mindst 240 px, og intet ord brydes midt i (Johnny 1. dec., LEARNINGS pkt. 68).
     Sagen er 360 px bred, og rækken har mindre luft. Varigheden står på én linje, også «mindst 365 dage» (pkt. 74),
     og setpunktet står uden enhed, når målingen over det har samme enhed (§7). */
  .cols { grid-template-columns: minmax(0,1fr) 360px; }
  .l-head.cs, .case { grid-template-columns: 24px minmax(0,1fr) 132px 132px 16px; column-gap: var(--sp-2); padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .d-unit { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .today:not(.opened) .case.sel:hover { background: var(--c-hover); }
  .p-back:hover { text-decoration: underline; text-underline-offset: 2px; }
}
