/* ────────────────────────────────────────────────────────
   JB Brain — dark theme
   ──────────────────────────────────────────────────────── */

:root {
  /* page */
  --bg: #0a0e16;
  --bg-deep: #060911;
  --bg-card: #131826;
  --bg-card-hover: #182032;
  --bg-soft: #1a2030;
  --bg-softer: #20283a;
  --bg-input: #0e131e;

  /* text */
  --fg: #e5e7eb;
  --fg-muted: #9ca3af;
  --fg-faint: #6b7280;
  --fg-hint: #4b5563;

  /* borders */
  --border: #1f2a3d;
  --border-strong: #2a3a55;
  --border-faint: #161e2c;

  /* accent (cyan → teal gradient) */
  --accent-1: #06b6d4;
  --accent-2: #14b8a6;
  --accent: #2dd4bf;
  --accent-soft: #14b8a6;
  --accent-glow: rgba(45, 212, 191, 0.18);
  --accent-glow-strong: rgba(45, 212, 191, 0.35);
  --accent-grad: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);

  /* status */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* priority */
  --pri-today: #ef4444;
  --pri-today-bg: rgba(239, 68, 68, 0.12);
  --pri-week: #f59e0b;
  --pri-week-bg: rgba(245, 158, 11, 0.12);
  --pri-someday: #3b82f6;
  --pri-someday-bg: rgba(59, 130, 246, 0.12);
  --pri-parked: #6b7280;
  --pri-parked-bg: rgba(107, 114, 128, 0.12);

  /* layout */
  --sidebar-w: 232px;
  --topbar-h: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 0 1px var(--accent-glow), 0 4px 24px var(--accent-glow);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body.dark { color-scheme: dark; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

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

kbd {
  display: inline-block;
  padding: 1px 6px;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--fg-muted);
  vertical-align: baseline;
}

::selection { background: var(--accent-glow-strong); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.error { color: var(--error); font-size: 13px; }

/* ─── Login ─────────────────────────────────────────────── */

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at top, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(6, 182, 212, 0.05) 0%, transparent 60%),
    var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 32px 28px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.login-card h1 {
  margin: 16px 0 24px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login-card form { display: grid; gap: 12px; }

.login-card input {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-card button {
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent-grad);
  color: #021214;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: filter 0.15s, transform 0.05s;
}

.login-card button:hover { filter: brightness(1.06); }
.login-card button:active { transform: translateY(1px); }

/* ─── Brand mark ────────────────────────────────────────── */

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-grad);
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-glow-strong);
}

.brand-mark svg { width: 100%; height: 100%; }

.brand-mark.large {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin: 0 auto;
}

/* ─── App shell ─────────────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────── */

.sidebar {
  background: var(--bg-deep);
  border-right: 1px solid var(--border-faint);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 8px;
  text-decoration: none;
  color: var(--fg);
}

.brand:hover { text-decoration: none; }

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.nav-item:hover {
  background: var(--bg-soft);
  color: var(--fg);
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.nav-item.active .nav-icon { color: var(--accent); }

.nav-icon {
  width: 18px;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  color: var(--fg-faint);
}

.nav-label { flex: 1; }

.nav-item.soon { cursor: default; }
.nav-item.soon:hover { background: transparent; color: var(--fg-muted); }

.nav-item.ext { text-decoration: none; }
.nav-item.ext:hover { text-decoration: none; }

.ext-arrow {
  font-size: 11px;
  color: var(--fg-faint);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.nav-item.ext:hover .ext-arrow { opacity: 1; }

.soon-tag {
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--fg-faint);
  text-transform: uppercase;
  font-weight: 600;
}

.nav-section { display: grid; gap: 6px; }

.nav-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--fg-faint);
  text-transform: uppercase;
}

.nav-spaces { display: flex; flex-direction: column; gap: 2px; }

.space-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: 13px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.space-item:hover { background: var(--bg-soft); color: var(--fg); }
.space-item.active { background: var(--accent-glow); color: var(--accent); }

.space-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-grad);
  flex-shrink: 0;
}

.space-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}

.sidebar-footer { margin-top: auto; }

.upgrade-card {
  background: linear-gradient(160deg, rgba(20, 184, 166, 0.08), rgba(6, 182, 212, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: left;
}

.upgrade-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--accent-grad);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 8px;
}

.upgrade-card h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.upgrade-card p {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.4;
}

.upgrade-btn {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
}

.upgrade-btn:disabled { cursor: not-allowed; opacity: 0.7; }

/* ─── Main area ─────────────────────────────────────────── */

.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ─── Topbar ────────────────────────────────────────────── */

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-faint);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 16px;
  color: var(--fg-faint);
  pointer-events: none;
}

.search-wrap kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.quick-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent-grad);
  color: #021214;
  font-weight: 600;
  font-size: 13px;
  transition: filter 0.15s;
}

.quick-add:hover { filter: brightness(1.06); }
.quick-add .plus { font-size: 16px; line-height: 0.8; margin-top: -2px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-muted);
  display: grid;
  place-items: center;
  position: relative;
  transition: background 0.12s, color 0.12s;
}

.icon-btn:hover { background: var(--bg-card); color: var(--fg); }
.icon-btn .icon { font-size: 16px; }

.icon-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--error);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 999px;
  min-width: 14px;
  text-align: center;
}

.profile-wrap { position: relative; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  display: grid;
  place-items: center;
}

.avatar:hover { border-color: var(--accent); }

.profile-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-md);
  min-width: 140px;
  z-index: 30;
}

.profile-menu button {
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.profile-menu button:hover { background: var(--bg-soft); color: var(--fg); }

/* ─── Generic buttons ───────────────────────────────────── */

.primary-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent-grad);
  color: #021214;
  font-weight: 600;
  font-size: 13px;
  transition: filter 0.15s;
}

.primary-btn:hover { filter: brightness(1.06); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

.ghost-btn {
  padding: 6px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: background 0.12s, color 0.12s;
}

.ghost-btn:hover { background: var(--bg-soft); color: var(--fg); }
.ghost-btn.icon-only { width: 28px; height: 28px; padding: 0; display: inline-grid; place-items: center; }
.ghost-btn.small { font-size: 11px; padding: 4px 10px; }
.ghost-btn.disabled, .ghost-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ─── Views ─────────────────────────────────────────────── */

.view {
  flex: 1;
  padding: 24px 28px 64px;
  min-width: 0;
}

/* ─── Dashboard grid ────────────────────────────────────── */

.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "hero hero brain brain"
    "capt capt brain brain"
    "today projects ideas suggest"
    "schedule schedule recent recent"
    "focus focus auto auto"
    "moment moment moment moment";
}

.card.hero { grid-area: hero; }
.card.capture { grid-area: capt; }
.card.connected-brain { grid-area: brain; }
.card.priorities { grid-area: today; }
.card.projects { grid-area: projects; }
.card.ideas { grid-area: ideas; }
.card.suggestions { grid-area: suggest; }
.card.schedule { grid-area: schedule; }
.card.recent { grid-area: recent; }
.card.focus { grid-area: focus; }
.card.automations { grid-area: auto; }
.card.momentum { grid-area: moment; }

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "hero hero"
      "capt capt"
      "brain brain"
      "today projects"
      "ideas suggest"
      "schedule recent"
      "focus auto"
      "moment moment";
  }
}

@media (max-width: 720px) {
  .dashboard-grid { grid-template-columns: 1fr; grid-template-areas: none; }
  .dashboard-grid > * { grid-area: auto !important; }
  .sidebar { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .view { padding: 16px; }
}

/* ─── Cards (generic) ───────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

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

.card-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card-header .count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  background: var(--bg-soft);
  border-radius: 999px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.num-badge {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--fg-faint);
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}

.card-bolt, .card-spark, .card-cal { color: var(--accent); font-size: 14px; }

.card-link {
  font-size: 12px;
  color: var(--accent);
  margin-top: auto;
  font-weight: 500;
  align-self: flex-start;
}

.card-link.disabled { color: var(--fg-faint); cursor: not-allowed; pointer-events: none; }

.card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--fg-faint);
  border-top: 1px solid var(--border-faint);
  padding-top: 10px;
  margin-top: auto;
}

.card-footer .meta-dot { opacity: 0.6; }
.card-footer span:first-child { color: var(--fg-muted); }

.placeholder-text {
  color: var(--fg-faint);
  font-size: 12px;
  margin: 0;
  line-height: 1.5;
}

.card.placeholder .card-link.disabled { margin-top: auto; }

/* ─── Hero card ─────────────────────────────────────────── */

.card.hero {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-deep) 100%);
  padding: 24px;
  gap: 6px;
}

.greeting {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}

.hero-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-sub {
  margin: 8px 0 0;
  color: var(--fg-muted);
  font-size: 14px;
}

.accent-link { color: var(--accent); }

/* ─── Capture card ──────────────────────────────────────── */

.card.capture {
  background: linear-gradient(160deg, rgba(20, 184, 166, 0.04), var(--bg-card));
  border-color: rgba(45, 212, 191, 0.18);
}

#capture-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  padding: 12px 14px;
  resize: none;
  outline: none;
  min-height: 60px;
  max-height: 320px;
  overflow: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#capture-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#capture-input:disabled { opacity: 0.7; }

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

.capture-icons {
  display: inline-flex;
  gap: 4px;
  color: var(--fg-faint);
}

.capture-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.capture-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-faint);
}

.capture-status {
  color: var(--accent);
  font-style: italic;
}
.capture-status::before { content: "✦ "; font-style: normal; }
.capture-status.error { color: var(--error); font-style: normal; }
.capture-status.error::before { content: "✕ "; }

.char-count { color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.char-count.warn { color: var(--warning); }
.char-count.danger { color: var(--error); }

/* ─── Connected Brain ───────────────────────────────────── */

.view-toggle {
  display: inline-flex;
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 2px;
  font-size: 11px;
  gap: 1px;
}

.view-toggle .toggle {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  border-radius: 4px;
  font-size: 11px;
}

.view-toggle .toggle.active {
  background: var(--bg-card);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}

.brain-svg-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 280px;
  position: relative;
}

.brain-svg-wrap svg { width: 100%; height: 100%; max-height: 320px; }

.brain-node-label {
  font-size: 11px;
  font-weight: 600;
  fill: var(--fg);
}

.brain-node-count {
  font-size: 10px;
  fill: var(--fg-muted);
}

/* ─── Priorities / task list ────────────────────────────── */

.task-list, .idea-list, .recent-list, .auto-list, .suggestion-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.task-list li,
.idea-list li,
.recent-list li,
.auto-list li,
.suggestion-list li {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-faint);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.task-list li:last-child,
.idea-list li:last-child,
.recent-list li:last-child,
.auto-list li:last-child,
.suggestion-list li:last-child { border-bottom: none; }

.task-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.12s;
}

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

.task-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.task-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
}

.task-space {
  font-size: 11px;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-time {
  font-size: 11px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.task-time.today { color: var(--pri-today); }

.add-task {
  margin-top: auto;
  padding: 6px 0;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  text-align: left;
}

.add-task:hover { color: var(--accent); }

/* ─── Idea / recent list items ──────────────────────────── */

.idea-icon, .recent-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-glow);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 11px;
  flex-shrink: 0;
}

.idea-text, .recent-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.idea-title, .recent-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idea-meta, .recent-meta {
  font-size: 11px;
  color: var(--fg-muted);
}

.idea-time, .recent-time {
  font-size: 11px;
  color: var(--fg-faint);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ─── Suggestions ───────────────────────────────────────── */

.suggestion-list li {
  align-items: center;
  border-bottom-style: dashed;
}

.suggestion-text {
  flex: 1;
  display: grid;
  gap: 1px;
}

.suggestion-text strong { font-weight: 600; font-size: 13px; }
.suggestion-text span { font-size: 11px; color: var(--fg-muted); }

/* ─── Auto list ─────────────────────────────────────────── */

.auto-list li {
  font-size: 12px;
  justify-content: space-between;
}

.auto-name { color: var(--fg-muted); }

.auto-status {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.auto-status.active { color: var(--success); }
.auto-status.scheduled { color: var(--warning); }

/* ─── Schedule (placeholder strip) ──────────────────────── */

.week-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--fg-muted);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 4px 0 8px;
}

.week-day {
  text-align: center;
  padding: 8px 4px;
  border-radius: 6px;
  background: var(--bg-soft);
  font-size: 11px;
  color: var(--fg-muted);
}

.week-day.today { background: var(--accent-glow); color: var(--accent); }

.week-day-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 2px;
}

.week-day-num { font-size: 14px; font-weight: 600; }

/* ─── Focus stats ───────────────────────────────────────── */

.focus-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.focus-stat {
  display: grid;
  gap: 2px;
}

.focus-stat .label {
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.focus-stat .value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ─── Momentum ──────────────────────────────────────────── */

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 6px;
}

.metric .label {
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}

.metric .value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.metric .delta {
  font-size: 11px;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.metric .sparkline {
  margin-top: 4px;
  height: 28px;
  display: block;
}

.momentum-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(6, 182, 212, 0.04));
  border: 1px solid rgba(45, 212, 191, 0.25);
  margin-top: 12px;
}

.callout-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-grad);
  color: #021214;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
}

.callout-text { display: grid; gap: 2px; }
.callout-text strong { font-size: 13px; font-weight: 600; }
.callout-text span { font-size: 12px; color: var(--fg-muted); }

.period-select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
}

/* ─── Empty mini text ───────────────────────────────────── */

.empty-mini {
  margin: 0;
  padding: 16px 0;
  text-align: center;
  font-size: 12px;
  color: var(--fg-faint);
}

/* ─── List view ─────────────────────────────────────────── */

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
  gap: 16px;
}

.list-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.list-sub {
  margin: 4px 0 0;
  color: var(--fg-muted);
  font-size: 13px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-faint);
  padding-bottom: 8px;
}

.tab {
  border: none;
  background: transparent;
  color: var(--fg-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, color 0.12s;
}

.tab:hover { background: var(--bg-soft); color: var(--fg); }
.tab.active { background: var(--accent-glow); color: var(--accent); }

.tab .count { font-size: 11px; opacity: 0.7; font-variant-numeric: tabular-nums; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  min-height: 24px;
}

.tag-chip {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg-muted);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.tag-chip:hover { border-color: var(--border-strong); color: var(--fg); }
.tag-chip.active { background: var(--accent); color: #021214; border-color: var(--accent); }
.tag-chip .count { font-size: 10px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.tag-chip.active .count { opacity: 0.85; }

/* ─── Items (list view) ─────────────────────────────────── */

.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  outline: none;
}

.item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  position: relative;
  transition: background 1.2s ease-out, border-color 0.12s, box-shadow 0.12s;
  animation: item-in 0.18s ease-out;
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.item:hover { border-color: var(--border-strong); }
.item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.item.flash { background: rgba(45, 212, 191, 0.12); }

.item-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.item-row-main { min-width: 0; flex: 1; }

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-muted);
  margin-bottom: 6px;
  align-items: center;
}

.time-ago {
  font-size: 11px;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 11px;
  white-space: nowrap;
}

.badge.priority-today { color: var(--pri-today); border-color: rgba(239,68,68,0.4); background: var(--pri-today-bg); }
.badge.priority-week { color: var(--pri-week); border-color: rgba(245,158,11,0.4); background: var(--pri-week-bg); }
.badge.priority-someday { color: var(--pri-someday); border-color: rgba(59,130,246,0.4); background: var(--pri-someday-bg); }
.badge.priority-parked { color: var(--pri-parked); }

.badge.status-inbox { color: var(--info); border-color: rgba(59,130,246,0.4); background: var(--pri-someday-bg); }
.badge.status-archived { color: var(--fg-faint); }

.badge.candidate {
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.08);
  color: var(--accent);
}

.badge.dup-of {
  border-color: rgba(245,158,11,0.4);
  background: var(--pri-week-bg);
  color: var(--pri-week);
  cursor: pointer;
}

.item-summary {
  font-size: 14px;
  margin: 0 0 4px;
  word-break: break-word;
}

.item-raw {
  font-size: 12px;
  color: var(--fg-muted);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item.expanded .item-raw {
  -webkit-line-clamp: unset;
  display: block;
}

.item-expanded {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: grid;
  gap: 12px;
}

.action-items-block h4 {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-faint);
  font-weight: 600;
}

.action-items {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

.action-items li { margin-bottom: 2px; }

.edit-block {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.edit-block label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.edit-block .field { display: block; }
.edit-block .field.full { grid-column: 1 / -1; }

.edit-block select,
.edit-block input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--fg);
  font-size: 13px;
  outline: none;
}

.edit-block select:focus,
.edit-block input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.item-actions button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--fg);
  transition: border-color 0.12s;
}

.item-actions button:hover { border-color: var(--accent); }
.item-actions button:disabled { cursor: not-allowed; opacity: 0.4; }
.item-actions .danger { color: var(--error); }
.item-actions .danger:hover { border-color: var(--error); }
.item-actions .primary {
  background: var(--accent-grad);
  color: #021214;
  border-color: transparent;
  font-weight: 600;
}

/* ─── Skeleton loading ──────────────────────────────────── */

.skeleton {
  cursor: default;
  pointer-events: none;
}

.skeleton .item-meta::before,
.skeleton .item-summary::before,
.skeleton .item-raw::before {
  content: "";
  display: block;
  background: linear-gradient(90deg, var(--bg-soft) 0%, var(--bg-softer) 50%, var(--bg-soft) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}

.skeleton .item-meta::before { height: 14px; width: 60%; margin-bottom: 8px; }
.skeleton .item-summary::before { height: 16px; width: 80%; margin-bottom: 6px; }
.skeleton .item-raw::before { height: 12px; width: 95%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Empty / error ─────────────────────────────────────── */

.empty {
  margin: 24px 0;
  color: var(--fg-faint);
  text-align: center;
  font-size: 13px;
}

/* ─── Help overlay ──────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
  animation: overlay-in 0.15s ease-out;
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.overlay-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-md);
}

.overlay-card h2 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

.shortcuts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 16px;
  margin: 0 0 20px;
  font-size: 13px;
}

.shortcuts dt {
  display: flex;
  gap: 4px;
  align-items: center;
}

.shortcuts dd {
  margin: 0;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
}

.overlay-card .primary-btn { width: 100%; }
