/* ============================================================
   Settings — EzReplay Pro
   Full-screen takeover layout (Discord / VS Code style)
   ============================================================ */

/* ---------- Overlay ---------- */

.settings-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    flex-direction: row;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 1000;
}

.settings-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* Backdrop click target sits behind the panel — not needed here,
   but kept for API consistency */
.settings-backdrop-click {
    display: none;
}

/* ---------- Panel (fills the overlay) ---------- */

.settings-panel {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateY(10px);
    transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.settings-overlay.open .settings-panel {
    transform: translateY(0);
}

/* Decorative top line in accent color */
.settings-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--color-accent) 30%,
        var(--color-accent) 70%,
        transparent 100%);
    opacity: 0.5;
    z-index: 2;
    pointer-events: none;
}

/* ---------- Header bar (full width) ---------- */

.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 32px;
    height: 52px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    background: var(--color-primary);
}

.settings-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    opacity: 0.85;
}

.settings-header-title svg {
    width: 16px;
    height: 16px;
    stroke: var(--color-accent);
    flex-shrink: 0;
}

.settings-close-btn {
    background: none;
    border: none;
    color: var(--color-text);
    opacity: 0.3;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    transition: opacity var(--ease-fast), background var(--ease-fast);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    flex-shrink: 0;
}

.settings-close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.07);
}

/* ---------- Body: sidebar + content ---------- */

.settings-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    /* Centre the settings content with max width */
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    gap: 0;
}

/* ---------- Tab sidebar ---------- */

.settings-tabs {
    width: 210px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 28px 0 28px;
    gap: 2px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    scrollbar-width: none;
    margin-right: 0;
}

.settings-tabs::-webkit-scrollbar { display: none; }

/* Section label above tab groups */
.settings-tabs-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-muted);
    padding: 16px 14px 6px;
    opacity: 0.6;
}

.settings-tabs-section-label:first-child {
    padding-top: 0;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    opacity: 0.45;
    transition: opacity var(--ease-fast), background var(--ease-fast);
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    width: 100%;
    white-space: nowrap;
    position: relative;
}

.settings-tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
}

.settings-tab:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.05);
}

.settings-tab.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font-weight: 500;
}

.settings-tab.active svg {
    stroke: var(--color-accent);
}

/* Active tab left accent bar */
.settings-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 2px;
    border-radius: 0 1px 1px 0;
    background: var(--color-accent);
}

/* ---------- Content area ---------- */

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 36px 40px 48px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
    min-width: 0;
}

.settings-content::-webkit-scrollbar {
    width: 4px;
}
.settings-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

/* Page title inside content */
.settings-page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 28px;
    display: block;
}

.settings-tab-content {
    display: none;
    flex-direction: column;
    gap: 32px;
    animation: settingsFadeIn 160ms ease;
    max-width: 680px;
}

.settings-tab-content.active {
    display: flex;
}

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

/* ---------- Group & Row ---------- */

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 2px 0;
}

.settings-row-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.settings-row-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
}

.settings-row-desc {
    font-size: 0.75rem;
    color: var(--color-muted);
    line-height: 1.5;
}

/* ---------- Toggle Switch ---------- */

.settings-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.settings-toggle-track {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: background 220ms ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-toggle-track::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    top: 2px;
    left: 2px;
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1), background 220ms ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.settings-toggle input:checked + .settings-toggle-track {
    background: var(--color-accent);
    border-color: transparent;
}

.settings-toggle input:checked + .settings-toggle-track::after {
    transform: translateX(20px);
    background: #fff;
}

/* ---------- Theme Selector ---------- */

.theme-options {
    display: flex;
    gap: 10px;
}

.theme-option {
    position: relative;
    flex: 1;
    cursor: pointer;
    max-width: 160px;
}

.theme-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 10px 12px;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition: border-color var(--ease-fast), background var(--ease-fast), transform 180ms ease;
    background: rgba(255, 255, 255, 0.025);
    user-select: none;
}

.theme-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.theme-option input:checked + .theme-card {
    border-color: var(--color-accent);
    background: rgba(112, 63, 161, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.theme-preview {
    width: 100%;
    height: 44px;
    border-radius: 7px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    box-sizing: border-box;
}

.theme-preview-bar {
    border-radius: 3px;
    height: 9px;
}

.theme-preview-bar:last-child { width: 55%; }

.theme-preview.default-theme { background: #121212; }
.theme-preview.default-theme .theme-preview-bar:first-child { background: #2e2e2e; }
.theme-preview.default-theme .theme-preview-bar:last-child  { background: #703fa1; }

.theme-preview.darker-theme  { background: #0E0F0F; }
.theme-preview.darker-theme  .theme-preview-bar:first-child { background: #1a1a1c; }
.theme-preview.darker-theme  .theme-preview-bar:last-child  { background: #703fa1; }

.theme-preview.white-theme   { background: #f3e1ef; }
.theme-preview.white-theme   .theme-preview-bar:first-child { background: #D8CAD5; }
.theme-preview.white-theme   .theme-preview-bar:last-child  { background: #C48BAE; }

.theme-label {
    font-size: 0.75rem;
    color: var(--color-text);
    opacity: 0.5;
    transition: opacity var(--ease-fast), color var(--ease-fast);
}

.theme-option input:checked + .theme-card .theme-label {
    opacity: 1;
    color: var(--color-accent);
    font-weight: 600;
}

/* ---------- Accent Color Swatches ---------- */

.accent-swatches {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 4px 0;
}

.accent-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    padding: 0;
    position: relative;
    transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    outline: none;
}

.accent-swatch::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 180ms ease;
}

.accent-swatch:hover { transform: scale(1.18); }

.accent-swatch.active {
    transform: scale(1.12);
}

.accent-swatch.active::after {
    border-color: rgba(255, 255, 255, 0.75);
}

.accent-swatch.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/55% no-repeat;
}

/* ---------- Speed Selector ---------- */

.speed-options {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    width: fit-content;
}

.speed-btn {
    padding: 7px 18px;
    border-radius: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    opacity: 0.4;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    transition: background var(--ease-fast), opacity var(--ease-fast);
}

.speed-btn:hover { opacity: 0.75; background: rgba(255,255,255,0.05); }

.speed-btn.active {
    background: var(--color-accent);
    opacity: 1;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ---------- Seek Inputs ---------- */

.seek-inputs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.seek-input-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

.seek-input-label {
    font-size: 0.78rem;
    color: var(--color-muted);
    min-width: 18px;
    text-align: center;
}

.settings-num-input {
    width: 44px;
    background: none;
    border: none;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-align: center;
    padding: 0;
    outline: none;
}

.settings-num-input::-webkit-inner-spin-button,
.settings-num-input::-webkit-outer-spin-button { opacity: 0.4; }

.seek-input-unit {
    font-size: 0.75rem;
    color: var(--color-muted);
}

/* ---------- Slider ---------- */

.settings-slider-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.slider-a-small { font-size: 0.72rem; color: var(--color-muted); flex-shrink: 0; }
.slider-a-large { font-size: 1.1rem;  color: var(--color-muted); flex-shrink: 0; }

.settings-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
    max-width: 320px;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    transition: transform var(--ease-fast);
    box-shadow: 0 0 0 3px rgba(112,63,161,0.22);
}

.settings-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.settings-slider::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: none;
}

.settings-slider-value {
    font-size: 0.75rem;
    color: var(--color-muted);
    min-width: 40px;
    text-align: right;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

/* ---------- Keyboard Shortcuts ---------- */

.shortcuts-list {
    display: flex;
    flex-direction: column;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 16px;
}

.shortcut-row:last-child { border-bottom: none; }

.shortcut-desc {
    font-size: 0.85rem;
    color: var(--color-muted);
    flex: 1;
}

.shortcut-keys {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.shortcut-plus {
    font-size: 0.65rem;
    opacity: 0.35;
    color: var(--color-text);
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    min-width: 26px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-text);
    user-select: none;
    opacity: 0.85;
}

/* ---------- Data Tab Buttons ---------- */

.settings-storage-count {
    color: var(--color-muted);
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.settings-neutral-btn,
.settings-danger-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    transition: background var(--ease-fast), border-color var(--ease-fast);
    width: 100%;
    max-width: 420px;
    text-align: left;
    box-sizing: border-box;
}

.settings-neutral-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text);
    opacity: 0.7;
}

.settings-neutral-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    opacity: 1;
}

.settings-danger-btn {
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.04);
    color: #ef4444;
}

.settings-danger-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
}

.settings-neutral-btn svg,
.settings-danger-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ---------- About Section ---------- */

.sab-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 4px 0;
}

.sab-logo-wrap {
    position: relative;
    width: 52px;
    height: 52px;
}

.sab-logo-glow {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(112, 63, 161, 0.4) 0%, transparent 70%);
    animation: sabPulse 3.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sabPulse {
    0%, 100% { opacity: 0.5; transform: scale(0.95); }
    50%       { opacity: 1;   transform: scale(1.1); }
}

.sab-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 14px rgba(112, 63, 161, 0.45));
}

.sab-identity {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.sab-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.sab-version {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--color-muted);
    opacity: 0.5;
}

.sab-desc {
    font-size: 0.84rem;
    color: var(--color-text);
    opacity: 0.45;
    line-height: 1.7;
    margin: 0;
    max-width: 400px;
}

.sab-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sab-pill {
    font-size: 0.67rem;
    font-family: var(--font-mono);
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text);
    opacity: 0.5;
}

.sab-pill--green {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
    opacity: 1;
}

.sab-divider {
    width: 32px;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
}

.sab-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sab-link {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.84rem;
    opacity: 0.6;
    transition: opacity var(--ease-fast);
    width: fit-content;
}

.sab-link:hover { opacity: 1; }

/* ---------- Page titles inside each tab ---------- */

#stab-appearance  .settings-page-title::before { content: 'Appearance'; }
#stab-editor      .settings-page-title::before { content: 'Editor'; }
#stab-video       .settings-page-title::before { content: 'Video'; }
#stab-shortcuts   .settings-page-title::before { content: 'Shortcuts'; }
#stab-data        .settings-page-title::before { content: 'Data & Storage'; }
#stab-about       .settings-page-title::before { content: 'About'; }

/* ---------- Custom Theme Pickers ---------- */

.custom-theme-pickers {
    display: none;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: settingsFadeIn 160ms ease;
}

.custom-theme-pickers.visible {
    display: flex;
}

.ctp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 16px;
}

.ctp-row:last-child {
    border-bottom: none;
}

.ctp-label {
    font-size: 0.825rem;
    color: var(--color-text);
    opacity: 0.65;
    flex: 1;
    cursor: default;
    user-select: none;
}

.ctp-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Color swatch that opens the native picker */
.ctp-input {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    padding: 0;
    cursor: pointer;
    background: none;
    transition: transform 180ms ease, border-color 180ms ease;
    flex-shrink: 0;
}

.ctp-input::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 50%;
}

.ctp-input::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.ctp-input::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

.ctp-input:hover {
    transform: scale(1.12);
    border-color: rgba(255, 255, 255, 0.35);
}

.ctp-hex {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--color-muted);
    min-width: 58px;
    user-select: all;
}

/* Custom theme preview (dynamic background) */
.theme-preview.custom-theme {
    background: #121212;
}

.theme-preview.custom-theme .theme-preview-bar:first-child {
    background: #2e2e2e;
}

.theme-preview.custom-theme .theme-preview-bar:last-child {
    background: var(--color-accent);
}

/* ---------- Custom Accent Picker ---------- */

.accent-swatch-custom {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
    box-sizing: border-box;
    overflow: hidden;
}

.accent-swatch-custom:hover {
    border-color: rgba(255, 255, 255, 0.55);
    transform: scale(1.12);
}

.accent-swatch-custom svg {
    width: 12px;
    height: 12px;
    stroke: rgba(255, 255, 255, 0.55);
    pointer-events: none;
    position: absolute;
    z-index: 1;
    transition: opacity 180ms ease;
}

.accent-swatch-custom input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

/* When a custom color is active, show the color as background */
.accent-swatch-custom.active {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.75);
    transform: scale(1.12);
}

.accent-swatch-custom.active svg {
    opacity: 0;
}

.accent-swatch-custom.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/55% no-repeat;
    z-index: 2;
}

/* ---------- How To Use sidebar button ---------- */

.settings-tab-howto {
    color: var(--color-text) !important;
}

.settings-tab-howto:hover {
    background: rgba(112, 63, 161, 0.08) !important;
    opacity: 0.9 !important;
}

/* ============================================================
   Mobile Layout
   Switches from left-sidebar to top tab bar on small screens
   ============================================================ */

@media (max-width: 768px) {

    /* Panel becomes column */
    .settings-panel {
        flex-direction: column;
    }

    .settings-body {
        flex-direction: column;
        padding: 0;
        max-width: 100%;
        gap: 0;
    }

    /* Sidebar → horizontal icon-only tab bar, no scrolling */
    .settings-tabs {
        width: 100%;
        flex-direction: row;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        overflow: visible;
        flex-shrink: 0;
        height: 50px;
        gap: 0;
        background: rgba(0, 0, 0, 0.12);
    }

    /* Hide category section labels and tab text */
    .settings-tabs-section-label {
        display: none;
    }

    .settings-tab {
        flex: 1;
        flex-direction: column;
        gap: 0;
        padding: 0;
        border-radius: 0;
        height: 100%;
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0;          /* hide label text */
        opacity: 0.4;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }

    .settings-tab span {
        display: none;         /* belt + braces */
    }

    .settings-tab svg {
        width: 19px;
        height: 19px;
    }

    /* Active: bottom border accent line */
    .settings-tab.active::before {
        top: auto;
        bottom: 0;
        left: 20%;
        width: 60%;
        height: 2px;
        border-radius: 2px 2px 0 0;
    }

    /* Content fills remaining height */
    .settings-content {
        flex: 1;
        min-height: 0;
        padding: 20px 16px 32px;
        overflow-y: auto;
    }

    /* Page title smaller */
    .settings-page-title {
        font-size: 1.05rem;
        margin-bottom: 20px;
    }

    /* Theme cards wrap */
    .theme-options {
        flex-wrap: wrap;
    }

    .theme-option {
        max-width: none;
        min-width: 72px;
        flex: 1;
    }

    .theme-preview {
        height: 36px;
    }

    /* Speed full width */
    .speed-options {
        width: 100%;
    }

    /* Slider full width */
    .settings-slider {
        max-width: none;
    }

    /* Data buttons full width */
    .settings-neutral-btn,
    .settings-danger-btn {
        max-width: 100%;
    }

    /* About section on mobile */
    .sab-wrap { align-items: center; text-align: center; }
    .sab-desc { max-width: 100%; }
    .sab-pills { justify-content: center; }
    .sab-links { align-items: center; }
}

@media (max-width: 480px) {

    .settings-panel-header {
        padding: 0 14px;
        height: 44px;
    }

    .settings-tabs {
        height: 46px;
    }

    .settings-tab svg {
        width: 17px;
        height: 17px;
    }

    .settings-content {
        padding: 16px 12px 28px;
    }

    .settings-tab-content {
        gap: 24px;
    }

    .settings-group {
        gap: 12px;
    }
}
