/* =========================================================
   Observationslog – stilark
   ========================================================= */

/* ---------- Farver og tokens ---------- */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f1f0eb;
  --surface-3: #e8e6df;
  --border: #e3e1d9;
  --border-strong: #cfccc2;
  --text: #1b1c19;
  --text-2: #55574f;
  --text-3: #85877f;
  --accent: #2c6e5b;
  --accent-hover: #235a4a;
  --accent-ink: #ffffff;
  --accent-soft: #e1ede7;
  --accent-soft-ink: #1f5446;
  --danger: #b2382f;
  --danger-soft: #f7e4e1;
  --warn-soft: #f6eed8;
  --warn-ink: #6a4d10;
  --warn-border: #e8d9ac;
  --backdrop: rgba(246, 245, 241, .82);
  --shadow-1: 0 1px 2px rgba(28, 27, 22, .05), 0 1px 1px rgba(28, 27, 22, .03);
  --shadow-2: 0 2px 6px rgba(28, 27, 22, .05), 0 12px 32px -14px rgba(28, 27, 22, .2);
  --shadow-3: 0 24px 60px -20px rgba(28, 27, 22, .35), 0 3px 10px rgba(28, 27, 22, .06);
  --tag-bg-l: 94.5%; --tag-bg-c: .038;
  --tag-fg-l: 41%;   --tag-fg-c: .1;
  --tag-dot-l: 66%;  --tag-dot-c: .14;
  --ring: 0 0 0 3px color-mix(in oklab, var(--accent) 32%, transparent);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121412;
    --surface: #1a1c1a;
    --surface-2: #212421;
    --surface-3: #2a2d2a;
    --border: #2b2f2b;
    --border-strong: #3b403b;
    --text: #ebeae5;
    --text-2: #a9aba3;
    --text-3: #777a72;
    --accent: #6cc1a5;
    --accent-hover: #86d0b7;
    --accent-ink: #0c1a15;
    --accent-soft: #1b322a;
    --accent-soft-ink: #9fdcc6;
    --danger: #f0786d;
    --danger-soft: #3a1f1c;
    --warn-soft: #2f2716;
    --warn-ink: #e8cf8f;
    --warn-border: #4a3d1e;
    --backdrop: rgba(18, 20, 18, .8);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .25), 0 12px 32px -14px rgba(0, 0, 0, .6);
    --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .7), 0 3px 10px rgba(0, 0, 0, .35);
    --tag-bg-l: 30%;  --tag-bg-c: .045;
    --tag-fg-l: 86%;  --tag-fg-c: .085;
    --tag-dot-l: 72%; --tag-dot-c: .13;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121412;
  --surface: #1a1c1a;
  --surface-2: #212421;
  --surface-3: #2a2d2a;
  --border: #2b2f2b;
  --border-strong: #3b403b;
  --text: #ebeae5;
  --text-2: #a9aba3;
  --text-3: #777a72;
  --accent: #6cc1a5;
  --accent-hover: #86d0b7;
  --accent-ink: #0c1a15;
  --accent-soft: #1b322a;
  --accent-soft-ink: #9fdcc6;
  --danger: #f0786d;
  --danger-soft: #3a1f1c;
  --warn-soft: #2f2716;
  --warn-ink: #e8cf8f;
  --warn-border: #4a3d1e;
  --backdrop: rgba(18, 20, 18, .8);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .25), 0 12px 32px -14px rgba(0, 0, 0, .6);
  --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .7), 0 3px 10px rgba(0, 0, 0, .35);
  --tag-bg-l: 30%;  --tag-bg-c: .045;
  --tag-fg-l: 86%;  --tag-fg-c: .085;
  --tag-dot-l: 72%; --tag-dot-c: .13;
  color-scheme: dark;
}

/* ---------- Grundlag ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  background: var(--surface);
  color: var(--text-2);
  font: 600 11px/1 var(--font);
}
::selection { background: color-mix(in oklab, var(--accent) 28%, transparent); }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; display: block; }
.ic-slot { display: inline-flex; }

.shell { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  transition: top .15s var(--ease);
}
.skip:focus { top: 12px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--backdrop);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -.01em; border-radius: 8px; }
.brand img { display: block; border-radius: 7px; }
.nav { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.nav a {
  padding: 5px 12px; border-radius: 8px;
  text-decoration: none; font-size: 14px; font-weight: 550; color: var(--text-2);
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.privacy-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px 0 10px;
  border: 1px solid color-mix(in oklab, var(--accent) 25%, transparent);
  background: var(--accent-soft); color: var(--accent-soft-ink);
  border-radius: 999px; font-size: 13px; font-weight: 550;
  transition: filter .15s;
}
.privacy-pill .ic { width: 15px; height: 15px; }
.privacy-pill:hover { filter: brightness(.97); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-2);
  transition: background-color .15s, color .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }

/* ---------- Menu ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 250px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-3);
  transform-origin: top right;
  animation: pop .16s var(--ease-out);
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; text-align: left; font-size: 14px;
}
.menu button .ic { width: 16px; height: 16px; color: var(--text-3); }
.menu button kbd { margin-left: auto; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); box-shadow: none; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }

/* ---------- Knapper og felter ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 550; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 550; text-decoration: underline; text-underline-offset: 2px; border-radius: 4px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.input, .field input, .field select {
  height: 40px; width: 100%; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, textarea::placeholder, input::placeholder { color: var(--text-3); }
.input:focus, .field input:focus, .field select:focus { border-color: var(--accent); box-shadow: var(--ring); }

/* ---------- Visninger ---------- */
main { flex: 1; padding-top: 36px; padding-bottom: 40px; }
.view { animation: viewIn .28s var(--ease-out); }
.boot { color: var(--text-3); padding: 40px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-title { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.lede { margin-top: 8px; color: var(--text-2); max-width: 60ch; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  margin: 36px 0 12px;
}
.count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); font-size: 11.5px; letter-spacing: 0;
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
}

/* ---------- Banner ---------- */
.banner {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px 12px 16px; margin-bottom: 20px;
  border-radius: var(--radius); border: 1px solid var(--warn-border);
  background: var(--warn-soft); color: var(--warn-ink); font-size: 14px;
  animation: viewIn .3s var(--ease-out);
}
.banner p { flex: 1; }
.banner .btn { border-color: var(--warn-border); background: transparent; color: var(--warn-ink); }
.banner .btn:hover { background: color-mix(in oklab, var(--warn-border) 40%, transparent); }

/* ---------- Ny session ---------- */
.new-session { padding: 20px 22px 22px; }
.new-session + .empty { margin-top: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.hint { font-size: 13px; color: var(--text-3); }
.fields { display: grid; grid-template-columns: 1fr 1fr 1.6fr 160px auto; gap: 12px; align-items: end; }
.fields .btn { height: 40px; padding: 0 18px; }

/* ---------- Sessionsliste ---------- */
.session-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.session-row {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .2s, transform .2s var(--ease);
  animation: rowIn .3s var(--ease-out) both;
}
.session-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.session-link {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: 10px minmax(0, 1fr) 150px 120px 90px; align-items: center; gap: 16px;
  padding: 14px 8px 14px 18px; text-decoration: none; border-radius: var(--radius);
}
.s-status { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.s-status.on { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.s-main { display: flex; flex-direction: column; min-width: 0; }
.s-task { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-meta { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-date { font-size: 13px; color: var(--text-2); }
.s-count { font-size: 13px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.s-count b { color: var(--text); font-weight: 650; }
.s-spark { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface-2); gap: 1px; }
.s-spark span { display: block; height: 100%; background: oklch(var(--tag-dot-l) var(--tag-dot-c) var(--h)); }
.s-actions { display: flex; gap: 2px; padding-right: 10px; opacity: .55; transition: opacity .15s; }
.session-row:hover .s-actions, .session-row:focus-within .s-actions { opacity: 1; }

.empty {
  text-align: center; padding: 48px 24px; color: var(--text-2);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
}
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty .ic-big { width: 40px; height: 40px; margin: 0 auto 14px; color: var(--text-3); }

/* ---------- Session: hoved ---------- */
.back {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; margin-left: -6px;
  padding: 3px 8px 3px 4px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500;
}
.back:hover { color: var(--text); background: var(--surface-2); }
.back .ic { width: 16px; height: 16px; }
.session-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.session-head h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.session-meta { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--text-2); font-size: 14px; }
.session-meta .sep { color: var(--border-strong); }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2);
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.on { background: var(--accent-soft); color: var(--accent-soft-ink); }
.status-pill.on::before { animation: pulse 2s infinite; }
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.seg {
  display: none; padding: 3px; gap: 2px; margin-bottom: 18px;
  background: var(--surface-2); border-radius: 10px;
}
.seg button {
  flex: 1; height: 32px; border: 0; border-radius: 8px; background: transparent;
  font-size: 14px; font-weight: 550; color: var(--text-2);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.session-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; }
.timeline-col { min-width: 0; display: flex; flex-direction: column; min-height: 50vh; }

/* ---------- Filterlinje ---------- */
.filterbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 8px 8px 12px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--text-2);
  animation: viewIn .2s var(--ease-out);
}
.filterbar .ic { width: 15px; height: 15px; color: var(--text-3); }
.filterbar .btn { margin-left: auto; }
.fchip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 4px 0 9px;
  border: 0; border-radius: 999px; font-size: 12.5px; font-weight: 550;
  background: var(--surface-3); color: var(--text);
}
.fchip[data-h] { background: oklch(var(--tag-bg-l) var(--tag-bg-c) var(--h)); color: oklch(var(--tag-fg-l) var(--tag-fg-c) var(--h)); }
.fchip .ic { width: 13px; height: 13px; color: currentColor; opacity: .7; }

/* ---------- Tidslinje ---------- */
.timeline { list-style: none; margin: 0; padding: 0; flex: 1; }
.note {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 74px 22px minmax(0, 1fr) auto; column-gap: 8px;
  padding: 10px 6px 10px 0; border-radius: var(--radius);
  transition: background-color .15s;
}
.note:hover { background: color-mix(in oklab, var(--surface-2) 70%, transparent); }
.note:focus-visible { background: var(--surface-2); box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--accent) 45%, transparent); }
.note-time {
  padding-top: 1px; text-align: right;
  font: 550 13.5px/1.5 var(--mono); color: var(--text); font-variant-numeric: tabular-nums;
}
.note-time .sec { color: var(--text-3); }
.note-rail { position: relative; display: flex; justify-content: center; }
.note-rail::before {
  content: ""; position: absolute; top: -10px; bottom: -10px; left: 50%; width: 1.5px; transform: translateX(-50%);
  background: var(--border);
}
.timeline > li:first-child .note-rail::before { top: 12px; }
.timeline > li.note:last-child .note-rail::before { bottom: calc(100% - 12px); }
.dot {
  position: relative; z-index: 1; margin-top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--text-3);
}
.dot[data-h] { background: oklch(var(--tag-dot-l) var(--tag-dot-c) var(--h)); border-color: var(--bg); box-shadow: 0 0 0 1.5px oklch(var(--tag-dot-l) var(--tag-dot-c) var(--h)); }
.note-body { min-width: 0; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-text.empty-text { color: var(--text-3); font-style: italic; }
.itag { color: oklch(var(--tag-fg-l) var(--tag-fg-c) var(--h)); font-weight: 600; }
.note-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.note-meta:empty { display: none; }
.note-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; align-self: start; }
.note:hover .note-actions, .note:focus-within .note-actions, .note:focus .note-actions { opacity: 1; }

.gap {
  display: grid; grid-template-columns: 74px 22px 1fr; column-gap: 8px;
  height: 26px; align-items: center;
  font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums;
}
.gap span:first-child { text-align: right; }
.gap .note-rail::before { top: 0; bottom: 0; background: repeating-linear-gradient(to bottom, var(--border-strong) 0 3px, transparent 3px 6px); }
.gap.long { color: var(--warn-ink); font-weight: 600; }
.gap.long .note-rail::before { background: repeating-linear-gradient(to bottom, color-mix(in oklab, var(--warn-ink) 60%, transparent) 0 3px, transparent 3px 6px); }

.note.is-new { animation: noteIn .45s var(--ease-out); }
.note.is-new::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--accent-soft); animation: flash 1.6s var(--ease) forwards;
}

.tag, .chip-src {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border: 0; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: oklch(var(--tag-bg-l) var(--tag-bg-c) var(--h, 0));
  color: oklch(var(--tag-fg-l) var(--tag-fg-c) var(--h, 0));
}
button.tag, button.chip-src { cursor: pointer; transition: filter .15s; }
button.tag:hover, button.chip-src:hover { filter: brightness(.96) saturate(1.2); }
.chip-src { background: var(--surface-3); color: var(--text-2); font-weight: 550; }
.chip-src .ic { width: 12px; height: 12px; }

.timeline-empty { padding: 56px 20px; text-align: center; color: var(--text-2); }
.timeline-empty .big-kbd { display: inline-flex; gap: 8px; margin-bottom: 14px; }
.timeline-empty .big-kbd kbd { min-width: 38px; height: 38px; font-size: 16px; border-radius: 9px; }
.timeline-empty h3 { color: var(--text); font-size: 17px; margin-bottom: 4px; }

/* ---------- Redigering af note ---------- */
.note.editing { grid-template-columns: 74px 22px minmax(0, 1fr); background: var(--surface); box-shadow: var(--shadow-2); border: 1px solid var(--border); padding: 12px 14px 12px 0; }
.note-edit { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.note-edit textarea {
  width: 100%; resize: none; overflow: hidden; min-height: 40px;
  padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  line-height: 1.5;
}
.note-edit textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
.time-field {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text-3);
  transition: border-color .15s, box-shadow .15s;
}
.time-field .ic { width: 16px; height: 16px; }
.time-field:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.time-input { height: 100%; border: 0; background: transparent; padding: 0; color: var(--text); font: 550 14px var(--mono); font-variant-numeric: tabular-nums; }
.time-input:focus-visible { box-shadow: none; }
.edit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.edit-row .source-field { flex: 1; min-width: 180px; }
.edit-row .hint { margin-right: auto; }

/* ---------- Chips (tag-vælger) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  --h: 0;
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 550; color: var(--text-2);
  transition: background-color .15s, border-color .15s, color .15s, transform .12s var(--ease), box-shadow .15s;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: oklch(var(--tag-dot-l) var(--tag-dot-c) var(--h)); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] {
  background: oklch(var(--tag-bg-l) var(--tag-bg-c) var(--h));
  border-color: oklch(var(--tag-dot-l) var(--tag-dot-c) var(--h) / .55);
  color: oklch(var(--tag-fg-l) var(--tag-fg-c) var(--h));
}
.chip.suggest { box-shadow: 0 0 0 2px oklch(var(--tag-dot-l) var(--tag-dot-c) var(--h) / .6); }
.chip-key { font: 600 10px var(--font); color: var(--text-3); margin-left: 1px; }
.chip[aria-pressed="true"] .chip-key { color: inherit; opacity: .6; }

/* ---------- Datakilde-felt + autoudfyld ---------- */
.source-field {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-3); transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.source-field .ic { width: 16px; height: 16px; }
.source-field input { flex: 1; min-width: 0; border: 0; background: transparent; height: 100%; padding: 0; color: var(--text); font-size: 14px; }
.source-field:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.ac {
  position: absolute; left: -1px; right: -1px; z-index: 40;
  margin: 0; padding: 5px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-3); max-height: 240px; overflow: auto;
  animation: pop .14s var(--ease-out);
}
.ac.up { bottom: calc(100% + 6px); transform-origin: bottom; }
.ac.down { top: calc(100% + 6px); transform-origin: top; }
.ac li { padding: 7px 10px; border-radius: 7px; font-size: 14px; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.ac li small { color: var(--text-3); font-variant-numeric: tabular-nums; }
.ac li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); }
.ac li mark { background: none; color: inherit; font-weight: 700; }

/* ---------- Notefelt (composer) ---------- */
.composer {
  position: sticky; bottom: 16px; z-index: 20;
  margin-top: 18px;
}
.composer-bar {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 54px; padding: 0 14px 0 10px;
  border: 1px solid var(--border); border-radius: 16px;
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--shadow-2);
  color: var(--text-3); font-size: 15px; text-align: left;
  transition: border-color .15s, box-shadow .2s, transform .15s var(--ease);
}
.composer-bar:hover { border-color: var(--border-strong); color: var(--text-2); }
.composer-bar:active { transform: scale(.995); }
.composer-plus {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
}
.composer-bar-text { flex: 1; }
.composer-panel {
  display: none;
  padding: 14px 16px 14px;
  border: 1px solid var(--border-strong); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow-3);
}
.composer[data-state="open"] .composer-bar { display: none; }
.composer[data-state="open"] .composer-panel { display: block; animation: composerIn .18s var(--ease-out); }
.composer-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; }
.composer-time { font: 650 14px var(--mono); font-variant-numeric: tabular-nums; }
.composer-ago { font-size: 12.5px; color: var(--text-3); }
.spacer { flex: 1; }
.composer-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.composer-hint kbd { margin-left: 6px; }
.composer-hint kbd:first-child { margin-left: 0; }
#cText {
  display: block; width: 100%; resize: none; overflow: hidden;
  min-height: 34px; max-height: 40vh; padding: 4px 0; margin-bottom: 10px;
  border: 0; background: transparent;
  font-size: 17px; line-height: 1.5;
}
#cText:focus-visible { box-shadow: none; }
.composer .chips { margin-bottom: 12px; }
.composer-bottom { display: flex; align-items: center; gap: 10px; }
.composer-bottom .source-field { flex: 1; }
.composer-buttons { display: flex; gap: 6px; }

/* ---------- Overbliks-panel ---------- */
.panel { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.panel-card { padding: 16px 18px; }
.panel-card h3 {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  margin-bottom: 12px;
}
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-label { font-size: 12px; color: var(--text-2); }

.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.bar {
  --h: 160;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 5px; column-gap: 10px; row-gap: 5px;
  width: 100%; padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px);
  border: 0; border-radius: 8px; background: transparent; text-align: left;
  transition: background-color .15s, opacity .2s;
}
button.bar:hover { background: var(--surface-2); }
.bar-label { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-count { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar-count small { color: var(--text-3); margin-left: 4px; }
.bar-track { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar-fill {
  display: block; height: 100%; border-radius: 3px; width: 0;
  background: oklch(var(--tag-dot-l) var(--tag-dot-c) var(--h));
  transition: width .5s var(--ease-out);
}
.bar.neutral .bar-fill { background: var(--text-3); }
.bar.src .bar-fill { background: var(--accent); opacity: .7; }
.bar.active { background: var(--accent-soft); }
.bar.active .bar-label { color: var(--accent-soft-ink); }
.bars.has-active .bar:not(.active) { opacity: .55; }
.bars.has-active .bar:not(.active):hover { opacity: 1; }
.panel-empty { font-size: 13.5px; color: var(--text-3); }
.panel-card h3 .btn { text-transform: none; letter-spacing: 0; margin: -6px -8px -6px 0; color: var(--text-2); }
.bars li { display: flex; align-items: center; gap: 2px; }
.bars li .bar { flex: 1; min-width: 0; width: auto; margin: 0 0 0 -8px; }
.bar.zero .bar-label, .bar.zero .bar-count { color: var(--text-3); }
.bar-remove { flex: none; opacity: 0; margin-right: -8px; transition: opacity .15s, background-color .15s, color .15s; }
.bar-remove-pad { flex: none; width: 30px; margin-right: -8px; }
.bars li:hover .bar-remove, .bar-remove:focus-visible { opacity: 1; }
.bar-add { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.bar-add .input { height: 32px; padding: 0 10px; font-size: 13.5px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); }
.bar-add .input:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
@media (hover: none) { .bar-remove { opacity: 1; } }

/* ---------- Samlet overblik ---------- */
.ov-toolbar { display: flex; align-items: center; gap: 10px; }
.ov-toolbar select { height: 36px; padding: 0 32px 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.tile { padding: 18px 20px; }
.tile .stat-num { font-size: 28px; }
.tile .stat-label { font-size: 13px; margin-top: 2px; }
.tile-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tile .tag { height: 26px; font-size: 14px; padding: 0 10px; }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.ov-grid .panel-card { padding: 20px 22px; }

.table-card { padding: 6px 0 4px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-card h3 { padding: 14px 22px 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
thead th { font-size: 12px; font-weight: 600; color: var(--text-3); border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background-color .12s; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover, tbody tr:focus-visible { background: var(--surface-2); box-shadow: none; }
td.num, th.num { text-align: center; font-variant-numeric: tabular-nums; }
td.heat { --a: 0; background: oklch(var(--tag-dot-l) var(--tag-dot-c) var(--h) / calc(var(--a) * .38)); font-weight: 600; }
td.heat.zero { color: var(--text-3); font-weight: 400; }
.td-task { font-weight: 600; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.td-sub { font-size: 12.5px; color: var(--text-2); }

/* ---------- Footer ---------- */
.footer { padding-top: 22px; padding-bottom: 36px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }
.footer p { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.footer .ic { width: 14px; height: 14px; }
.view-session-active .footer { display: none; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.view-session-active .toasts { bottom: 96px; }
.toast {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 10px 10px 16px; min-height: 44px;
  background: var(--text); color: var(--bg);
  border-radius: 12px; box-shadow: var(--shadow-3);
  font-size: 14px; pointer-events: auto;
  animation: toastIn .3s var(--ease-out);
}
.toast.out { animation: toastOut .2s var(--ease) forwards; }
.toast.error { background: var(--danger); color: #fff; }
.toast button {
  border: 0; background: color-mix(in oklab, var(--bg) 16%, transparent); color: inherit;
  height: 28px; padding: 0 10px; border-radius: 7px; font-size: 13px; font-weight: 650;
}
.toast button:hover { background: color-mix(in oklab, var(--bg) 26%, transparent); }
.toast:not(:has(button)) { padding-right: 16px; }

/* ---------- Dialoger ---------- */
dialog.dlg {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-3);
  overflow: auto;
}
dialog.dlg.wide { width: min(640px, calc(100vw - 32px)); }
dialog.dlg[open] { animation: dlgIn .22s var(--ease-out); }
dialog.dlg::backdrop { background: rgba(10, 12, 10, .35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s; }
.dlg-body { padding: 24px 24px 8px; }
.dlg-body h2 { font-size: 19px; font-weight: 700; letter-spacing: -.015em; margin-bottom: 8px; }
.dlg-body p { color: var(--text-2); }
.dlg-body p + p { margin-top: 10px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 22px; flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; }
.dlg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.dlg-fields .full { grid-column: 1 / -1; }

.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; margin-top: 14px; }
.keys h3 { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 14px 0 4px; }
.keys h3:first-child { margin-top: 0; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.key-row span:last-child { display: flex; gap: 4px; flex: none; }

.privacy-list { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 10px; }
.privacy-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.privacy-list li .ic { color: var(--accent); margin-top: 2px; }
.privacy-list li.warn .ic { color: var(--warn-ink); }
.privacy-list b { color: var(--text); font-weight: 600; }
.storage-info { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px; color: var(--text-2); }

.tag-admin { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tag-admin li { display: flex; align-items: center; gap: 4px; padding: 4px 2px; border-bottom: 1px solid var(--border); font-size: 14px; background: var(--surface); }
.tag-admin li.dragging { opacity: .55; }
.tag-admin .drag { display: flex; padding: 4px; color: var(--text-3); cursor: grab; border-radius: 6px; }
.tag-admin .drag:hover { color: var(--text); background: var(--surface-2); }
.tag-admin .dot-sm { flex: none; width: 9px; height: 9px; margin-left: 2px; border-radius: 50%; background: oklch(var(--tag-dot-l) var(--tag-dot-c) var(--h)); }
.tag-admin .hash { color: var(--text-3); margin-left: 6px; }
.tag-name { flex: 1; min-width: 0; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; font-weight: 550; }
.tag-name:hover { border-color: var(--border); }
.tag-name:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.tag-admin li .uses { min-width: 28px; text-align: right; margin-right: 6px; }
.icon-btn:disabled { opacity: .28; cursor: default; background: transparent; transform: none; }
.tag-add + .hint { margin-top: 10px; }
.tag-admin li .uses { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tag-add { display: flex; gap: 8px; margin-top: 16px; }
.tag-add .input { flex: 1; height: 36px; }

/* ---------- Animationer ---------- */
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes noteIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes flash { 0%, 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes composerIn { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Mellemstore skærme ---------- */
@media (max-width: 1020px) {
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .field.grow { grid-column: 1 / -1; order: -1; }
  .fields .btn { grid-column: 1 / -1; }
  .session-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .session-link { grid-template-columns: 10px minmax(0, 1fr) 130px 70px; }
  .s-spark { display: none; }
}

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  .shell { padding: 0 16px; }
  main { padding-top: 22px; }
  .topbar-inner { gap: 10px; height: 56px; }
  .brand-name, .privacy-text { display: none; }
  .privacy-pill { padding: 0; width: 34px; justify-content: center; }
  .nav { margin-left: auto; }
  .topbar-actions { margin-left: 0; gap: 2px; }
  .page-title { font-size: 25px; }
  .page-head { margin-bottom: 20px; }
  .new-session { padding: 16px; }
  .session-link { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; padding: 12px 4px 12px 14px; }
  .s-date { display: none; }
  .s-actions { opacity: 1; padding-right: 6px; }
  .session-head { flex-direction: column; gap: 14px; margin-bottom: 18px; }
  .session-head h1 { font-size: 22px; }
  .head-actions { justify-content: flex-start; }
  .seg { display: flex; }
  .session-grid { grid-template-columns: 1fr; gap: 0; }
  .session-grid:not(.show-panel) .panel { display: none; }
  .session-grid.show-panel .timeline-col { display: none; }
  .panel { position: static; }
  .note { grid-template-columns: 58px 18px minmax(0, 1fr); }
  .note.editing { grid-template-columns: 58px 18px minmax(0, 1fr); }
  .gap { grid-template-columns: 58px 18px 1fr; }
  .note-time { font-size: 12.5px; }
  .note-actions { grid-column: 3; opacity: 1; margin-top: 4px; }
  .composer { bottom: calc(10px + env(safe-area-inset-bottom)); }
  .composer-panel { padding: 12px; }
  .composer-hint, .composer-bar-keys, .chip-key { display: none; }
  .composer-bottom { flex-wrap: wrap; }
  .composer-bottom .source-field { flex-basis: 100%; }
  .composer-buttons { margin-left: auto; }
  .tiles { gap: 10px; }
  .tile { padding: 14px 16px; }
  .tile .stat-num { font-size: 22px; }
  .ov-grid { grid-template-columns: 1fr; }
  .dlg-fields, .keys { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  .toasts, .view-session-active .toasts { top: calc(64px + env(safe-area-inset-top)); bottom: auto; flex-direction: column; }
  .banner { flex-wrap: wrap; }
  .banner p { flex-basis: calc(100% - 40px); }
  .banner .btn { margin-left: 32px; }
}

@media (hover: none) {
  .note-actions, .s-actions { opacity: 1; }
  .composer-bar-keys { display: none; }
}
