/* Tavle – mobil først. Ingen rammeverk, ingen eksterne fonter (CSP: bare 'self'). */

:root {
  --bg: #efeadf;
  --bg-2: #e6e0d2;
  --card: #fffdf8;
  --ink: #1f2b25;
  --ink-2: #5d675f;
  --ink-3: #8a918a;
  --line: #d9d2c2;
  --accent: #244a39;
  --accent-ink: #fffdf8;
  --amber: #d98e3a;
  --red: #b9412e;
  --blue: #3a6ec2;
  --shadow: 0 1px 2px rgb(40 30 10 / .08), 0 2px 8px rgb(40 30 10 / .06);
  --shadow-lift: 0 10px 30px rgb(30 20 0 / .25);
  --radius: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --col-w: min(86vw, 360px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111714;
    --bg-2: #18201c;
    --card: #1e2822;
    --ink: #e9ede7;
    --ink-2: #a7b2aa;
    --ink-3: #78837b;
    --line: #2d3a33;
    --accent: #7cc49d;
    --accent-ink: #0f1a14;
    --amber: #e8a64e;
    --red: #e3735e;
    --blue: #7aa6ef;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-lift: 0 12px 34px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.4 ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.inline { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
code { font-size: .9em; background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }

/* ------------------------------------------------------------ splash/login */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; }
.splash img { width: 72px; height: 72px; border-radius: 18px; opacity: .9; }

.login { min-height: 100%; display: grid; place-items: center; padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b)); }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-logo { width: 64px; height: 64px; border-radius: 16px; align-self: center; box-shadow: var(--shadow); }
.login h1 { text-align: center; margin: 0 0 8px; font-size: 28px; letter-spacing: -.02em; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
input:not([type=checkbox]), select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); font-size: 16px; /* ≥16px: iOS zoomer ikke */
  outline: none; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea { resize: vertical; min-height: 64px; }
input[type=datetime-local] { min-height: 46px; }
.error { color: var(--red); min-height: 1.2em; margin: 0; font-size: 14px; }

.btn { border: 1px solid var(--line); background: var(--card); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 15px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--red); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--accent); font-size: 16px; padding: 8px 4px; }
.link.strong { font-weight: 700; }
.icon-btn { background: none; border: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2); }
.icon-btn:active, .icon-btn.on { background: var(--bg-2); color: var(--ink); }

/* ------------------------------------------------------------ header */
.app { height: 100dvh; display: flex; flex-direction: column; }
.top {
  padding: calc(6px + var(--safe-t)) calc(12px + var(--safe-r)) 0 calc(16px + var(--safe-l));
  background: var(--bg); position: relative; z-index: 3;
}
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.brand { font-size: 26px; font-weight: 800; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-switch { display: flex; align-items: center; gap: 2px; min-width: 0; background: none; border: 0; padding: 4px 6px 4px 0; margin-left: -2px; border-radius: 12px; color: var(--ink); }
.view-switch svg { flex: none; width: 22px; height: 22px; color: var(--ink-2); stroke-width: 2.4; }
.view-switch:active { background: var(--bg-2); }
.top-actions { display: flex; gap: 2px; }
.search-row { padding: 4px 4px 6px 0; }
.search-row input { padding: 9px 12px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 4px 8px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip:not(:has(.av)) { padding-left: 12px; }
.chip[aria-pressed=true], .chip[aria-checked=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-weight: 500; opacity: .6; }

.av {
  --c: var(--accent);
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--c); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: -.02em;
}
.av.lg { width: 30px; height: 30px; font-size: 13px; }
.av.none { background: transparent; border: 1.5px dashed var(--ink-3); }

.tabs { display: flex; gap: 0; margin: 0 -12px 0 -16px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; background: none; border: 0; padding: 10px 12px 11px; font-weight: 700; font-size: 15px; color: var(--ink-3); position: relative; }
.tab .n { font-weight: 600; font-size: 12px; margin-left: 4px; background: var(--bg-2); color: var(--ink-2); border-radius: 999px; padding: 1px 7px; }
.tab.active { color: var(--ink); }
.tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--accent); }

.banner { margin: 8px 16px 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--amber) 18%, var(--card)); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.banner .grow { flex: 1; }

/* ------------------------------------------------------------ board */
.board {
  flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  padding: 10px calc(16px + var(--safe-r)) 0 calc(16px + var(--safe-l));
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.board::-webkit-scrollbar { display: none; }
.board.dragging { scroll-snap-type: none; }
.col { flex: 0 0 var(--col-w); scroll-snap-align: start; display: flex; flex-direction: column; min-height: 0; }
.col:last-child { margin-right: 16px; }
.col-head { display: none; }
.col-list {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding: 2px 2px calc(100px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px;
}
.empty { color: var(--ink-3); text-align: center; padding: 36px 12px; font-size: 15px; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.col.done .card .title { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-3); }

@media (min-width: 760px) {
  :root { --col-w: 320px; }
  .board { scroll-snap-type: none; }
  .tabs { display: none; }
  .col-head { display: flex; align-items: baseline; gap: 8px; padding: 4px 4px 10px; font-weight: 800; font-size: 15px; }
  .col-head .n { color: var(--ink-3); font-weight: 600; font-size: 13px; }
  .col { background: var(--bg-2); border-radius: 18px; padding: 10px 8px 0; }
  .col-list { padding-bottom: 24px; }
}

/* ------------------------------------------------------------ kort */
.card {
  position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 11px 12px 11px 46px; min-height: 52px;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation; transition: transform .12s, opacity .12s;
}
.card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: transparent; }
.card.p1::before { background: var(--amber); }
.card.p2::before { background: var(--red); }
.card:active:not(.ghost) { transform: scale(.99); }
.card .check {
  position: absolute; left: 6px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; border: 0; background: none; padding: 0;
  display: grid; place-items: center; color: var(--ink-3);
}
.card .check span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; }
.card .check svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.col.done .card .check { color: var(--accent); }
.col.done .card .check span { background: var(--accent); border-color: var(--accent); }
.col.done .card .check svg { opacity: 1; color: var(--accent-ink); }
.card .title { font-weight: 600; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.card .meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.card .meta-row:empty { display: none; }
.card .meta-row svg { width: 14px; height: 14px; vertical-align: -2px; }
.card .who { display: inline-flex; align-items: center; gap: 5px; }
.card .who .av { width: 18px; height: 18px; font-size: 9px; }
.card .due.overdue { color: var(--red); font-weight: 700; }
.card .due.today { color: var(--amber); font-weight: 700; }
.card .notes-preview { margin-top: 4px; font-size: 13px; color: var(--ink-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.card.placeholder { opacity: .25; box-shadow: none; outline: 2px dashed var(--ink-3); outline-offset: -2px; }
.card.ghost {
  position: fixed; z-index: 40; pointer-events: none; margin: 0; box-shadow: var(--shadow-lift);
  transform: rotate(1.5deg) scale(1.03); transition: none;
}
.card.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: var(--shadow); } }

/* ------------------------------------------------------------ FAB, toast */
.fab {
  position: fixed; right: calc(18px + var(--safe-r)); bottom: calc(20px + var(--safe-b)); z-index: 5;
  width: 60px; height: 60px; border-radius: 20px; border: 0; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent);
}
.fab svg { width: 28px; height: 28px; stroke-width: 2.5; }
.fab:active { transform: scale(.95); }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); translate: -50% 20px; z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, translate .2s; max-width: calc(100vw - 32px);
  display: flex; gap: 12px; align-items: center;
}
.toast.show { opacity: 1; translate: -50% 0; pointer-events: auto; }
/* Som popover ligger toasten i det øverste laget, over åpne ark, så «Angre» kan trykkes. */
.toast[popover] { inset: auto; left: 50%; bottom: calc(92px + var(--safe-b)); margin: 0; border: 0; overflow: visible; }
.toast[popover]:popover-open { display: flex; }
.toast button { background: none; border: 0; color: var(--amber); font-weight: 800; padding: 0; }

/* ------------------------------------------------------------ ark (dialog) */
dialog.sheet {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: calc(100dvh - 40px - var(--safe-t));
  background: var(--bg); color: var(--ink); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lift);
  overflow: hidden;
}
dialog.sheet[open] { animation: up .22s cubic-bezier(.2,.9,.3,1); display: flex; }
dialog.sheet::backdrop { background: rgb(10 15 12 / .45); }
@keyframes up { from { translate: 0 40%; opacity: .4; } }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; max-width: 520px; border-radius: 22px; max-height: min(86dvh, 860px); }
}
.sheet-body {
  flex: 1; overflow-y: auto; padding: 6px calc(18px + var(--safe-r)) calc(24px + var(--safe-b)) calc(18px + var(--safe-l));
  display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain;
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 0; flex: none; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: sticky; top: -6px; background: var(--bg); z-index: 2; margin: 0 -4px; padding: 4px 0; }
.sheet-head > :first-child { justify-self: start; }
.sheet-head > :last-child { justify-self: end; }
.sheet-head h2 { margin: 0; font-size: 17px; }
.title-input { font-size: 20px !important; font-weight: 700; padding: 14px !important; }
.field h3, .card-section h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.field .chips { margin-top: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.hint { color: var(--ink-3); font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; margin: 0; }
.meta { color: var(--ink-3); font-size: 12px; margin: 0; text-align: center; }

.seg { display: flex; background: var(--bg-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg button[aria-checked=true] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.switch-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 15px; background: var(--card); border-radius: 14px; padding: 12px 14px; }
.switch { -webkit-appearance: none; appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: translate .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { translate: 20px 0; }

.card-section { background: var(--card); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card-section .stack label { color: var(--ink-2); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li .grow { font-weight: 600; }
.list li .sub { color: var(--ink-3); font-size: 13px; font-weight: 400; }
.mini { flex: none; background: none; border: 0; color: var(--ink-2); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; padding: 0; }
.mini:active { background: var(--bg-2); }
.mini:disabled { opacity: .3; }
.mini svg { width: 18px; height: 18px; }

.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; outline: 2px solid transparent; }
.swatch[aria-checked=true] { border-color: var(--card); outline-color: var(--ink); }

.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.lang-switch { display: flex; justify-content: center; gap: 4px; }
.lang-switch button { background: none; border: 0; padding: 6px 10px; border-radius: 8px; color: var(--ink-3); font-size: 14px; font-weight: 600; }
.lang-switch button[aria-checked=true] { color: var(--ink); background: var(--bg-2); }
[data-lang-switch].seg button { flex: 1; }

.confirm-title { margin: 8px 0 0; font-size: 18px; text-align: center; }
.confirm-text { margin: 0; text-align: center; color: var(--ink-2); overflow-wrap: anywhere; }


/* ------------------------------------------------------------ 0.2: visninger, I dag */
.board.today-view { display: block; overflow-y: auto; overflow-x: hidden; scroll-snap-type: none; padding-bottom: calc(100px + var(--safe-b)); }
.today-list { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.group-head { margin: 14px 2px 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 800; display: flex; gap: 8px; align-items: baseline; }
.group-head:first-child { margin-top: 4px; }
.group-head.overdue { color: var(--red); }
.group-head .n { font-weight: 600; }
.board-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-2); border-radius: 6px; padding: 0 6px; font-size: 12px; }

.list.views li { padding: 0; border-bottom: 0; }
.view-pick { flex: 1; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 12px 10px; border-radius: 12px; font-size: 17px; font-weight: 600; text-align: left; min-width: 0; }
.view-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list.views li.active .view-pick { background: var(--card); box-shadow: var(--shadow); }
.list.views li.active .view-pick svg { color: var(--accent); }

/* etiketter */
.label { --c: var(--accent); display: inline-flex; align-items: center; border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 700;
  color: color-mix(in srgb, var(--c) 75%, var(--ink)); background: color-mix(in srgb, var(--c) 16%, var(--card)); }
.card .labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip.label-chip { --c: var(--accent); color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.chip.label-chip[aria-pressed=true] { background: var(--c); border-color: var(--c); color: #fff; }
.card .progress.complete { color: var(--accent); font-weight: 700; }
.card .pending { color: var(--amber); }
.card.is-done .labels { opacity: .6; }

/* hurtigregistrering */
.stack.tight { gap: 6px; }
.quick-preview { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.quick-preview .qp { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px dashed var(--line); border-radius: 8px; padding: 2px 8px; }
.quick-preview .qp svg { width: 14px; height: 14px; }
.quick-preview .qp .av { width: 16px; height: 16px; font-size: 8px; }
.quick-preview .prio { color: var(--red); font-weight: 700; }

/* utsett */
.snooze { background: color-mix(in srgb, var(--amber) 16%, var(--card)); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 14px; }

/* sjekkliste */
.checklist { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; background: var(--card); border-radius: 14px; }
.checklist:empty { display: none; }
.checklist li { display: flex; align-items: center; gap: 4px; padding: 2px 4px 2px 2px; border-bottom: 1px solid var(--line); min-height: 46px; }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { flex: none; width: 42px; height: 42px; border: 0; background: none; display: grid; place-items: center; padding: 0; color: var(--ink-3); }
.checklist .tick::before { content: ""; grid-area: 1 / 1; width: 22px; height: 22px; border-radius: 7px; border: 2px solid currentColor; }
.checklist .tick svg { grid-area: 1 / 1; width: 14px; height: 14px; stroke-width: 3; opacity: 0; color: var(--accent-ink); }
.checklist li.done .tick { color: var(--accent); }
.checklist li.done .tick::before { background: var(--accent); }
.checklist li.done .tick svg { opacity: 1; }
.checklist .item-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 16px; }
.checklist li.done .item-text { color: var(--ink-3); text-decoration: line-through; }
.checklist .mini { opacity: .55; }
.add-item textarea { min-height: 46px; resize: none; overflow-y: auto; }

/* gjentakelse */
.repeat-more { margin-top: 10px; gap: 10px; }
.repeat-more .row { color: var(--ink-2); font-size: 15px; }
input.num { width: 76px; text-align: center; }
.weekdays { display: flex; gap: 6px; }
.weekdays .day { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 700; color: var(--ink-2); }
.weekdays .day[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.switch-row.compact { padding: 10px 12px; font-size: 14px; }

/* bilder */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 8px; }
.photos:empty { display: none; }
.photo { aspect-ratio: 1; max-width: 100%; border-radius: 12px; overflow: hidden; border: 0; padding: 0; background: var(--bg-2); display: block; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.pending { opacity: .6; }
.file-btn { display: inline-flex; align-items: center; justify-content: center; position: relative; overflow: hidden; color: var(--ink); font-size: 15px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
dialog.viewer { background: #000; }
dialog.viewer .sheet-head { background: #000; color: #fff; }
dialog.viewer .link { color: #fff; }
dialog.viewer .link.danger { color: #ff8a75; }
#photo-big { width: 100%; max-height: 75dvh; object-fit: contain; }

/* kalender */
.ics-title { margin: 0; font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
#ics-durations .chip[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
pre.code { white-space: pre-wrap; word-break: break-all; font-size: 11px; background: var(--bg-2); border-radius: 10px; padding: 10px; max-height: 220px; overflow: auto; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px !important; }
.hint.strong { color: var(--amber); font-weight: 700; }
a.btn { text-decoration: none; color: var(--ink); text-align: center; }

/* innstillinger */
.row.between { justify-content: space-between; flex-direction: row; align-items: center; color: var(--ink); font-size: 15px; }
select.auto { width: auto; min-width: 120px; }
.colors.small .swatch { width: 28px; height: 28px; }
.list.archive .archive-title { font-weight: 600; }
.empty-row { color: var(--ink-3); justify-content: center; padding: 24px 0 !important; }

/* frakoblet */
.banner.offline { background: color-mix(in srgb, var(--ink-3) 18%, var(--card)); }
.banner svg { flex: none; }
.card .due > svg + svg { margin-left: 3px; }

/* ny versjon */
.banner.update { background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
.banner.update svg { color: var(--accent); }
.btn.small { padding: 7px 12px; font-size: 14px; flex: none; }

/* dra ned for å oppdatere */
.ptr { height: 0; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; color: var(--ink-3); font-size: 13px; font-weight: 600; flex: none; }
.ptr:not(.loading) { transition: height .2s; }
.ptr-inner { display: flex; align-items: center; gap: 6px; padding-bottom: 10px; }
.ptr svg { width: 18px; height: 18px; transition: transform .2s; }
.ptr.ready svg { transform: rotate(180deg); }
.ptr.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* flytte sjekklistepunkter */
.checklist .grip { flex: none; width: 28px; height: 42px; display: grid; place-items: center; color: var(--ink-3); touch-action: none; cursor: grab; margin-right: -6px; }
.checklist .grip svg { width: 18px; height: 18px; stroke-width: 3; }
.checklist li.dragging-item { background: var(--bg-2); box-shadow: var(--shadow-lift); position: relative; z-index: 2; border-radius: 10px; }

/* --- 0.4: passnøkkel på innloggingen --- */
.login .or { margin: -4px 0; text-align: center; color: var(--ink-3); font-size: 14px; }
.btn.passkey { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.passkey svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --- 0.4: ukevisning --- */
.week-nav { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; }
.week-title { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.week-title strong { font-size: 17px; }
.week-title span { font-size: 13px; color: var(--ink-3); }
.day { display: flex; flex-direction: column; gap: 6px; }
.day-head { margin: 10px 2px 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 800; display: flex; gap: 8px; align-items: center; }
.day-head .n { font-weight: 600; }
.day-head .mini { margin: -6px -4px -6px 0; }
.day.is-today .day-head { color: var(--accent); }
.day.is-past .day-head { opacity: .6; }
.day-list { display: flex; flex-direction: column; gap: 8px; min-height: 34px; border-radius: var(--radius); }
.day-empty { color: var(--ink-3); font-size: 14px; padding: 6px 12px; border: 1.5px dashed var(--line); border-radius: var(--radius); text-align: center; }
.board.dragging .day-list { background: color-mix(in srgb, var(--accent) 6%, transparent); outline: 1.5px dashed var(--line); outline-offset: 2px; }
.week-later { text-align: center; margin: 14px 0 0; }
.day.is-past .day-empty { display: none; }
.day.is-past .day-list:not(:has(.card)) { min-height: 0; }
