/* app/theme.css — base + 4 aesthetic themes */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }
input, textarea { font-family: inherit; color: inherit; }

/* ─── Sobre (default) ─── */
.theme-sobre {
  --font-body: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --bg: #f7f5f0;
  --bg-elev: #fdfcf9;
  --bg-sidebar: #efece5;
  --bg-hover: rgba(41, 38, 27, 0.04);
  --bg-active: rgba(41, 38, 27, 0.08);
  --ink: #29261b;
  --ink-2: #6b6655;
  --ink-3: #a39e8d;
  --line: rgba(41, 38, 27, 0.08);
  --line-strong: rgba(41, 38, 27, 0.16);
  --accent: #c25a30;
  --accent-soft: rgba(194, 90, 48, 0.12);
  --done: #a39e8d;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-pop: 0 1px 0 rgba(255,255,255,.5) inset, 0 8px 24px rgba(41,38,27,.10);
  --noise: none;
  --check-shape: 4px;
}

/* ─── Sombre (dark pro) ─── */
.theme-sombre {
  --font-body: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --bg: #0e0f12;
  --bg-elev: #16181d;
  --bg-sidebar: #0a0b0e;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-active: rgba(255, 255, 255, 0.08);
  --ink: #e8e6df;
  --ink-2: #9a978b;
  --ink-3: #5e5b51;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --accent: #ff7a4d;
  --accent-soft: rgba(255, 122, 77, 0.16);
  --done: #5e5b51;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-pop: 0 0 0 1px rgba(255,255,255,.04), 0 12px 32px rgba(0,0,0,.4);
  --noise: none;
  --check-shape: 4px;
}

/* ─── Playful (couleurs vives + rounded) ─── */
.theme-playful {
  --font-body: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --bg: #fff7ed;
  --bg-elev: #ffffff;
  --bg-sidebar: #ffeed5;
  --bg-hover: rgba(124, 45, 18, 0.05);
  --bg-active: rgba(124, 45, 18, 0.10);
  --ink: #3b1f0f;
  --ink-2: #8b6650;
  --ink-3: #c4a58c;
  --line: rgba(124, 45, 18, 0.10);
  --line-strong: rgba(124, 45, 18, 0.20);
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.18);
  --done: #c4a58c;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-pop: 0 4px 0 rgba(124,45,18,0.08), 0 12px 32px rgba(124,45,18,0.10);
  --noise: none;
  --check-shape: 999px;
}

/* ─── Papier (carnet manuscrit) ─── */
.theme-papier {
  --font-body: 'Lora', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'Caveat', cursive;
  --bg: #f3ecd9;
  --bg-elev: #faf4e1;
  --bg-sidebar: #ebe2c5;
  --bg-hover: rgba(60, 47, 28, 0.05);
  --bg-active: rgba(60, 47, 28, 0.09);
  --ink: #3c2f1c;
  --ink-2: #7a6745;
  --ink-3: #b3a279;
  --line: rgba(60, 47, 28, 0.18);
  --line-strong: rgba(60, 47, 28, 0.32);
  --accent: #b6541c;
  --accent-soft: rgba(182, 84, 28, 0.14);
  --done: #b3a279;
  --radius: 3px;
  --radius-lg: 5px;
  --shadow-pop: 0 1px 0 rgba(255, 248, 220, .6) inset, 0 4px 12px rgba(60, 47, 28, .14);
  /* faint paper grain via repeating gradient */
  --noise: repeating-linear-gradient(
    0deg, rgba(60,47,28,0.025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(60,47,28,0.015) 0 1px, transparent 1px 5px);
  --check-shape: 0px;
}

/* Density */
.density-compact   { --row-h: 28px; --row-gap: 0; --pad-x: 8px; --font-size: 13px; }
.density-regular   { --row-h: 36px; --row-gap: 1px; --pad-x: 10px; --font-size: 14px; }
.density-comfy     { --row-h: 44px; --row-gap: 2px; --pad-x: 12px; --font-size: 15px; }

/* ─── App shell ─── */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr 360px;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg);
  background-image: var(--noise);
  color: var(--ink);
}
.main-col { background: var(--bg); }
.app-shell.detail-closed { grid-template-columns: 240px 1fr; }
.app-shell.sidebar-closed { grid-template-columns: 0 1fr 360px; }
.app-shell.sidebar-closed.detail-closed { grid-template-columns: 0 1fr; }

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 220px 1fr !important; }
  .app-shell.detail-closed { grid-template-columns: 220px 1fr !important; }
  .detail-col { position: fixed; right: 0; top: 0; bottom: 0; width: 360px; max-width: 90vw; z-index: 30; box-shadow: -8px 0 32px rgba(0,0,0,0.12); }
  .app-shell.detail-closed .detail-col { display: none; }
}
@media (max-width: 760px) {
  .app-shell, .app-shell.detail-closed { grid-template-columns: 1fr !important; }
  .sidebar-col { display: none !important; }
  .app-shell.mobile-sidebar .sidebar-col { display: flex !important; position: fixed; inset: 0; z-index: 50; width: 280px; box-shadow: 8px 0 32px rgba(0,0,0,0.12); }
  .main-hd { padding: 12px 14px 10px; flex-wrap: wrap; }
  .main-body { padding: 12px 14px 80px; }
}

/* ─── Sidebar ─── */
.sidebar-col {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13px;
}
.sidebar-hd {
  padding: 16px 14px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.theme-papier .brand { font-size: 26px; line-height: 1; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent); color: var(--bg-elev);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  font-family: var(--font-display);
}
.theme-playful .brand-mark { border-radius: 999px; }
.theme-papier .brand-mark { border-radius: 0; transform: rotate(-3deg); }

.sidebar-search {
  margin: 8px 12px 12px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
}
.sidebar-search input {
  border: 0; background: transparent; outline: 0;
  font-size: 13px; flex: 1; color: var(--ink);
}
.sidebar-search kbd {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-active); color: var(--ink-2);
}
.sidebar-section {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 16px 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-section button {
  appearance: none; border: 0; background: transparent;
  color: var(--ink-3); cursor: pointer;
  display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 4px;
}
.sidebar-section button:hover { background: var(--bg-active); color: var(--ink); }
.sidebar-list { padding: 0 8px; display: flex; flex-direction: column; gap: 1px; }
.sidebar-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--ink-2);
  font-size: 13px;
  position: relative;
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--ink); }
.sidebar-item.active { background: var(--bg-active); color: var(--ink); font-weight: 500; }
.sidebar-item .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--swatch, var(--ink-3));
  flex: 0 0 auto;
}
.sidebar-item .count {
  margin-left: auto;
  font-size: 11px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.sidebar-item.active .count { color: var(--ink-2); }

.sidebar-foot {
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-2); font-size: 12px;
}
.avatar-mini {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklch, var(--accent), var(--ink) 40%));
  color: white; display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}
.theme-papier .avatar-mini { border-radius: 0; }

/* ─── Main column ─── */
.main-col {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.main-hd {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  min-width: 0;
}
.main-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 0 1 auto;
}
.main-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.theme-papier .main-title { font-size: 36px; font-weight: 400; line-height: 1; }
.main-meta { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; margin-left: 4px; }
.main-tools {
  margin-left: auto;
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap; justify-content: flex-end;
  min-width: 0;
}
.tool-btn {
  appearance: none; background: transparent; border: 1px solid transparent;
  width: 30px; height: 30px;
  border-radius: var(--radius);
  color: var(--ink-2);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
}
.tool-btn:hover { background: var(--bg-hover); color: var(--ink); }
.tool-btn.active { background: var(--bg-active); color: var(--ink); }
.tool-btn .badge {
  position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.seg {
  display: inline-flex; padding: 2px;
  background: var(--bg-active); border-radius: 8px;
  gap: 0;
}
.seg button {
  appearance: none; border: 0;
  padding: 5px 10px;
  font-size: 12px; color: var(--ink-2);
  background: transparent; border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
}
.seg button.active { background: var(--bg-elev); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

.main-body {
  flex: 1; overflow: auto;
  padding: 16px 22px 80px;
}
.main-body::-webkit-scrollbar { width: 10px; }
.main-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }

/* ─── Tree rows ─── */
.tree-list { display: flex; flex-direction: column; gap: var(--row-gap); position: relative; }
.tree-row {
  display: grid;
  grid-template-columns: 16px 16px 18px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: var(--row-h);
  padding: 4px var(--pad-x);
  border-radius: var(--radius);
  position: relative;
  cursor: default;
  font-size: var(--font-size);
}
.tree-row:hover { background: var(--bg-hover); }
.tree-row.selected { background: var(--bg-active); }
.tree-row.dragging { opacity: 0.4; }

.tree-row .drag-handle {
  opacity: 0; color: var(--ink-3); cursor: grab;
  display: grid; place-items: center;
}
.tree-row:hover .drag-handle { opacity: 1; }
.tree-row .drag-handle:active { cursor: grabbing; }

.tree-row .twist {
  appearance: none; border: 0; background: transparent;
  width: 16px; height: 16px;
  display: grid; place-items: center;
  color: var(--ink-3); cursor: pointer;
  border-radius: 3px;
  padding: 0;
}
.tree-row .twist:hover { background: var(--bg-active); color: var(--ink); }
.tree-row .twist.empty { visibility: hidden; }

.checkbox {
  appearance: none; border: 1.5px solid var(--line-strong);
  background: transparent;
  width: 16px; height: 16px;
  border-radius: var(--check-shape);
  cursor: pointer;
  display: grid; place-items: center;
  flex: 0 0 auto;
  transition: all .15s ease;
  padding: 0;
}
.checkbox:hover { border-color: var(--accent); }
.checkbox.checked { background: var(--accent); border-color: var(--accent); color: white; }
.checkbox.checked svg { width: 10px; height: 10px; stroke-width: 3; }

.checkbox.prio-high { border-color: #dc2626; }
.checkbox.prio-high.checked { background: #dc2626; border-color: #dc2626; }
.checkbox.prio-med  { border-color: #f59e0b; }
.checkbox.prio-med.checked  { background: #f59e0b; border-color: #f59e0b; }
.checkbox.prio-low  { border-color: var(--ink-3); }

.tree-row .title-cell {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; flex-wrap: wrap;
}
.tree-row .title {
  font-weight: 450;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: text;
  min-width: 0; flex: 1 1 120px;
}
.tree-row.done .title { color: var(--done); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.theme-papier .tree-row .title { font-weight: 400; }

.tree-row .meta {
  display: flex; align-items: center; gap: 6px;
  color: var(--ink-3); font-size: 11.5px;
  flex: 0 0 auto;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  background: var(--chip-bg, var(--bg-active));
  color: var(--chip-fg, var(--ink-2));
  font-family: var(--font-body);
  letter-spacing: 0.01em;
}
.theme-papier .chip { border-radius: 0; border: 1px dashed currentColor; padding: 0 5px; }
.chip.due { font-variant-numeric: tabular-nums; }
.chip.due.overdue { color: #dc2626; background: rgba(220, 38, 38, 0.1); }
.chip.due.today { color: var(--accent); background: var(--accent-soft); }
.chip.recurring { color: var(--ink-2); }

.progress-mini {
  height: 3px; flex: 1; max-width: 80px;
  background: var(--bg-active); border-radius: 2px;
  overflow: hidden;
}
.progress-mini > div {
  height: 100%;
  background: var(--accent);
  transition: width .25s ease;
}

.row-actions {
  display: flex; align-items: center; gap: 0;
  opacity: 0; transition: opacity .1s;
}
.tree-row:hover .row-actions { opacity: 1; }
.row-actions button {
  appearance: none; background: transparent; border: 0;
  width: 24px; height: 24px; border-radius: 4px;
  color: var(--ink-3); cursor: pointer;
  display: grid; place-items: center;
}
.row-actions button:hover { background: var(--bg-active); color: var(--ink); }

/* ─── Hierarchy display modes ─── */

/* Mode 1: lines — guide lines on the left of nested children */
.hier-lines .nest {
  position: relative;
  margin-left: 18px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.hier-lines .nest > .tree-row::before {
  content: '';
  position: absolute;
  left: -14px; top: calc(var(--row-h) / 2);
  width: 10px; height: 1px;
  background: var(--line);
}

/* Mode 2: tree (file explorer) — minimal indent, no lines */
.hier-tree .nest {
  margin-left: 24px;
}

/* Mode 3: mindmap — horizontal tree */
.hier-mindmap {
  --col-w: 280px;
}
.hier-mindmap .tree-list {
  display: flex; flex-direction: row; align-items: flex-start;
  gap: 32px;
}
.hier-mindmap .nest-col {
  display: flex; flex-direction: column;
  gap: 8px;
}
.hier-mindmap .mm-card {
  width: var(--col-w);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  position: relative;
  cursor: pointer;
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px;
}
.hier-mindmap .mm-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.hier-mindmap .mm-card .title { flex: 1; min-width: 0; }
.hier-mindmap .mm-children {
  display: flex; flex-direction: column; gap: 8px;
}
.hier-mindmap .mm-connector {
  position: absolute; left: -32px;
  top: 50%; width: 32px; height: 1px;
  background: var(--line-strong);
}

/* Mode 4: focus zoom — drill into one task at a time */
.hier-focus .focus-bc {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--ink-3);
  margin-bottom: 12px;
}
.hier-focus .focus-bc button {
  appearance: none; border: 0; background: transparent;
  color: var(--ink-2); cursor: pointer;
  padding: 3px 6px; border-radius: 4px;
  font-size: 12px;
}
.hier-focus .focus-bc button:hover { background: var(--bg-active); color: var(--ink); }
.hier-focus .focus-bc .sep { color: var(--ink-3); }
.hier-focus .focus-bc .current { color: var(--ink); font-weight: 500; }
.hier-focus .focus-task {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 22px;
  margin-bottom: 18px;
}
.hier-focus .focus-task .focus-title {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  font-family: var(--font-display);
  display: flex; align-items: center; gap: 10px;
}
.theme-papier .hier-focus .focus-task .focus-title { font-size: 32px; font-weight: 400; }
.hier-focus .focus-task .focus-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px;
}
.hier-focus .drill {
  appearance: none; border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 4px 10px; border-radius: 6px;
  color: var(--ink-2); font-size: 11.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-body);
}
.hier-focus .drill:hover { color: var(--ink); border-color: var(--line-strong); }

/* ─── Drop indicators ─── */
.drop-line {
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin: 0 var(--pad-x);
}
.tree-row.drop-inside { background: var(--accent-soft); outline: 1px solid var(--accent); }

/* ─── Add row inline ─── */
.add-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px var(--pad-x);
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 13px;
  cursor: text;
  border-radius: var(--radius);
  border: 1px dashed transparent;
}
.add-row:hover { color: var(--ink-2); border-color: var(--line); }
.add-row input {
  flex: 1; border: 0; background: transparent; outline: 0;
  color: var(--ink); font-size: 13px;
}

/* ─── Detail panel ─── */
.detail-col {
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.detail-empty {
  flex: 1; display: grid; place-items: center;
  color: var(--ink-3); padding: 32px;
  text-align: center;
}
.detail-hd {
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.detail-hd .breadcrumb {
  font-size: 11.5px; color: var(--ink-3); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-body { flex: 1; overflow: auto; padding: 16px 20px 40px; }
.detail-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 0; background: transparent;
  width: 100%;
  outline: 0; color: var(--ink);
  padding: 4px 0;
  resize: none;
  line-height: 1.25;
}
.theme-papier .detail-title { font-size: 32px; font-weight: 400; }

.detail-section {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 8px 14px;
  align-items: center;
  margin-top: 16px;
  font-size: 13px;
}
.detail-section .lbl {
  color: var(--ink-3);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.detail-section .val { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.pill-btn {
  appearance: none; border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-body);
}
.theme-papier .pill-btn { border-radius: 3px; border-style: dashed; }
.pill-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.pill-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.notes-area {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  resize: vertical; min-height: 90px;
  font-size: 13px; line-height: 1.55;
  font-family: var(--font-body);
  outline: 0;
}
.notes-area:focus { border-color: var(--accent); }
.theme-papier .notes-area {
  background: transparent;
  background-image: repeating-linear-gradient(transparent, transparent 22px, var(--line) 22px, var(--line) 23px);
  line-height: 23px;
  border-style: dashed;
}

.attach-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 6px;
  font-size: 12.5px;
}
.attach-row .ico { color: var(--ink-3); }
.attach-row .name { flex: 1; }
.attach-row .size { color: var(--ink-3); font-size: 11px; }

.subtask-mini {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.subtask-mini:hover { background: var(--bg-hover); color: var(--ink); }
.subtask-mini.done .label { color: var(--done); text-decoration: line-through; }

/* ─── Pomodoro widget ─── */
.pomo-pop {
  position: fixed;
  bottom: 16px; left: 256px;
  z-index: 30;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-pop);
  display: flex; align-items: center; gap: 12px;
  font-size: 12px;
  min-width: 240px;
}
.pomo-time {
  font-family: var(--font-mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.pomo-task { color: var(--ink-2); flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pomo-btn {
  appearance: none; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink-2);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
}
.pomo-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.pomo-btn.go { background: var(--accent); color: white; border-color: var(--accent); }

/* ─── Calendar view ─── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cal-h {
  background: var(--bg-sidebar);
  padding: 10px 12px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
}
.cal-cell {
  background: var(--bg-elev);
  min-height: 110px;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
}
.cal-cell.other { background: var(--bg); color: var(--ink-3); }
.cal-cell.today .num { color: var(--accent); font-weight: 700; }
.cal-cell .num {
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.cal-task {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-active);
  color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid var(--swatch, var(--accent));
  cursor: pointer;
}
.cal-task.done { color: var(--done); text-decoration: line-through; }
.cal-task:hover { background: var(--bg-hover); color: var(--ink); }

/* ─── Misc ─── */
.kbd {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-active); color: var(--ink-2);
  border: 1px solid var(--line);
}
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 80px 24px; color: var(--ink-3);
  text-align: center;
  font-size: 14px;
}

/* ─── Mobile open buttons ─── */
.mobile-bk {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 40; display: none;
}
@media (max-width: 900px) {
  .app-shell.mobile-sidebar .mobile-bk,
  .app-shell.mobile-detail .mobile-bk { display: block; }
}

/* ─── Inline editing ─── */
.inline-edit {
  border: 0; background: transparent; outline: 0;
  font: inherit; color: inherit;
  padding: 0; margin: 0;
  width: 100%;
}
