/* ==========================================================================
   AURA FOCUS — DESIGN SYSTEM & MOBILE WEB STYLESHEET
   Revolut Aesthetics: Deep Obsidian, Frosted Glass, Vibrant Neon Gradients
   ========================================================================== */

:root {
  --bg-deep: #0a0b12;
  --bg-card: rgba(16, 18, 30, 0.62);
  --bg-card-hover: rgba(24, 28, 46, 0.75);
  --bg-card-active: rgba(32, 38, 62, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-subtle: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-glass-bright: rgba(255, 255, 255, 0.25);
  --border-accent: rgba(99, 102, 241, 0.55);
  
  --accent-cyan: #22d3ee;
  --accent-indigo: #6366f1;
  --accent-violet: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --gradient-neon: linear-gradient(135deg, #6366f1 0%, #22d3ee 50%, #a855f7 100%);
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-emerald: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --gradient-amber: linear-gradient(135deg, #f59e0b 0%, #f43f5e 100%);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --shadow-glow: 0 10px 30px -10px rgba(99, 102, 241, 0.45);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* Base Reset & Mobile Ergonomics */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #07080f;
  background-image: url('bg.jpg');
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Viewport Container (SmartPhone Adaptation max 480px) */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  background: rgba(9, 11, 20, 0.42) url('bg.jpg') center top / cover no-repeat;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.95), 0 0 40px rgba(99, 102, 241, 0.25);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Subtle background atmospheric wash disabled to keep art 100% crisp */
.app-container::before {
  display: none !important;
}

/* ==========================================================================
   TOP HEADER
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px 12px;
  background: rgba(10, 12, 22, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
}

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

.header-logo-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-glass-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

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

.logo-fallback {
  display: none;
  font-weight: 800;
  font-size: 13px;
  color: var(--accent-cyan);
}

.header-title-box {
  display: flex;
  flex-direction: column;
}

.header-app-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-subtitle {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
  letter-spacing: 0.2px;
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.1);
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
}

/* ==========================================================================
   VIEWPORT & SCREEN ROUTING (MANDATORY FIX FOR BLANK SCREEN)
   ========================================================================== */
.content-viewport {
  position: relative;
  z-index: 10;
  flex: 1;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 84px);
  width: 100%;
}

.screen-view {
  display: none !important;
  width: 100%;
  animation: screenFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.screen-view.active {
  display: block !important;
}

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

/* ==========================================================================
   GENERIC GLASS PANELS, BUTTONS & TOKENS
   ========================================================================== */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, background 0.2s;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 4px 12px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

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

.section-action-btn {
  background: none;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-cyan);
  cursor: pointer;
}

.section-action-btn:active {
  opacity: 0.7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-large {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.btn-glow {
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

/* ==========================================================================
   SCREEN 1: ONBOARDING / WELCOME
   ========================================================================== */
.welcome-container {
  display: flex;
  flex-direction: column;
  padding: 10px 4px;
}

.welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.hero-logo-ring {
  width: 90px;
  height: 90px;
  border-radius: 28px;
  background: rgba(18, 20, 32, 0.85);
  border: 2px solid var(--accent-indigo);
  box-shadow: 0 12px 36px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
}

.welcome-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-hero-fallback {
  display: none;
  font-size: 36px;
}

.hero-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(34, 211, 238, 0.15);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--accent-cyan);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.welcome-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 380px;
}

.feature-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.glass-feature-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.feature-icon.indigo {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.feature-icon.cyan {
  background: rgba(34, 211, 238, 0.2);
  border: 1px solid rgba(34, 211, 238, 0.4);
}

.feature-icon.violet {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.feature-text h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}

.feature-text p {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.welcome-action-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

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

/* ==========================================================================
   SCREEN 2: HOME / DASHBOARD
   ========================================================================== */
.dashboard-container {
  display: flex;
  flex-direction: column;
}

.metric-hero-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(26, 29, 46, 0.9) 0%, rgba(18, 20, 32, 0.85) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.metric-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.metric-hero-value {
  font-size: 34px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  letter-spacing: -1px;
}

/* Progress circular chart in hero */
.progress-circle-wrap {
  position: relative;
  width: 68px;
  height: 68px;
}

.circular-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
}

.circle-fg {
  fill: none;
  stroke: url(#timerGradientIndigo);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 0.4s ease;
}

.circle-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* Linear progress subbar */
.hero-subbar {
  margin-bottom: 16px;
}

.goal-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.goal-label strong {
  color: #ffffff;
}

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

.linear-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.linear-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Metrics Mini Grid */
.metrics-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
}

.mini-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.mini-stat-num {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* Quick Launch Grid */
.quick-launch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.quick-preset-btn {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s, border-color 0.2s;
}

.quick-preset-btn:active {
  transform: scale(0.95);
  border-color: var(--accent-cyan);
}

.preset-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.preset-icon-circle.indigo {
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.5);
}

.preset-icon-circle.cyan {
  background: rgba(34, 211, 238, 0.25);
  border: 1px solid rgba(34, 211, 238, 0.5);
}

.preset-icon-circle.violet {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.preset-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.preset-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

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

/* Active focus linked task card */
.active-task-card {
  border-left: 3px solid var(--accent-cyan);
}

.active-task-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.active-pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulse 1.8s infinite;
}

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

.active-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--accent-cyan);
  flex: 1;
}

.link-change-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.active-task-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

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

.task-category-pill {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 11px;
  font-weight: 600;
}

.task-pomo-count {
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1;
}

/* Priority task items on home */
.tasks-quick-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.priority-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}

/* ==========================================================================
   SCREEN 3: FOCUS TIMER STUDIO
   ========================================================================== */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Mode selector bar */
.mode-selector-bar {
  display: flex;
  width: 100%;
  background: rgba(18, 20, 32, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mode-tab {
  flex: 1;
  padding: 8px 6px;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mode-tab.active {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* Linked Task Pill */
.timer-task-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  cursor: pointer;
  margin-bottom: 20px;
  max-width: 90%;
  transition: border-color 0.2s;
}

.timer-task-pill:hover {
  border-color: var(--accent-cyan);
}

.timer-task-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrow-down {
  font-size: 10px;
  color: var(--text-muted);
}

/* Circular Timer Display */
.timer-circle-wrapper {
  position: relative;
  width: 270px;
  height: 270px;
  margin: 10px 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.timer-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 10;
}

.timer-progress {
  fill: none;
  stroke: url(#timerGradientIndigo);
  stroke-width: 10;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.45));
  transition: stroke-dashoffset 0.35s linear;
}

.timer-center-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-status-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.timer-digits {
  font-size: 54px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  letter-spacing: -2px;
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.2);
}

.timer-session-tally {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.tally-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.2s;
}

.tally-dot.active {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.tally-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 4px;
}

/* Timer Primary Controls Row */
.timer-controls-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.control-btn {
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.control-btn.secondary {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.control-btn.secondary:active {
  transform: scale(0.92);
  border-color: var(--accent-indigo);
}

.control-btn.primary-play {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: var(--gradient-neon);
  color: #ffffff;
  box-shadow: 0 12px 36px rgba(99, 102, 241, 0.5);
}

.control-btn.primary-play:active {
  transform: scale(0.92);
}

/* Ambient noise generator bar */
.ambient-sound-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 24px;
}

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

.ambient-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ambient-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
}

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

.ambient-btn {
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.ambient-btn.active {
  background: rgba(34, 211, 238, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Tasks Management Section in Timer */
.timer-tasks-section {
  width: 100%;
}

.filter-chips-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  scrollbar-width: none;
}

.filter-chips-scroller::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-indigo);
  color: #ffffff;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.task-item.active-linked {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.08);
}

.task-item.completed {
  opacity: 0.55;
}

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

.task-checkbox-wrap {
  display: flex;
  align-items: center;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.task-body {
  flex: 1;
  cursor: pointer;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.task-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.task-active-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(34, 211, 238, 0.25);
  color: var(--accent-cyan);
}

.task-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.task-category-tag {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-weight: 600;
}

.tag-work { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.tag-study { background: rgba(34, 211, 238, 0.2); color: #67e8f9; }
.tag-code { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
.tag-design { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.tag-health { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.tag-focus { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.task-priority-tag {
  font-weight: 600;
}
.prio-high { color: var(--accent-rose); }
.prio-medium { color: var(--accent-amber); }
.prio-low { color: var(--accent-emerald); }

.task-pomos-tag {
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.task-actions {
  display: flex;
  gap: 4px;
}

.task-action-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
}

.task-action-btn:active {
  opacity: 1;
}

/* ==========================================================================
   SCREEN 4: STATS & ANALYTICS
   ========================================================================== */
.stats-container {
  display: flex;
  flex-direction: column;
}

.stats-period-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.chart-panel {
  padding: 18px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.chart-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.chart-main-stat {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
  margin-top: 2px;
}

.chart-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent-emerald);
}

.canvas-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.canvas-wrapper canvas {
  width: 100% !important;
  max-width: 420px;
  height: auto !important;
}

/* Donut chart flex layout */
.canvas-donut-flex {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donut-canvas-box {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.donut-canvas-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.donut-legend-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.legend-name {
  color: var(--text-primary);
  font-weight: 600;
  flex: 1;
}

.legend-pct {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* KPI 2x2 Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 4px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 4px;
}

.kpi-icon.indigo { background: rgba(99, 102, 241, 0.2); }
.kpi-icon.cyan { background: rgba(34, 211, 238, 0.2); }
.kpi-icon.violet { background: rgba(168, 85, 247, 0.2); }
.kpi-icon.green { background: rgba(16, 185, 129, 0.2); }

.kpi-value {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Session History */
.session-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.session-icon-circle {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.session-icon-circle.indigo { background: rgba(99, 102, 241, 0.2); }
.session-icon-circle.cyan { background: rgba(34, 211, 238, 0.2); }

.session-info {
  flex: 1;
}

.session-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.session-time {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.session-duration {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* ==========================================================================
   SCREEN 5: SETTINGS & LEGAL
   ========================================================================== */
.settings-container {
  display: flex;
  flex-direction: column;
}

.settings-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.profile-avatar-box {
  position: relative;
}

.avatar-glow {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.profile-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.profile-tier {
  font-size: 12px;
  color: var(--accent-cyan);
  font-weight: 500;
}

.settings-group {
  margin-bottom: 22px;
}

.settings-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin: 0 4px 10px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.setting-item.clickable {
  cursor: pointer;
  transition: border-color 0.2s;
}

.setting-item.clickable:active {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
}

.setting-meta {
  flex: 1;
}

.setting-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.setting-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.setting-control {
  margin-left: 12px;
}

.setting-num-input {
  width: 68px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0;
}

/* Custom animated toggle switches */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  transition: 0.3s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .slider {
  background: var(--gradient-primary);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(20px);
}

.chevron {
  font-size: 18px;
  color: var(--text-muted);
}

.setting-btn-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.settings-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-action-btn:active {
  transform: scale(0.97);
}

.settings-action-btn.danger {
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.1);
}

.app-version-footer {
  text-align: center;
  padding: 24px 0 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.app-version-footer .copyright {
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.7;
}

/* ==========================================================================
   FIXED BOTTOM NAVIGATION BAR
   ========================================================================== */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(10, 11, 18, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 60;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

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

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
}

.nav-timer-glow {
  position: relative;
}

.nav-item.active .nav-timer-glow svg {
  filter: drop-shadow(0 0 6px var(--accent-cyan));
}

/* ==========================================================================
   MODALS & BOTTOM SHEETS
   ========================================================================== */
.modal-overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.active {
  display: flex !important;
}

.bottom-sheet {
  width: 100%;
  max-width: 480px;
  background: #141724;
  border-top: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  animation: sheetSlideUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
}

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

.sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.sheet-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
}

.sheet-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.45;
}

.form-group {
  margin-bottom: 14px;
}

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

.flex-1 { flex: 1; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-indigo);
  background: rgba(255, 255, 255, 0.08);
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.sheet-actions .btn {
  flex: 1;
}

/* Custom time pills */
.custom-pills-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.time-quick-pill {
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.time-quick-pill:active {
  background: var(--gradient-primary);
}

/* Select Task List Modal */
.select-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

.select-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
}

.select-task-item.selected {
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
}

/* Star rating row in rate modal */
.star-rating-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.star-btn {
  font-size: 34px;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.15s, color 0.15s;
}

.star-btn.active {
  color: #facc15;
  transform: scale(1.1);
}

.star-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 20px;
}

/* Share modal */
.share-link-box {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.share-social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.share-social-btn {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Legal text scroll body */
.modal-scroll-body {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.legal-paragraph {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.modal-scroll-body h4 {
  font-size: 15px;
  color: #ffffff;
  margin: 14px 0 6px;
}

.modal-scroll-body h5 {
  font-size: 13.5px;
  color: var(--accent-cyan);
  margin: 12px 0 4px;
}

/* About Modal specific */
.about-hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
}

.about-logo-badge {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.about-features-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.about-item {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.about-support-contact {
  margin-top: 16px;
  padding: 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
}

.contact-email-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 90%;
  max-width: 400px;
}

.app-toast {
  background: rgba(18, 20, 32, 0.95);
  border: 1px solid var(--accent-cyan);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Helper utility classes */
.nav-icon, .nav-icon-svg {
  width: 22px;
  height: 22px;
}

.sheet-body {
  margin-top: 10px;
}

.sheet-form {
  margin-top: 8px;
}

.profile-info-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.version-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.fire-icon, .pin-icon {
  font-size: 14px;
}

.streak-count {
  font-family: var(--font-mono);
  font-weight: 800;
}

.glass-sheet, .modal-content-sheet {
  background: rgba(20, 23, 36, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

