* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Notion-Inspired Bento Grid Color System */
:root {
  /* Primary Accent Colors */
  --primary-color: #6366f1; /* Soft Indigo */
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-dark: #3730a3;
  --primary-rgb: 99, 102, 241;

  --accent-secondary: #8b5cf6; /* Vibrant Purple */
  --accent-secondary-hover: #7c3aed;

  /* Light Mode - Notion-Inspired Warm Palette */
  --bg-primary: #fafaf9; /* Warm off-white */
  --bg-secondary: #ffffff; /* Pure white cards */
  --bg-tertiary: #f5f5f4;
  --bg-elevated: #ffffff;

  --text-primary: #1f2937; /* Charcoal */
  --text-secondary: #6b7280; /* Warm gray */
  --text-tertiary: #9ca3af; /* Light gray */
  --text-inverse: #ffffff;

  --border-primary: #e5e7eb; /* Subtle gray */
  --border-secondary: #d1d5db;
  --focus-ring-color: var(--primary-color);

  --surface-hover: #f9fafb;
  --surface-active: #f3f4f6;

  /* Semantic Colors - Light Mode */
  --success: #10b981; /* Emerald green */
  --success-light: #d1fae5;
  --warning: #f59e0b; /* Amber */
  --warning-light: #fef3c7;
  --danger: #ef4444; /* Red */
  --danger-light: #fee2e2;

  /* Bento Card System */
  --card-radius: 24px;
  --card-padding: 24px;
  --card-gap: 20px;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 12px 24px rgba(0, 0, 0, 0.06);

  /* Button System - Unified Design */
  --btn-radius: 16px; /* Rounded rectangles for controls */
  --btn-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --btn-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
  --btn-shadow-active: 0 1px 4px rgba(0, 0, 0, 0.2);

  /* Timer Display System */
  --timer-segment-radius: 20px; /* Slightly rounded segments */
  --timer-segment-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.1);

  /* Typography Scale */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-hero: 48px; /* 3rem */
  --font-page-title: 32px; /* 2rem */
  --font-card-title: 20px; /* 1.25rem */
  --font-body-large: 16px; /* 1rem */
  --font-body: 14px; /* 0.875rem */
  --font-caption: 12px; /* 0.75rem */

  /* Spacing scale (8px base) */
  --spacing-1: 4px;
  --spacing-2: 8px;
  --spacing-3: 12px;
  --spacing-4: 16px;
  --spacing-5: 20px;
  --spacing-6: 24px;
  --spacing-8: 32px;
  --spacing-10: 40px;
  --spacing-12: 48px;

  /* Transitions */
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Flip Card System */
  --flip-card-transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --flip-card-perspective: 1000px;
}

/* Dark Mode - Notion-Inspired Deep Blacks */
@media (prefers-color-scheme: dark) {
  :root {
    --dark-bg-primary: #0f0f0f; /* True black */
    --dark-bg-secondary: #1a1a1a; /* Dark charcoal */
    --dark-bg-tertiary: #262626;
    --dark-bg-elevated: #1a1a1a;

    --dark-text-primary: #f9fafb; /* Off-white */
    --dark-text-secondary: #d1d5db; /* Light gray */
    --dark-text-tertiary: #9ca3af; /* Medium gray */
    --dark-text-inverse: #0f0f0f;

    --dark-border-primary: #262626; /* Dark border */
    --dark-border-secondary: #374151;
    --dark-border-focus: #818cf8;

    --dark-surface-hover: #262626;
    --dark-surface-active: #374151;

    --dark-primary-color: #818cf8; /* Lighter indigo */
    --dark-primary-hover: #6366f1;
    --dark-primary-light: rgba(129, 140, 248, 0.15);

    --dark-accent-secondary: #a78bfa; /* Lighter purple */

    --dark-success: #34d399; /* Light emerald */
    --dark-success-light: rgba(52, 211, 153, 0.15);
    --dark-warning: #fbbf24; /* Light amber */
    --dark-warning-light: rgba(251, 191, 36, 0.15);
    --dark-danger: #f87171; /* Light red */
    --dark-danger-light: rgba(248, 113, 113, 0.15);

    /* Apply dark theme by default if system preference is dark */
    --bg-primary: var(--dark-bg-primary);
    --bg-secondary: var(--dark-bg-secondary);
    --bg-tertiary: var(--dark-bg-tertiary);
    --bg-elevated: var(--dark-bg-elevated);

    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --text-tertiary: var(--dark-text-tertiary);
    --text-inverse: var(--dark-text-inverse);

    --border-primary: var(--dark-border-primary);
    --border-secondary: var(--dark-border-secondary);
    --focus-ring-color: var(--dark-border-focus);

    --surface-hover: var(--dark-surface-hover);
    --surface-active: var(--dark-surface-active);

    --primary-color: var(--dark-primary-color);
    --primary-hover: var(--dark-primary-hover);
    --primary-light: var(--dark-primary-light);
    --accent-secondary: var(--dark-accent-secondary);

    --success: var(--dark-success);
    --success-light: var(--dark-success-light);
    --warning: var(--dark-warning);
    --warning-light: var(--dark-warning-light);
    --danger: var(--dark-danger);
    --danger-light: var(--dark-danger-light);

    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3), 0 12px 24px rgba(0, 0, 0, 0.25);

    /* Dark mode button shadows */
    --btn-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --btn-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
    --btn-shadow-active: 0 1px 4px rgba(0, 0, 0, 0.5);

    /* Dark mode timer segment shadows */
    --timer-segment-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
}

/* JavaScript-controlled dark mode (takes precedence over system preference) */
body.dark {
  --bg-primary: var(--dark-bg-primary, #0f0f0f);
  --bg-secondary: var(--dark-bg-secondary, #1a1a1a);
  --bg-tertiary: var(--dark-bg-tertiary, #262626);
  --bg-elevated: var(--dark-bg-elevated, #1a1a1a);

  --text-primary: var(--dark-text-primary, #f9fafb);
  --text-secondary: var(--dark-text-secondary, #d1d5db);
  --text-tertiary: var(--dark-text-tertiary, #9ca3af);
  --text-inverse: var(--dark-text-inverse, #0f0f0f);

  --border-primary: var(--dark-border-primary, #262626);
  --border-secondary: var(--dark-border-secondary, #374151);
  --focus-ring-color: var(--dark-focus-ring-color, #818cf8);

  --surface-hover: var(--dark-surface-hover, #262626);
  --surface-active: var(--dark-surface-active, #374151);

  /* Adjust primary colors for better dark mode contrast */
  --primary-color: var(--dark-primary-color, #818cf8);
  --primary-hover: var(--dark-primary-hover, #6366f1);
  --primary-light: var(--dark-primary-light, rgba(129, 140, 248, 0.15));
  --accent-secondary: var(--dark-accent-secondary, #a78bfa);

  --success: var(--dark-success, #34d399);
  --success-light: var(--dark-success-light, rgba(52, 211, 153, 0.15));
  --warning: var(--dark-warning, #fbbf24);
  --warning-light: var(--dark-warning-light, rgba(251, 191, 36, 0.15));
  --danger: var(--dark-danger, #f87171);
  --danger-light: var(--dark-danger-light, rgba(248, 113, 113, 0.15));

  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3), 0 12px 24px rgba(0, 0, 0, 0.25);

  /* Dark mode button shadows */
  --btn-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --btn-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
  --btn-shadow-active: 0 1px 4px rgba(0, 0, 0, 0.5);

  /* Dark mode timer segment shadows */
  --timer-segment-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* JavaScript-controlled light mode (takes precedence over system preference) */
body.light {
  --bg-primary: #fafaf9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f5f4;
  --bg-elevated: #ffffff;

  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;

  --border-primary: #e5e7eb;
  --border-secondary: #d1d5db;
  --focus-ring-color: #6366f1;

  --surface-hover: #f9fafb;
  --surface-active: #f3f4f6;

  /* Light mode primary colors */
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --accent-secondary: #8b5cf6;

  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;

  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 12px 24px rgba(0, 0, 0, 0.06);
}

body.color-green {
  --primary-color: #10b981;
  --primary-hover: #059669;
  --primary-light: #d1fae5;
  --primary-dark: #047857;
  --primary-rgb: 16, 185, 129;
}

body.dark.color-green {
  --primary-color: #34d399;
  --primary-hover: #10b981;
  --primary-light: rgba(52, 211, 153, 0.15);
}

body.color-purple {
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-light: #ede9fe;
  --primary-dark: #6d28d9;
  --primary-rgb: 139, 92, 246;
}

body.dark.color-purple {
  --primary-color: #a78bfa;
  --primary-hover: #8b5cf6;
  --primary-light: rgba(167, 139, 250, 0.15);
}

body.color-orange {
  --primary-color: #f97316;
  --primary-hover: #ea580c;
  --primary-light: #ffedd5;
  --primary-dark: #c2410c;
  --primary-rgb: 249, 115, 22;
}

body.dark.color-orange {
  --primary-color: #fb923c;
  --primary-hover: #f97316;
  --primary-light: rgba(251, 146, 60, 0.15);
}

body.color-pink {
  --primary-color: #ec4899;
  --primary-hover: #db2777;
  --primary-light: #fce7f3;
  --primary-dark: #be185d;
  --primary-rgb: 236, 72, 153;
}

body.dark.color-pink {
  --primary-color: #f472b6;
  --primary-hover: #ec4899;
  --primary-light: rgba(244, 114, 182, 0.15);
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container {
  max-width: 448px;
  margin: 0 auto;
}

/* Main Content Layout */
.main-content {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 24px;
}
.content-container {
  width: 100%;
}

/* Header - Enhanced Blur Effect */
.header {
  background: rgba(250, 250, 249, 0.8);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  z-index: 40;
}
body.dark .header {
  background: rgba(15, 15, 15, 0.8);
}

.header-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-6);
  padding: var(--spacing-3) var(--spacing-4);
  max-width: 1280px;
  margin: 0 auto;
}

/* App Branding */
.app-branding {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}
.app-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-secondary));
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.app-title {
  font-size: var(--font-card-title);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

/* Header Navigation */
.header-nav {
  flex: 1;
  margin-left: var(--spacing-6);
}
.nav-tabs {
  display: flex;
  gap: var(--spacing-1);
}
.tab-btn {
  padding: var(--spacing-2) var(--spacing-4);
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-body);
  font-weight: 500;
  transition: var(--transition-base);
  min-height: 44px;
  font-family: var(--font-family);
}
.tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.tab-btn:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}
.tab-btn.active {
  color: var(--primary-color);
  background: var(--primary-light);
  font-weight: 600;
}
body.dark .tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

/* Theme Toggle */
.theme-toggle-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
}
.theme-toggle-btn:hover {
  background: var(--surface-active);
}
.theme-toggle-btn:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}
.theme-icon {
  font-size: 14px;
}

/* Content */
.tab-content {
  padding: var(--spacing-8) var(--spacing-6);
  max-width: 1280px;
  margin: 0 auto;
}
.tab-content.hidden {
  display: none;
}
.hidden {
  display: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-8);
}
.header-actions {
  display: flex;
  gap: var(--spacing-3);
}

h2 {
  font-size: var(--font-page-title);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

/* Subsection headers for Templates */
.template-subsection {
  margin-bottom: 40px;
}
.template-subsection:last-child {
  margin-bottom: 0;
}
.subsection-header {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.2s;
}
.subsection-header:hover {
  background-color: var(--surface-hover);
}
body.dark .subsection-header {
  color: var(--text-primary);
}
body.dark .subsection-header:hover {
  background-color: var(--surface-hover);
}
.subsection-chevron {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 8px;
}
.subsection-header.collapsed .subsection-chevron {
  transform: rotate(-90deg);
}
.subsection-content {
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
}
.subsection-content.collapsed {
  max-height: 0 !important;
  opacity: 0;
}
.template-category {
  margin-bottom: 24px;
}
.template-category:last-child {
  margin-bottom: 0;
}
.category-header {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}
.category-header:hover {
  background-color: var(--surface-hover);
}
body.dark .category-header {
  color: var(--text-secondary);
}
body.dark .category-header:hover {
  background-color: var(--surface-hover);
}
.category-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 8px;
}
.category-header.collapsed .category-chevron {
  transform: rotate(-90deg);
}
.category-content {
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
}
.category-content.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

/* Welcome Screen - Bento Style */
.welcome-content {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--spacing-10) var(--spacing-6);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-10);
}

.welcome-header {
  text-align: center;
}

.welcome-title {
  font-size: var(--font-hero);
  font-weight: 700;
  margin-bottom: var(--spacing-3);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.welcome-subtitle {
  font-size: var(--font-body-large);
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.welcome-getting-started {
  text-align: center;
}

.welcome-section-title {
  font-size: var(--font-card-title);
  font-weight: 600;
  margin-bottom: var(--spacing-2);
  color: var(--text-primary);
}

.welcome-section-text {
  font-size: var(--font-body);
  color: var(--text-secondary);
  margin: 0;
}

.welcome-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--card-gap);
}

.welcome-action-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  cursor: pointer;
  transition: var(--transition-base);
  text-align: left;
  box-shadow: var(--card-shadow);
}

.welcome-action-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.welcome-action-card:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.welcome-action-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.welcome-action-icon-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.welcome-action-icon-secondary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.welcome-action-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.welcome-action-title {
  font-size: var(--font-card-title);
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.welcome-action-description {
  font-size: var(--font-body);
  line-height: 1.6;
  margin: 0;
  color: var(--text-secondary);
}

.welcome-help {
  background: linear-gradient(135deg, var(--warning-light), #fde68a);
  border-radius: var(--card-radius);
  padding: var(--spacing-6);
  border: 2px solid var(--warning);
}

body.dark .welcome-help {
  background: linear-gradient(135deg, #451a03, #78350f);
  border-color: var(--warning);
}

.welcome-help-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.welcome-help-title {
  font-size: var(--font-body-large);
  font-weight: 600;
  margin: 0;
  color: #92400e;
}

body.dark .welcome-help-title {
  color: var(--warning);
}

.welcome-help-text {
  font-size: var(--font-body);
  line-height: 1.6;
  margin: 0;
  color: #78350f;
}

body.dark .welcome-help-text {
  color: #fde68a;
}

@media (max-width: 640px) {
  .welcome-title {
    font-size: var(--font-page-title);
  }

  .welcome-subtitle {
    font-size: var(--font-body);
  }

  .welcome-actions-grid {
    grid-template-columns: 1fr;
  }

  .welcome-content {
    padding: var(--spacing-8) var(--spacing-4);
  }
}

/* Grid Layouts */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--card-gap);
}

/* Bento Card System - Notion-Inspired */
.card {
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-primary);
  transition: var(--transition-base);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}
body.dark .card:hover {
  border-color: rgba(129, 140, 248, 0.3);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-4);
  margin-bottom: var(--spacing-3);
}
.card-body {
  flex: 1;
}
.card-title {
  font-size: var(--font-card-title);
  font-weight: 600;
  margin-bottom: var(--spacing-2);
  color: var(--text-primary);
  line-height: 1.3;
}
.card-subtitle {
  font-size: var(--font-body);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-3);
  font-weight: 500;
}
.card-meta {
  font-size: var(--font-caption);
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* Minimal Timer Cards with Flip Animation - Bento Style */
.timer-card {
  perspective: 1000px;
  min-height: 300px;
}

.timer-card-inner {
  position: relative;
  width: 100%;
  height: 300px;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.timer-card.flipped .timer-card-inner {
  transform: rotateY(180deg);
}

/* Prevent front card from intercepting clicks when flipped */
.timer-card.flipped .timer-card-front {
  pointer-events: none;
}

.timer-card-front,
.timer-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  transition: var(--transition-base);
}

.timer-card-front:hover,
.timer-card-back:hover {
  box-shadow: var(--card-shadow-hover);
}

.timer-card-back {
  transform: rotateY(180deg);
  justify-content: center;
  align-items: center;
}

body.dark .timer-card-front:hover,
body.dark .timer-card-back:hover {
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.4),
    0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

.timer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

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

.timer-card-header-left {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.btn-menu {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.btn-menu:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.btn-menu:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

.btn-menu svg {
  width: 20px;
  height: 20px;
}

.timer-card-back-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  padding: 0 8px;
}

.btn-back-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-back-action svg {
  width: 16px;
  height: 16px;
}

.btn-back-edit {
  background: var(--primary-color);
  color: white;
}

.btn-back-edit:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-back-copy {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-back-copy:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
}

body.dark .btn-back-copy {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

body.dark .btn-back-copy:hover {
  background: var(--surface-hover);
}

.btn-back-share {
  background: #eff6ff;
  color: var(--primary-color);
}

.btn-back-share:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

body.dark .btn-back-share {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

body.dark .btn-back-share:hover {
  background: rgba(59, 130, 246, 0.2);
}

.btn-back-delete {
  background: #fef2f2;
  color: #dc2626;
}

.btn-back-delete:hover {
  background: #fee2e2;
  transform: translateY(-2px);
}

body.dark .btn-back-delete {
  background: rgba(220, 38, 38, 0.1);
  color: #f87171;
}

body.dark .btn-back-delete:hover {
  background: rgba(220, 38, 38, 0.2);
}

.timer-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.timer-duration {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.timer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.timer-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  color: var(--text-primary);
}
body.dark .timer-badge {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.timer-badge-small {
  font-size: 11px;
  font-weight: 400;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  color: var(--text-secondary);
}
body.dark .timer-badge-small {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* New vertical timer card layout */
.timer-card-header-new {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.timer-card-body-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  flex: 1;
}

.timer-duration-large {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

body.dark .timer-duration-large {
  color: var(--text-primary);
}

.timer-duration-unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 2px;
}

body.dark .timer-duration-unit {
  color: var(--text-secondary);
}

.timer-title-new {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  text-align: center;
}

body.dark .timer-title-new {
  color: var(--text-primary);
}

.timer-meta-icons {
  display: flex;
  gap: 12px; /* Reduced from 16px for tighter spacing */
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px; /* Add top margin for breathing room */
}

.timer-meta-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px; /* Increased from 2px for better separation */
  color: var(--text-secondary);
}

body.dark .timer-meta-icon {
  color: var(--text-secondary);
}

.timer-meta-icon svg {
  width: 20px; /* Reduced from 28px for less visual weight */
  height: 20px;
}

.timer-meta-icon span {
  font-size: 12px; /* Reduced from 13px */
  font-weight: 500; /* Reduced from 600 for lighter weight */
}

/* Side mode color coding */
.timer-meta-icon.side-mode-alternating {
  color: var(--primary-color);
}

body.dark .timer-meta-icon.side-mode-alternating {
  color: #60a5fa;
}

.timer-meta-icon.side-mode-completing {
  color: #8b5cf6;
}

body.dark .timer-meta-icon.side-mode-completing {
  color: #a78bfa;
}

/* Total duration display */
.timer-total-duration {
  font-size: 12px; /* Increased from 11px for better readability */
  color: var(--text-secondary);
  margin-top: 12px; /* Increased from 8px for more breathing room */
  font-weight: 500;
  padding-top: 12px; /* Add top padding with border for visual separation */
  border-top: 1px solid var(--border-primary);
}

body.dark .timer-total-duration {
  color: var(--text-secondary);
  border-top-color: var(--border-primary);
}

/* Tooltip system for timer card icons */
.timer-meta-icon {
  position: relative;
  cursor: help;
}

.timer-meta-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 10;
}

.timer-meta-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

body.dark .timer-meta-icon::after {
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
}

/* Last used timestamp */
.timer-last-used {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-style: italic;
}

body.dark .timer-last-used {
  color: var(--text-tertiary);
}

.program-notes {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 8px;
  font-style: italic;
  line-height: 1.4;
}

body.dark .program-notes {
  color: var(--text-secondary);
}

.timer-actions-new {
  display: flex;
  justify-content: center;
  margin-top: 0;
  padding-bottom: 4px;
}

.btn-play-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--btn-radius);
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--btn-shadow);
}

.btn-play-icon:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
  box-shadow: var(--btn-shadow-hover);
}

.btn-play-icon:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
}

body.dark .btn-play-icon:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

body.dark .btn-play-icon:focus-visible {
  outline-color: #60a5fa;
}

/* Success state for import buttons */
.btn-play-icon.success {
  background: #10b981;
}

body.dark .btn-play-icon.success {
  background: #059669;
}

.btn-play-icon.success svg {
  display: none;
}

.btn-play-icon.success::before {
  content: '✓';
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
}

.btn-play-icon svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

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

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 44px; /* Accessibility: minimum touch target size */
  min-height: 44px; /* Accessibility: minimum touch target size */
}
.btn-action .icon {
  width: 16px;
  height: 16px;
}
.btn-action:not(.btn-primary) {
  padding: 12px; /* Increased from 10px for better touch target */
}
.btn-action:not(.btn-primary) span {
  display: none;
}
.btn-action:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}
body.dark .btn-action:focus-visible {
  outline-color: #60a5fa;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-primary:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}
body.dark .btn-primary:focus-visible {
  outline-color: #60a5fa;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.btn-secondary:focus-visible {
  outline: 3px solid var(--text-secondary);
  outline-offset: 2px;
}
body.dark .btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
body.dark .btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
body.dark .btn-secondary:focus-visible {
  outline-color: var(--text-secondary);
}

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
}
.btn-danger:hover {
  background: #fee2e2;
}
.btn-danger:focus-visible {
  outline: 3px solid #dc2626;
  outline-offset: 2px;
}
body.dark .btn-danger {
  background: rgba(220, 38, 38, 0.1);
  color: #f87171;
}
body.dark .btn-danger:hover {
  background: rgba(220, 38, 38, 0.2);
}
body.dark .btn-danger:focus-visible {
  outline-color: #f87171;
}

/* Buttons - Bento Style */
.btn {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-size: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  text-decoration: none;
  font-family: var(--font-family);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.btn:active {
  transform: scale(0.98);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}
.btn:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Button Variants */
.btn-primary {
  background: var(--primary-color);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-primary:focus-visible {
  outline-color: var(--primary-color);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: #059669;
}
.btn-success:focus-visible {
  outline-color: var(--success);
}

.btn-blue {
  background: var(--primary-color);
  color: white;
}
.btn-blue:hover {
  background: var(--primary-hover);
}

.btn-gray {
  background: var(--text-secondary);
  color: white;
}
.btn-gray:hover {
  background: #4b5563;
}

.btn-red {
  background: var(--danger);
  color: white;
}
.btn-red:hover {
  background: #dc2626;
}

.btn-yellow {
  background: var(--warning);
  color: white;
}
.btn-yellow:hover {
  background: #d97706;
}

.btn-green {
  background: var(--success);
  color: white;
}
.btn-green:hover {
  background: #059669;
}

body.dark .btn:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.btn-icon {
  padding: 12px;
  min-width: 56px;
  min-height: 56px;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Add visual tap feedback for icon buttons */
.btn-icon:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-icon:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

body.dark .btn-icon:focus-visible {
  outline-color: #60a5fa;
}

/* Make Play/Pause button more prominent in runner controls */
#play-pause-btn.btn-icon {
  min-width: 64px;
  min-height: 64px;
  width: 64px;
  height: 64px;
}

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

.btn-large {
  width: 64px;
  height: 64px;
  padding: 16px;
}
.btn-group {
  display: flex;
  gap: 8px;
}

/* Forms - Bento Style */
.form-group {
  margin-bottom: var(--spacing-5);
}
.form-label {
  display: block;
  font-size: var(--font-body);
  font-weight: 600;
  margin-bottom: var(--spacing-2);
  color: var(--text-primary);
}
.form-label.required::after {
  content: ' *';
  color: var(--danger);
  font-weight: bold;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-primary);
  border-radius: 12px;
  font-size: var(--font-body);
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition-base);
}

/* Auto-capitalize for text inputs */
input[type='text'].form-control {
  text-transform: capitalize;
}

/* Numeric keyboard for mobile */
input[type='number'].form-control {
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

/* Real-time validation feedback */
.form-control.valid {
  border-color: var(--success);
}

.form-control.invalid {
  border-color: var(--danger);
}

.form-control.valid:focus {
  box-shadow: 0 0 0 4px var(--success-light);
}

.form-control.invalid:focus {
  box-shadow: 0 0 0 4px var(--danger-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* Number input with stepper buttons */
.number-input-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

.number-stepper-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-primary);
  background: var(--bg-secondary);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
  flex-shrink: 0;
}

.number-stepper-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: scale(1.05);
}

.number-stepper-btn:active {
  transform: scale(0.95);
}

/* Settings - Notion-Style Cards */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--card-gap);
}

.settings-section {
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-primary);
  transition: var(--transition-base);
}

.settings-section:hover {
  box-shadow: var(--card-shadow-hover);
}

.settings-section-title {
  font-size: var(--font-card-title);
  font-weight: 600;
  margin-bottom: var(--spacing-4);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: var(--spacing-2) var(--spacing-3);
  margin: calc(var(--spacing-2) * -1) calc(var(--spacing-3) * -1) var(--spacing-4)
    calc(var(--spacing-3) * -1);
  border-radius: 12px;
  transition: var(--transition-base);
}

.settings-section-title:hover {
  background-color: var(--surface-hover);
}

.settings-chevron {
  width: 20px;
  height: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  margin-left: var(--spacing-2);
}

.settings-section-title.collapsed .settings-chevron {
  transform: rotate(-90deg);
}

.settings-section-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
}

.settings-section-content.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-4);
}

.setting-label {
  font-size: var(--font-body);
  font-weight: 500;
  color: var(--text-primary);
}

.import-export-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

/* Color Swatches */
.color-swatches {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease;
}

.color-swatch:hover {
  transform: translateY(-2px);
}

.color-swatch:active {
  transform: translateY(0);
}

.swatch-color {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.dark .swatch-color {
  border-color: #374151;
}

.color-swatch:hover .swatch-color {
  border-color: #d1d5db;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body.dark .color-swatch:hover .swatch-color {
  border-color: #4b5563;
}

.color-swatch[aria-checked='true'] .swatch-color {
  border-color: #111827;
  border-width: 3px;
  box-shadow:
    0 0 0 3px #111827,
    0 4px 8px rgba(0, 0, 0, 0.2);
}

body.dark .color-swatch[aria-checked='true'] .swatch-color {
  border-color: #f9fafb;
  box-shadow:
    0 0 0 2px rgba(147, 197, 253, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
}

.swatch-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

body.dark .swatch-label {
  color: #d1d5db;
}

.color-swatch[aria-checked='true'] .swatch-label {
  color: #111827;
  font-weight: 600;
}

body.dark .color-swatch[aria-checked='true'] .swatch-label {
  color: #f9fafb;
}

/* Checkmark icon */
.swatch-checkmark {
  width: 24px;
  height: 24px;
  color: white;
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  /* Enhanced drop-shadow for better contrast on all color backgrounds */
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.color-swatch[aria-checked='true'] .swatch-checkmark {
  opacity: 1;
  transform: scale(1);
}

/* Accessibility: Focus states */
.color-swatch:focus {
  outline: none;
}

.color-swatch:focus-visible .swatch-color {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
}

body.dark .color-swatch:focus-visible .swatch-color {
  outline-color: #60a5fa;
}

/* Toggle */
.toggle {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 32px;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-bg {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #6b7280;
  border-radius: 32px;
  transition: 0.4s;
}
.toggle-dot {
  position: absolute;
  content: '';
  height: 24px;
  width: 24px;
  left: 4px;
  bottom: 4px;
  background: white;
  border-radius: 50%;
  transition: 0.4s;
}
.toggle input:checked + .toggle-bg {
  background: var(--primary-color);
}
.toggle input:checked + .toggle-bg .toggle-dot {
  transform: translateX(24px);
}

/* Modal - Bento Style */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-4);
  z-index: 50;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease-out;
}
.modal.hidden {
  display: none;
}

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

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  touch-action: pan-y;
  border: 1px solid var(--border-primary);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
body.dark .modal-content {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Enhanced swipe handle for mobile modals */
.modal-swipe-handle {
  width: 48px; /* Increased from 40px for better visibility */
  height: 5px; /* Increased from 4px */
  background: #9ca3af; /* Darker for better visibility */
  border-radius: 3px;
  margin: 14px auto 10px;
  cursor: grab;
  flex-shrink: 0;
  transition: all 0.2s ease;
  position: relative;
}

.modal-swipe-handle::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 12px;
}

.modal-swipe-handle:active {
  cursor: grabbing;
  transform: scaleY(1.2);
}

body.dark .modal-swipe-handle {
  background: #6b7280; /* Better visibility in dark mode */
}

/* Swipe hint animation */
@keyframes swipeHint {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

.modal-swipe-handle.hint {
  animation: swipeHint 1.5s ease-in-out 2;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border-primary);
}
.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}
.modal-close {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: #fee2e2;
  color: #991b1b;
}
.modal-close:focus-visible {
  outline: 3px solid #dc2626;
  outline-offset: 2px;
}
body.dark .modal-close:hover {
  background: #7f1d1d;
  color: #fca5a5;
}
body.dark .modal-close:focus-visible {
  outline-color: #f87171;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid var(--border-primary);
}

/* Program Editor Modal - Two Panel Layout */
.program-editor-modal .modal-content {
  max-width: 800px;
}
.program-editor-body {
  display: flex;
  gap: 16px;
  padding: 24px;
  min-height: 400px;
}
.program-editor-left {
  flex: 1;
  border-right: 1px solid #e5e7eb;
  padding-right: 16px;
}
body.dark .program-editor-left {
  border-color: #374151;
}
.program-editor-right {
  flex: 1;
  padding-left: 16px;
}
.program-timer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
}
.program-timer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  cursor: grab;
  transition: all 0.2s;
  background: #f9fafb;
}
.program-timer-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.program-timer-item.drag-over {
  border-top: 2px solid var(--primary-color);
}
body.dark .program-timer-item {
  background: #374151;
}
.program-timer-item:hover {
  background: #f3f4f6;
}
body.dark .program-timer-item:hover {
  background: #4b5563;
}
.program-timer-item.selected {
  background: var(--primary-light);
  border: 1px solid var(--primary-color);
}
body.dark .program-timer-item.selected {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary-color);
}
.program-timer-item .drag-handle {
  display: flex;
  align-items: center;
  color: #6b7280;
  cursor: grab;
  transition: color 0.2s;
}
.program-timer-item:hover .drag-handle {
  color: #374151;
}
.program-timer-item .drag-handle:active {
  cursor: grabbing;
}
body.dark .program-timer-item .drag-handle {
  color: #9ca3af;
}
body.dark .program-timer-item:hover .drag-handle {
  color: #d1d5db;
}
.program-timer-item .timer-name {
  flex: 1;
  font-size: 14px;
}
.program-timer-item .timer-controls {
  display: flex;
  gap: 4px;
}
.timer-control-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px; /* Increased from 4px for better touch target */
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  min-width: 44px; /* Accessibility: minimum touch target size */
  min-height: 44px; /* Accessibility: minimum touch target size */
}
.timer-control-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}
body.dark .timer-control-btn {
  color: #d1d5db;
}
body.dark .timer-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f9fafb;
}
.timer-control-btn svg {
  width: 16px;
  height: 16px;
}
.add-timer-btn {
  width: 100%;
  padding: 12px 8px; /* Increased vertical padding from 8px for better touch target */
  margin-top: 8px;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  transition: all 0.2s;
  min-height: 44px; /* Accessibility: minimum touch target size */
}
.add-timer-btn:hover {
  background: #e5e7eb;
  color: #374151;
  border-color: #9ca3af;
}
body.dark .add-timer-btn {
  background: #374151;
  border-color: #4b5563;
  color: #d1d5db;
}
body.dark .add-timer-btn:hover {
  background: #4b5563;
  color: #d1d5db;
  border-color: #6b7280;
}
.program-editor-section {
  margin-bottom: 16px;
}
.program-editor-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}
body.dark .program-editor-section h4 {
  color: #d1d5db;
}
.program-editor-step-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-color);
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  white-space: nowrap;
}
body.dark .program-editor-step-counter {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
}
.program-editor-footer {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}
body.dark .program-editor-footer {
  border-color: #374151;
}

/* Add Timer Card Styles */
.add-timer-card {
  background: white;
  color: #111827;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  max-width: 410px;
  margin: auto;
  padding: 24px;
  animation: comboSlideUp 0.7s cubic-bezier(0.61, 0.12, 0.6, 0.91);
}
body.dark .add-timer-card {
  background: #23304d;
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.8);
}

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

.add-timer-card h2 {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 600;
}

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

.timer-modal-header h2 {
  margin: 0;
}

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

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: 14px;
  margin-bottom: 8px;
  color: #6b7280;
  font-weight: 500;
}
body.dark .field-label {
  color: #d1d5db;
}

.add-timer-card input[type='number'],
.add-timer-card input[type='text'] {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
body.dark .add-timer-card input[type='number'],
body.dark .add-timer-card input[type='text'] {
  background: #374151;
  color: #f9fafb;
  border-color: #4b5563;
}

.add-timer-card input[type='number']::placeholder,
.add-timer-card input[type='text']::placeholder {
  color: #9ca3af;
}

.slider-label {
  margin-bottom: 8px;
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}
body.dark .slider-label {
  color: #d1d5db;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.add-timer-card input[type='range'] {
  flex: 1;
  min-width: 0;
  accent-color: #399cfb;
}

.slider-row input[type='number'] {
  width: 4.5em;
  padding: 10px 12px;
  text-align: center;
  font-weight: 600;
}

.slider-row .duration-unit {
  min-width: 1.5em;
  font-size: 0.9em;
  color: #6b7280;
}

body.dark .slider-row .duration-unit {
  color: #d1d5db;
}

.add-timer-card output {
  min-width: 2.5em;
  text-align: right;
  font-weight: bold;
  color: #399cfb;
}

.side-label {
  margin-bottom: 8px;
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}
body.dark .side-label {
  color: #d1d5db;
}

.side-mode-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.side-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px 16px; /* Increased from 10px for better touch target */
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px; /* Accessibility: minimum touch target size */
}
body.dark .side-btn {
  background: #374151;
  border-color: #4b5563;
  color: #d1d5db;
}

.side-btn:hover {
  background: #e5e7eb;
}
body.dark .side-btn:hover {
  background: #222c40;
}

.side-btn.active {
  background: #399cfb;
  color: #fff;
  border-color: #399cfb;
}

/* Info icon for side mode help */
.info-icon {
  display: inline-block;
  margin-left: 0.3em;
  cursor: help;
  opacity: 0.7;
  font-size: 0.9em;
}

.info-icon:hover {
  opacity: 1;
}

.rest-details summary {
  cursor: pointer;
  color: var(--primary-color);
  font-size: 14px;
  margin-bottom: 8px;
  margin-top: 8px;
  font-weight: 500;
}
body.dark .rest-details summary {
  color: #60a5fa;
}

.rest-fields {
  animation: fadeRest 0.5s;
  margin-top: 8px;
  display: flex;
  gap: 12px;
}

.rest-fields .form-field {
  flex: 1;
}

.rest-fields input[type='number'] {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
body.dark .rest-fields input[type='number'] {
  background: #374151;
  color: #f9fafb;
  border-color: #4b5563;
}

.rest-fields input[type='number']::placeholder {
  color: #9ca3af;
}

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

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.cancel,
.save {
  border: none;
  border-radius: 8px;
  padding: 0.7em 1.1em;
  cursor: pointer;
  font-size: 0.95em;
  min-height: 44px; /* Accessibility: minimum touch target size */
}

.cancel {
  background: #e5e7eb;
  color: #374151;
}
body.dark .cancel {
  background: #444;
  color: #fff;
}

.save {
  background: #399cfb;
  color: #fff;
}

.save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #9ca3af;
}

.cancel:hover {
  background: #d1d5db;
}
body.dark .cancel:hover {
  background: #555;
}

.save:hover {
  background: #2985e6;
}

/* HTML5 Dialog Styles */
.dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 32rem;
  width: 95vw;
  background: white;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
body.dark .dialog {
  background: #111827;
}
.dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}
.dialog-form {
  display: flex;
  flex-direction: column;
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}
body.dark .dialog-header {
  border-color: #374151;
}
.dialog-title {
  font-size: 18px;
  font-weight: 600;
}
.dialog-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 24px;
  padding: 4px;
}
.dialog-body {
  padding: 16px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #e5e7eb;
}
body.dark .dialog-footer {
  border-color: #374151;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group-full {
  grid-column: span 2;
}

/* Fullscreen Runner */
/* Runner Interface - Minimalist Notion-Inspired Design */
.runner-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg-primary);
  display: none;
}
.runner-fullscreen.active {
  display: block;
}

.runner-container {
  max-width: 600px;
  height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-8);
}

/* ===== Flip Card Structure ===== */
.runner-card-wrapper {
  perspective: var(--flip-card-perspective);
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  flex: 1;
}

.runner-card-flipper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  transform-style: preserve-3d;
  transition: var(--flip-card-transition);
}

.runner-card-flipper.flipped {
  transform: rotateY(180deg);
}

.runner-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
}

.runner-card-front {
  z-index: 2;
  transform: rotateY(0deg);
}

.runner-card-back {
  transform: rotateY(180deg);
  padding: var(--spacing-6);
  overflow-y: auto;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .runner-card-flipper {
    transition: none;
  }
}

/* ===== Info Button (Flip Trigger) ===== */
.flip-card-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: var(--btn-shadow);
  z-index: 20;
}

.flip-card-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  transform: scale(1.1);
  box-shadow: var(--btn-shadow-hover);
}

.flip-card-btn:active {
  transform: scale(0.95);
}

.flip-card-btn .icon {
  width: 20px;
  height: 20px;
}

/* Hint animation on first load */
@keyframes flipHintPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

.flip-card-btn.hint {
  animation: flipHintPulse 1.5s ease-in-out 3;
}

/* ===== Back Face - Unified Design ===== */

/* Back button (top-left, mirrors info button position) */
.back-flip-btn {
  left: 12px;
  right: auto;
}

/* Centered content container */
.back-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: var(--spacing-6);
  gap: var(--spacing-5);
  text-align: center;
}

/* Exercise title */
.back-title {
  font-size: var(--font-page-title);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

/* Program badge */
.back-program-badge {
  font-size: var(--font-body);
  color: var(--text-secondary);
  background: rgba(var(--primary-rgb), 0.08);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 500;
}

/* Info chips container */
.back-info-chips {
  display: flex;
  gap: var(--spacing-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* Individual info chip - matches timer segment style */
.info-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: var(--spacing-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--timer-segment-radius);
  box-shadow: var(--timer-segment-shadow);
}

.chip-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.chip-label {
  font-size: var(--font-caption);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Rep progress */
.back-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-2);
}

.back-progress-circles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.back-progress-text {
  font-size: var(--font-body);
  color: var(--text-secondary);
  font-weight: 500;
}

/* Program exercises list */
.back-program-list {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.program-exercise-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--btn-radius);
  box-shadow: var(--btn-shadow);
  transition: var(--transition-base);
}

.program-exercise-item.completed {
  opacity: 0.6;
}

.program-exercise-item.completed .exercise-item-name {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.program-exercise-item.current {
  border-color: var(--primary-color);
  background: rgba(var(--primary-rgb), 0.05);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

.exercise-item-status {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.program-exercise-item.completed .exercise-item-status {
  background: var(--success-color, #22c55e);
  color: white;
}

.program-exercise-item.current .exercise-item-status {
  background: var(--primary-color);
  color: white;
}

.program-exercise-item.upcoming .exercise-item-status {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.exercise-item-name {
  flex: 1;
  font-size: var(--font-body);
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
}

.exercise-item-duration {
  font-size: var(--font-caption);
  color: var(--text-secondary);
  font-weight: 500;
}

/* Front face - show exercise reps */
.runner-card-front #exercise-reps {
  display: block;
  font-size: var(--font-body-large);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: var(--spacing-2);
}

.runner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-6);
  height: 60px;
}

.runner-exit-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 12px;
  border-radius: var(--btn-radius);
  transition: var(--transition-base);
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--btn-shadow);
}
.runner-exit-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  transform: scale(1.05);
}
.runner-exit-btn:active {
  transform: scale(0.95);
}
.runner-exit-btn .icon {
  width: 20px;
  height: 20px;
}

.runner-progress-text {
  color: var(--text-secondary);
  font-size: var(--font-body);
  font-weight: 500;
}

/* Program Context */
.program-context {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
}
.program-title {
  font-weight: 600;
  font-size: var(--font-body-large);
  color: var(--text-primary);
}
.program-counter {
  font-size: var(--font-caption);
  color: var(--text-secondary);
}

/* Program Stepper - Enhanced */
.program-stepper {
  margin: var(--spacing-4) 0;
  padding: var(--spacing-4) 0;
}
.stepper-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-2);
  flex-wrap: wrap;
}
.stepper-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-secondary);
  transition: var(--transition-base);
  cursor: pointer;
}
.stepper-dot.completed {
  background: var(--success);
}
.stepper-dot.current {
  background: var(--primary-color);
  width: 14px;
  height: 14px;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.2);
}
body.dark .stepper-dot.current {
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}
.stepper-dot.upcoming {
  background: #e5e7eb;
}
body.dark .stepper-dot.upcoming {
  background: #374151;
}

/* Next Timer Preview */
.next-timer-preview {
  margin-top: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}
body.dark .next-timer-preview {
  background: #1f2937;
  border-left-color: #60a5fa;
}
.next-timer-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
}
body.dark .next-timer-label {
  color: #d1d5db;
}
.next-timer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.next-timer-name {
  font-weight: 500;
  color: #111827;
}
body.dark .next-timer-name {
  color: #f9fafb;
}
.next-timer-duration {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}
body.dark .next-timer-duration {
  color: #d1d5db;
}

/* Toggle Timer List Button */
.toggle-timer-list-btn {
  margin-top: 12px;
  padding: 12px 16px; /* Increased from 8px for better touch target */
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #374151;
  width: 100%;
  min-height: 44px; /* Accessibility: minimum touch target size */
}
body.dark .toggle-timer-list-btn {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}
.toggle-timer-list-btn:hover {
  background: #e5e7eb;
}
body.dark .toggle-timer-list-btn:hover {
  background: #4b5563;
}
.toggle-timer-list-btn .icon {
  width: 18px;
  height: 18px;
}
.toggle-timer-list-btn.hidden {
  display: none;
}

/* Timer List Modal */
.timer-list-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.timer-list-modal.hidden {
  display: none;
}
.timer-list-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.timer-list-content {
  position: relative;
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}
body.dark .timer-list-content {
  background: #1f2937;
}
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
.timer-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
body.dark .timer-list-header {
  border-color: #374151;
}
.timer-list-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.close-timer-list-btn {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  padding: 12px; /* Increased from 4px for better touch target */
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; /* Accessibility: minimum touch target size */
  min-height: 44px; /* Accessibility: minimum touch target size */
}
.close-timer-list-btn:hover {
  background: rgba(220, 38, 38, 0.1);
}
body.dark .close-timer-list-btn {
  color: #ef4444;
}
body.dark .close-timer-list-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}
.close-timer-list-btn .icon {
  width: 20px;
  height: 20px;
}
.timer-list-items {
  overflow-y: auto;
  padding: 12px 20px;
}
.timer-list-item {
  padding: 12px;
  margin-bottom: 8px;
  background: #f9fafb;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}
body.dark .timer-list-item {
  background: #374151;
}
.timer-list-item.current {
  background: #eff6ff;
  border: 2px solid var(--primary-color);
}
body.dark .timer-list-item.current {
  background: #1e3a5f;
  border-color: #60a5fa;
}
.timer-list-item.completed {
  opacity: 0.6;
}
.timer-list-item-name {
  font-weight: 500;
}
.timer-list-item-duration {
  font-size: 13px;
  color: #6b7280;
}
body.dark .timer-list-item-duration {
  color: #d1d5db;
}

/* Compact horizontal side indicator badges */
/* Side Indicators - Clean & Minimalist */
.side-indicators {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  margin: var(--spacing-4) auto 0;
  gap: var(--spacing-6);
  height: auto;
}

.side-indicator {
  background: var(--bg-secondary);
  border: 3px solid var(--border-primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 56px;
  transition: var(--transition-base);
  position: relative;
  box-shadow: var(--card-shadow);
}

/* Active states with color coding */
#side-left.active {
  background: var(--primary-color);
  border-color: var(--primary-hover);
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.4);
  animation: sideActivateSlide 0.4s ease-out;
}

#side-right.active {
  background: var(--warning);
  border-color: #ea580c;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
  animation: sideActivateSlide 0.4s ease-out;
}

.side-letter {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-secondary);
}

.side-indicator.active .side-letter {
  color: white;
}

/* Animation for side indicator activation */
@keyframes sideActivateSlide {
  0% {
    transform: scale(1) translateX(-10px);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.15) translateX(0);
    opacity: 1;
  }
  100% {
    transform: scale(1.1) translateX(0);
    opacity: 1;
  }
}

/* Checkmark icon for completed sides */
.side-indicator .checkmark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-base);
}
.side-indicator.completed .checkmark {
  opacity: 1;
}
.side-indicator.completed .side-letter {
  opacity: 0.3;
}

/* Side indicators during rest period */
.runner-display.rest-period .side-indicator {
  opacity: 0.7;
  border-style: dashed;
}
.runner-display.rest-period .side-indicator.active {
  opacity: 1;
  border-style: solid;
  animation: restSidePulse 2s ease-in-out infinite;
}
@keyframes restSidePulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.4);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.6);
  }
}
.runner-display.rest-period #side-right.active {
  animation: restSidePulseOrange 2s ease-in-out infinite;
}
@keyframes restSidePulseOrange {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.6);
  }
}

/* Runner Display - Clean Container */
.runner-display {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  padding: var(--spacing-6);
  box-shadow: var(--card-shadow);
  text-align: center;
  max-width: 500px;
  margin: var(--spacing-4) auto 0 auto;
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  border: 1px solid var(--border-primary);
}

.exercise-info {
  margin-bottom: var(--spacing-4);
}

.exercise-name {
  font-size: var(--font-page-title);
  font-weight: 700;
  margin-bottom: var(--spacing-1);
  animation: fadeIn 0.3s ease-out;
  color: var(--text-primary);
}

.exercise-reps {
  color: var(--text-secondary);
  font-size: var(--font-body);
  font-weight: 500;
}

/* Front face rep indicator - visual dots/counts */
.front-rep-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Dots for ≤5 reps - larger size for visibility */
.front-rep-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border-secondary);
  background: transparent;
  transition: all 0.2s ease;
}

.front-rep-dot.completed {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.front-rep-dot.current {
  transform: scale(1.25);
}

/* Side-specific colors - Left uses primary (blue), Right uses warning (orange) */
.front-rep-dot.left {
  border-color: var(--primary-color);
}
.front-rep-dot.left.completed {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.front-rep-dot.right {
  border-color: var(--warning);
}
.front-rep-dot.right.completed {
  background: var(--warning);
  border-color: var(--warning);
}

/* Count badge for >5 reps */
.front-rep-count {
  font-size: 14px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
}

.front-rep-count.left {
  color: var(--primary-color);
}
.front-rep-count.right {
  color: var(--warning);
}
.front-rep-count.no-sides {
  color: var(--text-secondary);
}

.step-counter {
  display: none !important;
}

/* Base timer display - Flexbox container */
.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-weight: 700;
  line-height: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Timer segment boxes - Unified Design System */
.timer-segment {
  background: var(--bg-secondary);
  border: 2px solid var(--border-primary);
  border-radius: var(--timer-segment-radius);
  padding: 20px 40px;
  box-shadow: var(--timer-segment-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 200px; /* Fixed width prevents layout shift */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Seconds box - always visible, larger when alone */
.timer-segment-seconds {
  min-width: 200px;
}

/* Minutes box - hidden by default */
.timer-segment-minutes {
  display: none;
  opacity: 0;
  transform: scale(0.9);
  min-width: 160px;
}

/* Separator - hidden by default */
.timer-separator {
  display: none;
  opacity: 0;
  font-size: 48px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Large seconds-only display (default state) */
.timer-display .timer-seconds {
  font-size: 76px;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
  transition: font-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark .timer-display .timer-seconds {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Minutes text (when shown) */
.timer-display .timer-minutes {
  font-size: 64px;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
}

body.dark .timer-display .timer-minutes {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* State: Timer has minutes (≥ 60 seconds) */
.timer-display.has-minutes .timer-segment-minutes {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.timer-display.has-minutes .timer-separator {
  display: block;
  opacity: 0.7;
}

/* Reduce seconds font when minutes are shown */
.timer-display.has-minutes .timer-seconds {
  font-size: 64px;
}

.timer-display.has-minutes .timer-segment-seconds {
  min-width: 180px;
}

/* Paused state - only visual distinction */
.timer-display.paused .timer-segment {
  border-color: var(--warning);
  opacity: 0.7;
  box-shadow:
    0 2px 8px rgba(245, 158, 11, 0.2),
    0 0 0 3px rgba(245, 158, 11, 0.15);
}

.timer-display.paused .timer-minutes,
.timer-display.paused .timer-seconds {
  color: var(--warning);
}

body.dark .timer-display.paused .timer-segment {
  border-color: #fbbf24;
}

body.dark .timer-display.paused .timer-minutes,
body.dark .timer-display.paused .timer-seconds {
  color: #fbbf24;
}

/* Responsive adjustments - smaller screens */
@media screen and (max-height: 700px) {
  .timer-display .timer-seconds {
    font-size: 64px;
  }

  .timer-display.has-minutes .timer-seconds,
  .timer-display .timer-minutes {
    font-size: 56px;
  }

  .timer-segment {
    padding: 16px 32px;
    min-width: 180px;
  }

  .timer-segment-minutes {
    min-width: 140px;
  }

  .timer-separator {
    font-size: 40px;
  }
}

@media screen and (max-height: 600px) {
  .timer-display .timer-seconds {
    font-size: 56px;
  }

  .timer-display.has-minutes .timer-seconds,
  .timer-display .timer-minutes {
    font-size: 48px;
  }

  .timer-segment {
    padding: 12px 28px;
    min-width: 160px;
  }

  .timer-segment-minutes {
    min-width: 120px;
  }

  .timer-separator {
    font-size: 32px;
  }
}

/* Paused State Styling - Visual distinction */
.runner-display.paused {
  position: relative;
  opacity: 0.85;
  border: 2px solid var(--warning);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

body.dark .runner-display.paused {
  border: 2px solid #fbbf24;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
}

/* Status label positioned on top border of runner-display, top-right */
.runner-status-label {
  display: none;
  position: absolute;
  top: 0;
  right: 16px;
  transform: translateY(-50%);
  z-index: 10;
}

.runner-status-label.visible {
  display: block;
}

.runner-status-label .status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  animation: statusBadgePulse 2s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.runner-status-label .status-badge.paused {
  background: var(--warning);
  color: white;
}

.runner-status-label .status-badge.rest {
  background: var(--success);
  color: white;
}

body.dark .runner-status-label .status-badge.paused {
  background: #fbbf24;
  color: #0f0f0f;
}

body.dark .runner-status-label .status-badge.rest {
  background: var(--success);
  color: #0f0f0f;
}

@keyframes statusBadgePulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Remove old paused ::before styles - now using separate element */

@keyframes pausedBadgePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

.timer-display.paused {
  opacity: 0.6;
}

.timer-display.paused .timer-minutes,
.timer-display.paused .timer-separator,
.timer-display.paused .timer-seconds {
  background: var(--warning);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark .timer-display.paused .timer-minutes,
body.dark .timer-display.paused .timer-separator,
body.dark .timer-display.paused .timer-seconds {
  background: #fbbf24;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive timer display for smaller iPhones */
@media screen and (max-height: 700px) {
  .timer-display {
    font-size: 48px;
  }

  .timer-display-container {
    max-width: 300px;
  }

  .timer-progress-bar-bg {
    max-width: 300px;
  }

  .side-indicator {
    width: 70px;
    height: 56px;
  }
}

/* Ensure timer fits on very small screens */
@media screen and (max-height: 600px) {
  .timer-display {
    font-size: 40px;
    margin: 0;
  }

  .timer-display-container {
    max-width: 260px;
  }

  .timer-progress-bar-bg {
    max-width: 260px;
    height: 8px;
  }

  .side-indicator {
    width: 60px;
    height: 48px;
  }
}
.side-indicator-text {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 16px;
}
.side-left {
  color: var(--primary-color);
}
.side-right {
  color: #ef4444;
}

/* Progress Bar for Fullscreen Runner */
.progress-container {
  margin: 20px 0;
}
.progress-bar-bg {
  width: 100%;
  height: 32px;
  background: #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
body.dark .progress-bar-bg {
  background: #374151;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
  border-radius: 16px;
  transition: width 0.1s linear;
  position: relative;
  overflow: hidden;
}
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Green progress bar for rest periods */
.runner-display.rest-period .progress-bar {
  background: linear-gradient(90deg, #10b981, #059669);
}

/* Round Indicators */
.round-indicators {
  margin: 16px 0;
  text-align: center;
}
.round-circles {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 8px;
}
.round-group {
  display: flex;
  gap: 4px;
  align-items: center;
}
.round-group.side-group {
  gap: 6px;
}
.round-separator {
  width: 2px;
  height: 16px;
  background: var(--border-color);
  border-radius: 1px;
  margin: 0 4px;
}
.round-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 2px solid #d1d5db;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
body.dark .round-circle {
  background: #374151;
  border-color: #4b5563;
}
.round-circle {
  position: relative;
}
.round-circle.completed {
  background: #4f46e5;
  border-color: #4f46e5;
}
body.dark .round-circle.completed {
  background: #a5b4fc;
  border-color: #a5b4fc;
}
.round-circle.current {
  background: #f59e0b;
  border-color: #f59e0b;
  transform: scale(1.2);
}
body.dark .round-circle.current {
  background: #fbbf24;
  border-color: #fbbf24;
}

/* Controls for Fullscreen Runner */
.controls {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px 0;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  background: inherit;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.controls-secondary {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.control-btn {
  padding: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Templates */
.template-card {
  margin-bottom: 16px;
}
.template-timer {
  background: #eff6ff;
  border: 1px solid var(--primary-light);
  border-radius: 8px;
  padding: 16px;
}
.template-program {
  background: #f0fdf4;
  border: 1px solid #dcfce7;
  border-radius: 8px;
  padding: 16px;
}
body.dark .template-timer {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}
body.dark .template-program {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}
.template-badge {
  background: var(--primary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.template-badge.program {
  background: #10b981;
}

/* Utilities */
.text-center {
  text-align: center;
}
.text-muted {
  color: #6b7280;
}
body.dark .text-muted {
  color: #d1d5db;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 16px;
}
.space-y-2 > * + * {
  margin-top: 8px;
}
.space-y-3 > * + * {
  margin-top: 12px;
}
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.flex-1 {
  flex: 1;
}
.ml-4 {
  margin-left: 16px;
}
.w-20 {
  width: 140px;
}

/* SVG Icons */
.icon {
  width: 16px;
  height: 16px;
}
.icon-lg {
  width: 24px;
  height: 24px;
}
.icon-xl {
  width: 32px;
  height: 32px;
}
.w-4 {
  width: 16px;
}
.h-4 {
  height: 16px;
}

/* Notification System */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease-out;
}

.notification-info {
  background: var(--primary-color);
  color: white;
}

.notification-success {
  background: #10b981;
  color: white;
}

.notification-error {
  background: #ef4444;
  color: white;
}

.notification-warning {
  background: #f59e0b;
  color: white;
}

.notification-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.notification-message {
  flex: 1;
  margin-right: 8px;
}

.notification-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:hover {
  opacity: 0.8;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
  pointer-events: none;
}

/* Hide button content when loading */
.loading > * {
  visibility: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  visibility: visible;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Form Validation */
.form-control.error {
  border-color: #ef4444;
  background-color: #fef2f2;
}

body.dark .form-control.error {
  background-color: #450a0a;
}

.form-error {
  color: #dc2626; /* Darker red for better contrast */
  font-size: 13px;
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.form-error::before {
  content: '⚠';
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

body.dark .form-error {
  color: #f87171; /* Lighter red for dark mode */
}

/* Error state for input fields */
input.error,
select.error,
textarea.error {
  border-color: #dc2626 !important;
  background-color: #fef2f2;
}

body.dark input.error,
body.dark select.error,
body.dark textarea.error {
  border-color: #f87171 !important;
  background-color: rgba(220, 38, 38, 0.1);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none; /* Hidden by default, shown on mobile */
  background: none;
  border: none;
  color: #374151;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
}

.mobile-menu-btn:hover {
  background: #f3f4f6;
}

body.dark .mobile-menu-btn {
  color: #d1d5db;
}

body.dark .mobile-menu-btn:hover {
  background: #374151;
}

.hamburger-icon {
  width: 24px;
  height: 24px;
}

.mobile-menu-overlay {
  display: none; /* Hidden by default, controlled by JavaScript */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-menu {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #ffffff;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

body.dark .mobile-menu {
  background: #1f2937;
}

.mobile-menu-overlay.active .mobile-menu {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

body.dark .mobile-menu-header {
  border-color: #374151;
}

.mobile-menu-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.mobile-menu-close {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  min-width: 40px;
  min-height: 40px;
}

.mobile-menu-close:hover {
  background: #fee2e2;
  color: #991b1b;
}

body.dark .mobile-menu-close {
  color: #ef4444;
}

body.dark .mobile-menu-close:hover {
  background: #7f1d1d;
  color: #fca5a5;
}

.close-icon {
  width: 24px;
  height: 24px;
}

.mobile-menu-nav {
  padding: 8px 0;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-left: 4px solid transparent;
  background: none;
  color: #374151;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.mobile-menu-item.hidden {
  display: none !important;
}

.mobile-menu-item:hover {
  background: #f3f4f6;
}

.mobile-menu-item.active {
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 500;
  border-left-color: #4f46e5;
}

body.dark .mobile-menu-item {
  color: #d1d5db;
}

body.dark .mobile-menu-item:hover {
  background: #374151;
}

body.dark .mobile-menu-item.active {
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
  border-left-color: #818cf8;
}

.mobile-menu-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Mobile Responsive Design */
@media screen and (max-width: 768px) {
  /* Show hamburger menu button on mobile */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hide desktop navigation on mobile */
  .header-nav {
    display: none;
  }

  /* Header optimizations for mobile */
  .header-content {
    gap: 12px;
    padding: 8px 0;
  }

  .app-branding {
    gap: 6px;
  }

  .app-title {
    font-size: 16px;
  }

  .app-logo {
    width: 28px;
    height: 28px;
  }

  /* Theme toggle mobile optimization */
  .theme-toggle-btn {
    padding: 10px;
    min-height: 44px;
    min-width: 44px;
  }

  /* Content area mobile spacing */
  .main-content {
    padding: 16px;
  }

  .container {
    max-width: 100%;
    padding: 0 16px;
  }

  /* Welcome screen mobile optimization */
  .welcome-content {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    max-width: none;
  }

  .welcome-card {
    padding: 20px;
  }

  .welcome-actions {
    gap: 8px;
  }

  /* Button mobile optimization */
  .btn {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Grid layouts mobile optimization */
  .grid-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  /* Modal mobile optimization - Bottom sheet pattern */
  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    max-width: 100%;
    width: 100%;
    margin: 0;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    animation: slideUpMobile 0.3s ease-out;
  }

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

  .modal-header {
    padding: 12px 16px 16px;
    flex-direction: row-reverse;
    gap: 12px;
  }

  .modal-title {
    flex: 1;
    font-size: 18px;
  }

  .modal-close {
    order: -1;
    margin-left: 0;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn,
  .modal-footer button[type='submit'] {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 16px;
    font-weight: 600;
  }

  .modal-footer .btn-primary,
  .modal-footer button[type='submit'] {
    order: -1;
  }

  /* Timer modal mobile optimization */
  .add-timer-card {
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    padding: 0;
    position: relative;
    touch-action: pan-y;
  }

  .timer-modal-header {
    padding: 12px 16px 16px;
    flex-direction: row-reverse;
    gap: 12px;
    margin-bottom: 16px;
  }

  .timer-modal-header h2 {
    flex: 1;
    font-size: 18px;
  }

  .timer-modal-header .modal-close {
    order: -1;
    margin: 0;
  }

  #timer-form {
    padding: 0 16px 16px;
  }

  .actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    margin-top: 16px;
  }

  .actions .save,
  .actions .cancel {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    font-weight: 600;
    justify-content: center;
  }

  .actions .save {
    order: -1;
  }

  /* Program editor modal mobile optimization */
  .program-editor-body {
    flex-direction: column;
    gap: 24px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
  }

  .program-editor-left {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding-right: 0;
    padding-bottom: 16px;
  }

  body.dark .program-editor-left {
    border-color: #374151;
  }

  .program-editor-right {
    padding-left: 0;
  }

  .program-editor-footer {
    padding: 12px 16px;
  }
}

/* Very small mobile devices */
@media screen and (max-width: 480px) {
  .header-content {
    gap: 8px;
  }

  .nav-tabs {
    gap: 1px;
  }

  .tab-btn {
    padding: 8px 6px;
    font-size: 12px;
  }

  .app-title {
    font-size: 14px;
  }

  .main-content {
    padding: 12px;
  }

  .welcome-content {
    padding: 12px;
  }

  .welcome-card {
    padding: 16px;
  }
}

/* Rest Period Styling - minimal border similar to pause state */
.runner-display.rest-period {
  position: relative;
  opacity: 0.85;
  border: 2px solid var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

body.dark .runner-display.rest-period {
  border: 2px solid var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
}

/* Old ::before REST badge removed - now using .runner-status-label element */

@keyframes restBadgePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* Rest Period Timer Display Styling */
.runner-display.rest-period .timer-display {
  color: var(--success) !important;
  font-weight: 600;
  opacity: 0.9;
}

body.dark .runner-display.rest-period .timer-display {
  color: var(--success) !important;
}

/* Rest Period Progress Bar - Green color */
.runner-display.rest-period .timer-progress-bar {
  background: var(--success) !important;
}

body.dark .runner-display.rest-period .timer-progress-bar {
  background: var(--success) !important;
}

/* Rest Period Modal - HIDDEN (use border indication instead) */
.rest-modal {
  display: none !important;
}

body.dark .runner-display.rest-period {
  border: 2px solid #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
}

/* Rest badge now uses separate .runner-status-label element */

@keyframes restBadgePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* Rest Period Timer Display Styling */
.runner-display.rest-period .timer-display {
  color: #10b981 !important;
  font-weight: 600;
  opacity: 0.9;
}

body.dark .runner-display.rest-period .timer-display {
  color: #34d399 !important;
}

/* Rest Period Progress Bar - Green color */
.runner-display.rest-period .timer-progress-bar {
  background: #10b981 !important;
}

body.dark .runner-display.rest-period .timer-progress-bar {
  background: #34d399 !important;
}

/* Rest Period Modal */
.rest-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.rest-modal:not(.hidden) {
  opacity: 1;
}
.rest-modal.hidden {
  display: none;
}
.rest-modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease-in-out;
}
.rest-modal:not(.hidden) .rest-modal-content {
  transform: scale(1);
}
.rest-modal-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.rest-modal-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.rest-modal-timer {
  font-size: 72px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: var(--success);
  margin: 16px 0;
  position: relative;
}
/* Rest progress bar */
.rest-progress-container {
  width: 100%;
  height: 8px;
  background: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 8px 0;
}
.rest-progress-bar {
  height: 100%;
  background: var(--success);
  border-radius: 4px;
  transition: width 0.3s linear;
}
.rest-modal-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 16px;
}

/* Rest modal context - enhanced with icon */
.rest-modal-context {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 20px;
  padding: 12px 20px;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}
.rest-modal-context:not(:empty)::before {
  content: '→';
  font-size: 20px;
  font-weight: bold;
  color: var(--success);
}

/* Rest skip button */
.rest-skip-btn {
  margin-top: 24px;
  padding: 12px 32px;
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rest-skip-btn:hover {
  background: var(--hover-bg);
  border-color: var(--success);
  color: var(--success);
  transform: scale(1.05);
}
.rest-skip-btn:active {
  transform: scale(0.95);
}
.rest-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  border-radius: 4px;
  transition: width 0.3s linear;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
.rest-modal-message {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 16px;
}

/* Rest modal context - enhanced with icon */
.rest-modal-context {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-top: 20px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}
.rest-modal-context:not(:empty)::before {
  content: '→';
  font-size: 20px;
  font-weight: bold;
}

/* Rest skip button with tap hint */
.rest-skip-btn {
  margin-top: 24px;
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
}

.rest-skip-btn::before {
  content: 'Tap to skip';
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  animation: tapHint 2s ease-in-out infinite;
}

@keyframes tapHint {
  0%,
  100% {
    opacity: 0.5;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
  }
}

.rest-skip-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.rest-skip-btn:hover::before {
  display: none;
}

.rest-skip-btn:active {
  transform: scale(0.95);
}

/* Dark mode adjustments for rest modal */
body.dark .rest-modal {
  background: rgba(0, 0, 0, 0.4);
}
body.dark .rest-modal-content {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(52, 211, 153, 0.92));
}

/* Countdown Modal */
.countdown-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.countdown-modal:not(.hidden) {
  opacity: 1;
}
.countdown-modal.hidden {
  display: none;
}
.countdown-modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease-in-out;
}
.countdown-modal:not(.hidden) .countdown-modal-content {
  transform: scale(1);
}
.countdown-modal-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.countdown-modal-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.countdown-modal-timer {
  font-size: 96px;
  font-weight: 700;
  color: var(--primary-color);
  animation: countdownNumberScale 1s ease-in-out;
}
@keyframes countdownNumberScale {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.countdown-timer-container {
  width: 100%;
  max-width: 280px;
  margin: 24px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.countdown-progress-bar-bg {
  width: 100%;
  max-width: 280px;
  height: 8px;
  background: var(--progress-bg);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px auto 0;
}
.countdown-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--primary-color);
  border-radius: 4px;
  transition: width 1s linear;
}
.countdown-exercise-preview {
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
}
.countdown-exercise-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.countdown-exercise-details {
  font-size: 14px;
  color: var(--text-secondary);
}
.countdown-session-time {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-weight: 500;
}
.countdown-skip-btn {
  margin-top: 24px;
  padding: 12px 32px;
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.countdown-skip-btn:hover {
  background: var(--hover-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: scale(1.05);
}
.countdown-skip-btn:active {
  transform: scale(0.95);
}

/* Dark mode adjustments for countdown modal */
body.dark .countdown-modal {
  background: rgba(0, 0, 0, 0.85);
}

/* Tooltip System */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #1f2937;
  color: #f9fafb;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 1000;
  text-align: left;
  max-width: 250px;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 1000;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

body.dark [data-tooltip]::before {
  background: #374151;
  color: #f9fafb;
}

body.dark [data-tooltip]::after {
  border-top-color: #374151;
}

/* Import Preview Modal Styles */
.import-preview-errors {
  background: var(--danger-light);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

body.dark .import-preview-errors {
  background: var(--danger-light);
  border-color: var(--danger);
}

.import-preview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.import-stat-card {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

body.dark .import-stat-card {
  background: var(--bg-tertiary);
}

.import-stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

body.dark .import-stat-label {
  color: var(--text-secondary);
}

.import-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
}

.import-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.import-option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.import-option-card:hover {
  border-color: var(--primary-color);
  background: var(--surface-hover);
}

body.dark .import-option-card {
  border-color: var(--border-primary);
}

body.dark .import-option-card:hover {
  border-color: var(--primary-color);
  background: var(--surface-hover);
}

.import-option-card input[type='radio'] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.import-option-card input[type='radio']:checked + div {
  color: var(--primary-color);
}

.import-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  color: #92400e;
  font-size: 14px;
}

body.dark .import-warning {
  background: #78350f;
  border-color: #b45309;
  color: #fef3c7;
}

/* Enhanced Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.empty-state-icon {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--primary-light), #bfdbfe);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

body.dark .empty-state-icon {
  background: linear-gradient(135deg, #1e3a8a, var(--primary-dark));
  color: #93c5fd;
}

.empty-state-icon svg {
  width: 64px;
  height: 64px;
}

.empty-state-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text-primary);
}

body.dark .empty-state-title {
  color: var(--text-primary);
}

.empty-state-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 32px 0;
  max-width: 500px;
}

body.dark .empty-state-description {
  color: var(--text-secondary);
}

.empty-state-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 32px;
}

.empty-state-action {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-primary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.empty-state-action:hover {
  border-color: var(--primary-color);
  box-shadow: 0 8px 16px rgba(var(--primary-rgb), 0.15);
  transform: translateY(-2px);
}

.empty-state-action:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

body.dark .empty-state-action {
  background: var(--bg-secondary);
  border-color: var(--border-primary);
}

body.dark .empty-state-action:hover {
  background: var(--surface-hover);
  border-color: var(--primary-color);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

body.dark .empty-state-action:focus-visible {
  outline-color: var(--primary-color);
}

.empty-state-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
}

.empty-state-action-icon.secondary {
  background: linear-gradient(135deg, #10b981, #059669);
}

.empty-state-action-content {
  flex: 1;
}

.empty-state-action-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

body.dark .empty-state-action-title {
  color: var(--text-primary);
}

.empty-state-action-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

body.dark .empty-state-action-description {
  color: var(--text-secondary);
}

.empty-state-example {
  width: 100%;
  max-width: 500px;
  margin-bottom: 24px;
}

.empty-state-example-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

body.dark .empty-state-example-label {
  color: var(--text-secondary);
}

.empty-state-example-card {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-secondary);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

body.dark .empty-state-example-card {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}

.empty-state-example-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(16, 185, 129, 0.05));
  pointer-events: none;
}

.empty-state-example-content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state-example-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.empty-state-example-duration {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
}

body.dark .empty-state-example-duration {
  color: #60a5fa;
}

.empty-state-example-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 4px 0;
}

body.dark .empty-state-example-title {
  color: var(--text-primary);
}

.empty-state-example-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

body.dark .empty-state-example-meta {
  color: var(--text-secondary);
}

.empty-state-example-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border-radius: 6px;
}

body.dark .empty-state-example-badge {
  background: var(--bg-tertiary);
}

.empty-state-tip {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 500px;
  width: 100%;
}

body.dark .empty-state-tip {
  background: linear-gradient(135deg, #451a03, #78350f);
  border-color: #f59e0b;
}

.empty-state-tip-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #92400e;
}

body.dark .empty-state-tip-title {
  color: #fbbf24;
}

.empty-state-tip-text {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  color: #78350f;
}

body.dark .empty-state-tip-text {
  color: #fde68a;
}

/* Session Complete Modal */
.session-complete-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.session-complete-modal.hidden {
  display: none;
}

.session-complete-content {
  background: linear-gradient(135deg, #10b981, #34d399);
  border-radius: 24px;
  padding: 48px 32px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(16, 185, 129, 0.4);
  max-width: 450px;
  width: 90%;
  position: relative;
  overflow: hidden;
}

/* Confetti animation */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fbbf24;
  top: -10px;
  animation: confettiFall 3s ease-out forwards;
}

.confetti:nth-child(2n) {
  background: #ec4899;
  animation-delay: 0.2s;
}

.confetti:nth-child(3n) {
  background: #60a5fa;
  animation-delay: 0.4s;
}

.confetti:nth-child(4n) {
  background: #f97316;
  animation-delay: 0.1s;
}

.confetti:nth-child(5n) {
  background: #8b5cf6;
  animation-delay: 0.3s;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.session-complete-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: celebrationBounce 0.6s ease-out;
}

@keyframes celebrationBounce {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.2) rotate(-10deg);
  }
  50% {
    transform: scale(0.95) rotate(10deg);
  }
  75% {
    transform: scale(1.1) rotate(-5deg);
  }
}

.session-complete-title {
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.session-complete-message {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 32px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.session-complete-stats {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}

.session-stat {
  margin-bottom: 12px;
}

.session-stat:last-child {
  margin-bottom: 0;
}

.session-stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.session-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.session-complete-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.session-complete-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-complete-btn-primary {
  background: white;
  color: #10b981;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.session-complete-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.session-complete-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.session-complete-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.session-complete-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Dark mode for session complete */
body.dark .session-complete-modal {
  background: rgba(0, 0, 0, 0.9);
}

/* Loading Spinners */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-primary);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner-small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-large {
  width: 60px;
  height: 60px;
  border-width: 6px;
}

body.dark .spinner {
  border-color: var(--border-primary);
  border-top-color: var(--primary-color);
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-primary);
  opacity: 0.95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

body.dark .loading-overlay {
  background-color: var(--bg-primary);
  opacity: 0.95;
}

.loading-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}

body.dark .loading-text {
  color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s ease-out;
  border-left: 4px solid var(--primary-color);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.toast-success {
  border-left-color: #10b981;
}

.toast.toast-error {
  border-left-color: #ef4444;
}

.toast.toast-warning {
  border-left-color: #f59e0b;
}

.toast.toast-info {
  border-left-color: var(--primary-color);
}

.toast-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

body.dark .toast {
  background: var(--bg-secondary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

body.dark .toast-title {
  color: var(--text-primary);
}

body.dark .toast-message {
  color: var(--text-secondary);
}

body.dark .toast-close {
  color: var(--text-tertiary);
}

body.dark .toast-close:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

/* Skeleton Screens */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--border-primary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-card {
  height: 200px;
}

body.dark .skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--border-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
}

/* ============================================
   Mobile Timer Controls (Icon-Only B Variant)
   ============================================ */

/* Screen reader only class for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Mobile Timer Controls Container */
.mobile-timer-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 24px 16px;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  background: inherit;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* Control Button Base Styles - Unified Design System */
.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--btn-radius); /* 16px rounded rectangles */
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--btn-shadow);
  position: relative;
  outline: none;
}

/* Dark theme control buttons */
body.dark .control-btn {
  background: var(--dark-bg-secondary);
  color: var(--dark-text-primary);
}

/* Control button hover/active states */
.control-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--btn-shadow-hover);
}

.control-btn:active {
  transform: scale(0.95);
  box-shadow: var(--btn-shadow-active);
}

/* Control button focus state */
.control-btn:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 2px;
}

/* Restart Button (Left) */
.control-btn-restart {
  width: 56px;
  height: 56px;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
}

.control-btn-restart:hover {
  background: rgba(var(--primary-rgb), 0.15);
}

.control-btn-restart:active {
  background: rgba(var(--primary-rgb), 0.2);
}

body.dark .control-btn-restart {
  background: rgba(var(--primary-rgb), 0.15);
}

body.dark .control-btn-restart:hover {
  background: rgba(var(--primary-rgb), 0.2);
}

/* Play/Pause Button (Center, Prominent) */
.control-btn-play-pause {
  width: 72px;
  height: 72px;
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.4);
}

.control-btn-play-pause:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.5);
}

.control-btn-play-pause:active {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

/* Skip Button (Right) */
.control-btn-skip {
  width: 56px;
  height: 56px;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary-color);
}

.control-btn-skip:hover {
  background: rgba(var(--primary-rgb), 0.15);
}

.control-btn-skip:active {
  background: rgba(var(--primary-rgb), 0.2);
}

body.dark .control-btn-skip {
  background: rgba(var(--primary-rgb), 0.15);
}

body.dark .control-btn-skip:hover {
  background: rgba(var(--primary-rgb), 0.2);
}

/* Control Icon Sizes */
.control-btn-restart .control-icon,
.control-btn-skip .control-icon {
  width: 24px;
  height: 24px;
}

.control-btn-play-pause .control-icon {
  width: 32px;
  height: 32px;
}

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {
  .control-btn {
    transition: none;
  }

  .control-btn:hover,
  .control-btn:active {
    transform: none;
  }
}

/* Larger touch targets on mobile */
@media (max-width: 768px) {
  .control-btn-restart,
  .control-btn-skip {
    width: 60px;
    height: 60px;
  }

  .control-btn-play-pause {
    width: 80px;
    height: 80px;
  }

  .control-btn-play-pause .control-icon {
    width: 36px;
    height: 36px;
  }

  .mobile-timer-controls {
    gap: 20px;
    padding: 32px 16px;
  }
}

/* Double-tap feedback on timer display */
.timer-display {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.timer-display.tap-feedback {
  animation: tapPulse 0.3s ease-out;
}

@keyframes tapPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================
   Timer Enhancements - Progress Ring & Fullscreen
   ============================================ */

/* Timer Display Container with Progress Ring */
.timer-display-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.timer-progress-bar-bg {
  width: 100%;
  max-width: 400px;
  height: 12px;
  background: rgba(156, 163, 175, 0.2);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timer-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--primary-color, #3b82f6);
  border-radius: 6px;
  transition:
    width 0.1s linear,
    background 0.3s ease;
}

/* Runner Header Controls */
.runner-header-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.runner-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition:
    background-color 0.2s,
    transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.dark .runner-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

.runner-icon-btn .icon {
  width: 20px;
  height: 20px;
}

/* Fullscreen State */
.runner-fullscreen:fullscreen {
  background: var(--bg-color);
}

.runner-fullscreen:fullscreen .runner-container {
  max-width: 100%;
  padding: 24px;
}

/* Dark mode adjustments for fullscreen */
.dark .runner-fullscreen:fullscreen {
  background: #111827;
}

/* Keyboard Shortcuts Modal Styles */
.shortcuts-grid {
  max-height: 400px;
  overflow-y: auto;
}

.shortcut-row {
  transition: background-color 0.2s;
}

.shortcut-row:hover {
  background: rgba(59, 130, 246, 0.05);
}

.dark .shortcut-row:hover {
  background: rgba(59, 130, 246, 0.1);
}

.shortcut-key {
  font-weight: 600;
  color: var(--text-primary);
}

.dark .shortcut-key {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary);
}

/* ARIA live region for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
  .timer-progress-bar {
    height: 16px;
  }

  .timer-progress-bar-bg {
    background: rgba(156, 163, 175, 0.4);
    border: 2px solid rgba(156, 163, 175, 0.6);
  }

  .control-btn {
    border: 2px solid currentColor;
  }

  .shortcut-key {
    border: 2px solid currentColor;
  }
}

/* Focus visible improvements for keyboard navigation */
.runner-icon-btn:focus-visible,
.control-btn:focus-visible,
button:focus-visible {
  outline: 3px solid var(--primary-color, #3b82f6);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .timer-progress-bar,
  .runner-icon-btn,
  .control-btn,
  .shortcut-row {
    transition: none;
  }
}

/* Mobile responsiveness for progress ring */
@media (max-width: 768px) {
  .timer-display-container {
    max-width: 320px;
  }

  .timer-display {
    font-size: 56px;
  }

  .timer-progress-bar-bg {
    max-width: 320px;
    height: 10px;
  }
}

@media (max-width: 480px) {
  .timer-display-container {
    max-width: 280px;
  }

  .timer-progress-bar-bg {
    max-width: 280px;
    height: 8px;
  }

  .timer-display {
    font-size: 48px;
  }

  .side-indicator {
    width: 60px; /* Smaller on mobile */
    height: 48px;
  }
}

/* ============================================
   Service Worker Update Banner
   ============================================ */

#sw-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 0;
  transform: translateY(-100%);
  transition: transform 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  /* Ensure visibility on iOS by accounting for safe area */
  padding-top: env(safe-area-inset-top, 0);
}

#sw-update-banner.sw-update-visible {
  transform: translateY(0);
}

.sw-update-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  max-width: 1280px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.sw-update-message {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

.sw-update-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.sw-update-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.sw-update-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  min-height: 36px;
}

.sw-update-btn-primary {
  background: white;
  color: var(--primary-color);
}

.sw-update-btn-primary:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

.sw-update-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.sw-update-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Update loading indicator */
#sw-update-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(4px);
}

body.dark #sw-update-loader {
  background: rgba(17, 24, 39, 0.95);
}

.sw-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .sw-update-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    text-align: center;
  }

  .sw-update-message {
    justify-content: center;
  }

  .sw-update-actions {
    justify-content: center;
  }

  .sw-update-btn {
    flex: 1;
    min-width: 100px;
  }
}

/* ============================================
   Audio Alert Indicator
   ============================================ */

.audio-alert-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.2s ease;
}

.audio-alert-indicator.audio-alert-active {
  opacity: 1;
  animation: audioAlertPulse 0.6s ease-out;
}

@keyframes audioAlertPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

body.dark .audio-alert-indicator {
  background: linear-gradient(135deg, var(--dark-primary-color), var(--dark-accent-secondary));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .audio-alert-indicator.audio-alert-active {
    animation: none;
  }

  @keyframes audioAlertPulse {
    0%,
    100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
    }
  }
}

/* ============================================
   Mobile Bottom Navigation Bar
   ============================================ */

.mobile-bottombar {
  display: none; /* Hidden by default, shown on mobile via media query */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  z-index: 1000;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

body.dark .mobile-bottombar {
  background: var(--dark-bg-secondary, #1a1a1a);
  border-top-color: var(--dark-border-primary, #262626);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* Hidden state for scroll behavior */
.mobile-bottombar.bottombar-hidden {
  transform: translateY(100%);
}

.bottombar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 4px;
  transition: color 0.2s ease;
  gap: 4px;
}

.bottombar-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.bottombar-label {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.bottombar-item:hover {
  color: var(--text-primary);
}

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

.bottombar-item.active .bottombar-icon {
  color: var(--primary-color);
}

body.dark .bottombar-item {
  color: var(--dark-text-secondary, #9ca3af);
}

body.dark .bottombar-item:hover {
  color: var(--dark-text-primary, #f9fafb);
}

body.dark .bottombar-item.active {
  color: var(--dark-primary-color, #818cf8);
}

body.dark .bottombar-item.active .bottombar-icon {
  color: var(--dark-primary-color, #818cf8);
}

.bottombar-item.hidden {
  display: none;
}

/* Mobile responsive: show bottombar, hide hamburger menu */
@media screen and (max-width: 768px) {
  .mobile-bottombar {
    display: flex;
  }

  /* Hide hamburger menu button on mobile when bottombar is active */
  .mobile-menu-btn {
    display: none !important;
  }

  /* Prevent mobile menu overlay from appearing */
  .mobile-menu-overlay {
    display: none !important;
  }

  /* Add bottom padding to main content to prevent overlap with bottombar */
  .main-content {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
  }

  /* Ensure templates and settings tabs also have bottom padding */
  #templates-tab,
  #settings-tab {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
  }
}
