/* ==========================================================
   Nova Focus - Focus Timer Studio
   Premium Dark Glassmorphic Design System with Fiery Accents
   ========================================================== */

:root {
  --primary-orange: #FF6D00;
  --primary-glow: rgba(255, 109, 0, 0.45);
  --primary-accent: #FF3D00;
  --primary-light: #FFAB40;
  --bg-dark: #0D0D12;
  --bg-surface: rgba(22, 22, 28, 0.72);
  --bg-surface-elevated: rgba(30, 30, 38, 0.85);
  --glass-border: rgba(255, 109, 0, 0.16);
  --glass-border-focus: rgba(255, 109, 0, 0.45);
  --glass-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --text-main: #FFFFFF;
  --text-muted: #9E9EA8;
  --text-dim: #6E6E7A;
  --danger-color: #FF5252;
  --success-color: #00E676;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background: #0D0D12 url('bg.jpg') center/cover no-repeat fixed;
}

/* App Container - Strict 100% Smartphone Adaptation */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: rgba(13, 13, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

@media (max-width: 480px) {
  .app-container {
    box-shadow: none;
  }
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: rgba(18, 18, 24, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px var(--primary-glow);
  color: #fff;
}

.brand-svg {
  width: 20px;
  height: 20px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(120deg, #FFFFFF 30%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--transition-smooth), color var(--transition-smooth), background var(--transition-smooth);
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 109, 0, 0.15);
  border-color: rgba(255, 109, 0, 0.3);
}

.icon-btn:active {
  transform: scale(0.92);
}

.svg-icon {
  width: 20px;
  height: 20px;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  height: 40px;
  min-width: 44px;
  border-radius: var(--radius-pill);
  background: rgba(255, 109, 0, 0.12);
  border: 1px solid rgba(255, 109, 0, 0.3);
  color: #FFB74D;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--transition-smooth);
}

.streak-badge:active {
  transform: scale(0.95);
}

.streak-fire {
  font-size: 16px;
  filter: drop-shadow(0 0 6px rgba(255, 109, 0, 0.8));
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 16px 16px calc(var(--safe-bottom) + 88px);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

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

/* Screens Common */
.screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.3s ease-out;
}

.screen.hidden {
  display: none !important;
}

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

/* 1. Welcome Screen */
.welcome-hero {
  text-align: center;
  padding: 30px 10px 10px;
  position: relative;
}

.hero-glow-orb {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  filter: blur(35px);
  pointer-events: none;
  z-index: 0;
}

.hero-logo-card {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  border-radius: 28px;
  background: linear-gradient(145deg, #1f1f28, #14141c);
  border: 1px solid rgba(255, 109, 0, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.hero-svg {
  width: 58px;
  height: 58px;
}

.pulsing-ring {
  position: absolute;
  inset: -6px;
  border-radius: 34px;
  border: 2px solid rgba(255, 109, 0, 0.4);
  animation: ringPulse 2.4s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes ringPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 0.2; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.welcome-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.welcome-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.feature-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 109, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 109, 0, 0.2);
}

.feature-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.feature-info p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.welcome-action-wrap {
  padding-top: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  min-height: 46px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), background var(--transition-smooth);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-accent) 100%);
  color: #FFFFFF;
}

.btn-large {
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 24px;
  min-height: 52px;
}

.btn-glow {
  box-shadow: 0 6px 24px var(--primary-glow);
}

.btn-glow:active {
  box-shadow: 0 2px 12px var(--primary-glow);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 109, 0, 0.1);
  border-color: rgba(255, 109, 0, 0.35);
}

.btn-danger {
  background: var(--danger-color);
  color: #fff;
}

.btn-danger-outline {
  background: rgba(255, 82, 82, 0.08);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: var(--danger-color);
}

.btn-danger-outline:hover {
  background: rgba(255, 82, 82, 0.15);
}

.btn-sm {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-pill);
}

.btn-full {
  width: 100%;
}

.btn-arrow {
  width: 18px;
  height: 18px;
}

.btn-play-icon {
  width: 14px;
  height: 14px;
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--danger-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

/* 2. Home / Dashboard Screen */
.greeting-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.greeting-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-orange);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.user-greeting {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.date-chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

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

.kpi-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
}

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

.kpi-icon {
  font-size: 20px;
}

.kpi-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 109, 0, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(255, 109, 0, 0.25);
}

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

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 2px;
}

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

/* Active Focus Card */
.active-focus-card {
  padding: 16px;
  background: linear-gradient(145deg, rgba(32, 28, 26, 0.85), rgba(20, 20, 26, 0.85));
  border-color: rgba(255, 109, 0, 0.28);
}

.active-focus-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-orange);
  box-shadow: 0 0 10px var(--primary-orange);
  animation: dotPulse 1.8s infinite;
}

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

.card-caption {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--primary-light);
}

.active-task-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.active-task-name {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-category-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  flex-shrink: 0;
}

.active-focus-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.active-pomo-counter {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Quick Actions */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

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

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}

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

.qa-icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.qa-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

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

/* Daily Quote */
.quote-card {
  padding: 14px 16px;
  border-left: 3px solid var(--primary-orange);
}

.quote-text {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 6px;
}

.quote-author {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-light);
}

/* 3. Main Tool Screen (Timer Studio) */
.mode-switcher {
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-pill);
}

.mode-tab {
  flex: 1;
  padding: 9px 8px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-accent));
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.timer-center-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.timer-ring-container {
  position: relative;
  width: 270px;
  height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.timer-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 12;
}

.timer-ring-progress {
  fill: none;
  stroke: var(--primary-orange);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 754; /* 2 * PI * 120 ≈ 753.98 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

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

.timer-mode-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary-light);
  margin-bottom: 2px;
}

.timer-digits {
  font-size: 54px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(255, 109, 0, 0.3);
}

.timer-status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 8px;
}

.timer-status-pill.active {
  background: rgba(255, 109, 0, 0.2);
  color: #FFB74D;
  border: 1px solid rgba(255, 109, 0, 0.4);
}

.timer-linked-task {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
}

.timer-linked-task:hover {
  color: #fff;
  background: rgba(255, 109, 0, 0.15);
}

/* Timer Controls */
.timer-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 6px 0;
}

.control-icon-btn {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--transition-smooth), color var(--transition-smooth), border-color var(--transition-smooth);
}

.control-icon-btn:hover {
  color: #fff;
  border-color: rgba(255, 109, 0, 0.4);
}

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

.main-play-btn {
  width: 76px;
  height: 76px;
  min-width: 76px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-accent) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

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

.play-svg {
  width: 32px;
  height: 32px;
}

/* Task Manager Section */
.task-manager-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

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

.tm-title {
  font-size: 16px;
  font-weight: 700;
}

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

.task-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.filter-pill.active {
  background: rgba(255, 109, 0, 0.15);
  border-color: rgba(255, 109, 0, 0.35);
  color: var(--primary-light);
}

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

.task-empty-state {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-dim);
  font-size: 13px;
}

.task-card {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}

.task-card.active-selected {
  border-color: var(--primary-orange);
  box-shadow: 0 0 16px var(--primary-glow);
}

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

.task-card.completed .task-card-title {
  text-decoration: line-through;
  color: var(--text-dim);
}

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

.task-check-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  color: transparent;
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.task-check-btn.checked {
  background: var(--success-color);
  border-color: var(--success-color);
  color: #000;
  font-weight: 900;
  font-size: 12px;
}

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

.task-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-tag {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.task-pomo-dots {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #FF7043;
}

.task-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  font-size: 14px;
}

.task-action-btn:hover {
  color: #fff;
  background: rgba(255, 109, 0, 0.15);
}

/* 4. History & Statistics Screen */
.screen-header {
  padding-top: 4px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.page-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
}

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

.stat-number {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.4px;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.chart-card {
  padding: 16px;
}

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

.chart-title {
  font-size: 15px;
  font-weight: 700;
}

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

.chart-legend {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-orange);
}

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

.canvas-container {
  width: 100%;
  height: 220px;
  position: relative;
}

#weeklyFocusChart {
  width: 100%;
  height: 100%;
  display: block;
}

.category-breakdown-card {
  padding: 16px;
}

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

.cat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.cat-bar-name {
  font-weight: 600;
}

.cat-bar-value {
  color: var(--text-muted);
}

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

.cat-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary-orange), var(--primary-light));
  transition: width 0.5s ease;
}

.history-log-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.session-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

.log-icon {
  font-size: 18px;
}

.log-title {
  font-size: 13px;
  font-weight: 600;
}

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

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

.log-mins {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-light);
}

/* 5. Settings Screen */
.settings-group {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.sg-icon {
  font-size: 18px;
}

.sg-title {
  font-size: 15px;
  font-weight: 700;
}

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

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

/* Important: font-size 16px to prevent iOS auto-zoom */
.form-input, .form-textarea, select.form-input {
  width: 100%;
  font-size: 16px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  transition: border-color var(--transition-smooth);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 10px rgba(255, 109, 0, 0.25);
}

.form-textarea {
  resize: vertical;
  min-height: 60px;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.slider-val {
  font-weight: 700;
  color: var(--primary-light);
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-orange);
  cursor: pointer;
  box-shadow: 0 0 8px var(--primary-glow);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-info {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-size: 14px;
  font-weight: 600;
}

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

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

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

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

input:checked + .slider-round {
  background-color: var(--primary-orange);
}

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

.btn-group-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* About & Legal */
.about-app-card {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  text-align: center;
}

.app-version-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 109, 0, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(255, 109, 0, 0.25);
  margin-bottom: 8px;
}

.app-about-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.action-list-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  min-height: 48px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  touch-action: manipulation;
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.list-action-btn:hover {
  background: rgba(255, 109, 0, 0.1);
  border-color: rgba(255, 109, 0, 0.25);
}

.list-action-btn:active {
  transform: scale(0.98);
}

.lab-icon {
  font-size: 16px;
  margin-right: 10px;
}

.lab-title {
  flex: 1;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}

.lab-arrow {
  font-size: 18px;
  color: var(--text-dim);
}

.version-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--text-dim);
  padding: 12px 0 20px;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 10px calc(var(--safe-bottom) + 8px);
  background: rgba(18, 18, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 50;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 6px 12px;
  min-height: 48px;
  min-width: 60px;
  cursor: pointer;
  touch-action: manipulation;
  transition: color var(--transition-smooth), transform var(--transition-smooth);
  position: relative;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-icon {
  width: 22px;
  height: 22px;
  margin-bottom: 3px;
  transition: stroke var(--transition-smooth), filter var(--transition-smooth);
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.nav-item.active {
  color: var(--primary-orange);
}

.nav-item.active .nav-icon {
  stroke: var(--primary-orange);
  filter: drop-shadow(0 0 6px var(--primary-glow));
}

/* Modals & Bottom Sheets */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 90;
  animation: fadeInBackdrop 0.2s ease-out;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  max-height: 85dvh;
  background: #181820;
  border-top: 1px solid rgba(255, 109, 0, 0.35);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 12px 18px calc(var(--safe-bottom) + 20px);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  animation: slideUpSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.bottom-sheet.hidden, .modal-backdrop.hidden {
  display: none !important;
}

@keyframes slideUpSheet {
  from { transform: translateX(-50%) translateY(100%); }
  to { transform: translateX(-50%) translateY(0); }
}

.sheet-drag-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 0 auto 12px;
}

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

.sheet-title {
  font-size: 17px;
  font-weight: 700;
}

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

.close-sheet-btn:hover {
  color: #fff;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.modal-info-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.number-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

.stepper-input {
  width: 60px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: #fff;
}

/* Star Rating */
.text-center {
  text-align: center;
}

.star-rating-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
}

.star-btn {
  background: none;
  border: none;
  font-size: 36px;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, color 0.15s ease;
}

.star-btn.active {
  color: #FFB300;
  text-shadow: 0 0 14px rgba(255, 179, 0, 0.6);
}

.star-btn:active {
  transform: scale(1.2);
}

.rating-feedback-note {
  font-size: 13px;
  color: var(--primary-light);
  font-weight: 600;
  margin-bottom: 16px;
}

/* Support Box */
.support-contact-box {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-label {
  font-size: 11px;
  color: var(--text-dim);
}

.sc-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-light);
}

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

.legal-text-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-top: 10px;
  margin-bottom: 4px;
}

.legal-text-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 90px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 36, 0.95);
  border: 1px solid var(--primary-orange);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 15px var(--primary-glow);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  z-index: 120;
  animation: toastIn 0.25s ease-out;
}

.toast.hidden {
  display: none !important;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
