/* CrackOn Dashboard — CRT Monitor Edition */

/* ─── Palette ─────────────────────────────────── */

:root {
  /* Core design tokens */
  --fg: #fafafa;
  --fg-secondary: #a3a3a3;
  --fg-muted: #737373;
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --border: #262626;
  --border-subtle: #1f1f1f;
  --gold: #c9b896;
  --lavender: #a78bfa;
  --lavender-faint: #1f1a2e;
  --green: #33ff33;

  /* Phosphor — CRT chrome elements */
  --phosphor: #8bf0a4;
  --phosphor-bright: #b4f7c8;
  --phosphor-dim: #4a9e64;
  --phosphor-faint: #2d6b40;
  --phosphor-glow: rgba(139, 240, 164, 0.12);

  /* Screen */
  --screen-bg: #06120a;
  --screen-bg-alt: #0a1a0f;

  /* Monitor housing */
  --housing-light: #d4cfc4;
  --housing-mid: #bfb9ab;
  --housing-dark: #a8a295;
  --housing-shadow: #6b675e;

  /* Content text — white for readability, green stays on chrome */
  --text-content: #e8e8e8;

  /* Typography */
  --font-sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Zoom-driven scaling — set by JS based on absolute window size.
     --zoom starts high at small windows (tight on content),
     decreases toward 1.0 at large windows (full beach revealed).
     Fallback 1.15 if JS hasn't loaded yet. */
  --zoom: 1.15;
}

/* ─── Reset ───────────────────────────────────── */

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

/* ─── Body ────────────────────────────────────── */

body {
  font-family: var(--font-sans);
  background: #0c1a2a;
  color: var(--fg);
  margin: 0;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Scene ───────────────────────────────────── */
/* Wraps monitor + overlay. Sized as cover × zoom.
   Cover ensures the PNG always fills the viewport.
   Zoom (JS-driven) adds extra at small windows → tight on content.
   At large windows, zoom → 1.0 → just cover → full beach visible. */

.scene {
  position: fixed;
  overflow: hidden;
  /* Dimensions and position set by JS updateLayout() */
}

/* ─── Monitor ─────────────────────────────────── */

.monitor {
  position: absolute;
  /* Screen hole is 54% x 62% of image. Monitor slightly larger for overlap. */
  width: 57%;
  height: 65%;
  /* Centre on the screen hole (49.2%, 44.2% of image) */
  left: 49.2%;
  top: 44.2%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  z-index: 1;
  border-radius: 4% / 3%;
}

.monitor::before { display: none; }
.monitor::after { display: none; }

/* ─── Bezel ───────────────────────────────────── */

.bezel {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* Inner bezel gradient */
.bezel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4% / 3%;
  box-shadow:
    inset 0 0 40px 15px rgba(10, 8, 6, 0.6),
    inset 0 0 80px 30px rgba(10, 8, 6, 0.3);
  pointer-events: none;
  z-index: 11;
}

.bezel::after { display: none; }
.chin-glow { display: none; }
.badge { display: none; }

/* ─── Screen ──────────────────────────────────── */

.screen {
  position: relative;
  background: var(--screen-bg);
  border-radius: 4% / 3%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  /* Inset content so it stays within the visible screen hole.
     Monitor is oversized (57%×62%) vs hole (54%×58%) — padding keeps
     content clear of the housing bezel overlap. */
  padding: 2.8% 3% 1.5% 3.6%;

  /* CRT vignette */
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.6),
    inset 0 0 120px rgba(0, 0, 0, 0.35),
    inset 0 0 200px rgba(0, 0, 0, 0.15);

  /* Responsive font — landscape screen hole is shorter, use vmin for stability */
  font-size: clamp(11px, 1.4vmin, 18px);
  line-height: 1.5;

  /* Subtle feathered edge — housing PNG does the heavy framing */
  -webkit-mask-image: radial-gradient(ellipse 98% 96% at 50% 50%, black 85%, transparent 100%);
  mask-image: radial-gradient(ellipse 98% 96% at 50% 50%, black 85%, transparent 100%);
}

/* Scanlines */
.screen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

/* Phosphor bloom */
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: radial-gradient(
    ellipse 95% 85% at 50% 46%,
    rgba(139, 240, 164, 0.07) 0%,
    rgba(139, 240, 164, 0.02) 50%,
    transparent 80%
  );
}

/* ─── CRT Overlay ─────────────────────────────── */

.crt-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 100;
  pointer-events: none;
  user-select: none;
}

/* ─── Header Nav ─────────────────────────────── */

.nav-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  min-height: 60px;
  padding: 0 16px;
  background: #131313;
  border-bottom: 1px solid var(--border);
}

.nav-group {
  display: flex;
  gap: 0;
}

.nav-key {
  padding: 8px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #becabc;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
  white-space: nowrap;
}

.nav-key:hover {
  color: var(--phosphor);
}

.nav-key.active {
  color: #8bf0a4;
  border-bottom-color: #8bf0a4;
}

/* Remove blue focus ring on mouse click; preserve for keyboard Tab */
.nav-key:focus:not(:focus-visible) {
  outline: none;
}

/* Responsive labels — full text on md+, single letter on mobile */
.nav-label-short {
  display: none;
}

/* ─── Central Orb ────────────────────────────── */

/* Dot-within-circle — Material radio_button_checked look, CSS-only.
   Steady state: outer ring + inner dot, subtle phosphor glow, no animation.
   .active (WORKING) state: pulses ring + dot together. */
.nav-orb {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--phosphor);
  background: transparent;
  margin: 0 16px;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.85;
  box-shadow: 0 0 8px rgba(139, 240, 164, 0.25);
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.2s;
}

.nav-orb::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--phosphor);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px var(--phosphor);
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-orb:hover {
  opacity: 1;
  box-shadow: 0 0 12px rgba(139, 240, 164, 0.5);
}

.nav-orb:focus-visible {
  outline: 1px solid var(--phosphor);
  outline-offset: 3px;
}

@keyframes orb-pulse {
  0%, 100% {
    opacity: 0.85;
    box-shadow: 0 0 8px rgba(139, 240, 164, 0.3);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 18px rgba(139, 240, 164, 0.7);
  }
}

@keyframes orb-dot-pulse {
  0%, 100% {
    background: var(--phosphor);
    box-shadow: 0 0 4px var(--phosphor);
  }
  50% {
    background: var(--phosphor-bright);
    box-shadow: 0 0 10px var(--phosphor-bright);
  }
}

.nav-orb.active {
  animation: orb-pulse 1.3s ease-in-out infinite;
}
.nav-orb.active::after {
  animation: orb-dot-pulse 1.3s ease-in-out infinite;
}

/* ─── Screen Body ─────────────────────────────── */

.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.screen-body::-webkit-scrollbar { width: 4px; }
.screen-body::-webkit-scrollbar-track { background: transparent; }
.screen-body::-webkit-scrollbar-thumb { background: var(--phosphor-faint); border-radius: 2px; }

.view-panel {
  height: 100%;
  overflow-y: auto;
}

.view-panel::-webkit-scrollbar { width: 4px; }
.view-panel::-webkit-scrollbar-track { background: transparent; }
.view-panel::-webkit-scrollbar-thumb { background: var(--phosphor-faint); border-radius: 2px; }

.badge-count {
  font-size: 9px;
  font-weight: 600;
  background: var(--lavender);
  color: var(--bg);
  border-radius: 8px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ─── Loading State ───────────────────────────── */

.loading {
  padding: 20px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--phosphor-dim);
  text-align: center;
}

/* ─── Two-Column Layout (Today view) ──────────── */

.two-col-layout {
  display: grid;
  /* Landscape screen: Today column narrower (focused list), All Tasks wider (more detail) */
  grid-template-columns: 2fr 3fr;
  gap: 0;
  height: 100%;
}

.col-today, .col-all {
  overflow-y: auto;
  padding-bottom: 8px;
}

.col-today {
  border-right: 1px solid var(--phosphor-faint);
}

.col-today::-webkit-scrollbar,
.col-all::-webkit-scrollbar { width: 3px; }
.col-today::-webkit-scrollbar-track,
.col-all::-webkit-scrollbar-track { background: transparent; }
.col-today::-webkit-scrollbar-thumb,
.col-all::-webkit-scrollbar-thumb { background: var(--phosphor-faint); border-radius: 2px; }

.col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 4px;
  border-bottom: 1px solid rgba(139, 240, 164, 0.08);
}

.col-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--phosphor-dim);
}

.pulse-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--phosphor-faint);
  letter-spacing: 0.02em;
}

/* ─── Section Labels ──────────────────────────── */

.section-label {
  padding: 6px 16px 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--phosphor-faint);
}

/* ─── Task Items ──────────────────────────────── */

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 16px;
  cursor: default;
  transition: background 0.15s;
  position: relative;
}

.task-item:hover {
  background: rgba(139, 240, 164, 0.04);
}

.task-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1.5px solid var(--phosphor-dim);
  border-radius: 3px;
  background: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

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

.task-check.done {
  border-color: var(--phosphor-faint);
}

.task-check.done::after {
  content: '\2713';
  position: absolute;
  top: -2px;
  left: 2px;
  font-size: 12px;
  color: var(--phosphor-faint);
}

.task-today-indicator {
  flex-shrink: 0;
  width: 16px;
  font-size: 14px;
  line-height: 16px;
  text-align: center;
  color: var(--phosphor-faint);
  cursor: default;
  user-select: none;
}

.task-item.on-today {
  font-style: italic;
  font-size: 0.9em;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-content);
  line-height: 1.4;
}

.task-item.completed .task-title {
  color: var(--phosphor-dim);
  text-decoration: line-through;
}

.task-meta {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.task-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--phosphor-dim);
}

.task-tag.overdue { color: var(--text-content); }
.task-tag.today { color: var(--phosphor-bright); }
.task-tag.sched { color: var(--lavender); }
.task-tag.priority-high { color: var(--lavender); }

/* ─── Today Column Items ──────────────────────── */

.today-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-content);
  transition: background 0.1s;
  line-height: 1.4;
}

.today-item[draggable="true"] { cursor: grab; }
.today-item.dragging { opacity: 0.4; }

.today-item:hover {
  background: rgba(139, 240, 164, 0.06);
}

.today-item.done {
  color: var(--phosphor-dim);
}

.today-item.done .item-title {
  text-decoration: line-through;
}

.today-item.done:hover {
  background: rgba(139, 240, 164, 0.03);
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── Triage Items ────────────────────────────── */

.triage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  gap: 8px;
}

.triage-item .item-title {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-content);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.triage-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.triage-btn {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid var(--phosphor-faint);
  background: none;
  cursor: pointer;
  transition: all 0.15s;
}

.triage-btn-yes {
  color: var(--phosphor);
}

.triage-btn-yes:hover {
  background: rgba(139, 240, 164, 0.15);
  border-color: var(--phosphor);
}

.triage-btn-no {
  color: var(--fg-muted);
}

.triage-btn-no:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ─── Empty States ────────────────────────────── */

.today-empty-state,
.extractions-empty {
  padding: 16px 16px;
  text-align: center;
}

.today-empty-state p,
.extractions-empty p {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--phosphor-dim);
  margin-bottom: 4px;
}

.empty-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--phosphor-faint);
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
}

.empty-state h2 {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phosphor);
  margin: 0 0 12px;
  font-weight: 500;
}

.empty-state p {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--phosphor-dim);
  margin: 0;
}

/* ─── Task Content (two-line display) ────────── */

.task-content {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-secondary);
  line-height: 1.4;
  margin-top: 1px;
  white-space: normal;
  word-wrap: break-word;
}

.item-content {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-secondary);
  line-height: 1.4;
  margin-top: 2px;
  white-space: normal;
  word-wrap: break-word;
}

/* ─── Task Notes (subtitle line) ────────────── */

.task-notes {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--fg-muted);
  line-height: 1.4;
  margin-top: 0.125rem;
  white-space: normal;
  word-wrap: break-word;
}

/* Notes should NOT get strikethrough when task is done */
.today-item.done .task-notes,
.task-item.completed .task-notes {
  text-decoration: none;
}

/* Wrapper for today item title + notes */
.today-item-body {
  flex: 1;
  min-width: 0;
}

/* ─── Done Count ─────────────────────────────── */

.done-count {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  color: var(--phosphor-faint);
  letter-spacing: 0.02em;
}

/* Confirmation flash */
@keyframes confirm-flash {
  0% { background-color: rgba(201, 184, 150, 0.15); }
  100% { background-color: transparent; }
}

.task-just-confirmed {
  animation: confirm-flash 0.6s ease-out;
}

/* ─── Knowledge / Entity Approval (F3) ────────── */

.knowledge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 6px;
  border-bottom: 1px solid rgba(139, 240, 164, 0.08);
}

.knowledge-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--phosphor-dim);
}

.confirm-all-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid var(--phosphor-faint);
  border-radius: 3px;
  background: none;
  color: var(--phosphor);
  cursor: pointer;
  transition: all 0.15s;
}

.confirm-all-btn:hover {
  background: rgba(139, 240, 164, 0.12);
  border-color: var(--phosphor);
  color: var(--phosphor-bright);
}

.confirm-all-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Extraction cards */
.extraction-card {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.15s;
}

.extraction-card:hover {
  background: rgba(139, 240, 164, 0.03);
}

.extraction-card.relationship {
  border-left: 2px solid rgba(167, 139, 250, 0.3);
}

.extraction-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.extraction-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--phosphor-dim);
  border-radius: 3px;
  background: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.extraction-check input[type="checkbox"]:checked {
  border-color: var(--phosphor);
  background: rgba(139, 240, 164, 0.15);
}

.extraction-check input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 12px;
  color: var(--phosphor-bright);
}

.entity-type {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phosphor);
  background: rgba(139, 240, 164, 0.1);
  border: 1px solid var(--phosphor-faint);
  border-radius: 2px;
  padding: 1px 5px;
}

.entity-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-content);
}

.rel-label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-content);
}

.rel-type {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lavender);
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 2px;
  padding: 1px 5px;
  margin-left: 8px;
}

.extraction-detail {
  padding: 4px 0 2px 26px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-secondary);
}

/* ─── Settings View (F3) ──────────────────────── */

.settings-content {
  padding: 16px;
}

.settings-section {
  padding: 8px 0;
  border-bottom: 1px solid rgba(139, 240, 164, 0.06);
}

.settings-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--phosphor-dim);
  margin-bottom: 4px;
}

.settings-value {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-content);
}

.settings-group {
  margin-bottom: 20px;
}

.settings-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--phosphor-dim);
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(139, 240, 164, 0.12);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.settings-row .settings-label {
  flex: 0 0 90px;
  margin-bottom: 0;
}

.settings-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(139, 240, 164, 0.18);
  color: var(--text-content);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 2px;
}

.settings-input:focus {
  outline: none;
  border-color: var(--phosphor);
}

.settings-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--phosphor);
}

.settings-status-line {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--phosphor-dim);
  text-align: right;
  min-height: 14px;
  margin-top: 8px;
}

/* ─── Voice Panel ────────────────────────────── */
/* Bottom-anchored inside .screen. Three-column: HVM | Chat | AVM.
   Hidden by default, shown via .open class. VP-B adds VU meters,
   VP-C rebuilds chat, VP-D adds dynamic height + mobile PTT. */

/* Floated above the screen content with an inset so the meters aren't clipped
   against the CRT housing. Stitch reference is 48px left/right + 24px bottom
   from the viewport — scaled slightly here since our container is .screen,
   not the viewport. */
.voice-panel {
  position: absolute;
  bottom: 16px;
  left: var(--vp-left, 28px);
  right: var(--vp-right, 28px);
  height: 155px;
  background: #141414;
  border: 1px solid rgba(139, 240, 164, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  z-index: 8;
  transform: translateY(calc(100% + 16px));
  transition: transform 0.25s ease;
}

.voice-panel.open {
  transform: translateY(0);
}

.voice-panel.ptt-active {
  border-color: var(--phosphor-dim);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8),
              inset 0 0 16px rgba(139, 240, 164, 0.18);
}

/* Dashboard scroll clearance when VP is open. The two columns (.col-today,
   .col-all) are the actual scroll containers — applying padding to their
   ancestors too (.view-panel, .screen-body) stacks spatially and produces
   double/triple/quadruple empty gaps at the bottom. 155(VP) + 16(inset) +
   16(breathing) = 187px. */
body:has(.voice-panel.open) .col-today,
body:has(.voice-panel.open) .col-all {
  padding-bottom: 187px;
}

/* ── VP Status Bar ───────────────────────────── */

.vp-status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* Atmospheric glow behind status text */
.vp-status-bar::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 100%;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  filter: blur(15px);
  opacity: 0;
  transition: opacity 0.3s, background 0.3s;
  pointer-events: none;
}

.vp-status-text {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--phosphor-dim);
  text-align: center;
  position: relative;
  z-index: 1;
  transition: color 0.3s;
}

/* ── VP Status States ────────────────────────── */
/* 6 canonical states driven by [data-state] on .vp-status-bar */

.vp-status-bar[data-state="offline"] .vp-status-text {
  color: var(--fg-muted);
}

.vp-status-bar[data-state="connecting"] .vp-status-text {
  color: var(--phosphor-dim);
}
.vp-status-bar[data-state="connecting"]::before {
  background: rgba(139, 240, 164, 0.1);
  opacity: 1;
  animation: vp-glow-pulse 2s ease-in-out infinite;
}

.vp-status-bar[data-state="ready"] .vp-status-text {
  color: var(--phosphor);
}
.vp-status-bar[data-state="ready"]::before {
  background: rgba(139, 240, 164, 0.08);
  opacity: 1;
}

.vp-status-bar[data-state="listening"] .vp-status-text {
  color: var(--phosphor-bright);
}
.vp-status-bar[data-state="listening"]::before {
  background: rgba(139, 240, 164, 0.2);
  opacity: 1;
  animation: vp-glow-pulse 1.2s ease-in-out infinite;
}

.vp-status-bar[data-state="speaking"] .vp-status-text {
  color: var(--gold);
}
.vp-status-bar[data-state="speaking"]::before {
  background: rgba(201, 184, 150, 0.15);
  opacity: 1;
}

.vp-status-bar[data-state="working"] .vp-status-text {
  color: var(--gold);
}
.vp-status-bar[data-state="working"]::before {
  background: rgba(201, 184, 150, 0.12);
  opacity: 1;
  animation: vp-glow-pulse 1.5s ease-in-out infinite;
}

/* Wave H — WORKING_CONTINUATION: same gold family as WORKING but visually
   distinct via a faster, breathing pulse + a softly-pulsing trailing ellipsis.
   Triggered by .working-continuation class (independent of [data-state] so
   the underlying state can remain 'working' for orb/PTT semantics). */
.vp-status-bar.working-continuation .vp-status-text {
  color: var(--gold);
}
.vp-status-bar.working-continuation .vp-status-text::after {
  content: ' \2022\2022\2022';
  letter-spacing: 0.1em;
  margin-left: 0.4em;
  display: inline-block;
  animation: vp-continuation-dots 1.2s ease-in-out infinite;
}
.vp-status-bar.working-continuation::before {
  background: rgba(201, 184, 150, 0.18);
  opacity: 1;
  animation: vp-continuation-pulse 1.2s ease-in-out infinite;
}

@keyframes vp-glow-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes vp-continuation-pulse {
  0%, 100% { opacity: 0.45; transform: translateX(-50%) scale(0.92); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

@keyframes vp-continuation-dots {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* QUEUED badge — surfaced when a PTT is queued during WORKING_CONTINUATION.
   Sits to the right of the status text. Phosphor-bright so it's unambiguous
   that input was received but is being held. */
.vp-queued-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--phosphor-bright);
  margin-left: 10px;
  padding: 1px 5px;
  border: 1px solid var(--phosphor-bright);
  border-radius: 2px;
  position: relative;
  z-index: 1;
  animation: vp-queued-pulse 0.9s ease-in-out infinite;
}
.vp-queued-badge[hidden] { display: none; }

@keyframes vp-queued-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* ── VP Body (three-column) ─────────────────── */

.vp-body {
  flex: 1;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  min-height: 0;
}

/* ── VP Meter Columns (HVM / AVM) ──────────────── */

.vp-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px 4px;
  overflow: hidden;
}

/* AVM now on the left, HVM on the right (swap from prior layout).
   Inner borders separate each meter column from the central chat. */
.vp-avm {
  border-right: 1px solid var(--border);
}

.vp-hvm {
  border-left: 1px solid var(--border);
}

.vp-meter-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--phosphor-faint);
  flex-shrink: 0;
  margin-bottom: 4px;
}

/* VU meter: 12 vertical rows, bottom-to-top fill */
.vu-column {
  display: flex;
  flex-direction: column-reverse; /* bottom-to-top: row 0 at bottom */
  flex: 1;
  justify-content: flex-start;
  align-items: center;
  min-height: 0;
}

.vu-row {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.1;
  display: block;
  text-align: center;
  width: 100%;
}

/* HVM (human) — phosphor gradient, matches LISTENING state + green dashboard labels */
.vp-hvm .vu-row.b0 { color: #1a3a22; }
.vp-hvm .vu-row.b1 { color: var(--phosphor-dim); }
.vp-hvm .vu-row.b2 { color: var(--phosphor); }
.vp-hvm .vu-row.b3 { color: var(--phosphor-bright); }

/* AVM (agent) — gold gradient, matches SPEAKING state */
.vp-avm .vu-row.b0 { color: #2a2518; }
.vp-avm .vu-row.b1 { color: #8a7a52; }
.vp-avm .vu-row.b2 { color: #b0a070; }
.vp-avm .vu-row.b3 { color: var(--gold); }

/* ── VP Chat (transcript compatibility shim) ── */

.vp-chat {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vp-chat::-webkit-scrollbar { width: 3px; }
.vp-chat::-webkit-scrollbar-track { background: transparent; }
.vp-chat::-webkit-scrollbar-thumb { background: var(--phosphor-faint); border-radius: 2px; }

.transcript-entry {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.45;
  word-wrap: break-word;
  background: transparent;
  border-radius: 0;
  border: 0;
  transition: font-size 0.15s ease, opacity 0.15s ease;
}

/* Reverse-chronological hierarchy — first child is newest (prepended).
   Each tier is 2pt down from before; paired with a shorter panel this
   preserves the number of visible turns while reclaiming vertical space. */
.vp-chat .transcript-entry:nth-child(1),
.vp-chat .transcript-entry:nth-child(2) {
  font-size: 14px;
  line-height: 1.4;
  opacity: 1;
}

.vp-chat .transcript-entry:nth-child(3),
.vp-chat .transcript-entry:nth-child(4) {
  font-size: 11px;
  opacity: 0.8;
}

.vp-chat .transcript-entry:nth-child(n+5) {
  font-size: 10px;
  opacity: 0.5;
}

.vp-chat .transcript-entry:nth-child(n+7) {
  opacity: 0.3;
}

/* Stitch design: border-bar only, no bubble. User right-aligned with phosphor
   right-border; agent left-aligned with gold left-border. */
.transcript-entry.user {
  align-self: flex-end;
  text-align: right;
  border-right: 2px solid var(--phosphor);
  padding-right: 12px;
  color: var(--fg);
  max-width: 85%;
}

.transcript-entry.agent {
  align-self: flex-start;
  text-align: left;
  border-left: 2px solid var(--gold);
  padding-left: 12px;
  color: #a3a3a3;
  max-width: 85%;
}

.transcript-entry.system {
  align-self: center;
  color: var(--phosphor-faint);
  font-style: italic;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* User bubble structure: a single .transcript-entry.user holds the whole
   open turn — .user-committed above, .user-interim below. Both are display:block
   so reading order within the bubble is top-to-bottom (conventional), even
   though the bubble itself is near the top of the reverse-chronological thread.
   .user-interim is visually provisional (faded, italic, dashed underline); once
   the final arrives, text moves from .user-interim to .user-committed and the
   interim span empties. :empty keeps the bubble collapsed to one line when no
   interim is pending. */
.transcript-entry.user .user-committed,
.transcript-entry.user .user-interim {
  display: block;
}

.transcript-entry.user .user-committed:empty,
.transcript-entry.user .user-interim:empty {
  display: none;
}

.transcript-entry.user .user-interim {
  opacity: 0.5;
  font-style: italic;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 1px;
  margin-top: 2px;
}

/* Wave Meta-Mode (Phase 1B) — when Cmd+Spacebar PTT fires, voice.js sets
   currentTurnMode='meta' and app.js adds .meta-mode to the active user
   bubble. Lavender right-border overrides the default phosphor border;
   ::before pseudo-element provides a small META label affordance so Mat
   (voice-first) can see the mode at a glance. */
.transcript-entry.user.meta-mode {
  border-right-color: var(--lavender);
  position: relative;
  padding-top: 24px;
}

.transcript-entry.user.meta-mode::before {
  content: 'META';
  position: absolute;
  top: 6px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--lavender);
  background: var(--lavender-faint);
  padding: 2px 6px;
  border-radius: 2px;
}

/* ─── Project Groups (All Tasks column) ───────── */

.project-group {
  border-bottom: 1px solid rgba(139, 240, 164, 0.04);
}

.project-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.project-section-header:hover {
  background: rgba(139, 240, 164, 0.04);
}

.project-name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-secondary);
}

.project-task-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--phosphor-faint);
}

.project-chevron {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--fg-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
  line-height: 1;
}

.project-group.expanded .project-chevron {
  transform: rotate(90deg);
}

.health-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-red { background: var(--text-content); box-shadow: 0 0 4px rgba(232, 232, 232, 0.4); }
.health-amber { background: #f0d08b; box-shadow: 0 0 4px rgba(240, 208, 139, 0.4); }
.health-green { background: #4ade80; box-shadow: 0 0 4px rgba(74, 222, 128, 0.4); }
.health-grey { background: #555; }

.project-tasks {
  display: none;
  padding-bottom: 4px;
}

.project-group.expanded .project-tasks {
  display: block;
}

.project-group.expanded > .project-section-header {
  background: rgba(139, 240, 164, 0.04);
}

/* ─── Project Jobsheet ───────────────────────── */

.project-jobsheet {
  display: none;
  padding: 0.75rem 16px 0.75rem 28px;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--fg-secondary);
  word-break: break-word;
  border-left: 2px solid var(--border);
  margin: 4px 16px 8px 28px;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: 2px;
}

.project-group.expanded .project-jobsheet {
  display: block;
}

.project-jobsheet p {
  margin: 0 0 0.25rem;
}

.project-jobsheet br {
  display: block;
  content: '';
  margin: 0.25rem 0;
}

.project-jobsheet .jobsheet-h {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--fg);
  margin: 0.5rem 0 0.25rem;
  line-height: 1.3;
}

h3.jobsheet-h { font-size: 0.875rem; }
h4.jobsheet-h { font-size: 0.8125rem; }
h5.jobsheet-h { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }

.project-jobsheet .jobsheet-list {
  margin: 0.25rem 0 0.25rem 1rem;
  padding: 0;
  list-style: disc;
}

.project-jobsheet .jobsheet-list li {
  margin: 0.125rem 0;
}

.project-jobsheet .jobsheet-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  color: var(--fg);
}

.project-jobsheet strong {
  font-weight: 600;
  color: var(--fg);
}

.project-jobsheet em {
  font-style: italic;
  color: var(--fg-secondary);
}

/* ─── Alias Value (Knowledge View) ───────────── */

.alias-value {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--fg-secondary);
  margin-left: 6px;
}

.extraction-card.alias {
  border-left: 2px solid rgba(201, 184, 150, 0.3);
}

/* ─── Spinner ─────────────────────────────────── */

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

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--phosphor-faint);
  border-top-color: var(--phosphor);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ─── Archive (F2) — Archived projects ─────────── */

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 6px;
  border-bottom: 1px solid rgba(139, 240, 164, 0.08);
  gap: 16px;
}

.archive-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--phosphor-dim);
}

.archive-body {
  padding: 12px 16px 24px;
  overflow-y: auto;
}

.archive-loading,
.archive-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--phosphor-dim);
  padding: 24px 8px;
  text-align: center;
}

.archive-empty .empty-hint {
  margin-top: 6px;
  opacity: 0.6;
  font-size: 11px;
  line-height: 1.5;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.archive-row {
  border-top: 1px solid rgba(139, 240, 164, 0.06);
  font-size: 13px;
  line-height: 1.4;
}

.archive-row:last-child {
  border-bottom: 1px solid rgba(139, 240, 164, 0.06);
}

.archive-row-summary {
  display: grid;
  grid-template-columns: 18px 1fr auto auto 14px;
  gap: 12px;
  align-items: baseline;
  padding: 8px 6px;
  cursor: pointer;
  transition: background 120ms;
}

.archive-row-summary:hover {
  background: rgba(139, 240, 164, 0.04);
}

.archive-marker {
  font-family: var(--font-mono);
  text-align: center;
  opacity: 0.7;
}

.archive-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-refcode {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--phosphor-dim);
  padding: 1px 6px;
  border: 1px solid rgba(139, 240, 164, 0.18);
  border-radius: 2px;
}

.archive-when {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.55;
  white-space: nowrap;
}

.archive-caret {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.45;
  transition: transform 150ms;
  display: inline-block;
}

.archive-row.expanded .archive-caret {
  transform: rotate(90deg);
  opacity: 0.8;
}

.archive-jobsheet {
  display: none;
  padding: 10px 14px 14px 38px;
  background: rgba(139, 240, 164, 0.02);
  border-top: 1px dashed rgba(139, 240, 164, 0.1);
}

.archive-row.expanded .archive-jobsheet {
  display: block;
}

.archive-jobsheet-text {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 10px;
  color: inherit;
  opacity: 0.85;
}

.archive-jobsheet-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--phosphor-dim);
  opacity: 0.55;
  padding: 6px 0 10px;
}

.archive-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(139, 240, 164, 0.06);
}

.archive-unarchive-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: var(--phosphor-dim);
  border: 1px solid rgba(139, 240, 164, 0.2);
  padding: 4px 10px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.archive-unarchive-btn:hover {
  color: var(--phosphor, #8bf0a4);
  border-color: rgba(139, 240, 164, 0.45);
  background: rgba(139, 240, 164, 0.06);
}

.archive-unarchive-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Responsive: Mobile Flat Layout ────────── */

@media (max-width: 767px) {
  .nav-label-full { display: none; }
  .nav-label-short { display: inline; }
  .nav-orb { margin: 0 10px; }
  .nav-key { padding: 8px 10px; }
}

body.mobile-flat .scene {
  position: static;
  width: 100% !important;
  height: auto !important;
  overflow: visible;
}

body.mobile-flat .monitor {
  position: static;
  width: 100%;
  height: auto;
  transform: none;
  border-radius: 0;
}

body.mobile-flat .bezel {
  border-radius: 0;
}

body.mobile-flat .bezel::before {
  display: none;
}

body.mobile-flat .crt-overlay {
  display: none;
}

body.mobile-flat .screen {
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  -webkit-mask-image: none;
  mask-image: none;
  font-size: 14px;
  height: 100vh;
  height: 100dvh;
}

/* Mobile VP: tighter inset than desktop — viewport edge is the clipping concern,
   not the housing. 12px matches the scroll-snap column padding.
   Height matches desktop (180px) — reverse-chronological + nth-child hierarchy
   keeps the newest exchange legible without stealing dashboard real estate. */
body.mobile-flat .voice-panel {
  left: 12px;
  right: 12px;
  bottom: 12px;
}

/* Remove scanlines + bloom on mobile */
body.mobile-flat .screen::before,
body.mobile-flat .screen::after {
  display: none;
}

/* Horizontal scroll-snap between Today and All Tasks */
body.mobile-flat .two-col-layout {
  grid-template-columns: 100vw 100vw;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

body.mobile-flat .col-today,
body.mobile-flat .col-all {
  scroll-snap-align: start;
  min-width: 100vw;
  padding-left: 12px;
  padding-right: 12px;
}

body.mobile-flat .col-today {
  border-right: none;
}

/* ─── Knowledge View (F4) — W-1 three-sub-tab ──── */

#view-knowledge {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.knowledge-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid rgba(139, 240, 164, 0.08);
}

.knowledge-tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--phosphor-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 14px;
  cursor: pointer;
  transition: color 120ms, background 120ms, border-color 120ms;
  border-radius: 2px 2px 0 0;
}

.knowledge-tab:hover {
  color: var(--phosphor-dim);
  background: rgba(139, 240, 164, 0.04);
}

.knowledge-tab.active {
  color: var(--phosphor);
  background: rgba(139, 240, 164, 0.08);
  border-color: rgba(139, 240, 164, 0.25);
  border-bottom: 1px solid var(--bg-card);
  margin-bottom: -1px;
}

.knowledge-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
  overflow-y: auto;
  min-height: 0;
}

.knowledge-panel[hidden] {
  display: none;
}

/* Document meta strip (version + updated + dirty badge) */
.doc-meta-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phosphor-dim);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(139, 240, 164, 0.06);
}

.doc-meta-version,
.doc-meta-updated {
  white-space: nowrap;
}

.doc-dirty-badge {
  margin-left: auto;
  color: var(--gold);
  border: 1px solid rgba(201, 184, 150, 0.4);
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 9px;
  letter-spacing: 0.1em;
}

/* Textarea editor (shared between AWARE + CONSTRAINTS) */
.doc-editor {
  flex: 1;
  min-height: 280px;
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(139, 240, 164, 0.18);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: 2px;
  resize: vertical;
  outline: none;
  tab-size: 2;
}

.doc-editor:focus {
  border-color: var(--phosphor);
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
}

.doc-save-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--phosphor-dim);
  border: 1px solid rgba(139, 240, 164, 0.25);
  padding: 5px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}

.doc-save-btn:hover:not(:disabled) {
  color: var(--phosphor);
  border-color: rgba(139, 240, 164, 0.5);
  background: rgba(139, 240, 164, 0.06);
}

.doc-save-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.doc-status-line {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--phosphor-dim);
  letter-spacing: 0.05em;
  min-height: 14px;
}

.doc-status-ok { color: var(--phosphor); }
.doc-status-error { color: #f08b8b; }

/* Recall sub-tab */
.recall-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.recall-search {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(139, 240, 164, 0.18);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 2px;
  outline: none;
}

.recall-search:focus {
  border-color: var(--phosphor);
}

.recall-add-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--phosphor-dim);
  border: 1px solid rgba(139, 240, 164, 0.25);
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
  white-space: nowrap;
}

.recall-add-btn:hover {
  color: var(--phosphor);
  border-color: rgba(139, 240, 164, 0.5);
  background: rgba(139, 240, 164, 0.06);
}

.recall-add-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(139, 240, 164, 0.18);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.2);
}

.recall-add-content,
.recall-add-aliases {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(139, 240, 164, 0.18);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 2px;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
}

.recall-add-content:focus,
.recall-add-aliases:focus {
  border-color: var(--phosphor);
}

.recall-add-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recall-add-cancel {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--phosphor-faint);
  border: 1px solid rgba(139, 240, 164, 0.12);
  padding: 5px 12px;
  border-radius: 2px;
  cursor: pointer;
}

.recall-add-cancel:hover {
  color: var(--phosphor-dim);
}

.recall-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recall-loading,
.recall-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--phosphor-dim);
  padding: 24px 8px;
  text-align: center;
}

.recall-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 6px;
  border-top: 1px solid rgba(139, 240, 164, 0.06);
  transition: opacity 180ms;
}

.recall-row:last-child {
  border-bottom: 1px solid rgba(139, 240, 164, 0.06);
}

.recall-row:hover {
  background: rgba(139, 240, 164, 0.03);
}

.recall-row-deleting {
  opacity: 0;
}

.recall-row-body {
  flex: 1;
  min-width: 0;
}

.recall-content {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.recall-aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.recall-alias {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--phosphor-dim);
  background: rgba(139, 240, 164, 0.06);
  border: 1px solid rgba(139, 240, 164, 0.15);
  padding: 1px 5px;
  border-radius: 2px;
}

.recall-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--phosphor-faint);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.recall-row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.recall-icon-btn {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--phosphor-faint);
  border: 1px solid rgba(139, 240, 164, 0.15);
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}

.recall-icon-btn:hover {
  color: var(--phosphor);
  border-color: rgba(139, 240, 164, 0.4);
}

.recall-delete-btn:hover {
  color: #f08b8b;
  border-color: rgba(240, 139, 139, 0.4);
}

.recall-row-editing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(139, 240, 164, 0.25);
  background: rgba(0, 0, 0, 0.2);
}

.recall-edit-content {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(139, 240, 164, 0.18);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 2px;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
}

.recall-edit-content:focus {
  border-color: var(--phosphor);
}

.recall-edit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recall-edit-cancel {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--phosphor-faint);
  border: 1px solid rgba(139, 240, 164, 0.12);
  padding: 5px 12px;
  border-radius: 2px;
  cursor: pointer;
}

.recall-edit-cancel:hover {
  color: var(--phosphor-dim);
}

/* ─── NEXT per project card (All Tasks column) ── */
.next-section {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--phosphor-faint);
}
.next-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 16px;
  font-size: 12px;
}
.next-project {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phosphor-dim);
  flex-shrink: 0;
}
.next-title {
  color: var(--phosphor);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.next-urgent {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  flex-shrink: 0;
}
.next-due {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--phosphor-dim);
  flex-shrink: 0;
}

/* ── BRIEFING sub-tab (read-only, migration 0037) ───────── */

.briefing-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.briefing-meta-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phosphor-dim);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(139, 240, 164, 0.06);
}

.briefing-week {
  color: var(--phosphor-bright);
}

.briefing-body {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--phosphor);
  white-space: pre-wrap;
  word-break: break-word;
}

.briefing-annotations {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(139, 240, 164, 0.06);
}

.briefing-annotations-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phosphor-dim);
  margin-bottom: 8px;
}

.briefing-annotation {
  margin-bottom: 10px;
}

.briefing-annotation-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--phosphor-dim);
  margin-bottom: 2px;
}

.briefing-annotation-body {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--phosphor);
  white-space: pre-wrap;
  word-break: break-word;
}
