/* Threadmenu — warm minimal. Designed mobile-first; widens gracefully. */

:root {
  --bg: #fbf6ef;
  --surface: #fffaf3;
  --surface-2: #f4ebdc;
  --ink: #2a221b;
  --ink-soft: #6b5d4f;
  --muted: #9a8a78;
  --accent: #c25a3a;
  --accent-ink: #fff;
  --line: #ead8bf;
  --danger: #a4452f;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 8px 24px rgba(60, 40, 20, 0.04);
  --space: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 8px; font-weight: 600; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; }

.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.4em; margin: 0; }

button {
  font: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: background .12s, transform .04s;
}
button:hover { background: #ead8bf; }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover { background: #a8492e; }
button.ghost { background: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.danger { color: var(--danger); }
button.danger:hover { background: #f3dad2; }

input:not([type="checkbox"]):not([type="radio"]), textarea {
  font: inherit;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
input[type="checkbox"] { width: auto; cursor: pointer; }

/* App shell */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--space);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  font-weight: 700; letter-spacing: 0.02em; color: var(--ink);
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }

.status {
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.status.ok { background: #e2efdb; color: #466a3a; }
.status.syncing { background: #f1e0c4; color: #8a6a2c; }
.status.error { background: #f3dad2; color: var(--danger); }
.status.offline { background: var(--surface-2); color: var(--ink-soft); }

.main {
  flex: 1;
  padding: var(--space);
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

/* Login */
.login {
  max-width: 420px;
  margin: 10vh auto;
  padding: var(--space);
}
.login form { display: flex; flex-direction: column; gap: 12px; }

/* Panels and lists */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space);
  margin-bottom: var(--space);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 8px;
}
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; margin: 0 -4px;
  border-radius: var(--radius-sm);
}
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--surface-2); }
.row + .row { border-top: 1px solid var(--line); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; }
.row-sub { font-size: 0.9rem; margin-top: 2px; }
.row-meta { font-size: 0.85rem; white-space: nowrap; }

/* Project / thread views */
.view { display: flex; flex-direction: column; gap: var(--space); }
.breadcrumb {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.title-input {
  font-size: 1.5rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}
.title-input:hover { border-color: var(--line); }
.title-input:focus { border-color: var(--accent); background: var(--surface); }
.desc-input {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 8px;
}
.desc-input:hover { border-color: var(--line); }
.desc-input:focus { border-color: var(--accent); background: var(--surface); }

.composer { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.composer button { align-self: flex-start; }

.notes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.note {
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.note.note-change {
  background: transparent;
  border-left-color: var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.note-text { white-space: pre-wrap; word-wrap: break-word; }
.note-meta { font-size: 0.8rem; margin-top: 4px; }

/* Tasks tree — view-only rows, editing happens in the task-detail modal */
.tasks { display: flex; flex-direction: column; gap: 4px; }
.tree, .tree-children { list-style: none; padding: 0; margin: 0; }
.tree-children { margin-left: 22px; border-left: 1px dashed var(--line); padding-left: 10px; }
.task { padding: 2px 0; }
.task-row {
  display: flex; align-items: center; gap: 10px;
}

/* 3-state checkbox: todo (empty) → in_progress (half) → done (check) */
.task-check {
  width: 18px; height: 18px;
  border: 2px solid var(--muted);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  position: relative;
  transition: border-color .08s, background .08s;
}
.task-check:hover { border-color: var(--accent); }
.task-check-todo { /* empty box */ }
.task-check-in-progress {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent) 50%, var(--surface) 50%, var(--surface) 100%);
  border-color: var(--accent);
}
.task-check-done {
  background: var(--accent);
  border-color: var(--accent);
}
.task-check-done::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
}

.task-title {
  flex: 1;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  user-select: text;
  word-break: break-word;
}
.task-title:hover { background: var(--surface-2); }
.task-title.done { color: var(--muted); text-decoration: line-through; }
.task-title.empty { color: var(--muted); font-style: italic; }

/* Inline creation input — appears at the slot where a new task will land */
.creating-task { animation: createInRow .15s ease-out; }
.creating-row { padding-left: 26px; /* visually align with task text after checkbox slot */ }
.task-create-input {
  flex: 1;
  font-size: 0.95rem;
  padding: 6px 8px !important;
  border: 1px solid var(--project-accent, var(--accent)) !important;
  background: var(--surface) !important;
}
@keyframes createInRow {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
.menu-item {
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  white-space: nowrap;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: #f3dad2; }

/* Submenu (e.g. "Insert template" expanding inside a menu) */
.submenu { width: 100%; }
.submenu > summary {
  list-style: none;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}
.submenu > summary::-webkit-details-marker { display: none; }
.submenu > summary:hover { background: var(--surface-2); }
.submenu-body {
  padding-left: 8px;
  display: flex; flex-direction: column;
  border-left: 2px solid var(--line);
  margin-left: 8px;
}

.tree-foot { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
button.small { padding: 4px 10px; font-size: 0.9rem; }

/* Templates panel */
.templates-list { display: flex; flex-direction: column; gap: 4px; }
.template { padding: 6px 0; border-top: 1px solid var(--line); }
.template:first-child { border-top: none; }
.template-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.template-name {
  flex: 1;
  text-align: left;
  background: transparent;
  border: none;
  font: inherit;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
}
.template-name:hover { background: var(--surface-2); }
.template-editor { padding: 8px 0 4px 12px; }

/* Mood filter at top of home */
.mood-filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 0 4px;
  margin-bottom: var(--space);
}

/* Resume rail — horizontal scrolling cards (replaces old hero) */
.resume-rail-section { margin-bottom: var(--space); }
.rail-head { padding: 0 4px; margin-bottom: 8px; }
.rail-head h2 { margin: 0; }
.resume-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 4px 14px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.resume-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--project-accent, var(--accent));
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow);
  transition: transform .08s, box-shadow .12s;
}
.resume-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(60,40,20,0.08), 0 10px 22px rgba(60,40,20,0.07);
}
.resume-card-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--project-accent, var(--accent));
  font-weight: 600;
}
.resume-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}
.resume-card-note {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.4;
  border-left: 2px solid var(--line);
  padding-left: 8px;
  font-size: 0.92rem;
}
.resume-card-empty { font-size: 0.9rem; }
.resume-card-foot { font-size: 0.8rem; margin-top: auto; }

/* Likes constellation */
.constellation {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.constellation-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: transform .08s, box-shadow .12s;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center;
  min-height: 110px;
}
.constellation-tile::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at center top,
    var(--project-accent, var(--accent)) 0%,
    transparent 60%);
  opacity: 0.10;
  pointer-events: none;
}
.constellation-tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.constellation-tile.rank-1 {
  grid-column: span 2;
  padding: 24px;
  min-height: 140px;
}
.constellation-tile.rank-1::before { opacity: 0.16; }
.tile-emoji { font-size: 2rem; line-height: 1; }
.constellation-tile.rank-1 .tile-emoji { font-size: 2.6rem; }
.tile-title { font-weight: 600; color: var(--ink); }
.constellation-tile.rank-1 .tile-title { font-size: 1.15rem; }
.tile-likes {
  color: var(--project-accent, var(--accent));
  font-size: 0.9rem; font-weight: 500;
}

/* Project-row emoji prefix + accent stripe */
.project-row {
  border-left: 3px solid var(--project-accent, transparent);
  padding-left: 12px;
}
.row-emoji {
  font-size: 1.15rem;
  flex: 0 0 auto;
  width: 26px;
  text-align: center;
  user-select: none;
}
.row-emoji-dot {
  width: 8px; height: 8px;
  flex: 0 0 auto;
  background: var(--project-accent, var(--ink-soft));
  border-radius: 50%;
  margin: 0 9px 0 2px;
  opacity: 0.6;
}
.row-emoji-inline { user-select: none; }

/* Recency buckets */
.buckets { display: flex; flex-direction: column; gap: 14px; }
.bucket-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 0 4px 4px;
}
.older-bucket > summary { cursor: pointer; list-style: none; user-select: none; padding: 4px; border-radius: var(--radius-sm); }
.older-bucket > summary::-webkit-details-marker { display: none; }
.older-bucket > summary::before { content: '▸ '; color: var(--muted); }
.older-bucket[open] > summary::before { content: '▾ '; }
.older-bucket > summary:hover { background: var(--surface-2); }

/* Collapsible panel (Archived) */
.collapsible-panel > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.collapsible-panel > summary::-webkit-details-marker { display: none; }
.collapsible-panel > summary::after {
  content: '▸';
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 4px;
  transition: transform .12s;
}
.collapsible-panel[open] > summary::after { content: '▾'; }
.collapsible-panel[open] > summary { margin-bottom: 8px; }

.thread-project-context { font-size: 0.95rem; }

/* Likes */
.likes-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.like-btn {
  background: var(--surface-2);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.95rem;
}
.like-btn:hover { background: #ead8bf; color: var(--ink); }
.like-btn.has-likes { background: #f3dad2; color: var(--accent); }
.like-btn.has-likes:hover { background: #ebc4b8; }
.like-composer {
  display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap;
}
.like-input { flex: 1; min-width: 200px; }
.likes-panel ul.like-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.like-row {
  padding: 8px 10px;
  background: #fdf2eb;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.like-text { white-space: pre-wrap; }
.like-meta { font-size: 0.85rem; margin-top: 4px; }
.link-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.row-likes { font-size: 0.9rem; color: var(--accent); white-space: nowrap; padding: 0 4px; }

/* Idea rows */
.idea-row { gap: 8px; }
.idea-row .clickable-inline { cursor: pointer; flex: 1; min-width: 0; }
.idea-row .clickable-inline:hover .row-title { color: var(--accent); }
.idea-dot { user-select: none; }

/* Timers */
.timer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.timer-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.timer-row:last-child { border-bottom: none; }
.timer-list.compact .timer-row { padding: 8px 0; grid-template-columns: 110px 1fr auto; }
.timer-list.dim .timer-row { opacity: 0.65; }
.timer-time {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink-soft);
}
.timer-row.overdue .timer-time { color: var(--danger); }
.timer-label { font-weight: 500; }
.timer-meta { font-size: 0.85rem; margin-top: 2px; }
.timer-target { color: var(--ink-soft); }
.timer-target:hover { color: var(--accent); }
.timer-actions { display: flex; gap: 4px; }

.timer-widget .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.pill-count {
  display: inline-block;
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.see-all { font-size: 0.9rem; }

/* Timer composer fields */
.timer-target-line { font-size: 0.9rem; padding: 4px 2px 0; }
.field-label { font-size: 0.85rem; color: var(--ink-soft); margin: 6px 0 -2px; display: block; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip {
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.chip:hover { background: #ead8bf; color: var(--ink); }
.input-error { border-color: var(--danger) !important; background: #fdecea !important; }
.inline-check { display: flex; align-items: center; gap: 6px; font-size: 0.95rem; color: var(--ink-soft); cursor: pointer; }
.timer-composer .timer-template-picker {
  font: inherit;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  margin-top: 6px;
}

/* Project identity (emoji, accent, mood) */
.project-title-row { display: flex; align-items: center; gap: 8px; }
.project-emoji-input {
  width: 56px !important;
  flex: 0 0 auto;
  text-align: center;
  font-size: 1.6rem;
  padding: 4px !important;
  background: transparent;
  border: 1px solid transparent;
}
.project-emoji-input:hover, .project-emoji-input:focus {
  border-color: var(--line);
  background: var(--surface);
}

.accent-row, .mood-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 4px 0;
}
.accent-row-label, .mood-row-label {
  font-size: 0.85rem;
  margin-right: 4px;
}
.accent-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}
.accent-swatch.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink);
}
.mood-chip {
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid transparent;
}
.mood-chip:hover { background: #ead8bf; color: var(--ink); }
.mood-chip.active {
  background: var(--project-accent, var(--accent));
  color: var(--accent-ink);
  border-color: var(--project-accent, var(--accent));
}

/* Project chip used everywhere a project appears as context */
.project-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9em;
  color: var(--project-accent, var(--ink-soft));
  background: transparent;
  border: none;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: inherit;
}
.project-chip.clickable { cursor: pointer; }
.project-chip.clickable:hover { background: var(--surface-2); }
.project-chip-emoji { font-size: 1.05em; line-height: 1; }
.project-chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--project-accent, var(--ink-soft));
  display: inline-block;
}
.project-chip-name { font-weight: 500; }

/* Task-detail modal */
.task-name-input { font-size: 1.1rem; }
.state-buttons {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.state-btn {
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.state-btn:hover { background: #ead8bf; color: var(--ink); }
.state-btn.active.state-todo {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ink-soft);
}
.state-btn.active.state-in-progress {
  background: #f1e0c4;
  color: #8a6a2c;
  border-color: #8a6a2c;
}
.state-btn.active.state-done {
  background: #e2efdb;
  color: #466a3a;
  border-color: #466a3a;
}

.task-actions {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.action-btn {
  text-align: left;
  background: transparent;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  font: inherit;
  color: var(--ink);
}
.action-btn:hover { background: var(--surface-2); }
.action-btn.danger { color: var(--danger); }
.action-btn.danger:hover { background: #f3dad2; }
.modal-action-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  flex-wrap: wrap;
}
.modal-action-row label {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
}
.insert-template-select {
  font: inherit;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  flex: 1;
  min-width: 180px;
}

.breadcrumb-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.breadcrumb-actions .ghost.active {
  background: #e2efdb;
  color: #466a3a;
}
.breadcrumb-actions .ghost.active:hover { background: #d3e8c5; }

/* Related threads navigator (above the composer) */
.related-threads {
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 2px;
}

/* Composer mode toggle (now / earlier) */
.composer-modes {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.mode-btn {
  background: transparent;
  color: var(--ink-soft);
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
}
.mode-btn:hover { background: var(--surface-2); color: var(--ink); }
.mode-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.late-offset { display: inline-flex; align-items: center; }
.late-offset-input {
  width: 80px;
  padding: 4px 8px !important;
  margin-left: 4px;
}

.changes-toggle { font-size: 0.85rem; margin: 10px 0 6px; }
.idle-hint { font-size: 0.85rem; }

/* Note type picker in the composer */
.composer-types {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.note-type-btn {
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid transparent;
}
.note-type-btn:hover { background: #ead8bf; color: var(--ink); }
.note-type-btn.active {
  background: var(--project-accent, var(--accent));
  color: var(--accent-ink);
  border-color: var(--project-accent, var(--accent));
}
.note-link-input { margin-top: 6px; }

/* Note rendering by type */
.note { /* base — defined earlier */ }
.note-body { display: flex; flex-direction: column; gap: 4px; }
.note-type-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--project-accent, var(--accent));
  font-weight: 600;
}

.note-question {
  background: #fdf6e3;
  border-left-color: #c69a2a;
}
.note-question.resolved .note-text { text-decoration: line-through; opacity: 0.7; }

.note-decision {
  background: #e8efe1;
  border-left-color: #5a9966;
  padding: 14px;
  font-weight: 500;
}
.note-decision .note-type-eyebrow { color: #5a9966; }

.note-link {
  color: var(--accent);
  text-decoration: underline;
}
.note-link:hover { color: #a8492e; }

.note-experiment {
  background: #f0eaf6;
  border-left-color: #6e6dab;
  border-left-width: 3px;
  border-style: dashed;
  border-top: none;
  border-right: none;
  border-bottom: none;
}
.note-experiment .note-type-eyebrow { color: #6e6dab; }

.note-resolve { font-size: 0.8rem; margin-left: 6px; }
.note-delete { margin-left: 8px; font-size: 0.8rem; }

/* Branch map (replaces related-threads inline text) */
.branch-map {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 6px 0;
}
.branch-map-head {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
}
.branch-list { list-style: none; padding: 0; margin: 0; }
.branch-row {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 0;
  font-size: 0.92rem;
}
.branch-row.depth-1 { padding-left: 16px; }
.branch-row.depth-2 { padding-left: 32px; }
.branch-row.dim { color: var(--ink-soft); }
.branch-glyph {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  width: 16px;
  display: inline-block;
  text-align: center;
}
.branch-row.self .branch-glyph {
  color: var(--project-accent, var(--accent));
}
.branch-row.self .branch-title {
  font-weight: 600;
  color: var(--ink);
}
.branch-title { color: inherit; }

/* Thread project context chip under title */
.thread-project-context {
  margin-top: -4px;
}

/* Threads tree on project view */
.thread-tree, .thread-children { list-style: none; padding: 0; margin: 0; }
.thread-children { margin-left: 20px; padding-left: 10px; border-left: 1px dashed var(--line); }
.thread-node + .thread-node { margin-top: 4px; }
.thread-node > .row.thread-active {
  background: #e2efdb;
}
.thread-node > .row.thread-active:hover { background: #d3e8c5; }
.active-dot { user-select: none; }

/* Capture FAB + modal */
.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.5rem;
  font-weight: 500;
  border: none;
  box-shadow: 0 4px 16px rgba(60, 30, 10, 0.2);
  z-index: 20;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.fab:hover { background: #a8492e; transform: translateY(-1px); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(40, 30, 20, 0.4);
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  overflow-y: auto;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  padding: var(--space);
  box-shadow: 0 12px 40px rgba(60, 30, 10, 0.25);
  display: flex; flex-direction: column; gap: 12px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; }
.capture-text { font-size: 1.05rem; }
.capture-dest-label { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }
.capture-dest {
  font: inherit;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
.capture-picker {
  font: inherit;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  margin-top: 8px;
}
.capture-dest-summary { font-size: 0.9rem; padding: 0 2px; }
.capture-picker-slot { min-height: 24px; }
.capture-slash-hint {
  font-size: 0.82rem;
  padding: 4px 2px 0;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.capture-slash-hint code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--ink);
}
.capture-slash-preview {
  font-size: 0.88rem;
  min-height: 1.2em;
  padding: 4px 8px;
  border-left: 2px solid var(--accent);
  background: #fdf2eb;
  border-radius: var(--radius-sm);
}
.capture-slash-preview:empty {
  display: none;
}
.capture-like { margin: 0; }

@media (max-width: 480px) {
  .main { padding: 12px; }
  .panel { padding: 12px; }
  h1 { font-size: 1.4rem; }
  .tree-children { margin-left: 14px; padding-left: 8px; }
  .task-menu .menu-body { right: -4px; min-width: 180px; }
  .fab { right: 14px; bottom: 14px; width: 52px; height: 52px; }
  .modal-backdrop { padding: 4vh 8px 12px; }
}
