/* CRM – stilark. Fargene er tokens, så lys og mørk modus følger systemet. */
:root {
  --bg: #EEF1EE;
  --surface: #FBFCFA;
  --surface-2: #F4F7F4;
  --ink: #17201C;
  --muted: #5C6A63;
  --line: #D5DCD7;
  --accent: #1E6B52;
  --accent-ink: #FFFFFF;
  --accent-soft: #DCEBE4;
  --over: #A0451B; --over-soft: #F6E3D8;
  --today: #1E6B52; --today-soft: #DCEBE4;
  --soon: #8A6A10; --soon-soft: #F3EBCF;
  --won: #1E6B52; --lost: #8B5A5A;
  --t-kunde: #1E6B52; --t-investor: #2B4F9E; --t-mentor: #7A4AA0; --t-styre: #9A3B3B;
  --t-partner: #2F7E8C; --t-leverandor: #8A6A10; --t-radgiver: #5B6B2E; --t-annet: #5C6A63;
  --shadow: 0 10px 30px rgba(20, 35, 28, .12);
  --radius: 10px;
  --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, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111714; --surface: #18201C; --surface-2: #1D2622; --ink: #E6ECE8; --muted: #97A59E; --line: #2C3832;
    --accent: #5CC29B; --accent-ink: #0D1411; --accent-soft: #1F3A2F;
    --over: #F0956A; --over-soft: #3D2418; --today: #5CC29B; --today-soft: #1F3A2F; --soon: #E0C060; --soon-soft: #352D14;
    --won: #5CC29B; --lost: #D29A9A;
    --t-kunde: #5CC29B; --t-investor: #7FA3F0; --t-mentor: #C19BE6; --t-styre: #EC8E8E;
    --t-partner: #6CC5D3; --t-leverandor: #E0C060; --t-radgiver: #B4C673; --t-annet: #97A59E;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -.01em; }
h2 { font-family: var(--f-display); font-weight: 600; font-size: 19px; }
h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- Ramme ---------- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-family: var(--f-display); font-weight: 700; font-size: 20px; padding: 4px 10px 14px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 14px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav a.on svg { color: var(--accent); }
.nav .sub { padding-left: 38px; font-weight: 400; font-size: 14px; }
.nav .count { margin-left: auto; font-family: var(--f-mono); font-size: 12px; background: var(--over-soft); color: var(--over); border-radius: 999px; padding: 0 7px; }
.side .spacer { flex: 1; }
.side .user { font-size: 13px; color: var(--muted); padding: 8px 10px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.side .user form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }

.main { min-width: 0; padding: 22px max(20px, env(safe-area-inset-right, 0px)) 80px max(20px, env(safe-area-inset-left, 0px)); }
.topbar { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.topbar form { flex: 1; max-width: 520px; position: relative; }
.topbar input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.topbar form svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.quick { margin-left: auto; position: relative; }
.quick summary { list-style: none; }
.quick summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; min-width: 200px; z-index: 30; display: grid; }
.menu a { padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.menu a:hover { background: var(--surface-2); text-decoration: none; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mobile-top, .tabbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
    background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .mobile-top .brand { padding: 0; font-size: 18px; }
  .main { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); }
  .topbar .quick { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; position: relative; }
  .tabbar a.on { color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .dot { position: absolute; top: 2px; left: calc(50% + 8px); background: var(--over); color: #fff; font-size: 10px; border-radius: 999px; padding: 0 5px; font-family: var(--f-mono); }
}

/* ---------- Knapper og skjema ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px;
  border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--over); border-color: var(--over); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.sm { padding: 5px 10px; font-size: 13px; }

.field { display: grid; gap: 4px; min-width: 0; }
.field > label { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.field input:not([type=checkbox]), .field select, .field textarea, .input {
  width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.field textarea { resize: vertical; }
.field .help { font-size: 12px; color: var(--muted); }
.field .err, .errorlist { color: var(--over); font-size: 13px; margin: 0; padding: 0; list-style: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card > .card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.card > .card-body { padding: 4px 16px 16px; }
.panel-form { max-width: 760px; padding: 20px; display: grid; gap: 18px; }

.messages { display: grid; gap: 8px; margin-bottom: 16px; }
.msg { padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--ink); border-left: 3px solid var(--accent); }
.msg.error { background: var(--over-soft); border-left-color: var(--over); }

/* ---------- Merker ---------- */
.type { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--c); white-space: nowrap; }
.type::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.t-kunde { --c: var(--t-kunde); } .t-investor { --c: var(--t-investor); } .t-mentor { --c: var(--t-mentor); } .t-styre { --c: var(--t-styre); }
.t-partner { --c: var(--t-partner); } .t-leverandor { --c: var(--t-leverandor); } .t-radgiver { --c: var(--t-radgiver); } .t-annet { --c: var(--t-annet); }
.due { display: inline-block; font-family: var(--f-mono); font-size: 12px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.due.over { background: var(--over-soft); color: var(--over); }
.due.today { background: var(--today-soft); color: var(--today); font-weight: 500; }
.due.soon { background: var(--soon-soft); color: var(--soon); }
.due.later, .due.none { color: var(--muted); }
.flag { font-size: 12px; color: var(--over); display: inline-flex; gap: 4px; align-items: center; }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--accent-soft); color: var(--accent); flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; font-family: var(--f-display); }

/* ---------- I dag ---------- */
.today-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .today-grid { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 20px; min-width: 0; }
.group-title { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px 6px; }
.group-title .n { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.group-title.over h3 { color: var(--over); }

.task { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 16px; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; }
.task form { margin: 0; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; margin-top: 1px; }
.check:hover { border-color: var(--accent); background: var(--accent-soft); }
.check svg { width: 12px; height: 12px; opacity: 0; color: var(--accent); }
.check:hover svg { opacity: 1; }
.task.done .check { background: var(--accent); border-color: var(--accent); }
.task.done .check svg { opacity: 1; color: var(--accent-ink); }
.task .what { min-width: 0; }
.task .subj { font-weight: 500; overflow-wrap: anywhere; }
.task .rel { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.task .rel a { color: var(--muted); }
.task .side-r { display: grid; justify-items: end; gap: 4px; }
.kind { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.empty { padding: 26px 16px; color: var(--muted); text-align: center; }
.empty strong { display: block; color: var(--ink); font-family: var(--f-display); font-size: 18px; margin-bottom: 2px; }

.sumrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.sumrow:first-of-type { border-top: 0; }
.sumrow .big { font-family: var(--f-display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.mini { display: flex; justify-content: space-between; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.mini:first-of-type { border-top: 0; }
.mini .l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tabeller / lister ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters .input { width: auto; flex: 1 1 220px; }
.filters select.input { flex: 0 1 auto; }
.typebar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.typebar a { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; }
.typebar a:hover { text-decoration: none; border-color: var(--muted); }
.typebar a.on { background: var(--accent-soft); border-color: var(--accent); }
.typebar .n { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: var(--surface-2); }
table.list .name { font-weight: 600; color: var(--ink); }
table.list .r { text-align: right; }
table.list .clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; }
  table.list tr { padding: 10px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  table.list td { padding: 0; border: 0; }
  table.list td.hide-m { display: none; }
  table.list .clip { max-width: none; }
}
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; padding: 14px; }

/* ---------- Detaljside ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.who-head { display: flex; gap: 14px; align-items: center; min-width: 0; }
.who-head h1 { overflow-wrap: anywhere; }
.facts { display: grid; gap: 0; }
.fact { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.fact:first-child { border-top: 0; }
.fact dt { color: var(--muted); }
.fact dd { margin: 0; overflow-wrap: anywhere; }
.copy { user-select: all; font-family: var(--f-mono); font-size: 13px; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 8px 12px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabpanel { padding: 16px; display: grid; gap: 12px; }
.tabpanel .row3 { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; }
.tabpanel .row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 560px) { .tabpanel .row3, .tabpanel .row2 { grid-template-columns: minmax(0, 1fr); } }
.quickpick { display: flex; flex-wrap: wrap; gap: 6px; }
.quickpick button { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.quickpick button:hover { border-color: var(--accent); }
.prompt-next { box-shadow: 0 0 0 2px var(--accent); }
.prompt-banner { padding: 10px 16px; background: var(--accent-soft); color: var(--ink); font-size: 14px; border-radius: var(--radius) var(--radius) 0 0; }

.timeline { position: relative; padding: 6px 16px 16px; }
.tl-item { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 10px 0; }
.tl-item::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-item:first-child::before { top: 16px; }
.tl-item:last-child::before { bottom: calc(100% - 16px); }
.tl-dot { position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); display: grid; place-items: center; color: var(--accent); z-index: 1; }
.tl-dot svg { width: 11px; height: 11px; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 12px; color: var(--muted); }
.tl-meta b { color: var(--ink); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; }
.tl-meta a { color: var(--muted); }
.tl-subj { font-weight: 500; margin-top: 2px; overflow-wrap: anywhere; }
.tl-body { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; }
.tl-sep { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 0 4px 34px; }

.deal-mini { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.deal-mini:first-of-type { border-top: 0; }
.deal-mini .t { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.stagebar { display: flex; gap: 3px; margin-top: 6px; }
.stagebar span { flex: 1; height: 5px; border-radius: 2px; background: var(--line); }
.stagebar span.on { background: var(--accent); }
.stagebar span.lost { background: var(--lost); }

/* Faser som knapper på avtalesiden */
.stages { display: flex; flex-wrap: wrap; gap: 0; margin: 4px 0 0; }
.stages form { margin: 0; }
.stages button { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px 7px 18px; cursor: pointer; font-size: 13px; margin-right: -1px;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); }
.stages form:first-child button { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); padding-left: 14px; border-radius: 6px 0 0 6px; }
.stages button.past { background: var(--accent-soft); }
.stages button.cur { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.stages button.won { color: var(--won); font-weight: 600; }
.stages button.lost { color: var(--lost); }
.stages button.cur.lost { background: var(--lost); border-color: var(--lost); color: #fff; }

/* ---------- Pipeline-tavle ---------- */
.board-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.pipe-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: start; min-height: 60vh; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; max-height: calc(100vh - 210px); }
.col-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.col-head .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.col-head .t .n { font-family: var(--f-mono); font-size: 12px; color: var(--muted); font-weight: 400; }
.col-head .sum { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.col.won .col-head { border-top: 3px solid var(--won); border-radius: var(--radius) var(--radius) 0 0; }
.col.lost .col-head { border-top: 3px solid var(--lost); border-radius: var(--radius) var(--radius) 0 0; }
.col.closed { opacity: .92; }
.col-body { padding: 8px; display: grid; gap: 8px; overflow-y: auto; align-content: start; flex: 1; }
.col.dragover { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.col-add { display: block; padding: 8px; text-align: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; display: grid; gap: 4px; cursor: grab; color: var(--ink); }
.dcard:hover { border-color: var(--muted); text-decoration: none; }
.dcard.dragging { opacity: .5; }
.dcard .t { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.dcard .o { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.dcard .b { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.dcard .amt { font-family: var(--f-mono); font-size: 13px; font-weight: 500; }
.dcard .nx { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; min-width: 0; }
.dcard .nx span.s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Rapporter ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; }
.kpi { padding: 14px 16px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .v { font-family: var(--f-display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.bars { display: grid; gap: 8px; padding: 8px 16px 16px; }
.bar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 120px; gap: 10px; align-items: center; font-size: 14px; }
.bar .track { height: 12px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 3px; }
.bar .v { text-align: right; font-family: var(--f-mono); font-size: 13px; }
@media (max-width: 560px) { .bar { grid-template-columns: 90px minmax(0, 1fr) 84px; } }
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 160px; padding: 10px 16px 0; }
.months .m { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 4px; align-items: stretch; }
.months .col-bar { background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.months .col-bar.zero { background: var(--line); }
.month-labels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; padding: 6px 16px 14px; font-size: 11px; color: var(--muted); text-align: center; font-family: var(--f-mono); }

/* ---------- Innlogging ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.login .card { width: min(400px, 100%); padding: 28px; display: grid; gap: 16px; }

/* Bekreft sletting uten nettleserdialog */
details.confirm summary { list-style: none; cursor: pointer; }
details.confirm summary::-webkit-details-marker { display: none; }
details.confirm[open] summary { display: none; }
details.confirm .box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--over); font-size: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .dcard, .btn, .check { transition: border-color .12s, background-color .12s, box-shadow .12s; }
}

/* Ikoner i knapper */
.btn svg { width: 16px; height: 16px; flex: none; }
.tabpanel .row3, .tabpanel .row2 { align-items: start; }

/* Slippsoner for vunnet/tapt mens et kort dras */
.dropbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.dropzone { border: 2px dashed var(--c); color: var(--c); border-radius: var(--radius); padding: 22px 12px; text-align: center; font-weight: 600; background: var(--surface); }
.dropzone.won { --c: var(--won); }
.dropzone.lost { --c: var(--lost); }
.dropzone.dragover { background: var(--c); color: var(--surface); border-style: solid; }
@media (min-width: 861px) { .dropbar { left: 228px; } }
.stages button.cur.won { background: var(--won); border-color: var(--won); color: var(--accent-ink); }
.mini > span { min-width: 0; overflow-wrap: anywhere; }
.msg { overflow-wrap: anywhere; }
