@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #faf9f7;
  --bg-card: #ffffff;
  --bg-hover: #f4f2ef;
  --bg-elevated: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --text-faint: #bbbbbb;
  --border: #eae8e4;
  --border-hover: #d0cdc9;
  --space-xs: 0.5rem;
  --space-s: 0.75rem;
  --space-m: 1.25rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-xxl: 4rem;
  --radius: 10px;
  --radius-lg: 16px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.02);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 0 1px color-mix(in srgb, var(--area-primary, #6B8AAE) 10%, transparent);

  --agency: #6B8AAE;
  --agency-bg: color-mix(in srgb, var(--agency) 3%, transparent);
  --agency-bg-solid: color-mix(in srgb, var(--agency) 5%, var(--bg));
  --stage: #C4875A;
  --stage-bg: color-mix(in srgb, var(--stage) 3%, transparent);
  --stage-bg-solid: color-mix(in srgb, var(--stage) 5%, var(--bg));
  --studio: #7B6B9E;
  --studio-bg: color-mix(in srgb, var(--studio) 3%, transparent);
  --studio-bg-solid: color-mix(in srgb, var(--studio) 5%, var(--bg));
  --backstage: #8A9A6B;
  --backstage-bg: color-mix(in srgb, var(--backstage) 3%, transparent);
  --backstage-bg-solid: color-mix(in srgb, var(--backstage) 5%, var(--bg));
  --overdue: #c89050;

  --status-kept: #8899aa;
  --status-parked: #666666;
}

[data-theme="dark"] {
  --bg: #0c0c0c;
  --bg-card: #151515;
  --bg-hover: #1e1e1e;
  --bg-elevated: #1a1a1a;
  --text: #e8e6e3;
  --text-secondary: #aaaaaa;
  --text-muted: #666666;
  --text-faint: #333333;
  --border: #222222;
  --border-hover: #333333;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px rgba(107, 138, 174, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  transition: background 0.3s ease, color 0.3s ease;
  min-block-size: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Fade-in animation ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.animate-in {
  animation: fadeUp 0.4s ease both;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }

/* ── Layout ── */
.container {
  max-inline-size: 1120px;
  margin: 0 auto;
  padding: var(--space-m) var(--space-l) var(--space-xxl);
}

/* ── Header ── */
header {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  align-items: start;
  padding-block-end: var(--space-s);
  animation: fadeIn 0.6s ease both;
}


.header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-title-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-s);
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.header-greeting {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: end;
  justify-content: space-between;
  justify-self: end;
  block-size: 100%;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: var(--space-s);
}

.date {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 400;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.75rem;
  font-family: var(--font);
}

.theme-toggle:hover {
  border-color: var(--text-muted);
  color: var(--text);
  transform: scale(1.05);
}

/* ── Main Grid ── */
.main-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  margin-block-end: var(--space-l);
}

.main-grid-full { /* kept for compat */ }

/* ── Section ── */
.section-header {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-block-end: var(--space-s);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block-end: 6px;
  border-block-end: 1px solid var(--border);
}

.section-count {
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0;
}

/* ── Timeline (unified calendar + tasks) ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.timeline-day {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 0;
  position: relative;
}

.timeline-day + .timeline-day { margin-block-start: 4px; }

.timeline-day {
  animation: fadeUp 0.35s ease both;
}
.timeline-day:nth-child(1) { animation-delay: 0.05s; }
.timeline-day:nth-child(2) { animation-delay: 0.1s; }
.timeline-day:nth-child(3) { animation-delay: 0.15s; }
.timeline-day:nth-child(4) { animation-delay: 0.2s; }
.timeline-day:nth-child(5) { animation-delay: 0.25s; }
.timeline-day:nth-child(6) { animation-delay: 0.3s; }
.timeline-day:nth-child(7) { animation-delay: 0.35s; }

/* ── Spine (center column) ── */
.timeline-spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.timeline-spine::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-block-end: 0;
  inline-size: 1px;
  background: var(--border);
  block-size: 100%;
}

.timeline-day:first-child .timeline-spine::before { inset-block-start: 14px; }
.timeline-day:last-child .timeline-spine::before { inset-block-end: 0; }
.timeline-day:only-child .timeline-spine::before { display: none; }

.timeline {
  padding-block-end: var(--space-s);
}

.timeline-dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--border-hover);
  position: relative;
  z-index: 2;
  margin-block-start: 14px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.timeline-dot.is-today {
  inline-size: 9px;
  block-size: 9px;
  background: var(--text-secondary);
  box-shadow: 0 0 12px rgba(0,0,0,0.08);
}

.timeline-day-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  writing-mode: horizontal-tb;
  white-space: nowrap;
  margin-block-start: 6px;
  font-family: var(--font-mono);
}

.timeline-day-label.is-today { color: var(--text-secondary); font-weight: 700; }

.timeline-day.is-today-row {
  border-radius: var(--radius);
  padding-block-end: var(--space-m);
  margin-block-end: var(--space-s);
  border-block-end: 1px solid var(--border);
}

/* ── Left lane (calendar events) ── */
.timeline-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px var(--space-s) 6px 0;
  align-items: stretch;
}

.tl-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px var(--space-s);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
  inline-size: 100%;
  flex-direction: row;
  min-block-size: 42px;
}

.tl-card.is-now {
  border-color: var(--border-hover);
}

.tl-card.is-overdue .tl-meta { color: var(--text-error, #c44); }
.tl-card.is-past {
  opacity: 0.15;
  transition: opacity 0.2s;
}

.tl-card.is-past:hover {
  opacity: 0.6;
}

.tl-card.tl-dimmed {
  opacity: 0.35;
  transition: opacity 0.15s ease;
}
.tl-card.tl-dimmed:hover {
  opacity: 1;
}

.tl-bar {
  inline-size: 3px;
  align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
  order: 1;
}

.tl-content {
  flex: 1;
  min-inline-size: 0;
  display: flex;
  align-items: center;
  order: 2;
}

.tl-meta {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  text-align: end;
  font-weight: 500;
  line-height: 1.15;
  flex-shrink: 0;
  order: 3;
  letter-spacing: -0.02em;
}

.tl-title { flex: 1; font-weight: 500; text-align: start; }

/* ── Right lane (tasks) ── */
.timeline-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0 6px var(--space-s);
  min-inline-size: 0;
  overflow: hidden;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-group-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--space-xs) 0 2px 0;
  margin-block-start: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.task-group-label:first-child { margin-block-start: 0; }
.task-group-label.overdue { color: var(--text-muted); }

.task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px var(--space-s);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  min-block-size: 42px;
}

.task.overdue { border-color: var(--border-hover); }

/* ── Timeline section headers ── */
.timeline-header {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 0;
  margin-block-end: 4px;
}

.timeline-header-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding-block-end: 6px;
  border-block-end: 1px solid var(--border);
}

.timeline-header-left {
  text-align: end;
  padding-inline-end: var(--space-s);
  opacity: 0.5;
}

.timeline-header-right {
  padding-inline-start: var(--space-s);
}

.timeline-header-center {
  border-block-end: 1px solid var(--border);
}

/* ── Mobile day label (hidden on desktop) ── */
.timeline-mobile-label {
  display: none;
}

/* ── Empty lane placeholder ── */
.timeline-empty {
  min-block-size: 36px;
}


.task-area {
  inline-size: var(--task-bar-width, 3px);
  block-size: 24px;
  border-radius: 2px;
  flex-shrink: 0;
  transition: inline-size 0.3s ease;
}

.task-content { flex: 1; min-inline-size: 0; }

.task-title {
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  min-inline-size: 0;
  overflow: hidden;
}

.task-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-inline-size: 0;
}

.task-tags-inline {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-inline-start: 6px;
  vertical-align: middle;
}

.task-meta {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-block-start: 2px;
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  flex-wrap: wrap;
}

.task-tag {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.task-tag.high { color: var(--text-muted); background: var(--bg); }
.task-tag.urgent { color: var(--text-secondary); font-weight: 500; background: var(--bg); }

.task-due {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Date label styles */
.task-due.due-date { color: var(--text-muted); font-weight: 500; }
.task-due.overdue { color: var(--text-secondary); font-weight: 600; }
.task-due.on-date { color: var(--text-muted); }
.task-due.available { color: var(--text-muted); font-style: italic; }
.task-due.pending-from { color: var(--text-muted); font-style: italic; }

/* Whole-card dimming by date type */
.task.type-due { opacity: 1; }
.task.type-on { opacity: 0.55; transition: opacity 0.15s ease; }
.task.type-from { opacity: 0.4; transition: opacity 0.15s ease; }
.task.type-on:hover, .task.type-from:hover { opacity: 1; }
.task.overdue { opacity: 1; }

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-s);
}

.area-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-m) var(--space-m) var(--space-s);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.area-group::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  inline-size: var(--glow-width, 40%);
  block-size: 1.5px;
  border-radius: 0 0 2px 2px;
  background: var(--area-color, var(--border));
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--area-color, var(--border)) 25%, transparent);
}

/* no hover on non-clickable area groups */

.area-group-header {
  font-size: 0.7rem;
  font-weight: 600;
  margin-block-end: var(--space-s);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.area-group-count {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-inline-start: auto;
  font-weight: 400;
}

/* Status group labels inside area groups */
.status-group-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 6px 2px;
  margin-block-start: 4px;
}

.status-group-label:first-of-type { margin-block-start: 0; }

.project-item {
  font-size: 0.8rem;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
  border-radius: 6px;
  position: relative;
}

.project-item.clickable {
  cursor: pointer;
  transition: all 0.12s ease;
}

.project-item.clickable:hover {
  background: color-mix(in srgb, var(--area-color, var(--border)) 8%, transparent);
  transform: translateX(3px);
}

.project-item.has-notes .notes-hint {
  color: var(--text-faint);
  font-size: 0.6rem;
  margin-inline-start: 2px;
  transition: color 0.15s ease;
  user-select: none;
}

.project-item.has-notes:hover .notes-hint {
  color: var(--text-muted);
}

.project-status {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-status:hover {
  transform: scale(2);
  transition: transform 0.15s;
}

.project-status.live {
  background: var(--area-color, var(--agency));
  box-shadow: none;
}
.project-status.kept { background: var(--status-kept); }
.project-status.parked { background: var(--status-parked); opacity: 0.4; }
.project-status { cursor: pointer; position: relative; }

.status-picker {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 0;
  margin: 2px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  min-inline-size: 70px;
}
.project-item.dimmed { opacity: 0.25; pointer-events: none; }
.status-picker-option {
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 450;
  letter-spacing: 0.02em;
  transition: background 0.1s;
}
.status-picker-option:first-child { border-radius: 7px 7px 0 0; }
.status-picker-option:last-child { border-radius: 0 0 7px 7px; }
.status-picker-option:hover { background: var(--bg-hover); }
.status-picker-option.active { font-weight: 600; }
.status-picker-option.s-live { color: var(--area-color, var(--agency)); }
.status-picker-option.s-kept { color: var(--status-kept); }
.status-picker-option.s-parked { color: var(--text-muted); opacity: 0.7; }

.project-name { flex: 1; font-weight: 450; }
.project-name-live { font-weight: 550; }
.project-name-parked { color: var(--text-muted); font-weight: 400; }

.parked-footer {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-xs) 0 0;
  opacity: 0.4;
  font-family: var(--font-mono);
  margin-block-start: auto;
}

/* ── Bite: create project button ── */
.area-bite {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  inline-size: 48px;
  block-size: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, transparent 50%, color-mix(in srgb, var(--area-color) 6%, var(--bg-card)) 50%);
  border-radius: 0 0 var(--radius-lg) 0;
  transition: all 0.25s ease;
  z-index: 2;
}

.area-bite-icon {
  opacity: 0;
  font-size: 1rem;
  color: var(--area-color);
  font-weight: 300;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translate(6px, 6px);
}

.area-bite:hover {
  inline-size: 64px;
  block-size: 64px;
  background: linear-gradient(135deg, transparent 40%, color-mix(in srgb, var(--area-color) 10%, var(--bg-card)) 40%);
}

.area-bite:hover .area-bite-icon {
  opacity: 1;
  transform: translate(8px, 8px);
}

.area-bite-input {
  display: block;
  width: 100%;
  padding: 5px 8px;
  font-size: 0.8rem;
  font-weight: 450;
  font-family: var(--font);
  background: none;
  border: none;
  border-bottom: 1px solid var(--area-color, var(--border));
  color: var(--text);
  outline: none;
  margin-block-start: var(--space-xs);
}

.task-title-edit {
  background: none;
  border: none;
  outline: none;
  font: inherit;
  color: inherit;
  inline-size: 100%;
  padding: 0;
  margin: 0;
}

@keyframes refreshPulse {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}
.refreshing #projectsGrid,
.refreshing #timelineContainer {
  animation: refreshPulse 0.4s ease-out;
}

.orbit-bar {
  text-align: center;
  justify-self: center;
}
.orbit-pill {
  display: inline-block;
  inline-size: 54px;
  block-size: 6px;
  border-radius: 3px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s ease;
}
.orbit-pill:hover {
  inline-size: 60px;
  block-size: 10px;
  border-radius: 5px;
  border-color: var(--text-muted);
  box-shadow: 0 0 6px rgba(255,255,255,0.04);
}
.orbit-pill-empty {
  padding: 0;
  inline-size: 40px;
}
.orbit-items {
  margin-block-start: var(--space-xs);
  margin-block-end: var(--space-s);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.orbit-age {
  font-size: 0.68rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.project-name-kept { color: var(--text-secondary); font-weight: 400; }

/* Routine checklist */
.routine-footer {
  padding: 8px 8px 8px;
  font-size: 0.75rem;
  font-family: var(--font);
  color: var(--text);
  border-block-end: 1px solid var(--border);
  margin-block-end: 4px;
}
.routine-block { display: block; padding: 3px 0; }
.routine-progress {
  letter-spacing: 1px;
  font-size: 0.55rem;
  color: var(--area-color, var(--text-muted));
  margin-block-start: 0;
  line-height: 1;
}
.routine-name { cursor: pointer; opacity: 0.85; font-weight: 500; transition: opacity 0.15s; }
.routine-name:hover { opacity: 1; }
.routine-checklist {
  display: block;
  padding: 6px 0 4px 4px;
  font-size: 0.65rem;
  color: var(--text-secondary);
}
.routine-step {
  padding: 3px 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.routine-step:hover { opacity: 0.9; }
.routine-step-done {
  text-decoration: line-through;
  opacity: 0.3;
}
.routine-check {
  font-size: 0.7rem;
  margin-inline-end: 2px;
}

.project-task-count {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-item:hover .project-task-count {
  opacity: 1;
}

/* ── Notes Panel (slide-over) ── */
.notes-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.notes-overlay.open {
  opacity: 1;
  visibility: visible;
}

.notes-panel {
  position: fixed;
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: min(700px, 88vw);
  block-size: 100vh;
  background: var(--bg);
  border-inline-start: 1px solid var(--border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-panel.open {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

.notes-panel-header {
  padding: var(--space-m) var(--space-l);
  border-block-end: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.notes-panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}

.notes-panel-area {
  inline-size: 3px;
  block-size: 24px;
  border-radius: 2px;
  flex-shrink: 0;
}

.notes-panel-meta {
  display: flex;
  align-items: center;
  gap: var(--space-s);
}

.notes-open-folder {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.notes-open-folder:hover {
  border-color: var(--text-muted);
  color: var(--text);
  background: var(--bg-hover);
}

.notes-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  transition: all 0.15s ease;
  font-weight: 500;
}

.notes-close:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.notes-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 var(--space-l);
  border-block-end: 1px solid var(--border);
  flex-shrink: 0;
}
.notes-tabs .note-edit-btn {
  margin-inline-start: auto;
}

.notes-tab {
  padding: var(--space-s) var(--space-m);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-block-end: 2px solid transparent;
  transition: all 0.15s ease;
  background: none;
  border-block-start: none;
  border-inline-start: none;
  border-inline-end: none;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notes-tab:hover { color: var(--text); }
.notes-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.notes-tab.is-empty {
  opacity: 0.3;
}
.notes-tab.is-empty:hover {
  opacity: 0.6;
}
.notes-tab.is-empty.active {
  opacity: 0.5;
}

/* ── Empty tab create prompt ── */
.empty-tab-create {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  padding: var(--space-xl) var(--space-l);
  color: var(--text-muted);
}

.empty-tab-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.empty-tab-btn {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.empty-tab-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
  background: var(--bg-hover);
}

.loose-create-row {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}
.loose-create-top {
  margin-block-end: var(--space-m);
}
.loose-create-input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  outline: none;
  box-sizing: border-box;
}
.loose-create-input:focus { border-color: var(--text-muted); }

.empty-tab-hint {
  font-size: 0.65rem;
  color: var(--text-faint);
  font-style: italic;
}

.notes-tab.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.notes-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-l);
}

/* ── Markdown Rendering ── */
.md-content {
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text);
}

.md-content h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 var(--space-s) 0;
  letter-spacing: -0.03em;
  border-block-end: 1px solid var(--border);
  padding-block-end: var(--space-xs);
}

.md-content h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: var(--space-l) 0 var(--space-xs) 0;
  letter-spacing: -0.01em;
  color: var(--text);
}

.md-content h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: var(--space-m) 0 var(--space-xs) 0;
  color: var(--text-secondary);
}

.md-content p {
  margin-block-end: var(--space-s);
  color: var(--text-secondary);
}

.md-content ul, .md-content ol {
  margin: 0 0 var(--space-s) var(--space-m);
}

.md-content li {
  margin-block-end: 3px;
  color: var(--text-secondary);
}

.md-content code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
}

.md-content pre {
  background: var(--bg-hover);
  padding: var(--space-m);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-block-end: var(--space-s);
  border: 1px solid var(--border);
}

.md-content pre code {
  background: none;
  padding: 0;
}

.md-content a {
  color: var(--area-primary, #6B8AAE);
  text-decoration: none;
  border-block-end: 1px solid transparent;
  transition: border-color 0.15s;
}

.md-content a:hover { border-bottom-color: var(--area-primary, #6B8AAE); }

.md-content strong { font-weight: 600; color: var(--text); }

.md-content blockquote {
  border-inline-start: 3px solid var(--border);
  padding-inline-start: var(--space-s);
  color: var(--text-muted);
  margin-block-end: var(--space-s);
  font-style: italic;
}

.md-content hr {
  border: none;
  border-block-start: 1px solid var(--border);
  margin: var(--space-l) 0;
}

/* ── Tasks View ── */
.tasks-view { padding: 0; }

.tasks-view { --task-text-offset: 36px; }
.tasks-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tasks-list .tasks-list {
  margin-inline-start: 20px;
  padding: 0;
}

.task-children {
  overflow: hidden;
}

.task-children.collapsed {
  display: none;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 4px;
  margin: 0 -4px;
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  transition: opacity 0.3s ease, background 0.12s ease;
}
.task-item:hover { background: rgba(0,0,0,0.03); }
[data-theme="dark"] .task-item:hover { background: rgba(255,255,255,0.04); }

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-muted);
  opacity: 0.5;
}

.task-item.completing {
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.task-checkbox {
  flex-shrink: 0;
  inline-size: 14px;
  block-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  margin-block-start: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.task-checkbox:hover {
  border-color: var(--text-secondary);
}

.task-checkbox.checked {
  background: var(--border);
  color: var(--bg);
}

.task-checkbox.checked::after { content: '\2713'; }

.task-toggle {
  flex-shrink: 0;
  inline-size: 14px;
  block-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-block-start: 3px;
  transition: transform 0.15s ease;
  user-select: none;
}

.task-toggle.collapsed { transform: rotate(-90deg); }

.task-text { flex: 1; }

.task-text strong { color: var(--text); }
.task-text em { font-style: italic; }
.task-text code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-hover);
  padding: 1px 4px;
  border-radius: 3px;
}

.task-note {
  margin-left: 42px;
  padding: 2px 0 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Completed section reveal bar */
.tasks-section-heading {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 12px 0 4px;
}

.tasks-completed-bar {
  position: relative;
  block-size: 1px;
  background: var(--border);
  margin: 16px 0 6px;
  cursor: pointer;
}

.tasks-completed-bar::after {
  content: '';
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  transform: translate(-50%, -50%);
  inline-size: 40px;
  block-size: 14px;
  border-radius: 7px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}

.tasks-completed-bar:hover::after {
  inline-size: 54px;
  border-color: var(--text-muted);
  box-shadow: 0 0 6px rgba(255,255,255,0.04);
}

.tasks-completed-section {
  overflow: hidden;
  max-block-size: 0;
  opacity: 0;
  transition: max-block-size 0.35s ease, opacity 0.25s ease;
}

.tasks-completed-section.open {
  max-block-size: 2000px;
  opacity: 1;
}

/* ── Loose Notes List ── */
.loose-notes-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.loose-note-item {
  padding: 8px var(--space-s);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.loose-note-item:hover {
  border-color: var(--border-hover);
  transform: translateX(3px);
}

.loose-note-item .icon {
  color: var(--text-muted);
  font-size: 0.7rem;
  inline-size: 16px;
  text-align: center;
}

.loose-note-back {
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-block-end: var(--space-s);
  border: none;
  background: none;
  font-family: var(--font);
  padding: 4px 0;
  transition: color 0.15s;
}

.loose-note-back:hover { color: var(--text); }

.loose-tree-dir {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 6px var(--space-s);
  letter-spacing: 0.02em;
  user-select: none;
  cursor: pointer;
}
.loose-tree-dir:hover { color: var(--text); }
.loose-dir-arrow {
  display: inline-block;
  font-size: 0.55rem;
  transition: transform 0.15s ease;
}
.loose-tree-dir.open .loose-dir-arrow {
  transform: rotate(90deg);
}
.loose-dir-children.collapsed { display: none; }

/* ── Task completion (visual/localStorage) ── */
.task.locally-completed { opacity: 0; block-size: 0; padding: 0; margin: 0; border: none; overflow: hidden; pointer-events: none; transition: opacity 0.4s ease, block-size 0.4s ease, padding 0.4s ease, margin 0.4s ease; }
.task.locally-completed .task-title { text-decoration: line-through; }
.task.pending-complete .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-check-slot {
  inline-size: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-check {
  cursor: pointer;
  color: var(--text-faint);
  font-size: 0.85rem;
  transition: color 0.15s, transform 0.15s;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
  inline-size: 20px;
  block-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.task-check:hover { color: var(--text-secondary); transform: scale(1.15); background: var(--bg-hover); }
.task-check.checked { color: var(--text-muted); }
.task-countdown {
  position: absolute;
  inset-block-start: -8px;
  inset-inline-end: -8px;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  animation: countdownPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: transform 0.15s ease, border-color 0.3s ease;
}

.task-countdown.pulse {
  animation: countdownPulse 0.4s ease;
}

@keyframes countdownPop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes countdownPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.sync-hint {
  font-size: 0.55rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  text-align: end;
  padding-block-start: var(--space-xs);
  animation: fadeIn 0.4s ease;
}

/* ── Balance bar ── */
.balance-bar {
  display: flex;
  gap: 3px;
  block-size: 4px;
  margin-block-end: var(--space-m);
  animation: fadeIn 0.6s ease both;
  animation-delay: 0.1s;
}

.balance-segment {
  border-radius: 2px;
  transition: flex 0.4s ease;
}

/* ── Empty state ── */
.empty {
  padding: var(--space-l);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  font-style: italic;
}

/* ── Empty area cards with color-coded dashed border ── */
.area-group.empty-area {
  border-color: var(--area-color, var(--border));
  border-style: dashed;
}

.area-group.empty-area .empty-dots {
  font-size: 1.2rem;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  text-align: center;
  padding: var(--space-l);
}

/* ── Footer ── */
footer {
  margin-block-start: var(--space-xl);
  padding-block-start: var(--space-m);
  border-block-start: 1px solid var(--border);
  font-size: 0.6rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  animation: fadeIn 0.8s ease both;
  animation-delay: 0.5s;
}

/* ── Keyboard hint ── */
.kbd-hint {
  position: fixed;
  inset-block-end: var(--space-m);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  pointer-events: none;
  opacity: 0.5;
  letter-spacing: 0.02em;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .container { padding: var(--space-m); }
  .projects-grid { grid-template-columns: 1fr; }
  .notes-panel, .north-panel { inline-size: 100vw !important; }
  .tl-title { font-size: 0.75rem; }
  .task-title { font-size: 0.75rem; }

  /* Timeline: stack vertically on mobile */
  .timeline-header { display: none; }
  .timeline-day {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-s) 0;
    border-block-end: 1px solid var(--border);
  }
  .timeline-day + .timeline-day { margin-block-start: 0; }
  .timeline-spine { display: none; }
  .timeline-left { padding: 0; }
  .timeline-right { padding: 0; }
  .timeline-empty { display: none; min-block-size: 0; }

  /* Mobile day label */
  .timeline-mobile-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: var(--font-mono);
    padding-block-end: 2px;
  }
  .timeline-mobile-label.is-today { color: var(--text-secondary); }
}

/* ── Scrollbar ── */
.notes-body::-webkit-scrollbar { inline-size: 6px; }
.notes-body::-webkit-scrollbar-track { background: transparent; }
.notes-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.notes-body::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── FAB (Floating Action Button) ── */
.fab {
  position: fixed;
  inset-block-end: 0;
  inset-inline-end: 0;
  inline-size: 72px;
  block-size: 72px;
  background: linear-gradient(135deg, transparent 40%, var(--text) 40%);
  border: none;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.25s ease;
  border-radius: 0;
}
.fab span {
  opacity: 1;
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--bg);
  transform: translate(8px, 8px);
}
.fab:hover {
  inline-size: 78px;
  block-size: 78px;
}
.fab:hover span {
  transform: translate(6px, 6px);
}
.fab:active { transform: scale(0.95); }
.fab.cmd-open {
  inline-size: 48px;
  block-size: 48px;
  z-index: 1002;
  pointer-events: none;
}
.fab.cmd-open span { opacity: 0; }

/* ── Command Bar ── */
.cmd-bar {
  position: fixed;
  inset-block-end: 0;
  inset-inline-end: 0;
  inline-size: min(500px, calc(100vw - var(--space-l)));
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-m) 48px var(--space-m) var(--space-l);
  background: var(--text);
  border-radius: 0;
  clip-path: polygon(28px 0, 100% 0, 100% 100%, 0 100%, 0 28px);
  z-index: 1001;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15), 0 -2px 10px rgba(0,0,0,0.08);
}
.cmd-bar.open { transform: translateY(0); opacity: 1; }
.cmd-bar .at-autocomplete {
  inset-block-start: auto;
  inset-block-end: 100%;
  margin-block-start: 0;
  margin-block-end: 4px;
  background: var(--bg-card);
}
.cmd-tasks-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bg);
  opacity: 0.5;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.cmd-tasks-btn:hover { opacity: 1; }
.cmd-input-wrap {
  flex: 1;
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  min-inline-size: 0;
}
.cmd-bar input {
  flex: 1;
  min-inline-size: 0;
  background: transparent;
  border: none;
  color: var(--bg);
  font-size: 1rem;
  font-family: var(--font);
  padding: 8px 0;
  outline: none;
  font-weight: 300;
  letter-spacing: -0.01em;
}
.cmd-bar input::placeholder { color: rgba(255,255,255,0.25); }
.cmd-area-select {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 4px 6px;
  cursor: pointer;
  opacity: 0.5;
}
.cmd-area-select:hover { opacity: 1; }
.cmd-area-select option { color: var(--text); background: var(--bg); }

/* ── Note Editor ── */
.note-edit-bar {
  display: flex;
  justify-content: flex-end;
  padding-block-end: var(--space-s);
}
.note-edit-btn {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  cursor: pointer;
}
.note-edit-btn:hover { border-color: var(--text-muted); }
.note-edit-btn.saving { opacity: 0.4; pointer-events: none; }
.note-editor {
  inline-size: 100%;
  min-block-size: 300px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
}
.note-editor:focus { border-color: var(--text-muted); }
.note-edit-actions {
  display: flex;
  gap: var(--space-s);
  justify-content: flex-end;
  padding-block-start: var(--space-s);
}

/* ── Project task badge in timeline ── */
.project-tag { opacity: 0.6; font-size: 0.55rem; }

/* ── Feature B: Area Soul subtitles ── */
.area-soul {
  font-size: 0.55rem;
  font-style: italic;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  display: block;
  margin-top: 2px;
}

/* ── Feature C: Nørth Panel ── */
.north-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.north-overlay.open { opacity: 1; visibility: visible; }

.north-panel {
  position: fixed;
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: min(700px, 88vw);
  block-size: 100vh;
  background: var(--bg);
  border-inline-start: 1px solid var(--border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.north-panel.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

.north-panel-header {
  padding: var(--space-m) var(--space-l);
  border-block-end: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.north-panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}
.north-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-l);
}
.north-panel-body .md-content { line-height: 1.7; }

/* ── Inbox Button & Panel ── */
.inbox-btn { position: relative; }
.inbox-btn .inbox-badge {
  position: absolute;
  inset-block-start: -2px;
  inset-inline-end: -4px;
  background: var(--overdue);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  min-inline-size: 14px;
  block-size: 14px;
  line-height: 14px;
  border-radius: 7px;
  text-align: center;
  padding-inline: 3px;
  pointer-events: none;
}
.inbox-badge:empty { display: none; }
.inbox-panel { inline-size: min(550px, 88vw); }
.inbox-item {
  padding: var(--space-xs) 0;
  border-block-end: 1px solid var(--border);
  font-size: 0.92rem;
  line-height: 1.5;
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
}
.inbox-item:last-child { border-block-end: none; }
.inbox-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.inbox-dismiss:hover { color: var(--overdue); }
.inbox-item .inbox-due {
  color: var(--overdue);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-inline-start: var(--space-xs);
}
.inbox-empty {
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-l) 0;
}

/* ── Feature D: Reflection Mode ── */
.reflection-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow-y: auto;
  padding: var(--space-xl) var(--space-l);
}
.reflection-overlay.open { opacity: 1; visibility: visible; }

.reflection-header {
  max-width: 640px;
  margin: 0 auto var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reflection-title {
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: -0.02em;
}
.reflection-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}
.reflection-body {
  max-width: 640px;
  margin: 0 auto;
}
.reflection-direction {
  max-width: 640px;
  margin: 0 auto var(--space-l);
  padding: var(--space-m) var(--space-l);
  border-left: 2px solid var(--border);
  animation: fadeUp 0.4s ease both;
}
/* Area-specific reflection colors are now set inline by JS */

.reflection-direction-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}
.reflection-direction-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-s);
}
.reflection-activity {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  gap: var(--space-m);
}
.reflection-activity-item { display: flex; align-items: center; gap: 4px; }

@media (max-width: 720px) {
  .area-soul { display: none; }
  .reflection-overlay { padding: var(--space-l) var(--space-s); }
  .reflection-direction { padding: var(--space-s) var(--space-m); }
}

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: calc(var(--space-l) + 60px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  pointer-events: none;
}
.toast {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  animation: toast-in 0.2s ease forwards;
  pointer-events: auto;
}
.toast--error {
  border-color: var(--overdue);
  color: var(--overdue);
}
@keyframes toast-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

/* ── Tasks panel ── */
.tasks-panel-filters {
  display: flex;
  gap: 6px;
  padding: var(--space-xs) var(--space-l);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}
.tasks-filter-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tasks-filter-pill:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.tasks-filter-pill.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tasks-panel-section {
  margin-block-end: var(--space-l);
}
.tasks-panel-section-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding-block-end: var(--space-xs);
  border-bottom: 1px solid var(--border);
  margin-block-end: var(--space-xs);
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
}
.tasks-panel-count {
  font-weight: 400;
  opacity: 0.6;
}
.dispatch-pill { margin-inline-start: auto; }
.area-tasks-edit {
  margin-inline-start: auto;
  text-transform: none;
  opacity: 0.25;
  transition: opacity 0.15s ease;
}
.tasks-panel-section-title:hover .area-tasks-edit { opacity: 0.8; }
/* ── Dispatch ── */
.dispatch-trigger {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
.dispatch-trigger:hover { opacity: 1; }
.dispatch-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}
.dispatch-card {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  padding: var(--space-m) var(--space-l);
  border-left: 2px solid var(--border);
  animation: fadeUp 0.4s ease both;
}
.dispatch-card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}
.dispatch-card-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.area-tasks-editor-wrap {
  display: flex;
  flex-direction: column;
  block-size: 100%;
}
.add-task-inline {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-s) 0 var(--space-m);
  padding-inline-start: var(--task-text-offset, 36px);
  opacity: 0.4;
}
.add-task-inline:hover { opacity: 0.8; }
.add-task-inline-input {
  inline-size: 100%;
  font-size: 0.85rem;
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  outline: none;
}
.add-task-inline-input:focus { border-color: var(--text-muted); }
.add-task-inline-wrap,
.tasks-panel-section,
.notes-body { position: relative; }
.at-autocomplete {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 100%;
  margin-block-start: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 10;
  min-inline-size: 180px;
}
.at-autocomplete-item {
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-s);
}
.at-autocomplete-item:hover,
.at-autocomplete-item.active { background: var(--bg-hover, rgba(0,0,0,0.04)); }
.at-autocomplete-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-inline-start: auto;
}
.work-block-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.work-block-item:hover { background: var(--bg-hover); }
.work-block-name { font-weight: 450; }
.work-block-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}
