/**
 * Velos Production CSS
 * Zero runtime JIT compiler bloat - Pre-compiled modern CSS design tokens.
 * WCAG AA Contrast, 8px spatial grid, Todoist signature aesthetic.
 */

:root {
  /* Color Palette - Light Mode */
  --sidebar-bg: #FAF8F7;
  --canvas-bg: #FFFFFF;
  --card-bg: #FFFFFF;
  --text-main: #202020;
  --text-muted: #666666;
  --text-subtle: #8A8886;
  --border-subtle: #EBEAE8;
  --border-hover: #D4D2CF;

  /* Brand Vermilion */
  --brand-primary: #DC4C3E;
  --brand-hover: #B83A2E;
  --brand-surface: #FDF3F1;
  --brand-subtle: #FBE6E4;

  /* Priority Tokens */
  --p1-color: #DC4C3E;
  --p2-color: #EB8909;
  --p3-color: #246FE0;
  --p4-color: #808080;

  /* Semantic Feedback */
  --danger: #DC4C3E;
  --success: #058527;
  --warning: #EB8909;

  /* Layout & Geometry */
  --sidebar-width: 270px;
  --pomo-hud-height: 72px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-pomo: 0 8px 28px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

/* =========================================================================
   SYMMETRICAL DUAL-MODE THEME SYSTEM
   Every archetype supports BOTH Light and Dark modes symmetrically.
   ========================================================================= */

/* Default Dark Theme / Fallback */
[data-theme="dark"] {
  --sidebar-bg: #16181B;
  --canvas-bg: #0E1012;
  --card-bg: #1D2024;
  --card-hover: #26292E;
  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-subtle: #6B7280;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);

  --brand-primary: #DC4C3E;
  --brand-hover: #EF4444;
  --brand-surface: rgba(220, 76, 62, 0.15);
  --brand-subtle: rgba(220, 76, 62, 0.25);

  --p1-color: #EF4444;
  --p2-color: #F59E0B;
  --p3-color: #3B82F6;
  --p4-color: #9CA3AF;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.7);
  --shadow-pomo: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* 1. ARCHETYPE: Linear (Obsidian Dark / Crisp Slate Light) */
[data-theme="dark"][data-theme-preset="linear-dark"],
[data-theme-preset="linear-dark"][data-theme="dark"] {
  --sidebar-bg: #16181B;
  --canvas-bg: #0E1012;
  --card-bg: #1D2024;
  --card-hover: #26292E;
  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-subtle: #6B7280;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);

  --brand-primary: #DC4C3E;
  --brand-hover: #EF4444;
  --brand-surface: rgba(220, 76, 62, 0.15);
  --brand-subtle: rgba(220, 76, 62, 0.25);
}

[data-theme="light"][data-theme-preset="linear-dark"],
:root[data-theme-preset="linear-dark"]:not([data-theme="dark"]) {
  --sidebar-bg: #F8F9FA;
  --canvas-bg: #FFFFFF;
  --card-bg: #FFFFFF;
  --card-hover: #F3F4F6;
  --text-main: #111827;
  --text-muted: #4B5563;
  --text-subtle: #9CA3AF;
  --border-subtle: #E5E7EB;
  --border-hover: #D1D5DB;

  --brand-primary: #5E6AD2;
  --brand-hover: #4B56C0;
  --brand-surface: #EEF2FF;
  --brand-subtle: #E0E7FF;
}

/* 2. ARCHETYPE: Todoist Warm (Warm Vermilion Light / Rich Warm Dark) */
[data-theme="light"][data-theme-preset="todoist-warm"],
:root[data-theme-preset="todoist-warm"]:not([data-theme="dark"]) {
  --sidebar-bg: #FAF8F7;
  --canvas-bg: #FFFFFF;
  --card-bg: #FFFFFF;
  --card-hover: #F6F4F2;
  --text-main: #202020;
  --text-muted: #666666;
  --text-subtle: #8A8886;
  --border-subtle: #EBEAE8;
  --border-hover: #D4D2CF;

  --brand-primary: #DC4C3E;
  --brand-hover: #B83A2E;
  --brand-surface: #FDF3F1;
  --brand-subtle: #FBE6E4;
}

[data-theme="dark"][data-theme-preset="todoist-warm"],
[data-theme-preset="todoist-warm"][data-theme="dark"] {
  --sidebar-bg: #262628;
  --canvas-bg: #1E1E20;
  --card-bg: #2B2B2E;
  --card-hover: #353539;
  --text-main: #F5F5F5;
  --text-muted: #A3A3A3;
  --text-subtle: #737373;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.18);

  --brand-primary: #DC4C3E;
  --brand-hover: #EF4444;
  --brand-surface: rgba(220, 76, 62, 0.18);
  --brand-subtle: rgba(220, 76, 62, 0.28);
}

/* 3. ARCHETYPE: Nordic Frost (Arctic Midnight & Ice Cyan) */
[data-theme="dark"][data-theme-preset="nordic-frost"],
[data-theme-preset="nordic-frost"][data-theme="dark"] {
  --sidebar-bg: #13161A;
  --canvas-bg: #181B20;
  --card-bg: #1F242C;
  --card-hover: #282E38;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;
  --border-subtle: rgba(56, 189, 248, 0.14);
  --border-hover: rgba(56, 189, 248, 0.28);

  --brand-primary: #38BDF8;
  --brand-hover: #0EA5E9;
  --brand-surface: rgba(56, 189, 248, 0.14);
  --brand-subtle: rgba(56, 189, 248, 0.24);
}

[data-theme="light"][data-theme-preset="nordic-frost"],
:root[data-theme-preset="nordic-frost"]:not([data-theme="dark"]) {
  --sidebar-bg: #E8EFF4;
  --canvas-bg: #F3F7FA;
  --card-bg: #FFFFFF;
  --card-hover: #E1ECF2;
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-subtle: #94A3B8;
  --border-subtle: #CBD5E1;
  --border-hover: #94A3B8;

  --brand-primary: #0284C7;
  --brand-hover: #0369A1;
  --brand-surface: #E0F2FE;
  --brand-subtle: #BAE6FD;
}

/* 4. ARCHETYPE: Midnight Emerald / Mint Fresh (Deep Forest & Mint Leaf) */
[data-theme="dark"][data-theme-preset="midnight-emerald"],
[data-theme-preset="midnight-emerald"][data-theme="dark"] {
  --sidebar-bg: #070D0B;
  --canvas-bg: #0B1311;
  --card-bg: #121E1B;
  --card-hover: #192925;
  --text-main: #ECFDF5;
  --text-muted: #6EE7B7;
  --text-subtle: #059669;
  --border-subtle: rgba(16, 185, 129, 0.14);
  --border-hover: rgba(16, 185, 129, 0.28);

  --brand-primary: #10B981;
  --brand-hover: #059669;
  --brand-surface: rgba(16, 185, 129, 0.14);
  --brand-subtle: rgba(16, 185, 129, 0.24);
}

[data-theme="light"][data-theme-preset="midnight-emerald"],
:root[data-theme-preset="midnight-emerald"]:not([data-theme="dark"]) {
  --sidebar-bg: #DCFCE7;
  --canvas-bg: #F0FDF4;
  --card-bg: #FFFFFF;
  --card-hover: #E8F9EE;
  --text-main: #064E3B;
  --text-muted: #047857;
  --text-subtle: #6EE7B7;
  --border-subtle: #A7F3D0;
  --border-hover: #6EE7B7;

  --brand-primary: #059669;
  --brand-hover: #047857;
  --brand-surface: #D1FAE5;
  --brand-subtle: #A7F3D0;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--canvas-bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  color: inherit;
}

/* Global Utility Classes */
.is-hidden {
  display: none !important;
}

/* App Layout Grid */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  user-select: none;
  z-index: 10;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Collapsed Sidebar Rail (56px Icon Rail) */
.app-sidebar.is-collapsed {
  width: 56px !important;
  min-width: 56px !important;
}

.app-sidebar.is-collapsed .sidebar-header {
  padding: 16px 8px;
  justify-content: center;
}

.app-sidebar.is-collapsed .brand-link span {
  display: none;
}

.app-sidebar.is-collapsed .sidebar-quick-add {
  padding: 0 8px 12px;
}

.app-sidebar.is-collapsed .btn-sidebar-add {
  padding: 8px;
  justify-content: center;
}

.app-sidebar.is-collapsed .btn-sidebar-add span:not(.btn-icon),
.app-sidebar.is-collapsed .btn-sidebar-add .kbd-badge {
  display: none;
}

.app-sidebar.is-collapsed .sidebar-scrollable {
  padding: 0 6px;
}

.app-sidebar.is-collapsed .nav-item-btn {
  padding: 10px 0;
  justify-content: center;
  gap: 0;
}

.app-sidebar.is-collapsed .nav-item-btn span:not(.nav-icon) {
  display: none;
}

.app-sidebar.is-collapsed .sidebar-section-header {
  display: none;
}

.app-sidebar.is-collapsed #projectsNavList .nav-item-btn {
  justify-content: center;
  padding: 8px 0;
}

.app-sidebar.is-collapsed #projectsNavList .nav-item-btn span:not(.project-item-dot) {
  display: none;
}

.app-sidebar.is-collapsed .sidebar-footer {
  padding: 10px 4px;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.app-sidebar.is-collapsed .btn-sidebar-footer {
  padding: 6px;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.app-sidebar.is-collapsed .btn-sidebar-footer span:not(#iconSettings) {
  display: none;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.sidebar-collapse-btn:hover {
  background: var(--border-subtle);
  color: var(--text-main);
}

.sidebar-header {
  padding: 16px 18px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  background: var(--brand-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.brand-mark svg {
  stroke-width: 2.5;
}

.sidebar-quick-add {
  padding: 0 16px 12px;
}

.btn-sidebar-add {
  width: 100%;
  background: var(--brand-surface);
  color: var(--brand-primary);
  border: 1px solid var(--brand-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}

.btn-sidebar-add:hover {
  background: var(--brand-subtle);
}

.btn-sidebar-add .kbd-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(220, 76, 62, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Nav Menu */
.sidebar-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
}

.nav-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s;
  text-decoration: none;
}

.nav-item-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .nav-item-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item-btn.is-active {
  background: var(--brand-surface);
  color: var(--brand-primary);
  font-weight: 600;
}

.nav-item-btn .nav-icon {
  display: flex;
  align-items: center;
  color: inherit;
}

.nav-item-btn .nav-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.nav-item-btn.is-active .nav-count {
  color: var(--brand-primary);
}

/* Projects Section in Sidebar */
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.btn-icon-tiny {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}

.btn-icon-tiny:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-main);
}

.project-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.btn-sidebar-footer:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

/* Main View Canvas */
.app-canvas {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  background-color: var(--canvas-bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

.canvas-inner {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 24px 32px 120px; /* 120px bottom padding for floating Pomodoro HUD */
  box-sizing: border-box;
}

/* Constrain standard single-column task lists to comfortable reading width while Board & Table expand 100% */
.tasks-container,
.completed-tasks-list,
.analytics-dashboard {
  max-width: 1040px;
}

/* Quick Notes Companion Panel (Right Dock on Wide Screens / Drawer on Mobile & Laptop) */
.quick-notes-panel {
  width: 350px;
  min-width: 350px;
  height: 100%;
  background-color: var(--sidebar-bg);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 15;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), width 0.2s ease, min-width 0.2s ease;
}

.quick-notes-panel.is-hidden {
  display: none !important;
}

.quick-notes-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-notes-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

.quick-notes-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-notes-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--card-bg);
}

.quick-notes-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qn-tab-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.12s;
}

.qn-tab-btn:hover {
  color: var(--text-main);
  background: var(--border-subtle);
}

.qn-tab-btn.is-active {
  color: var(--brand-primary);
  background: var(--brand-surface);
  font-weight: 600;
}

.quick-notes-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.quick-notes-textarea {
  flex: 1;
  width: 100%;
  height: 100%;
  padding: 16px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.quick-notes-preview {
  flex: 1;
  width: 100%;
  height: 100%;
  padding: 16px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
}

.quick-notes-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--sidebar-bg);
}

.quick-notes-status {
  font-size: 11px;
  color: var(--text-subtle);
}

.btn-convert-task {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--brand-surface);
  color: var(--brand-primary);
  border: 1px solid var(--brand-subtle);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.btn-convert-task:hover {
  background-color: var(--brand-subtle);
}

/* Floating overlay on screens <= 1440px */
@media (max-width: 1440px) {
  .quick-notes-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    z-index: 80;
  }
}

/* Mobile Top Bar */
.mobile-top-bar {
  display: none;
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--sidebar-bg);
}

/* View Header */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.view-header-title h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.view-date-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.view-header-stats {
  display: flex;
  gap: 8px;
}

.header-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Task Row & List */
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.task-section {
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.text-danger {
  color: var(--danger) !important;
}

.task-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s;
  border-radius: var(--radius-sm);
  position: relative;
}

.task-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .task-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.task-row.is-active-focus {
  background: var(--brand-surface);
  border-left: 3px solid var(--brand-primary);
}

.task-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

/* Priority Circular Checkbox */
.priority-checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  padding: 0;
}

.checkbox-ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--priority-color, #808080);
  transition: all 0.15s ease;
}

.priority-checkbox:hover .checkbox-ring {
  background-color: var(--priority-color);
  opacity: 0.25;
}

.checkbox-check {
  display: none;
  position: absolute;
  color: #FFFFFF;
}

.task-row.is-completed .checkbox-ring {
  background-color: var(--priority-color, #808080);
  border-color: var(--priority-color, #808080);
}

.task-row.is-completed .checkbox-check {
  display: flex;
}

.task-row.is-completed .task-title {
  text-decoration: line-through;
  color: var(--text-subtle);
}

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

.task-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-word;
}

.task-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--sidebar-bg);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.badge-pomo {
  color: var(--brand-primary);
  background: var(--brand-surface);
  border-color: var(--brand-subtle);
}

.badge-overdue {
  color: var(--danger);
  background: rgba(220, 76, 62, 0.08);
  border-color: rgba(220, 76, 62, 0.2);
  font-weight: 600;
}

.badge-today {
  color: var(--brand-primary);
  font-weight: 600;
}

.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.project-dot.large-dot {
  width: 14px;
  height: 14px;
}

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

.header-icon-inbox {
  color: var(--text-muted);
}

/* Task Actions on Hover */
.task-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.task-row:hover .task-actions,
.task-row:focus-within .task-actions {
  opacity: 1;
}

.btn-task-action {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}

.btn-task-action:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-main);
}

.btn-task-action.btn-danger:hover {
  background: rgba(220, 76, 62, 0.1);
  color: var(--danger);
}

.btn-task-action.btn-active-pomo {
  color: var(--brand-primary);
  background: var(--brand-surface);
}

/* Inline Add Task Row */
.inline-add-row {
  margin-top: 12px;
}

.btn-inline-add {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: color 0.15s, background 0.15s;
  width: 100%;
  text-align: left;
}

.btn-inline-add:hover {
  color: var(--brand-primary);
  background: var(--brand-surface);
}

/* Empty View State */
.empty-view-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-icon {
  margin: 0 auto 16px;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-view-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-view-state p {
  font-size: 13px;
  max-width: 400px;
  margin: 0 auto;
}

/* Completed Summary Accordion */
.completed-summary-accordion {
  margin-top: 32px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.completed-summary-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.completed-summary-title::-webkit-details-marker {
  display: none;
}

.accordion-arrow {
  margin-left: auto;
  transition: transform 0.2s;
}

.completed-summary-accordion[open] .accordion-arrow {
  transform: rotate(180deg);
}

/* Upcoming 7-day Agenda */
.upcoming-agenda {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.agenda-day-card {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.agenda-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.agenda-day-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.agenda-day-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.agenda-day-date {
  font-size: 13px;
  color: var(--text-muted);
}

.agenda-day-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-subtle);
}

.agenda-day-empty {
  font-size: 13px;
  color: var(--text-subtle);
  padding: 8px 10px;
}

/* =========================================================================
   EDGE-HIDING BOTTOM-RIGHT POMODORO MINI-DOCK (Phase 8 Overhaul)
   ========================================================================= */
.pomo-hud-dock {
  position: fixed;
  bottom: 24px;
  right: 0;
  left: auto;
  z-index: 90;
  max-width: min(540px, calc(100vw - 32px));
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-right: none;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: -4px 6px 28px rgba(0, 0, 0, 0.16);
  padding: 8px 16px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  backdrop-filter: blur(14px);
  transform: translateX(calc(100% - 16px));
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  cursor: pointer;
}

.pomo-hud-dock:hover,
.pomo-hud-dock.is-peek,
.pomo-hud-dock:focus-within {
  transform: translateX(0);
  box-shadow: -8px 10px 36px rgba(0, 0, 0, 0.25);
  cursor: default;
}

/* 16px Sleek Edge Pulse Indicator Handle */
.pomo-dock-edge-handle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  padding: 4px 4px 4px 0;
}

.pomo-edge-pulse-bar {
  width: 6px;
  height: 36px;
  border-radius: 9999px;
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  animation: edge-pulse 2s ease-in-out infinite;
}

.pomo-hud-dock.mode-shortBreak .pomo-edge-pulse-bar,
.pomo-hud-dock.mode-longBreak .pomo-edge-pulse-bar {
  background-color: #10B981;
  box-shadow: 0 0 10px #10B981;
}

.pomo-edge-mini-time {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  display: none;
}

@keyframes edge-pulse {
  0%, 100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.55;
    transform: scaleY(0.85);
  }
}

.pomo-hud-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.pomo-circle-progress {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pomo-circle-progress svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.circle-track {
  stroke: var(--border-subtle);
}

.circle-fill {
  stroke: var(--brand-primary);
  transition: stroke-dashoffset 0.3s ease;
}

.pomo-circle-text {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
}

.pomo-task-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pomo-mode-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pomo-mode-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--brand-surface);
  color: var(--brand-primary);
}

.pomo-mode-pill.mode-shortBreak,
.pomo-mode-pill.mode-longBreak {
  background: rgba(36, 111, 224, 0.1);
  color: #246FE0;
}

.pomo-round-dots {
  display: flex;
  gap: 4px;
}

.pomo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-subtle);
}

.pomo-dot.is-filled {
  background: var(--brand-primary);
}

.pomo-task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.pomo-hud-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pomo-primary {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, background 0.12s;
  box-shadow: 0 2px 6px rgba(220, 76, 62, 0.3);
}

.btn-pomo-primary:hover {
  background: var(--brand-hover);
  transform: scale(1.05);
}

.btn-pomo-control {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}

.btn-pomo-control:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.pomo-hud-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-noise-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: all 0.15s;
}

.btn-noise-toggle.is-playing {
  background: rgba(5, 133, 39, 0.1);
  color: var(--success);
  border-color: rgba(5, 133, 39, 0.25);
}

/* =========================================================================
   ANALYTICS & KARMA STYLING
   ========================================================================= */
.karma-hero-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-sm);
}

.karma-hero-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.karma-score-badge {
  display: flex;
  align-items: center;
  gap: 16px;
}

.karma-star-icon {
  color: #EB8909;
}

.karma-number-wrap {
  display: flex;
  flex-direction: column;
}

.karma-number {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.karma-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.karma-level-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.karma-rank-pill {
  background: rgba(235, 137, 9, 0.12);
  color: #D47900;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.karma-next-threshold {
  font-size: 12px;
  color: var(--text-muted);
}

.karma-hero-right {
  display: flex;
  gap: 24px;
}

.karma-metric-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-flame { background: rgba(220, 76, 62, 0.1); color: var(--brand-primary); }
.stat-clock { background: rgba(36, 111, 224, 0.1); color: #246FE0; }
.stat-check { background: rgba(5, 133, 39, 0.1); color: var(--success); }

.metric-big-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  display: block;
  line-height: 1.1;
}

.metric-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.metric-caption {
  font-size: 12px;
  color: var(--text-muted);
}

.analytics-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-header-row h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-summary-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.svg-chart-wrapper {
  width: 100%;
  overflow-x: auto;
}

.analytics-chart-svg {
  width: 100%;
  height: auto;
  max-height: 240px;
}

.chart-bar-group {
  outline: none;
}

.chart-bar-group:hover .chart-col-hover,
.chart-bar-group:focus .chart-col-hover {
  fill: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .chart-bar-group:hover .chart-col-hover {
  fill: rgba(255, 255, 255, 0.04);
}

.session-history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.session-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.session-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-icon {
  color: var(--brand-primary);
}

.session-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.session-time {
  font-size: 11px;
  color: var(--text-muted);
}

.session-duration-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  background: rgba(5, 133, 39, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

/* =========================================================================
   NATIVE DIALOGS & MODALS (<dialog closedby="any">)
   ========================================================================= */
dialog {
  border: none;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  padding: 0;
  max-width: 580px;
  width: calc(100vw - 32px);
  margin: auto;
  outline: none;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
}

.quick-add-modal {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quick-add-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-add-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.quick-add-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qa-textarea {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  resize: vertical;
  background: var(--canvas-bg);
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s;
}

.qa-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 1px var(--brand-primary);
}

.qa-desc-input {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
  background: var(--canvas-bg);
  outline: none;
}

.qa-desc-input:focus {
  border-color: var(--border-hover);
}

/* Real-Time Parsed Token Chips */
.qa-parsed-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 6px 10px;
  background: var(--sidebar-bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
}

.parsed-preview-label {
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 600;
  text-transform: uppercase;
}

.qa-tag-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hint-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 7px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
}

.hint-pill:hover {
  background: var(--brand-surface);
  color: var(--brand-primary);
  border-color: var(--brand-subtle);
}

.quick-add-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.qa-kbd-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.qa-buttons {
  display: flex;
  gap: 8px;
}

/* Generic Form Inputs & Buttons */
.fp-input {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 14px;
  background: var(--canvas-bg);
  outline: none;
}

.fp-input:focus {
  border-color: var(--brand-primary);
}

.fp-range {
  width: 100%;
  accent-color: var(--brand-primary);
}

.btn-primary {
  background: var(--brand-primary);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}

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

.btn-secondary {
  background: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.06);
}

.btn-subtle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-subtle:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Settings Dialog Body */
.settings-modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.settings-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.settings-legend {
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

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

.setting-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.setting-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-main);
  margin-top: 12px;
  cursor: pointer;
}

.setting-toggle-row input {
  accent-color: var(--brand-primary);
}

.settings-subrow {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 6px 0 12px;
}

.settings-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-file-label {
  cursor: pointer;
}

.theme-options-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.theme-radio-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

.theme-radio-pill input {
  display: none;
}

.theme-radio-pill.is-selected {
  border-color: var(--brand-primary);
  background: var(--brand-surface);
  color: var(--brand-primary);
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Color Picker Row in Project Dialog */
.color-picker-grid {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.color-option-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s;
}

.color-option-btn:hover {
  transform: scale(1.15);
}

.color-option-btn.is-selected {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px var(--card-bg);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-top-bar {
    display: flex;
  }

  .canvas-inner {
    padding: 16px 16px 120px;
  }

  .pomo-hud-dock {
    left: 50%;
    width: calc(100vw - 24px);
    bottom: 12px;
    padding: 8px 12px;
  }

  .pomo-task-title {
    max-width: 140px;
  }

  .karma-hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .karma-hero-right {
    flex-wrap: wrap;
    gap: 16px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   PHASE 2 POWER-USER STYLES
   ========================================================================= */

/* Keyboard Selection Outline */
.task-row.is-keyboard-selected {
  outline: 2px solid var(--brand-primary);
  outline-offset: -1px;
  background-color: var(--brand-surface) !important;
}

/* Drag & Drop Reordering */
.task-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  cursor: grab;
  opacity: 0.35;
  transition: opacity 0.15s, color 0.15s;
  padding: 2px;
  margin-right: 4px;
}

.task-row:hover .task-drag-handle {
  opacity: 0.85;
}

.task-drag-handle:active {
  cursor: grabbing;
}

.task-row.is-dragging {
  opacity: 0.4;
  background-color: var(--border-subtle);
  border: 1px dashed var(--brand-primary);
}

.task-row.drag-over {
  border-top: 2px solid var(--brand-primary);
  background-color: var(--brand-surface);
}

.agenda-day-card.drag-day-target {
  outline: 2px dashed var(--brand-primary);
  outline-offset: -2px;
  background-color: var(--brand-surface);
}

/* Recurrence Badge */
.meta-badge.badge-recurrence {
  background-color: rgba(105, 47, 194, 0.1);
  color: #692FC2;
  border: 1px solid rgba(105, 47, 194, 0.25);
  font-weight: 600;
}

[data-theme="dark"] .meta-badge.badge-recurrence {
  background-color: rgba(168, 85, 247, 0.15);
  color: #C084FC;
  border-color: rgba(168, 85, 247, 0.3);
}

/* Subtasks & Checklists */
.task-subtasks-collapsible {
  margin-top: 8px;
  width: 100%;
}

.subtasks-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  list-style: none;
  padding: 3px 0;
  transition: color 0.15s;
}

.subtasks-summary::-webkit-details-marker {
  display: none;
}

.subtasks-summary:hover {
  color: var(--text-main);
}

.subtasks-summary-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.subtasks-chevron {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-subtle);
}

.task-subtasks-collapsible[open] > .subtasks-summary .subtasks-chevron {
  transform: rotate(90deg);
}

.subtasks-count-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background-color: var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
}

.subtasks-progress-track {
  width: 80px;
  height: 4px;
  background-color: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-left: 12px;
}

.subtasks-progress-bar {
  height: 100%;
  background-color: var(--success);
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
}

.subtasks-list {
  list-style: none;
  margin: 6px 0 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 2px solid var(--border-subtle);
  padding-left: 10px;
}

.subtask-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--card-bg);
  transition: background-color 0.12s;
  font-size: 13px;
}

.subtask-row:hover {
  background-color: var(--sidebar-bg);
}

.subtask-row.is-completed .subtask-title {
  text-decoration: line-through;
  color: var(--text-subtle);
}

.subtask-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-hover);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s;
  background: transparent;
}

.subtask-check-mark {
  display: none;
}

.subtask-row.is-completed .subtask-checkbox {
  background-color: var(--success);
  border-color: var(--success);
  color: #FFFFFF;
}

.subtask-row.is-completed .subtask-check-mark {
  display: block;
}

.subtask-title {
  flex: 1;
  word-break: break-word;
  color: var(--text-main);
}

.btn-subtask-delete {
  color: var(--text-subtle);
  opacity: 0;
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s, color 0.15s;
}

.subtask-row:hover .btn-subtask-delete {
  opacity: 1;
}

.btn-subtask-delete:hover {
  color: var(--danger);
}

.subtask-quick-add-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  margin-left: 22px;
}

.subtask-quick-input {
  flex: 1;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--canvas-bg);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.12s;
}

.subtask-quick-input:focus {
  border-color: var(--brand-primary);
}

.btn-subtask-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background-color: var(--border-subtle);
  color: var(--text-main);
  transition: background-color 0.12s, color 0.12s;
}

.btn-subtask-add:hover {
  background-color: var(--brand-primary);
  color: #FFFFFF;
}

/* Spotlight Search & Command Palette Modal */
#searchDialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 640px;
  width: 90vw;
  margin: 60px auto auto;
}

#searchDialog::backdrop {
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.search-palette-modal {
  background-color: var(--card-bg);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-palette-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--card-bg);
}

.search-icon-wrap {
  color: var(--text-subtle);
  display: flex;
  align-items: center;
}

.search-palette-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--text-main);
}

.search-filter-hints {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background-color: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.search-hint-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.12s;
}

.search-hint-pill:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background-color: var(--brand-surface);
}

.search-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 0;
}

.palette-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  cursor: pointer;
  user-select: none;
  border-left: 3px solid transparent;
  transition: background-color 0.1s, border-color 0.1s;
}

.palette-result-item:hover,
.palette-result-item.is-palette-selected {
  background-color: var(--brand-surface);
  border-left-color: var(--brand-primary);
}

.palette-result-item.is-completed {
  opacity: 0.6;
}

.palette-result-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.palette-prio-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.palette-result-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.palette-result-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.palette-result-item.is-completed .palette-result-title {
  text-decoration: line-through;
}

.palette-result-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 440px;
}

.palette-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.palette-result-action {
  font-size: 11px;
  color: var(--text-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--sidebar-bg);
}

.search-palette-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--sidebar-bg);
  font-size: 12px;
  color: var(--text-subtle);
}

.palette-footer-shortcuts {
  display: flex;
  align-items: center;
  gap: 12px;
}

.palette-footer-shortcuts kbd {
  background: var(--card-bg);
  border: 1px solid var(--border-hover);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
  font-family: var(--font-mono);
}

.search-empty-state {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
}

.search-empty-state p {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* Todoist Sync Box */
.sync-status-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
}

.sync-status-box.status-loading {
  background-color: var(--brand-surface);
  color: var(--brand-primary);
  border: 1px solid var(--border-hover);
}

.sync-status-box.status-success {
  background-color: rgba(5, 133, 39, 0.08);
  color: var(--success);
  border: 1px solid rgba(5, 133, 39, 0.25);
}

.sync-status-box.status-error {
  background-color: rgba(220, 76, 62, 0.08);
  color: var(--danger);
  border: 1px solid rgba(220, 76, 62, 0.25);
}

/* =========================================================================
   PHASE 3: DAILY HABITS, SECTIONS, HEATMAP, POPUP RESCHEDULE & JOURNALING
   ========================================================================= */

/* --- 1. Daily Habits & Rituals System --- */
.habits-section {
  margin-bottom: 24px;
}

.habits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.habits-header-icon {
  color: var(--brand-primary);
  display: flex;
  align-items: center;
}

.habits-title-row h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.habits-count-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--brand-surface);
  color: var(--brand-primary);
}

.btn-add-habit-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
}

.btn-add-habit-open:hover {
  background-color: var(--brand-surface);
}

.habits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.habit-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.habit-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.habit-card.is-completed {
  background-color: var(--brand-surface);
  border-color: rgba(220, 76, 62, 0.25);
}

.habit-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.habit-check-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-hover);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}

.habit-check-btn:hover {
  border-color: var(--brand-primary);
  transform: scale(1.08);
}

.habit-check-btn.is-checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #FFFFFF;
}

.habit-check-tick {
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.12s;
}

.habit-check-btn.is-checked .habit-check-tick {
  opacity: 1;
}

.habit-icon-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.habit-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habit-card.is-completed .habit-name {
  color: var(--text-muted);
}

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

.habit-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--canvas-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.habit-streak-pill.has-streak {
  background: var(--brand-surface);
  border-color: rgba(220, 76, 62, 0.3);
  color: var(--brand-primary);
}

.btn-habit-delete {
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: var(--radius-sm);
  color: var(--text-subtle);
  transition: opacity 0.15s, color 0.15s;
}

.habit-card:hover .btn-habit-delete {
  opacity: 1;
}

.btn-habit-delete:hover {
  color: var(--danger);
  background-color: rgba(220, 76, 62, 0.1);
}

.habits-empty-state {
  padding: 18px;
  border: 1.5px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.habit-icon-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.habit-icon-choice {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.habit-icon-choice:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.habit-icon-choice.is-selected {
  border-color: var(--brand-primary);
  background: var(--brand-surface);
  color: var(--brand-primary);
}

/* --- 2. Project Sections & Grouping --- */
.project-section-block {
  margin-bottom: 24px;
}

.project-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.section-heading-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.section-count-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--border-subtle);
  color: var(--text-muted);
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-empty-dropzone {
  padding: 18px;
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  list-style: none;
}

.section-task-list.drag-over {
  background-color: rgba(220, 76, 62, 0.04);
  border-radius: var(--radius-md);
}

.section-add-task-row {
  margin-top: 6px;
}

.btn-section-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.12s;
}

.btn-section-add:hover {
  color: var(--brand-primary);
  background-color: var(--brand-surface);
}

.project-add-section-bar {
  margin-top: 18px;
  padding-top: 12px;
}

.btn-add-section {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-primary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(220, 76, 62, 0.4);
  background: transparent;
  transition: all 0.15s;
}

.btn-add-section:hover {
  background-color: var(--brand-surface);
  border-color: var(--brand-primary);
}

/* --- 3. 35-Day SVG Heatmap Matrix --- */
.heatmap-section-card {
  overflow-x: auto;
}

.heatmap-wrapper {
  width: 100%;
  min-width: 520px;
  padding: 8px 0;
}

.analytics-heatmap-svg {
  width: 100%;
  height: auto;
  display: block;
}

.heatmap-cell {
  transition: fill 0.2s, stroke 0.15s, transform 0.12s;
  cursor: pointer;
}

.heatmap-cell:hover {
  stroke: var(--brand-primary) !important;
  stroke-width: 2px !important;
}

/* --- 4. 1-Click Quick Reschedule Trigger & Popover --- */
.btn-reschedule-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s;
}

.btn-reschedule-trigger:hover {
  background-color: var(--border-subtle);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.btn-reschedule-empty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-color: var(--border-subtle);
  color: var(--text-subtle);
}

.btn-reschedule-empty:hover {
  color: var(--brand-primary);
  border-color: rgba(220, 76, 62, 0.4);
}

.fp-popover {
  position: fixed;
  z-index: 1000;
  background-color: var(--card-bg);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 220px;
  padding: 6px 0;
}

.reschedule-popover-header {
  padding: 6px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.reschedule-options-list {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.reschedule-opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  font-size: 13px;
  color: var(--text-main);
  transition: background-color 0.12s;
  cursor: pointer;
}

.reschedule-opt-btn:hover {
  background-color: var(--brand-surface);
  color: var(--brand-primary);
}

.opt-icon-slot {
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
}

.opt-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.opt-title {
  font-weight: 600;
}

.opt-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.reschedule-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 4px 0;
}

.reschedule-clear-btn:hover {
  background-color: rgba(220, 76, 62, 0.08);
  color: var(--danger);
}

.reschedule-clear-btn .opt-icon-slot {
  color: var(--danger);
}

/* --- 5. Focus Session Micro-Journaling & History Timeline --- */
.session-log-card {
  margin-top: 20px;
}

.session-timeline {
  position: relative;
  padding-left: 24px;
  margin-top: 16px;
}

.session-timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background-color: var(--border-subtle);
}

.session-timeline-entry {
  position: relative;
  margin-bottom: 16px;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--card-bg);
  border: 2px solid var(--brand-primary);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.timeline-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}

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

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

.timeline-task-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timeline-task-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.badge-linked-task {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-surface);
  color: var(--brand-primary);
}

.timeline-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}

.timeline-note-container {
  margin-top: 8px;
}

.timeline-note-bubble {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background-color: var(--sidebar-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand-primary);
  font-size: 12px;
  color: var(--text-main);
}

.note-icon {
  color: var(--brand-primary);
  margin-top: 1px;
  display: flex;
  align-items: center;
}

.note-text {
  flex: 1;
  margin: 0;
  line-height: 1.4;
}

.btn-note-edit {
  color: var(--text-subtle);
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: color 0.12s;
  cursor: pointer;
}

.btn-note-edit:hover {
  color: var(--brand-primary);
}

.btn-add-session-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.12s;
  cursor: pointer;
}

.btn-add-session-note:hover {
  color: var(--brand-primary);
  background-color: var(--brand-surface);
}

.micro-journal-hero {
  padding: 4px 0 8px;
}

.micro-journal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}


/* =========================================================================
   PHASE 4: PRO SUITE DESIGN TOKENS, TRI-VIEW & ZEN MODE
   ========================================================================= */

/* --- Tri-View Switcher Segmented Control --- */
.view-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.view-mode-switcher {
  display: inline-flex;
  align-items: center;
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.view-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  user-select: none;
}

.view-mode-btn:hover {
  color: var(--text-main);
  background-color: var(--border-subtle);
}

.view-mode-btn.is-active {
  color: var(--text-main);
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* --- Kanban Board View (Horizontal Multi-Column Layout) --- */
.board-view-container {
  width: 100%;
  overflow-x: auto;
  padding: 8px 0 24px;
}

.board-columns-track {
  display: flex;
  gap: 16px;
  min-height: calc(100vh - 280px);
  align-items: flex-start;
  padding-bottom: 16px;
  width: 100%;
}

.board-column {
  flex: 1 1 300px;
  min-width: 280px;
  max-width: 420px;
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background-color 0.15s;
}

@media (min-width: 1440px) {
  .board-column {
    flex: 1 1 320px;
    min-width: 300px;
    max-width: 460px;
  }
}

@media (max-width: 1024px) {
  .board-column {
    flex: 0 0 280px;
    min-width: 280px;
  }
}

@media (max-width: 640px) {
  .board-columns-track {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .board-column {
    flex: 0 0 calc(100vw - 40px);
    min-width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
    scroll-snap-align: center;
  }
}

.board-column.drag-over {
  border-color: var(--brand-primary);
  background-color: var(--brand-surface) !important;
}

.board-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.board-column-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-column-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.board-column-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.board-column-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--border-subtle);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.board-column-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.board-column-cards {
  padding: 10px 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  flex: 1;
}

.board-empty-placeholder {
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px 12px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 12px;
  pointer-events: none;
}

.board-column-footer {
  padding: 8px 10px 10px;
}

.btn-board-add {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.btn-board-add:hover {
  background-color: var(--border-subtle);
  color: var(--brand-primary);
}

.board-add-column-card {
  width: 260px;
  min-width: 260px;
}

.btn-board-new-column {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--sidebar-bg);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all 0.15s ease;
}

.btn-board-new-column:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background-color: var(--brand-surface);
}

/* --- Kanban Task Card --- */
.board-task-card {
  position: relative;
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 12px 10px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.board-task-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.board-task-card:active {
  cursor: grabbing;
}

.board-task-card.is-active-focus {
  border-left: 3px solid var(--brand-primary);
  background-color: var(--brand-surface);
}

.board-task-card.is-completed {
  opacity: 0.6;
}

.board-task-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.97);
  outline: 2px dashed var(--brand-primary);
}

.board-card-priority-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.board-card-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.board-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.board-card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-main);
  cursor: pointer;
  flex: 1;
  word-break: break-word;
}

.board-card-title:hover {
  color: var(--brand-primary);
}

.board-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.board-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  opacity: 0.4;
  transition: opacity 0.15s ease;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
}

.board-task-card:hover .board-card-actions {
  opacity: 1;
}

/* --- High-Density Database Table View --- */
.data-table-container {
  width: 100%;
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
  overflow: hidden;
}

.data-table-scrollable {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table thead th {
  background-color: var(--sidebar-bg);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table-row {
  transition: background-color 0.12s ease;
  cursor: pointer;
}

.data-table-row:hover {
  background-color: var(--sidebar-bg);
}

.data-table-row.is-active-focus {
  background-color: var(--brand-surface);
}

.data-table-row.is-completed td {
  opacity: 0.6;
}

.data-table-row.is-completed .table-task-name {
  text-decoration: line-through;
}

.table-title-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
}

.table-task-name {
  font-weight: 500;
  color: var(--text-main);
}

.table-task-name:hover {
  color: var(--brand-primary);
}

.table-task-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.table-prio-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
  display: inline-block;
}

.table-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.data-table-row:hover .table-row-actions {
  opacity: 1;
}

.data-table-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.table-footer-bar {
  padding: 10px 14px;
  background-color: var(--sidebar-bg);
  border-top: 1px solid var(--border-subtle);
}

/* --- Drag and Drop Visual Feedback --- */
.drop-indicator-line {
  height: 2px;
  background-color: var(--brand-primary);
  border-radius: 1px;
  margin: 2px 0;
}

.column-drop-active {
  border-color: var(--brand-primary) !important;
  background-color: var(--brand-surface) !important;
}

/* --- Task Detail Modal & Live Markdown Editor --- */
#taskDetailDialog {
  width: 720px;
  max-width: 94vw;
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0;
  color: var(--text-main);
  overflow: hidden;
}

.task-detail-modal {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  overflow-y: auto;
}

.task-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--sidebar-bg);
}

.task-detail-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-project-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-primary);
  background-color: var(--brand-surface);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.detail-task-id {
  font-size: 11px;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.task-detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-detail-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-title-input {
  width: 100%;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-subtle);
  padding: 6px 0 10px;
  outline: none;
  transition: border-color 0.15s ease;
}

.detail-title-input:focus {
  border-bottom-color: var(--brand-primary);
}

.detail-props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  background-color: var(--sidebar-bg);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.detail-prop-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-prop-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.detail-prio-pills {
  display: flex;
  gap: 4px;
}

.detail-prio-btn {
  flex: 1;
  padding: 5px 0;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background-color: var(--card-bg);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.12s ease;
}

.detail-prio-btn:hover {
  background-color: var(--border-subtle);
}

.detail-prio-btn.is-selected.prio-p1 {
  background-color: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

.detail-prio-btn.is-selected.prio-p2 {
  background-color: #F59E0B;
  color: #FFFFFF;
  border-color: #F59E0B;
}

.detail-prio-btn.is-selected.prio-p3 {
  background-color: #3B82F6;
  color: #FFFFFF;
  border-color: #3B82F6;
}

.detail-prio-btn.is-selected.prio-p4 {
  background-color: #9CA3AF;
  color: #111827;
  border-color: #9CA3AF;
}

.detail-date-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-date-input {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
}

.btn-date-clear {
  font-size: 11px;
  padding: 4px 8px;
}

.detail-pomo-counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-pomo-done {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.detail-pomo-divider {
  color: var(--text-subtle);
}

.pomo-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: var(--card-bg);
}

.btn-stepper {
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-stepper:hover {
  background-color: var(--border-subtle);
  color: var(--text-main);
}

.pomo-input-val {
  width: 36px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 12px;
  padding: 2px 0;
  -moz-appearance: textfield;
}

.pomo-input-val::-webkit-inner-spin-button,
.pomo-input-val::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Extended Markdown Dual-Tab Section */
.detail-markdown-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  background-color: var(--sidebar-bg);
}

.detail-markdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.markdown-tabs {
  display: inline-flex;
  gap: 4px;
}

.md-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.12s ease;
}

.md-tab-btn:hover {
  color: var(--text-main);
}

.md-tab-btn.is-active {
  background-color: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.markdown-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-md-tool {
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-md-tool:hover {
  background-color: var(--border-subtle);
  color: var(--text-main);
}

.detail-notes-textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  outline: none;
  resize: vertical;
}

.detail-notes-textarea:focus {
  border-color: var(--brand-primary);
}

.detail-notes-preview-content {
  padding: 12px;
  min-height: 130px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow-y: auto;
  max-height: 240px;
}

.markdown-panel.is-hidden {
  display: none;
}

/* Detail Subtasks */
.detail-subtasks-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-subtasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-subtasks-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.detail-subtasks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.detail-subtask-row.is-completed span {
  text-decoration: line-through;
  color: var(--text-muted);
}

.detail-subtask-row span {
  flex: 1;
  font-size: 13px;
}

.detail-subtask-add-row {
  display: flex;
  gap: 8px;
}

.detail-subtask-add-row input {
  flex: 1;
}

.task-detail-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

/* --- Markdown Rendered Typography --- */
.md-paragraph {
  margin-bottom: 8px;
  line-height: 1.5;
}

.md-h1, .md-h2, .md-h3, .md-h4, .md-h5, .md-h6 {
  font-weight: 700;
  margin: 12px 0 6px;
  color: var(--text-main);
  line-height: 1.3;
}

.md-h1 { font-size: 18px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 4px; }
.md-h2 { font-size: 16px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 4px; }
.md-h3 { font-size: 14px; }

.md-blockquote {
  border-left: 3px solid var(--brand-primary);
  padding: 4px 12px;
  margin: 8px 0;
  color: var(--text-muted);
  font-style: italic;
  background-color: var(--brand-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.md-code-block {
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  margin: 8px 0;
}

.md-inline-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background-color: var(--border-subtle);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--brand-primary);
}

.md-bullet-list, .md-ordered-list, .md-checklist {
  margin: 6px 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.5;
}

.md-checklist {
  list-style: none;
  padding-left: 0;
}

.md-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.md-task-item.is-checked {
  color: var(--text-muted);
  text-decoration: line-through;
}

.md-link {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.md-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 12px 0;
}

/* =========================================================================
   PHASE 6: OBSIDIAN MARKDOWN STYLING & IN-PLACE LIVE PREVIEW
   Smart Wikilinks, Admonition Callouts, Glowing Highlights, KaTeX Math,
   Multi-State Checklists, Footnotes, and Live Preview Block Transitions.
   ========================================================================= */

/* --- Obsidian Callouts / Admonitions --- */
.obsidian-callout {
  border-left: 4px solid var(--callout-border, var(--brand-primary));
  background-color: var(--callout-bg, var(--brand-surface));
  border-radius: 6px;
  padding: 10px 14px;
  margin: 12px 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.obsidian-callout.callout-note {
  --callout-border: #3b82f6;
  --callout-bg: rgba(59, 130, 246, 0.08);
}
.obsidian-callout.callout-tip {
  --callout-border: #f59e0b;
  --callout-bg: rgba(245, 158, 11, 0.08);
}
.obsidian-callout.callout-warning {
  --callout-border: #f97316;
  --callout-bg: rgba(249, 115, 22, 0.08);
}
.obsidian-callout.callout-danger {
  --callout-border: #ef4444;
  --callout-bg: rgba(239, 68, 68, 0.08);
}
.obsidian-callout.callout-success {
  --callout-border: #10b981;
  --callout-bg: rgba(16, 185, 129, 0.08);
}
.obsidian-callout.callout-todo {
  --callout-border: #06b6d4;
  --callout-bg: rgba(6, 182, 212, 0.08);
}
.obsidian-callout.callout-quote {
  --callout-border: #8b5cf6;
  --callout-bg: rgba(139, 92, 246, 0.08);
}
.obsidian-callout.callout-example {
  --callout-border: #a855f7;
  --callout-bg: rgba(168, 85, 247, 0.08);
}

.obsidian-callout .callout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
  cursor: default;
  margin-bottom: 6px;
}

.obsidian-callout.is-collapsible summary.callout-header {
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.obsidian-callout.is-collapsible summary::-webkit-details-marker {
  display: none;
}

.obsidian-callout .callout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--callout-border);
}

.obsidian-callout .callout-title {
  flex: 1;
}

.obsidian-callout .callout-fold-icon {
  display: inline-flex;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.obsidian-callout[open] .callout-fold-icon {
  transform: rotate(180deg);
}

.obsidian-callout .callout-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-main);
}

.obsidian-callout .callout-body p:last-child {
  margin-bottom: 0;
}

/* --- Obsidian Smart Wikilinks --- */
.obsidian-wikilink {
  color: #8b5cf6;
  font-weight: 500;
  text-decoration: underline dotted 1.5px;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
  padding: 0 3px;
  border-radius: 3px;
}

.obsidian-wikilink:hover {
  color: #7c3aed;
  background-color: rgba(139, 92, 246, 0.12);
  text-decoration: underline solid 1.5px;
}

[data-theme="dark"] .obsidian-wikilink {
  color: #a78bfa;
}

[data-theme="dark"] .obsidian-wikilink:hover {
  color: #c4b5fd;
  background-color: rgba(167, 139, 250, 0.18);
}

/* --- Obsidian Highlights (==text==) --- */
.obsidian-highlight {
  background-color: rgba(245, 158, 11, 0.28);
  color: inherit;
  padding: 1px 4px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

[data-theme="dark"] .obsidian-highlight {
  background-color: rgba(251, 191, 36, 0.22);
  color: #fef3c7;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}

/* --- Multi-State Task Checklists --- */
.md-task-item[data-task-state="in-progress"] {
  color: #d97706;
}
[data-theme="dark"] .md-task-item[data-task-state="in-progress"] {
  color: #fbbf24;
}

.md-task-item[data-task-state="cancelled"] {
  color: var(--text-muted);
  opacity: 0.6;
}
.md-task-item[data-task-state="cancelled"] .task-strikethrough {
  text-decoration: line-through;
}

.md-task-item[data-task-state="deferred"] {
  color: var(--brand-primary);
  font-style: italic;
}

/* --- Pre-bundled Local KaTeX Math Typography --- */
.obsidian-math-block.katex-block {
  text-align: center;
  padding: 14px 18px;
  margin: 12px 0;
  overflow-x: auto;
  overflow-y: hidden;
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.obsidian-math-inline.katex-inline {
  display: inline;
  padding: 0 3px;
  vertical-align: baseline;
}

.katex {
  font-size: 1.05em;
  text-rendering: auto;
}

/* --- Footnotes --- */
.md-footnote-ref {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  margin-left: 2px;
}
.md-footnote-ref a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}
.md-footnotes {
  margin-top: 20px;
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.md-footnotes-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}
.md-footnotes-list {
  padding-left: 18px;
  line-height: 1.5;
}
.md-footnote-backref {
  color: var(--brand-primary);
  text-decoration: none;
  margin-left: 4px;
}

/* --- Obsidian-Grade In-Place Live Preview Editor --- */
.live-editor-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: var(--card-bg);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.live-editor-container:focus-within {
  border-color: var(--brand-primary);
}

.live-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background-color: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  gap: 8px;
}

.btn-live-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background-color: var(--card-bg);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-live-mode:hover {
  background-color: var(--border-subtle);
}

.live-editor-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.btn-live-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-live-tool:hover {
  background-color: var(--border-subtle);
  color: var(--text-main);
}

.live-editor-stats {
  font-size: 11px;
  color: var(--text-subtle);
}

.live-editor-content {
  position: relative;
  min-height: 120px;
  padding: 8px 10px;
}

.live-blocks-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-block {
  position: relative;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.live-block.is-dormant {
  cursor: text;
  padding: 3px 6px;
}

.live-block.is-dormant:hover {
  background-color: rgba(125, 125, 125, 0.05);
}

.live-block.is-active {
  background-color: var(--card-bg);
}

.live-block-editor {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--brand-primary);
  border-radius: 4px;
  background-color: var(--sidebar-bg);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  padding: 6px 8px;
  resize: none;
  outline: none;
  box-shadow: 0 0 0 1px var(--brand-primary);
}

.live-source-textarea {
  width: 100%;
  min-height: 140px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  padding: 4px;
}

.live-empty-placeholder {
  color: var(--text-subtle);
  font-style: italic;
  font-size: 13px;
  padding: 12px 6px;
  cursor: text;
}

/* =========================================================================
   PHASE 9: ULTRA-ZEN MONUMENTAL THEATER (Apple/Linear-Grade Visual Sanctuary)
   Deep OLED (#0A0B0D) / Crisp Minimalist (#FAF8F7), breathing ambient aura,
   massive tabular digits only, consolidated frosted floating bottom capsule.
   ========================================================================= */

.zen-mode-dialog {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  background-color: #0A0B0D !important;
  color: #F9FAFB !important;
  border: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  z-index: 1000;
}

.zen-mode-dialog::backdrop {
  background: #0A0B0D;
}

/* Symmetrical Light Mode Zen Mode Dialog */
body.theme-light .zen-mode-dialog,
[data-theme="light"] .zen-mode-dialog {
  background-color: #FAF8F7 !important;
  color: #1E2024 !important;
}

body.theme-light .zen-mode-dialog::backdrop,
[data-theme="light"] .zen-mode-dialog::backdrop {
  background: #FAF8F7;
}

/* Zen Theater Container */
.zen-theater-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #151921 0%, #0A0B0D 75%);
  color: #F9FAFB;
  transition: background 0.4s ease, color 0.4s ease;
  user-select: none;
  cursor: default;
}

/* Symmetrical Light Mode Zen Theater Container */
body.theme-light .zen-theater-container,
[data-theme="light"] .zen-theater-container {
  background: radial-gradient(circle at 50% 35%, #FFFFFF 0%, #FAF8F7 80%);
  color: #1E2024;
}

/* Dynamic Breathing Focus Aura */
@keyframes zen-pulse-glow {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.28;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.18);
    opacity: 0.42;
  }
}

.zen-ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 680px;
  height: 680px;
  border-radius: 50%;
  background: radial-gradient(circle, #DC4C3E 0%, #6366F1 45%, transparent 75%);
  opacity: 0.28;
  filter: blur(120px);
  pointer-events: none;
  animation: zen-pulse-glow 5s ease-in-out infinite;
  z-index: 1;
  transition: background 0.8s ease, opacity 0.8s ease;
}

.zen-theater-container.is-break .zen-ambient-glow,
.zen-ambient-glow.is-break {
  background: radial-gradient(circle, #10B981 0%, #06B6D4 50%, transparent 75%);
  animation: zen-pulse-glow 4s ease-in-out infinite;
}

body.theme-light .zen-theater-container .zen-ambient-glow {
  opacity: 0.16;
}

/* Zen Theater Top Bar */
.zen-theater-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 40px;
  width: 100%;
  z-index: 10;
  transition: opacity 0.4s ease;
}

.zen-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zen-brand-mark {
  background: #DC4C3E;
  color: #FFFFFF;
  box-shadow: 0 0 16px rgba(220, 76, 62, 0.5);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zen-brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F3F4F6;
  opacity: 0.85;
}

body.theme-light .zen-theater-container .zen-brand-title {
  color: #1E2024;
}

/* =========================================================================
   MONUMENTAL CENTER STAGE (Massive Tabular Digits & Breathing Colon Only)
   ========================================================================= */

.zen-center-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.monumental-digits-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.monumental-digits {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: clamp(5rem, 20vw, 15rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #F9FAFB;
  text-shadow: 0 8px 48px rgba(0, 0, 0, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.4s ease;
}

body.theme-light .zen-theater-container .monumental-digits,
[data-theme="light"] .zen-theater-container .monumental-digits {
  color: #1E2024;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
}

.monumental-mins,
.monumental-secs {
  display: inline-block;
  min-width: 1.15ch;
  text-align: center;
}

.monumental-colon {
  display: inline-block;
  margin: 0 0.03em;
  color: var(--accent, #DC4C3E);
  animation: colon-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  transition: color 0.4s ease;
}

.zen-theater-container.is-break .monumental-colon {
  color: #10B981;
}

@keyframes colon-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.28;
    transform: scale(0.96);
  }
}

/* =========================================================================
   CONSOLIDATED MINIMALIST FROSTED BOTTOM CAPSULE (.zen-floating-capsule)
   ========================================================================= */

.zen-floating-capsule {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(22, 24, 27, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 8px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 20;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.theme-light .zen-floating-capsule,
[data-theme="light"] .zen-floating-capsule {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  color: #1E2024;
}

/* Capsule Subgroups */
.zen-capsule-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zen-controls-group {
  gap: 8px;
}

.zen-info-group {
  gap: 12px;
  padding: 0 4px;
}

.zen-audio-exit-group {
  gap: 10px;
}

.zen-capsule-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
}

body.theme-light .zen-capsule-divider,
[data-theme="light"] .zen-capsule-divider {
  background: rgba(0, 0, 0, 0.1);
}

/* Capsule Task Title */
.zen-capsule-task {
  font-size: 13px;
  font-weight: 600;
  color: #F9FAFB;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-light .zen-capsule-task,
[data-theme="light"] .zen-capsule-task {
  color: #1E2024;
}

/* Capsule Phase Badge */
.zen-phase-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent, #DC4C3E);
  background: rgba(220, 76, 62, 0.14);
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.zen-theater-container.is-break .zen-phase-badge {
  color: #10B981;
  background: rgba(16, 185, 129, 0.14);
}

/* Capsule Daily Goal Badge */
.zen-floating-capsule .zen-goal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: #9CA3AF;
  white-space: nowrap;
}

body.theme-light .zen-floating-capsule .zen-goal-badge {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #4B5563;
}

/* Controls inside capsule */
.btn-zen-ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #9CA3AF;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.15s ease;
}

.btn-zen-ctrl:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.btn-zen-ctrl.is-active {
  background: rgba(220, 76, 62, 0.25);
  color: #EF4444;
  border-color: rgba(220, 76, 62, 0.4);
}

body.theme-light .btn-zen-ctrl {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #4B5563;
}

body.theme-light .btn-zen-ctrl:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #111827;
}

body.theme-light .btn-zen-ctrl.is-active {
  background: rgba(220, 76, 62, 0.15);
  color: #DC4C3E;
  border-color: rgba(220, 76, 62, 0.3);
}

.btn-zen-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #DC4C3E;
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(220, 76, 62, 0.45);
  transition: transform 0.15s, background-color 0.15s;
}

.btn-zen-primary:hover {
  transform: scale(1.06);
  background: #EF4444;
}

.zen-theater-container.is-break .btn-zen-primary {
  background: #10B981;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
}

.zen-theater-container.is-break .btn-zen-primary:hover {
  background: #059669;
}

/* Soundscape Selector & Volume in Capsule */
.zen-noise-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #D1D5DB;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 9999px;
  outline: none;
}

body.theme-light .zen-noise-select {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1E2024;
}

.zen-noise-select option {
  background: #181B20;
  color: #F3F4F6;
}

body.theme-light .zen-noise-select option {
  background: #FFFFFF;
  color: #1E2024;
}

.zen-volume-slider-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9CA3AF;
}

.zen-range {
  width: 64px;
}

/* Exit Zen Button in Capsule */
.btn-zen-exit {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #9CA3AF;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-zen-exit:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.06);
}

body.theme-light .btn-zen-exit {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #4B5563;
}

body.theme-light .btn-zen-exit:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #111827;
}

/* =========================================================================
   INACTIVITY AUTO-FADE (Fades out after 3.5s of stationary mouse/keyboard)
   ========================================================================= */

.zen-theater-container.is-zen-idle .zen-floating-capsule,
.zen-theater-container.is-zen-idle .zen-theater-top {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.zen-theater-top,
.zen-floating-capsule {
  transition: opacity 0.25s ease;
}

@media (max-width: 768px) {
  .zen-floating-capsule {
    bottom: 20px;
    padding: 6px 12px;
    gap: 10px;
    max-width: 95vw;
    overflow-x: auto;
  }
  .zen-capsule-task {
    max-width: 120px;
  }
  .zen-noise-select {
    display: none;
  }
  .zen-volume-slider-wrap {
    display: none;
  }
}

.btn-zen-open-dock {
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-zen-open-dock:hover {
  color: var(--brand-primary);
  background-color: var(--brand-surface);
}

/* Microphone Pulse Animation for Voice Recognition */
@keyframes mic-pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 76, 62, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(220, 76, 62, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 76, 62, 0);
  }
}

.btn-voice-active,
.is-recording {
  color: #DC4C3E !important;
  animation: mic-pulse-ring 1.5s cubic-bezier(0.25, 0, 0, 1) infinite !important;
  background: rgba(220, 76, 62, 0.15) !important;
  border-radius: 50%;
}

/* Toast Feedback Notification */
.fp-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-main);
  color: var(--canvas-bg);
  padding: 9px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.fp-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.qa-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-voice-qa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--brand-surface);
  color: var(--brand-primary);
  border: 1px solid var(--brand-subtle);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-voice-qa:hover {
  background: var(--brand-subtle);
}

/* --- Keyboard Shortcuts Modal --- */
.shortcuts-modal {
  width: 680px;
  max-width: 94vw;
}

.shortcuts-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.shortcut-group {
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-group h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-primary);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-main);
}

.shortcut-action {
  color: var(--text-main);
}

/* --- Curated Theme & Accent Settings Swatches --- */
.theme-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.theme-preset-card {
  padding: 10px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.theme-preset-card:hover {
  border-color: var(--border-hover);
}

.theme-preset-card.is-selected {
  border-color: var(--brand-primary);
  background-color: var(--brand-surface);
}

.theme-preset-name {
  font-size: 12px;
  font-weight: 600;
}

.theme-preview-palette {
  display: flex;
  height: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-preview-palette span {
  flex: 1;
}

.accent-color-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.accent-color-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.accent-color-btn:hover {
  transform: scale(1.1);
}

.accent-color-btn.is-selected {
  border-color: var(--text-main);
  box-shadow: 0 0 0 2px var(--card-bg);
}

/* =========================================================================
   Phase 7: Helium Voice Engine, VU Meter & Diagnostic Modal Styles
   ========================================================================= */

/* Password Input with Show/Hide Adornment Button */
.fp-input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.fp-input-password-wrap .fp-input {
  padding-right: 36px;
  width: 100%;
}

.btn-input-adornment {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.btn-input-adornment:hover {
  color: var(--text-main);
  background-color: var(--border-subtle);
}

.setting-hint-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

.setting-hint-sub a {
  color: var(--brand-primary);
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Settings Live Mic VU Meter & Diagnostic Test */
.mic-test-container {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--sidebar-bg);
}

.mic-test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mic-test-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: var(--border-subtle);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.mic-test-status.is-active {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.mic-test-status.is-error {
  background-color: rgba(220, 76, 62, 0.15);
  color: #DC4C3E;
}

.mic-test-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mic-visualizer {
  display: flex;
  align-items: center;
  flex: 1;
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  height: 36px;
}

.mic-meter-svg {
  display: block;
  width: 100%;
  height: 28px;
}

.mic-bar {
  fill: var(--border-subtle);
  transition: height 0.08s ease, y 0.08s ease, fill 0.15s ease;
}

.mic-bar.is-active {
  fill: var(--brand-primary);
}

/* Transcribing animation state for mic buttons */
.btn-voice-qa.is-transcribing,
.btn-icon-tiny.is-transcribing {
  animation: pulse-transcribing 1.2s infinite ease-in-out;
  color: #38BDF8 !important;
}

@keyframes pulse-transcribing {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* Helium Voice Guidance Modal */
.helium-voice-modal {
  max-width: 540px;
  width: 90vw;
}

.helium-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.helium-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background-color: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.45;
}

.helium-info-banner svg {
  color: #38BDF8;
  flex-shrink: 0;
  margin-top: 1px;
}

.helium-modal-text {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 14px;
  line-height: 1.4;
}

.helium-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.helium-option-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  background-color: var(--card-bg);
  transition: border-color 0.15s ease;
}

.helium-option-card:hover {
  border-color: var(--border-hover);
}

.helium-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.helium-card-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
}

.helium-card-header svg {
  color: var(--brand-primary);
  flex-shrink: 0;
}

.helium-option-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 10px 0;
}

.helium-option-card code {
  font-size: 11px;
  padding: 1px 4px;
  background-color: var(--sidebar-bg);
  border-radius: 3px;
  color: var(--brand-primary);
}

.helium-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.helium-tip-badge {
  font-size: 12px;
  color: #10B981;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* =========================================================================
   PHASE 8 PRODUCTIVITY, GOALS, LIVE PREVIEW & ONBOARDING
   ========================================================================= */

/* Productivity Hero Card & XP Progress Bar */
.productivity-hero-card .prod-xp-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: var(--border-subtle);
  overflow: hidden;
  margin: 6px 0;
}

.productivity-hero-card .prod-xp-progress-bar {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent), #F59E0B);
  transition: width 0.4s ease;
}

/* Goals Progress Rings Section */
.goals-progress-section {
  margin-bottom: 24px;
}

.goals-rings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.goal-ring-card {
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.goal-ring-card.is-goal-reached {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.05);
}

.goal-ring-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.goal-ring-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.badge-goal-hit {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.goal-ring-visual-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.goal-ring-svg-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.goal-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.goal-fill-task {
  stroke: var(--accent);
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.goal-ring-center-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.goal-ring-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goal-stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.goal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-task { background-color: var(--accent); }
.dot-pomo { background-color: #F59E0B; }

.goal-stat-label {
  color: var(--text-muted);
}

.goal-stat-val {
  color: var(--text-main);
  font-weight: 600;
}

/* Vector Celebration Particles Overlay */
.celebration-particles-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.celebration-particle {
  position: absolute;
  opacity: 1;
  transition: transform 1.6s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 1.6s ease;
}

.celebration-particles-overlay.is-active .celebration-particle {
  transform: translate(var(--tx), var(--ty)) rotate(var(--rot));
  opacity: 0;
}

/* Reading / Live Edit Subtle Switcher & Live Editor */
.live-editor-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-live-reading-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-live-reading-toggle:hover {
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-live-reading-toggle.is-reading-active {
  color: var(--accent);
  background: rgba(220, 76, 62, 0.08);
  border-color: rgba(220, 76, 62, 0.25);
}

.live-editor-container.is-reading-mode .live-editor-tools,
.live-editor-container.is-reading-mode .btn-live-mode {
  opacity: 0.35;
  pointer-events: none;
}

.live-editor-container.is-reading-mode .live-block-preview {
  cursor: default;
}

/* Quick Notes Header Status Row */
.quick-notes-status-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-hover);
}

/* All Tasks View */
.all-tasks-view .header-icon-all-tasks {
  color: var(--accent);
  display: flex;
  align-items: center;
}

.sort-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.all-tasks-sort-select {
  padding: 6px 12px;
  font-size: 13px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
}

/* Custom Lists Styling */
.custom-list-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Interactive Onboarding Modal Dialog */
.onboarding-dialog {
  max-width: 580px;
  width: 90vw;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.onboarding-modal {
  display: flex;
  flex-direction: column;
}

.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.onboarding-step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-subtle);
  transition: all 0.25s ease;
}

.step-dot.is-active {
  width: 24px;
  border-radius: 9999px;
  background: var(--accent);
}

.onboarding-body {
  padding: 24px;
}

.onboarding-step-slide {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.onboarding-step-slide.is-active {
  display: flex;
}

.onboarding-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(220, 76, 62, 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.onboarding-demo-box {
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 6px;
}

.demo-input-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 8px;
}

.demo-chip {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.chip-p1 { background: rgba(220, 76, 62, 0.15); color: #DC4C3E; }
.chip-pomo { background: rgba(235, 137, 9, 0.15); color: #EB8909; }
.chip-proj { background: rgba(36, 111, 224, 0.15); color: #246FE0; }
.chip-date { background: rgba(5, 133, 39, 0.15); color: #058527; }

.demo-explanation {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.demo-clock-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.demo-digits {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}

.demo-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(220, 76, 62, 0.15);
  color: var(--accent);
  text-transform: uppercase;
}

.demo-markdown-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.demo-md-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-main);
}

.demo-rewards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.demo-reward-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-main);
}

.reward-xp {
  font-weight: 700;
  color: var(--accent);
  font-size: 12px;
  padding: 2px 6px;
  background: rgba(220, 76, 62, 0.12);
  border-radius: 4px;
}

.onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.onboarding-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================================
   Phase 10: Top Navigation & Header Sync Status Pill
   ========================================================================= */

.app-top-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 28px 0 28px;
  background: transparent;
  gap: 12px;
  position: relative;
  z-index: 10;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.mobile-only-btn,
.mobile-only-brand {
  display: none !important;
}

@media (max-width: 768px) {
  .app-top-header {
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--sidebar-bg);
  }

  .mobile-only-btn {
    display: inline-flex !important;
  }

  .mobile-only-brand {
    display: flex !important;
  }
}

.header-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  transition: all 0.15s ease;
  user-select: none;
}

.header-sync-pill:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-main);
}

.sync-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  transition: background 0.2s ease;
}

.sync-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-sync-pill.is-synced .sync-pill-dot {
  background: #10b981;
}

.header-sync-pill.is-synced {
  color: var(--text-muted);
}

.header-sync-pill.is-syncing .sync-pill-dot {
  background: #6366f1;
}

.header-sync-pill.is-syncing .sync-pill-icon svg {
  animation: spin 1s linear infinite;
}

.header-sync-pill.is-offline .sync-pill-dot {
  background: #f59e0b;
}

.header-sync-pill.is-not-paired .sync-pill-dot {
  background: #6b7280;
}

.header-sync-pill.is-error .sync-pill-dot {
  background: #ef4444;
}

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

/* =========================================================================
   Phase 10: Multi-Device Sync Pairing Dialog & Tabs
   ========================================================================= */

.sync-pairing-modal {
  max-width: 500px;
  width: 100%;
}

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

.sync-dialog-title-row h2 {
  font-size: 17px;
  font-weight: 650;
  color: var(--text-main);
  margin: 0;
}

.sync-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-hover);
  border-radius: 8px;
  margin: 14px 0;
}

.sync-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sync-tab-btn:hover {
  color: var(--text-main);
}

.sync-tab-btn.is-active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.sync-tab-panel {
  display: block;
}

.sync-tab-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}

.sync-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 14px;
}

.sync-qr-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.sync-qr-caption {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 8px;
}

.sync-key-card {
  margin-bottom: 14px;
}

.sync-key-input-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.sync-key-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  flex: 1;
}

.sync-controls-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.sync-status-indicator-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.sync-indicator-label {
  color: var(--text-muted);
}

.sync-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.sync-buttons-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-feedback-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid var(--border-subtle);
  background: var(--bg-hover);
}

.sync-feedback-box.is-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.sync-feedback-box.is-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.sync-security-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* =========================================================================
   Phase 10: Settings Cloud Sync Card & Offline Voice Card
   ========================================================================= */

.sync-settings-summary-card {
  padding: 12px 14px;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  margin-top: 10px;
}

.sync-summary-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sync-summary-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.sync-summary-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.offline-voice-card {
  padding: 12px 14px;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.offline-voice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.offline-voice-title-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.offline-model-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}

.offline-model-badge.is-downloaded {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.offline-voice-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.offline-voice-storage-text {
  font-size: 11px;
  color: var(--text-muted);
}

.offline-download-progress {
  margin-top: 10px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent, #dc4c3e);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.progress-status-text {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Phase 12: Reverse-Engineered Obsidian Live Preview & Floating Toggle --- */
.live-editor-wrapper {
  position: relative;
  width: 100%;
}

.live-editor-floating-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background-color: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.live-editor-wrapper:hover .live-editor-floating-toggle,
.live-editor-wrapper:focus-within .live-editor-floating-toggle,
.live-editor-container:hover .live-editor-floating-toggle,
.live-editor-container:focus-within .live-editor-floating-toggle {
  opacity: 1;
  pointer-events: auto;
}

.live-editor-floating-toggle:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.live-editor-floating-toggle.is-reading-active {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* --- Phase 12: Refined Clean Slate Empty State --- */
.empty-focus-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
}

.empty-monolith-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.empty-focus-state:hover .empty-monolith-mark {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.empty-focus-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.empty-keyboard-hint {
  font-size: 13px;
  color: var(--text-subtle);
  margin-bottom: 20px;
}

.empty-keyboard-hint strong {
  color: var(--text-muted);
  font-weight: 600;
}

.btn-empty-guide {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

/* --- Phase 12: Custom Priority Settings & Dynamic Pills --- */
.priority-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.priority-setting-row {
  display: grid;
  grid-template-columns: 44px 1fr 140px 90px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--card-bg);
  border: 1px solid var(--border-subtle);
}

.priority-tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.setting-label-mini {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 3px;
  letter-spacing: 0.05em;
}

.prio-color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fp-color-picker.prio-color-input {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  background: none;
}

.prio-color-hex {
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted);
}

.prio-icon-input {
  text-align: center;
}

.meta-badge.badge-priority {
  border: 1px solid;
  font-weight: 600;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-priority-preview {
  border: 1px solid;
  border-radius: 4px;
  padding: 1px 6px;
}

#detailPrioPills .detail-prio-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background-color: var(--card-bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

#detailPrioPills .detail-prio-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

#detailPrioPills .detail-prio-btn.is-selected {
  border-color: var(--prio-pill-color, var(--brand-primary));
  background-color: rgba(220, 76, 62, 0.1);
  color: var(--prio-pill-color, var(--brand-primary));
  font-weight: 600;
}
