/* ---------------------------------------
  1. Root Variables
---------------------------------------- */
:root {
    /* Typography */
    --font-display: 'Fraunces', 'Georgia', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;

    /* Dark theme (default) */
    --color-1: #c0b299;
    --color-2: #E7D4B5;
    --color-3: #F6E6CB;
    --color-4: #2E3D24;
    --background-dark: #2C2C2C;
    --text-light: #F6E6CB;
    --menu-dark-green: #2E3D24;
    --text-gray: #999999;
    --hover-gray: #e1e1e1;
    --icon-color: #999999;

    /* Deep forest green palette (primary - not too saturated) */
    --forest-green: #5a7a5f;            /* Deep forest green (primary) */
    --forest-green-light: #7a9a7f;      /* Light forest green */
    --forest-green-dark: #3d5a42;       /* Darker forest green */
    --forest-green-alpha-10: rgba(90, 122, 95, 0.1);
    --forest-green-alpha-15: rgba(90, 122, 95, 0.15);
    --forest-green-alpha-20: rgba(90, 122, 95, 0.2);
    --forest-green-alpha-30: rgba(90, 122, 95, 0.3);
    --forest-green-alpha-40: rgba(90, 122, 95, 0.4);

    /* Legacy sage green (for backwards compatibility) */
    --sage-green: #5a7a5f;              /* Now points to forest green */
    --sage-green-light: #7a9a7f;
    --sage-green-dark: #3d5a42;
    --sage-green-alpha-10: rgba(90, 122, 95, 0.1);
    --sage-green-alpha-15: rgba(90, 122, 95, 0.15);
    --sage-green-alpha-20: rgba(90, 122, 95, 0.2);
    --sage-green-alpha-30: rgba(90, 122, 95, 0.3);
    --sage-green-alpha-40: rgba(90, 122, 95, 0.4);
    --highlight-color: #5a7a5f;

    /* Warm terracotta accents */
    --terracotta: #c9956e;              /* Warm clay/earth tone */
    --terracotta-light: #e0b591;        /* Light terracotta */
    --terracotta-dark: #a67a55;         /* Dark terracotta */
    --terracotta-alpha-10: rgba(201, 149, 110, 0.1);
    --terracotta-alpha-15: rgba(201, 149, 110, 0.15);
    --terracotta-alpha-20: rgba(201, 149, 110, 0.2);
    --terracotta-alpha-30: rgba(201, 149, 110, 0.3);

    /* Honey/golden yellow (for gradients) */
    --honey-gold: #e8c170;
    --amber-warm: #f0d9a8;

    /* Additional color palette */
    --color-white: #ffffff;
    --color-gold: #ffd700;
    --color-gray-medium: #888888;
    --color-red-error: #ff6b6b;

    /* Semantic colors (refined) */
    --color-success: #6eb37e;           /* Forest-tinted green */
    --color-warning: #e8a663;           /* Warm orange */
    --color-error: #d97575;             /* Muted red */
    --color-info: #7ca8c8;              /* Soft blue */

    /* Spacing & Layout (more generous) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;
    --spacing-3xl: 48px;
    --spacing-4xl: 64px;

    /* Page Padding (increased for breathing room) */
    --page-padding-top-mobile: 32px;       /* Was 20px */
    --page-padding-top-desktop: 48px;      /* Was 30px */
    --page-padding-horizontal-mobile: 16px; /* Was 10px */
    --page-padding-horizontal-desktop: 32px; /* Was 20px */

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows - 5-tier elevation system */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06),
                 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.04),
                 0 2px 4px rgba(0, 0, 0, 0.03),
                 0 1px 1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.06),
                 0 4px 6px rgba(0, 0, 0, 0.04),
                 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.08),
                 0 10px 10px rgba(0, 0, 0, 0.04),
                 0 0 0 1px rgba(0, 0, 0, 0.02);

    /* Special glow effect (forest green) */
    --shadow-glow: 0 0 20px rgba(90, 122, 95, 0.15),
                   0 0 40px rgba(90, 122, 95, 0.08);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-index stacking context */
    --z-base: 1;
    --z-modal: 1000;
    --z-skip-link: 3000;
    --z-install-banner: 9999;
    --z-error-banner: 10000;
  }

  /* Light theme */
  [data-theme="light"] {
    --color-1: #7c9a5f;          /* Soft sage green for buttons */
    --color-2: #5d8a4a;          /* Darker green for hover */
    --color-3: #F6E6CB;
    --color-4: #a8c992;          /* Light green accent */
    --background-dark: #e8f0dc;  /* Light sage/mint background */
    --text-light: #ffffff;       /* White text on buttons */
    --menu-dark-green: #d4e5c7;  /* Light green sidebar */
    --text-gray: #4a5f3a;        /* Dark green-gray for body text */
    --hover-gray: #2d3d24;       /* Very dark green for hover */
    --icon-color: #5d7a4a;
    --highlight-color: #5d8a4a;

    /* Light mode needs more pronounced shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08),
                 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1),
                 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 20px rgba(0, 0, 0, 0.12),
                 0 6px 8px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 24px 32px rgba(0, 0, 0, 0.14),
                 0 12px 16px rgba(0, 0, 0, 0.1);
  }

  /* Light theme course cards - visible backgrounds */
  [data-theme="light"] .course-card {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  [data-theme="light"] .course-card:hover {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  /* Light theme tiles - visible backgrounds */
  [data-theme="light"] .tile {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }

  [data-theme="light"] .tile:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  }

  /* Light theme tile text - dark text for readability */
  [data-theme="light"] .quote-text,
  [data-theme="light"] .streak-number,
  [data-theme="light"] .random-text,
  [data-theme="light"] .quick-label,
  [data-theme="light"] .yoga-text {
    color: #2d3d24; /* Very dark green - readable on light backgrounds */
  }

  /* Light theme timer tile */
  [data-theme="light"] .timer-tile {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
  }

  [data-theme="light"] .timer-tile:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  }

  /* Light theme settings/account page */
  [data-theme="light"] .setting-item {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  [data-theme="light"] .setting-item:hover {
    background: rgba(255, 255, 255, 0.9);
  }

  [data-theme="light"] .setting-select {
    background-color: rgba(255, 255, 255, 0.9);
    color: #2d3d24;
    border-color: rgba(0, 0, 0, 0.2);
  }

  [data-theme="light"] .setting-select:hover {
    background-color: #ffffff;
    border-color: var(--sage-green);
  }

  /* Light theme toggle buttons - use medium green for light mode */
  [data-theme="light"] .setting-toggle-btn {
    background-color: var(--sage-green);
  }

  [data-theme="light"] .setting-toggle-btn:hover {
    background-color: var(--sage-green-light);
  }

  /* Light theme user account section */
  [data-theme="light"] .user-detail {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
  }

  /* Light theme modal backdrop */
  [data-theme="light"] .audio-modal {
    background-color: rgba(255, 255, 255, 0.7);
  }

  /* ---------------------------------------
    2. Global / Body
  ---------------------------------------- */
  * {
    box-sizing: border-box;
  }

  body {
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--background-dark);
    color: var(--text-gray);
    /* Multi-level fallback for viewport height */
    min-height: 100vh; /* Fallback for older browsers */
    min-height: -webkit-fill-available; /* Safari-specific fallback */
    min-height: 100dvh; /* Dynamic viewport height - best for Safari address bar */
    min-height: calc(var(--vh, 1vh) * 100); /* JS-based fallback for older iOS */
    display: flex;
    justify-content: center;
    /* Prevent unwanted scroll behavior on iOS */
    position: relative;
    overflow-x: hidden;
    /* Better font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  /* Base interactive element pattern */
  button,
  .interactive {
    font-family: inherit;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  }

  button {
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    outline: none;
  }

  /* Button press feedback - subtle squeeze */
  button:active,
  .interactive:active {
    transform: scale(0.97);
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* Remove focus outline for mouse users only, keep for keyboard */
  button:focus:not(:focus-visible),
  input:focus:not(:focus-visible) {
    outline: none;
  }

  /* Enhanced focus indicator for keyboard navigation */
  button:focus-visible,
  input:focus-visible,
  a:focus-visible {
    outline: 2px solid var(--forest-green);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
  }

  /* Focus within - show parent is focused */
  .course-card:focus-within {
    box-shadow: 0 0 0 3px var(--forest-green-alpha-30), var(--shadow-lg);
  }

  /* ---------------------------------------
    2a. Typography
  ---------------------------------------- */
  /* Display font for headings and special text */
  h1, h2, h3, h4,
  .logo-text,
  .course-title,
  .hero-title,
  .section-title,
  .modal-title {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.25;
  }

  h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }

  h2 {
    font-size: 2rem;
    margin-bottom: 0.875rem;
  }

  h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }

  h4 {
    font-size: 1.25rem;
    margin-bottom: 0.625rem;
  }

  /* Body text remains with sans-serif */
  p, span, div, button, input {
    font-family: var(--font-body);
  }

  /* ---------------------------------------
    3. Container Layout
  ---------------------------------------- */
  #container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    padding: 20px 0;
  }
  
  /* ---------------------------------------
    4. Left Menu
  ---------------------------------------- */
  #menu {
    width: 200px;
    background-color: var(--menu-dark-green);
    padding: 20px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    border-radius: 10px;
    margin-right: 20px;
    align-self: flex-start;
    flex-shrink: 0;
    flex-grow: 0;
  }
  
  #menu h1 {
    font-size: 40px;
    color: var(--color-2);
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 8px;
    font-family: 'Courier New', Courier, monospace;
  }
  
  #menu ul {
    list-style: none;
    padding: 0;
    text-align: center;
  }
  
  #menu ul li {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-gray);
    text-align: left;
    padding-left: 10px;
  }
  
  #menu ul li img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    filter: brightness(0) invert(0.4);
    vertical-align: middle;
    flex-shrink: 0;
  }
  
  #menu ul li:hover {
    color: var(--hover-gray);
    transform: translateX(5px);
  }
  
  #menu ul li.active {
    color: var(--highlight-color);
  }
  
  #menu hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin: 20px 0;
  }
  
  .logo {
    margin-top: 20px;
    text-align: center;
  }
  
  .logo img {
    max-width: 50%;
    height: auto;
    margin: 20px 0;
    filter: saturate(20%);
  }
  
  /* ---------------------------------------
    5. Main Content
  ---------------------------------------- */
  #content {
    flex-grow: 1;
    padding: 0 20px 20px 20px;
    color: var(--text-gray);
  }
  
  #app {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
  }
  
  h1, h2, h3 {
    color: var(--text-gray);
  }

  h1 {
    text-align: center;
  }
  
  /* ---------------------------------------
    Homepage Header (Non-fixed)
  ---------------------------------------- */
  .home-header {
    text-align: center;
    padding: 30px 20px 10px;
    margin-bottom: 5px;
  }

  .home-logo {
    font-size: 2em;
    font-weight: 700;
    color: var(--color-2);
    margin: 0;
    letter-spacing: 8px;
    font-family: 'Courier New', Courier, monospace;
  }

  /* ---------------------------------------
    Welcome Section (New Users)
  ---------------------------------------- */
  .welcome-section {
    margin: 5px 0 30px 0;
  }

  .welcome-message {
    text-align: center;
    margin-bottom: 0;
    padding: 0 20px;
  }

  .welcome-title {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--sage-green);
    margin: 0 0 15px 0;
    letter-spacing: 0.5px;
  }

  .welcome-text {
    font-size: 1.05em;
    line-height: 1.7;
    color: var(--text-gray);
    margin: 0;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Legacy classes removed - no longer needed */

  /* Hero section on home page (Legacy - now replaced by smart sections) */
  .hero {
    text-align: center;
    margin-bottom: 30px;
  }

  /* ---------------------------------------
    Featured Courses Section
  ---------------------------------------- */
  .featured-section {
    margin: 0 0 30px 0;
  }

  .featured-section h3 {
    font-size: 1.3em;
    margin: 0 0 15px 0;
    color: var(--text-gray);
  }

  /* ---------------------------------------
    Quick Start Section
  ---------------------------------------- */
  .quick-start-section {
    margin: 0 0 30px 0;
  }

  .quick-start-section h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: var(--text-gray);
  }

  .quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
  }

  .quick-action-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100px;
    cursor: pointer;
  }

  .quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    border-color: var(--sage-green);
    background: rgba(255, 255, 255, 0.08);
  }

  .quick-action-card:active {
    transform: translateY(0);
  }

  .quick-icon {
    font-size: 2.5em;
    line-height: 1;
    flex-shrink: 0;
  }

  .quick-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
  }

  .quick-label {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-light);
  }

  .quick-description {
    font-size: 0.85em;
    color: var(--text-gray);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Breathing card - most prominent with gradient */
  .breathing-card {
    background: linear-gradient(135deg, rgba(124, 168, 130, 0.15), rgba(124, 168, 130, 0.08));
    border-color: rgba(124, 168, 130, 0.3);
  }

  .breathing-card:hover {
    background: linear-gradient(135deg, rgba(124, 168, 130, 0.25), rgba(124, 168, 130, 0.15));
    border-color: var(--sage-green);
  }

  .breathing-card .quick-icon {
    color: var(--sage-green);
  }

  /* Timer card */
  .timer-card {
    background: rgba(255, 255, 255, 0.05);
  }

  .timer-card:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  /* Continue card - subtle highlight */
  .continue-card {
    background: linear-gradient(135deg, rgba(168, 208, 141, 0.12), rgba(168, 208, 141, 0.06));
    border-color: rgba(168, 208, 141, 0.2);
  }

  .continue-card:hover {
    background: linear-gradient(135deg, rgba(168, 208, 141, 0.2), rgba(168, 208, 141, 0.12));
  }

  /* Mobile optimizations (≤768px: phones in portrait & landscape) */
  @media (max-width: 768px) {
    .quick-actions {
      grid-template-columns: 1fr;
    }

    .quick-action-card {
      min-height: 90px;
      padding: 18px;
    }

    .quick-icon {
      font-size: 2.2em;
    }

    .quick-label {
      font-size: 1em;
    }

    .quick-description {
      font-size: 0.8em;
      white-space: normal;
    }
  }

  /* ---------------------------------------
    Home Page Tiles
  ---------------------------------------- */
  .home-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
  }

  .tile {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
  }

  .tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  /* Tile width modifiers */
  .tile-half {
    grid-column: span 1;
  }

  .tile-full {
    grid-column: span 2;
  }

  /* Tile height modifiers */
  .tile-compact {
    min-height: 90px;
    padding: 15px 20px;
  }

  .tile-tall {
    min-height: 360px;
  }

  .tile-auto {
    min-height: auto;
  }

  /* Quote Tile */
  .quote-tile {
    background: linear-gradient(135deg, var(--sage-green-alpha-15) 0%, rgba(76, 121, 92, 0.15) 100%);
    border-color: var(--sage-green-alpha-30);
  }

  .quote-content {
    text-align: center;
    width: 100%;
  }

  .quote-text {
    font-size: 1.05em;
    line-height: 1.6;
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 15px;
  }

  .quote-author {
    font-size: 0.9em;
    color: var(--text-gray);
    font-weight: 600;
  }

  /* Streak Tile */
  .streak-tile {
    background: linear-gradient(135deg, rgba(171, 212, 174, 0.1) 0%, var(--sage-green-alpha-10) 100%);
    border-color: rgba(171, 212, 174, 0.3);
  }

  .streak-tile.completed-today {
    background: linear-gradient(135deg, rgba(171, 212, 174, 0.2) 0%, var(--sage-green-alpha-20) 100%);
    border-color: rgba(171, 212, 174, 0.5);
    box-shadow: 0 0 20px rgba(171, 212, 174, 0.2);
  }

  .streak-content {
    text-align: center;
    width: 100%;
  }

  .streak-emoji {
    font-size: 3.5em;
    margin-bottom: 10px;
    line-height: 1;
  }

  .streak-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 5px;
    line-height: 1;
  }

  .streak-label {
    font-size: 1em;
    color: var(--text-gray);
    margin-bottom: 10px;
  }

  .streak-total {
    font-size: 0.85em;
    color: var(--text-gray);
    opacity: 0.8;
  }

  /* Random Meditation Tile */
  .random-meditation-tile {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%);
    border-color: rgba(147, 197, 253, 0.35);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  }

  .random-meditation-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 197, 253, 0.2);
    border-color: rgba(147, 197, 253, 0.5);
  }

  .random-content {
    text-align: center;
    width: 100%;
  }

  .random-emoji {
    font-size: 2.5em;
    margin-bottom: 10px;
    line-height: 1;
    display: block;
  }

  .random-text {
    font-size: 1.1em;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 5px;
  }

  .random-description {
    font-size: 0.9em;
    color: var(--text-gray);
    opacity: 0.9;
  }

  /* Breathing Tile */
  .breathing-tile {
    background: linear-gradient(135deg, rgba(124, 168, 130, 0.15), rgba(124, 168, 130, 0.08));
    border-color: rgba(124, 168, 130, 0.3);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .breathing-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 168, 130, 0.3);
    background: linear-gradient(135deg, rgba(124, 168, 130, 0.25), rgba(124, 168, 130, 0.15));
    border-color: var(--sage-green);
  }

  .breathing-tile .quick-icon {
    font-size: 2em;
    line-height: 1;
    color: var(--sage-green);
  }

  /* Timer Tile */
  .timer-tile {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .timer-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .timer-tile .quick-icon {
    font-size: 2em;
    line-height: 1;
  }

  /* Quick action content (used in breathing/timer tiles) */
  .quick-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .quick-label {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
  }

  .quick-description {
    font-size: 0.85em;
    color: var(--text-gray);
    white-space: nowrap;
  }

  /* Yoga Studio Tile */
  .yoga-tile {
    background: linear-gradient(135deg, rgba(171, 212, 174, 0.12) 0%, rgba(124, 168, 130, 0.12) 100%);
    border-color: rgba(171, 212, 174, 0.35);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  }

  .yoga-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(171, 212, 174, 0.2);
    border-color: rgba(171, 212, 174, 0.5);
  }

  .yoga-content {
    text-align: center;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
  }

  .yoga-emoji {
    font-size: 1.5em;
    line-height: 1;
    flex-shrink: 0;
  }

  .yoga-text {
    font-size: 0.9em;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
  }

  /* Mobile responsive tiles (≤768px: phones) */
  @media (max-width: 768px) {
    .home-tiles {
      grid-template-columns: 1fr;
    }

    .tile-half {
      grid-column: span 1;
    }

    .tile-compact {
      min-height: 80px;
      padding: 12px 18px;
    }

    .quote-text {
      font-size: 0.95em;
    }

    .streak-emoji {
      font-size: 3em;
    }

    .streak-number {
      font-size: 2em;
    }

    .breathing-tile .quick-icon,
    .timer-tile .quick-icon {
      font-size: 1.8em;
    }

    .quick-label {
      font-size: 0.95em;
    }

    .quick-description {
      font-size: 0.8em;
    }

    .yoga-emoji {
      font-size: 1.3em;
    }

    .yoga-text {
      font-size: 0.85em;
    }

    .yoga-content {
      flex-direction: column;
      gap: 10px;
    }

    .yoga-emoji {
      font-size: 1.8em;
    }

    .yoga-text {
      font-size: 0.9em;
    }

    .random-emoji {
      font-size: 2em;
    }

    .random-text {
      font-size: 1em;
    }

    .random-description {
      font-size: 0.85em;
    }
  }

  /* ---------------------------------------
    Continue Learning Panel
  ---------------------------------------- */
  .continue-learning-panel {
    background: linear-gradient(135deg, rgba(124, 168, 130, 0.15) 0%, rgba(124, 168, 130, 0.05) 100%);
    border: 1px solid rgba(124, 168, 130, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .continue-learning-panel:hover {
    background: linear-gradient(135deg, rgba(124, 168, 130, 0.2) 0%, rgba(124, 168, 130, 0.1) 100%);
    border-color: rgba(124, 168, 130, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .continue-learning-panel:focus {
    outline: 2px solid var(--sage-green);
    outline-offset: 2px;
  }

  .continue-header {
    margin-bottom: 15px;
  }

  .continue-header h3 {
    font-size: 1.1em;
    margin: 0;
    color: var(--text-gray);
    font-weight: 600;
  }

  .continue-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
  }

  .continue-course-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
  }

  .course-badge {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
  }

  .continue-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .continue-course-name {
    font-size: 0.85em;
    color: var(--text-gray);
    opacity: 0.8;
  }

  .continue-track-name {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-light);
  }

  .continue-progress {
    font-size: 0.8em;
    color: var(--sage-green);
    font-weight: 500;
  }

  .continue-play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--sage-green);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
  }

  .continue-play-btn:hover {
    background: var(--sage-green-dark);
    transform: scale(1.1);
  }

  /* Mobile: Continue Learning Panel (≤768px: phones) */
  @media (max-width: 768px) {
    .continue-learning-panel {
      padding: 15px;
    }

    .course-badge {
      width: 40px;
      height: 40px;
      font-size: 20px;
    }

    .continue-play-btn {
      width: 44px;
      height: 44px;
    }

    .continue-track-name {
      font-size: 0.95em;
    }
  }

  /* ---------------------------------------
    6. Course Panels
  ---------------------------------------- */
  .course-panel {
    background-color: var(--color-1);
    color: var(--color-white);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
    font-size: 1.1em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  .course-panel:hover {
    background-color: var(--color-2);
  }

  /* Course Cards with Gradient Thumbnails */
  .course-card {
    display: flex;
    gap: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
  }

  .course-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background-color: rgba(255, 255, 255, 0.08);
  }

  .course-card:active {
    transform: translateY(0);
  }

  .course-thumbnail {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .course-icon {
    font-size: 48px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .course-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
  }

  .course-title {
    font-size: 1.4em;
    margin: 0 0 8px 0;
    color: var(--text-gray);
    font-weight: 600;
  }

  .course-description {
    font-size: 0.95em;
    margin: 0 0 12px 0;
    color: var(--text-gray);
    opacity: 0.8;
    line-height: 1.4;
  }

  .course-progress {
    margin-top: auto;
  }

  .progress-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
  }

  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--forest-green), var(--honey-gold));
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 0 8px rgba(90, 122, 95, 0.3);
  }

  .progress-text {
    font-size: 0.85em;
    color: var(--text-gray);
    opacity: 0.7;
  }

  /* Mobile adjustments (≤768px: phones) */
  @media (max-width: 768px) {
    .course-card {
      flex-direction: row;
      gap: 12px;
      padding: 12px;
    }

    .course-thumbnail {
      width: 60px;
      height: 60px;
      border-radius: 8px;
    }

    .course-icon {
      font-size: 28px;
    }

    .course-info {
      justify-content: flex-start;
    }

    .course-title {
      font-size: 1.1em;
      margin-bottom: 4px;
    }

    .course-description {
      font-size: 0.85em;
      margin-bottom: 8px;
    }
  }

  /* Course Header (Course Detail Page) */
  .course-header {
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.4s ease-out;
  }

  .course-header-icon {
    font-size: 72px;
    margin-bottom: 15px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-out 0.1s backwards;
  }

  .course-header-title {
    color: #ffffff;
    font-size: 2.2em;
    margin: 0 0 12px 0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease-out 0.2s backwards;
  }

  .course-header-description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1em;
    margin: 0 0 30px 0;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s ease-out 0.3s backwards;
  }

  .course-header-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 25px;
    animation: fadeIn 0.5s ease-out 0.4s backwards;
  }

  .course-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }

  .course-stat-value {
    color: #ffffff;
    font-size: 1.8em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .course-stat-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }

  .course-header-progress {
    max-width: 400px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out 0.5s backwards;
  }

  .course-header-progress .progress-bar {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  .course-header-progress .progress-fill {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  /* Mobile adjustments for course header (≤768px: phones) */
  @media (max-width: 768px) {
    .course-header {
      padding: 30px 20px;
    }

    .course-header-icon {
      font-size: 56px;
    }

    .course-header-title {
      font-size: 1.8em;
    }

    .course-header-description {
      font-size: 1em;
    }

    .course-header-stats {
      gap: 25px;
      flex-wrap: wrap;
    }

    .course-stat-value {
      font-size: 1.5em;
    }

    .course-stat-label {
      font-size: 0.75em;
    }
  }

  /* ---------------------------------------
    7. Meditation List
  ---------------------------------------- */
  #meditation-list {
    list-style-type: none;
    padding: 0;
  }
  
  #meditation-list li {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
  }
  
  #meditation-list li:hover {
    background-color: rgba(255, 255, 255, 0.2);
  }
  
  .audio-duration {
    float: right;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 10px;
  }
  
  /* ---------------------------------------
    8. Audio Element (generic)
  ---------------------------------------- */
  audio {
    width: 100%;
    margin-bottom: 10px;
  }
  
  /* ---------------------------------------
    9. Timer Page & Timer Modal
  ---------------------------------------- */
  #timer-page {
    text-align: center;
  }

  .timer-controls-frame {
    border: 1px solid rgba(192, 192, 192, 0.3);
    border-radius: 12px;
    padding: 25px 30px;
    margin: 0 auto 20px;
    max-width: 600px;
  }

  .timer-input-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 25px;
  }

  .timer-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0;
  }

  .timer-label-row label {
    font-weight: bold;
    color: var(--text-light);
  }

  .timer-value {
    color: var(--text-gray);
    font-size: 0.95em;
  }

  .timer-input-container input[type="range"] {
    width: 100%;
  }

  .timer-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 5px;
  }
  
  .timer-start-btn {
    background-color: var(--sage-green);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(124, 168, 130, 0.3);
  }

  .timer-start-btn:hover {
    background-color: var(--sage-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 168, 130, 0.4);
  }
  
  #timer-range,
  #bell-range {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    width: 90%;
  }
  
  #timer-range::-webkit-slider-thumb,
  #bell-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--color-green-vibrant);
    cursor: pointer;
    margin-top: -6px;
  }

  #timer-range::-webkit-slider-runnable-track,
  #bell-range::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--color-green-light);
    border-radius: 2px;
  }

  /* Firefox styling for timer modal sliders */
  #timer-range::-moz-range-thumb,
  #bell-range::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--color-green-vibrant);
    cursor: pointer;
    border: none;
  }

  #timer-range::-moz-range-track,
  #bell-range::-moz-range-track {
    height: 4px;
    background: var(--color-green-light);
    border-radius: 2px;
  }

  #timer-modal {
    display: none;
    position: fixed;
    z-index: var(--z-modal);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
  }
  
  #timer-modal .audio-modal-content {
    width: 90%;
    max-width: 600px;
  }
  
  #timer-modal-range {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    width: 100%;
  }
  
  #timer-modal-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--color-1);
    cursor: pointer;
    margin-top: -6px;
  }
  
  #timer-modal-range::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--color-4);
    border-radius: 2px;
  }
  
  /* ---------------------------------------
    10. Back Button
  ---------------------------------------- */
  .back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-1);
    color: var(--text-light);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 10px;
  }
  
  .back-button img {
    width: 20px;
    height: 20px;
    margin-right: 5px;
  }
  
  .back-button:hover {
    background-color: var(--color-2);
    color: var(--background-dark);
  }
  
  /* ---------------------------------------
    11. Mobile / Responsive
  ---------------------------------------- */

  /*
   * RESPONSIVE BREAKPOINT STRATEGY
   * ===============================
   * Mobile (≤768px):     Phones in portrait & landscape - bottom nav, no sidebar
   * Tablet (769-1024px): iPad, iPad Pro, Surface - sidebar visible, optimized touch targets
   * Desktop (≥1025px):   Large screens - full desktop layout
   *
   * Device Examples:
   * - iPhone 14 Pro Max:    430px  (mobile)
   * - iPad Mini:            768px  (mobile at boundary)
   * - iPad Pro 11":         834px  (tablet)
   * - iPad Pro 12.9":       1024px (tablet at boundary)
   * - Surface Pro:          912px  (tablet)
   * - Desktop:              1280px+ (desktop)
   */

  /* Tablet optimization (769px - 1024px: iPad, iPad Pro, Surface) - Keep sidebar visible */
  @media (min-width: 769px) and (max-width: 1024px) {
    #container {
      width: 95%;
      max-width: none;
    }

    #menu {
      width: 180px;
      padding: 15px;
    }

    #menu h1 {
      font-size: 36px;
    }

    #content {
      padding: 0 15px 15px 15px;
    }

    #app {
      max-width: 700px;
    }

    .course-card {
      padding: 20px;
    }

    .course-thumbnail {
      width: 140px;
      height: 140px;
    }

    .audio-modal-content {
      max-width: 550px;
    }

    /* Better grid layouts for tablets */
    .stats-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  /* Mobile Layout (≤768px: phones in portrait & landscape) */
  @media (max-width: 768px) {
    body {
      padding-top: 0; /* No header on mobile anymore */
      overflow-x: hidden;
    }
    #container {
      flex-direction: column;
      width: 100%;
    }
    #menu {
      width: 170px;
      border-radius: 0;
      padding: 10px 10px 5px 10px;
      position: fixed;
      top: 0; /* No header anymore */
      left: -100%;
      height: 100%; /* Full height now */
      overflow-y: auto;
      transition: left 0.3s ease-in-out;
      z-index: var(--z-modal);
      background-color: var(--menu-dark-green);
    }
    #menu.show {
      left: 0;
    }
    #menu h1 {
      display: none;
    }
    #menu ul {
      margin: 0;
      padding: 0;
    }
    #menu ul li {
      padding: 0;
      margin-bottom: 0;
    }
    #menu hr {
      margin: 4px 0;
    }
    .logo {
      margin-top: 5px;
      display: none; /* Hide logo on mobile to save space */
    }
    .logo img {
      margin: 5px 0;
      max-width: 35%;
    }
    #content {
      padding: var(--page-padding-top-mobile) var(--page-padding-horizontal-mobile) 10px var(--page-padding-horizontal-mobile);
      width: 100%;
      box-sizing: border-box;
    }
    #app {
      padding-left: 10px;
      padding-right: 10px;
    }
  }

  /* Tablet landscape optimization (iPad landscape mode) */
  @media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    #container {
      width: 98%;
    }

    #menu {
      width: 160px;
      padding: 12px;
    }

    #menu h1 {
      font-size: 32px;
    }

    .course-card {
      flex-direction: row;
    }

    .course-thumbnail {
      width: 120px;
      height: 120px;
    }
  }
  
  /* ---------------------------------------
    12. Modal Audio Player Styles
  ---------------------------------------- */
  .audio-modal {
    display: none;
    position: fixed;
    z-index: var(--z-modal);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 28, 28, 0.85);
    backdrop-filter: blur(8px) saturate(1.2);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    justify-content: center;
    align-items: center;
  }
  
  .audio-modal-content {
    background-color: var(--menu-dark-green);
    width: 90%;
    max-width: 600px;
    margin: auto;
    border-radius: 12px;
    padding: 30px 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-xl);
  }
  
  .close-audio {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
  }

  .favorite-btn {
    background: none;
    border: none;
    color: var(--color-2);
    font-size: 28px;
    position: absolute;
    top: 15px;
    left: 20px;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .favorite-btn:hover {
    transform: scale(1.2);
    color: #ffd700;
  }

  .favorite-btn:active {
    transform: scale(1.1);
  }

  .share-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 28px;
    position: absolute;
    top: 15px;
    left: 60px;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .share-btn:hover {
    transform: scale(1.2);
    color: var(--highlight-color);
  }

  .share-btn:active {
    transform: scale(1.1);
  }

  .audio-art img {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 20px;
  }
  
  #audio-title,
  #timer-modal-title {
    font-size: 1.6em;
    margin-bottom: 8px;
    text-align: center;
  }
  
  .audio-subtitle,
  #timer-modal-subtitle {
    font-size: 0.9em;
    margin-bottom: 20px;
    color: #ccc;
    text-align: center;
  }
  
  .audio-timeline {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
  }

  .timeline-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: var(--text-gray);
  }

  .timeline-labels span {
    min-width: 45px;
    text-align: center;
  }

  #current-time {
    text-align: left;
  }

  #remaining-time {
    text-align: right;
  }

  #audio-range,
  #timer-modal-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
  }

  /* Audio slider track (already set above for timer) */
  #audio-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--color-1);
    cursor: pointer;
    margin-top: -6px;
  }

  #audio-range::-webkit-slider-runnable-track {
    height: 4px;
    background: #888;
    border-radius: 2px;
  }

  /* Firefox audio slider styling */
  #audio-range::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--color-1);
    cursor: pointer;
    border: none;
  }

  #audio-range::-moz-range-track {
    height: 4px;
    background: #888;
    border-radius: 2px;
  }
  
  .audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
  }

  .audio-control-btn {
    background-color: var(--color-1);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .audio-control-btn img {
    width: 26px;
    height: 26px;
  }

  #play {
    width: 56px;
    height: 56px;
  }

  #play img {
    width: 30px;
    height: 30px;
    margin-left: 2px;
  }

  .audio-control-btn:hover {
    background-color: var(--color-2);
    color: var(--background-dark);
  }

  .keyboard-hint {
    margin-top: 15px;
    font-size: 0.85em;
    color: var(--text-gray);
    text-align: center;
    opacity: 0.8;
  }

  /* Tablet player optimization (769px-1024px: tablets) */
  @media (min-width: 769px) and (max-width: 1024px) {
    .audio-modal-content {
      max-width: 600px;
      padding: 35px 25px;
    }

    .audio-controls {
      gap: 20px;
    }

    .audio-control-btn {
      width: 52px;
      height: 52px;
    }

    .audio-control-btn img {
      width: 28px;
      height: 28px;
    }

    #play {
      width: 60px;
      height: 60px;
    }

    #play img {
      width: 32px;
      height: 32px;
    }

    .player-control-toggle {
      min-width: 140px;
      padding: 12px 18px;
      font-size: 0.95em;
    }

    .speed-btn,
    .sleep-timer-btn {
      padding: 10px 16px;
      min-width: 60px;
    }
  }

  /* Mobile: Audio Modal Adjustments (≤768px: phones) - FULLSCREEN */
  @media (max-width: 768px) {
    .keyboard-hint {
      font-size: 0.75em;
      margin-top: 10px;
    }

    /* Fullscreen modals on mobile */
    .audio-modal-content,
    .breathing-modal-content {
      width: 100vw;
      height: 100vh;
      height: 100dvh; /* Dynamic viewport height for Safari */
      max-width: 100vw;
      border-radius: 0;
      margin: 0;
      box-shadow: none;
      /* Allow scrolling if content overflows */
      overflow-y: auto;
      /* Ensure safe areas are respected */
      padding-top: max(20px, env(safe-area-inset-top));
      padding-left: max(20px, env(safe-area-inset-left));
      padding-right: max(20px, env(safe-area-inset-right));
      padding-bottom: max(30px, env(safe-area-inset-bottom));
    }

    .audio-art img {
      width: 150px;
      height: 150px;
    }
  }

  /* Player Options - Compact Design */
  .player-options {
    width: 100%;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
  }

  .player-controls-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .player-control-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-gray);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    flex: 1;
    min-width: 120px;
    max-width: 180px;
  }

  .player-control-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--color-2);
    transform: translateY(-1px);
  }

  .player-control-toggle.active {
    background-color: var(--color-1);
    color: #ffffff;
    border-color: var(--color-1);
    font-weight: 600;
  }

  .player-control-toggle:active {
    transform: scale(0.98);
  }

  .control-icon {
    font-size: 1.2em;
    line-height: 1;
  }

  .control-text {
    font-size: 0.9em;
  }

  /* Control Menus (Dropdowns) */
  .control-menu {
    background-color: var(--menu-dark-green);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.2s ease-out;
  }

  .control-menu-header {
    font-size: 0.85em;
    color: var(--text-gray);
    text-align: center;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
  }

  .control-menu-options {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Duration menu has many options - make it scrollable */
  #duration-menu .control-menu-options {
    max-height: 250px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .speed-btn,
  .sleep-timer-btn,
  .duration-option-btn {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-gray);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 55px;
    font-family: inherit;
  }

  .speed-btn:hover,
  .sleep-timer-btn:hover,
  .duration-option-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--color-2);
    transform: translateY(-1px);
  }

  .speed-btn.active,
  .sleep-timer-btn.active,
  .duration-option-btn.active {
    background-color: var(--color-1);
    color: #ffffff;
    border-color: var(--color-1);
    font-weight: 600;
  }

  .speed-btn:active,
  .sleep-timer-btn:active,
  .duration-option-btn:active {
    transform: scale(0.96);
  }

  #sleep-timer-display {
    font-size: 0.85em;
    color: var(--highlight-color);
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
  }

  /* Tablet adjustments for player options (769px-1024px: tablets) */
  @media (min-width: 769px) and (max-width: 1024px) {
    .player-controls-row {
      gap: 12px;
    }

    .control-menu-options {
      gap: 10px;
    }
  }

  /* Mobile adjustments for player options (≤768px: phones) */
  @media (max-width: 768px) {
    .player-options {
      margin-top: 20px;
      padding-top: 15px;
    }

    .player-controls-row {
      gap: 8px;
    }

    .player-control-toggle {
      padding: 12px 16px;
      min-width: 100px;
      min-height: 48px;
      font-size: 0.85em;
    }

    .control-icon {
      font-size: 1.1em;
    }

    .control-text {
      font-size: 0.85em;
    }

    .speed-btn,
    .sleep-timer-btn {
      padding: 10px 14px;
      font-size: 0.9em;
      min-width: 44px;
      min-height: 44px;
    }

    .control-menu {
      padding: 12px;
      margin-top: 12px;
    }
  }


  :focus-visible {
    outline: 3px solid var(--highlight-color);
    outline-offset: 2px;
  }

.audio-control-btn:active,
.timer-start-btn:active,
.course-panel:active {
  transform: scale(0.96);
}

.skip-link{position:absolute;left:-999px;top:auto;width:1px;height:1px;overflow:hidden;}
.skip-link:focus{left:8px;top:8px;width:auto;height:auto;padding:8px 12px;background:#fff;color:#000;z-index:var(--z-skip-link);}

#menu a {
  color: var(--text-gray);
  text-decoration: none;
  padding: 5px 10px;
  margin: -5px -10px;
  border-radius: 4px;
  transition: color 0.3s, background-color 0.3s;
}

#menu a.active {
  color: var(--highlight-color);
}

#menu a:hover  {
  color: var(--hover-gray);
}

#menu a:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 2px;
  background-color: rgba(255, 255, 255, 0.05);
}

input[type="number"] {
  background: #fff;
  color: #000;
  width: 60px;
  padding: 4px;
  border-radius: 4px;
}
button#start {
  margin-top: 12px;
}
button#start:hover {
  background-color: var(--color-2);
  color: var(--background-dark);
}
button#start:active {
  transform: scale(0.96);
}
/* Course list (meditation items) - semantic button approach */
#list {
  list-style-type: none;
  padding: 0;
}

/* List item container */
#list li, .meditation-list-item {
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start; /* Don't stretch buttons vertically */
}

/* Main meditation button - takes most space */
.meditation-item-btn {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-gray);
  padding: 15px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 1.05em;
  font-family: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Favorite button - separate button, fixed size */
.favorite-star-btn {
  position: relative; /* Required for ::before touch area expansion */
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-gray);
  padding: 15px 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 1.2em;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}

/* Light theme */
[data-theme="light"] .meditation-item-btn,
[data-theme="light"] .favorite-star-btn {
  background-color: rgba(0, 0, 0, 0.08);
  color: var(--text-gray);
}

/* Hover states - only on non-touch devices */
@media (hover: hover) {
  .meditation-item-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
  }

  .favorite-star-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
  }

  [data-theme="light"] .meditation-item-btn:hover,
  [data-theme="light"] .favorite-star-btn:hover {
    background-color: rgba(0, 0, 0, 0.12);
  }
}

/* Active state for touch feedback */
.meditation-item-btn:active {
  background-color: rgba(255, 255, 255, 0.15);
}

.favorite-star-btn:active {
  background-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .meditation-item-btn:active,
[data-theme="light"] .favorite-star-btn:active {
  background-color: rgba(0, 0, 0, 0.10);
}

/* Timer page range inputs */
input[type="range"]#minutes,
input[type="range"]#bell,
input[type="range"]#ambient-volume {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
}

/* Green styling for timer page sliders and ambient volume slider */
input[type="range"]#minutes::-webkit-slider-thumb,
input[type="range"]#bell::-webkit-slider-thumb,
input[type="range"]#ambient-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--sage-green);
  cursor: pointer;
  margin-top: -6px;
}

input[type="range"]#minutes::-webkit-slider-runnable-track,
input[type="range"]#bell::-webkit-slider-runnable-track,
input[type="range"]#ambient-volume::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--sage-green-alpha-40);
  border-radius: 2px;
}

input[type="range"]#minutes::-moz-range-thumb,
input[type="range"]#bell::-moz-range-thumb,
input[type="range"]#ambient-volume::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--sage-green);
  cursor: pointer;
  border: none;
}

input[type="range"]#minutes::-moz-range-track,
input[type="range"]#bell::-moz-range-track,
input[type="range"]#ambient-volume::-moz-range-track {
  height: 4px;
  background: var(--sage-green-alpha-40);
  border-radius: 2px;
}

/* Timer modal range slider - make it full width */
#range {
  flex: 1;
  width: 100%;
}


/* ===============================================
   MOBILE IMPROVEMENTS
=============================================== */

/* Tablet touch targets (769px-1024px: iPad, Surface) - comfortable, not too large */
@media (min-width: 769px) and (max-width: 1024px) {
  .course-panel,
  .meditation-item-btn {
    padding: 16px;
    min-height: 56px;
  }

  .favorite-star-btn {
    padding: 16px 12px;
  }

  .back-button {
    padding: 10px 14px;
    min-height: 40px;
  }

  .close-audio,
  .favorite-btn,
  .share-btn {
    font-size: 30px;
    min-width: 40px;
    min-height: 40px;
  }

  .favorite-star-btn {
    min-width: 36px;
    min-height: 36px;
    font-size: 21px;
  }
}

/* Mobile touch targets (≤768px: phones) - minimum 44x44px for accessibility */
@media (max-width: 768px) {
  .audio-control-btn,
  .timer-start-btn {
    width: 50px;
    height: 50px;
    font-size: 1.1em;
  }

  .audio-control-btn img {
    width: 28px;
    height: 28px;
  }

  #play {
    width: 60px;
    height: 60px;
  }

  #play img {
    width: 32px;
    height: 32px;
  }

  .close-audio {
    font-size: 36px;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
  }

  .course-panel,
  .meditation-item-btn {
    padding: 18px;
    min-height: 60px;
  }

  .favorite-star-btn {
    padding: 18px 14px;
    min-height: 60px;
  }

  .back-button {
    padding: 12px 16px;
    min-height: 44px;
  }

  #menu ul li a {
    padding: 5px 10px;
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  /* Mobile homepage adjustments */
  .home-header {
    padding: 0 15px 5px; /* No top padding - #content provides it */
    margin-bottom: 0;
  }

  .home-logo {
    font-size: 1.8em;
  }

  .welcome-section {
    margin-top: 0;
  }

  .welcome-message {
    padding: 0 15px;
    margin-bottom: 0;
  }

  .welcome-title {
    font-size: 1.5em;
    margin-bottom: 12px;
  }

  .welcome-text {
    font-size: 0.95em;
    line-height: 1.6;
  }
}

/* Prevent text selection on interactive cards */
.course-panel, .course-card, .meditation-item-btn, .favorite-star-btn {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile touch feedback */
@media (hover: none) and (pointer: coarse) {
  /* Enhanced touch states for mobile */
  button:active,
  .course-panel:active,
  .course-card:active,
  .meditation-item-btn:active,
  .audio-control-btn:active,
  .player-control-toggle:active {
    transform: scale(0.96);
    opacity: 0.9;
  }

  .favorite-btn:active,
  .share-btn:active,
  .close-audio:active,
  .favorite-star-btn:active {
    transform: scale(0.9);
  }

  /* Larger touch area for small buttons */
  .favorite-btn::before,
  .share-btn::before,
  .close-audio::before,
  .favorite-star-btn::before,
  .remove-favorite-btn::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
  }

  /* Visual feedback on touch */
  .course-card:active {
    background-color: rgba(255, 255, 255, 0.12);
  }

  /* Better range slider for touch */
  input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -8px;
  }

  input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
  }
}

/* Improve input visibility on mobile */
input[type="range"] {
  min-height: 44px;
  cursor: pointer;
  touch-action: none; /* Prevents accidental scrolling */
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
  /* Safari mobile address bar fix - set height to fill available space */
  height: 100%;
  height: -webkit-fill-available;
  height: 100dvh; /* Dynamic viewport height */
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* iOS safe area support for notch/dynamic island devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  #menu {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  /* Modal content safe areas */
  .audio-modal-content,
  .breathing-modal-content {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(30px, env(safe-area-inset-bottom));
  }

  /* Timer modal safe area */
  #timer-modal .audio-modal-content {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(30px, env(safe-area-inset-bottom));
  }

  /* Install banner safe area */
  .install-banner {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* ===============================================
   BREADCRUMBS
=============================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 0.9em;
  color: var(--text-gray);
}

.breadcrumb a {
  color: var(--highlight-color);
  text-decoration: none;
  transition: color 0.3s;
}

.breadcrumb a:hover {
  color: var(--color-2);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--text-gray);
}

.breadcrumb-current {
  color: var(--text-light);
}

/* ===============================================
   PROGRESS INDICATORS
=============================================== */
.meditation-title {
  flex: 1;
}

.meditation-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-icon {
  font-size: 1.2em;
  min-width: 24px;
  text-align: center;
}

.meditation-list-item.completed .meditation-item-btn {
  border-left: 4px solid var(--highlight-color);
}

.meditation-list-item.completed .progress-icon {
  color: var(--highlight-color);
}

.meditation-list-item.in-progress .meditation-item-btn {
  border-left: 4px solid var(--color-2);
}

.meditation-list-item.in-progress .progress-icon {
  color: var(--color-2);
}

.meditation-duration {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9em;
}

/* ===============================================
   SKELETON LOADING STATES
=============================================== */
@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.skeleton {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  border-radius: 4px;
}

.skeleton-course {
  height: 80px;
  margin-bottom: 20px;
}

.skeleton-meditation {
  height: 60px;
  margin-bottom: 10px;
}

.skeleton-text {
  height: 20px;
  margin-bottom: 10px;
}

/* ===============================================
   PAGE TRANSITIONS & ANIMATIONS
=============================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes countdownPulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

#content {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-panel,
.course-card,
.meditation-list-item {
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.course-panel:nth-child(1),
.course-card:nth-child(1) { animation-delay: 0.05s; }
.course-panel:nth-child(2),
.course-card:nth-child(2) { animation-delay: 0.1s; }
.course-panel:nth-child(3),
.course-card:nth-child(3) { animation-delay: 0.15s; }
.course-panel:nth-child(4),
.course-card:nth-child(4) { animation-delay: 0.2s; }
.course-panel:nth-child(5),
.course-card:nth-child(5) { animation-delay: 0.25s; }

.meditation-list-item:nth-child(1) { animation-delay: 0.05s; }
.meditation-list-item:nth-child(2) { animation-delay: 0.1s; }
.meditation-list-item:nth-child(3) { animation-delay: 0.15s; }
.meditation-list-item:nth-child(4) { animation-delay: 0.2s; }
.meditation-list-item:nth-child(5) { animation-delay: 0.25s; }
.meditation-list-item:nth-child(6) { animation-delay: 0.3s; }
.meditation-list-item:nth-child(7) { animation-delay: 0.35s; }
.meditation-list-item:nth-child(8) { animation-delay: 0.4s; }

/* Smooth modal transitions */
.audio-modal {
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.audio-modal-content {
  animation: slideInFromBottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
}

/* Ripple effect removed for cleaner desktop experience */

/* Smooth hover transitions */
.course-card,
.meditation-item-btn,
.favorite-star-btn,
.stat-card,
.recent-item {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.3s ease;
}

button,
.audio-control-btn,
.player-control-toggle,
.speed-btn,
.sleep-timer-btn,
.ambient-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Menu slide animation */
#menu.show {
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger animations for lists */
@media (prefers-reduced-motion: no-preference) {
  .stats-grid > * {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  }

  .stats-grid > *:nth-child(1) { animation-delay: 0.05s; }
  .stats-grid > *:nth-child(2) { animation-delay: 0.1s; }
  .stats-grid > *:nth-child(3) { animation-delay: 0.15s; }
  .stats-grid > *:nth-child(4) { animation-delay: 0.2s; }
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Connection Status Banner */
.connection-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: var(--z-error-banner);
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95em;
  font-weight: 500;
  min-width: 280px;
  max-width: 90vw;
}

.connection-banner.show {
  transform: translateX(-50%) translateY(0);
}

.connection-banner.offline {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

.connection-banner.online {
  background: linear-gradient(135deg, var(--sage-green) 0%, var(--sage-green-light) 100%);
  color: #ffffff;
}

.connection-banner.error {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: #ffffff;
}

.connection-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.connection-icon {
  font-size: 1.2em;
  line-height: 1;
}

.connection-text {
  line-height: 1.4;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .connection-banner {
    font-size: 0.85em;
    padding: 10px 20px;
    min-width: 240px;
  }
}

/* Error Banner */
.error-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: var(--z-error-banner);
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  max-width: 90vw;
  font-size: 0.95em;
  opacity: 0;
  /* Move further up to hide shadow completely */
  transform: translateX(-50%) translateY(calc(-100% - 20px));
}

.error-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.error-icon {
  font-size: 1.4em;
  line-height: 1;
  flex-shrink: 0;
}

.error-message {
  flex: 1;
  line-height: 1.4;
  font-weight: 500;
}

.error-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.error-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.error-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.error-btn:active:not(:disabled) {
  transform: translateY(0);
}

.error-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5em;
  line-height: 1;
  padding: 4px 8px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.error-retry-btn {
  padding: 6px 16px;
}

/* Mobile adjustments for error banner */
@media (max-width: 768px) {
  .error-banner {
    font-size: 0.85em;
    padding: 12px 16px;
    min-width: 280px;
    gap: 10px;
  }

  .error-actions {
    gap: 6px;
  }

  .error-btn {
    padding: 5px 12px;
    font-size: 0.85em;
  }
}

/* PWA Install Banner */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  z-index: var(--z-install-banner);
  background: linear-gradient(135deg, var(--color-1) 0%, var(--color-2) 100%);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 500px;
  width: 90%;
}

.install-banner.show {
  transform: translateX(-50%) translateY(0);
}

.install-banner-content {
  position: relative;
  padding: 20px;
  padding-right: 55px; /* Space for close button (36px + 8px offset + margin) */
  display: flex;
  align-items: center;
  gap: 15px;
}

.install-banner-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.install-banner-close:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Ensure proper touch target on mobile */
@media (max-width: 768px) {
  .install-banner-close {
    width: 44px;
    height: 44px;
    top: 4px;
    right: 4px;
  }
}

.install-banner-icon {
  font-size: 2.5em;
  line-height: 1;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
}

.install-banner-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.install-banner-subtitle {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.85);
}

.install-banner-button {
  background: #ffffff;
  color: var(--color-4);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  font-family: inherit;
}

.install-banner-button:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.install-banner-button:active {
  transform: scale(0.98);
}

/* Mobile adjustments for install banner (≤768px: phones) */
@media (max-width: 768px) {
  .install-banner-content {
    flex-wrap: wrap;
    padding: 18px 15px;
    padding-right: 15px; /* Reset desktop padding-right */
    gap: 12px;
  }

  .install-banner-icon {
    font-size: 2em;
  }

  .install-banner-button {
    width: 100%;
    margin-top: 5px;
  }
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--highlight-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-large {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-install-banner);
  animation: fadeIn 0.2s ease-out;
}

.loading-overlay-content {
  background: var(--menu-dark-green);
  padding: 30px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.loading-overlay-text {
  color: var(--text-gray);
  font-size: 1.1em;
  font-weight: 500;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  margin: 20px 0;
  animation: fadeIn 0.4s ease-out;
}

.empty-state p {
  color: var(--text-gray);
  font-size: 1em;
  margin: 0;
  opacity: 0.8;
  line-height: 1.6;
}

.empty-state-icon {
  font-size: 3em;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* ===============================================
   SETTINGS SECTION (ACCOUNT PAGE)
=============================================== */
.settings-section {
  margin-bottom: 35px;
}

.settings-section h3 {
  color: var(--text-gray);
  font-size: 1.3em;
  margin-bottom: 20px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.2s;
}

.setting-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.setting-link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.setting-link-item:hover {
  color: var(--sage-green);
}

.setting-arrow {
  font-size: 1.8em;
  color: var(--text-gray);
  opacity: 0.5;
  transition: all 0.2s;
  margin-left: 10px;
}

.setting-link-item:hover .setting-arrow {
  opacity: 1;
  color: var(--sage-green);
  transform: translateX(3px);
}

.setting-info {
  flex: 1;
  min-width: 0;
}

.setting-info label {
  display: block;
  color: var(--text-gray);
  font-size: 1.05em;
  font-weight: 600;
  margin-bottom: 4px;
  cursor: pointer;
}

.setting-description {
  color: var(--text-gray);
  font-size: 0.85em;
  opacity: 0.7;
  margin: 0;
  line-height: 1.4;
}

.setting-toggle-btn {
  background-color: var(--sage-green-dark);
  color: var(--text-light);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  min-width: 110px;
  font-weight: 600;
}

.setting-toggle-btn:hover {
  background-color: var(--sage-green);
  transform: scale(1.05);
}

.setting-toggle-btn:active {
  transform: scale(0.98);
}

.setting-toggle-btn.active {
  background-color: var(--highlight-color);
}

.setting-select {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 160px;
  font-weight: 500;
  appearance: none; /* Remove default arrow */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237ca882' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  padding-right: 45px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-family: inherit;
  line-height: 1.5;
}

.setting-select:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--sage-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 168, 130, 0.2);
}

.setting-select:active {
  transform: translateY(0);
}

.setting-select:focus {
  outline: none;
  border-color: var(--sage-green);
  box-shadow: 0 0 0 3px var(--sage-green-alpha-30), 0 2px 12px rgba(124, 168, 130, 0.25);
  background-color: rgba(255, 255, 255, 0.12);
}

.setting-select option {
  background-color: #2C2C2C;
  color: var(--text-light);
  padding: 10px;
  font-weight: 500;
}

/* Mobile adjustments for settings (≤768px: phones) */
@media (max-width: 768px) {
  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .setting-toggle-btn {
    width: 100%;
    padding: 12px 20px;
  }

  .setting-select {
    width: 100%;
    padding: 14px 45px 14px 15px;
    font-size: 1em;
    min-height: 48px; /* Better touch target */
  }
}

/* ===============================================
   THEME TOGGLE (Legacy - kept for compatibility)
=============================================== */
.theme-toggle-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.theme-toggle-container label {
  color: var(--text-light);
  font-size: 1em;
}

.theme-toggle-btn {
  background-color: var(--color-1);
  color: var(--text-light);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle-btn:hover {
  background-color: var(--color-2);
  transform: scale(1.05);
}

.theme-toggle-btn:active {
  transform: scale(0.98);
}

/* ===============================================
   STATISTICS PAGE
=============================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.stat-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-value {
  font-size: 2em;
  font-weight: bold;
  color: var(--highlight-color);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9em;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-item {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 12px 15px;
  margin-bottom: 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 3px solid var(--highlight-color);
  transition: background-color 0.2s;
}

.recent-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.recent-title {
  flex: 1;
  font-size: 1em;
}

.recent-time {
  color: var(--text-gray);
  font-size: 0.85em;
  white-space: nowrap;
  margin-left: 15px;
}

.reset-button {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-gray);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s;
}

.reset-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.3);
}

.reset-button:active {
  transform: scale(0.98);
}

/* Mobile adjustments for stats grid (≤768px: phones) */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-value {
    font-size: 1.5em;
  }
}

/* ===============================================
   FAVORITES / LIBRARY PAGE
=============================================== */
#favorites-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.favorite-item {
  position: relative;
}

.remove-favorite-btn {
  background: none;
  border: none;
  color: var(--text-gray);
  font-size: 24px;
  cursor: pointer;
  padding: 0 8px;
  transition: color 0.2s, transform 0.2s;
  line-height: 1;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.remove-favorite-btn:hover {
  color: var(--color-red-error);
  transform: scale(1.2);
}

.remove-favorite-btn:active {
  transform: scale(1.1);
}

/* Ensure proper touch target on mobile */
@media (max-width: 768px) {
  .remove-favorite-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 26px;
  }
}

/* ===============================================
   FAVORITE STAR IN MEDITATION ITEMS
=============================================== */
.favorite-star-btn {
  background: none;
  border: none;
  color: var(--color-2);
  font-size: 20px;
  cursor: pointer;
  padding: 0 6px;
  transition: color 0.2s, transform 0.2s;
  line-height: 1;
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.favorite-star-btn:hover {
  color: var(--color-gold);
  transform: scale(1.15);
}

.favorite-star-btn:active {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .favorite-star-btn {
    font-size: 22px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* ===============================================
   MODE TABS (TIMER & BREATHING)
=============================================== */
.mode-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
}

.mode-tab {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-gray);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  font-weight: 500;
}

.mode-tab:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--color-2);
  transform: translateY(-2px);
}

.mode-tab.active {
  background-color: var(--sage-green-alpha-30);
  color: var(--text-light);
  border-color: var(--sage-green);
}

.mode-tab:active {
  transform: scale(0.98);
}

.mode-content {
  animation: fadeIn 0.3s ease-out;
}

/* ===============================================
   BREATHING PRESETS
=============================================== */
.breathing-presets {
  margin-bottom: 30px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  max-width: 600px;
  margin: 0 auto;
}

.breath-preset-btn {
  background-color: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 20px 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.breath-preset-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--color-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.breath-preset-btn.active {
  background-color: var(--sage-green-alpha-30);
  border-color: var(--sage-green);
}

.breath-preset-btn:active {
  transform: scale(0.98);
}

.preset-icon {
  width: 32px;
  height: 32px;
  color: var(--sage-green);
  flex-shrink: 0;
}

.breath-preset-btn.active .preset-icon {
  color: var(--sage-green-light);
}

.preset-name {
  font-size: 0.95em;
  font-weight: 500;
  color: var(--text-gray);
  text-align: center;
  line-height: 1.3;
}

.breath-preset-btn.active .preset-name {
  color: var(--text-light);
  font-weight: 600;
}

.preset-rhythm {
  font-size: 0.85em;
  color: var(--sage-green);
  font-weight: 600;
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 1px;
}

.breath-preset-btn.active .preset-rhythm {
  color: var(--sage-green-light);
}

.breathing-duration {
  margin-bottom: 25px;
}

.breathing-duration .timer-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0;
}

.breathing-duration label {
  font-weight: bold;
  color: var(--text-light);
  margin: 0;
}

.breathing-duration input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
}

/* Green styling for breathing duration slider */
.breathing-duration input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--sage-green);
  cursor: pointer;
  margin-top: -6px;
}

.breathing-duration input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--sage-green-alpha-40);
  border-radius: 2px;
}

.breathing-duration input[type="range"]::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--sage-green);
  cursor: pointer;
  border: none;
}

.breathing-duration input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--sage-green-alpha-40);
  border-radius: 2px;
}

.breathing-duration .timer-value {
  color: var(--text-gray);
  font-size: 0.95em;
}

/* Mobile adjustments for presets (≤768px: phones) */
@media (max-width: 768px) {
  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .breath-preset-btn {
    padding: 15px 10px;
  }

  .preset-icon {
    width: 28px;
    height: 28px;
  }

  .preset-name {
    font-size: 0.9em;
  }

  .preset-rhythm {
    font-size: 0.8em;
  }
}

/* ===============================================
   BREATHING VISUALIZER
=============================================== */
.breathing-modal-content {
  max-width: 500px;
}

.breathing-subtitle {
  text-align: center;
  font-size: 1.2em;
  color: var(--highlight-color);
  margin-bottom: 30px;
  font-weight: 600;
}

.breathing-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 350px;
  margin: 20px 0;
}

.breathing-circle {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-1), var(--color-2));
  box-shadow:
    0 0 20px rgba(168, 208, 141, 0.3),
    0 0 40px rgba(168, 208, 141, 0.2),
    0 0 60px rgba(168, 208, 141, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1);
  transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
}

.breathing-circle-inner {
  position: absolute;
  width: 85%;
  height: 85%;
  border-radius: 50%;
  background: var(--menu-dark-green);
  z-index: var(--z-base);
}

.breathing-text {
  position: relative;
  z-index: 2;
  font-size: 1.3em;
  font-weight: 600;
  color: var(--text-gray);
  text-align: center;
  padding: 0 20px;
}

/* Breathing animation states */
.breathing-circle.inhale {
  transform: scale(1.8);
}

.breathing-circle.exhale {
  transform: scale(1);
}

/* Pulse effect for breathing circle */
@keyframes breathePulse {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(168, 208, 141, 0.3),
      0 0 40px rgba(168, 208, 141, 0.2),
      0 0 60px rgba(168, 208, 141, 0.1);
  }
  50% {
    box-shadow:
      0 0 30px rgba(168, 208, 141, 0.5),
      0 0 60px rgba(168, 208, 141, 0.3),
      0 0 90px rgba(168, 208, 141, 0.2);
  }
}

.breathing-circle {
  animation: breathePulse 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Breathing hint text */
.breathing-hint {
  color: var(--text-gray);
  font-size: 0.9em;
  opacity: 0.8;
  margin: 5px 0 10px 0;
  font-style: italic;
}

/* Square breathing visualization */
.breathing-square {
  display: block;
  margin: 0 auto;
}

.breathing-square-outline {
  opacity: 0.6;
}

.breathing-square-light {
  filter: drop-shadow(0 0 8px var(--sage-green));
  transition: cx 4s linear, cy 4s linear;
}

.breathing-text-svg {
  font-size: 18px;
  font-weight: 600;
  fill: var(--text-gray);
  text-align: center;
}

/* Breathing text container for square mode */
.breathing-text-container {
  text-align: center;
  margin-top: 20px;
  min-height: 30px;
}

/* Install Section */
.install-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.install-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--sage-green);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  font-family: inherit;
}

.install-button:hover {
  background: var(--sage-green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.install-button:active {
  transform: translateY(0);
}

.install-icon {
  font-size: 1.3em;
  line-height: 1;
}

.store-button {
  background: #414141;
}

.store-button:hover {
  background: #2a2a2a;
}

/* Accordion/Collapsible sections */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.accordion-header {
  width: 100%;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  color: var(--text-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.accordion-header[aria-expanded="true"] {
  background: rgba(168, 208, 141, 0.1);
}

.accordion-icon {
  font-size: 1.3em;
  flex-shrink: 0;
}

.accordion-title {
  flex: 1;
  font-weight: 600;
  font-size: 1.05em;
}

.accordion-chevron {
  font-size: 0.8em;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.accordion-header[aria-expanded="true"] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 20px;
}

.accordion-content > *:first-child {
  margin-top: 15px;
}

.accordion-content > *:last-child {
  margin-bottom: 15px;
}

/* Mobile adjustments for breathing visualizer (≤768px: phones) */
@media (max-width: 768px) {
  .breathing-container {
    /* Removed min-height constraint for fullscreen modal */
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
  }

  .breathing-circle {
    width: 200px; /* Increased from 160px for better visibility on fullscreen */
    height: 200px;
  }

  .breathing-text {
    font-size: 1.2em; /* Slightly larger for fullscreen */
  }

  .breathing-text-svg {
    font-size: 16px; /* Increased from 14px */
  }

  .breathing-square {
    width: 280px; /* Increased from 240px for fullscreen */
    height: 280px;
  }

  .breathing-subtitle {
    font-size: 1em;
  }

  .accordion-header {
    padding: 12px 15px;
  }

  .accordion-icon {
    font-size: 1.1em;
  }

  .accordion-title {
    font-size: 0.95em;
  }

  .accordion-content {
    padding: 0 15px;
  }
}

/* ===============================================
   AMBIENT SOUNDS
=============================================== */
.ambient-sounds-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ambient-btn {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-gray);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 10px 8px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ambient-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--color-2);
  transform: translateY(-1px);
}

.ambient-btn.active {
  background-color: var(--color-1);
  color: #ffffff;
  border-color: var(--color-1);
  font-weight: 600;
}

.ambient-btn:active {
  transform: scale(0.96);
}

.ambient-icon {
  font-size: 1.5em;
  line-height: 1;
}

.ambient-name {
  font-size: 0.8em;
  line-height: 1.2;
  text-align: center;
}

/* Mobile adjustments for ambient sounds (≤768px: phones) */
@media (max-width: 768px) {
  .ambient-sounds-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .ambient-btn {
    padding: 8px 6px;
    min-height: 60px;
  }

  .ambient-icon {
    font-size: 1.3em;
  }

  .ambient-name {
    font-size: 0.75em;
  }
}

/* ---------------------------------------
  Track Type Badges
---------------------------------------- */

.track-type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7em;
  font-weight: 500;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
  transition: all 0.2s;
  /* Subtle grey styling - unified for all types */
  background: rgba(128, 128, 128, 0.12);
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(128, 128, 128, 0.18);
}

/* Light theme adjustments */
[data-theme="light"] .track-type-badge {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(0, 0, 0, 0.10);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .track-type-badge {
    font-size: 0.65em;
    padding: 2px 6px;
    margin-left: 4px;
  }
}

/* ---------------------------------------
  Search Page
---------------------------------------- */
.search-page {
  padding: 20px;
}

.search-input-wrapper {
  margin: 20px 0 30px 0;
}

.search-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid rgba(124, 168, 130, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  font-size: 1em;
  font-family: inherit;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--sage-green);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(124, 168, 130, 0.15);
}

.search-input::placeholder {
  color: var(--text-gray);
  opacity: 0.6;
}

.search-results-header {
  margin-bottom: 15px;
  color: var(--text-gray);
  font-size: 0.9em;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(124, 168, 130, 0.3);
  transform: translateX(2px);
}

.search-result-item:focus {
  outline: 2px solid var(--sage-green);
  outline-offset: 2px;
}

.search-result-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  color: var(--text-light);
  font-size: 1em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-course {
  font-size: 0.85em;
  color: var(--text-gray);
  opacity: 0.8;
}

.search-result-meta {
  font-size: 0.8em;
  color: var(--sage-green);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-result-meta .type-badge {
  background: rgba(124, 168, 130, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

.search-result-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(124, 168, 130, 0.2);
  border: 1px solid rgba(124, 168, 130, 0.3);
  color: var(--sage-green);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.search-result-play:hover {
  background: var(--sage-green);
  color: white;
  transform: scale(1.1);
}

/* Search page header with filter button */
.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.filter-toggle-btn {
  display: none; /* Hidden on desktop */
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.filter-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(124, 168, 130, 0.3);
}

.filter-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--sage-green);
  color: white;
  font-size: 0.75em;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Search content layout */
.search-content {
  display: flex;
  gap: 30px;
}

/* Filter sidebar */
.filter-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  position: sticky;
  top: 20px;
}

.filter-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-sidebar-header h3 {
  margin: 0;
  font-size: 1.1em;
  color: var(--text-light);
  font-weight: 600;
}

.clear-filters-btn {
  background: none;
  border: 1px solid rgba(124, 168, 130, 0.3);
  color: var(--sage-green);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-filters-btn:hover:not(:disabled) {
  background: rgba(124, 168, 130, 0.1);
  border-color: var(--sage-green);
}

.clear-filters-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Filter logic toggle */
.filter-logic-toggle {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-logic-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.filter-logic-toggle label:hover {
  background: rgba(255, 255, 255, 0.05);
}

.filter-logic-toggle input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.filter-logic-toggle span {
  font-size: 0.9em;
  color: var(--text-light);
}

/* Filter categories */
.filter-tags-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.filter-category {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 15px;
}

.filter-category:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.filter-category-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.2s;
}

.filter-category-header:hover {
  opacity: 0.8;
}

.filter-category-header span {
  font-weight: 600;
}

.category-chevron {
  transition: transform 0.2s;
}

.filter-category-header[aria-expanded="false"] .category-chevron {
  transform: rotate(-90deg);
}

.filter-category-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

/* Filter tag labels */
.filter-tag-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.filter-tag-label:hover {
  background: rgba(255, 255, 255, 0.05);
}

.filter-tag-checkbox {
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-tag-icon {
  font-size: 1.1em;
  flex-shrink: 0;
}

.filter-tag-name {
  flex: 1;
  font-size: 0.9em;
  color: var(--text-light);
}

.filter-tag-count {
  font-size: 0.8em;
  color: var(--text-gray);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 24px;
  text-align: center;
}

/* Search main area */
.search-main {
  flex: 1;
  min-width: 0;
}

/* Mobile adjustments for search page (≤768px: phones) */
@media (max-width: 768px) {
  .search-page {
    padding: 15px;
  }

  .filter-toggle-btn {
    display: flex; /* Show filter button on mobile */
  }

  .search-content {
    flex-direction: column;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    max-height: 100vh;
    z-index: 1000;
    padding: 20px;
    border-radius: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
    background: var(--bg-dark);
  }

  .filter-sidebar.open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  }

  .search-result-item {
    padding: 12px;
    gap: 12px;
  }

  .search-result-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .search-result-play {
    width: 38px;
    height: 38px;
  }

  .search-result-title {
    font-size: 0.95em;
  }
}

/* ===============================================
   AUTHENTICATION / ACCOUNT SYNC SECTION
=============================================== */
.auth-section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
}

.auth-section h2 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--text-light);
  font-size: 1.5em;
}

.auth-description {
  color: var(--text-gray);
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 25px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  font-size: 1em;
  font-family: inherit;
  transition: all 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--sage-green);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(124, 168, 130, 0.15);
}

.auth-input::placeholder {
  color: var(--text-gray);
  opacity: 0.6;
}

.auth-button {
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-button.primary {
  background: var(--sage-green);
  color: white;
  border: 1px solid var(--sage-green);
}

.auth-button.primary:hover:not(:disabled) {
  background: var(--sage-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 168, 130, 0.3);
}

.auth-button.primary:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-button.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-gray);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-button.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.3);
}

.auth-button.google {
  background: white;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  font-weight: 500;
  gap: 12px;
}

.auth-button.google svg {
  flex-shrink: 0;
}

.auth-button.google:hover:not(:disabled) {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-color: #d2d3d4;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 8px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.auth-divider span {
  padding: 0 15px;
  color: var(--text-gray);
  font-size: 0.9em;
  opacity: 0.7;
}

.auth-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9em;
  line-height: 1.5;
  margin-top: 8px;
}

.auth-message.error {
  background: rgba(244, 67, 54, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.auth-message.success {
  background: rgba(76, 175, 80, 0.15);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.auth-privacy {
  color: var(--text-gray);
  font-size: 0.85em;
  opacity: 0.8;
  margin-top: 8px;
  text-align: center;
  line-height: 1.5;
}

/* Signed-in user profile */
.auth-section.signed-in {
  background: linear-gradient(135deg, rgba(124, 168, 130, 0.1), rgba(124, 168, 130, 0.05));
  border-color: rgba(124, 168, 130, 0.2);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.user-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-label {
  font-weight: 500;
  color: var(--text-gray);
  font-size: 0.95em;
  opacity: 0.9;
}

.user-value {
  color: var(--text-light);
  font-size: 0.95em;
  font-weight: 500;
  text-align: right;
}

/* Mobile adjustments for auth section (≤768px: phones) */
@media (max-width: 768px) {
  .auth-section {
    padding: 20px;
  }

  .auth-form {
    max-width: 100%;
  }

  .user-detail {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .user-label {
    min-width: auto;
  }
}

/* ===============================================
   MOBILE HEADER & BOTTOM NAVIGATION
=============================================== */

/* Mobile Header */
.mobile-header {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--menu-dark-green);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mobile-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-gray);
  text-decoration: none;
  transition: color 0.2s;
}

.mobile-search-btn:hover {
  color: var(--sage-green);
}

.mobile-search-btn svg {
  width: 24px;
  height: 24px;
}

/* Bottom Navigation */
.bottom-nav {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 65px;
  background: var(--menu-dark-green);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: var(--z-modal);
  padding-bottom: 0; /* Fallback for browsers without safe-area support */
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);

  /* Safari mobile address bar fix */
  /* Ensure bottom nav stays at the visual viewport bottom, not layout viewport */
  /* The combination of position:fixed and these properties prevents jumping */
  transform: translateZ(0); /* Force GPU acceleration and separate layer */
  -webkit-transform: translateZ(0);
  will-change: transform; /* Hint to browser for optimization */
}

/* Extend green background below nav bar to prevent page content showing during viewport changes */
.bottom-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px; /* Green buffer extending below */
  background: var(--menu-dark-green);
  transform: translateY(100%); /* Position it below the nav bar */
  z-index: -1; /* Behind the nav bar content */
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-gray);
  opacity: 0.7;
  transition: all 0.2s;
  padding: 12px 4px;
  position: relative;
}

.bottom-nav-item:hover {
  opacity: 1;
  color: var(--sage-green);
}

.bottom-nav-item.active {
  opacity: 1;
  color: var(--sage-green);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--sage-green);
  border-radius: 0 0 3px 3px;
}

.bottom-nav-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

/* Mobile Layout with Bottom Navigation (≤768px: phones) */
@media (max-width: 768px) {
  /* Hide mobile header (not needed with bottom nav) */
  .mobile-header {
    display: none !important;
  }

  /* Show bottom navigation */
  .bottom-nav {
    display: flex;
  }

  /* Hide desktop sidebar */
  #menu {
    transform: translateX(-100%);
  }

  #menu.show {
    transform: translateX(0);
  }

  /* No padding needed at top since no header */
  #container {
    padding-top: 0;
  }

  main#content {
    padding-bottom: 65px; /* Fallback for browsers without safe-area support */
    padding-bottom: calc(65px + env(safe-area-inset-bottom));
  }

  /* Adjust modal positioning if needed */
  #modal-root .modal {
    bottom: 65px; /* Fallback for browsers without safe-area support */
    bottom: calc(65px + env(safe-area-inset-bottom));
  }
}

/* Desktop & Tablet Layout (≥769px: tablets & desktops) */
@media (min-width: 769px) {
  /* Hide mobile-only elements */
  .mobile-header {
    display: none !important;
  }

  .bottom-nav {
    display: none !important;
  }

  /* Hide home page header on desktop (sidebar already shows Ticho) */
  .home-header {
    display: none;
  }
}

/* ---------------------------------------
  Toast Notifications
---------------------------------------- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95em;
  font-weight: 500;
  color: white;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0);
  min-width: 250px;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-success {
  background: var(--sage-green);
}

.toast-error {
  background: var(--color-red-error);
}

.toast-info {
  background: var(--color-gray-medium);
}

/* Mobile positioning */
@media (max-width: 768px) {
  .toast {
    bottom: 100px;
    min-width: 200px;
    font-size: 0.9em;
  }
}

/* ========================================
   TAG BADGE SYSTEM
   ======================================== */

/**
 * Base tag badge styles
 * Tags are color-coded by category with emoji icons
 */
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.75em;
  font-weight: 500;
  border: 1px solid;
  transition: all 0.2s ease;
  white-space: nowrap;
  vertical-align: middle;
}

.tag-icon {
  font-size: 1.1em;
  line-height: 1;
}

.tag-label {
  line-height: 1;
}

/* Tag sizes */
.tag-size-small {
  padding: 2px 6px;
  font-size: 0.65em;
  gap: 3px;
}

.tag-size-medium {
  padding: 4px 10px;
  font-size: 0.75em;
  gap: 4px;
}

.tag-size-large {
  padding: 6px 14px;
  font-size: 0.85em;
  gap: 5px;
}

/* Clickable tags */
.tag-clickable {
  cursor: pointer;
}

.tag-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tag-clickable:active {
  transform: translateY(0);
}

.tag-clickable:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
   TAG CATEGORIES - Color Coding
   ======================================== */

/* Technique tags - Blue */
.tag-technique {
  background: rgba(74, 144, 226, 0.15);
  border-color: rgba(74, 144, 226, 0.3);
  color: #4A90E2;
}

.tag-technique:hover {
  background: rgba(74, 144, 226, 0.25);
  border-color: rgba(74, 144, 226, 0.5);
}

/* Support tags - Green */
.tag-support {
  background: rgba(126, 211, 33, 0.15);
  border-color: rgba(126, 211, 33, 0.3);
  color: #7ED321;
}

.tag-support:hover {
  background: rgba(126, 211, 33, 0.25);
  border-color: rgba(126, 211, 33, 0.5);
}

/* Purpose tags - Orange */
.tag-purpose {
  background: rgba(245, 166, 35, 0.15);
  border-color: rgba(245, 166, 35, 0.3);
  color: #F5A623;
}

.tag-purpose:hover {
  background: rgba(245, 166, 35, 0.25);
  border-color: rgba(245, 166, 35, 0.5);
}

/* Guidance tags - Purple */
.tag-guidance {
  background: rgba(144, 19, 254, 0.15);
  border-color: rgba(144, 19, 254, 0.3);
  color: #9013FE;
}

.tag-guidance:hover {
  background: rgba(144, 19, 254, 0.25);
  border-color: rgba(144, 19, 254, 0.5);
}

/* Level tags - Grey */
.tag-level {
  background: rgba(155, 155, 155, 0.15);
  border-color: rgba(155, 155, 155, 0.3);
  color: #9B9B9B;
}

.tag-level:hover {
  background: rgba(155, 155, 155, 0.25);
  border-color: rgba(155, 155, 155, 0.5);
}

/* ========================================
   LIGHT MODE ADJUSTMENTS
   ======================================== */

[data-theme="light"] .tag-technique {
  background: rgba(74, 144, 226, 0.1);
  border-color: rgba(74, 144, 226, 0.25);
  color: #2E6DB8;
}

[data-theme="light"] .tag-technique:hover {
  background: rgba(74, 144, 226, 0.2);
  border-color: rgba(74, 144, 226, 0.4);
}

[data-theme="light"] .tag-support {
  background: rgba(126, 211, 33, 0.1);
  border-color: rgba(126, 211, 33, 0.25);
  color: #5A9E1A;
}

[data-theme="light"] .tag-support:hover {
  background: rgba(126, 211, 33, 0.2);
  border-color: rgba(126, 211, 33, 0.4);
}

[data-theme="light"] .tag-purpose {
  background: rgba(245, 166, 35, 0.1);
  border-color: rgba(245, 166, 35, 0.25);
  color: #C17C1F;
}

[data-theme="light"] .tag-purpose:hover {
  background: rgba(245, 166, 35, 0.2);
  border-color: rgba(245, 166, 35, 0.4);
}

[data-theme="light"] .tag-guidance {
  background: rgba(144, 19, 254, 0.1);
  border-color: rgba(144, 19, 254, 0.25);
  color: #6B0FC2;
}

[data-theme="light"] .tag-guidance:hover {
  background: rgba(144, 19, 254, 0.2);
  border-color: rgba(144, 19, 254, 0.4);
}

[data-theme="light"] .tag-level {
  background: rgba(155, 155, 155, 0.1);
  border-color: rgba(155, 155, 155, 0.25);
  color: #666666;
}

[data-theme="light"] .tag-level:hover {
  background: rgba(155, 155, 155, 0.2);
  border-color: rgba(155, 155, 155, 0.4);
}

/* ========================================
   TAG LIST LAYOUT
   ======================================== */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

/* "Show more" button */
.tag-more {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7em;
  font-weight: 600;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-more:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .tag-more {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .tag-more:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.3);
  color: rgba(0, 0, 0, 0.7);
}

/* Tag count (non-expandable) */
.tag-count {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7em;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .tag-count {
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.4);
}

/* Hidden tags container */
.tag-hidden {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
}

.tag-hidden[hidden] {
  display: none;
}

/* ========================================
   TAG GROUPS (for player modal, filters)
   ======================================== */

.tag-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tag-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-group-label {
  font-size: 0.85em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="light"] .tag-group-label {
  color: rgba(0, 0, 0, 0.6);
}

.tag-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .tag-badge {
    font-size: 0.7em;
  }

  .tag-size-small {
    font-size: 0.6em;
    padding: 2px 5px;
  }

  .tag-size-medium {
    font-size: 0.7em;
    padding: 3px 8px;
  }

  .tag-size-large {
    font-size: 0.75em;
    padding: 5px 12px;
  }

  .tag-list {
    gap: 4px;
    margin-top: 6px;
  }

  .tag-groups {
    gap: 12px;
  }

  .tag-group {
    gap: 6px;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .tag-badge {
    border-width: 2px;
  }

  .tag-technique,
  .tag-support,
  .tag-purpose,
  .tag-guidance,
  .tag-level {
    background: transparent;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tag-badge,
  .tag-more,
  .tag-clickable {
    transition: none;
  }

  .tag-clickable:hover {
    transform: none;
  }
}

/* Search result tags */
.search-result-tags {
  margin-top: 8px;
}

.search-result-tags .tag-list {
  margin-top: 0;
}

.search-result-tags .tag-badge {
  font-size: 0.7em;
}

/* Player modal tags section */
.player-tags-section {
  margin-top: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-tags-header {
  margin: 0 0 12px 0;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.player-tags-section .tag-groups {
  gap: 12px;
}

.player-tags-section .tag-group {
  gap: 6px;
}

.player-tags-section .tag-group-label {
  font-size: 0.8em;
}

.player-tags-section .tag-badge {
  font-size: 0.75em;
}

@media (max-width: 768px) {
  .player-tags-section {
    margin-top: 15px;
    padding: 12px;
  }

  .player-tags-header {
    font-size: 0.9em;
  }

  .player-tags-section .tag-badge {
    font-size: 0.7em;
  }
}
