/* Taskioo — design system "Studio".
   Warm paper canvas, floating dark ink sidebar, tasks as individual cards, squircle checks,
   expressive display type (Bricolage Grotesque) and an electric-violet palette with a soft lavender "pop" tint derived from the accent. */
:root {
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --canvas: #f3efe8;
  --panel: #f3efe8;
  --raised: #fffdf9;
  --hover: rgba(40, 30, 60, .055);
  --active: rgba(40, 30, 60, .09);
  --chip: rgba(40, 30, 60, .065);
  --line: #e4ded3;
  --line-soft: #ece7de;
  --ink: #1d1a26;
  --ink-2: #4a4558;
  --muted: #8a8496;
  --faint: #bdb6c4;
  --primary-bg: #1d1a26;
  --primary-fg: #fffdf9;
  --accent: #6b4eff;
  --accent-soft: rgba(107, 78, 255, .12);
  --accent-ink: #5436e6;
  --on-accent: #ffffff;
  --pop: color-mix(in srgb, var(--accent) 38%, #ffffff);
  --pop-ink: #1d1a26;
  --side-bg: #1d1a26;
  --danger: #e5484d;
  --ok: #2fa86e;
  --today: var(--accent);
  --tomorrow: #e0821e;
  --week: #3b82f6;
  --overdue: #e5484d;
  --p1: #d6336c; --p2: #e8a317; --p3: #14a39a; --p4: #a8a2b4;
  --shadow-sm: 0 1px 2px rgba(40, 30, 60, .06), 0 1px 0 rgba(40, 30, 60, .03);
  --shadow: 0 2px 4px rgba(40, 30, 60, .05), 0 10px 28px rgba(40, 30, 60, .09);
  --shadow-lg: 0 4px 10px rgba(40, 30, 60, .07), 0 30px 70px rgba(40, 30, 60, .2);
  --radius: 12px;
  --radius-lg: 22px;
  --sidebar-w: 284px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --canvas: #121017;
  --panel: #121017;
  --raised: #1c1a24;
  --hover: rgba(255, 255, 255, .055);
  --active: rgba(255, 255, 255, .09);
  --chip: rgba(255, 255, 255, .07);
  --line: #2b2836;
  --line-soft: #23212c;
  --ink: #f1eef7;
  --ink-2: #c6c0d4;
  --muted: #8f89a0;
  --faint: #5b5669;
  --primary-bg: #f1eef7;
  --primary-fg: #1d1a26;
  --accent: #8b74ff;
  --accent-soft: rgba(139, 116, 255, .17);
  --accent-ink: #a796ff;
  --side-bg: #1a1822;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .38);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-accent="red"] { --accent: #e5484d; --accent-soft: rgba(229, 72, 77, .12); --accent-ink: #cd2b31; }
:root[data-accent="orange"] { --accent: #f76b15; --accent-soft: rgba(247, 107, 21, .12); --accent-ink: #d14e00; }
:root[data-accent="green"] { --accent: #2fa86e; --accent-soft: rgba(47, 168, 110, .12); --accent-ink: #1f8457; }
:root[data-accent="blue"] { --accent: #0a84ff; --accent-soft: rgba(10, 132, 255, .12); --accent-ink: #006adc; }
:root[data-accent="violet"] { --accent: #a855f7; --accent-soft: rgba(168, 85, 247, .12); --accent-ink: #9333ea; }
:root[data-accent="pink"] { --accent: #e0479e; --accent-soft: rgba(224, 71, 158, .12); --accent-ink: #c2298a; }
:root[data-accent="charcoal"] { --accent: #3a3646; --accent-soft: rgba(58, 54, 70, .1); --accent-ink: #27242f; }
:root[data-theme="dark"][data-accent="charcoal"] { --accent: #d6d2df; --accent-ink: #e8e5ee; --on-accent: #1d1a26; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--canvas);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.xs { width: 13px; height: 13px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: 600 10.5px/1 var(--font); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--raised); color: var(--muted); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; height: 100dvh; background: var(--canvas); }
.sidebar {
  /* dark ink panel in both themes — re-maps the tokens so every nav component adapts */
  --ink: #f4f1fa; --ink-2: #cdc7db; --muted: #8b85a0; --faint: #5d5772;
  --hover: rgba(255, 255, 255, .06); --active: rgba(255, 255, 255, .1); --chip: rgba(255, 255, 255, .08);
  --line: #2f2b3c; --line-soft: #27242f; --canvas: var(--side-bg); --accent-ink: #b9a9ff;
  width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; gap: 2px; color: var(--ink);
  margin: 10px 0 10px 10px; padding: 14px 10px 10px; border-radius: var(--radius-lg); background: var(--side-bg);
  box-shadow: 0 10px 30px rgba(29, 26, 38, .18);
  transition: margin .3s var(--ease), transform .3s var(--ease);
}
:root[data-theme="dark"] .sidebar { box-shadow: inset 0 0 0 1px var(--line); }
.app.sidebar-hidden .sidebar { margin-left: calc(-1 * var(--sidebar-w) - 10px); }
.main {
  flex: 1; min-width: 0; margin: 0; background: var(--panel);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.app.sidebar-hidden .main { margin-left: 0; }
.topbar { height: 60px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 18px; }
.topbar .icon-btn { width: 38px; height: 38px; border-radius: 12px; background: var(--raised); box-shadow: var(--shadow-sm); color: var(--ink-2); }
.topbar .icon-btn:hover { color: var(--ink); background: var(--raised); box-shadow: var(--shadow); }
.topbar .crumbs { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; min-width: 0; padding: 0 6px; }
.topbar .crumbs a { color: var(--muted); }
.topbar .crumbs b { font-family: var(--font-display); font-size: 16px; letter-spacing: -.01em; }
.scroller { flex: 1; overflow: auto; overscroll-behavior: contain; }
.content { max-width: 840px; margin: 0 auto; padding: 4px 40px 120px; }
.content.wide { max-width: none; padding: 4px 28px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin: 10px 0 26px; }
.page-title { font-family: var(--font-display); font-size: 40px; line-height: 1.05; font-weight: 700; letter-spacing: -.035em; margin: 0; font-variation-settings: "opsz" 96; }
.page-title[contenteditable] { outline: none; border-radius: 8px; }
.page-title svg.i { width: 30px; height: 30px; vertical-align: -3px; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-top: 8px; display: flex; gap: 10px; align-items: center; font-weight: 500; }

/* ---------- sidebar ---------- */
.sb-head { display: flex; align-items: center; gap: 6px; padding: 0 2px 12px 2px; }
.avatar {
  width: 28px; height: 28px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ff7ab6));
}
.avatar.sm { width: 20px; height: 20px; font-size: 9.5px; border-radius: 7px; }
.avatar.xs { width: 18px; height: 18px; font-size: 9px; border-radius: 6px; }
.user-btn { display: flex; align-items: center; gap: 9px; padding: 5px 7px; border-radius: 12px; font-weight: 650; min-width: 0; flex: 1; }
.user-btn:hover { background: var(--hover); }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--muted); flex: none; position: relative; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.on { color: var(--accent-ink); background: var(--accent-soft); }
.add-task-btn {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px; border-radius: 15px; font-weight: 700; font-size: 14.5px;
  color: var(--pop-ink); background: var(--pop); margin: 0 0 10px; box-shadow: 0 6px 18px color-mix(in srgb, var(--pop) 22%, transparent); transition: transform .2s var(--spring), filter .15s;
}
.add-task-btn .plus { width: 30px; height: 30px; border-radius: 10px; background: var(--pop-ink); color: var(--pop); display: grid; place-items: center; }
.add-task-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.add-task-btn:active { transform: scale(.98); }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 12px; color: var(--ink-2); font-size: 14px; font-weight: 500;
  user-select: none; position: relative; text-decoration: none !important; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.active { background: var(--active); color: var(--ink); font-weight: 650; }
.sidebar .nav-item.active { background: var(--pop); color: var(--pop-ink); }
.sidebar .nav-item.active .ico, .sidebar .nav-item.active .count { color: var(--pop-ink) !important; }
.sidebar kbd { background: var(--chip); border-color: var(--line); }
.nav-item .count { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nav-item .more { margin-left: auto; opacity: 0; }
.nav-item:hover .more { opacity: 1; }
.nav-item:hover .more + .count, .nav-item:hover .count:has(+ .more) { display: none; }
.nav-item .ico { width: 20px; display: grid; place-items: center; color: var(--muted); flex: none; }
.nav-item.active .ico { color: var(--accent-ink); }
.nav-item.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.sb-scroll { flex: 1; overflow: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sb-group { margin-top: 16px; }
.sb-group-head { display: flex; align-items: center; height: 30px; padding: 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; gap: 4px; border-radius: 10px; }
.sb-group-head:hover { background: var(--hover); }
.sb-group-head .icon-btn { width: 24px; height: 24px; opacity: 0; }
.sb-group-head:hover .icon-btn { opacity: 1; }
.proj-dot { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.proj-hash { display: inline-block; width: 11px; height: 11px; border-radius: 4px; background: currentColor; flex: none; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.prio-ico { display: inline-flex; align-items: center; }
.caret { width: 18px; height: 18px; display: grid; place-items: center; color: var(--faint); margin-left: -4px; border-radius: 5px; transition: transform .2s var(--ease); }
.caret.closed { transform: rotate(-90deg); }
.sb-foot { padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); position: absolute; right: 3px; bottom: 3px; box-shadow: 0 0 0 2px var(--side-bg); }
.sync-dot.off { background: var(--faint); }
.sync-dot.busy { background: var(--tomorrow); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 15px; border-radius: 12px; font-weight: 650; font-size: 13px;
  border: 1px solid var(--line); background: var(--raised); color: var(--ink); white-space: nowrap; transition: background .15s, opacity .15s, transform .2s var(--spring);
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary-bg); color: var(--primary-fg); border-color: transparent; }
.btn.primary:hover { opacity: .88; }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-2); font-size: 12.5px; font-weight: 550; background: var(--raised); white-space: nowrap; transition: background .15s;
}
.chip-btn:hover { background: var(--hover); }
.chip-btn.set { color: var(--ink); background: var(--chip); border-color: transparent; }
.chip-btn .x { margin-left: 2px; color: var(--muted); display: grid; place-items: center; border-radius: 50%; }
.chip-btn .x:hover { background: var(--active); color: var(--ink); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 13px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--raised); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 13px; resize: vertical; min-height: 80px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 24px; background: var(--active); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .25s var(--spring); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.seg { display: inline-flex; padding: 3px; background: var(--chip); border-radius: 13px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border-radius: 10px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 700; }

/* ---------- task list ---------- */
.section { margin-bottom: 26px; }
.section-head {
  display: flex; align-items: center; gap: 8px; padding: 4px 0 10px; margin-bottom: 0; position: relative;
}
.section-head h3 {
  margin: 0; font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--chip);
}
.section-head .cnt { color: var(--muted); font-size: 12px; font-weight: 650; }
.section-head .icon-btn { width: 28px; height: 28px; }
.section-head .acts { margin-left: auto; opacity: 0; display: flex; }
.section-head:hover .acts { opacity: 1; }
.section-head .caret { margin-left: -24px; opacity: 0; }
.section-head:hover .caret, .section-head .caret.closed { opacity: 1; }
.section-head.overdue h3 { color: var(--overdue); background: color-mix(in srgb, var(--overdue) 12%, transparent); }
.add-section-line { height: 20px; position: relative; display: flex; align-items: center; justify-content: center; opacity: 0; margin: -10px 0 6px; color: var(--accent-ink); font-weight: 700; font-size: 12.5px; cursor: pointer; transition: opacity .15s; }
.add-section-line::before, .add-section-line::after { content: ""; flex: 1; height: 0; border-top: 1.5px dashed var(--accent); margin: 0 10px; }
.add-section-line:hover { opacity: 1; }

.task {
  position: relative; display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); align-items: flex-start;
  cursor: pointer; background: transparent;
}
/* list rows in the main view are floating cards */
.content .task:not(.card) {
  background: var(--raised); border: 0; border-radius: 16px; padding: 13px 14px 13px 15px; margin-bottom: 7px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s var(--ease);
}
.content .task:not(.card):hover { box-shadow: var(--shadow); }
.content .task::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.content .task:has(> .check.p1)::before { background: var(--p1); }
.content .task:has(> .check.p2)::before { background: var(--p2); }
.content .task:has(> .check.p3)::before { background: var(--p3); }
.content .task.done:not(.card) { background: color-mix(in srgb, var(--raised) 55%, transparent); box-shadow: none; }
.task:hover .task-actions { opacity: 1; }
.task.selected { background: var(--hover); }
.content .task.selected:not(.card) { background: var(--raised); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.task.dragging { opacity: .35; }
.task .handle { position: absolute; left: -28px; top: 13px; width: 20px; height: 22px; display: grid; place-items: center; color: var(--faint); opacity: 0; cursor: grab; touch-action: none; }
.task:hover .handle { opacity: 1; }
.task .sub-caret { position: absolute; left: -48px; top: 14px; opacity: 0; }
.task:hover .sub-caret, .task .sub-caret.closed { opacity: 1; }
.check {
  width: 20px; height: 20px; margin-top: 0; border-radius: 7px; border: 2px solid var(--p4); flex: none; display: grid; place-items: center;
  color: transparent; transition: background .15s, color .15s, transform .25s var(--spring); position: relative;
}
.check svg { width: 12px; height: 12px; stroke-width: 3.2; }
.check:hover { transform: scale(1.08); }
.check:active { transform: scale(.9); }
.check.p1, .check.p2, .check.p3 { border-color: var(--faint); }
.check:hover, .check.p1:hover, .check.p2:hover, .check.p3:hover { color: var(--accent); border-color: var(--accent); }
.check.done, .check.done.p1, .check.done.p2, .check.done.p3 { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check.recurring::after { content: ""; position: absolute; inset: -4px; border-radius: 10px; border: 1px dashed transparent; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; line-height: 20px; font-weight: 550; word-wrap: break-word; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); font-weight: 500; }
.task-desc { color: var(--muted); font-size: 12.5px; line-height: 18px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; margin-top: 7px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.meta { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--chip); }
.meta.date.overdue { color: var(--overdue); background: color-mix(in srgb, var(--overdue) 12%, transparent); }
.meta.date.today { color: var(--today); background: color-mix(in srgb, var(--today) 13%, transparent); }
.meta.date.tomorrow { color: var(--tomorrow); background: color-mix(in srgb, var(--tomorrow) 13%, transparent); }
.meta.date.week { color: var(--week); background: color-mix(in srgb, var(--week) 12%, transparent); }
.meta.deadline { color: var(--ink-2); }
.meta.deadline.soon { color: var(--overdue); background: color-mix(in srgb, var(--overdue) 12%, transparent); }
.label-chip { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); }
.label-chip .tag { width: 11px; height: 11px; }
.meta-project { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); max-width: 40%; }
.task-actions { position: absolute; right: 8px; top: 8px; display: flex; gap: 0; opacity: 0; background: var(--raised); border-radius: 12px; box-shadow: var(--shadow); padding: 2px; transition: opacity .15s; }
.task-actions .icon-btn { width: 30px; height: 30px; }
.add-inline { display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 15px; color: var(--muted); width: 100%; font-size: 14px; font-weight: 550; border-radius: 16px; border: 1.5px dashed var(--line); transition: border-color .15s, color .15s, background .15s; }
.add-inline .plus { width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; color: var(--accent); transition: background .15s, color .15s; }
.add-inline:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.add-inline:hover .plus { background: var(--accent); color: var(--on-accent); }
.subtasks { margin-left: 28px; }
.drop-indicator { position: absolute; height: 3px; background: var(--accent); border-radius: 3px; pointer-events: none; z-index: 50; }
.drop-indicator::before { content: ""; position: absolute; left: -5px; top: -3.5px; width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--accent); background: var(--panel); }
.drag-ghost {
  position: fixed; z-index: 1000; pointer-events: none; background: var(--raised); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 12px 16px;
  max-width: 420px; font-size: 14px; font-weight: 550; display: flex; gap: 12px; align-items: center; transform: rotate(-2deg) scale(1.02);
}
.empty { text-align: center; padding: 64px 20px 40px; color: var(--muted); }
.empty .art { width: 132px; height: 112px; margin: 0 auto 18px; }
.empty h4 { color: var(--ink); font-family: var(--font-display); font-size: 20px; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 700; }
.completed-row .task-title { text-decoration: line-through; color: var(--muted); }

/* ---------- board ---------- */
.board { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 20px; min-height: 100%; }
.board-col { width: 292px; flex: none; display: flex; flex-direction: column; max-height: 100%; background: var(--chip); border-radius: 20px; padding: 10px 10px 12px; }
.board-col-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 10px; font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.board-col-head .cnt { color: var(--muted); font-family: var(--font); font-weight: 600; font-size: 12px; }
.board-col-head .acts { margin-left: auto; }
.board-list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; border-radius: 14px; }
.card {
  background: var(--raised); border: 0; border-radius: 15px; padding: 12px 13px; display: flex; gap: 10px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s var(--ease); position: relative; touch-action: pan-y;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.card.dragging { opacity: .35; }
.board-add-col { width: 292px; flex: none; }

/* ---------- upcoming ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 24px; position: sticky; top: 0; background: var(--panel); z-index: 5; padding: 8px 0 12px; }
.week-day { display: flex; flex-direction: column; align-items: center; padding: 9px 0 8px; border-radius: 16px; color: var(--muted); font-size: 11.5px; font-weight: 600; gap: 3px; background: var(--raised); box-shadow: var(--shadow-sm); transition: background .15s, transform .2s var(--spring); }
.week-day b { font-family: var(--font-display); font-size: 19px; color: var(--ink); font-weight: 700; line-height: 1.1; }
.week-day:hover { transform: translateY(-1px); }
.week-day.today b { color: var(--accent-ink); }
.week-day.sel { background: var(--primary-bg); color: color-mix(in srgb, var(--primary-fg) 70%, transparent); }
.week-day.sel b { color: var(--primary-fg); }
.week-day .dots { height: 4px; display: flex; gap: 2px; }
.week-day .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.week-day.sel .dots i { background: var(--pop); }
.week-day.past { opacity: .45; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { padding: 4px 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cal-d { min-height: 112px; background: var(--raised); border-radius: 14px; padding: 6px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow-sm); }
.cal-d.other { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.cal-d .n { font-size: 12px; font-weight: 650; color: var(--muted); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; }
.cal-d.today .n { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cal-t { font-size: 12px; font-weight: 550; padding: 4px 7px; border-radius: 8px; background: var(--chip); display: flex; gap: 5px; align-items: center; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-t:hover { background: var(--active); }
.cal-t .pdot { width: 6px; height: 6px; border-radius: 2px; flex: none; background: var(--p4); }
.cal-d.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(22, 18, 32, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .18s var(--ease); }
.overlay.center { align-items: center; padding-top: 16px; }
.modal { width: 100%; max-width: 580px; background: var(--raised); border-radius: 24px; box-shadow: var(--shadow-lg); border: 0; animation: pop .26s var(--spring); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 18px 18px 6px 24px; }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; flex: 1; letter-spacing: -.02em; }
.modal-body { padding: 10px 24px 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97) } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) } }
.popover {
  position: fixed; z-index: 400; background: var(--raised); border: 1px solid var(--line-soft); border-radius: 16px; box-shadow: var(--shadow-lg);
  min-width: 220px; max-width: min(340px, 96vw); padding: 6px; animation: pop .18s var(--ease); max-height: 80vh; overflow: auto;
}
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 10px; text-align: left; color: var(--ink); font-size: 13px; font-weight: 500; }
.menu-item:hover, .menu-item.kb { background: var(--hover); }
.menu-item .ico { width: 18px; display: grid; place-items: center; color: var(--muted); }
.menu-item .r { margin-left: auto; color: var(--muted); font-size: 12px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .ico { color: var(--danger); }
.menu-item.on { color: var(--accent-ink); font-weight: 650; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 5px 6px; }
.menu-label { font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.menu-search { padding: 4px 4px 6px; }
.menu-search input { width: 100%; height: 34px; border: 0; border-radius: 10px; outline: none; background: var(--chip); padding: 0 10px; }
.prio-row { display: flex; gap: 4px; padding: 4px 6px 6px; }
.prio-row button { flex: 1; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.prio-row button:hover { background: var(--hover); }
.prio-row button.on { background: var(--active); }

/* date picker */
.dp { width: 284px; }
.dp-input { padding: 6px 6px 4px; }
.dp-input input { width: 100%; border: 0; outline: none; background: var(--chip); border-radius: 10px; font-size: 14px; font-weight: 550; padding: 4px 10px; height: 36px; }
.dp-preview { font-size: 12px; color: var(--muted); padding: 4px 10px; min-height: 22px; }
.dp-cal { padding: 4px 8px 8px; }
.dp-cal-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-weight: 700; font-size: 14px; padding: 4px 2px 6px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-grid .wd { font-size: 10.5px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.dp-grid button { height: 32px; border-radius: 10px; font-size: 12.5px; font-weight: 550; color: var(--ink); position: relative; }
.dp-grid button:hover { background: var(--hover); }
.dp-grid button.past { color: var(--faint); }
.dp-grid button.today { color: var(--accent-ink); font-weight: 800; }
.dp-grid button.sel { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.dp-grid button.has::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--faint); }
.dp-foot { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--line-soft); }
.dp-foot .chip-btn { flex: 1; justify-content: center; }

/* composer */
.composer { border: 0; border-radius: 18px; background: var(--raised); box-shadow: var(--shadow-sm); transition: box-shadow .2s; }
.composer:focus-within { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.composer.in-modal { border: 0; box-shadow: none; border-radius: 0; }
.composer-main { padding: 14px 16px 4px; }
.hl-wrap { position: relative; }
.hl-back, .hl-input {
  font: 16px/23px var(--font); font-weight: 650; letter-spacing: normal; padding: 0; margin: 0; border: 0; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; width: 100%;
}
.hl-back { position: absolute; inset: 0; color: transparent; pointer-events: none; }
.hl-back mark { color: transparent; background: var(--accent-soft); border-radius: 5px; box-shadow: 0 0 0 2px var(--accent-soft); }
.hl-back mark.date { background: color-mix(in srgb, var(--today) 18%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--today) 18%, transparent); }
.hl-back mark.prio { background: color-mix(in srgb, var(--p1) 16%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--p1) 16%, transparent); }
.hl-input { position: relative; background: transparent; outline: none; resize: none; display: block; color: var(--ink); overflow: hidden; min-height: 23px; }
.hl-input::placeholder { color: var(--faint); font-weight: 550; }
.composer-desc { width: 100%; border: 0; outline: none; background: transparent; resize: none; font-size: 13px; color: var(--ink-2); padding: 4px 0 2px; min-height: 22px; line-height: 19px; }
.composer-desc::placeholder { color: var(--faint); }
.composer-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 12px; }
.composer-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-soft); }
.composer-foot .proj-pick { margin-right: auto; }

/* task detail */
.detail { display: grid; grid-template-columns: 1fr 270px; min-height: 0; flex: 1; overflow: hidden; }
.detail-main { padding: 8px 26px 26px; overflow: auto; }
.detail-side { background: var(--chip); margin: 0 10px 10px 0; border-radius: 18px; padding: 12px 16px 20px; overflow: auto; }
.detail-title { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0 2px; }
.detail-title textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; font-family: var(--font-display); font-size: 23px; font-weight: 700; line-height: 29px; letter-spacing: -.02em; padding: 0; overflow: hidden; }
.detail-title .check { margin-top: 5px; width: 22px; height: 22px; }
.detail-desc { margin: 6px 0 14px 34px; }
.detail-desc textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; font-size: 13.5px; color: var(--ink-2); min-height: 22px; padding: 0; overflow: hidden; line-height: 20px; }
.md { font-size: 13.5px; color: var(--ink-2); line-height: 20px; cursor: text; min-height: 20px; }
.md p { margin: 0 0 6px; }
.md:empty::before { content: attr(data-ph); color: var(--faint); }
.md code, .task-title code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--chip); border-radius: 5px; padding: 1px 5px; }
.side-field { padding: 9px 0; border-bottom: 1px solid var(--line); }
.side-field:last-child { border-bottom: 0; }
.side-field > .lbl { font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; display: flex; align-items: center; }
.side-field > .lbl .icon-btn { margin-left: auto; width: 22px; height: 22px; }
.side-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 7px; margin: 0 -7px; border-radius: 10px; font-size: 13px; font-weight: 550; text-align: left; min-height: 32px; width: calc(100% + 14px); }
.side-btn:hover { background: var(--hover); }
.side-btn .x { margin-left: auto; opacity: 0; }
.side-btn:hover .x { opacity: .7; }
.rem-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 0; color: var(--ink-2); }
.rem-item .icon-btn { width: 22px; height: 22px; margin-left: auto; }
.tabs { display: inline-flex; gap: 2px; margin: 18px 0 10px; padding: 3px; border-radius: 13px; background: var(--chip); }
.tabs button { padding: 6px 12px; font-size: 12.5px; font-weight: 650; color: var(--muted); border-radius: 10px; }
.tabs button.on { color: var(--ink); background: var(--raised); box-shadow: var(--shadow-sm); }
.comment { display: flex; gap: 10px; padding: 9px 0; }
.comment .who { font-size: 12.5px; font-weight: 700; }
.comment .who span { color: var(--muted); font-weight: 500; margin-left: 6px; }
.comment .body { font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; word-wrap: break-word; margin-top: 4px; padding: 8px 12px; background: var(--chip); border-radius: 4px 14px 14px 14px; display: inline-block; max-width: 100%; }
.comment .acts { margin-left: auto; opacity: 0; }
.comment:hover .acts { opacity: 1; }
.attach { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 12px; font-size: 12.5px; font-weight: 550; color: var(--ink); background: var(--raised); }
.attach img { max-width: 260px; max-height: 180px; border-radius: 8px; display: block; }
.comment-box { border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 12px; margin-top: 8px; transition: border-color .15s, box-shadow .15s; }
.comment-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.comment-box textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; min-height: 40px; font-size: 13.5px; }

/* settings */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 0; min-height: 0; flex: 1; overflow: hidden; }
.settings-nav { padding: 10px 8px; margin: 0 0 10px 10px; border-radius: 18px; background: var(--chip); overflow: auto; }
.settings-nav .nav-item.active { background: var(--raised); box-shadow: var(--shadow-sm); }
.settings-body { padding: 8px 28px 28px; overflow: auto; }
.settings-body h3 { font-size: 10.5px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; margin: 24px 0 10px; color: var(--muted); }
.settings-body h3:first-child { margin-top: 10px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.set-row .t { flex: 1; }
.set-row .t b { display: block; font-weight: 650; font-size: 13.5px; }
.set-row .t small { color: var(--muted); font-size: 12.5px; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--chip); border: 0; border-radius: 12px; padding: 12px 14px; word-break: break-all; white-space: pre-wrap; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .2s var(--spring); }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px var(--raised), 0 0 0 4px var(--ink); }
.callout { background: var(--accent-soft); color: var(--ink); border-radius: 14px; padding: 12px 14px; font-size: 13px; }
.callout.warn { background: color-mix(in srgb, var(--tomorrow) 15%, transparent); }
.map-box { height: 260px; border-radius: 16px; overflow: hidden; border: 0; margin: 8px 0; box-shadow: var(--shadow-sm); }

/* toast */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1d1a26; color: #f4f1fa; padding: 10px 10px 10px 18px; border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 14px; font-size: 13px; font-weight: 550; animation: rise .3s var(--spring); max-width: 92vw; }
.toast button { color: var(--pop); font-weight: 700; padding: 5px 10px; border-radius: 10px; }
.toast button:hover { background: rgba(255,255,255,.08); }
:root[data-theme="dark"] .toast { background: #f4f1fa; color: #1d1a26; }
:root[data-theme="dark"] .toast button { color: #5436e6; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(600px 400px at 15% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
  radial-gradient(500px 380px at 90% 90%, color-mix(in srgb, var(--pop) 35%, transparent), transparent 70%), var(--canvas); }
.auth-card { width: 100%; max-width: 400px; background: var(--raised); border: 0; border-radius: 28px; box-shadow: var(--shadow-lg); padding: 34px 30px 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -.03em; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--primary-bg); color: var(--pop); display: grid; place-items: center; }
.auth-card h1 { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; margin: 24px 0 6px; }
.auth-card p { color: var(--muted); margin: 0 0 22px; }
.err { color: var(--danger); font-size: 13px; font-weight: 550; min-height: 18px; margin: -4px 0 8px; }
.soc { display: grid; gap: 8px; }
.soc-btn { width: 100%; height: 46px; justify-content: center; gap: 10px; font-size: 14px; font-weight: 650; text-decoration: none; border-radius: 14px; }
.soc-btn.google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.soc-btn.google:hover { background: #f7f8f8; }
.soc-btn.apple { background: #000; color: #fff; border-color: #000; }
.soc-btn.apple:hover { background: #222; }
:root[data-theme="dark"] .soc-btn.apple { background: #fff; color: #000; border-color: #fff; }
:root[data-theme="dark"] .soc-btn.apple:hover { background: #e8e8e8; }
.soc-ico { width: 18px; height: 18px; flex: none; }
.soc-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 600; margin: 18px 0 14px; }
.soc-or::before, .soc-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* palette */
.palette { max-width: 640px; }
.palette input.q { width: 100%; height: 58px; border: 0; outline: none; background: transparent; font-size: 17px; font-weight: 550; padding: 0 22px; border-bottom: 1px solid var(--line-soft); }
.palette .results { max-height: 52vh; overflow: auto; padding: 8px; }
.palette .group { font-size: 10.5px; color: var(--muted); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; padding: 10px 10px 4px; }

/* stats */
.bars { display: flex; gap: 6px; align-items: flex-end; height: 120px; padding: 6px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 32px; border-radius: 9px; background: var(--accent); min-height: 4px; }
.bars .b.goal i { background: var(--pop); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 18px; }
.stat { border: 0; border-radius: 18px; padding: 14px 16px; background: var(--raised); box-shadow: var(--shadow-sm); }
.stat b { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.03em; display: block; }
.stat span { font-size: 12px; font-weight: 600; color: var(--muted); }
.heat { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 3px; margin: 8px 0; }
.heat i { border-radius: 3px; background: var(--chip); }

/* ---------- mobile dock ---------- */
.fab { display: none; }
.scrim { display: none; }
.dock { display: none; }
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 150; margin: 0; border-radius: 0 26px 26px 0; transform: translateX(-105%); width: min(86vw, 320px); box-shadow: var(--shadow-lg); padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-hidden .sidebar { margin-left: 0; }
  .app.sidebar-open .scrim { display: block; position: fixed; inset: 0; z-index: 140; background: rgba(22, 18, 32, .4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
  .main, .app.sidebar-hidden .main { margin: 0; border: 0; border-radius: 0; }
  .topbar { padding: env(safe-area-inset-top) 14px 0; height: calc(58px + env(safe-area-inset-top)); }
  .topbar [data-a="sidebar"] { display: none; }
  .content { padding: 2px 16px 150px; }
  .content.wide { padding: 2px 14px 130px; }
  .task .handle, .task .sub-caret { display: none; }
  .task-actions { display: none; }
  .dock {
    display: flex; align-items: center; justify-content: space-around; position: fixed; z-index: 100;
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 66px; padding: 0 6px;
    background: color-mix(in srgb, var(--side-bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-radius: 24px; box-shadow: 0 12px 36px rgba(22, 18, 32, .3);
  }
  :root[data-theme="dark"] .dock { box-shadow: inset 0 0 0 1px #2f2b3c, 0 12px 36px rgba(0, 0, 0, .5); }
  .dock > a, .dock > button:not(.dock-add) {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 54px; justify-content: center; border-radius: 18px;
    color: #8b85a0; font-size: 10.5px; font-weight: 650; text-decoration: none !important; transition: color .15s, background .15s;
  }
  .dock svg.i { width: 21px; height: 21px; }
  .dock > a.on { color: var(--pop); }
  .dock > a.on svg.i { stroke-width: 2.2; }
  .dock-add {
    width: 54px; height: 54px; flex: none; margin: 0 4px; border-radius: 18px; display: grid; place-items: center;
    background: var(--pop); color: var(--pop-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--pop) 40%, transparent); transition: transform .25s var(--spring);
  }
  .dock-add svg.i { width: 26px; height: 26px; stroke-width: 2.4; }
  .dock-add:active { transform: scale(.92) rotate(90deg); }
  .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .overlay { padding: 0; align-items: flex-end; }
  .overlay.center { align-items: flex-end; }
  .modal { max-width: none; border-radius: 28px 28px 0 0; max-height: 94vh; padding-bottom: env(safe-area-inset-bottom); animation: rise .32s var(--ease); }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 8px auto 0; flex: none; }
  .detail { grid-template-columns: 1fr; overflow: auto; }
  .detail-main { overflow: visible; }
  .detail-side { margin: 0 12px 12px; overflow: visible; }
  .settings { grid-template-columns: 1fr; overflow: auto; }
  .settings-nav { display: flex; overflow-x: auto; margin: 0 12px 6px; padding: 5px; gap: 2px; border-radius: 15px; }
  .settings-nav .nav-item { white-space: nowrap; }
  .settings-body { overflow: visible; padding: 8px 18px 28px; }
  .board-col { width: 82vw; }
  .page-title { font-size: 34px; }
  .page-head { margin-bottom: 20px; }
  .week-strip { gap: 4px; }
  .week-day { border-radius: 13px; padding: 7px 0 6px; }
  .week-day b { font-size: 17px; }
  .cal { gap: 3px; }
  .cal-d { min-height: 76px; border-radius: 10px; padding: 4px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .meta-project { margin-left: 0; max-width: 100%; }
}
@media (hover: none) {
  .task-actions, .nav-item .more { display: none; }
  .section-head .acts { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* sidebar project drag & drop (nest / reorder) */
.nav-item[data-ptree] { position: relative; }
.nav-item.dragging { opacity: .45; }
.nav-item.pdrop-inside { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.nav-item.pdrop-before::before, .nav-item.pdrop-after::after { content: ""; position: absolute; left: 8px; right: 6px; height: 2px; background: var(--accent); border-radius: 2px; pointer-events: none; }
.nav-item.pdrop-before::before { top: -1px; }
.nav-item.pdrop-after::after { bottom: -1px; }
.sb-group-head.pdrop-root { color: var(--accent); background: var(--accent-soft); border-radius: 8px; }

/* merged "Dnes" view: week strip head, today section, completed toggle */
.week-strip-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 2px 4px; }
.week-strip-head b { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.week-strip-head .btn.sm { height: 28px; padding: 0 9px; }
.section-head.today h3 { background: var(--primary-bg); color: var(--primary-fg); }
.day-clear { padding: 14px 15px; margin-bottom: 7px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; font-size: 13.5px; }
.head-acts { flex-wrap: wrap; justify-content: flex-end; }
/* the title block never gets squeezed by the action buttons — they wrap below instead */
.page-head { flex-wrap: wrap; row-gap: 10px; }
.page-head > .grow { min-width: min(100%, 340px); }
.done-toggle { border: 1px solid var(--line); background: var(--raised); }
.done-toggle.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.done-toggle.on:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
@media (max-width: 760px) {
  .page-head { flex-wrap: wrap; }
}

/* search lives in the sidebar header; the topbar copy only shows when the sidebar is hidden (or on mobile) */
@media (min-width: 761px) {
  .app:not(.sidebar-hidden) .topbar [data-a="search"] { display: none; }
}

/* "Přidat do kalendáře" dialog */
.cal-sub .cal-btn { justify-content: flex-start; height: 46px; gap: 12px; font-size: 14px; text-decoration: none !important; border-radius: 14px; }
.cal-sub .cal-btn .muted { font-weight: 500; }
.cal-sub .cal-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.cal-manual { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.cal-manual summary { cursor: pointer; font-weight: 650; font-size: 13px; }
.cal-manual .row .input { flex: 1; font-size: 12px; }

/* Google Tasks: synced project picker */
.g-scope { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; max-height: 260px; overflow: auto; }
.g-proj { display: flex; align-items: center; gap: 8px; padding: 5px 2px; font-size: 13.5px; cursor: pointer; }
.g-proj input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

/* whole-task drag: grabbing cursor everywhere while a task is being moved */
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }

/* ---------- grid board ("Nástěnka"): sections as freely placed cards ---------- */
.grid-tools { margin: -4px 0 12px; gap: 10px; }
.grid-board { position: relative; min-height: 200px; }
.grid-board .grid-card { position: absolute; width: 280px; max-height: none; overflow: hidden; transition: top .18s ease, left .18s ease, height .18s ease, box-shadow .15s; }
.grid-board .grid-head { cursor: grab; user-select: none; touch-action: none; }
.grid-board .grid-card.open { z-index: 6; box-shadow: var(--shadow-lg, 0 18px 50px rgba(20, 16, 30, .22)); }
.grid-board .grid-card.lifted { z-index: 20; transition: none; opacity: .92; box-shadow: 0 24px 60px rgba(20, 16, 30, .28); transform: rotate(-.6deg); }
.grid-board .grid-card.clipped::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(to bottom, transparent, var(--chip) 62%); pointer-events: none; border-radius: 0 0 20px 20px; }
.grid-more { position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 2; height: 28px; border: 0; border-radius: 10px; background: var(--panel); color: var(--accent); font: 600 12.5px var(--font); cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.grid-more:hover { background: var(--raised); }
.grid-card.open .grid-more { position: static; display: block; width: 100%; margin-top: 8px; }
.grid-card.open { padding-bottom: 12px; }
.grid-ph { position: absolute; border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 20px; pointer-events: none; transition: left .08s, top .08s; }
.grid-board.single { display: flex; flex-direction: column; gap: 14px; height: auto !important; }
.grid-board.single .grid-card { position: static; width: auto; }
.grid-board.single .grid-head { cursor: default; }

/* view menu: layout choices as equal tiles (icon above the label) so four of them fit the popover */
.seg.layout-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); width: 100%; }
.seg.layout-seg button { height: auto; min-width: 0; padding: 7px 2px 6px; flex-direction: column; justify-content: center; gap: 3px; font-size: 11.5px; }
.seg.layout-seg button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* section left out of the Google Tasks sync */
.nosync-badge { display: inline-flex; align-items: center; margin-left: 6px; color: var(--muted, #8a8a8a); opacity: .8; vertical-align: middle; }
.nosync-badge svg { width: 13px; height: 13px; }
