/* Dark Theme Overrides */
    .dark { --bg: #0F172A; }
    .dark body { background-color: #0F172A; color: #F1F5F9; }
    .dark .bg-\[\#F8FAFC\] { background-color: #0F172A !important; }
    .dark .bg-white { background-color: #1E293B !important; }
    .dark .border-slate-100\/80, .dark .border-slate-100, .dark .border-slate-200, .dark .border-slate-200\/80 { border-color: #334155 !important; }
    .dark .text-slate-900 { color: #F8FAFC !important; }
    .dark .text-slate-700 { color: #CBD5E1 !important; }
    .dark .text-slate-500 { color: #94A3B8 !important; }
    .dark .text-slate-400 { color: #64748B !important; }
    .dark .bg-slate-50 { background-color: #0F172A !important; }
    .dark .bg-slate-100 { background-color: #334155 !important; }

    /* Transitions & Utilities */
    .transition-fast { transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
    /* Entrance animation — PROGRESSIVE ENHANCEMENT ONLY. Visible by default; the
       fade-up runs only when motion is allowed, so `prefers-reduced-motion: reduce`
       no longer leaves the content invisible. */
    .fade-in-up { opacity: 1; }
    @keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
    @media (prefers-reduced-motion: no-preference) {
      .fade-in-up { animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
    }

    /* Touch-friendly controls */
    .settings-control-input, .settings-select {
      height: 44px;
      padding: 0 14px;
      border-radius: 12px;
      border: 1px solid #E2E8F0;
      background-color: #F8FAFC;
      /* 0.875rem (14px) made iOS Safari zoom the whole page on every field
         focus. 16px is the threshold below which it does not. */
      font-size: 1rem;
      font-weight: 500;
      color: #0F172A;
      outline: none;
      transition: all 0.15s ease;
      width: 100%;
    }
    .dark .settings-control-input, .dark .settings-select {
      background-color: #0F172A;
      border-color: #334155;
      color: #F8FAFC;
    }
    .settings-control-input:focus, .settings-select:focus {
      border-color: #2563EB;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }
    
    .settings-btn-action {
      min-height: 44px;
      padding: 0 16px;
      border-radius: 12px;
      border: 1px solid #E2E8F0;
      background-color: #ffffff;
      font-size: 0.875rem;
      font-weight: 600;
      color: #0F172A;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      transition: all 0.15s ease;
      white-space: nowrap;
    }
    .dark .settings-btn-action {
      background-color: #1E293B;
      border-color: #334155;
      color: #F8FAFC;
    }
    .settings-btn-action:hover {
      background-color: #F8FAFC;
      border-color: #CBD5E1;
    }
    .dark .settings-btn-action:hover {
      background-color: #334155;
    }

    .settings-btn-danger {
      color: #DC2626;
      border-color: #FECACA;
      background-color: #FEF2F2;
    }
    .dark .settings-btn-danger {
      color: #FCA5A5;
      border-color: #991B1B;
      background-color: rgba(153, 27, 27, 0.2);
    }
    .settings-btn-danger:hover {
      background-color: #FEE2E2;
    }
    .dark .settings-btn-danger:hover {
      background-color: rgba(153, 27, 27, 0.35);
    }
    .settings-btn-action:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* ===== Premium Install Button ===== */
    .install-btn-premium {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      min-height: 48px;
      padding: 0 22px;
      border: none;
      border-radius: 16px;
      background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
      color: #ffffff;
      font-family: 'Inter', system-ui, sans-serif;
      font-size: 0.9375rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      line-height: 1.4;
      cursor: pointer;
      overflow: hidden;
      box-shadow:
        0 1px 2px rgba(37, 99, 235, 0.2),
        0 4px 12px rgba(37, 99, 235, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
      transition:
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      -webkit-tap-highlight-color: transparent;
    }

    .install-btn-premium::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(
        105deg,
        transparent 35%,
        rgba(255, 255, 255, 0.15) 45%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.15) 55%,
        transparent 65%
      );
      transform: translateX(-100%);
      transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .install-btn-premium:hover {
      transform: translateY(-2px);
      box-shadow:
        0 4px 8px rgba(37, 99, 235, 0.25),
        0 12px 24px rgba(37, 99, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }

    .install-btn-premium:hover::before {
      transform: translateX(100%);
    }

    .install-btn-premium:hover .install-btn-text {
      letter-spacing: 0.01em;
    }

    .install-btn-premium:active {
      transform: translateY(0) scale(0.98);
      box-shadow:
        0 1px 2px rgba(37, 99, 235, 0.2),
        0 2px 6px rgba(37, 99, 235, 0.1);
      transition-duration: 0.1s;
    }

    .install-btn-premium:focus-visible {
      outline: none;
      box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.6),
        0 0 0 5px #2563EB,
        0 4px 12px rgba(37, 99, 235, 0.2);
    }

    .install-btn-premium:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
      box-shadow: 0 1px 2px rgba(37, 99, 235, 0.1);
    }

    .install-btn-premium:disabled::before {
      display: none;
    }

    .install-btn-premium svg {
      flex-shrink: 0;
      width: 14px;
      height: 14px;
      transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .install-btn-premium:hover svg {
      transform: translateY(1px);
    }

    .dark .install-btn-premium {
      background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
      box-shadow:
        0 1px 2px rgba(37, 99, 235, 0.35),
        0 4px 12px rgba(37, 99, 235, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .dark .install-btn-premium:hover {
      box-shadow:
        0 4px 8px rgba(59, 130, 246, 0.4),
        0 12px 24px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    .dark .install-btn-premium:focus-visible {
      box-shadow:
        0 0 0 3px rgba(30, 41, 59, 0.8),
        0 0 0 5px #3B82F6,
        0 4px 12px rgba(59, 130, 246, 0.25);
    }

    .about-link {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 12px;
      font-size: 0.8125rem;
      font-weight: 600;
      color: #334155;
      text-decoration: none;
      transition: background-color 0.15s ease, color 0.15s ease;
    }

    .dark .about-link {
      color: #CBD5E1;
    }

    .about-link:hover {
      background-color: #F8FAFC;
      color: #0F172A;
    }

    .dark .about-link:hover {
      background-color: #1E293B;
      color: #F8FAFC;
    }

    .about-link-icon {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      opacity: 0.7;
    }

    .about-link-chevron {
      width: 14px;
      height: 14px;
      flex-shrink: 0;
      margin-left: auto;
      opacity: 0;
      transform: translateX(-4px);
      transition: opacity 0.15s ease, transform 0.15s ease;
    }

    .about-link:hover .about-link-chevron {
      opacity: 0.5;
      transform: translateX(0);
    }

    body.planix-compact section {
      padding: 1rem 1.125rem;
    }
    body.planix-compact .divide-y > div {
      padding-top: 0.75rem;
      padding-bottom: 0.75rem;
    }

    /* Toggle Switch */
    .switch-track {
      width: 48px;
      height: 26px;
      background-color: #CBD5E1;
      border-radius: 9999px;
      position: relative;
      cursor: pointer;
      transition: background-color 0.2s ease;
      flex-shrink: 0;
    }
    .dark .switch-track { background-color: #475569; }
    .switch-track::after {
      content: '';
      position: absolute;
      top: 3px;
      left: 3px;
      width: 20px;
      height: 20px;
      background-color: #FFFFFF;
      border-radius: 9999px;
      transition: transform 0.2s ease;
      box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }
    .switch-input:checked + .switch-track { background-color: #2563EB; }
    .switch-input:checked + .switch-track::after { transform: translateX(22px); }
    .switch-input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3); }

    /* The visible pill is only 26px tall, so the hit area inherited from it
       was 26px. Pad the label out to 44px and pull the same amount back with
       a negative margin, which keeps the switch looking and laying out
       exactly as before while meeting the 44px touch target minimum. */
    .switch-label {
      padding: 9px;
      margin: -9px;
    }
    .switch-label:focus-within .switch-track {
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
    }

    /* ===== Responsive =====
       This file previously had no width-based media query at all, so nothing
       in it adapted to small viewports; only Tailwind utilities in the markup
       did. These bands cover the mobile and tablet layouts. */
    @media (max-width: 639px) {
      /* Label + control rows use a non-wrapping flex row; let the control
         drop to its own line instead of forcing a 320px overflow. */
      .settings-control-input, .settings-select {
        font-size: 1rem;
      }

      .settings-btn-action {
        padding: 0 14px;
      }
    }

    @media (min-width: 640px) and (max-width: 1023px) {
      .settings-btn-action {
        padding: 0 14px;
      }
    }
