/* ==========================================================================
   Calm Rotunda — Deep Focus & Sprint Telemetry Studio
   Brand Palette:
   - Neon Lime: #A3E635
   - Solar Gold: #FACC15
   - Midnight Slate: #1E293B
   - Liquid-Glass HUD Surface: rgba(13, 19, 34, 0.78)
   ========================================================================== */

:root {
  --accent-primary: #A3E635;
  --accent-secondary: #FACC15;
  --slate-base: #1E293B;
  --hud-bg: rgba(13, 19, 34, 0.78);
  --hud-bg-elevated: rgba(20, 29, 49, 0.84);
  --hud-border: rgba(163, 230, 53, 0.38);
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --danger-color: #FB7185;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* Custom Theme Accent Variations */
body[data-accent="solar"] {
  --accent-primary: #FACC15;
  --accent-secondary: #A3E635;
  --hud-border: rgba(250, 204, 21, 0.42);
}

body[data-accent="cyber"] {
  --accent-primary: #4ADE80;
  --accent-secondary: #A3E635;
  --hud-border: rgba(74, 222, 128, 0.42);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* STRICT BACKGROUND & VIEWPORT RULES */
html, body, .app-container {
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll; /* STRICTLY SCROLL, NEVER FIXED */
  overflow-x: hidden;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 480px) {
  .app-container {
    margin: 0;
    max-width: 100%;
  }
}

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

input, textarea, select {
  font-size: 16px !important; /* Prevents auto-zoom on mobile iOS/Android */
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:active {
  transform: scale(0.97);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.lime-text {
  color: var(--accent-primary);
}

.gold-text {
  color: var(--accent-secondary);
}

/* ================= 1. WELCOME / ONBOARDING SINGLE-VIEWPORT OVERLAY ================= */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: rgba(10, 15, 28, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.welcome-card {
  width: 100%;
  max-width: 448px;
  height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  max-height: 670px;
  background: rgba(13, 19, 34, 0.84);
  border: 1px solid var(--hud-border);
  border-radius: 22px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 22px rgba(163, 230, 53, 0.14);
  overflow: hidden;
}

.welcome-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(163, 230, 53, 0.35);
}

.brand-mini-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
}

.brand-badge-text {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--accent-primary);
}

.skip-btn {
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.welcome-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 150px;
  max-height: 250px;
  margin: 8px 0;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 50%, rgba(163, 230, 53, 0.14), rgba(13, 19, 34, 0.65));
  border: 1px solid rgba(250, 204, 21, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.welcome-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.slide-pill {
  position: absolute;
  bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(13, 19, 34, 0.88);
  border: 1px solid var(--accent-secondary);
  color: var(--accent-secondary);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.welcome-text-block {
  text-align: center;
  padding: 4px 6px;
}

.welcome-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.welcome-desc {
  font-size: 13.5px;
  color: #CBD5E1;
  line-height: 1.42;
}

.welcome-benefit-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(163, 230, 53, 0.28);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
  text-align: center;
}

.benefit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 8px var(--accent-secondary);
  flex-shrink: 0;
}

.welcome-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

.welcome-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.welcome-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.38);
  transition: all 0.22s ease;
}

.welcome-dot.active {
  width: 26px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 0 10px rgba(163, 230, 53, 0.55);
}

.welcome-cta {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ================= PERSISTENT HEADER ================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 10px;
  background: rgba(13, 19, 34, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(163, 230, 53, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.logo-orb-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--accent-primary);
  box-shadow: 0 0 12px rgba(163, 230, 53, 0.35);
  flex-shrink: 0;
  background: #0F172A;
}

.header-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-titles {
  min-width: 0;
}

.app-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  white-space: nowrap;
}

.version-chip {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(163, 230, 53, 0.16);
  border: 1px solid rgba(163, 230, 53, 0.45);
  color: var(--accent-primary);
}

.app-subtitle {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hud-pill-btn {
  min-height: 38px;
  padding: 0 9px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid rgba(250, 204, 21, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #FFFFFF;
}

.xp-pill {
  border-color: rgba(163, 230, 53, 0.42);
}

.xp-label {
  font-size: 10px;
  color: var(--accent-primary);
  font-weight: 900;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}

/* ================= MAIN CONTENT & HUD CARDS ================= */
.main-content {
  flex: 1;
  padding: 12px 12px calc(env(safe-area-inset-bottom, 0px) + 84px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-screen {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: screenFadeIn 0.22s ease;
}

.app-screen.active {
  display: flex;
}

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

/* Liquid-Glass HUD Card */
.hud-card {
  background: var(--hud-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid var(--hud-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hud-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hud-dot.lime {
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
}

.hud-dot.gold {
  background: var(--accent-secondary);
  box-shadow: 0 0 8px var(--accent-secondary);
}

.card-title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #F1F5F9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telemetry-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(163, 230, 53, 0.16);
  border: 1px solid rgba(163, 230, 53, 0.48);
  color: var(--accent-primary);
  white-space: nowrap;
}

.telemetry-badge.gold {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.5);
  color: var(--accent-secondary);
}

.card-helper-text {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ================= HOME WORKBENCH & SPRINT COMPOSER ================= */
.live-reactor-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(250, 204, 21, 0.34);
  margin-bottom: 12px;
}

.reactor-strip-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
}

.pulse-indicator.running {
  animation: pulseGlow 1.2s infinite alternate;
}

@keyframes pulseGlow {
  from { transform: scale(0.9); opacity: 0.65; }
  to { transform: scale(1.25); opacity: 1; }
}

.strip-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.strip-val {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
}

.reactor-strip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-action-btn {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #0F172A;
  font-size: 12px;
  font-weight: 800;
}

.mini-action-btn.secondary {
  background: rgba(15, 23, 42, 0.85);
  color: var(--accent-primary);
  border: 1px solid rgba(163, 230, 53, 0.4);
}

.composer-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.composer-control {
  background: rgba(15, 23, 42, 0.65);
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #CBD5E1;
  margin-bottom: 7px;
}

.control-value {
  font-weight: 800;
  color: var(--accent-primary);
}

.cyber-slider {
  width: 100%;
  accent-color: var(--accent-primary);
  height: 6px;
  cursor: pointer;
}

.ratio-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.ratio-pill {
  min-height: 36px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 12px;
  font-weight: 700;
  color: #CBD5E1;
}

.ratio-pill.active {
  background: rgba(163, 230, 53, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(163, 230, 53, 0.2);
}

.composer-output-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.output-metric {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(163, 230, 53, 0.25);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.output-label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.output-number {
  font-size: 14.5px;
  font-weight: 800;
}

.composer-cta-row {
  display: flex;
  gap: 8px;
}

/* KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kpi-mini-card {
  padding: 11px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-mini-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kpi-mini-val {
  font-size: 18px;
  font-weight: 900;
}

.kpi-mini-sub {
  font-size: 11px;
  color: #CBD5E1;
}

/* Subtabs on Home */
.subtab-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  padding: 4px;
  border-radius: 11px;
  margin-bottom: 12px;
}

.subtab-btn {
  min-height: 38px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.subtab-btn.active {
  background: rgba(163, 230, 53, 0.2);
  color: var(--accent-primary);
  border: 1px solid rgba(163, 230, 53, 0.45);
}

.subtab-panel {
  display: none;
}

.subtab-panel.active {
  display: block;
}

.panel-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.text-link-btn {
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 700;
  min-height: 34px;
  padding: 0 4px;
}

/* Lists & Items */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.telemetry-item {
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #F8FAFC;
  word-break: break-word;
}

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

.item-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.domain-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(163, 230, 53, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(163, 230, 53, 0.35);
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mini-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #CBD5E1;
}

.mini-icon-btn.danger:hover {
  color: var(--danger-color);
  border-color: var(--danger-color);
}

/* Domain Bars */
.domain-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.domain-bar-row {
  background: rgba(15, 23, 42, 0.68);
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.domain-bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.domain-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
}

.domain-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

/* ================= 3. REACTOR SCREEN ================= */
.chime-toggle-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(163, 230, 53, 0.4);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
}

.reactor-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.mode-tab {
  min-height: 40px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 12px;
  font-weight: 700;
  color: #CBD5E1;
}

.mode-tab.active {
  background: rgba(163, 230, 53, 0.18);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.reactor-canvas-container {
  position: relative;
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 12px;
}

.reactor-canvas {
  width: 250px;
  height: 250px;
  display: block;
}

.reactor-center-readout {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.reactor-phase-pill {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-secondary);
  margin-bottom: 2px;
}

.reactor-time-display {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  text-shadow: 0 0 18px rgba(163, 230, 53, 0.45);
}

.reactor-tag-display {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent-primary);
  margin-top: 2px;
}

.reactor-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.icon-control-btn {
  min-height: 46px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.reactor-play-btn {
  flex: 1;
  min-height: 46px;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.reactor-section-block {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 12px;
  margin-top: 10px;
}

.block-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.block-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.tiny-link-btn {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-secondary);
}

.tag-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.domain-tag-btn {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #CBD5E1;
}

.domain-tag-btn.active {
  background: rgba(163, 230, 53, 0.16);
  border-color: var(--accent-primary);
  color: #FFFFFF;
}

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

.tag-dot.lime { background: #A3E635; }
.tag-dot.gold { background: #FACC15; }
.tag-dot.cyan { background: #38BDF8; }
.tag-dot.purple { background: #C084FC; }

.duration-presets-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.preset-chip {
  min-height: 36px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 12px;
  font-weight: 700;
  color: #CBD5E1;
}

.preset-chip.active {
  background: rgba(250, 204, 21, 0.2);
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.custom-mins-Row {
  display: flex;
  gap: 6px;
}

.compact-num {
  width: 72px;
  text-align: center;
}

/* ================= 4. WORKBENCH (MILESTONES + DISTRACTIONS) ================= */
.workbench-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(13, 19, 34, 0.82);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--hud-border);
}

.wb-switch-btn {
  min-height: 42px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.wb-switch-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #0F172A;
}

.wb-view {
  display: none;
}

.wb-view.active {
  display: block;
}

.progress-track-wrap {
  margin-bottom: 12px;
}

.progress-bar-bg {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(163, 230, 53, 0.3);
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s ease;
}

.progress-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.crud-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.form-row {
  display: flex;
  gap: 6px;
}

.form-row.split-3 {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
}

.form-row.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.filter-pills-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.filter-pill {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.filter-pill.active {
  background: rgba(163, 230, 53, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.check-circle-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid var(--accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #0F172A;
  font-weight: 900;
}

.check-circle-btn.checked {
  background: var(--accent-primary);
}

/* Shield & Distraction Log */
.shield-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.shield-stat-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(250, 204, 21, 0.28);
  border-radius: 10px;
  padding: 9px 6px;
  text-align: center;
}

.shield-stat-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
}

.shield-stat-val {
  font-size: 17px;
  font-weight: 900;
}

.star-rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.star-label {
  font-size: 12px;
  font-weight: 700;
  color: #CBD5E1;
}

.star-picker {
  display: inline-flex;
  gap: 3px;
}

.star-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.8);
  font-size: 16px;
  color: #475569;
}

.star-btn.active {
  color: var(--accent-secondary);
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

/* ================= 5. ANALYTICS & HEATMAP SCREEN ================= */
.heatmap-canvas-wrap {
  width: 100%;
  height: 155px;
  margin-bottom: 10px;
}

.peak-canvas-wrap {
  width: 100%;
  height: 195px;
  margin-bottom: 10px;
}

.analytics-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.heatmap-detail-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(163, 230, 53, 0.35);
}

.detail-day-name {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-primary);
}

.detail-metrics {
  font-size: 11.5px;
  color: #CBD5E1;
}

.detail-tag-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.16);
  color: var(--accent-secondary);
}

.chart-filter-pills {
  display: flex;
  gap: 4px;
}

.mini-filter {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.mini-filter.active {
  background: rgba(163, 230, 53, 0.2);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.peak-insight-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.insight-chip {
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 9px 10px;
}

.insight-label {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.insight-val {
  font-size: 14px;
  font-weight: 800;
}

/* ================= 6. 7-DAY STREAK CHECK-IN CALENDAR ================= */
.checkin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.checkin-day-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 98px;
  position: relative;
}

.checkin-day-card.claimed {
  background: rgba(163, 230, 53, 0.16);
  border-color: var(--accent-primary);
}

.checkin-day-card.ready {
  background: rgba(250, 204, 21, 0.16);
  border: 1.5px solid var(--accent-secondary);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.26);
}

.checkin-day-card.locked {
  opacity: 0.65;
}

.day-num {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
}

.day-icon {
  font-size: 20px;
  margin: 4px 0;
}

.day-reward-name {
  font-size: 10.5px;
  font-weight: 700;
  color: #F8FAFC;
  line-height: 1.2;
}

.day-status-pill {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-muted);
}

.checkin-day-card.claimed .day-status-pill {
  background: var(--accent-primary);
  color: #0F172A;
}

.checkin-day-card.ready .day-status-pill {
  background: var(--accent-secondary);
  color: #0F172A;
}

.checkin-action-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(163, 230, 53, 0.38);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkin-next-title {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
}

.checkin-next-sub {
  font-size: 12px;
  color: var(--accent-primary);
}

.theme-selector-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.accent-option-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.26);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.accent-option-btn.active {
  border-color: var(--accent-primary);
  background: rgba(163, 230, 53, 0.15);
}

.swatch {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.swatch.lime-gold { background: linear-gradient(135deg, #A3E635, #FACC15); }
.swatch.solar-flare { background: linear-gradient(135deg, #FACC15, #FB923C); }
.swatch.cyber-emerald { background: linear-gradient(135deg, #4ADE80, #38BDF8); }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.perk-badge-item {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(163, 230, 53, 0.3);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.perk-badge-icon {
  font-size: 18px;
}

.perk-badge-title {
  font-size: 12px;
  font-weight: 800;
}

.perk-badge-sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* ================= SHARED CONTROLS & INPUTS ================= */
.cyber-input, .cyber-select {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #FFFFFF;
  outline: none;
}

.cyber-input:focus, .cyber-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(163, 230, 53, 0.2);
}

.flex-1 {
  flex: 1;
}

.btn-primary {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #0F172A;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(163, 230, 53, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(163, 230, 53, 0.36);
  color: #F8FAFC;
  font-size: 13px;
  font-weight: 700;
}

.btn-danger {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  background: rgba(251, 113, 133, 0.16);
  border: 1px solid rgba(251, 113, 133, 0.5);
  color: #FDA4AF;
  font-size: 13px;
  font-weight: 700;
}

.small-btn, .compact-btn {
  min-height: 44px;
  padding: 0 13px;
  font-size: 12.5px;
}

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

/* ================= BOTTOM NAVIGATION BAR ================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 50;
  background: rgba(13, 19, 34, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(163, 230, 53, 0.32);
  padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 8px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.nav-item {
  min-height: 48px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
}

.nav-item.active {
  color: var(--accent-primary);
  background: rgba(163, 230, 53, 0.14);
}

/* ================= BOTTOM SHEET MODALS (SETTINGS, ABOUT, LEGAL) ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(8, 12, 22, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bottom-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 86dvh;
  background: rgba(13, 19, 34, 0.95);
  border-top: 1.5px solid var(--accent-primary);
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.6);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.4);
  margin: 0 auto 10px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.sheet-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
}

.sheet-body {
  overflow-y: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-secondary);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.setting-name {
  font-size: 13px;
  font-weight: 700;
}

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

.cyber-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.about-info-card {
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(163, 230, 53, 0.3);
  border-radius: 12px;
  padding: 12px;
}

.about-app-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.about-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--accent-primary);
}

.about-app-name {
  font-size: 15px;
  font-weight: 800;
}

.about-app-ver {
  font-size: 11.5px;
  color: var(--accent-primary);
  font-weight: 600;
}

.about-summary {
  font-size: 12.5px;
  color: #CBD5E1;
}

.about-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.about-action-btn {
  padding: 0 8px;
  font-size: 12px;
}

.legal-links-row, .data-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.legal-doc-content {
  font-size: 13px;
  color: #CBD5E1;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-doc-content h4 {
  color: var(--accent-primary);
  font-size: 13.5px;
  margin-top: 4px;
}

/* Toast Notification */
.toast-banner {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 74px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  background: rgba(13, 19, 34, 0.95);
  border: 1.5px solid var(--accent-primary);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
