/* ═══════════════════════════════════════════════════════════════════════
   VANGUARD  ·  Modern Professional Theme
   Dark default  ·  Cyber via body.theme-cyber  ·  Light via body.theme-light
   Palette: slate blue · emerald · deep space · warm white
   ═══════════════════════════════════════════════════════════════════════ */

/* ════════════════════════
   DARK THEME  (default)
   ════════════════════════ */
:root {
  /* surfaces */
  --bg-base: #111318;
  --bg-surface: #191c23;
  --bg-card: #1e2129;
  --bg-sidebar: #15171e;
  --bg-hover: #252831;
  --bg-inset: #0d0f14;

  /* accent — cooler blue for dark */
  --accent: #5b8af0;
  --accent-dim: #7aa0f5;
  --accent-soft: rgba(91, 138, 240, 0.12);

  /* semantic colours — brightened for dark bg */
  --green: #3ecf8e;
  --cyan: #22d3ee;
  --rose: #fb7185;
  --gold: #fbbf24;
  --violet: #a78bfa;
  --teal: #2dd4bf;
  --slate: #94a3b8;
  --amber: #fbbf24;

  /* text */
  --text-1: #e9ecf2;
  --text-2: #b0bac8;
  --text-3: #7584a0;
  --text-4: #4a5670;

  /* borders */
  --border-1: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --border-3: rgba(255, 255, 255, 0.22);

  /* shadows — deeper for dark */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
}

/* ════════════════════════
   DARK THEME — vars live on :root (see above)
   body.theme-dark kept for JS class compatibility only
   ════════════════════════ */

/* ════════════════════════
   CYBER THEME  (dark · blue · green gradient)
   ════════════════════════ */
body.theme-cyber {
  /* surfaces — deep space black */
  --bg-base: #070b12;
  --bg-surface: #0b1422;
  --bg-card: #0d1826;
  --bg-sidebar: #090e1a;
  --bg-hover: #12202e;
  --bg-inset: #050810;

  /* accent — electric blue */
  --accent: #00c8ff;
  --accent-dim: #0090c0;
  --accent-soft: rgba(0, 200, 255, 0.09);

  /* semantic — neon palette */
  --green: #00e87a;
  --cyan: #00f0ff;
  --rose: #ff3d6b;
  --gold: #ffc200;
  --violet: #a855f7;
  --teal: #00e87a;
  --slate: #3a6a90;
  --amber: #ffaa00;

  /* text hierarchy */
  --text-1: #d4eeff;
  --text-2: #6ea8cc;
  --text-3: #3a6a8a;
  --text-4: #1e4060;

  /* borders — cyan tinted */
  --border-1: rgba(0, 200, 255, 0.07);
  --border-2: rgba(0, 200, 255, 0.13);
  --border-3: rgba(0, 200, 255, 0.24);

  /* shadows — deep with cyan glow */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 10px rgba(0, 200, 255, 0.04);
  --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.65), 0 0 18px rgba(0, 200, 255, 0.06);
  --shadow-lg: 0 12px 44px rgba(0, 0, 0, 0.75), 0 0 32px rgba(0, 200, 255, 0.09);

  /* gradient body background */
  background:
    radial-gradient(ellipse at 18% 0%, rgba(0, 70, 140, 0.38) 0%, transparent 52%),
    radial-gradient(ellipse at 82% 100%, rgba(0, 80, 80, 0.22) 0%, transparent 48%), #070b12;
}

/* ── Cyber gradient surfaces ── */
body.theme-cyber .sidebar {
  background: linear-gradient(160deg, #0d1c2e 0%, #070c18 100%);
  border-right-color: rgba(0, 200, 255, 0.1);
}
body.theme-cyber .brand {
  background: linear-gradient(135deg, #0a1a32 0%, #060e1c 100%);
  border-bottom-color: rgba(0, 200, 255, 0.12);
}
body.theme-cyber .brand-icon {
  background: linear-gradient(135deg, #005fa0, #00c8ff);
  box-shadow: 0 0 18px rgba(0, 200, 255, 0.28);
}
body.theme-cyber .brand h1 {
  background: linear-gradient(135deg, #00c8ff 0%, #00e87a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.theme-cyber .calendar-widget,
body.theme-cyber .prediction-section,
body.theme-cyber .grid-container {
  background: linear-gradient(150deg, #0d1a28 0%, #080d1a 100%);
}
body.theme-cyber .widget-box {
  background: linear-gradient(145deg, #0c1828 0%, #070d1c 100%);
}
body.theme-cyber .pred-card,
body.theme-cyber .si-mini-card,
body.theme-cyber .si-mission-card {
  background: linear-gradient(145deg, #0c1828 0%, #07101e 100%);
}
body.theme-cyber .cal-section {
  background: linear-gradient(145deg, #0a1624 0%, #060d1a 100%);
}
body.theme-cyber .modal-card {
  background: linear-gradient(145deg, #0d1a2c 0%, #070c1a 100%);
}
body.theme-cyber .nexus-btn {
  background: linear-gradient(135deg, #0d1828 0%, #070c16 100%);
  border-color: rgba(0, 200, 255, 0.18);
  color: #00c8ff;
}
body.theme-cyber .nexus-btn:hover {
  background: linear-gradient(135deg, #0f2242 0%, #081022 100%);
  border-color: rgba(0, 200, 255, 0.5);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 28px rgba(0, 200, 255, 0.16);
}

/* ── Cyber accent elements ── */
body.theme-cyber .cycle-number-badge {
  background: linear-gradient(135deg, #006aaa, #00c8ff);
  box-shadow: 0 1px 14px rgba(0, 200, 255, 0.38);
}
body.theme-cyber .current-date-widget {
  border-left-color: #00e87a;
}
body.theme-cyber #year-line-progress {
  background: linear-gradient(90deg, #0090d0, #00c8ff);
}
body.theme-cyber .doy-fill {
  background: linear-gradient(90deg, #0090d0, #00c8ff);
}
body.theme-cyber .doy-num {
  color: #00c8ff;
}
body.theme-cyber .week-number-badge.current-week {
  background: linear-gradient(135deg, #006aaa, #00c8ff);
  border-color: transparent;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.4);
}

/* ── Cyber green: today markers ── */
body.theme-cyber .week-cell.today .week-cell-dot {
  background: #00e87a;
  border-color: #00e87a;
  box-shadow: 0 0 10px rgba(0, 232, 122, 0.42);
}
body.theme-cyber .week-cell.today .week-cell-name {
  color: #00e87a;
}
body.theme-cyber .dot-day.today {
  background: linear-gradient(135deg, #00b060, #00e87a) !important;
  border-color: #00e87a !important;
  box-shadow: 0 0 10px rgba(0, 232, 122, 0.42);
}
body.theme-cyber .cal-brick.today {
  background: #00c8ff;
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.42);
}
body.theme-cyber .month-brick.today {
  background: #00c8ff;
}
body.theme-cyber .month-brick.filled {
  background: rgba(0, 200, 255, 0.35);
  border-color: transparent;
}

/* ── Cyber ring ── */
body.theme-cyber .ring-arc {
  stroke: #00e87a;
}
body.theme-cyber .ring-trail {
  stroke: #00e87a;
}
body.theme-cyber .ring-day-sub {
  color: #00e87a;
}

/* ── Cyber mission table ── */
body.theme-cyber .col-today {
  background: rgba(0, 200, 255, 0.06) !important;
}
body.theme-cyber .col-today .date-day-num {
  color: #00c8ff;
}
body.theme-cyber .col-today .date-day-name {
  color: #00c8ff;
  opacity: 0.85;
}
body.theme-cyber thead th {
  background: rgba(5, 8, 16, 0.85);
}
body.theme-cyber thead .th-mission {
  background: rgba(7, 10, 20, 0.92) !important;
}

/* ── Cyber active / selection states ── */
body.theme-cyber .cal-section.active-section {
  border-color: #00c8ff;
  background: rgba(0, 200, 255, 0.07);
}
body.theme-cyber .cal-section.active-section .cal-section-label {
  color: #00c8ff;
}
body.theme-cyber ::-webkit-scrollbar-thumb {
  background: rgba(0, 200, 255, 0.22);
}
body.theme-cyber ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 200, 255, 0.42);
}

/* ════════════════════════
   LIGHT THEME  (Soft & Clean Modern Minimalist UI)
   ════════════════════════ */
body.theme-light {
  /* Surfaces - Pure whites */
  --bg-base: #ffffff;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: #f8fafc;
  --bg-inset: #ffffff;

  /* Accent - Soft modern periwinkle indigo */
  --accent: #4f46e5;
  --accent-dim: #6366f1;
  --accent-soft: rgba(79, 70, 229, 0.06);

  /* Semantic colors - soft pastel-like friendly colors */
  --green: #10b981;
  --cyan: #0ea5e9;
  --rose: #f43f5e;
  --gold: #f59e0b;
  --violet: #8b5cf6;
  --teal: #0d9488;
  --slate: #64748b;
  --amber: #d97706;

  /* Text hierarchy - Soft deep charcoal */
  --text-1: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --text-4: #94a3b8;

  /* Borders - Minimalist light borders */
  --border-1: rgba(241, 245, 249, 0.9);
  --border-2: #e2e8f0;
  --border-3: #cbd5e1;

  /* Shadows - Elegant, soft and modern shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.03), 0 4px 6px -4px rgba(15, 23, 42, 0.03);

  background: #ffffff;
  color: #334155;
}

/* ── Light surfaces ── */
body.theme-light .sidebar {
  background: #ffffff;
  border-right: 1px solid #f1f5f9;
  box-shadow: 2px 0 8px rgba(15, 23, 42, 0.01);
}
body.theme-light .brand {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}
body.theme-light .brand-icon {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
  color: #ffffff;
}
body.theme-light .brand h1 {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.theme-light .brand-tagline {
  color: #94a3b8;
  opacity: 0.85;
  letter-spacing: 0.05em;
}

body.theme-light .calendar-widget,
body.theme-light .prediction-section,
body.theme-light .grid-container {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  box-shadow:
    0 4px 20px -2px rgba(15, 23, 42, 0.02),
    0 2px 6px -1px rgba(15, 23, 42, 0.02);
  border-radius: var(--r-lg);
}

body.theme-light .widget-box {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: var(--r-md);
}
body.theme-light .widget-box:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
}

body.theme-light .pred-card,
body.theme-light .si-mini-card,
body.theme-light .si-mission-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.01);
}

body.theme-light .cal-section {
  background: #ffffff;
  border: 1px solid #f1f5f9;
}

body.theme-light .modal-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  box-shadow:
    0 20px 40px -5px rgba(15, 23, 42, 0.08),
    0 8px 16px -4px rgba(15, 23, 42, 0.04);
}

body.theme-light .nexus-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
body.theme-light .nexus-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ── Light accent elements ── */
body.theme-light .cycle-number-badge {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
  color: #ffffff;
}
body.theme-light .current-date-widget {
  border-left-color: #10b981;
}
body.theme-light #year-line-progress {
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}
body.theme-light .doy-fill {
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}
body.theme-light .doy-num {
  color: #4f46e5;
}
body.theme-light .week-number-badge.current-week {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: transparent;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* ── Light: today markers ── */
body.theme-light .week-cell.today .week-cell-dot {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}
body.theme-light .week-cell.today .week-cell-name {
  color: #4f46e5;
  font-weight: 600;
}
body.theme-light .dot-day.today {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}
body.theme-light .cal-brick.today {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}
body.theme-light .month-brick.today {
  background: #4f46e5;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}
body.theme-light .month-brick.filled {
  background: rgba(79, 70, 229, 0.15);
  border-color: transparent;
}

/* ── Light ring ── */
body.theme-light .ring-arc {
  stroke: #4f46e5;
}
body.theme-light .ring-trail {
  stroke: rgba(79, 70, 229, 0.08);
}
body.theme-light .ring-day-sub {
  color: #64748b;
}

/* ── Light mission table ── */
body.theme-light .col-today {
  background: rgba(79, 70, 229, 0.02) !important;
}
body.theme-light .col-today .date-day-num {
  color: #4f46e5;
  font-weight: 700;
}
body.theme-light .col-today .date-day-name {
  color: #4f46e5;
  opacity: 1;
}
body.theme-light thead th {
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}
body.theme-light thead .th-mission {
  background: #f1f5f9 !important;
  border-right-color: #e2e8f0 !important;
}

/* ── Light active / selection states ── */
body.theme-light .cal-section.active-section {
  border-color: #4f46e5;
  background: rgba(79, 70, 229, 0.03);
}
body.theme-light .cal-section.active-section .cal-section-label {
  color: #4f46e5;
}
body.theme-light ::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.1);
}
body.theme-light ::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.2);
}

/* ── Light input fields ── */
body.theme-light .control-group input,
body.theme-light .btn-toggle {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}
body.theme-light .control-group textarea {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}
body.theme-light .control-group textarea::placeholder {
  color: #94a3b8;
}
body.theme-light .btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}
body.theme-light .btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
body.theme-light .topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.01);
}

/* ── Light nav items ── */
body.theme-light .nav-item {
  color: #334155;
}
body.theme-light .nav-item:hover {
  background: rgba(79, 70, 229, 0.04);
  color: #4f46e5;
}
body.theme-light .nav-item.active {
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
}
body.theme-light .nav-section-label {
  color: #94a3b8;
}

/* ── Light text overrides ── */
body.theme-light .stat-value,
body.theme-light .ring-day-num,
body.theme-light .doy-num {
  color: #0f172a;
}
body.theme-light .stat-label,
body.theme-light .ring-day-sub,
body.theme-light .section-title {
  color: #475569;
}
body.theme-light .topbar-title {
  color: #0f172a;
}

/* ── Light theme: force ALL inner cavities to pure white ── */

/* body itself */
body.theme-light,
body.theme-light #app {
  background: #ffffff !important;
  color: #334155 !important;
}

/* top-level layout */
body.theme-light .main-content {
  background: #ffffff !important;
}

/* topbar */
body.theme-light .topbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

/* sidebar */
body.theme-light .sidebar,
body.theme-light .sidebar-section,
body.theme-light .sidebar-inner {
  background: #ffffff !important;
}

/* all widget boxes and stat areas */
body.theme-light .widget-box,
body.theme-light .widget-box:hover {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* form inputs / textareas / toggles */
body.theme-light .control-group input,
body.theme-light .control-group textarea,
body.theme-light .btn-toggle,
body.theme-light .energy-btn {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

/* buttons */
body.theme-light .btn,
body.theme-light .nexus-btn,
body.theme-light .nav-btn,
body.theme-light .week-bar-nav-btn {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}

/* week cell dots */
body.theme-light .week-cell-dot {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
body.theme-light .week-cell.past .week-cell-dot {
  background: rgba(99, 102, 241, 0.08) !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
}
body.theme-light .week-cell.today .week-cell-dot {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
}
body.theme-light .week-cell.today .week-cell-name {
  color: var(--accent) !important;
}

body.theme-light .week-number-bar {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.9),
    0 2px 4px rgba(0, 0, 0, 0.02) !important;
}

/* week number cards */
body.theme-light .week-number-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}
body.theme-light .week-number-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}
body.theme-light .week-number-card.current-week {
  background: #ffffff !important;
  border-color: var(--accent) !important;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.08) !important;
}
body.theme-light .week-card-indicator {
  background: #cbd5e1 !important;
}
body.theme-light .week-number-card.current-week .week-card-indicator {
  background: var(--accent) !important;
}

/* week number chips/badges */
body.theme-light .week-number-chip,
body.theme-light .week-number-badge:not(.current-week) {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

/* calendar widget and sections */
body.theme-light .calendar-widget {
  background: #ffffff !important;
}
body.theme-light .cal-section {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
body.theme-light .cal-brick {
  background: #e2e8f0 !important;
  color: #475569 !important;
}
body.theme-light .cal-brick.future {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
}
body.theme-light .cal-brick.sunday.past {
  background: rgba(244, 63, 94, 0.1) !important;
}

/* prediction / efficiency / insight panels */
body.theme-light .prediction-section,
body.theme-light .calendar-widget,
body.theme-light .grid-container {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
body.theme-light .pred-card,
body.theme-light .si-mini-card,
body.theme-light .si-mission-card,
body.theme-light .eff-card,
body.theme-light .si-row,
body.theme-light .eff-row {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* table — ALL cells white */
body.theme-light table {
  background: #ffffff !important;
}
body.theme-light td,
body.theme-light .intensity-row td {
  background: #ffffff !important;
}
body.theme-light thead th {
  background: #f8fafc !important;
  color: #475569 !important;
}
body.theme-light .th-mission {
  background: #ffffff !important;
}
body.theme-light thead .th-mission {
  background: #f8fafc !important;
}
body.theme-light tr:hover td {
  background: #f8fafc !important;
}

/* mission ring */
body.theme-light .mission-ring-wrap {
  background: #ffffff !important;
}

/* cycle summary card */
body.theme-light .csc-inner {
  background: #ffffff !important;
}

/* modal card */
body.theme-light .modal-card,
body.theme-light .modal-overlay .modal-card {
  background: #ffffff !important;
}

/* DOY / year-progress bar tracks */
body.theme-light #year-progress-bar-track,
body.theme-light .year-bar-bg,
body.theme-light .doy-bg,
body.theme-light .doy-bar,
body.theme-light .doy-track {
  background: #f1f5f9 !important;
}

/* month progress bricks */
body.theme-light .month-brick {
  background: #e2e8f0 !important;
  border-color: transparent !important;
}

/* keyboard shortcuts modal table */
body.theme-light .kbd-table,
body.theme-light .kbd-table thead tr,
body.theme-light .kbd-table tbody tr,
body.theme-light .kbd-table tbody td,
body.theme-light .kbd-table thead th {
  background: #ffffff !important;
  color: #334155 !important;
}
body.theme-light .kbd-table tbody tr:hover {
  background: #f8fafc !important;
}

/* ════════════════════════
   SHARED TOKENS (fixed)
   ════════════════════════ */
:root {
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 22px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  background: var(--bg-base);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.65;
  height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.4s var(--ease),
    color 0.25s;
}

/* ── Light theme: re-apply background after the flat body rule ── */
body.theme-light {
  background: #ffffff;
}

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

#app {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.app-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

/* ════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════ */
.sidebar {
  width: 272px;
  min-width: 272px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 20;
  transition: margin-left 0.28s var(--ease);
}
.sidebar.collapsed {
  margin-left: -272px;
}

/* brand */
.brand {
  padding: 20px;
  border-bottom: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  background: var(--accent);
  color: #fff;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  font-size: 15px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand h1 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  background: linear-gradient(135deg, #5b8af0 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-tagline {
  font-size: 10.5px;
  color: var(--text-4);
  font-weight: 500;
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.sidebar-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-1);
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 12px;
}

/* ── Widgets ── */
.widget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.widget-box {
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.widget-box:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-xs);
}
.widget-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 5px;
  letter-spacing: 0.04em;
}
.widget-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  font-family: var(--font-mono);
}
.widget-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-4);
  margin-top: 4px;
}

/* ── Form controls ── */
.control-group {
  margin-bottom: 10px;
}
.control-group:last-child {
  margin-bottom: 0;
}
.control-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}
.control-group input,
.btn-toggle {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text-1);
  padding: 9px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
  appearance: none;
}
.control-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.control-group input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
}
.control-group textarea {
  width: 100%;
  resize: none;
  height: 72px;
  padding: 8px 10px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-1);
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
.control-group textarea::placeholder {
  color: var(--text-4);
}
.control-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.note-char-count {
  font-size: 10px;
  color: var(--text-4);
  text-align: right;
  margin-top: 2px;
  font-family: var(--font-mono);
  transition: color 0.18s;
}
.note-char-count.warn {
  color: var(--rose);
}

/* ── Toggle buttons ── */
.btn-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text-2);
  min-height: 40px;
}
.btn-toggle:hover {
  border-color: var(--border-3);
  background: var(--bg-hover);
  color: var(--text-1);
}
.btn-toggle.active {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 8%, var(--bg-surface));
  color: var(--green);
}
.btn-toggle.active-planning {
  border-color: var(--violet);
  background: color-mix(in srgb, var(--violet) 8%, var(--bg-surface));
  color: var(--violet);
}
.btn-toggle.active-ontrack-partial {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, var(--bg-surface));
  color: var(--gold);
}
.btn-toggle.active-ontrack-full {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 8%, var(--bg-surface));
  color: var(--cyan);
}

/* ── Stat rows ── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-1);
}
.stat-row:last-child {
  border-bottom: none;
}
.stat-label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}
.stat-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  font-family: var(--font-mono);
}

/* ── Week widget ── */
.week-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-left: 12px;
}
.week-widget-head {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--violet);
  font-family: var(--font-mono);
  white-space: nowrap;
  align-self: flex-start;
}
.week-cells {
  display: flex;
  gap: 4px;
}
.week-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  transition: all 0.2s var(--spring);
}
.week-cell.today {
  transform: scale(1.1);
}
.week-cell-dot {
  width: 24px;
  height: 24px;
  border-radius: var(--r-xs);
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-3);
  transition: all 0.22s var(--spring);
}
.week-cell.past .week-cell-dot {
  background: color-mix(in srgb, var(--violet) 15%, var(--bg-inset));
  border-color: color-mix(in srgb, var(--violet) 25%, var(--border-1));
  color: var(--violet);
}
.week-cell.today .week-cell-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.week-cell.today::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r-sm);
  animation: today-pulse-glow 2.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}
@keyframes today-pulse-glow {
  0% {
    transform: translate(-50%, -50%) scale(0.75);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0;
  }
}
.week-cell.is-sun .week-cell-dot {
  opacity: 0.45;
}
.week-cell-name {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  font-family: var(--font-mono);
  transition: color 0.22s var(--ease);
}
.week-cell.today .week-cell-name {
  color: var(--accent);
  font-weight: 800;
}

/* ── Generic button ── */
.btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text-2);
  padding: 8px 13px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition:
    border-color 0.18s,
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
  min-height: 36px;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--border-3);
  background: var(--bg-hover);
  color: var(--text-1);
  box-shadow: var(--shadow-xs);
}

/* ── Energy buttons ── */
.energy-group {
  display: flex;
  gap: 4px;
}
.energy-btn {
  flex: 1;
  padding: 6px 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-1);
  background: var(--bg-inset);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-ui);
  min-height: 36px;
}
.energy-btn:hover {
  border-color: var(--border-2);
  color: var(--text-1);
}
.energy-btn.active-low {
  border-color: var(--rose);
  background: color-mix(in srgb, var(--rose) 8%, var(--bg-surface));
  color: var(--rose);
}
.energy-btn.active-medium {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, var(--bg-surface));
  color: var(--gold);
}
.energy-btn.active-high {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 8%, var(--bg-surface));
  color: var(--green);
}
.energy-corr-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  margin-right: 2px;
}

/* ── Mission ring ── */
.mission-ring-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.mission-ring-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.mission-ring-svg-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}
.mission-ring-svg {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
  overflow: visible;
}
.orbital-track {
  fill: none;
}
.orbital-arc {
  fill: none;
  transition:
    stroke-dasharray 0.5s var(--ease),
    opacity 0.35s;
}
.orbital-arc.completed {
  opacity: 1;
}
.orbital-arc.partial {
  opacity: 0.55;
  stroke-linecap: round;
}

.ring-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 0 2px;
}
.ring-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.ring-bar-icon {
  font-size: 9px;
  width: 11px;
  flex-shrink: 0;
  text-align: center;
}
.ring-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border-1);
  border-radius: 2px;
  overflow: hidden;
}
.ring-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s var(--ease);
}
.ring-bar-status {
  font-size: 9px;
  font-weight: 700;
  width: 10px;
  text-align: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

/* ════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════ */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: 20px;
}
.cycle-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.cycle-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

#btn-toggle-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  transition: all 0.18s;
  flex-shrink: 0;
}
#btn-toggle-sidebar:hover {
  background: var(--bg-hover);
  border-color: var(--border-3);
  color: var(--text-1);
}

.cycle-meta h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.cycle-meta p {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 2px;
}

.cycle-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cycle-nav {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.nav-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-1);
  color: var(--text-3);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.18s;
}
.nav-btn:last-child {
  border-right: none;
}
.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}
.nav-btn.text-btn {
  width: auto;
  padding: 0 16px;
  font-size: 13px;
}

.current-date-widget {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 2px 0 2px 10px;
  border-left: 3px solid var(--accent);
}
.current-date-widget .day-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  line-height: 1;
}
.current-date-widget .full-date {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-4);
  font-family: var(--font-mono);
  line-height: 1;
}

/* ── Year progress ── */
.year-progress-wrapper {
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.progress-header span:last-child {
  color: var(--accent);
}
.year-line-container {
  width: 100%;
  height: 6px;
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.line-progress-fill {
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 10px;
  transition: width 0.8s var(--ease);
}
#year-line-progress {
  background: var(--accent);
}

/* ── Day of year widget ── */
.doy-widget {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
}
.doy-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
}
.doy-body {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.doy-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--teal);
  font-family: var(--font-mono);
  line-height: 1;
}
.doy-of {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-4);
  font-family: var(--font-mono);
}
.doy-track {
  width: 100%;
  height: 3px;
  background: var(--border-1);
  border-radius: 3px;
  overflow: hidden;
}
.doy-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  transition: width 0.8s var(--ease);
  width: 0%;
}
.q-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--bg-base);
  z-index: 2;
}
.q-labels {
  display: flex;
  width: 100%;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-4);
}
.q-labels.spaced span {
  width: 25%;
  text-align: center;
}
.q-labels.end {
  justify-content: flex-end;
}

/* ── Cycle day ring ── */
.cycle-day-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cycle-day-ring-shell {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}
.cycle-ring-svg {
  transform: rotate(-90deg);
  display: block;
}
.ring-track {
  fill: none;
  stroke: var(--bg-inset);
  stroke-width: 5;
}
.ring-arc {
  fill: none;
  stroke: var(--teal);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
  transition: stroke-dashoffset 0.85s var(--spring);
}
.ring-trail {
  fill: none;
  stroke: var(--teal);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
  opacity: 0.15;
  transition: stroke-dashoffset 0.85s var(--spring);
}
.cycle-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.ring-day-num {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
  font-family: var(--font-mono);
  transition: opacity 0.2s;
}
.ring-day-num.flash {
  animation: num-flash 0.35s ease;
}
@keyframes num-flash {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  40% {
    opacity: 0.25;
    transform: scale(0.75);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.ring-day-sub {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
}
.ring-caption {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-4);
  text-align: center;
  white-space: nowrap;
}
.ring-caption b {
  color: var(--text-3);
  font-weight: 700;
}

/* ── Cycle summary card ── */
.csc-wrap {
  padding: 0 0 4px;
  animation: csc-in 0.3s var(--spring);
}
@keyframes csc-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.csc-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.csc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.csc-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 6px;
}
.csc-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-4);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  transition: color 0.18s;
}
.csc-dismiss:hover {
  color: var(--text-1);
}
.csc-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 6px;
}
.csc-stat {
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.csc-stat-label {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
}
.csc-stat-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-1);
  font-family: var(--font-mono);
  line-height: 1.2;
}
.csc-stat-sub {
  font-size: 9.5px;
  color: var(--text-3);
}
.csc-up {
  color: var(--green) !important;
}
.csc-down {
  color: var(--rose) !important;
}
.csc-same {
  color: var(--text-3) !important;
}
.csc-goal-row {
  grid-column: 1 / -1;
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-left: 2px solid var(--accent-dim);
  border-radius: var(--r-sm);
  padding: 8px 10px;
}
.csc-goal-label {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.csc-goal-text {
  font-size: 12px;
  color: var(--text-1);
  font-style: italic;
  line-height: 1.45;
  font-family: 'Lora', serif;
}
.csc-goal-empty {
  font-size: 11px;
  color: var(--text-4);
  font-style: italic;
}
.cycle-goal-range {
  font-size: 9px;
  color: var(--accent-dim);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 5px;
}

/* ── Dot-matrix month ── */
.dot-month-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.dot-month-head {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: var(--font-mono);
  white-space: nowrap;
  align-self: flex-start;
}
.dot-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 20px);
  gap: 3px;
}
.dot-dow {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-4);
  font-family: var(--font-mono);
}
.dot-dow.sat {
  color: var(--amber);
}
.dot-dow.sun {
  color: var(--rose);
}
.dot-spacer {
  width: 20px;
  height: 20px;
}
.dot-day {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.dot-day-num {
  font-size: 8px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-3);
  line-height: 1;
  pointer-events: none;
}
.dot-day.past {
  background: color-mix(in srgb, var(--gold) 20%, var(--bg-inset));
  border-color: color-mix(in srgb, var(--gold) 30%, var(--border-1));
}
.dot-day.past .dot-day-num {
  color: var(--gold);
}
.dot-day.is-saturday {
  background: color-mix(in srgb, var(--amber) 10%, var(--bg-inset));
}
.dot-day.is-saturday .dot-day-num {
  color: var(--amber);
}
.dot-day.is-sunday {
  background: color-mix(in srgb, var(--rose) 10%, var(--bg-inset));
}
.dot-day.is-sunday .dot-day-num {
  color: var(--rose);
}
.dot-day.today {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 1px 5px rgba(217, 119, 6, 0.3);
}
.dot-day.today .dot-day-num {
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}
.dot-month-foot {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-4);
  font-family: var(--font-mono);
}
.dot-month-foot span {
  color: var(--gold);
}

/* ── Calendar widget ── */
.calendar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.cal-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-1);
}
.cal-subtitle {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
.cal-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cal-section {
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.18s;
}
.cal-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  margin-bottom: 2px;
}
.cal-section.active-section {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cal-section.active-section .cal-section-label {
  color: var(--accent);
}
.cal-bricks {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.cal-brick {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--border-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-4);
  cursor: default;
  transition: all 0.14s;
  position: relative;
}
.cal-brick.past {
  background: var(--accent-dim);
  color: #fff;
  opacity: 0.75;
}
.cal-brick.today {
  background: var(--accent);
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(58, 95, 217, 0.35);
  z-index: 1;
  font-weight: 800;
}
.cal-brick.future {
  background: var(--bg-surface);
  color: var(--text-4);
  border: 1px solid var(--border-1);
}
.cal-brick.sunday {
  color: var(--rose);
}
.cal-brick.sunday.past {
  background: color-mix(in srgb, var(--rose) 20%, var(--bg-inset));
  color: var(--rose);
}
.cal-brick.sunday.today {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 2px 8px rgba(224, 62, 82, 0.35);
}
.cal-section-range {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  font-family: var(--font-mono);
  margin-top: 2px;
}
.cal-section-score {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

/* ── Week number bar ── */
.week-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}
.week-bar-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-xs);
  background: var(--bg-surface);
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  flex-shrink: 0;
}
.week-bar-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-1);
  border-color: var(--border-2);
}
.week-bar-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}
.week-number-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #1e222b, #12141a);
  border: 1px solid var(--border-1);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}
.week-number-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  transition: all 0.22s var(--spring);
  position: relative;
  overflow: hidden;
}
.week-number-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-sm);
}
.week-card-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-4);
  transition: all 0.22s var(--ease);
  flex-shrink: 0;
}
.week-number-card.current-week {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08);
}
.week-number-card.current-week .week-card-indicator {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot-week 2s infinite;
}
@keyframes pulse-dot-week {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}
.week-card-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.week-card-title {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-1);
  line-height: 1.1;
}
.week-number-card.current-week .week-card-title {
  color: var(--accent);
}
.week-card-range {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-3);
  opacity: 0.85;
}

/* ── Week number badge ── */
.week-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3.5px 10px;
  border-radius: 100px;
  box-shadow: var(--shadow-xs);
  vertical-align: middle;
  font-family: var(--font-mono);
  transition: all 0.22s var(--ease);
}
.week-number-badge.current-week {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-color: transparent;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}
.week-number-badge.current-week::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px #ffffff;
  animation: badge-dot-pulse 1.8s infinite;
  flex-shrink: 0;
}
@keyframes badge-dot-pulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

/* ── Cycle number badge ── */
.cycle-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 11px 3px 9px;
  border-radius: 100px;
  box-shadow: 0 1px 6px rgba(58, 95, 217, 0.3);
  vertical-align: middle;
  position: relative;
  top: -1px;
}
body.theme-dark .cycle-number-badge {
  box-shadow: 0 1px 8px rgba(91, 138, 240, 0.4);
}
.cycle-number-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   MISSION GRID (table)
   ════════════════════════════════════════════ */
.grid-container {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th,
td {
  padding: 12px 10px;
  text-align: center;
  border-right: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
}
th:last-child,
td:last-child {
  border-right: none;
}
tr:last-child td {
  border-bottom: none;
}

thead th {
  background: var(--bg-inset);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.th-mission {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--bg-surface) !important;
  min-width: 220px;
  z-index: 5;
  border-right: 1px solid var(--border-2) !important;
}
thead .th-mission {
  background: var(--bg-inset) !important;
}

.date-day-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.date-day-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-2);
  line-height: 1;
  font-family: var(--font-mono);
}

.col-today {
  background: var(--accent-soft) !important;
}
.col-today .date-day-num {
  color: var(--accent);
}
.col-today .date-day-name {
  color: var(--accent);
  opacity: 0.8;
}
.col-sunday .date-day-num {
  color: var(--rose);
  opacity: 0.8;
}

.col-section-start {
  border-left: 2px solid var(--border-2) !important;
}

.mission-row {
  transition: background 0.15s;
}
.mission-row:hover {
  background: var(--bg-hover);
}

.mission-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 8px;
}
.mission-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--m-rgb), 0.1);
  border-radius: var(--r-sm);
  color: var(--m-color);
  font-size: 13px;
  flex-shrink: 0;
}
.mission-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mission-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}
.mission-spec {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1;
}

.cell-action {
  cursor: pointer;
  position: relative;
}
.status-mark {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition:
    transform 0.14s var(--spring),
    background 0.18s;
  font-size: 12px;
  margin: 0 auto;
}
.st-none {
  border: 2px solid var(--border-2);
  background: transparent;
}
.st-part {
  border: 2px solid var(--m-color);
  background: linear-gradient(to top, rgba(var(--m-rgb), 0.28) 50%, transparent 50%);
}
.st-done {
  background: var(--m-color);
  border: 2px solid var(--m-color);
  color: #fff;
}
.cell-action:hover .status-mark {
  transform: scale(1.14);
}
.cell-action:hover .st-none {
  border-color: var(--border-3);
}
.streak-line::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--m-color);
  transform: translateY(-50%);
  z-index: 0;
  opacity: 0.12;
}
.cell-action .status-mark {
  position: relative;
  z-index: 1;
}

.intensity-row td {
  padding: 6px 10px;
  background: var(--bg-inset);
}
.intensity-bar {
  height: 4px;
  width: 26px;
  border-radius: 10px;
  margin: 3px auto 0;
  transition: background 0.3s;
}
.intensity-score-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

/* ════════════════════════════════════════════
   BOTTOM PANELS
   ════════════════════════════════════════════ */
.bottom-panels-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.prediction-section {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.month-emphasis-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-1);
  margin-left: 12px;
  line-height: 1;
}
.pred-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.pred-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pred-header-label {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-1);
}
.pred-header-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
}

.pred-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.eff-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.si-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.si-grid-7 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.si-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  margin: 20px 0 10px;
  letter-spacing: 0.06em;
}
.si-section-title:first-child {
  margin-top: 0;
}

.si-mini-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    box-shadow 0.2s,
    transform 0.2s,
    border-color 0.2s;
}
.si-mini-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-2);
}
.si-mini-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.si-mini-val {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  font-family: var(--font-mono);
}
.si-mini-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-4);
  line-height: 1.4;
}

.si-mission-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.18s;
}
.si-mission-card:hover {
  border-color: var(--border-2);
}
.si-mission-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.si-mission-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: rgba(var(--m-rgb), 0.1);
  color: var(--m-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.si-mission-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.si-mission-pct {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--m-color);
  font-family: var(--font-mono);
}

.dow-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.dow-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.dow-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.dow-bar-wrap {
  width: 100%;
  height: 56px;
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.dow-bar-fill {
  width: 100%;
  transition: height 0.75s var(--ease);
  border-radius: var(--r-sm);
}
.dow-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  font-family: var(--font-mono);
}

.pred-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.18s var(--ease);
}
.pred-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}
.clickable-card {
  cursor: pointer;
}
.clickable-card:hover {
  transform: translateY(-2px);
}
.pred-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.pred-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pred-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: rgba(var(--m-rgb), 0.1);
  color: var(--m-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.pred-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}
.pred-pct-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--m-color);
  line-height: 1;
  font-family: var(--font-mono);
}
.pred-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.pred-bar-fill {
  height: 100%;
  background: var(--m-color);
  border-radius: 10px;
  position: absolute;
  left: 0;
  top: 0;
  transition: width 1s var(--ease);
}
.insight-desc {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  line-height: 1.55;
}

/* monthly progress bricks */
.month-bricks-container {
  display: flex;
  gap: 4px;
  width: 100%;
  height: 16px;
  margin-top: 10px;
}
.month-brick {
  flex: 1;
  background: var(--bg-inset);
  border: 1px solid var(--border-1);
  border-radius: 4px;
  transition: all 0.18s;
}
.month-brick.filled {
  background: var(--accent-dim);
  border-color: transparent;
}
.month-brick.is-sunday {
  background: var(--border-1);
}
.month-brick.is-sunday.filled {
  background: var(--accent);
  opacity: 0.75;
}
.month-brick.today {
  background: var(--accent);
  transform: scaleY(1.2);
  box-shadow: 0 1px 6px rgba(58, 95, 217, 0.3);
}

/* ════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-1);
  border-radius: var(--r-xl);
  width: 92%;
  max-width: 520px;
  padding: 30px;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.28s var(--spring);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-1);
  padding-bottom: 18px;
}
.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.2;
}
.modal-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 4px;
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-close {
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-1);
  border-color: var(--border-3);
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ════════════════════════════════════════════
   NEXUS BUTTON (fixed FAB)
   ════════════════════════════════════════════ */
.nexus-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 26px;
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  color: var(--accent);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.2s ease,
    transform 0.28s var(--spring),
    box-shadow 0.22s ease;
  border-radius: 14px;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
body.theme-dark .nexus-btn {
  background: var(--bg-card);
}
.nexus-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.07) 50%,
    transparent 70%
  );
  transition: left 0.6s ease;
  pointer-events: none;
}
.nexus-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}
body.theme-dark .nexus-btn::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}
.nexus-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px) scale(1.02);
}
.nexus-btn:hover::before {
  left: 140%;
}
.nexus-btn:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: 0.1s;
}
.nexus-btn .nexus-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  opacity: 0.65;
  transition: opacity 0.2s;
}
.nexus-btn:hover .nexus-icons {
  opacity: 1;
}
.nexus-btn .nexus-sep {
  width: 1px;
  height: 15px;
  background: var(--border-2);
}
.nexus-btn .nexus-arrow {
  font-size: 0.68rem;
  opacity: 0.5;
  transition:
    opacity 0.2s,
    transform 0.28s ease;
}
.nexus-btn:hover .nexus-arrow {
  opacity: 0.85;
  transform: translateX(3px);
}

/* ════════════════════════════════════════════
   KEYBOARD SHORTCUTS MODAL
   ════════════════════════════════════════════ */
.kbd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.kbd-table thead tr {
  background: var(--bg-inset);
}
.kbd-table thead th {
  padding: 9px 14px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  text-align: left;
  border-bottom: 2px solid var(--border-1);
}
.kbd-th-key {
  text-align: center !important;
  width: 90px;
}
.kbd-th-category {
  width: 130px;
}
.kbd-table tbody tr {
  border-bottom: 1px solid var(--border-1);
  transition: background 0.12s;
}
.kbd-table tbody tr:last-child {
  border-bottom: none;
}
.kbd-table tbody tr:hover {
  background: var(--bg-hover);
}
.kbd-table tbody tr:hover .kbd-key {
  border-color: var(--row-accent, var(--accent));
  color: var(--row-accent, var(--accent));
  background: color-mix(in srgb, var(--row-accent, var(--accent)) 8%, var(--bg-surface));
}
.kbd-group-last td {
  border-bottom: 2px solid var(--border-1);
}
.kbd-table tbody td {
  padding: 8px 14px;
  font-weight: 500;
  color: var(--text-2);
  vertical-align: middle;
}
.kbd-table tbody td:last-child {
  text-align: center;
}
.kbd-category {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--kbd-accent, var(--accent));
  white-space: nowrap;
  border-left: 3px solid var(--kbd-accent, var(--accent));
  background: color-mix(in srgb, var(--kbd-accent, var(--accent)) 6%, var(--bg-surface));
  padding-left: 12px !important;
}
.kbd-category i {
  margin-right: 6px;
  font-size: 9px;
}
.kbd-keys {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.kbd-sep {
  font-size: 10px;
  color: var(--text-4);
  font-family: var(--font-mono);
}
.kbd-key {
  display: inline-block;
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-bottom: 2.5px solid var(--border-3);
  border-radius: 6px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-1);
  min-width: 26px;
  text-align: center;
  white-space: nowrap;
  transition:
    border-color 0.14s,
    color 0.14s,
    background 0.14s;
  box-shadow: 0 1px 0 var(--border-3);
}
.kbd-tip {
  margin-top: 12px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-inset));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border-1));
  border-radius: var(--r-sm);
  font-size: 11.5px;
  color: var(--text-3);
  text-align: center;
}
.kbd-tip strong {
  color: var(--accent);
  font-weight: 700;
}

/* ════════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 1024px)
   ════════════════════════════════════════════ */
@media (max-width: 1024px) {
  body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .app-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-1);
    overflow: visible;
    height: auto;
  }
  .sidebar.collapsed {
    display: none;
    margin-left: 0;
  }
  .main-content {
    overflow: visible;
    padding: 18px 16px;
    height: auto;
    min-height: 0;
    flex: none;
    gap: 16px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .topbar > div:last-child {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cycle-info {
    width: 100%;
  }
  .pred-grid {
    grid-template-columns: 1fr;
  }
  .eff-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .si-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .si-grid-7 {
    grid-template-columns: repeat(4, 1fr);
  }
  .cal-sections {
    grid-template-columns: 1fr;
  }
}

/* ════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 600px)
   ════════════════════════════════════════════ */
@media (max-width: 600px) {
  .main-content {
    padding: 14px 12px;
    gap: 14px;
  }
  .eff-grid {
    grid-template-columns: 1fr;
  }
  .si-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
  .si-grid-7 {
    grid-template-columns: repeat(4, 1fr);
  }
  .cal-sections {
    grid-template-columns: 1fr;
  }
  .brand h1 {
    font-size: 1.1rem;
  }
  .widget-value {
    font-size: 1.5rem;
  }
  .cycle-meta h2 {
    font-size: 1.25rem;
  }
}

/* ════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE  (≤ 480px)
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .sidebar-section {
    padding: 14px;
  }
  .brand {
    padding: 14px;
  }
  .widget-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .widget-box {
    padding: 10px 8px;
  }
  .widget-value {
    font-size: 1.35rem;
  }
  .widget-label,
  .widget-sub {
    font-size: 10px;
  }
  .control-group label {
    font-size: 11px;
  }
  .control-group input,
  .btn-toggle {
    padding: 11px 12px;
    font-size: 14px;
    min-height: 46px;
  }
  .main-content {
    padding: 12px 10px;
  }
  .si-grid-7 {
    grid-template-columns: repeat(4, 1fr);
  }
  .nexus-btn {
    bottom: 20px;
    right: 16px;
    padding: 11px 20px;
    font-size: 0.75rem;
    border-radius: 12px;
  }
  .kbd-th-category {
    display: none;
  }
  .kbd-category {
    display: none;
  }
}

/* ════════════════════════════════════════════
   RESPONSIVE — TINY  (≤ 380px)
   ════════════════════════════════════════════ */
@media (max-width: 380px) {
  .widget-grid {
    grid-template-columns: 1fr;
  }
  .eff-grid {
    grid-template-columns: 1fr;
  }
  .si-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}
