/* ============================================================
   THEME TOKENS — single source of truth for light + dark.
   Body gets a class (.light-theme / .dark-theme). Default = dark.
   ============================================================ */

:root {
  /* Core brand color gradients (shared between themes) */
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent-color: #818cf8;

  /* Area specific colors (shared) */
  --career-color: #6366f1;
  --finances-color: #10b981;
  --health-color: #f43f5e;
  --family-color: #f59e0b;
  --friends-color: #ec4899;
  --romance-color: #d946ef;
  --inner-life-color: #14b8a6;
  --fun-color: #eab308;
  --environment-color: #84cc16;
  --mission-color: #3b82f6;
}

/* DARK THEME (default) */
.dark-theme,
body:not(.light-theme) {
  --bg-dark: #090a0f;
  --bg-card: rgba(18, 20, 32, 0.65);
  --bg-card-solid: #12141d;
  --bg-input: rgba(0, 0, 0, 0.2);
  --bg-elev: rgba(255, 255, 255, 0.03);
  --bg-elev-hover: rgba(255, 255, 255, 0.05);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.2);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-on-accent: #ffffff;
  --header-bg: rgba(9, 10, 15, 0.8);
  --footer-bg: rgba(9, 10, 15, 0.9);
  --ai-panel-bg: rgba(15, 17, 26, 0.95);
  --kanban-col-bg: rgba(10, 11, 18, 0.5);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --placeholder-bg: rgba(255, 255, 255, 0.04);
  --placeholder-border: rgba(255, 255, 255, 0.06);
  --glow-opacity: 0.12;
}

/* LIGHT THEME */
.light-theme {
  --bg-dark: #f5f6fa;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --bg-input: #ffffff;
  --bg-elev: rgba(0, 0, 0, 0.025);
  --bg-elev-hover: rgba(0, 0, 0, 0.05);
  --border-light: rgba(15, 23, 42, 0.08);
  --border-active: rgba(15, 23, 42, 0.18);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-accent: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.85);
  --footer-bg: rgba(255, 255, 255, 0.9);
  --ai-panel-bg: rgba(255, 255, 255, 0.97);
  --kanban-col-bg: rgba(241, 245, 249, 0.7);
  --shadow-color: rgba(15, 23, 42, 0.08);
  --placeholder-bg: rgba(15, 23, 42, 0.03);
  --placeholder-border: rgba(15, 23, 42, 0.08);
  --glow-opacity: 0.08;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

h1, h2, h3, h4, .logo-text h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Background Glow Effects */
.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: var(--glow-opacity);
  pointer-events: none;
  z-index: -1;
}

.bg-glow-1 {
  background: #6366f1;
  top: -100px;
  right: -50px;
}

.bg-glow-2 {
  background: #d946ef;
  bottom: -150px;
  left: -100px;
}

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  margin-left: 0.25rem;
}
.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-elev-hover);
  border-color: var(--border-active);
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--border-light);
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  line-height: 1;
}

.logo-text h1 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.app-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
}

.nav-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-elev-hover);
}

.nav-btn.active {
  color: var(--text-primary);
  background-color: var(--bg-elev);
  border-color: var(--border-light);
}

/* Main Layout */
.app-main {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  min-height: calc(100vh - 9.5rem);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
  display: block;
}

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

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 1.25rem;
  padding: 1.75rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: var(--border-active);
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

/* Overview Tab Layout */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.span-cols-2 {
  grid-column: span 2;
}

/* Balance Ring Chart */
.balance-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.balance-score-wrapper {
  margin: 1.5rem 0;
  position: relative;
  width: 140px;
  height: 140px;
}

.circular-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.circle-bg {
  fill: none;
  stroke: var(--border-light);
  stroke-width: 2.8;
}

.circle {
  fill: none;
  stroke: var(--accent-color);
  stroke-width: 2.8;
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease-in-out;
}

.score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.balance-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-elev);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: 1px solid var(--border-light);
}

/* Capture Form */
.capture-card {
  display: flex;
  flex-direction: column;
}

/* Hermes Context Widget — "what we discussed in chat" */
.hermes-context-card {
  border-left: 3px solid #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.04));
}

.hermes-context-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.hermes-context-icon {
  font-size: 1rem;
}

.hermes-context-label {
  flex-grow: 1;
  color: #a5b4fc;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.hermes-context-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.hermes-context-summary {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  margin-bottom: 0.6rem;
}

.hermes-context-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hermes-context-area-pill {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 500;
}

/* Home: current-level descriptor line under the progress bar.
   Shows "Direction is set: building a tech-based career…" so the user
   sees what the current level actually MEANS at a glance. */
.home-area-lvl-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.75;
  margin-top: 0.35rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.capture-form {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.capture-form textarea {
  width: 100%;
  height: 100px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.capture-form textarea:focus {
  border-color: var(--accent-color);
}

.capture-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.captured-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Progression List */
.areas-mini-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.mini-area-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-elev);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mini-area-row:hover {
  background: var(--bg-elev-hover);
}

.mini-icon {
  font-size: 1.5rem;
  background: var(--bg-elev-hover);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.mini-info {
  flex-grow: 1;
}

.mini-info h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.mini-bar-container {
  height: 6px;
  background: var(--bg-elev-hover);
  border-radius: 3px;
  overflow: hidden;
}

.mini-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease-out;
}

.mini-level {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
  min-width: 2.5rem;
}

.mini-level-max {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Life Areas Layout */
.areas-detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.75rem;
  align-items: start;
}

.sidebar-card {
  padding: 1.25rem;
}

.area-selector-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1rem;
}

.selector-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.9rem;
  width: 100%;
}

.selector-btn:hover {
  background-color: var(--bg-elev);
  color: var(--text-primary);
}

.selector-btn.active {
  background-color: var(--bg-elev);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.selector-level {
  margin-left: auto;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-elev-hover);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  color: var(--text-secondary);
}

.selector-btn.active .selector-level {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
}

/* Detail Placeholder */
.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem;
  min-height: 400px;
}

.placeholder-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  opacity: 0.2;
}

.detail-placeholder h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.detail-placeholder p {
  color: var(--text-secondary);
  max-width: 400px;
  font-size: 0.95rem;
}

/* Area Detail Panel */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.detail-title-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.detail-icon {
  font-size: 2.25rem;
  width: 54px;
  height: 54px;
  background: var(--bg-elev-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
}

.detail-title-text h2 {
  font-size: 1.5rem;
}

.detail-title-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail-badge {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  padding: 0.4rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid currentColor;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.75rem;
}

/* Milestones Box */
.milestones-box h3, .ladder-box h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.milestones-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.milestone-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--border-light);
  padding: 0.75rem;
  border-radius: 0.75rem;
  transition: background-color 0.2s ease;
}

.milestone-item:hover {
  background: var(--bg-elev);
}

.milestone-checkbox {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg-input);
  transition: all 0.2s ease;
  user-select: none;
}

.milestone-checkbox.checked {
  background: var(--accent-gradient);
  border-color: transparent;
}

.milestone-checkbox.checked::after {
  content: "✓";
  color: var(--text-on-accent);
  font-size: 0.7rem;
  font-weight: 700;
}

.milestone-text {
  font-size: 0.85rem;
  flex-grow: 1;
}

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

.milestone-lvl-badge {
  font-size: 0.7rem;
  background: var(--bg-elev-hover);
  color: var(--text-secondary);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.level-trigger-card {
  background: var(--bg-elev);
  border: 1px dashed var(--border-light);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  margin-top: 1.5rem;
}

.level-trigger-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
}

/* Level Ladder list */
.ladder-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.ladder-step {
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--bg-elev);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.ladder-step.current {
  background: var(--bg-elev-hover);
  border-color: var(--border-active);
}

.ladder-step.completed {
  opacity: 0.7;
}

.step-num {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  width: 24px;
  height: 24px;
  background: var(--bg-elev-hover);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.ladder-step.current .step-num {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
}

.step-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.ladder-step.current .step-desc {
  color: var(--text-primary);
  font-weight: 500;
}

/* Custom Scrollbar */
.ladder-list::-webkit-scrollbar {
  width: 4px;
}

.ladder-list::-webkit-scrollbar-track {
  background: transparent;
}

.ladder-list::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

.ladder-list::-webkit-scrollbar-thumb:hover {
  background: var(--border-active);
}

/* ============================================================
   INLINE-EDITABLE ELEMENTS
   - Ladder step: text becomes an editable field on click
   - Milestone text: editable in place
   - Inline save buttons appear in edit mode
   ============================================================ */

.editable {
  cursor: text;
  border-radius: 0.35rem;
  padding: 0.15rem 0.4rem;
  margin: -0.15rem -0.4rem;
  transition: background-color 0.15s ease, outline-color 0.15s ease;
  outline: 1px dashed transparent;
  outline-offset: 0;
  display: block;
  width: 100%;
}
.editable:hover {
  background: var(--bg-elev-hover);
  outline-color: var(--border-light);
}
.editable:focus {
  background: var(--bg-input);
  outline: 1px solid var(--accent-color);
  outline-offset: 0;
}

.ladder-step-edit-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}
.ladder-step-edit-row textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.825rem;
  line-height: 1.4;
}
.ladder-step-edit-row textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.ladder-step-edit-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}
.inline-save-btn {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  border: none;
  padding: 0.35rem 0.9rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.inline-save-btn:hover { opacity: 0.9; }
.inline-save-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.inline-cancel-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 0.35rem 0.9rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.inline-cancel-btn:hover {
  background: var(--bg-elev-hover);
  color: var(--text-primary);
}

/* Milestones: drag-and-drop + inline edit */
.milestone-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0 0.15rem 0 0;
  user-select: none;
  flex-shrink: 0;
  align-self: center;
  line-height: 1;
}
.milestone-drag-handle:hover { color: var(--text-secondary); }

/* Inline "Add milestone" input — theme-aware */
.ms-add-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  width: 100%;
  font-size: 0.85rem;
  font-family: inherit;
}
.ms-add-input::placeholder { color: var(--text-muted); }
.milestone-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.milestone-item.drag-over {
  border-top: 2px solid var(--accent-color);
}
.milestone-save-row {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-light);
}
.milestone-dirty-indicator {
  font-size: 0.7rem;
  color: #f59e0b;
  font-weight: 500;
  align-self: center;
  margin-right: auto;
}
.milestone-edit-textarea {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.4;
}
.milestone-edit-textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.milestone-edit-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  align-items: center;
}
.ms-lvl-select {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.3rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
}

/* Drag-handle + re-order indicator inside the existing milestone-item layout */
.milestone-item {
  flex-wrap: wrap;
}
.milestone-item .milestone-text { flex: 1 1 60%; min-width: 0; }
.milestone-item .milestone-lvl-badge { flex-shrink: 0; }

/* Kanban / Idea Board */
.idea-board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.triage-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.kanban-column {
  background: var(--kanban-col-bg);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  padding: 1.25rem 1rem;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.column-header h3 {
  font-size: 1rem;
  color: var(--text-primary);
}

.column-count {
  font-size: 0.75rem;
  background: var(--bg-elev-hover);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-weight: 600;
}

.column-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.25s ease;
  position: relative;
  cursor: grab;
}

.kanban-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.kanban-card-text {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.triage-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  text-transform: capitalize;
}

.triage-badge.suggested {
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
}

.triage-badge.approved {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
}

.triage-badge.rejected {
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
}

.triage-badge.inbox {
  background: var(--bg-elev-hover);
  color: var(--text-secondary);
}

.kanban-card-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-light);
  justify-content: flex-end;
}

.action-dot-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-dot-btn:hover {
  background: var(--bg-elev-hover);
  color: var(--text-primary);
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-light);
  padding: 2rem 0;
  background-color: var(--footer-bg);
  margin-top: auto;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* Responsive design */
@media (max-width: 900px) {
  .areas-detail-layout {
    grid-template-columns: 1fr;
  }
  .kanban-board {
    grid-template-columns: 1fr 1fr;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .span-cols-2 {
    grid-column: span 1;
  }
  .areas-mini-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
  .header-container {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 1rem;
  }
  .footer-container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* New list-first and AI panel styles */
.areas-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.home-area-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-elev);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.home-area-row:hover {
  border-color: var(--border-active);
  background: var(--bg-elev-hover);
  transform: translateX(4px);
}

.home-area-icon {
  font-size: 1.75rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-elev);
  flex-shrink: 0;
}

.home-area-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.home-area-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.home-area-header h4 {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-area-level {
  font-size: 0.85rem;
  font-weight: 700;
}

.home-area-progress {
  height: 6px;
  background: var(--bg-elev-hover);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.home-area-bar {
  height: 100%;
  border-radius: 3px;
}

.home-area-milestone {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.home-area-milestone-checkbox {
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-area-milestone-checkbox:hover {
  border-color: var(--accent-color);
}

.home-area-milestone-checkbox.checked::after {
  content: '✓';
  color: var(--accent-color);
  font-size: 0.7rem;
  font-weight: bold;
}

.home-area-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.2s ease;
  padding-left: 0.5rem;
}

.home-area-link:hover {
  color: var(--text-primary);
}

/* AI Slide-over Panel */
.ai-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 460px;
  max-width: 100vw;
  height: 100vh;
  background: var(--ai-panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-light);
  box-shadow: -10px 0 30px var(--shadow-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-panel.open {
  right: 0;
}

.ai-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.close-btn:hover {
  color: var(--text-primary);
}

.ai-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-message {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  max-width: 85%;
  line-height: 1.5;
  word-wrap: break-word;
}

.ai-message.system {
  background: var(--bg-elev-hover);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 0.25rem;
}

.ai-message.user {
  background: var(--accent-color);
  color: var(--text-on-accent);
  align-self: flex-end;
  border-bottom-right-radius: 0.25rem;
}

.ai-message.proposal {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--text-primary);
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-input-area {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-card-solid);
}

.ai-input-area textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 110px;
  max-height: 280px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-input-area textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.ai-input-area textarea::placeholder {
  color: var(--text-muted);
}

.ai-input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.ai-input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ai-send-btn {
  background: var(--accent-gradient);
  border: none;
  color: var(--text-on-accent);
  padding: 0.7rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ai-send-btn:hover { opacity: 0.92; }
.ai-send-btn:active { transform: translateY(1px); }
.ai-send-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Proposal styles */
.proposal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.proposal-op-item {
  font-size: 0.8rem;
  padding: 0.4rem;
  background: var(--bg-elev-hover);
  border-radius: 0.35rem;
  margin-top: 0.25rem;
}

.btn-tier1 { background: #10b981; color: white; border: none; padding: 0.4rem 0.8rem; border-radius: 0.35rem; cursor: pointer; }
.btn-tier2 { background: #3b82f6; color: white; border: none; padding: 0.4rem 0.8rem; border-radius: 0.35rem; cursor: pointer; }
.btn-tier3 { background: #ef4444; color: white; border: none; padding: 0.4rem 0.8rem; border-radius: 0.35rem; cursor: pointer; }
.btn-reject { background: var(--bg-elev-hover); color: var(--text-secondary); border: 1px solid var(--border-light); padding: 0.4rem 0.8rem; border-radius: 0.35rem; cursor: pointer; }

.btn-tier1:hover, .btn-tier2:hover, .btn-tier3:hover { opacity: 0.9; }
.btn-reject:hover { background: var(--bg-elev-hover); color: var(--text-primary); }

.sparkline-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-elev-hover);
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
}

.sparkline-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

