/* Hjem – design "Nordisk ro" (forslag A) */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #F6F5F1;
  --side: #EFEDE6;
  --surface: #FFFFFF;
  --lane: #ECEAE3;
  --border: #E2DFD6;
  --border-strong: #B9B5AA;
  --text: #1F2421;
  --muted: #5C635D;
  --accent: #3F6B57;
  --accent-deep: #2A4A3B;
  --on-accent: #FFFFFF;
  --accent-soft: #DDE8E0;
  --accent-text: #2C5242;
  --track: #E6E3DB;
  --sel: #EEF4EF;
  --late-bg: #F8E1DE; --late-fg: #9A2E22;
  --soon-bg: #F6EDD2; --soon-fg: #6E5508;
  --danger: #9A2E22;
  --shadow: 0 1px 2px rgba(31, 36, 33, .06), 0 1px 1px rgba(31, 36, 33, .04);
  --shadow-lg: 0 18px 50px rgba(31, 36, 33, .18);

  --blue-bg: #E3ECF3;  --blue-fg: #2D5674;  --blue-dot: #3E6F8E;
  --green-bg: #E1EEE4; --green-fg: #2F6141; --green-dot: #3F6B57;
  --clay-bg: #F3E6DC;  --clay-fg: #87472A;  --clay-dot: #A8553B;
  --plum-bg: #EFE5F2;  --plum-fg: #673D78;  --plum-dot: #7A64B5;
  --sand-bg: #F3EDD6;  --sand-fg: #6A5610;  --sand-dot: #8F7A1E;
  --slate-bg: #E5E8EE; --slate-fg: #3C4555; --slate-dot: #5B6676;
  --rose-bg: #F6E2E2;  --rose-fg: #8C3232;  --rose-dot: #B04848;
  --amber-bg: #F6EDD2; --amber-fg: #6E5508; --amber-dot: #B07A10;

  --radius: 12px;
  --radius-sm: 9px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131715; --side: #0F1211; --surface: #1B201D; --lane: #171C19;
    --border: #2A312D; --border-strong: #46504A; --text: #E7ECE8; --muted: #9DA8A1;
    --accent: #86BFA2; --accent-deep: #4E8268; --on-accent: #0F1A14; --accent-soft: #22342A; --accent-text: #A9D6BE;
    --track: #2C3530; --sel: #22342A;
    --late-bg: #3B2020; --late-fg: #F0A7A7; --soon-bg: #352E17; --soon-fg: #E7CF86; --danger: #F0A7A7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
    --blue-bg: #1E2C38;  --blue-fg: #9EC3DE;  --blue-dot: #8DB6D6;
    --green-bg: #1E3024; --green-fg: #9FD1AE; --green-dot: #86BFA2;
    --clay-bg: #36261C;  --clay-fg: #E7B394;  --clay-dot: #C9A08F;
    --plum-bg: #2E2235;  --plum-fg: #D4B1E2;  --plum-dot: #B7A3E0;
    --sand-bg: #33301A;  --sand-fg: #E0CF85;  --sand-dot: #D9C46E;
    --slate-bg: #262B33; --slate-fg: #BAC4D3; --slate-dot: #AAB4C3;
    --rose-bg: #3A2222;  --rose-fg: #EDA9A9;  --rose-dot: #E69B9B;
    --amber-bg: #352E17; --amber-fg: #E7CF86; --amber-dot: #E0B867;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131715; --side: #0F1211; --surface: #1B201D; --lane: #171C19;
  --border: #2A312D; --border-strong: #46504A; --text: #E7ECE8; --muted: #9DA8A1;
  --accent: #86BFA2; --accent-deep: #4E8268; --on-accent: #0F1A14; --accent-soft: #22342A; --accent-text: #A9D6BE;
  --track: #2C3530; --sel: #22342A;
  --late-bg: #3B2020; --late-fg: #F0A7A7; --soon-bg: #352E17; --soon-fg: #E7CF86; --danger: #F0A7A7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  --blue-bg: #1E2C38;  --blue-fg: #9EC3DE;  --blue-dot: #8DB6D6;
  --green-bg: #1E3024; --green-fg: #9FD1AE; --green-dot: #86BFA2;
  --clay-bg: #36261C;  --clay-fg: #E7B394;  --clay-dot: #C9A08F;
  --plum-bg: #2E2235;  --plum-fg: #D4B1E2;  --plum-dot: #B7A3E0;
  --sand-bg: #33301A;  --sand-fg: #E0CF85;  --sand-dot: #D9C46E;
  --slate-bg: #262B33; --slate-fg: #BAC4D3; --slate-dot: #AAB4C3;
  --rose-bg: #3A2222;  --rose-fg: #EDA9A9;  --rose-dot: #E69B9B;
  --amber-bg: #352E17; --amber-fg: #E7CF86; --amber-dot: #E0B867;
  color-scheme: dark;
}

.c-blue  { --tag-bg: var(--blue-bg);  --tag-fg: var(--blue-fg);  --dot: var(--blue-dot); }
.c-green { --tag-bg: var(--green-bg); --tag-fg: var(--green-fg); --dot: var(--green-dot); }
.c-clay  { --tag-bg: var(--clay-bg);  --tag-fg: var(--clay-fg);  --dot: var(--clay-dot); }
.c-plum  { --tag-bg: var(--plum-bg);  --tag-fg: var(--plum-fg);  --dot: var(--plum-dot); }
.c-sand  { --tag-bg: var(--sand-bg);  --tag-fg: var(--sand-fg);  --dot: var(--sand-dot); }
.c-slate { --tag-bg: var(--slate-bg); --tag-fg: var(--slate-fg); --dot: var(--slate-dot); }
.c-rose  { --tag-bg: var(--rose-bg);  --tag-fg: var(--rose-fg);  --dot: var(--rose-dot); }
.c-amber { --tag-bg: var(--amber-bg); --tag-fg: var(--amber-fg); --dot: var(--amber-dot); }

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
.link { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.icon { flex: none; display: block; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; }
.hint .icon { display: inline-block; vertical-align: -4px; width: 15px; height: 15px; }
.grow { flex: 1; }
.right { text-align: right; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- forms ---------- */

input:not([type=checkbox]):not([type=radio]), select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  min-height: 40px;
  width: 100%;
}
textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
select { width: auto; padding-right: 30px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, label { font-weight: 600; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field legend { padding: 0; margin-bottom: 6px; }
.field-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.field-row .grow { flex: 1 1 220px; }
.end { align-self: flex-end; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-height: 40px; cursor: pointer; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  font: inherit; font-weight: 700; font-size: 14px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { border-color: var(--late-bg); background: var(--late-bg); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; min-height: 46px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--track); }
.icon-btn.bordered { border-color: var(--border); background: var(--surface); }

.alert { padding: 11px 14px; border-radius: 10px; background: var(--late-bg); color: var(--late-fg); font-weight: 600; }
.notice { padding: 11px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--track); border-radius: 11px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 8px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.segmented input:disabled + span { opacity: .6; cursor: not-allowed; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--swatch); cursor: pointer; }
.swatch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--swatch); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 5px; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--side) 248px, transparent 248px); }
.topbar { display: none; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
  padding: 20px 14px;
  background: var(--side); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 800; }
.brand-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 38px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--text); text-decoration: none; font-weight: 600;
}
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--track); }
.nav-item.is-active { background: var(--surface); box-shadow: var(--shadow); }
.nav-item.is-active .icon { color: var(--accent); }
.nav-item span:not(.badge):not(.dot) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-action { color: var(--muted); }
.badge {
  min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 12px; font-weight: 700; text-align: center;
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--muted)); flex: none; display: inline-block; }
.nav-item .dot { margin: 0 4px; }
.nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.nav-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nav-user-text strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-text small { font-size: 12px; color: var(--muted); }
.nav-user form { margin: 0; }

.main { min-width: 0; padding: 26px 32px 40px; display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .topbar {
    display: flex; align-items: center; gap: 8px;
    position: sticky; top: 0; z-index: 20;
    padding: 8px 12px; background: var(--side); border-bottom: 1px solid var(--border);
  }
  .brand-sm { font-weight: 800; text-decoration: none; }
  .sidebar {
    position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(290px, 86vw);
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); }
  .main { padding: 18px 16px 32px; }
}

/* ---------- page parts ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; }
.crumbs { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.seg-links { display: inline-flex; padding: 3px; gap: 2px; background: var(--track); border-radius: 11px; }
.seg-links a { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--muted); }
.seg-links a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.search { position: relative; display: flex; align-items: center; min-width: 200px; }
.search .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px !important; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card.flush { padding: 0; gap: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.empty { color: var(--muted); padding: 18px; text-align: center; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.settings-body { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.danger-zone { border-color: var(--late-bg); }

/* avatars & tags */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 50%; color: #fff; font-weight: 800;
}
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-md { width: 34px; height: 34px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar, .tb-avatar { overflow: hidden; }
.avatar img, .tb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* avatar picker */
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 12px 10px; }
.avatar-choice { position: relative; display: flex; justify-content: center; cursor: pointer; }
.avatar-choice input[type="radio"] { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.avatar-choice .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px transparent; transition: box-shadow .15s, transform .15s; }
.avatar-choice:hover .avatar { transform: scale(1.06); }
.avatar-choice:has(input:checked) .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--accent); }
.avatar-choice:has(input:focus-visible) .avatar { outline: 2px solid var(--accent); outline-offset: 6px; }
.avatar-upload .avatar { background: var(--lane); color: var(--muted); border: 1.5px dashed var(--border-strong); }
.avatar-upload .avatar .icon { width: 22px; height: 22px; }
.avatars { display: inline-flex; align-items: center; }
.avatars .avatar + .avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
.page-actions .avatars .avatar { box-shadow: 0 0 0 2px var(--bg); }
.person { display: inline-flex; align-items: center; gap: 10px; }

.tag {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; background: var(--tag-bg, var(--track)); color: var(--tag-fg, var(--muted));
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.due {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 700; background: var(--track); color: var(--muted); white-space: nowrap;
}
.due .icon { width: 13px; height: 13px; }
.due-late { background: var(--late-bg); color: var(--late-fg); }
.due-soon { background: var(--soon-bg); color: var(--soon-fg); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-muted td { color: var(--muted); }
.task-table tbody tr:hover { background: var(--sel); }
.task-table tr.is-selected { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }
.cell-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cell-title a { font-weight: 700; text-decoration: none; }
.cell-title a:hover { text-decoration: underline; }
.stage-pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .search { flex: 1 1 220px; max-width: 340px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 20px; align-items: start; }
.detail-col { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .detail-col { position: static; max-height: none; }
}

/* ---------- kanban ---------- */

.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; min-height: 60vh; }
.lane {
  flex: 1 0 210px; max-width: 340px; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: 16px; background: var(--lane);
}
.lane-head { display: flex; align-items: center; gap: 9px; padding: 2px 4px; }
.lane-head h2 { font-size: 14px; flex: 1; }
.count { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); padding: 1px 8px; border-radius: 999px; }
.lane-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.task-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px 13px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  cursor: grab;
}
.task-card:hover { border-color: var(--border-strong); }
.task-card h3 { font-size: 14px; font-weight: 700; }
.task-card h3 a { text-decoration: none; }
.task-card h3 a:hover { text-decoration: underline; }
.task-card.is-done { opacity: .72; }
.task-card.is-done h3 { text-decoration: line-through; text-decoration-color: var(--muted); }
.card-meta { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.sortable-ghost { opacity: .35; }
.sortable-drag { box-shadow: var(--shadow-lg); transform: rotate(1.5deg); }

.quick-add summary {
  list-style: none; display: flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 8px; border-radius: 9px;
  color: var(--muted); font-weight: 600; cursor: pointer;
}
.quick-add summary::-webkit-details-marker { display: none; }
.quick-add summary:hover { background: var(--track); color: var(--text); }
.quick-add[open] summary { display: none; }
.quick-add form { display: flex; flex-direction: column; gap: 8px; }
.quick-add form .btn { align-self: flex-start; }
.lane-new { flex: 0 0 236px; background: transparent; border: 2px dashed var(--border); }
.lane-new .hint { padding: 0 8px; }

/* ---------- task detail ---------- */

.task-panel { display: flex; flex-direction: column; }
.task-form { display: flex; flex-direction: column; gap: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.panel-meta { flex: 1; font-size: 13px; }
.title-input {
  font-size: 22px !important; font-weight: 800 !important; letter-spacing: -0.01em;
  border-color: transparent !important; padding: 6px 8px !important; margin: 0 -8px; width: calc(100% + 16px) !important;
  background: transparent !important;
}
.title-input:hover { border-color: var(--border) !important; }
.title-input:focus { border-color: var(--accent) !important; background: var(--surface) !important; }
.props { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px 14px; margin: 0; align-items: center; }
.props dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.props dt label { font-weight: 600; }
.props dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.props input[type=date] { width: auto; }
.people, .tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.person-toggle, .tag-toggle { position: relative; cursor: pointer; }
.person-toggle input, .tag-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.person-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--muted); }
.person-toggle .avatar { opacity: .45; }
.person-toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.person-toggle:has(input:checked) .avatar { opacity: 1; }
.person-toggle:has(input:focus-visible), .tag-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 999px; }
.tag-toggle .tag { padding: 5px 10px; font-size: 12.5px; opacity: .5; border: 1px solid transparent; }
.tag-toggle:has(input:checked) .tag { opacity: 1; border-color: var(--tag-fg); }
.empty-panel { min-height: 160px; align-items: center; justify-content: center; text-align: center; }
.page-panel { max-width: 820px; }
@media (max-width: 560px) {
  .props { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .props dd { margin-bottom: 8px; }
}

/* drawer */
.drawer-host:empty { display: none; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 18, 17, .35); }
.drawer {
  position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(560px, 100vw);
  overflow-y: auto; padding: 18px 22px 28px;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: drawer-in .18s ease-out;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } .sidebar { transition: none; } }

/* board settings */
.stage-list, .label-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stage-list li { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.label-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.handle { cursor: grab; color: var(--muted); padding: 6px; display: inline-flex; }
.stage-row { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 8px; }
.stage-row input:not([type=checkbox]) { flex: 1 1 160px; width: auto; }
.count-text { font-size: 12.5px; white-space: nowrap; }
.add-row { padding-top: 6px; border-top: 1px solid var(--border); }

/* ---------- overview ---------- */

.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 18px; align-items: start; }
.task-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.task-lines li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.task-lines li:last-child { border-bottom: 0; }
.task-lines a { display: flex; align-items: center; gap: 10px; flex: 1 1 200px; min-width: 0; text-decoration: none; font-weight: 700; }
.task-lines a:hover .line-title { text-decoration: underline; }
.line-sub { font-size: 12.5px; }

/* ---------- bare pages (login, setup) ---------- */

.bare-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px 16px; }
.bare-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.auth-card { width: min(420px, 100%); padding: 28px; gap: 18px; }

/* ---------- milestone 2: progress, subtasks, files, editor ---------- */

.progress { display: flex; align-items: center; gap: 8px; }
.progress-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; min-width: 40px; }
.progress-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.progress-text { font-size: 12px; font-weight: 700; color: var(--muted); }
.progress-lg .progress-bar { height: 8px; }
.meta-icon { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.meta-icon .icon { width: 14px; height: 14px; }
.icon-preview { display: inline-flex; width: 34px; height: 34px; border-radius: 9px; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); }
.bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

.panel-section { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--border); }
.panel-foot { margin-top: 14px; }
.section-head { display: flex; align-items: baseline; gap: 10px; }
.section-head h3 { font-size: 14px; }

.subtasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.subtask-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.subtask-row .handle { padding: 4px 0; cursor: grab; }
.subtask-row input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.subtask-title { flex: 1; min-height: 34px !important; padding: 5px 8px !important; border-color: transparent !important; background: transparent !important; }
.subtask-title:hover { border-color: var(--border) !important; }
.subtask-title:focus { border-color: var(--accent) !important; background: var(--surface) !important; }
.subtasks li.is-done .subtask-title { text-decoration: line-through; color: var(--muted); }
.who-select { min-height: 34px !important; padding: 4px 26px 4px 8px !important; font-size: 13px; max-width: 120px; }
.subtask-row .icon-btn { width: 32px; height: 32px; }
.subtask-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.subtask-add input { flex: 1 1 180px; width: auto !important; min-height: 36px !important; }

.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.files li { display: flex; align-items: center; gap: 12px; }
.file-thumb { width: 48px; height: 48px; flex: none; border-radius: 9px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--track); color: var(--muted); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-text a { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-text a:hover { text-decoration: underline; }
.upload { display: flex; align-items: center; gap: 10px; }
.upload-btn { position: relative; cursor: pointer; }
.upload-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.htmx-request.upload .upload-btn { opacity: .6; pointer-events: none; }

.editor { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.editor.is-focused { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor.is-busy { opacity: .7; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tool { min-height: 32px; min-width: 32px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tool:hover:not(:disabled) { background: var(--track); }
.tool[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.tool:disabled { opacity: .45; cursor: not-allowed; }
.t-bold { font-weight: 800; } .t-italic { font-style: italic; } .t-underline { text-decoration: underline; }
.tool-sep { width: 1px; margin: 4px 4px; background: var(--border); }
.editor-content .prose { min-height: 150px; padding: 12px 14px; outline: none; line-height: 1.6; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 .6em; }
.prose h1 { font-size: 20px; margin: .8em 0 .4em; }
.prose h2 { font-size: 16px; margin: .8em 0 .4em; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 .6em; }
.prose a { color: var(--accent-text); }
.prose img { max-width: 100%; height: auto; border-radius: 9px; display: block; margin: .4em 0; }
.prose img.ProseMirror-selectednode { outline: 3px solid var(--accent); }
.prose ul[data-type="taskList"] { list-style: none; padding-left: 2px; }
.prose ul[data-type="taskList"] li { display: flex; gap: 8px; align-items: flex-start; }
.prose ul[data-type="taskList"] li > label { margin-top: 3px; flex: none; }
.prose ul[data-type="taskList"] li > div { flex: 1; }
.prose ul[data-type="taskList"] li[data-checked="true"] > div { text-decoration: line-through; color: var(--muted); }
.prose p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--muted); float: left; height: 0; pointer-events: none; }

/* ---------- tablet mode (design A) ---------- */

body.tablet { --tb-ring: #E9E2CC; --tb-star: #FBEFC9; --tb-star-fg: #6A4E00; }
:root[data-theme="dark"] body.tablet { --tb-ring: #2A312D; --tb-star: #3A3218; --tb-star-fg: #F2D27A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body.tablet { --tb-ring: #2A312D; --tb-star: #3A3218; --tb-star-fg: #F2D27A; } }

.tablet-main { min-height: 100vh; box-sizing: border-box; padding: 32px 36px 24px; display: flex; flex-direction: column; gap: 24px; max-width: 1280px; margin: 0 auto; }
.tb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.tb-head h1 { font-size: 40px; font-weight: 800; }
.tb-sub { font-size: 18px; font-weight: 600; color: var(--muted); }
.tb-head-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tb-avatar { width: 76px; height: 76px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 32px; font-weight: 800; box-shadow: 0 0 0 5px var(--tb-ring); }
.tb-avatar .icon { width: 40px; height: 40px; }
.tb-avatar-xl { width: 110px; height: 110px; font-size: 44px; }
.tb-lock-avatar { background: var(--accent); }
.tb-stars { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 22px; border-radius: 999px; background: var(--tb-star); color: var(--tb-star-fg); font-size: 28px; font-weight: 800; }
.tb-stars .icon { width: 30px; height: 30px; fill: currentColor; }
.tb-switch { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; }
.tb-switch .icon { width: 26px; height: 26px; }

.tb-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 18px 24px; border-radius: 22px; background: var(--surface); border: 2px solid var(--border); }
.tb-progress strong { font-size: 22px; font-weight: 800; white-space: nowrap; }
.tb-segments { flex: 1 1 200px; display: grid; gap: 8px; }
.tb-segments span { height: 18px; border-radius: 9px; background: var(--track); }
.tb-segments span.is-on { background: var(--accent); }

.tb-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; align-content: start; }
.tb-card { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 20px 20px; border-radius: 26px; background: var(--surface); border: 2px solid var(--border); text-align: center; }
.tb-card.is-done { background: var(--lane); border-color: transparent; }
.tb-icon { width: 104px; height: 104px; border-radius: 30px; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; background: var(--tag-bg); color: var(--tag-fg); }
.tb-icon .icon { width: 60px; height: 60px; stroke-width: 1.6; }
.tb-card h2 { font-size: 26px; font-weight: 800; line-height: 1.2; }
.tb-card form { width: 100%; }
.tb-finish { width: 100%; height: 68px; border: 0; border-radius: 20px; background: var(--accent); color: var(--on-accent); font: inherit; font-size: 22px; font-weight: 800; box-shadow: 0 4px 0 var(--accent-deep); cursor: pointer; }
.tb-finish:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-deep); }
.tb-done { width: 100%; height: 68px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-text); font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; }
.tb-done .icon { width: 30px; height: 30px; stroke-width: 3; }
.tb-card.is-just .tb-done { animation: tb-pop .5s ease-out; }
@keyframes tb-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .tb-card.is-just .tb-done { animation: none; } }

.tb-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.tb-empty-icon { width: 120px; height: 120px; border-radius: 36px; display: flex; align-items: center; justify-content: center; background: var(--tb-star); color: var(--tb-star-fg); }
.tb-empty-icon .icon { width: 70px; height: 70px; }
.tb-empty h2 { font-size: 32px; font-weight: 800; }

.tb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 15px; font-weight: 600; }
.tb-foot > span { display: inline-flex; align-items: center; gap: 8px; }
.tb-parent { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-weight: 700; }

.tb-people { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; align-content: start; }
.tb-people form { display: contents; }
.tb-person { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 30px 16px; border-radius: 26px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-decoration: none; cursor: pointer; width: 100%; }
.tb-person:hover { border-color: var(--accent); }
.tb-person.is-current { border-color: var(--accent); }
button.tb-parent { background: none; font: inherit; cursor: pointer; }
.switch-current { display: flex; justify-content: center; margin: 0 0 20px; }
.tb-empty-note { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 18px; }
.tb-person .tb-avatar { width: 110px; height: 110px; font-size: 44px; }
.tb-name { font-size: 26px; font-weight: 800; }
.tb-lock { position: absolute; top: 16px; right: 16px; color: var(--muted); }

.tb-pin { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.tb-pin h1 { font-size: 36px; font-weight: 800; }
.pin-form { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pin-input { width: 240px !important; text-align: center; font-size: 34px !important; letter-spacing: .4em; min-height: 64px !important; border-radius: 16px !important; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 84px); gap: 12px; }
.pin-pad button { height: 84px; border-radius: 22px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 30px; font-weight: 800; cursor: pointer; }
.pin-pad button:active { background: var(--track); }
.pin-pad .pin-aux { font-size: 22px; }
.pin-pad .pin-ok { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

@media (max-width: 700px) {
  .tablet-main { padding: 20px 16px; }
  .tb-head h1 { font-size: 30px; }
  .tb-head-actions { margin-left: 0; width: 100%; }
}
.lane-more { padding: 4px 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.lane-more:hover { color: var(--text); text-decoration: underline; }

/* ---------- month ---------- */

.avatar-xs { width: 18px; height: 18px; font-size: 8.5px; }
.month { display: flex; flex-direction: column; gap: 14px; }
.month-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-nav h2 { font-size: 20px; min-width: 9.5em; text-align: center; }
.month-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 13.5px; }
.month-stats strong { color: var(--text); font-size: 15px; }
.month-stats .is-late, .month-stats .is-late strong { color: var(--late-fg); }
.month-stats .month-progress { display: flex; width: 160px; }
.month-stats .grow { text-align: right; }

.cal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.cal-row { display: grid; grid-template-columns: 38px repeat(7, minmax(0, 1fr)); }
.cal-row + .cal-row { border-top: 1px solid var(--border); }
.cal-head span { padding: 9px 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal-head abbr { text-decoration: none; }
.cal-wk { display: flex; justify-content: center; padding: 9px 0; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--lane); }
.cal-head .cal-wk { padding: 9px 0; font-size: 10px; }
.cal-day { min-height: 112px; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--border); min-width: 0; }
.cal-day.is-weekend { background: color-mix(in srgb, var(--lane) 45%, var(--surface)); }
.cal-day.is-out { background: var(--lane); }
.cal-day.is-out .cal-num { color: var(--border-strong); }
.cal-date { display: flex; align-items: center; justify-content: space-between; min-height: 26px; }
.cal-num { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.cal-day.is-today .cal-num { background: var(--accent); color: var(--on-accent); }
.cal-wd { display: none; }
.cal-add { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; color: var(--muted); opacity: 0; }
.cal-add .icon { width: 15px; height: 15px; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { background: var(--track); color: var(--text); }
@media (hover: none) { .cal-add { opacity: .7; } }

.cal-task {
  display: flex; align-items: center; gap: 6px; min-width: 0; padding: 3px 6px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; text-decoration: none; color: var(--text);
  background: var(--tag-bg, var(--track));
}
a.cal-task:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.cal-task .dot { width: 8px; height: 8px; }
.cal-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-task .avatars .avatar + .avatar { margin-left: -5px; box-shadow: 0 0 0 1.5px var(--surface); }
.cal-task.is-done { opacity: .6; }
.cal-task.is-done .cal-title { text-decoration: line-through; }
.cal-task.is-late { background: var(--late-bg); color: var(--late-fg); }
.cal-task.is-ghost { background: none; color: var(--muted); font-weight: 500; border: 1px dashed var(--border); }
.cal-task.is-ghost .icon { width: 13px; height: 13px; flex: none; }

@media (max-width: 760px) {
  /* Agenda: only days with something on them. */
  .cal-row.cal-head, .cal-wk, .cal-day:not(.has-items):not(.is-today), .cal-day.is-out { display: none; }
  .cal-row { display: block; }
  .cal-row + .cal-row { border-top: 0; }
  .cal-day { min-height: 0; border-left: 0; border-top: 1px solid var(--border); padding: 10px 12px; }
  .cal-row:first-of-type + .cal-row .cal-day:first-child { border-top: 0; }
  .cal-day.is-weekend { background: none; }
  .cal-wd { display: inline; margin-right: 2px; font-weight: 600; }
  .cal-num { justify-content: flex-start; padding: 0 8px; }
  .cal-add { opacity: .7; }
  .cal-task { font-size: 14px; padding: 6px 8px; }
  .month-nav h2 { min-width: 0; font-size: 18px; }
  .month-stats .grow { text-align: left; }
}
.cal-items { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cal-task[data-id] { cursor: grab; }
.cal-task.sortable-ghost { opacity: .35; }

/* ---------- overview calendar ---------- */

.ov-cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.ov-cal-nav { display: flex; align-items: center; gap: 8px; }
.ov-cal-nav h2 { font-size: 17px; min-width: 12em; text-align: center; }
.ov-cal .seg-links a { min-height: 30px; }

.ov-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ov-item a {
  display: flex; align-items: center; gap: 7px; min-width: 0; padding: 4px 8px; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none; background: var(--tag-bg, var(--track));
}
.ov-item a:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.ov-item .dot { width: 8px; height: 8px; }
.ov-item .icon { width: 14px; height: 14px; flex: none; }
.ov-time { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.ov-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-item .avatars .avatar + .avatar { margin-left: -5px; box-shadow: 0 0 0 1.5px var(--surface); }
.ov-item.is-done a { opacity: .6; }
.ov-item.is-done .ov-title { text-decoration: line-through; }
.ov-item.is-late a { background: var(--late-bg); color: var(--late-fg); }
.ov-item.is-ghost a { background: none; color: var(--muted); font-weight: 500; border: 1px dashed var(--border); }

.ov-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.ov-wday { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 8px; border-radius: 12px; background: var(--lane); min-height: 120px; }
.ov-wday h3 { display: flex; align-items: baseline; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ov-wday h3 strong { font-size: 16px; color: var(--text); letter-spacing: 0; }
.ov-wday.is-today { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.ov-wday.is-today h3, .ov-wday.is-today h3 strong { color: var(--accent-text); }

.ov-month { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.ov-mini { display: flex; flex-direction: column; gap: 2px; }
.ov-mini-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ov-mini-head span { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.ov-mini-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  aspect-ratio: 1; min-height: 38px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 13.5px;
}
.ov-mini-day:hover { background: var(--track); }
.ov-mini-day.is-out { color: var(--border-strong); }
.ov-mini-day.is-today .ov-num { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.ov-mini-day.is-picked { background: var(--accent); color: var(--on-accent); }
.ov-mini-day.is-picked .ov-num { color: var(--on-accent); }
.ov-dots { display: flex; gap: 3px; height: 5px; }
.ov-dots .dot { width: 5px; height: 5px; }
.ov-dots .dot.is-ghost { background: none; box-shadow: inset 0 0 0 1px var(--muted); }
.ov-mini-day.is-picked .dot { background: var(--on-accent); }
.ov-agenda { display: flex; flex-direction: column; gap: 10px; }
.ov-agenda h3 { font-size: 15px; }
.ov-agenda .ov-item a { font-size: 14px; padding: 7px 10px; }

@media (max-width: 1100px) {
  .ov-week { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 700px) {
  .ov-week { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ov-wday { min-height: 0; flex-direction: row; align-items: flex-start; gap: 10px; }
  .ov-wday h3 { width: 64px; flex: none; flex-direction: column; gap: 0; }
  .ov-wday .ov-items { flex: 1; }
  .ov-month { grid-template-columns: minmax(0, 1fr); }
  .ov-cal-nav h2 { min-width: 0; font-size: 15px; }
}

/* ---------- indkøbsliste ---------- */

.shop-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.shop-add { gap: 10px; padding: 14px; }
.shop-add-row { display: flex; gap: 10px; }
.shop-add-row input { flex: 1; font-size: 16px; min-height: 46px; }
.shop-add-row .btn { min-height: 46px; }
.shop-more summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; padding: 2px 0; }
.shop-more[open] summary { margin-bottom: 10px; }
.shop { display: flex; flex-direction: column; gap: 14px; }
.shop-card .shop-group + .shop-group { border-top: 1px solid var(--border); }
.shop-add-row input::-webkit-calendar-picker-indicator, [data-recipe-input]::-webkit-calendar-picker-indicator { display: none !important; }
.shop-group h2 { display: flex; align-items: center; gap: 9px; padding: 12px 16px 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.shop-group h2 .count { background: var(--lane); }
.shop-group ul { list-style: none; margin: 0; padding: 0 0 6px; }
.shop-item { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 6px; border-top: 1px solid var(--border); }
.shop-group li:first-child { border-top: 0; }
.shop-check-form { flex: 1; min-width: 0; }
.shop-check {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; width: 100%; min-height: 50px; padding: 8px 8px;
  font: inherit; text-align: left; color: var(--text); background: none; border: 0; border-radius: 10px; cursor: pointer;
}
.shop-check:hover .shop-box { border-color: var(--accent); }
.shop-box {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border-strong); color: transparent;
}
.shop-box .icon { width: 16px; height: 16px; }
.shop-name { font-size: 15.5px; font-weight: 700; }
.shop-note { color: var(--muted); font-size: 13.5px; }
.shop-item.is-done .shop-box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.shop-item.is-done .shop-name { text-decoration: line-through; color: var(--muted); font-weight: 600; }
.shop-done-head { display: flex; align-items: center; justify-content: space-between; padding-right: 10px; }
.shop-done h2 .icon { width: 16px; height: 16px; }
.shop-edit { position: relative; }
.shop-edit summary { list-style: none; }
.shop-edit summary::-webkit-details-marker { display: none; }
.shop-edit-form {
  position: absolute; right: 0; top: 44px; z-index: 10; width: min(320px, 86vw);
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.shop-empty { align-items: center; text-align: center; padding: 34px 20px; gap: 8px; }
.shop-empty-icon { display: inline-flex; padding: 14px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.shop-empty-icon .icon { width: 28px; height: 28px; }
.shop-mini { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px 16px; }
.shop-mini li { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
@media (max-width: 560px) {
  .shop-add-row .btn span { display: none; }
}

/* ---------- kalender ---------- */

.kal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.kal-side { gap: 12px; }
.kal-layout .cal .cal-task .avatars { display: none; }
.kal-layout .cal .cal-task { gap: 5px; padding: 3px 5px; }
@media (min-width: 1560px) {
  .kal-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .kal-side { position: sticky; top: 20px; }
}
.kal-up { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kal-up li + li { border-top: 1px solid var(--border); }
.kal-up a { display: flex; align-items: center; gap: 12px; padding: 9px 0; text-decoration: none; min-width: 0; }
.kal-up a:hover .kal-up-title { text-decoration: underline; }
.kal-up-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 11px; background: var(--tag-bg, var(--track)); color: var(--tag-fg, var(--text)); line-height: 1.05;
}
.kal-up-date strong { font-size: 16px; }
.kal-up-date small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.kal-up-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.kal-up-title { display: flex; align-items: center; gap: 6px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kal-up-title .icon { width: 15px; height: 15px; color: var(--tag-fg, var(--muted)); }
.cal-task .icon { width: 13px; height: 13px; flex: none; color: var(--tag-fg, var(--muted)); }
.cal-task .ov-time { font-size: 11.5px; }
.kal-week .ov-wday { min-height: 220px; }
.kal-week .ov-wday h3 { justify-content: flex-start; }
.kal-week .ov-wday h3 .cal-add { margin-left: auto; }
.ov-wday:hover .cal-add { opacity: 1; }

.event-form .segmented .icon { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; }
.event-form .only-birthday { display: none; }
.event-form:has(input[name=kind][value=fodselsdag]:checked) .only-event { display: none; }
.event-form:has(input[name=kind][value=fodselsdag]:checked) .only-birthday { display: block; }
.ev-time { gap: 14px; }
.ev-clock { display: inline-flex; align-items: center; gap: 8px; }
.ev-clock input { width: auto; }
.ev-time:has(input[name=all_day]:checked) .ev-clock { display: none; }


/* ---------- madplan ---------- */

.meal-wrap { display: flex; flex-direction: column; gap: 14px; max-width: 860px; }
.meal-days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.meal-day { padding: 0; gap: 0; }
.meal-day.is-today { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.meal-day.is-past .meal-row { opacity: .7; }
.meal-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.meal-thumb { width: 64px; height: 64px; flex: none; border-radius: 12px; object-fit: cover; }
.meal-title a { text-decoration: none; }
.meal-title a:hover { text-decoration: underline; }
.meal-row [aria-expanded=true] { background: var(--track); }
.meal-date { display: flex; flex-direction: column; align-items: center; flex: none; width: 74px; padding: 6px 0; border-radius: 12px; background: var(--lane); line-height: 1.1; }
.meal-date span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.meal-date strong { font-size: 22px; }
.meal-date small { font-size: 11px; font-weight: 700; color: var(--muted); }
.meal-day.is-today .meal-date { background: var(--accent-soft); }
.meal-day.is-today .meal-date span, .meal-day.is-today .meal-date small, .meal-day.is-today .meal-date strong { color: var(--accent-text); }
.meal-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.meal-title { font-size: 17px; font-weight: 700; }
.meal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; }
.meal-meta .person { gap: 6px; font-weight: 600; }
.meal-actions { display: flex; align-items: center; gap: 6px; }
.meal-form { display: flex; flex-direction: column; gap: 12px; margin: 0 16px; padding: 14px 0 16px; border-top: 1px solid var(--border); }
.meal-form[hidden] { display: none; }
.meal-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.meal-mini li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.meal-mini li > span:first-child { width: 72px; font-size: 13px; }
.recipe-new { padding: 14px; gap: 12px; }
.recipe-new > summary { list-style: none; align-self: flex-start; }
.recipe-new > summary::-webkit-details-marker { display: none; }
.recipe-list { list-style: none; margin: 0; padding: 0; }
.recipe-list li + li { border-top: 1px solid var(--border); }
.recipe > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 18px; cursor: pointer; }
.recipe-title { font-weight: 700; font-size: 15px; }
.recipe[open] > summary { background: var(--sel); }
.recipe .meal-form { padding: 14px 18px 18px; }
@media (max-width: 560px) {
  .meal-row { flex-wrap: wrap; gap: 12px; padding: 12px; }
  .meal-date { width: 58px; }
  .meal-date strong { font-size: 19px; }
  .meal-body { flex-basis: calc(100% - 70px); }
  .meal-actions { margin-left: 70px; }
  .meal-form { margin: 0 12px; }
}

/* tablet: today's agenda */
.tb-agenda { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.tb-event {
  display: flex; align-items: center; gap: 14px; flex: none; min-width: 220px; max-width: 360px; padding: 12px 20px 12px 12px;
  border-radius: 20px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.tb-event-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 54px; height: 54px; border-radius: 16px; background: var(--tag-bg, var(--track)); color: var(--tag-fg, var(--muted)); }
.tb-event-icon .icon { width: 30px; height: 30px; }
.tb-event-text { display: flex; flex-direction: column; min-width: 0; }
.tb-event-text small { font-size: 15px; font-weight: 700; color: var(--muted); }
.tb-event-text strong { font-size: 21px; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- installable app ---------- */

.offline-notice {
  position: fixed; z-index: 60; left: 50%; bottom: 20px; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 12px; background: var(--late-bg); color: var(--late-fg); font-weight: 700; box-shadow: var(--shadow-lg);
}
.offline-card { text-align: center; }
@media (display-mode: standalone) {
  .topbar { padding-top: max(8px, env(safe-area-inset-top)); }
}

/* ---------- settings: modules ---------- */

.module-list { list-style: none; margin: 0; padding: 0; }
.module-list li + li { border-top: 1px solid var(--border); }
.module-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; cursor: pointer; }
.module-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.module-text strong { font-size: 15px; }
.module-text small { font-size: 13px; font-weight: 500; }
input[type=checkbox].switch {
  appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--track);
  border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background .15s;
}
input[type=checkbox].switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow); transition: transform .15s;
}
input[type=checkbox].switch:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox].switch:checked::after { transform: translateX(18px); }
@media (prefers-reduced-motion: reduce) { input[type=checkbox].switch, input[type=checkbox].switch::after { transition: none; } }
.code { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--lane); font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: pre; }
.sugg-row { display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 18px; }

/* ---------- opskrifter ---------- */

.recipes-wrap { display: flex; flex-direction: column; gap: 16px; }
.import-card { gap: 8px; max-width: 860px; }
.import-row { display: flex; gap: 10px; }
.import-row input { flex: 1; min-height: 46px; font-size: 15px; }
.import-row .btn { min-height: 46px; }
.import-card[aria-busy=true] .btn { opacity: .7; cursor: progress; }
.recipe-filters .search { max-width: 460px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-weight: 600; font-size: 13px; color: var(--muted); }
.chip small { font-size: 11px; color: var(--muted); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip.is-active small { color: var(--on-accent); }
.recipe-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.recipe-card { overflow: hidden; }
.recipe-card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.recipe-card a:hover strong { text-decoration: underline; }
.recipe-photo { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--lane); color: var(--border-strong); }
.recipe-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.recipe-photo .icon { width: 42px; height: 42px; }
.recipe-card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.recipe-card-body strong { font-size: 15.5px; line-height: 1.25; }

.recipe-page { display: flex; flex-direction: column; gap: 20px; }
.recipe-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.recipe-hero:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
.recipe-hero-img { width: 100%; max-height: 460px; object-fit: cover; border-radius: 18px; }
.recipe-hero-text { display: flex; flex-direction: column; gap: 14px; }
.recipe-lead { font-size: 16px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-weight: 600; }
.recipe-facts li { display: flex; align-items: center; gap: 10px; }
.recipe-facts .icon { width: 18px; height: 18px; color: var(--muted); }
.tags a.tag { text-decoration: none; }
.plan-form { display: flex; flex-wrap: wrap; gap: 10px; }
.plan-form input[type=date] { width: auto; }
.recipe-body { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.recipe-ingredients { position: sticky; top: 20px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper .icon-btn { width: 34px; height: 34px; font-size: 18px; font-weight: 700; }
.stepper output { min-width: 1.6em; text-align: center; font-weight: 800; font-size: 16px; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li + li { border-top: 1px solid var(--border); }
.ing-list .check { align-items: flex-start; padding: 8px 0; min-height: 0; font-weight: 500; font-size: 14.5px; }
.ing-list .check input { margin-top: 3px; }
.ing-list .check:has(input:checked) span { color: var(--muted); text-decoration: line-through; }
.rich-text { font-size: 15px; line-height: 1.65; }
.rich-text ol, .rich-text ul { padding-left: 1.4em; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rich-text li p { margin: 0; }
.rich-text p + p, .rich-text h2, .rich-text h3 { margin-top: 12px; }
.rich-text h3 { font-size: 15px; }
.recipe-note { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--sand-bg); color: var(--sand-fg); }
.recipe-note h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.recipe-form { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; }
.recipe-form-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.recipe-image-row { align-items: center; }
.recipe-thumb { width: 120px; height: 90px; object-fit: cover; border-radius: 12px; }
@media (max-width: 900px) {
  .recipe-hero, .recipe-body, .recipe-form-cols { grid-template-columns: minmax(0, 1fr); }
  .recipe-ingredients { position: static; }
}
@media (max-width: 560px) {
  .import-row { flex-direction: column; }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .recipe-card-body { padding: 10px; }
  .recipe-card-body strong { font-size: 14px; }
  .meal-thumb { display: none; }
}

/* ---------- totrinsbekræftelse ---------- */

.due-ok { background: var(--accent-soft); color: var(--accent-text); }
.twofa-card { width: min(460px, 100%); }
.twofa-steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.qr-box { align-self: center; width: 200px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--border); }
.qr-box .qr { display: block; width: 100%; height: auto; }
.secret-line { text-align: center; font-size: 13px; overflow-wrap: anywhere; }
.secret-line code, .recovery-codes code { font: 600 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.code-input { font: 700 26px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .25em; text-align: center; min-height: 56px; }
.code-input-sm { width: 10em !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em; }
.recovery-codes { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; border-radius: 12px; background: var(--lane); }
.recovery-codes li { text-align: center; }
@media print {
  body.bare { background: #fff; }
  .bare-main { min-height: 0; padding: 0; }
  .twofa-card .btn, .bare-brand { display: none; }
}
.passkey-list { list-style: none; margin: 0; padding: 0; }
.passkey-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.passkey-list li:last-child { border-bottom: 1px solid var(--border); }
.passkey-login { display: flex; flex-direction: column; gap: 12px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
