/* Eiendomsoversikt — layout: top bar (bottom tab bar on phones), one main column of pages built from cards, tabs and tables. */
:root {
  --bg:#f2f5f6; --surface:#ffffff; --surface-2:#f7f9fa; --ink:#13232a; --muted:#5b6d75; --line:#d8e0e3; --weekend:#eef2f3;
  --accent:#0f6b72; --accent-ink:#ffffff; --accent-soft:#d5e9ea;
  --stay:#2f5fb3; --stay-ink:#ffffff; --stay-soft:#dce6f7;
  --arrive:#9a5c00; --arrive-soft:#fae6c4; --depart:#6046a8; --depart-soft:#e5ddf8;
  --good:#2c7647; --good-soft:#d6eedd; --warn:#c25e00; --warn-soft:#ffdcbc; --yellow:#d9ad00; --yellow-ink:#6b5300; --yellow-soft:#fff2ad; --orange:#e06800; --danger:#b3261e; --danger-soft:#f8dad7; --danger-ink:#ffffff;
  --past:#c9d3d7; --past-ink:#3d4e55; --scrim:rgba(8,20,24,.45);
  --shadow:0 10px 30px rgba(15,40,48,.18);
  --f-display:"Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body:"IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:"IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --cell:42px; --label:118px; --r:12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg:#0e1619; --surface:#162125; --surface-2:#1b282d; --ink:#e3ebed; --muted:#92a5ac; --line:#28373c; --weekend:#131e22;
  --accent:#4cb3b9; --accent-ink:#06191b; --accent-soft:#1b4245;
  --stay:#7fa6ef; --stay-ink:#0a1630; --stay-soft:#1f2f4f;
  --arrive:#efb25e; --arrive-soft:#46331a; --depart:#b8a1f0; --depart-soft:#33294f;
  --good:#6ccb8b; --good-soft:#1b3826; --warn:#ffa45c; --warn-soft:#4a2c14; --yellow:#f2d24b; --yellow-ink:#f2d24b; --yellow-soft:#3a3212; --orange:#ff8a2a; --danger:#ff8a80; --danger-soft:#4a1f1c; --danger-ink:#2a0806;
  --past:#33454b; --past-ink:#b6c6cb; --scrim:rgba(0,0,0,.6);
  --shadow:0 10px 30px rgba(0,0,0,.5); color-scheme:dark;
}}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--ink); font-family:var(--f-body); font-size:15px; line-height:1.45; }
[hidden] { display:none !important; }
a { color:var(--accent); }
h1, h2, h3 { font-family:var(--f-display); text-wrap:balance; margin:0; letter-spacing:-.01em; }
h1 { font-size:1.65rem; line-height:1.15; }
h2 { font-size:1.12rem; }
h3 { font-size:1rem; }
.mono, .num { font-family:var(--f-mono); font-variant-numeric:tabular-nums; }
.num { text-align:right; white-space:nowrap; }
.muted { color:var(--muted); }
.small { font-size:.85rem; }
.eyebrow { font-size:.72rem; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); font-weight:600; }
button { font:inherit; color:inherit; cursor:pointer; }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

/* ---------- buttons, chips ---------- */
.btn { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--surface); border-radius:10px; padding:9px 14px; font-weight:500; text-decoration:none; color:var(--ink); white-space:nowrap; }
.btn:hover { border-color:var(--accent); }
.btn.primary { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); font-weight:600; }
.btn.ghost { background:transparent; border-color:transparent; color:var(--muted); }
.btn.sm { padding:6px 10px; font-size:.88rem; }
.btn.danger { color:var(--danger); }
.btn.danger.armed { background:var(--danger); color:var(--danger-ink); border-color:var(--danger); }
.btn:disabled { opacity:.55; cursor:default; }
.chip { display:inline-block; font-size:.7rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; padding:3px 8px; border-radius:999px; white-space:nowrap; background:var(--surface-2); color:var(--muted); border:1px solid var(--line); }
.chip.rented, .chip.occupied { background:var(--accent-soft); color:var(--accent); border-color:transparent; }
.chip.arriving, .chip.turnover { background:var(--arrive-soft); color:var(--arrive); border-color:transparent; }
.chip.departing { background:var(--depart-soft); color:var(--depart); border-color:transparent; }
.chip.free, .chip.paid, .chip.ok { background:var(--good-soft); color:var(--good); border-color:transparent; }
.chip.open { background:var(--surface-2); color:var(--muted); }
.chip.overdue, .chip.lvl1 { background:var(--arrive-soft); color:var(--arrive); border-color:transparent; }
.chip.lvl2 { background:var(--warn-soft); color:var(--warn); border-color:transparent; }
.chip.lvl3 { background:var(--danger); color:var(--danger-ink); border-color:var(--danger); }
.chip.type { text-transform:none; letter-spacing:0; font-weight:500; }
.chip.u1 { }
.chip.u2 { background:var(--accent-soft); color:var(--accent); border-color:transparent; }
.chip.u3 { background:var(--arrive-soft); color:var(--arrive); border-color:transparent; }
.chip.u4 { background:var(--danger); color:var(--danger-ink); border-color:var(--danger); }

/* ---------- gates ---------- */
.gate { min-height:100vh; display:grid; place-items:center; padding-block:24px; padding-left:max(16px, env(safe-area-inset-left, 0px)); padding-right:max(16px, env(safe-area-inset-right, 0px)); }
.gate-card { width:100%; max-width:380px; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:24px; display:flex; flex-direction:column; gap:14px; }
.gate-card p { margin:0; color:var(--muted); }
.gate-card code { font-family:var(--f-mono); font-size:.85em; background:var(--bg); padding:1px 5px; border-radius:5px; }
.brand-lg { font-family:var(--f-display); font-weight:700; font-size:1.4rem; display:flex; align-items:center; gap:10px; }
.logo { width:26px; height:26px; border-radius:7px; background:var(--accent); position:relative; flex:none; }
.logo::after { content:""; position:absolute; inset:6px 6px 5px; background:var(--accent-ink); clip-path:polygon(50% 0, 100% 42%, 100% 100%, 0 100%, 0 42%); }

/* ---------- shell ---------- */
.topbar { position:sticky; top:0; z-index:15; background:var(--surface); border-bottom:1px solid var(--line); padding-top:env(safe-area-inset-top, 0px); }
.topbar-in { max-width:1200px; margin:0 auto; display:flex; align-items:center; gap:18px; height:58px; padding-left:max(16px, env(safe-area-inset-left, 0px)); padding-right:max(16px, env(safe-area-inset-right, 0px)); }
.brand { display:flex; align-items:center; gap:9px; font-family:var(--f-display); font-weight:700; font-size:1.08rem; color:var(--ink); text-decoration:none; }
.nav { display:flex; gap:4px; margin-left:12px; flex:1; }
.nav a { display:flex; align-items:center; gap:7px; padding:8px 12px; border-radius:9px; color:var(--muted); text-decoration:none; font-weight:500; }
.nav a:hover { color:var(--ink); background:var(--surface-2); }
.nav a.on { color:var(--accent); background:var(--accent-soft); }
.nav svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#btn-out { margin-left:auto; }
@media (max-width:760px) {
  .nav { position:fixed; left:0; right:0; bottom:0; margin:0; z-index:16; background:var(--surface); border-top:1px solid var(--line); justify-content:space-around; gap:0;
    padding:6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .nav a { flex-direction:column; gap:2px; font-size:.7rem; padding:6px 4px; flex:1; justify-content:center; background:transparent !important; }
  .nav svg { width:22px; height:22px; }
  .brand span:last-child { font-size:1rem; }
  .page { padding-bottom:calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
}
.notice-wrap { max-width:1200px; margin:0 auto; padding-left:max(16px, env(safe-area-inset-left, 0px)); padding-right:max(16px, env(safe-area-inset-right, 0px)); }
.notice { margin-top:12px; padding:10px 14px; border-radius:10px; background:var(--arrive-soft); font-size:.92rem; }
.page { max-width:1200px; margin:0 auto; padding-block:22px 64px; padding-left:max(16px, env(safe-area-inset-left, 0px)); padding-right:max(16px, env(safe-area-inset-right, 0px)); display:flex; flex-direction:column; gap:22px; }

/* ---------- page parts ---------- */
.page-head { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:12px; }
.page-head .titles { display:flex; flex-direction:column; gap:4px; min-width:0; }
.page-head .titles p { margin:0; color:var(--muted); }
.actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.crumbs { font-size:.85rem; color:var(--muted); display:flex; gap:6px; flex-wrap:wrap; }
.crumbs a { color:var(--muted); }
.section { display:flex; flex-direction:column; gap:12px; min-width:0; }
.section-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:16px; min-width:0; }
.card.pad-0 { padding:0; overflow:hidden; }
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; }
.grid.units { grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:10px; }
.tile { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:14px; display:flex; flex-direction:column; gap:7px; text-align:left; text-decoration:none; color:var(--ink); min-width:0; }
a.tile:hover, button.tile:hover { border-color:var(--accent); }
.tile-top { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.tile-name { font-weight:600; overflow-wrap:anywhere; }
.tile-line { font-size:.88rem; color:var(--muted); overflow-wrap:anywhere; }
.tile-line strong { color:var(--ink); font-weight:500; }
.chips { display:flex; flex-wrap:wrap; gap:5px; }
.meter { height:6px; border-radius:99px; background:var(--surface-2); border:1px solid var(--line); overflow:hidden; }
.meter i { display:block; height:100%; background:var(--accent); }

.stats { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:10px; }
.stat { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px; display:flex; flex-direction:column; gap:3px; min-width:0; }
.stat .v { font-family:var(--f-mono); font-size:1.25rem; font-weight:500; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.stat .v.neg { color:var(--danger); }
.stat .v.pos { color:var(--good); }
.stat .s { font-size:.8rem; color:var(--muted); }

.tabs { display:flex; gap:2px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar { display:none; }
.tabs a { padding:9px 13px; color:var(--muted); text-decoration:none; font-weight:500; border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap; }
.tabs a:hover { color:var(--ink); }
.tabs a.on { color:var(--accent); border-bottom-color:var(--accent); }

/* ---------- alerts ---------- */
.alerts { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:10px; }
.alert { background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--warn); border-radius:var(--r); padding:12px 14px; display:flex; flex-direction:column; gap:6px; text-decoration:none; color:var(--ink); min-width:0; }
.alert.l3 { border-left-color:var(--danger); }
.alert:hover { border-color:var(--accent); border-left-color:inherit; }
.alert.l3:hover { border-left-color:var(--danger); } .alert.l2:hover { border-left-color:var(--warn); }
.alert .who { font-weight:600; overflow-wrap:anywhere; }
.alert dl { margin:0; display:grid; grid-template-columns:auto 1fr; gap:2px 10px; font-size:.85rem; }
.alert dt { color:var(--muted); } .alert dd { margin:0; }

/* ---------- tables & lists ---------- */
.tbl-wrap { overflow-x:auto; }
table.tbl { width:100%; border-collapse:collapse; font-size:.9rem; }
.tbl th { text-align:left; font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600; padding:9px 12px; border-bottom:1px solid var(--line); white-space:nowrap; background:var(--surface-2); }
.tbl th.num { text-align:right; }
.tbl td { padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
.tbl tr:last-child td { border-bottom:0; }
.tbl tr.group td { background:var(--surface-2); font-weight:600; }
.tbl tr.total td { font-weight:600; border-top:2px solid var(--line); }
.tbl tr.click { cursor:pointer; } .tbl tr.click:hover td { background:var(--accent-soft); }
.tbl td.indent { padding-left:26px; }
.neg { color:var(--danger); } .pos { color:var(--good); }
.rows { display:flex; flex-direction:column; }
.row { display:flex; align-items:center; gap:12px; padding:11px 14px; border-bottom:1px solid var(--line); text-align:left; background:transparent; border-left:0; border-right:0; border-top:0; width:100%; min-width:0; }
.row:last-child { border-bottom:0; }
button.row:hover, .row.click:hover { background:var(--accent-soft); cursor:pointer; }
.row .main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; overflow-wrap:anywhere; }
.row .main .t { font-weight:500; }
.row .main .s { font-size:.84rem; color:var(--muted); }
.row .side { display:flex; flex-direction:column; align-items:flex-end; gap:3px; flex:none; }
.row.done .t { text-decoration:line-through; color:var(--muted); }
.check { width:22px; height:22px; border-radius:7px; border:2px solid var(--line); background:var(--surface); flex:none; display:grid; place-items:center; padding:0; }
.check.on { background:var(--accent); border-color:var(--accent); }
.check.on::after { content:""; width:10px; height:6px; border-left:2px solid var(--accent-ink); border-bottom:2px solid var(--accent-ink); transform:rotate(-45deg) translate(1px,-1px); }
.empty { background:var(--surface); border:1px dashed var(--line); border-radius:var(--r); padding:20px; display:flex; flex-direction:column; gap:10px; align-items:flex-start; }
.empty p { margin:0; color:var(--muted); max-width:62ch; }
.kv { display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:12px 18px; margin:0; }
.kv div { display:flex; flex-direction:column; gap:2px; min-width:0; }
.kv dt { font-size:.75rem; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.05em; }
.kv dd { margin:0; overflow-wrap:anywhere; }
.kv dt { overflow-wrap:anywhere; }
summary { list-style:none; } summary::-webkit-details-marker { display:none; }
.filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.filters select, .filters input[type=date] { font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:9px; padding:7px 10px; max-width:100%; }
.filters label { display:flex; align-items:center; gap:6px; font-size:.9rem; color:var(--muted); }

/* ---------- period bar ---------- */
.periodbar { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; }
.seg { display:inline-flex; background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:3px; overflow-x:auto; max-width:100%; }
.seg button { border:0; background:transparent; padding:6px 10px; border-radius:7px; font-size:.88rem; color:var(--muted); white-space:nowrap; }
.seg button.on { background:var(--accent); color:var(--accent-ink); font-weight:600; }
.pnav { display:flex; align-items:center; gap:6px; }
.pnav .lbl { font-weight:600; min-width:0; }

/* ---------- bar chart (HTML/CSS) ---------- */
.chart { display:grid; grid-template-columns:auto 1fr; gap:6px; }
.chart .yax { display:flex; flex-direction:column; justify-content:space-between; font-family:var(--f-mono); font-size:.68rem; color:var(--muted); text-align:right; height:170px; padding-bottom:0; }
.chart .plot { position:relative; height:170px; display:flex; align-items:flex-end; gap:2px; border-bottom:1px solid var(--line); min-width:0; }
.chart .plot::before, .chart .plot::after { content:""; position:absolute; left:0; right:0; border-top:1px dashed var(--line); }
.chart .plot::before { top:0; } .chart .plot::after { top:50%; }
.chart .col { flex:1; display:flex; align-items:flex-end; justify-content:center; gap:1px; height:100%; min-width:0; position:relative; z-index:1; }
.chart .bar { flex:1; max-width:28px; border-radius:3px 3px 0 0; min-height:0; }
.chart .bar.inc { background:var(--accent); }
.chart .bar.exp { background:var(--arrive); opacity:.85; }
.chart .xax { grid-column:2; display:flex; gap:2px; font-size:.66rem; color:var(--muted); font-family:var(--f-mono); }
.chart .xax span { flex:1; text-align:center; min-width:0; overflow:hidden; white-space:nowrap; }
.legend { display:flex; gap:14px; font-size:.82rem; color:var(--muted); }
.legend i { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:5px; vertical-align:-1px; }
.catbars { display:flex; flex-direction:column; gap:8px; }
.catbar { display:grid; grid-template-columns:minmax(90px, 160px) 1fr auto; gap:10px; align-items:center; font-size:.9rem; }
.catbar .track { height:10px; background:var(--surface-2); border-radius:99px; overflow:hidden; }
.catbar .track i { display:block; height:100%; background:var(--arrive); }

/* ---------- month calendar ---------- */
.cal { display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; background:var(--surface); }
.cal .wd { font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600; padding:7px 8px; background:var(--surface-2); border-bottom:1px solid var(--line); }
.cal .d { min-height:96px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); padding:5px 5px 6px; display:flex; flex-direction:column; gap:3px; background:var(--surface); border-top:0; border-left:0; text-align:left; min-width:0; }
.cal .d:nth-child(7n) { border-right:0; }
.cal .d.out { background:var(--surface-2); color:var(--muted); }
.cal .d.wk { background:var(--weekend); }
.cal .d.sel { box-shadow:inset 0 0 0 2px var(--accent); }
.cal .d .n { font-family:var(--f-mono); font-size:.8rem; width:24px; height:24px; display:grid; place-items:center; border-radius:50%; }
.cal .d.today .n { background:var(--accent); color:var(--accent-ink); font-weight:600; }
.ev { font-size:.72rem; line-height:1.25; padding:2px 5px; border-radius:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:var(--surface-2); }
.ev.inn { background:var(--arrive-soft); color:var(--arrive); }
.ev.ut { background:var(--depart-soft); color:var(--depart); }
.ev.innflytting { background:var(--good-soft); color:var(--good); }
.ev.utflytting { background:var(--depart-soft); color:var(--depart); }
.ev.utkastelse { background:var(--danger); color:var(--danger-ink); }
.ev.frist { background:var(--accent-soft); color:var(--accent); }
.ev.frist.u4 { background:var(--danger-soft); color:var(--danger); }
.ev.more { background:transparent; color:var(--muted); }
.dots { display:none; gap:3px; flex-wrap:wrap; }
.dots i { width:6px; height:6px; border-radius:50%; background:var(--muted); }
.dots i.inn { background:var(--arrive); } .dots i.ut, .dots i.utflytting { background:var(--depart); } .dots i.innflytting { background:var(--good); } .dots i.utkastelse { background:var(--danger); } .dots i.frist { background:var(--accent); }
@media (max-width:640px) {
  .cal .d { min-height:54px; padding:4px 3px; align-items:center; }
  .cal .d .ev { display:none; }
  .cal .d .dots { display:flex; justify-content:center; }
  .cal .wd { text-align:center; padding:6px 2px; }
}
.daylist { display:flex; flex-direction:column; }

/* ---------- timeline (per-address calendar) ---------- */
.tl-scroll { overflow-x:auto; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); -webkit-overflow-scrolling:touch; }
.tl { width:calc(var(--label) + var(--days) * var(--cell)); }
.tl-row { display:flex; border-top:1px solid var(--line); }
.tl-row.head { border-top:0; }
.tl-label { position:sticky; left:0; z-index:3; flex:0 0 var(--label); width:var(--label); background:var(--surface); border-right:1px solid var(--line); padding:0 10px; display:flex; flex-direction:column; justify-content:center; font-weight:600; font-size:.86rem; overflow:hidden; white-space:nowrap; }
.tl-label span { overflow:hidden; text-overflow:ellipsis; }
.tl-label small { font-weight:400; color:var(--muted); font-size:.72rem; }
.tl-track { position:relative; display:flex; height:50px; }
.tl-row.head .tl-track { height:46px; }
.tday { flex:0 0 var(--cell); width:var(--cell); display:flex; flex-direction:column; align-items:center; justify-content:center; border-left:1px solid var(--line); font-size:.68rem; color:var(--muted); }
.tday b { font-family:var(--f-mono); font-size:.84rem; font-weight:500; color:var(--ink); }
.tday.wk, .tcell.wk { background:var(--weekend); }
.tday.today { background:var(--accent); color:var(--accent-ink); } .tday.today b { color:var(--accent-ink); }
.tcell { flex:0 0 var(--cell); width:var(--cell); border:0; border-left:1px solid var(--line); background:transparent; padding:0; }
.tcell:hover { background:var(--accent-soft); }
.tbar { position:absolute; top:8px; height:34px; border-radius:7px; border:0; padding:0 8px; z-index:2; font-size:.78rem; font-weight:600; text-align:left; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:flex; align-items:center; gap:6px; }
.tbar.lease { background:var(--accent); color:var(--accent-ink); }
.tbar.lease.l2 { box-shadow:inset 0 0 0 2px var(--warn); }
.tbar.lease.l3 { background:var(--danger); color:var(--danger-ink); }
.tbar.stay { background:var(--stay); color:var(--stay-ink); }
.tbar.stay.future { background:var(--stay-soft); color:var(--stay); box-shadow:inset 0 0 0 1.5px var(--stay); }
.tbar.past { background:var(--past); color:var(--past-ink); box-shadow:none; }
.tbar.cl { border-top-left-radius:0; border-bottom-left-radius:0; } .tbar.cr { border-top-right-radius:0; border-bottom-right-radius:0; }
.tbar .n { font-family:var(--f-mono); font-weight:400; opacity:.8; }

/* ---------- sheet / form ---------- */
.scrim { position:fixed; inset:0; background:var(--scrim); z-index:40; display:flex; align-items:flex-end; justify-content:center; }
.sheet { width:100%; max-width:560px; max-height:92%; overflow-y:auto; background:var(--surface); border-radius:18px 18px 0 0; box-shadow:var(--shadow);
  padding-block:20px calc(20px + env(safe-area-inset-bottom, 0px)); padding-left:max(18px, env(safe-area-inset-left, 0px)); padding-right:max(18px, env(safe-area-inset-right, 0px)); }
@media (min-width:640px) { .scrim { align-items:center; } .sheet { border-radius:18px; } }
@media (prefers-reduced-motion: no-preference) { .sheet { animation:up .18s ease-out; } @keyframes up { from { transform:translateY(16px); opacity:.6; } } }
.sheet form, .sheet .inner { display:flex; flex-direction:column; gap:13px; margin:0; }
.sheet-head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.x { border:0; background:transparent; font-size:1.5rem; line-height:1; padding:4px 8px; color:var(--muted); }
.fgrid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.fgrid .full { grid-column:1 / -1; }
@media (max-width:420px) { .fgrid { grid-template-columns:1fr; } }
.field { display:flex; flex-direction:column; gap:5px; min-width:0; }
.field > label { font-size:.8rem; font-weight:600; color:var(--muted); }
.field input, .field select, .field textarea { font:inherit; color:var(--ink); background:var(--bg); border:1px solid var(--line); border-radius:9px; padding:10px 11px; width:100%; min-width:0; }
.field textarea { resize:vertical; min-height:70px; }
.field .help { font-size:.78rem; color:var(--muted); }
.field.cb { flex-direction:row; align-items:center; gap:9px; }
.field.cb input { width:20px; height:20px; flex:none; }
.err { color:var(--danger); font-size:.9rem; min-height:1.2em; }
.sheet-foot { display:flex; flex-wrap:wrap; gap:8px; justify-content:space-between; }
.sheet-foot .right { display:flex; gap:8px; margin-left:auto; }
.toast { position:fixed; left:50%; transform:translateX(-50%); bottom:calc(84px + env(safe-area-inset-bottom, 0px)); z-index:50; background:var(--ink); color:var(--bg); padding:9px 16px; border-radius:10px; font-size:.9rem; box-shadow:var(--shadow); }
@media (min-width:761px) { .toast { bottom:24px; } }

/* ---------- tenants ---------- */
a.row { text-decoration:none; color:inherit; }
a.plain { color:inherit; text-decoration:none; } a.plain:hover { text-decoration:underline; }
.search { font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:9px 12px; flex:1 1 260px; min-width:0; max-width:460px; }
.filters .input { font:inherit; color:var(--ink); background:var(--bg); border:1px solid var(--line); border-radius:9px; padding:9px 11px; flex:1 1 220px; min-width:0; }
.todo-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap:12px; }
.card:not(.pad-0) .rows .row { padding-left:0; padding-right:0; }
.big { font-family:var(--f-mono); font-size:1.4rem; font-variant-numeric:tabular-nums; }
.lvls { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:4px; }
.lvl-link { display:flex; align-items:center; gap:6px; text-decoration:none; color:var(--ink); border-radius:8px; }
.lvl-link b { font-size:1.15rem; font-weight:500; }
.lvl-link:hover b { text-decoration:underline; }
.fhead { font-size:.72rem; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); font-weight:600; padding-top:10px; border-top:1px solid var(--line); }
ul.todo { margin:0; padding-left:18px; display:flex; flex-direction:column; gap:3px; font-size:.9rem; }
.page-head .titles p { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
@media (max-width:760px) { .nav a span { font-size:.66rem; } }

/* ---------- round 3: categories, health marks, contract thumbs, long calendars ---------- */
.chip.cat { text-transform:none; letter-spacing:0; font-weight:500; background:var(--surface); color:var(--ink); }
.okmark { display:inline-flex; align-items:center; gap:5px; color:var(--good); font-size:.8rem; font-weight:600; white-space:nowrap; }
.okmark svg { width:18px; height:18px; flex:none; }
.okmark.sm svg { width:20px; height:20px; }
.okmark circle { fill:var(--good); }
.okmark path { fill:none; stroke:var(--surface); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.followup { background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--arrive); border-radius:var(--r); padding:10px 14px; font-size:.9rem; }
.followup summary { cursor:pointer; font-weight:600; display:flex; align-items:center; gap:8px; }
.followup .dot { width:8px; height:8px; border-radius:50%; background:var(--arrive); flex:none; }
.followup ul { margin:8px 0 2px; padding-left:20px; display:flex; flex-direction:column; gap:3px; color:var(--muted); }
.thumb { display:inline-flex; align-items:center; gap:6px; font-weight:600; font-size:.88rem; }
.thumb svg { width:22px; height:22px; fill:currentColor; flex:none; }
.thumb.up { color:var(--good); }
.thumb.down { color:var(--danger); }
.thumb.down svg { transform:rotate(180deg); }
.tl-track.coarse { cursor:pointer; }
.tl-track.coarse:hover { background:color-mix(in srgb, var(--accent) 5%, transparent); }
.tmonth { position:absolute; top:0; height:100%; border-left:1px solid var(--line); padding:5px 6px; font-size:.75rem; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; }
.ttick { position:absolute; bottom:3px; font-family:var(--f-mono); font-size:.6rem; color:var(--muted); border-left:1px solid var(--line); padding-left:2px; line-height:1.1; }
.tguide { position:absolute; top:0; bottom:0; border-left:1px solid var(--line); }
.ttoday { position:absolute; top:0; bottom:0; background:color-mix(in srgb, var(--accent) 22%, transparent); pointer-events:none; }
.ttoday.head { background:var(--accent); opacity:.8; top:auto; height:6px; bottom:0; }
.tl-track { width:calc(var(--days) * var(--cell)); flex:none; }
.followup summary::after { content:"Vis"; margin-left:auto; font-weight:500; color:var(--accent); font-size:.85rem; }
.followup[open] summary::after { content:"Skjul"; }
/* ---------- round 4: document status ---------- */
.docstatus { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap:10px; }
.ds { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; border:1px solid var(--line); background:var(--surface-2); min-width:0; flex-wrap:wrap; }
.ds.up { border-color:color-mix(in srgb, var(--good) 35%, var(--line)); background:var(--good-soft); }
.ds.down { border-color:color-mix(in srgb, var(--danger) 35%, var(--line)); background:var(--danger-soft); }
.ds .ds-txt { display:flex; flex-direction:column; min-width:0; flex:1; font-size:.85rem; }
.ds .ds-txt b { font-size:.9rem; color:var(--ink); }
.ds .ds-txt span { color:var(--muted); }
.ds .thumb svg { width:24px; height:24px; }
.thumb.na { width:24px; text-align:center; color:var(--muted); font-weight:700; }
.thumb.sm { font-size:.82rem; } .thumb.sm svg { width:17px; height:17px; }
.chip.miss { display:inline-flex; align-items:center; gap:4px; background:var(--danger-soft); color:var(--danger); border-color:transparent; text-transform:none; letter-spacing:0; font-weight:600; }
.chip.miss svg { width:13px; height:13px; fill:currentColor; transform:rotate(180deg); }

/* ---------- round 5: level colours, status colours, red buttons, co-tenants ---------- */
.chip.lvl1 { background:var(--yellow-soft); color:var(--yellow-ink); border-color:color-mix(in srgb, var(--yellow) 45%, transparent); }
.chip.lvl2 { background:var(--warn-soft); color:var(--warn); border-color:color-mix(in srgb, var(--warn) 35%, transparent); }
.chip.lvl3 { background:var(--danger); color:var(--danger-ink); border-color:var(--danger); }
.alert.l1, .alert.l1:hover { border-left-color:var(--yellow); }
.alert.l2, .alert.l2:hover { border-left-color:var(--warn); }
.alert.l3, .alert.l3:hover { border-left-color:var(--danger); }
.chip.st-active { background:var(--good-soft); color:var(--good); border-color:transparent; }
.chip.st-inactive { background:var(--yellow-soft); color:var(--yellow-ink); border-color:color-mix(in srgb, var(--yellow) 45%, transparent); }
.chip.st-archive { background:var(--surface-2); color:var(--muted); }
.btn.red { background:var(--danger); color:var(--danger-ink); border-color:var(--danger); font-weight:600; }
.btn.red:hover { filter:brightness(1.08); border-color:var(--danger); }
.seg.colored button { display:inline-flex; align-items:center; gap:7px; }
.seg.colored button i { width:9px; height:9px; border-radius:50%; flex:none; }
.seg button.c-green i { background:var(--good); } .seg button.c-yellow i { background:var(--yellow); } .seg button.c-grey i { background:var(--muted); } .seg button.c-red i { background:var(--danger); }
.seg button.c-green.on { background:var(--good); color:var(--surface); }
.seg button.c-yellow.on { background:var(--yellow); color:#2a2200; }
.seg button.c-grey.on { background:var(--muted); color:var(--surface); }
.seg button.c-red.on { background:var(--danger); color:var(--danger-ink); }
.seg button.on i { background:currentColor; }
.people { display:flex; flex-direction:column; gap:6px; }
.people .chips { align-items:center; gap:8px; }
.person { display:inline-flex; align-items:center; gap:6px; padding:5px 6px 5px 11px; border:1px solid var(--line); border-radius:999px; background:var(--surface-2); font-weight:500; }
.person small { color:var(--muted); font-size:.72rem; }
.x-sm { border:0; background:transparent; color:var(--muted); font-size:1rem; line-height:1; padding:2px 6px; border-radius:99px; }
.x-sm:hover { color:var(--danger); background:var(--danger-soft); }
.x-sm.armed { color:var(--danger-ink); background:var(--danger); font-size:.75rem; font-weight:600; }
.chip.lvl1 { background:var(--yellow); color:#2a2200; border-color:var(--yellow); }
.chip.lvl2 { background:var(--orange); color:#ffffff; border-color:var(--orange); }
/* ---------- round 6: property chips, level sections ---------- */
.pchips { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; }
.pchips .eyebrow { margin-right:4px; }
.pc { border:1px solid var(--line); background:var(--surface); border-radius:999px; padding:6px 13px; font-size:.88rem; color:var(--ink); }
.pc:hover { border-color:var(--accent); }
.pc.on { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:600; }
.lvl-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap:12px; }
.lvl-sec { display:flex; flex-direction:column; gap:8px; border-top-width:5px; }
.lvl-sec.l3 { border-top-color:var(--danger); } .lvl-sec.l2 { border-top-color:var(--orange); } .lvl-sec.l1 { border-top-color:var(--yellow); }
.lvl-title { display:flex; flex-direction:column; gap:4px; align-items:flex-start; }
.lvl-total { display:flex; flex-direction:column; align-items:flex-end; }
.lvl-total b { font-size:1.5rem; font-weight:500; line-height:1.1; }

/* ---------- round 7: move-out steps (blue thumbs) ---------- */
.thumb.blue { color:var(--stay); }
.ds.blue { border-color:color-mix(in srgb, var(--stay) 35%, var(--line)); background:var(--stay-soft); }
.chip.exit { display:inline-flex; align-items:center; gap:4px; text-transform:none; letter-spacing:0; font-weight:600; border-color:transparent; }
.chip.exit svg { width:13px; height:13px; fill:currentColor; }
.chip.exit.blue { background:var(--stay-soft); color:var(--stay); }
.chip.exit.down { background:var(--danger-soft); color:var(--danger); }
.chip.exit.down svg { transform:rotate(180deg); }
.seg button.c-all i { background:var(--accent); }
.seg button.c-all.on { background:var(--accent); color:var(--accent-ink); }
/* ---------- round 8: undo toast ---------- */
.toast { display:flex; align-items:center; gap:14px; }
.toast-undo { border:0; background:transparent; color:var(--accent-soft); font-weight:700; text-decoration:underline; padding:2px 4px; }
.toast-undo:hover { color:var(--bg); }
.toast { min-width:min(340px, calc(100vw - 32px)); max-width:calc(100vw - 32px); justify-content:space-between; }
/* ---------- round 9: owners, document generator ---------- */
.tbl tr.owner td { background:var(--accent-soft); color:var(--ink); font-weight:700; }
.tbl td.indent2 { padding-left:40px; }
code { font-family:var(--f-mono); font-size:.85em; background:var(--surface-2); border:1px solid var(--line); padding:1px 5px; border-radius:5px; }
.gfs { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap:6px; max-height:260px; overflow:auto; padding:2px; }
.gf { display:flex; flex-direction:column; gap:1px; padding:7px 9px; border-radius:8px; background:var(--surface-2); border:1px solid var(--line); min-width:0; font-size:.82rem; }
.gf span { color:var(--muted); }
.gf b { font-weight:500; color:var(--ink); overflow-wrap:anywhere; }
.gf.miss { background:var(--yellow-soft); border-color:color-mix(in srgb, var(--yellow) 45%, var(--line)); }
.gf.miss b { color:var(--yellow-ink); font-style:italic; }
.doc-preview { margin:0; max-height:300px; overflow:auto; white-space:pre-wrap; font-family:var(--f-body); font-size:.85rem; line-height:1.5; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:14px 16px; color:var(--ink); }
.howto { margin:0; padding-left:20px; display:flex; flex-direction:column; gap:5px; }
.sheet-foot .btn.ghost { padding-left:0; }
/* ---------- round 10: editable document fields ---------- */
.gf input { font:inherit; font-size:.88rem; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:7px; padding:6px 8px; width:100%; min-width:0; margin-top:3px; }
.gf input:focus { border-color:var(--accent); outline:none; box-shadow:0 0 0 2px var(--accent-soft); }
.gf.miss input { border-color:color-mix(in srgb, var(--yellow) 60%, var(--line)); }
.gf.edited:not(.miss) { background:var(--accent-soft); border-color:color-mix(in srgb, var(--accent) 35%, var(--line)); }
.gfs { max-height:340px; }
i.sv { font-style:normal; color:var(--accent); font-weight:700; }
/* ---------- round 11 (MARK 2): AI assistant ---------- */
.ai-btn { margin-left:auto; display:inline-flex; align-items:center; gap:6px; border:1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); color:var(--accent); background:var(--accent-soft); font-weight:600; }
.ai-btn svg { width:16px; height:16px; fill:currentColor; }
.ai-btn[aria-expanded="true"] { background:var(--accent); color:var(--accent-ink); }
#btn-ai:not([hidden]) ~ #btn-out { margin-left:8px; }
.ai-panel { position:fixed; top:0; right:0; bottom:0; width:min(440px, 100vw); z-index:35; background:var(--surface); border-left:1px solid var(--line); box-shadow:var(--shadow);
  display:flex; flex-direction:column; padding-top:env(safe-area-inset-top, 0px); padding-bottom:env(safe-area-inset-bottom, 0px); padding-right:env(safe-area-inset-right, 0px); }
@media (max-width:760px) { .ai-panel { width:100vw; border-left:0; box-shadow:none; padding-left:env(safe-area-inset-left, 0px); } body.ai-on { overflow:hidden; } .ai-btn span { display:none; } .ai-btn { padding-left:9px; padding-right:9px; } }
.ai-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; padding:14px 12px 12px 16px; border-bottom:1px solid var(--line); }
.ai-head strong { font-family:var(--f-display); font-size:1.1rem; display:block; }
.ai-head-btns { display:flex; align-items:center; gap:2px; flex:none; }
.ai-log { flex:1; min-height:0; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:14px; overscroll-behavior:contain; }
.ai-msg { min-width:0; }
.ai-msg.user { align-self:flex-end; max-width:86%; background:var(--accent); color:var(--accent-ink); padding:9px 13px; border-radius:14px 14px 4px 14px; white-space:pre-wrap; overflow-wrap:anywhere; }
.ai-text { overflow-wrap:anywhere; }
.ai-text p { margin:0 0 8px; }
.ai-text > :last-child { margin-bottom:0; }
.ai-text ul, .ai-text ol { margin:0 0 8px; padding-left:20px; }
.ai-text li { margin:3px 0; }
.ai-text .ai-h { font-weight:700; margin-top:6px; }
.ai-text code { font-family:var(--f-mono); font-size:.85em; background:var(--surface-2); padding:1px 4px; border-radius:4px; }
.ai-tbl { overflow-x:auto; margin:4px 0 10px; border:1px solid var(--line); border-radius:8px; }
.ai-tbl table { border-collapse:collapse; font-size:.86rem; width:100%; }
.ai-tbl th, .ai-tbl td { border-bottom:1px solid var(--line); padding:6px 9px; text-align:left; white-space:nowrap; }
.ai-tbl tr:last-child td { border-bottom:0; }
.ai-tbl th { color:var(--muted); font-weight:600; background:var(--surface-2); }
.ai-tbl td.num { text-align:right; font-family:var(--f-mono); }
.ai-status { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:.88rem; margin-top:6px; }
.ai-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); flex:none; }
@media (prefers-reduced-motion: no-preference) { .ai-dot { animation:aipulse 1s ease-in-out infinite; } @keyframes aipulse { 50% { opacity:.25; } } }
.ai-note { color:var(--muted); font-size:.85rem; margin-top:8px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.ai-card { border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:10px; background:var(--surface-2); padding:10px 12px; margin-top:10px; }
.ai-card-h { font-weight:700; margin-bottom:6px; font-size:.92rem; }
.ai-card dl { display:grid; grid-template-columns:auto 1fr; gap:3px 12px; margin:0; font-size:.88rem; }
.ai-card dl > div { display:contents; }
.ai-card dt { color:var(--muted); }
.ai-card dd { margin:0; overflow-wrap:anywhere; }
.ai-card-f { display:flex; gap:8px; margin-top:10px; align-items:center; flex-wrap:wrap; }
.ai-card.done { border-left-color:var(--good); }
.ai-card.cancel { border-left-color:var(--past); opacity:.75; }
.ai-card.error { border-left-color:var(--danger); }
.ai-ok { color:var(--good); font-weight:600; font-size:.9rem; }
.ai-err { color:var(--danger); }
.ai-empty { color:var(--muted); display:flex; flex-direction:column; gap:14px; }
.ai-empty p { margin:0; }
.ai-sugg { display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.ai-sugg button { border:1px solid var(--line); background:var(--surface-2); color:var(--ink); border-radius:999px; padding:7px 13px; font-size:.88rem; text-align:left; }
.ai-sugg button:hover { border-color:var(--accent); color:var(--accent); }
.ai-form { display:flex; gap:8px; padding:10px 12px 4px 16px; border-top:1px solid var(--line); align-items:flex-end; }
.ai-form textarea { flex:1; min-width:0; resize:none; font:inherit; color:var(--ink); background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:9px 11px; max-height:140px; line-height:1.4; }
.ai-form textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
.ai-form .btn { flex:none; }
.ai-foot { margin:0; padding:2px 16px 10px; font-size:.75rem; }
@media (min-width:761px) and (max-width:1120px) { .ai-btn span { display:none; } .ai-btn { padding-left:9px; padding-right:9px; } .nav { margin-left:6px; gap:2px; } .nav a { padding:8px 9px; gap:5px; } }
@media (min-width:761px) and (max-width:920px) { .brand > span:last-child { display:none; } }
@media (min-width:761px) and (max-width:820px) { .nav a { padding:8px 6px; font-size:.9rem; } .nav svg { display:none; } }
/* ---------- round 12 ---------- */
.ai-card.warn { border-left-color:var(--yellow); }
.periodbar .filters label { display:inline-flex; align-items:center; gap:6px; }
/* ---------- round 13: bank import, e-post, årsrapport, konto ---------- */
.sheet.wide { max-width:760px; }
.linkbtn { background:none; border:0; padding:2px 0; color:var(--accent); font:inherit; font-size:.9rem; text-decoration:underline; text-underline-offset:2px; cursor:pointer; align-self:center; }
.ok-msg { margin:0; padding:10px 12px; border-radius:10px; background:var(--accent-soft); color:var(--ink); font-size:.9rem; }
.acct-btn { display:inline-flex; align-items:center; gap:6px; }
.acct-btn svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.7; }
.acct-btn.on { background:var(--accent-soft); color:var(--accent); }
@media (max-width:1120px) { .acct-btn span { display:none; } }
.bk-map summary, .bk-more summary { cursor:pointer; font-weight:600; font-size:.9rem; padding:4px 0; }
.bk-map .fgrid { margin-top:8px; }
.bk-list { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:12px; overflow:hidden; margin-top:6px; }
.bk-row { display:flex; gap:10px; padding:10px 12px; border-bottom:1px solid var(--line); align-items:flex-start; }
.bk-row:last-child { border-bottom:0; }
.bk-row.off { opacity:.6; }
.bk-cb { padding-top:2px; } .bk-cb input { width:19px; height:19px; }
.bk-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:6px; }
.bk-top { display:flex; gap:10px; align-items:baseline; }
.bk-top .mono:first-child { color:var(--muted); font-size:.85rem; flex:none; }
.bk-txt { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bk-top strong { flex:none; }
.bk-pick { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.bk-pick select { flex:1; min-width:0; max-width:100%; }
.attach { display:flex; gap:8px; align-items:center; padding:9px 12px; border:1px dashed var(--line); border-radius:10px; font-size:.9rem; overflow-wrap:anywhere; }
.field.miss input { border-color:color-mix(in srgb, var(--yellow) 60%, var(--line)); background:color-mix(in srgb, var(--yellow) 8%, var(--surface)); }
.sent { color:var(--accent); }
ul.plain { margin:0; padding-left:18px; display:flex; flex-direction:column; gap:6px; }
.two-col { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:18px; align-items:start; }
.two-col > * { min-width:0; }
.tbl.yr td.num { white-space:nowrap; }
@media print {
  .topbar, .nav, .no-print, .demo-bar, .notice-wrap, .ai-panel, .toast, #toast, .bottomnav { display:none !important; }
  body { background:#fff; color:#000; }
  .card { box-shadow:none; border-color:#ccc; }
  .section { break-inside:avoid; }
}
/* ---------- round 14: konto per eiendom, bankimport spør ---------- */
.bk-acct { display:flex; flex-direction:column; gap:8px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.bk-acct.warn { border-color:color-mix(in srgb, var(--yellow) 55%, var(--line)); background:color-mix(in srgb, var(--yellow) 8%, var(--surface)); }
.bk-h { margin:10px 0 0; font-size:.95rem; }
.bk-row.need { background:color-mix(in srgb, var(--yellow) 9%, var(--surface)); }
.bk-q { font-size:.9rem; }
.bk-alts { display:flex; flex-wrap:wrap; gap:6px; }
.bk-alts .pill { border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:999px; padding:5px 11px; font-size:.86rem; cursor:pointer; }
.bk-alts .pill:hover { border-color:var(--accent); }
.bk-alts .pill.on { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); font-weight:600; }
.bk-keep { display:flex; gap:8px; align-items:center; font-size:.86rem; color:var(--muted); }
.bk-keep input { width:17px; height:17px; flex:none; }
.err.soft { color:var(--muted); }
/* ---------- round 15: Bankimport-fane ---------- */
.bank-page { display:flex; flex-direction:column; gap:22px; }
.bk-drop { display:flex; flex-direction:column; gap:12px; align-items:flex-start; }
.bk-file { position:relative; overflow:hidden; cursor:pointer; }
.bk-file input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; }
.bk-file:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.bk-samples { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.bk-accts { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:12px; }
.bk-acc { display:flex; flex-direction:column; gap:3px; padding:12px 14px; }
.bk-meta { display:flex; flex-wrap:wrap; gap:10px 28px; padding:12px 16px; }
.bk-meta > div { display:flex; flex-direction:column; gap:2px; min-width:0; }
.bk-meta strong { overflow-wrap:anywhere; }
.bk-overlap { display:flex; flex-direction:column; gap:8px; padding:14px 16px; border-radius:12px; border:1px solid color-mix(in srgb, var(--orange) 55%, var(--line)); background:color-mix(in srgb, var(--orange) 9%, var(--surface)); }
.bk-overlap p { margin:0; }
.bk-ov-btns { display:flex; gap:8px; flex-wrap:wrap; }
.bk-edit { display:flex; gap:10px 14px; flex-wrap:wrap; align-items:flex-end; }
.bk-edit label { display:flex; flex-direction:column; gap:3px; font-size:.8rem; color:var(--muted); }
.bk-edit input { font:inherit; font-size:.9rem; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:6px 8px; width:140px; }
.bk-edit input[type=date] { width:160px; }
.warn-t { color:color-mix(in srgb, var(--orange) 80%, var(--ink)); }
.nowrap { white-space:nowrap; }
.bk-bar { position:sticky; bottom:0; z-index:5; display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; padding:12px 16px; margin-top:4px; background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.bk-sum { display:flex; flex-direction:column; gap:2px; min-width:0; }
.bk-bar-btns { display:flex; gap:8px; }
@media (max-width:760px) { .bk-bar { bottom:calc(70px + env(safe-area-inset-bottom, 0px)); } .bk-bar-btns { width:100%; } .bk-bar-btns .btn { flex:1; } }
.bk-hist td { vertical-align:middle; }
.bk-map > summary, .bk-more > summary { list-style:none; }
.bk-map > summary::-webkit-details-marker, .bk-more > summary::-webkit-details-marker { display:none; }
.bk-map > summary::before, .bk-more > summary::before { content:'▸'; display:inline-block; width:1.1em; color:var(--muted); }
.bk-map[open] > summary::before, .bk-more[open] > summary::before { content:'▾'; }
@media (max-width:760px) { .bk-bar { padding:10px 12px; gap:8px; } }
.bk-alts .pill.unk { border-style:dashed; }
.bk-alts .pill.unk.on { border-style:solid; background:color-mix(in srgb, var(--yellow) 18%, var(--surface)); border-color:color-mix(in srgb, var(--yellow) 70%, var(--line)); color:var(--ink); }
a.bk-unk-alert { text-decoration:none; color:inherit; }
/* ---------- round 17: Ukjente betalinger ---------- */
.subtabs { display:flex; gap:6px; flex-wrap:wrap; }
.subtabs a { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:999px; border:1px solid var(--line); background:var(--surface); color:var(--ink); text-decoration:none; font-size:.9rem; font-weight:500; }
.subtabs a:hover { border-color:var(--accent); }
.subtabs a.on { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); }
.subtabs .count { min-width:20px; height:20px; padding:0 6px; border-radius:999px; display:inline-grid; place-items:center; font-size:.75rem; font-weight:700; background:var(--yellow); color:#3a2c00; }
.bk-unk-filters { display:flex; gap:10px 14px; flex-wrap:wrap; align-items:center; }
.bk-unk-filters .search { flex:1; min-width:200px; }
.bk-unk td { vertical-align:middle; }
/* ---------- round 18: manuell betaling og fritak ---------- */
span.lbl { font-size:.85rem; font-weight:600; color:var(--ink); display:block; margin-bottom:5px; }
.pay-seg { display:flex; flex-wrap:wrap; }
.pay-seg button { flex:1; }
.pay-seg button.wv.on { background:color-mix(in srgb, var(--yellow) 75%, var(--surface)); color:#3a2c00; }
.pay-months { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.pay-m { display:flex; align-items:center; gap:10px; padding:8px 12px; border-bottom:1px solid var(--line); cursor:pointer; font-size:.92rem; }
.pay-m:last-child { border-bottom:0; }
.pay-m input { width:18px; height:18px; flex:none; }
.pay-m span:nth-child(2) { flex:1; }
.pay-sum { display:flex; flex-direction:column; gap:6px; padding:12px 14px; background:var(--surface-2); }
.pay-sum > div { display:flex; justify-content:space-between; gap:12px; font-size:.92rem; }
.pay-sum > div.tot { border-top:1px solid var(--line); padding-top:6px; font-weight:600; }
.wv-note { display:block; }
/* ---------- round 19: annen innbetaling ---------- */
.inc-seg button { flex:1 1 auto; }
.pay-m.fut { background:color-mix(in srgb, var(--accent) 4%, var(--surface)); }

/* ---------- Runde 21: notater på eiendom, enhet og leietaker ---------- */
.note-pins { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:10px; }
.note-pin { display:flex; flex-direction:column; gap:4px; min-width:0; padding:10px 14px; border-radius:var(--r); background:var(--yellow-soft); border:1px solid color-mix(in srgb, var(--yellow) 45%, transparent); color:var(--ink); text-decoration:none; }
.note-pin .eyebrow { color:var(--yellow-ink); }
.note-pin-body { white-space:pre-wrap; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.note-pin.more { justify-content:center; color:var(--yellow-ink); font-weight:600; }
.note-pin:hover { border-color:var(--yellow); }
.note-new { display:flex; flex-direction:column; gap:10px; padding:12px; }
.note-new textarea { width:100%; min-height:84px; resize:vertical; font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.note-new textarea:focus { outline:2px solid var(--accent); outline-offset:0; border-color:transparent; }
.note-bar { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; }
.note-bar .spacer { flex:1; }
.note-where { display:inline-flex; align-items:center; gap:8px; font-size:.9rem; color:var(--muted); }
.note-where select { font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:5px 8px; max-width:200px; }
.note-cb { display:inline-flex; align-items:center; gap:6px; font-size:.9rem; cursor:pointer; }
.note-q { font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:6px 10px; width:220px; max-width:100%; }
.note-list { display:flex; flex-direction:column; gap:10px; }
.note { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px 6px; display:flex; flex-direction:column; gap:6px; min-width:0; }
.note.pinned { border-color:color-mix(in srgb, var(--yellow) 60%, var(--line)); box-shadow:inset 3px 0 0 var(--yellow); }
.note-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:.82rem; color:var(--muted); }
.chip.pin { background:var(--yellow-soft); color:var(--yellow-ink); border-color:transparent; }
.note-body { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; max-width:75ch; }
.note-actions { display:flex; flex-wrap:wrap; gap:2px; margin-left:-8px; }
@media (max-width:600px) { .note-bar .hint { display:none; } .note-bar .spacer { display:none; } .note-bar .btn { margin-left:auto; } .note-q { width:100%; } }
@media print { .note-new, .note-actions { display:none !important; } }
