/* Gjøremål – stilark. Lyst/mørkt tema via data-theme på <html>. */
:root {
  --accent: #db4c3f; --accent-2: #c3392c; --accent-soft: #ffefe5;
  --bg: #ffffff; --bg-side: #fcfaf8; --bg-hover: #f2efed; --bg-elev: #ffffff; --bg-sel: #fff3e6;
  --text: #202020; --muted: #808080; --faint: #b9b9b9; --line: #ececec; --line-2: #e0e0e0;
  --ok: #058527; --warn: #ad6200; --bad: #d1453b; --week: #692fc2; --tickler: #b8860b;
  --radius: 8px; --shadow: 0 6px 24px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.08);
  --side-w: 290px; --detail-w: 460px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color-scheme: light;
}
[data-theme="dark"] {
  --accent: #e06b5f; --accent-2: #f07a6e; --accent-soft: #3a2422;
  --bg: #1e1e1e; --bg-side: #262626; --bg-hover: #2f2f2f; --bg-elev: #282828; --bg-sel: #3a2f22;
  --text: #ececec; --muted: #9a9a9a; --faint: #666; --line: #333; --line-2: #3d3d3d;
  --ok: #4caf50; --warn: #e0a040; --bad: #ef6b60; --week: #a586e0; --tickler: #d6a830;
  --shadow: 0 6px 24px rgba(0,0,0,.5); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { line-height: 1.4; -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; }
kbd { font-family: inherit; font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--muted); background: var(--bg-side); }
.ic { flex: none; }
.muted { color: var(--muted); } .small { font-size: 12px; } .pad { padding: 0 4px 8px; }
.err { color: var(--bad); font-size: 13px; } .ok { color: var(--ok); }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0; }
.spacer { flex: 1; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); font-size: 20px; }

/* ---------- knapper og felter */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; background: var(--bg-hover); font-weight: 500; white-space: nowrap; }
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.small { width: 24px; height: 24px; }
.input { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); outline: none; }
.input:focus { border-color: var(--faint); box-shadow: 0 0 0 2px var(--accent-soft); }
textarea.input { resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.form { display: grid; gap: 12px; }
.form label, .settings label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.inline { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { padding: 4px 8px; color: var(--muted); display: grid; place-items: center; }
.seg button.active { background: var(--bg-hover); color: var(--text); }

/* ---------- skall */
.shell { display: flex; height: 100vh; height: 100dvh; }
.sidebar { width: var(--side-w); flex: none; background: var(--bg-side); overflow-y: auto; padding: 12px 10px 24px; border-right: 1px solid var(--line); }
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: none; }
.main { flex: 1; overflow-y: auto; padding: 32px 48px 120px; outline: none; }
.view { max-width: 820px; margin: 0 auto; }
.detail-open .main { padding-right: calc(var(--detail-w) + 24px); }
.fab { display: none; }

.side-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; font-weight: 600; }
.user-btn:hover { background: var(--bg-hover); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
.add-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; color: var(--accent); font-weight: 600; border-radius: 6px; }
.add-btn:hover { background: var(--bg-hover); }
.add-btn .plus { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; }
.nav { margin: 4px 0 12px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; color: var(--text); min-width: 0; flex: 1; }
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item .ic { color: var(--accent); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { color: var(--muted); font-size: 12px; }
.side-section { margin-top: 14px; }
.side-title { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.side-bottom { border-top: 1px solid var(--line); padding-top: 10px; }
.proj-row { display: flex; align-items: center; padding-left: calc(var(--depth, 0) * 14px); position: relative; }
.proj-row .row-more { opacity: 0; }
.proj-row:hover .row-more { opacity: 1; }
.proj-row.drop-child { background: var(--accent-soft); border-radius: 6px; }
.proj-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.twisty { width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted); flex: none; transition: transform .15s; border-radius: 4px; }
.twisty.open { transform: rotate(90deg); }
.twisty-space { width: 18px; flex: none; }

/* ---------- visningshode */
.view-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.view-head h1 { font-size: 22px; margin: 0; flex: 1; min-width: 0; }
.view-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.query { background: var(--bg-hover); padding: 2px 6px; border-radius: 4px; color: var(--muted); }
.project-desc { color: var(--muted); margin: -8px 0 14px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .big { font-size: 48px; margin-bottom: 8px; }
.empty-small { color: var(--faint); font-size: 13px; padding: 6px 0 2px 30px; }
.banner { background: var(--accent-soft); padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }

/* ---------- grupper og oppgaver */
.group { margin-bottom: 18px; }
.group-head { display: flex; align-items: center; gap: 6px; padding: 6px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.group-head h3 { font-size: 14px; margin: 0; font-weight: 700; }
.group-head .count { color: var(--muted); font-size: 12px; flex: 1; }
.group-head.overdue h3 { color: var(--bad); }
.group-head.this_week h3 { color: var(--week); }
.group-head.drop-zone, .task-list.drop-zone { background: var(--accent-soft); }
.task-list { min-height: 4px; border-radius: 6px; }

.task { display: flex; align-items: flex-start; gap: 6px; padding: 8px 4px 8px calc(4px + var(--depth, 0) * 28px); border-bottom: 1px solid var(--line); position: relative; outline: none; cursor: pointer; }
.task:hover { background: var(--bg-hover); }
.task:focus-visible { box-shadow: inset 2px 0 0 var(--accent); background: var(--bg-hover); }
.task.selected { background: var(--bg-sel); }
.task.dragging { opacity: .4; }
.task.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.task.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.task.drop-child { box-shadow: inset 40px -2px 0 -38px var(--accent); }
.task .handle { position: absolute; left: -20px; top: 10px; color: var(--faint); opacity: 0; cursor: grab; }
.task:hover .handle { opacity: 1; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--c, var(--muted)); display: grid; place-items: center; flex: none; margin-top: 1px; color: transparent; background: transparent; }
.check.p1 { background: color-mix(in srgb, var(--c) 12%, transparent); border-width: 2px; }
.check.p2, .check.p3 { background: color-mix(in srgb, var(--c) 10%, transparent); border-width: 2px; }
.check:hover { color: var(--c, var(--muted)); }
.task.done .check, .check.done { background: var(--c, var(--muted)); color: #fff; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.check.big { width: 24px; height: 24px; margin-top: 4px; }
.task-main { flex: 1; min-width: 0; }
.task-title { word-break: break-word; }
.task-title code { background: var(--bg-hover); padding: 0 4px; border-radius: 3px; }
.task-title a { color: var(--accent); text-decoration: underline; }
.task-desc { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; align-items: center; font-size: 12px; }
.task-actions { display: flex; opacity: 0; }
.task:hover .task-actions, .task:focus-within .task-actions { opacity: 1; }
.where { margin-left: auto; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip.label { color: var(--muted); }
.chip.deadline { color: var(--bad); }
.btnchip { padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 12px; }
.btnchip:hover { background: var(--bg-hover); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.due-overdue { color: var(--bad) !important; }
.due-today { color: var(--ok) !important; }
.due-tomorrow { color: var(--warn) !important; }
.due-week { color: var(--week) !important; }
.due-later { color: var(--muted) !important; }
.due-tickler { color: var(--tickler) !important; }

.add-task { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 8px 4px; width: 100%; }
.add-task:hover { color: var(--accent); }
.add-task .ic { color: var(--accent); }
.adder-form { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px; margin: 6px 0; }
.adder-form .input { border: 0; padding: 4px; box-shadow: none !important; font-weight: 500; }
.adder-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.qa-preview { display: flex; flex-wrap: wrap; gap: 6px 10px; min-height: 0; padding: 2px 4px; }
.qa-preview .chip { background: var(--bg-hover); padding: 2px 8px; border-radius: 10px; }
.add-section { display: flex; align-items: center; gap: 6px; color: var(--muted); padding: 10px 0; width: 100%; border-top: 1px dashed transparent; }
.add-section:hover { color: var(--accent); border-top-color: var(--accent); }
.done-subs summary { color: var(--muted); cursor: pointer; padding: 6px 0; font-size: 13px; }

/* ---------- tavle */
.board { display: flex; gap: 16px; overflow-x: auto; align-items: flex-start; padding-bottom: 20px; }
.view:has(.board) { max-width: none; }
.column { width: 290px; flex: none; }
.column .task { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; background: var(--bg-elev); padding-left: 8px; }
.column.new { padding-top: 6px; }

/* ---------- kalender */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-nav strong { min-width: 140px; text-align: center; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal-wd { padding: 6px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 96px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.cal-cell.other { background: var(--bg-side); color: var(--faint); }
.cal-cell.today .cal-day { background: var(--accent); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.cal-cell.drop-zone { background: var(--accent-soft); }
.cal-day { font-size: 12px; margin-bottom: 2px; }
.cal-task { font-size: 11px; padding: 2px 4px; border-left: 3px solid; background: var(--bg-hover); border-radius: 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-task.done { text-decoration: line-through; opacity: .6; }
.view:has(.calendar) { max-width: 1100px; }

/* ---------- kommende */
.week-strip { display: flex; gap: 4px; align-items: center; margin-bottom: 14px; overflow-x: auto; }
.day-pill { display: grid; place-items: center; min-width: 42px; padding: 4px; border-radius: 8px; font-weight: 600; }
.day-pill small { color: var(--muted); font-weight: 400; font-size: 11px; }
.day-pill:hover { background: var(--bg-hover); }
.day-pill.today { color: var(--accent); }

/* ---------- popover, meny, modal, toast */
.popover { position: fixed; z-index: 60; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-width: min(360px, calc(100vw - 16px)); }
.menu { padding: 4px; min-width: 220px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 5px; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item.sel { background: var(--bg-hover); }
.menu-item span:first-of-type { flex: 1; }
.menu-item.danger { color: var(--bad); }
.menu-item.sub { font-size: 13px; }
.menu-item kbd { margin-left: auto; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.menu-list.scroll { max-height: 320px; overflow-y: auto; }
.picker { padding: 8px; width: 320px; max-width: 100%; display: grid; gap: 6px; }
.date-picker { padding: 8px; width: 300px; display: grid; gap: 6px; }
.date-preview { font-size: 12px; color: var(--ok); min-height: 16px; }
.date-preview.err { color: var(--bad); }
.minical-head { display: flex; justify-content: space-between; align-items: center; text-transform: capitalize; font-weight: 600; font-size: 13px; }
.minical-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.minical-grid .wd { font-size: 11px; color: var(--muted); }
.minical-grid .day { padding: 5px 0; border-radius: 50%; font-size: 12px; }
.minical-grid .day:hover { background: var(--bg-hover); }
.minical-grid .day.today { color: var(--accent); font-weight: 700; }
.minical-grid .day.sel { background: var(--accent); color: #fff; }
.minical-grid .day.past { color: var(--faint); }
.date-extra { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 6px; font-size: 13px; }
.date-extra .time { width: 90px; padding: 3px 6px; }

.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; display: grid; place-items: start center; padding-top: 12vh; overflow-y: auto; }
.modal { background: var(--bg-elev); border-radius: 10px; box-shadow: var(--shadow); width: min(520px, calc(100vw - 24px)); margin-bottom: 40px; }
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 0; }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-body { padding: 14px 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.qa-modal { width: min(620px, calc(100vw - 24px)); }
.quick-add { display: grid; gap: 6px; }
.quick-add .qa-input { font-size: 16px; font-weight: 500; border: 0; padding: 4px 0; box-shadow: none !important; }
.quick-add textarea { border: 0; padding: 4px 0; box-shadow: none !important; font-size: 13px; }
.palette-modal { width: min(620px, calc(100vw - 24px)); }
.palette .input { font-size: 16px; }
.palette-list { max-height: 420px; overflow-y: auto; margin-top: 8px; }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 6px; text-align: left; }
.palette-item span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item.active, .palette-item:hover { background: var(--bg-hover); }
.keys td { padding: 4px 12px 4px 0; }

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; }
.toast { display: flex; align-items: center; gap: 14px; background: #282828; color: #fff; padding: 10px 10px 10px 16px; border-radius: 8px; box-shadow: var(--shadow); }
.toast.error { background: var(--bad); }
.toast .link { color: #ff9f94; }
.toast .icon-btn { color: #bbb; }

.bulkbar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40; display: flex; gap: 6px; align-items: center; background: var(--bg-elev); padding: 8px; border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); flex-wrap: wrap; max-width: calc(100vw - 20px); }
.bulkbar .count { font-weight: 600; padding: 0 8px; }

/* ---------- detaljpanel */
.detail { position: fixed; top: 0; right: 0; bottom: 0; width: var(--detail-w); background: var(--bg-elev); border-left: 1px solid var(--line); box-shadow: -6px 0 20px rgba(0,0,0,.06); z-index: 30; display: flex; flex-direction: column; }
.detail-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.crumbs { color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.detail-tools { display: flex; }
.detail-scroll { overflow-y: auto; padding: 14px 18px 60px; flex: 1; }
.detail-title { display: flex; gap: 10px; align-items: flex-start; }
.title-edit { flex: 1; font-size: 19px; font-weight: 600; border: 0; outline: none; resize: none; background: transparent; padding: 2px 0; overflow: hidden; }
.desc-view { margin: 6px 0 12px 34px; font-size: 13px; cursor: text; min-height: 20px; }
.desc-view.placeholder { color: var(--faint); }
.desc-view a { color: var(--accent); text-decoration: underline; }
.desc-edit { width: calc(100% - 34px); margin: 6px 0 12px 34px; border: 1px solid var(--line-2); border-radius: 6px; padding: 6px; background: var(--bg); resize: vertical; }
.props { display: grid; gap: 2px; margin: 8px 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; }
.prop { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 8px; text-align: left; padding: 6px; border-radius: 6px; font-size: 13px; }
.prop:hover { background: var(--bg-hover); }
.prop-label { color: var(--muted); }
.prop-value { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.detail h4 { margin: 16px 0 4px; font-size: 13px; }
.tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin-top: 18px; }
.tab { padding: 8px 0; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-body { padding-top: 10px; }
.comment { padding: 8px 0; border-bottom: 1px solid var(--line); }
.comment-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.comment-body { font-size: 13px; }
.comment-body a { color: var(--accent); text-decoration: underline; }
.comment-form { margin-top: 10px; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att img { max-width: 160px; max-height: 120px; border-radius: 6px; border: 1px solid var(--line); }
.att.file { display: inline-flex; gap: 6px; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.att audio { width: 240px; }
.activity { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.activity li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.activity.big li { padding: 8px 0; }
.drop-zone { outline: 2px dashed var(--accent); }

/* ---------- lister uten avkryssing */
.plain-list { display: grid; }
.plain-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.plain-row:hover { background: var(--bg-hover); }
.plain-list.compact .plain-row { padding: 4px; font-size: 13px; }
.done-row .ic { color: var(--ok); }

/* ---------- ukeplan */
.view:has(.week-grid) { max-width: 1200px; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.week-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-elev); }
.week-card-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 6px; }
.week-card-head a { flex: 1; }
.week-card .group { margin-bottom: 8px; }
.week-card .task { padding-top: 5px; padding-bottom: 5px; }
.capacity { display: inline-flex; gap: 4px; align-items: center; padding: 4px 8px; border-radius: 6px; background: var(--bg-hover); font-size: 13px; }
.capacity.over { background: var(--accent-soft); color: var(--bad); }

/* ---------- gjennomgang */
.view:has(.review) { max-width: 1100px; }
.review { display: grid; grid-template-columns: 240px 1fr; gap: 28px; }
.review aside { display: grid; gap: 12px; align-content: start; position: sticky; top: 0; }
.review-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.review-steps button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 7px 8px; border-radius: 6px; }
.review-steps button:hover { background: var(--bg-hover); }
.review-steps .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-hover); font-size: 12px; flex: none; }
.review-steps li.active button { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.review-steps li.active .num { background: var(--accent); color: #fff; }
.review-steps li.done .num { background: var(--ok); color: #fff; }
.review-body h2 { margin: 0 0 4px; font-size: 19px; }
.review-content { margin: 14px 0; }
.review-content .view-head h1 { font-size: 16px; }
.review-nav { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.blocks { padding-left: 18px; }
.blocks li { margin-bottom: 6px; }
table.health { width: 100%; border-collapse: collapse; font-size: 13px; }
.health th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px; border-bottom: 1px solid var(--line-2); }
.health td { padding: 6px; border-bottom: 1px solid var(--line); }
.health td:first-child { display: flex; gap: 8px; align-items: center; }
.health td.good { color: var(--ok); } .health td.warn { color: var(--warn); } .health td.bad { color: var(--bad); font-weight: 600; }

/* ---------- statistikk */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.big-num { font-size: 28px; font-weight: 700; }
.goal { display: flex; gap: 12px; align-items: center; }
.ring { width: 54px; height: 54px; border-radius: 50%; background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--bg-hover) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 42px; height: 42px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-weight: 700; }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 140px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar .fill { width: 100%; background: var(--faint); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar .fill.hit { background: var(--ok); }
.bar small { font-size: 9px; color: var(--muted); }

/* ---------- innstillinger */
.settings { display: grid; gap: 18px; }
.settings section { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; }
.settings h2 { font-size: 15px; margin: 0; }
.settings summary { cursor: pointer; color: var(--accent); }
.secret { display: grid; grid-template-columns: 110px 1fr auto auto; gap: 6px; align-items: center; }
details.help summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.help code { background: var(--bg-hover); padding: 0 3px; border-radius: 3px; }

/* ---------- innlogging */
.login-wrap { display: grid; place-items: center; min-height: 100vh; background: var(--bg-side); padding: 20px; }
.login { width: min(360px, 100%); display: grid; gap: 10px; background: var(--bg); padding: 28px; border-radius: 12px; box-shadow: var(--shadow); }
.login .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login .logo img { width: 36px; height: 36px; }
.login h1 { margin: 0; font-size: 22px; }

/* ---------- mobil */
@media (max-width: 900px) {
  body { overflow: hidden; }
  .sidebar { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); padding-top: calc(12px + env(safe-area-inset-top)); }
  .nav-open .sidebar { transform: none; }
  .nav-scrim { display: none; }
  .nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 44; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--bg); }
  .topbar-title { flex: 1; font-weight: 700; }
  .main { padding: 16px 14px 120px; }
  .detail-open .main { padding-right: 14px; }
  .detail { width: 100%; padding-top: env(safe-area-inset-top); }
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: var(--shadow); z-index: 35; }
  .task-actions { opacity: 1; }
  .task-actions .icon-btn:first-child { display: none; }
  .task .handle { display: none; }
  .review { grid-template-columns: 1fr; }
  .review aside { position: static; }
  .review-steps { grid-auto-flow: column; overflow-x: auto; }
  .review-steps button { white-space: nowrap; }
  .week-grid { grid-template-columns: 1fr; }
  .secret { grid-template-columns: 1fr auto auto; }
  .secret > span { grid-column: 1 / -1; }
  .backdrop { padding-top: 6vh; }
  .cal-cell { min-height: 64px; }
  .cal-task { font-size: 10px; }
  #toasts { bottom: calc(86px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  .toast { justify-content: space-between; }
  .bulkbar { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .view-head h1 { font-size: 20px; }
}
@media (hover: none) {
  .proj-row .row-more { opacity: 1; }
}

.detail-open .fab { display: none; }
