/* ═══════════════════════════════════════════
   THEMES
════════════════════════════════════════════ */
:root, [data-theme="amber"] {
  --bg:           #0c0c11;
  --bg-card:      #13131a;
  --bg-input:     #1a1a23;
  --bg-raised:    #1f1f29;
  --bg-elev:      #25252f;
  --border:       #26263380;
  --border-solid: #2a2a38;

  --text:         #e4dfd6;
  --text-mid:     #9a96a0;
  --text-faint:   #4a4858;

  --accent:       #c8935a;
  --accent-hi:    #d9a870;
  --accent-dim:   #8a6038;
  --accent-soft:  #6a4d2c;
  --accent-glow:  rgba(200, 147, 90, 0.12);
  --accent-text-on: #0c0c11;

  --cat-abandoned: #c8935a;
  --cat-deepened:  #5a9bc8;
  --cat-inverted:  #c85a5a;
  --cat-added:     #5ac87a;
  --cat-frozen:    #a05ac8;

  --status-progress:  #c8935a;
  --status-complete:  #5ac87a;
  --status-reflected: #5a9bc8;
  --status-discussed: #a05ac8;

  --overlay: rgba(8, 8, 12, 0.78);
}

[data-theme="slate"] {
  --bg: #0a0f17;
  --bg-card: #121822;
  --bg-input: #1a212d;
  --bg-raised: #232c39;
  --bg-elev: #2c3645;
  --border: #2a334080;
  --border-solid: #2d3744;

  --text: #d8dde6;
  --text-mid: #8b94a3;
  --text-faint: #4a5360;

  --accent: #74a8d4;
  --accent-hi: #8ab8df;
  --accent-dim: #4d80b0;
  --accent-soft: #345780;
  --accent-glow: rgba(116, 168, 212, 0.12);
  --accent-text-on: #0a0f17;

  --cat-abandoned: #d4a574;
  --cat-deepened:  #74a8d4;
  --cat-inverted:  #d47474;
  --cat-added:     #74d49a;
  --cat-frozen:    #a874d4;

  --status-progress:  #d4a574;
  --status-complete:  #74d49a;
  --status-reflected: #74a8d4;
  --status-discussed: #a874d4;

  --overlay: rgba(6, 10, 16, 0.80);
}

[data-theme="forest"] {
  --bg: #0a1410;
  --bg-card: #131c17;
  --bg-input: #1a241e;
  --bg-raised: #232f28;
  --bg-elev: #2d3a32;
  --border: #2a3a3080;
  --border-solid: #2d3d33;

  --text: #d8e4dc;
  --text-mid: #8aa398;
  --text-faint: #4a5d52;

  --accent: #6dad7c;
  --accent-hi: #84c293;
  --accent-dim: #4d7d58;
  --accent-soft: #34543c;
  --accent-glow: rgba(109, 173, 124, 0.12);
  --accent-text-on: #0a1410;

  --cat-abandoned: #c8a374;
  --cat-deepened:  #74a8d4;
  --cat-inverted:  #d48474;
  --cat-added:     #6dad7c;
  --cat-frozen:    #b08adb;

  --status-progress:  #c8a374;
  --status-complete:  #6dad7c;
  --status-reflected: #74a8d4;
  --status-discussed: #b08adb;

  --overlay: rgba(6, 14, 10, 0.80);
}

[data-theme="rose"] {
  --bg: #140a10;
  --bg-card: #1c1218;
  --bg-input: #241a20;
  --bg-raised: #2f232b;
  --bg-elev: #3a2d35;
  --border: #3a2a3080;
  --border-solid: #3d2d33;

  --text: #e8dde2;
  --text-mid: #a08a96;
  --text-faint: #5d4a52;

  --accent: #d68aa8;
  --accent-hi: #e3a3bd;
  --accent-dim: #a85d7d;
  --accent-soft: #743450;
  --accent-glow: rgba(214, 138, 168, 0.12);
  --accent-text-on: #140a10;

  --cat-abandoned: #d4a874;
  --cat-deepened:  #8aa8d4;
  --cat-inverted:  #d47474;
  --cat-added:     #8ad4a8;
  --cat-frozen:    #d68aa8;

  --status-progress:  #d4a874;
  --status-complete:  #8ad4a8;
  --status-reflected: #8aa8d4;
  --status-discussed: #d68aa8;

  --overlay: rgba(14, 6, 10, 0.80);
}

[data-theme="mono"] {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-input: #1c1c1c;
  --bg-raised: #242424;
  --bg-elev: #2c2c2c;
  --border: #28282880;
  --border-solid: #2c2c2c;

  --text: #f0f0f0;
  --text-mid: #909090;
  --text-faint: #505050;

  --accent: #f0f0f0;
  --accent-hi: #ffffff;
  --accent-dim: #b0b0b0;
  --accent-soft: #707070;
  --accent-glow: rgba(240, 240, 240, 0.06);
  --accent-text-on: #0a0a0a;

  --cat-abandoned: #d4d4d4;
  --cat-deepened:  #c0c0c0;
  --cat-inverted:  #a0a0a0;
  --cat-added:     #b8b8b8;
  --cat-frozen:    #909090;

  --status-progress:  #d4d4d4;
  --status-complete:  #f0f0f0;
  --status-reflected: #b0b0b0;
  --status-discussed: #909090;

  --overlay: rgba(0, 0, 0, 0.85);
}

[data-theme="sepia"] {
  --bg: #f0e8d8;
  --bg-card: #e8dfc8;
  --bg-input: #f5eed8;
  --bg-raised: #ddd2b8;
  --bg-elev: #d0c4a8;
  --border: #c4b89880;
  --border-solid: #c0b48c;

  --text: #2c2418;
  --text-mid: #6b5e48;
  --text-faint: #a89878;

  --accent: #8b5a2b;
  --accent-hi: #a0683a;
  --accent-dim: #6b4520;
  --accent-soft: #4d3018;
  --accent-glow: rgba(139, 90, 43, 0.10);
  --accent-text-on: #f5eed8;

  --cat-abandoned: #b06820;
  --cat-deepened:  #4a7090;
  --cat-inverted:  #a04848;
  --cat-added:     #4a8060;
  --cat-frozen:    #7a4890;

  --status-progress:  #b06820;
  --status-complete:  #4a8060;
  --status-reflected: #4a7090;
  --status-discussed: #7a4890;

  --overlay: rgba(50, 35, 20, 0.55);
}

/* ═══════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

:root {
  --radius:    10px;
  --radius-lg: 16px;
  --radius-sm: 6px;
  --max-w:     720px;
  --max-w-lg:  860px;
  --shadow-modal: 0 24px 60px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.3);
  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

[hidden] { display: none !important; }

/* ═══════════════════════════════════════════
   TOP BAR
════════════════════════════════════════════ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-solid);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-btn {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.brand-btn:hover { background: var(--bg-card); }

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand-sub {
  font-size: 0.65rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 3px;
}

.top-bar-actions { display: flex; gap: 8px; }

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-mid);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-card);
  border-color: var(--border-solid);
}

/* ═══════════════════════════════════════════
   PHASES
════════════════════════════════════════════ */
.phase {
  display: none;
  min-height: calc(100vh - 65px);
  width: 100%;
}

#phase-setup { min-height: 100vh; }

.phase.active {
  display: flex;
  flex-direction: column;
  animation: phaseIn 0.4s ease both;
}

@keyframes phaseIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   TYPOGRAPHY
════════════════════════════════════════════ */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 500; line-height: 1.3; }

p { line-height: 1.75; }

em { font-style: italic; color: var(--accent); }

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

kbd {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-mid);
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-radius: 4px;
  line-height: 1;
}

/* ═══════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--accent);
  color: var(--accent-text-on);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hi);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary.full-width { width: 100%; }
.btn-primary.big-cta { padding: 16px 36px; font-size: 1rem; border-radius: 12px; }
.btn-primary.danger { background: var(--cat-inverted); color: #fff; }

.cta-plus { font-size: 1.2rem; line-height: 1; margin-right: 4px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border-solid);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn-ghost-sm:hover { color: var(--text); border-color: var(--text-mid); background: var(--bg-card); }
.btn-ghost.full-width { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════
   FORMS
════════════════════════════════════════════ */
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-faint); }

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239a96a0' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.form-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-faint);
  line-height: 1.5;
}

.form-group { margin-bottom: 24px; }

/* ═══════════════════════════════════════════
   ERRORS & TOASTS
════════════════════════════════════════════ */
.error-inline {
  padding: 12px 16px;
  background: rgba(200, 90, 90, 0.12);
  border: 1px solid rgba(200, 90, 90, 0.3);
  border-radius: var(--radius);
  color: #e07070;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.hidden { display: none !important; }

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elev);
  border: 1px solid var(--border-solid);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  max-width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.toast.toast-success { border-left: 3px solid var(--status-complete); }
.toast.toast-error   { border-left: 3px solid var(--cat-inverted); }
.toast.toast-info    { border-left: 3px solid var(--accent); }

.toast.exiting { animation: toastOut 0.25s ease forwards; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0);   } to { opacity: 0; transform: translateX(40px); } }

.toast-icon { font-size: 1rem; line-height: 1.4; flex-shrink: 0; }
.toast-msg  { line-height: 1.5; flex: 1; }

/* ═══════════════════════════════════════════
   MODAL
════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlayIn 0.2s ease;
}

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  max-width: 480px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-card.wide { max-width: 600px; }

.modal-header { padding: 24px 28px 0; }

.modal-title {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
  font-family: var(--font-serif);
}

.modal-body {
  padding: 16px 28px 8px;
  color: var(--text-mid);
  font-size: 0.95rem;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 28px 24px;
}

.modal-section { padding: 18px 28px; border-top: 1px solid var(--border-solid); }
.modal-section:first-of-type { border-top: 0; }

.modal-section-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.modal-input-row { display: flex; gap: 8px; align-items: stretch; }
.modal-input-row .form-input, .modal-input-row .form-select { flex: 1; }
.modal-section.danger { background: rgba(200, 90, 90, 0.04); }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.theme-swatch {
  background: var(--bg-input);
  border: 2px solid var(--border-solid);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-swatch:hover { transform: translateY(-1px); }
.theme-swatch.active { border-color: var(--accent); }

.theme-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--border-solid);
}

.theme-swatch-name {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.88rem;
}

.shortcut-row + .shortcut-row { border-top: 1px solid var(--border); }

.shortcut-row span { color: var(--text-mid); }

.shortcut-keys { display: flex; gap: 4px; }

/* ═══════════════════════════════════════════
   STEP TRAIL
════════════════════════════════════════════ */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.step-trail { display: flex; align-items: center; gap: 10px; }

.step {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.step.active { color: var(--accent); }
.step.done   { color: var(--text-mid); }

.step-line { width: 28px; height: 1px; background: var(--border-solid); }

/* ═══════════════════════════════════════════
   SETUP
════════════════════════════════════════════ */
#phase-setup {
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.setup-wrap {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.setup-logo { text-align: center; }

.app-name {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}

.app-sub {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  margin-top: 8px;
}

.setup-desc {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--text-mid);
  line-height: 1.8;
  text-align: center;
}

.setup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.key-input-row { display: flex; gap: 8px; align-items: stretch; }
.key-input-row .form-input { flex: 1; }

.setup-footer-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ═══════════════════════════════════════════
   HOME
════════════════════════════════════════════ */
#phase-home { padding: 48px 24px 80px; }

.home-wrap {
  width: 100%;
  max-width: var(--max-w-lg);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.home-hero { text-align: left; }

.home-title {
  font-size: 2.4rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.home-tagline {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-mid);
  font-style: italic;
  margin-top: 6px;
}

.home-stats {
  display: flex;
  gap: 28px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
}

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

.stat-num {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.home-search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 16px 11px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-faint); }

.sessions-empty {
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed var(--border-solid);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.sessions-no-match {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-mid);
}

.empty-icon { font-size: 2rem; color: var(--text-faint); margin-bottom: 12px; }
.empty-text { font-family: var(--font-serif); font-size: 1.1rem; color: var(--text-mid); }
.empty-sub  { font-size: 0.85rem; color: var(--text-faint); margin-top: 6px; }

.sessions-list { display: flex; flex-direction: column; gap: 12px; }

.session-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-top: 16px;
  margin-bottom: 4px;
  padding-left: 4px;
}

.session-group-label:first-child { margin-top: 0; }

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  position: relative;
}

.session-card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}

.session-card.pinned {
  border-left: 3px solid var(--accent);
}

.session-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.session-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.session-pin-icon {
  font-size: 0.85rem;
  color: var(--accent);
  flex-shrink: 0;
}

.session-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}

.session-actions-trigger {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-faint);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.session-actions-trigger:hover {
  color: var(--text);
  background: var(--bg-input);
  border-color: var(--border-solid);
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-faint);
  flex-wrap: wrap;
}

.session-date { color: var(--text-faint); }
.session-divider { color: var(--text-faint); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid currentColor;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.in_progress { color: var(--status-progress); }
.status-badge.completed   { color: var(--status-complete); }
.status-badge.reflected   { color: var(--status-reflected); }
.status-badge.discussed   { color: var(--status-discussed); }

.session-preview {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--text-mid);
  line-height: 1.65;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.session-files-summary {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.kb-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 16px;
}

.kb-hint kbd { margin: 0 2px; }

/* ═══════════════════════════════════════════
   UPLOAD
════════════════════════════════════════════ */
#phase-upload { padding: 32px 24px 120px; }

.upload-wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}

.upload-header { margin-bottom: 32px; }

.section-title {
  font-size: 1.7rem;
  margin-bottom: 12px;
  color: var(--text);
}

.section-desc {
  color: var(--text-mid);
  font-size: 0.95rem;
  max-width: 580px;
}

.entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.2s, background 0.2s;
}

.entry-card:focus-within { border-color: var(--accent-dim); }
.entry-card.drag-over { border-color: var(--accent); background: var(--accent-glow); }

.entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.entry-date-area { flex: 1; }

.entry-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.entry-date {
  width: 100%;
  max-width: 280px;
  padding: 9px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-solid);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.entry-date:focus { border-color: var(--accent); }
.entry-date::placeholder { color: var(--text-faint); }

.entry-remove {
  background: transparent;
  border: 1px solid var(--border-solid);
  border-radius: 6px;
  color: var(--text-faint);
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
  margin-top: 22px;
}

.entry-remove:hover { color: var(--cat-inverted); border-color: var(--cat-inverted); }

.entry-text {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.75;
  resize: vertical;
  min-height: 180px;
  outline: none;
  transition: border-color 0.2s;
}

.entry-text:focus { border-color: var(--accent-dim); }
.entry-text::placeholder { color: var(--text-faint); font-family: var(--font-sans); font-style: italic; }

.entry-footer { display: flex; justify-content: flex-end; margin-top: 10px; }

.entry-word-count { font-size: 0.78rem; color: var(--text-faint); }

.add-entry-btn {
  width: 100%;
  margin-bottom: 32px;
  border-style: dashed;
  color: var(--text-faint);
  justify-content: center;
}

.add-entry-btn:hover { color: var(--accent); border-color: var(--accent-dim); }

.upload-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.word-count-row { display: flex; align-items: baseline; gap: 6px; }

.wc-number {
  font-size: 1.4rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.wc-label { font-size: 0.88rem; color: var(--text-mid); }

.wc-status { font-size: 0.85rem; }
.wc-status.low   { color: var(--cat-abandoned); }
.wc-status.ok    { color: var(--text-mid); }
.wc-status.great { color: var(--cat-added); }

/* ═══════════════════════════════════════════
   FILES
════════════════════════════════════════════ */
.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.entry-attach-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

.entry-attach-label { cursor: pointer; user-select: none; flex-shrink: 0; }
.entry-attach-label:hover { color: var(--accent); border-color: var(--accent-dim); }

.attach-hint { font-size: 0.78rem; color: var(--text-faint); }

.entry-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.entry-files:empty { display: none; }

.file-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 7px;
  background: var(--bg-raised);
  border: 1px solid var(--border-solid);
  border-radius: 8px;
  max-width: 220px;
  transition: border-color 0.2s;
}

.file-chip:hover { border-color: var(--text-faint); }

.file-chip-icon { font-size: 1rem; flex-shrink: 0; line-height: 1; }

.file-chip-thumb {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.file-chip-name {
  font-size: 0.78rem;
  color: var(--text-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.file-chip-remove {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 0 2px 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.file-chip-remove:hover { color: var(--cat-inverted); }

/* ═══════════════════════════════════════════
   LOADING
════════════════════════════════════════════ */
.loading-phase { align-items: center; justify-content: center; padding: 48px 24px; }

.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border-solid);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-msg {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text);
  transition: opacity 0.3s;
}

.loading-sub { font-size: 0.85rem; color: var(--text-faint); font-style: italic; }

/* ═══════════════════════════════════════════
   INTERVIEW
════════════════════════════════════════════ */
#phase-interview {
  flex-direction: column;
  max-height: calc(100vh - 65px);
  overflow: hidden;
}

.interview-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 65px);
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.interview-topbar {
  flex-shrink: 0;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-row { display: flex; align-items: center; gap: 12px; }

.progress-track {
  flex: 1;
  height: 2px;
  background: var(--border-solid);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: right;
}

.interview-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

.interview-scroll::-webkit-scrollbar { width: 4px; }
.interview-scroll::-webkit-scrollbar-track { background: transparent; }
.interview-scroll::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 2px; }

.interview-history { display: flex; flex-direction: column; gap: 28px; margin-bottom: 40px; }

.history-item { display: flex; flex-direction: column; gap: 10px; }

.history-q {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-style: italic;
  font-family: var(--font-serif);
  line-height: 1.6;
  padding-left: 12px;
  border-left: 2px solid var(--border-solid);
}

.history-a-wrap { position: relative; padding-right: 32px; }

.history-a {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.75;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.history-edit-btn {
  position: absolute;
  right: 0;
  top: 0;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
}

.history-item:hover .history-edit-btn { opacity: 1; }

.history-edit-btn:hover { color: var(--accent); background: var(--bg-card); }

.question-block { padding: 28px 0 20px; }

.question-byline {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 14px;
}

.current-question {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.7;
  color: var(--text);
  transition: opacity 0.25s;
  white-space: pre-wrap;
}

.current-question.loading { opacity: 0.3; }

.question-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.question-options:empty { display: none; }

.option-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  color: var(--text-mid);
  padding: 9px 16px;
  border-radius: 100px;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: left;
  line-height: 1.4;
}

.option-chip:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-1px);
}

.answer-dock {
  flex-shrink: 0;
  padding: 16px 0 24px;
  border-top: 1px solid var(--border-solid);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-input-wrap { position: relative; }

.answer-input {
  width: 100%;
  padding: 14px 50px 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.7;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  min-height: 80px;
  max-height: 220px;
}

.answer-input:focus { border-color: var(--accent-dim); }
.answer-input::placeholder { color: var(--text-faint); font-style: italic; font-family: var(--font-sans); }
.answer-input:disabled { opacity: 0.5; cursor: not-allowed; }

.mic-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border-solid);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  color: var(--text-mid);
}

.mic-btn:hover { color: var(--text); border-color: var(--text-faint); transform: scale(1.05); }

.mic-btn.recording {
  background: var(--cat-inverted);
  border-color: var(--cat-inverted);
  color: #fff;
  animation: micPulse 1.4s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 90, 90, 0.6); }
  50%      { box-shadow: 0 0 0 10px rgba(200, 90, 90, 0);   }
}

.answer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.answer-action-buttons { display: flex; gap: 8px; align-items: center; }

.answer-hint { font-size: 0.78rem; color: var(--text-faint); }

/* ═══════════════════════════════════════════
   REPORT
════════════════════════════════════════════ */
#phase-report { padding: 40px 24px 80px; }

.report-wrap {
  width: 100%;
  max-width: var(--max-w-lg);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.report-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.report-heading {
  font-size: 2.2rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.report-timespan {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-top: 6px;
  font-style: italic;
}

.report-actions { display: flex; gap: 8px; flex-shrink: 0; }

.report-summary { display: flex; flex-direction: column; gap: 12px; }

.report-summary-title {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.report-summary p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 12px;
}

.report-summary p:last-child { margin-bottom: 0; }

.key-insight-card {
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}

.insight-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
}

.insight-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
}

.report-findings { display: flex; flex-direction: column; gap: 36px; }

.category-section { display: flex; flex-direction: column; gap: 16px; }

.category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-solid);
}

.category-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.category-name { font-size: 1.1rem; font-weight: 500; font-family: var(--font-serif); }
.category-desc { font-size: 0.82rem; color: var(--text-mid); display: block; margin-top: 2px; }

.finding-card {
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-left-width: 3px;
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.finding-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.finding-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.change-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid currentColor;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.finding-timeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
}

.timeline-col { display: flex; flex-direction: column; gap: 8px; }

.timeline-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.timeline-stance {
  font-size: 0.92rem;
  color: var(--text-mid);
  line-height: 1.65;
}

.timeline-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-faint);
  line-height: 1.65;
  padding-left: 12px;
  border-left: 2px solid var(--border-solid);
}

.timeline-arrow { font-size: 1rem; color: var(--text-faint); padding-top: 22px; flex-shrink: 0; }

.finding-note {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.65;
  font-style: italic;
}

.hard-question {
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hq-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.hq-text { font-family: var(--font-serif); font-size: 1rem; color: var(--text); line-height: 1.7; }

.report-held {
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
}

.report-held-title {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.report-held p {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.8;
}

.report-closing { padding: 0 4px; }

.closing-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.85;
  font-style: italic;
}

.report-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-solid);
}

.report-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  text-align: center;
}

.report-end-line { font-size: 0.88rem; color: var(--text-faint); font-style: italic; }

/* Reading mode */
body.reading-mode #top-bar,
body.reading-mode .report-cta-row,
body.reading-mode .report-end,
body.reading-mode .report-actions { display: none; }

body.reading-mode #phase-report { padding: 64px 24px; }

body.reading-mode .report-wrap {
  max-width: 640px;
  font-size: 1.05em;
}

body.reading-mode .report-summary p,
body.reading-mode .insight-text,
body.reading-mode .timeline-stance,
body.reading-mode .hq-text,
body.reading-mode .closing-text,
body.reading-mode .report-held p { font-size: 1.05rem; line-height: 2; }

body.reading-mode .reading-exit {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  background: var(--bg-card);
  display: inline-flex !important;
}

.reading-exit { display: none; }

/* ═══════════════════════════════════════════
   REFLECTION
════════════════════════════════════════════ */
#phase-reflection { padding: 32px 24px 80px; }

.reflection-wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; }

.reflection-header { margin-bottom: 32px; }

.reflection-questions { display: flex; flex-direction: column; gap: 24px; }

.reflection-card {
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-left: 3px solid var(--accent-dim);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reflection-question-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.reflection-question {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}

.reflection-context {
  font-size: 0.82rem;
  color: var(--text-faint);
  line-height: 1.6;
  font-style: italic;
}

.reflection-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.75;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color 0.2s;
}

.reflection-textarea:focus { border-color: var(--accent-dim); }
.reflection-textarea::placeholder { color: var(--text-faint); font-style: italic; font-family: var(--font-sans); }

.reflection-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-solid);
}

.reflection-status { font-size: 0.82rem; color: var(--text-faint); }
.reflection-status.saved { color: var(--status-complete); }

/* ═══════════════════════════════════════════
   FOLLOW-UP
════════════════════════════════════════════ */
#phase-followup {
  flex-direction: column;
  max-height: calc(100vh - 65px);
  overflow: hidden;
}

.followup-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 65px);
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.followup-title { font-family: var(--font-serif); font-size: 1rem; color: var(--text); }

.followup-intro {
  flex-shrink: 0;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.followup-intro p { font-size: 0.85rem; color: var(--text-mid); line-height: 1.6; }

.followup-scroll { flex: 1; overflow-y: auto; padding-bottom: 16px; scroll-behavior: smooth; }
.followup-scroll::-webkit-scrollbar { width: 4px; }
.followup-scroll::-webkit-scrollbar-track { background: transparent; }
.followup-scroll::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 2px; }

.followup-messages { display: flex; flex-direction: column; gap: 22px; }

.followup-msg { display: flex; flex-direction: column; gap: 4px; max-width: 92%; }

.followup-msg.user  { align-self: flex-end;   align-items: flex-end; }
.followup-msg.drift { align-self: flex-start; }

.followup-msg-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.followup-msg.user  .followup-msg-label { color: var(--text-faint); }
.followup-msg.drift .followup-msg-label { color: var(--accent); }

.followup-msg-bubble {
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.followup-msg.user .followup-msg-bubble {
  background: var(--bg-elev);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

.followup-msg.drift .followup-msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  color: var(--text);
  border-bottom-left-radius: 4px;
  font-family: var(--font-serif);
}

.followup-msg.drift.thinking .followup-msg-bubble { color: var(--text-faint); font-style: italic; }

.followup-dock {
  flex-shrink: 0;
  padding: 16px 0 24px;
  border-top: 1px solid var(--border-solid);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ═══════════════════════════════════════════
   WELCOME TOUR
════════════════════════════════════════════ */
.tour-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlayIn 0.3s ease;
}

.tour-card {
  background: var(--bg-card);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-modal);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: modalIn 0.35s ease;
}

.tour-step-num {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.tour-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text);
}

.tour-body {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.8;
}

.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 10px;
}

.tour-dots { display: flex; gap: 6px; }

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-solid);
  transition: background 0.2s;
}

.tour-dot.active { background: var(--accent); }

/* ═══════════════════════════════════════════
   PRINT
════════════════════════════════════════════ */
@media print {
  body { background: #fff; color: #111; }
  .top-bar, .no-print, .toast-container, .modal-overlay, .tour-overlay { display: none !important; }
  .phase { display: none !important; }
  #phase-report { display: block !important; min-height: unset; }
  .report-wrap { max-width: 100%; gap: 28px; }
  .report-heading { color: #111; }
  .report-summary p, .insight-text, .timeline-stance, .hq-text, .closing-text, .report-held p { color: #333; }
  .key-insight-card { background: #f8f4ef; border-color: #c8935a; }
  .finding-card { background: #fff; border-color: #ddd; break-inside: avoid; }
  .hard-question { background: #f5f5f5; }
  .report-held { background: #fafafa; border-color: #ddd; }
  .category-section { break-inside: avoid; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 640px) {
  .app-name { font-size: 2.6rem; }
  .home-title { font-size: 1.8rem; }
  .section-title { font-size: 1.35rem; }
  .current-question { font-size: 1.15rem; }
  .report-heading { font-size: 1.6rem; }
  .report-topbar { flex-direction: column; }
  .report-actions { width: 100%; flex-wrap: wrap; }
  .finding-timeline { grid-template-columns: 1fr; gap: 12px; }
  .timeline-arrow { display: none; }
  .key-insight-card { padding: 20px; }
  .finding-card { padding: 20px; }
  .interview-wrap, .followup-wrap { padding: 16px 16px 0; }
  #phase-upload, #phase-report, #phase-home, #phase-reflection { padding-left: 16px; padding-right: 16px; }
  .top-nav { flex-direction: column; align-items: flex-start; gap: 16px; }
  .answer-hint { display: none; }
  .top-bar { padding: 12px 16px; }
  .modal-card { max-height: 92vh; }
  .modal-header, .modal-body, .modal-actions, .modal-section { padding-left: 20px; padding-right: 20px; }
  .answer-actions { flex-direction: column; align-items: stretch; }
  .answer-action-buttons { justify-content: flex-end; flex-wrap: wrap; }
  .reflection-footer { flex-direction: column; align-items: stretch; }
  .home-stats { gap: 18px; padding: 16px; flex-wrap: wrap; }
  .stat-num { font-size: 1.3rem; }
  .home-actions { flex-direction: column; align-items: stretch; }
  .home-search-wrap { width: 100%; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .tour-card { padding: 28px 24px; }
}
