:root {
  --bg: #f5f5f5;
  --panel-bg: #ffffff;
  --ink: #111111;
  --ink-soft: #666666;
  --line: #dddddd;
  --accent: #000000;
  --accent-soft: #ededed;
  --focus-tag: #707070;
  --task-tag: #4a4a4a;
  --phase-tag: #000000;
  --component-tag: #858585;
  --component2-tag: #9a9a9a;
  --component3-tag: #adadad;
  --current-green: #15803d;
  --current-green-soft: #dcfce7;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-bg);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}
.brand-name { font-weight: 600; font-size: 15px; }

.company-tag {
  color: var(--ink-soft);
  font-size: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.reset-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.reset-btn:hover { background: #eeeeee; }

.auth-area {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-user {
  color: var(--ink-soft);
  font-size: 13px;
}
.auth-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.auth-btn:hover { border-color: var(--accent); color: var(--accent); }

.auth-delete-link {
  font-size: 11px;
  color: var(--ink-soft);
  opacity: 0.6;
}
.auth-delete-link:hover { opacity: 1; color: var(--ink); }

.site-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px 20px 32px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.site-footer a {
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-google-icon { flex-shrink: 0; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-input {
  font-family: var(--font);
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.auth-error { color: var(--ink); font-weight: 700; font-size: 12.5px; }
.auth-message { color: var(--ink-soft); font-size: 12.5px; }

/* ---------- login page (full page, not a corner popup) ---------- */

.login-main {
  min-height: calc(100vh - 57px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-title {
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 6px;
  text-align: center;
}

.login-card .ghost,
.login-card .back-link {
  text-align: center;
}

/* ---------- onboarding wizard (onboarding.html) ---------- */

.onboarding-main {
  min-height: calc(100vh - 57px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
}

.wizard-card {
  width: 100%;
  max-width: 540px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ob-back-btn {
  display: block;
  margin: 0 0 10px;
  align-self: flex-start;
}

.wizard-step-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.wizard-title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 4px;
}
.wizard-title-tight { margin-top: 18px; }

.wizard-title-small {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.wizard-sub {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.wizard-sub-italic {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-soft);
}

.wizard-card .auth-input,
.wizard-card .inline-edit-textarea {
  width: 100%;
}
.wizard-card .inline-edit-textarea { min-height: 90px; margin-top: 0; border-color: var(--line); }

/* info icon + hover/focus tooltip (used by the MVP question) */

.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--ink-soft);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
}
.info-icon .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  background: var(--ink);
  color: white;
  font-size: 12.5px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s;
  z-index: 30;
}
.info-icon:hover .tooltip,
.info-icon:focus .tooltip {
  opacity: 1;
  visibility: visible;
}

/* Q3: multiple-choice blocks */

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.choice-block {
  font-family: var(--font);
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  cursor: pointer;
}
.choice-block:hover { border-color: var(--accent); background: var(--accent-soft); }
.choice-block-selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* Q4: static example timeline illustration */

.example-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.example-timeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 14px;
}
.example-chip {
  background: #f0f0f0;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.example-arrow { color: var(--line); font-size: 13px; }

/* Q6: editable tree embedded in the wizard card */

.wizard-tree-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px 4px;
  margin: 4px 0 4px;
  max-height: 320px;
  overflow-y: auto;
}
.wizard-tree-wrap.editable {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.wizard-final-choices { flex-direction: column; }

/* ---------- landing page ---------- */

.landing-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 24px 100px;
  text-align: center;
}

.landing-hero h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 18px;
}

.landing-sub {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 32px;
}

.landing-cta {
  font-size: 15px;
  padding: 12px 28px;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 90px;
  text-align: left;
}

.legal-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}
.legal-main h1 { font-size: 28px; margin: 0 0 6px; }
.legal-main .legal-updated { color: var(--ink-soft); font-size: 13px; margin: 0 0 36px; }
.legal-main h2 { font-size: 17px; margin: 32px 0 10px; }
.legal-main p, .legal-main li { color: var(--ink-soft); font-size: 14.5px; line-height: 1.7; }
.legal-main ul { padding-left: 20px; margin: 8px 0; }
.legal-main a { color: var(--accent); }

@media (max-width: 700px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 30px; }
}

.landing-feature {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.landing-feature h3 { margin: 0 0 8px; font-size: 15px; }
.landing-feature p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.1fr);
  gap: 20px;
  height: calc(100vh - 57px);
  padding: 20px;
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; height: auto; }
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.panel-header h2 { margin: 0 0 4px; font-size: 16px; }
.panel-sub { margin: 0; font-size: 13px; color: var(--ink-soft); }

.mvp-note {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.mvp-note strong { color: var(--ink); }

.todo-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* Quick List Mode's outline editor — [Label] prefixes live inline in the
 * text itself (see resyncQuickListLabels in app.js), kept in sync on every
 * keystroke and Tab/Shift+Tab/Enter press. */
.quick-list-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.quick-list-editor:focus-within { border-color: var(--accent); }

/* Notepad-style dotted rule between rows — a radial-gradient dot grid
 * rather than per-row borders, since a <textarea> can't host those. */
.quick-list-textarea {
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1.5px);
  background-size: 6px 24px;
  background-position: 3px 23px;
  background-repeat: repeat;
}

/* [Label] prefixes live inline in the textarea's own text (see
 * resyncQuickListLabels in app.js) rather than in a separate sidebar
 * column — there's no gutter to style anymore. */
.quick-list-textarea {
  width: 100%;
  min-height: 360px;
  border: none;
  padding: 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 24px;
  color: var(--ink);
  white-space: pre;
  overflow-x: auto;
  overflow-y: auto;
  tab-size: 2;
  -moz-tab-size: 2;
  resize: vertical;
  box-sizing: border-box;
}
.quick-list-textarea:focus { outline: none; }

.empty-state {
  color: var(--ink-soft);
  font-size: 13px;
  padding: 30px 10px;
  text-align: center;
  line-height: 1.6;
}

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  background: var(--task-tag);
  padding: 2px 7px;
  border-radius: 5px;
}
/* Goal (depth 1) → Task → Component → Component₂ → Component₃ → Component₄ (depth 6, terminal) */
.tag.goal { background: var(--phase-tag); }
.tag.task { background: var(--task-tag); }
.tag.component { background: var(--focus-tag); }
.tag.component2 { background: var(--component-tag); }
.tag.component3 { background: var(--component2-tag); }
.tag.component4 { background: var(--component3-tag); }

ul.tree, ul.tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul.tree ul {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px dashed var(--line);
}

.tree li { margin: 6px 0; }

.node-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
}
.node-row:hover { background: #f7f7f7; }
.node-row[draggable="true"] { cursor: grab; }
.node-row.dragging { opacity: 0.35; }
.node-row.drag-over {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}

.row-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
  flex-shrink: 0;
}
.node-row:hover .row-actions,
.row-actions-static {
  opacity: 1;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 4px 5px;
  border-radius: 6px;
  color: var(--ink-soft);
}
.icon-btn:hover { background: #e5e5e5; color: var(--ink); }
.icon-btn { filter: grayscale(1); }

.inline-edit-input {
  width: 100%;
  font-family: var(--font);
  font-size: 13.5px;
  padding: 3px 6px;
  border: 1px solid var(--accent);
  border-radius: 6px;
}

.inline-edit-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  padding: 6px 8px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  margin-top: 6px;
  min-height: 60px;
  resize: vertical;
}

.checkbox-spacer { display: inline-block; width: 15px; flex-shrink: 0; }
.add-child-row { background: #f5f5f5; }

.dashboard-link {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: none;
}
.dashboard-link:hover { background: var(--accent); color: white; }

.node-row input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}

.node-text {
  font-size: 13.5px;
  line-height: 1.4;
  flex: 1;
}
.node-row.done .node-text { text-decoration: line-through; color: var(--ink-soft); }

.node-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.leaf-badge {
  font-size: 10px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 1px 6px;
  border-radius: 10px;
  filter: grayscale(1);
}

/* TO-DO PANEL — quick actions + inline action forms */
.todo-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.todo-actions-bar button {
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  cursor: pointer;
}
.todo-actions-bar button:hover { border-color: var(--accent); color: var(--accent); }

/* Phase selector — replaces the old inline phase-block. Single clipped
 * line by default; .has-overflow (JS-toggled, only when it genuinely
 * doesn't fit) adds a fade + arrow, and hovering it expands into an
 * overlay so every phase wraps onto as many lines as needed without
 * pushing the rest of the page down. */
.phase-selector-wrap {
  position: relative;
  margin-top: 10px;
}
.phase-selector {
  display: flex;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.phase-pill {
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.phase-pill:hover { border-color: var(--accent); color: var(--accent); }
.phase-pill.active { background: var(--accent); border-color: var(--accent); color: white; }

.phase-selector-wrap.has-overflow::after {
  content: '▸';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 6px 0 18px;
  background: linear-gradient(to right, transparent, var(--panel-bg) 55%);
  color: var(--ink-soft);
  pointer-events: none;
}
.phase-selector-wrap.has-overflow:hover {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.phase-selector-wrap.has-overflow:hover .phase-selector {
  flex-wrap: wrap;
  overflow: visible;
  white-space: normal;
}
.phase-selector-wrap.has-overflow:hover::after { display: none; }

.todo-action-area {
  border-top: 1px solid var(--line);
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.todo-action-area:empty { display: none; }

/* Plan Simplifier's read-only/editable tree preview (round questions, the
 * condense screen) — contained and scrollable so a deep breakdown doesn't
 * push the Continue/Cancel buttons off-screen. */
.ps-preview {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.action-prompt {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

/* DEADLINES */
.deadline-badge {
  font-size: 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 10px;
}
.date-fields { display: inline-flex; align-items: center; gap: 2px; }
.date-field {
  width: 28px;
  font-family: var(--font);
  font-size: 12px;
  text-align: center;
  padding: 2px 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.date-field-year { width: 42px; }
.date-sep { color: var(--ink-soft); font-size: 11px; }

/* CALENDAR (app.html right panel + dashboard.html) */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
.calendar-month-label { font-size: 13.5px; font-weight: 600; }

.calendar-container { padding: 12px 18px 20px; overflow-y: auto; flex: 1; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-weekday {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  padding-bottom: 4px;
}
.calendar-cell {
  position: relative;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  overflow: hidden;
}
.calendar-cell.empty { border-color: transparent; }
.calendar-cell.today { border-color: var(--current-green); background: var(--current-green-soft); }
.calendar-cell.drag-over {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}
.calendar-cell-date { font-size: 11px; color: var(--ink-soft); margin-bottom: 2px; }

/* Hovering a day with 2+ deadlines expands it into a taller overlay showing
 * every task in full — the collapsed view only ever shows 3 chips plus a
 * "+N more" count, which isn't enough to actually read a busy day. The
 * overlay sits on top of the grid (absolute, no reflow of neighboring
 * cells) rather than growing the grid cell itself. */
.calendar-cell-expanded { display: none; }
.calendar-cell.has-multiple:hover {
  overflow: visible;
}
.calendar-cell.has-multiple:hover .calendar-cell-expanded {
  display: block;
  position: absolute;
  top: -1px;
  left: -1px;
  z-index: 30;
  min-width: calc(100% + 2px);
  width: max-content;
  max-width: 240px;
  background: var(--panel-bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.calendar-cell.has-multiple:hover .calendar-cell-chips { visibility: hidden; }
.calendar-cell-expanded-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.calendar-cell-expanded .calendar-task-chip .chip-text {
  white-space: normal;
  overflow-wrap: break-word;
}

.calendar-task-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  font-size: 10.5px;
  border-radius: 5px;
  padding: 1px 3px 1px 4px;
  margin-bottom: 2px;
  cursor: grab;
}
.calendar-task-chip.dragging { opacity: 0.35; }
.chip-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chip-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 0 1px;
  flex-shrink: 0;
  opacity: 0;
}
.calendar-task-chip:hover .chip-delete { opacity: 0.7; }
.chip-delete:hover { opacity: 1 !important; }
/* Greyscale hierarchy: phase (bold, darkest) → task → sub-task (lightest). */
.calendar-chip-phase { background: var(--ink); color: white; font-weight: 700; }
.calendar-chip-task { background: var(--accent-soft); color: var(--ink); }
.calendar-chip-subtask { background: #f2f2f2; color: var(--ink-soft); }
.calendar-more { font-size: 10px; color: var(--ink-soft); }

.field-row { display: flex; gap: 8px; }
.field-row input[type="text"], .field-row textarea {
  flex: 1;
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
}
.field-row textarea { min-height: 70px; }

.multi-input-list { display: flex; flex-direction: column; gap: 8px; }
.multi-input-row { display: flex; gap: 6px; align-items: center; }
.multi-input-row input[type="text"] {
  flex: 1;
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.multi-input-row .remove-row {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
}
.multi-input-row .remove-row:disabled { opacity: 0.25; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

button.primary, button.secondary, button.ghost, button.option-btn {
  font-family: var(--font);
  cursor: pointer;
  border-radius: 10px;
  font-size: 13.5px;
  padding: 9px 16px;
  border: 1px solid transparent;
}
button.primary { background: var(--accent); color: white; }
button.primary:hover { background: #333333; }
button.primary:disabled { background: #cccccc; cursor: not-allowed; }

button.secondary { background: white; border-color: var(--line); color: var(--ink); }
button.secondary:hover { border-color: var(--accent); color: var(--accent); }

button.ghost { background: none; border: none; color: var(--ink-soft); text-decoration: underline; padding: 4px 2px; }

button.option-btn {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}
button.option-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

.add-more-btn {
  align-self: flex-start;
  background: none;
  border: 1px dashed var(--line);
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}
.add-more-btn:hover { border-color: var(--accent); color: var(--accent); }

.breadcrumb-hint {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: -2px;
}

/* ================= DASHBOARD ================= */

.back-link {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: none;
}
.back-link:hover { background: var(--accent); color: white; }

.dashboard-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- timeline --- */

.timeline-panel {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  overflow-x: auto;
}
.timeline-panel h2 { margin: 0 0 2px; font-size: 16px; }
.timeline-panel .panel-sub { margin: 0 0 18px; font-size: 13px; color: var(--ink-soft); }

.timeline-row {
  display: flex;
  align-items: stretch;
  min-width: max-content;
}

.timeline-connector {
  width: 26px;
  flex-shrink: 0;
  align-self: center;
  height: 2px;
  background: var(--line);
}

.timeline-box {
  position: relative;
  min-width: 160px;
  max-width: 220px;
  background: white;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  flex-shrink: 0;
}
.timeline-box:hover { border-color: #b5b5b5; }
.timeline-box.current {
  border-color: var(--current-green);
  background: var(--current-green-soft);
}
.timeline-box[draggable="true"] { cursor: grab; }
.timeline-box.dragging { opacity: 0.35; }
.timeline-box.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }

.timeline-box-index {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
}
.timeline-box.current .timeline-box-index { color: var(--current-green); }

.timeline-box-text {
  font-size: 13.5px;
  line-height: 1.4;
  margin-top: 4px;
  cursor: pointer;
}

.timeline-box .row-actions { position: absolute; top: 4px; right: 4px; }

.timeline-current-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--current-green);
}

.timeline-add-box {
  flex-shrink: 0;
  min-width: 46px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: none;
  color: var(--ink-soft);
  font-size: 20px;
  cursor: pointer;
  align-self: stretch;
}
.timeline-add-box:hover { border-color: var(--accent); color: var(--accent); }

/* --- split bottom section --- */

.dashboard-split {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .dashboard-split { grid-template-columns: 1fr; }
}

.ideas-panel .panel-header, .todo-dash-panel .panel-header { padding: 18px 20px 14px; }

/* Fixed, matching height for both boxes — the panels differ in surrounding
 * content (todo-dash-panel has an extra phase-switcher row), so capping
 * just the inner scrollable lists to the same max-height isn't enough to
 * make the two outer boxes line up; this pins the box itself instead, and
 * the scrollable areas below (flex: 1) absorb whatever space is left. */
.ideas-panel, .todo-dash-panel { height: 420px; }

.idea-input-row { display: flex; gap: 8px; padding: 0 20px 14px; }
.idea-input-row input {
  flex: 1;
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ideas-list { padding: 0 20px 20px; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

.idea-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  cursor: grab;
}
.idea-card:hover { border-color: var(--accent); }
.idea-card.dragging { opacity: 0.35; }
.idea-card .icon-btn { opacity: 0; }
.idea-card:hover .icon-btn { opacity: 1; }

.phase-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #f7f7f7;
}
.phase-switcher button {
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phase-switcher button:hover { border-color: var(--accent); color: var(--accent); }
.phase-switcher button.active { background: var(--accent); border-color: var(--accent); color: white; }

.todo-dash-body {
  padding: 16px 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  transition: background 0.1s, outline 0.1s;
  border-radius: 0 0 var(--radius) var(--radius);
}
.todo-dash-body.drop-hover {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.add-task-inline-row { display: flex; gap: 8px; padding: 4px 20px 18px; }
.add-task-inline-row input {
  flex: 1;
  font-family: var(--font);
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* ---------- custom center-screen modal (shared.js's showInfoModal) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.modal-box {
  background: var(--panel-bg);
  border-radius: var(--radius);
  padding: 24px 26px;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-box p {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.modal-btn-row {
  justify-content: center;
}

/* ---------- right-panel tab system (app.html) ---------- */

.right-panel {
  padding: 0;
}

.tab-bar-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px 0;
  background: #ececec;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.tab-strip {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

/* Browser-tab styling — rounded top corners, recessed/darker when
 * inactive, raised and matching the panel background when active. No
 * close (x) button by design — removing a tab only happens via Add-ons. */
.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: #dcdcdc;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}
.tab-btn:hover { background: #e7e7e7; color: var(--ink); }
.tab-btn.active {
  background: var(--panel-bg);
  color: var(--ink);
  position: relative;
  top: 1px;
}
.tab-icon { font-size: 13px; filter: grayscale(1); }

.addons-btn {
  flex-shrink: 0;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink-soft);
  cursor: pointer;
}
.addons-btn:hover { border-color: var(--accent); color: var(--accent); }

.tab-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.tab-content .panel-header { flex-shrink: 0; }

/* ---------- Add-ons sliding panel ---------- */

.addons-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1500;
}

.addons-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 90vw;
  background: var(--panel-bg);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  padding: 20px;
  transform: translateX(0);
  animation: addons-slide-in 0.2s ease-out;
}
@keyframes addons-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.addons-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.addons-panel-header h3 { margin: 0; font-size: 17px; }
.addons-panel-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.addons-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.addon-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.addon-item:hover { background: #f5f5f5; }
.addon-item.locked { cursor: not-allowed; opacity: 0.5; }
.addon-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.addon-item-icon { font-size: 16px; filter: grayscale(1); }
.addon-item-label { font-size: 13.5px; font-weight: 600; }
.addon-item-desc { font-size: 11.5px; color: var(--ink-soft); margin-top: 1px; }

.addons-locked-note {
  font-size: 12px;
  color: var(--ink-soft);
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Hover-video preview (see startAddonHoverPreview in app.js) — plays a
 * short clip from assets/addon-previews/<key>.mp4 while hovering an
 * add-on row, if that file exists; silently does nothing otherwise. */
.addon-preview-video {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  width: 220px;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 10;
  background: black;
}

/* ---------- mini Dashboard tab ---------- */

.mini-timeline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0 18px;
}
.mini-timeline-box {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
}
.mini-timeline-box:hover { border-color: var(--accent); }
.mini-timeline-box.current { border-color: var(--current-green); background: var(--current-green-soft); color: var(--current-green); }
.mini-timeline-arrow { color: var(--line); }

/* ---------- mobile notice ---------- */

.mobile-notice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
  padding: 20px;
}
.mobile-notice-overlay .modal-box { max-width: 320px; }
