/* ==========================================================================
   Search+ — styles
   Classic search-engine layout: plain page, one search box, dense results.
   Tokens use light-dark() so each colour is defined once for both themes.
   Theme: system by default; [data-theme] on <html> forces light or dark.
   ========================================================================== */

:root {
    color-scheme: light dark;

    /* Surfaces */
    --bg: light-dark(#ffffff, #1b1c1f);
    --surface: light-dark(#ffffff, #26272b);
    --surface-2: light-dark(#f2f3f5, #2e3034);
    --surface-3: light-dark(#e8eaed, #3a3c41);
    --border: light-dark(#dfe1e5, #3c3e43);
    --border-soft: light-dark(#ebedf0, #303237);

    /* Text */
    --text: light-dark(#1f2023, #e8eaed);
    --text-2: light-dark(#4d5156, #bdc1c6);
    --text-3: light-dark(#70757a, #9aa0a6);
    --link: light-dark(#1a0dab, #99c3ff);
    --link-visited: light-dark(#681da8, #c58af9);

    /* Accent (Search+ blue from the logo) */
    --accent: light-dark(#1d5fe0, #8ab4f8);
    --accent-strong: light-dark(#174cb6, #aecbfa);
    --accent-soft: light-dark(#e8f0fe, #263248);
    --on-accent: light-dark(#ffffff, #10141c);
    --ring: color-mix(in oklab, var(--accent) 35%, transparent);

    --danger: light-dark(#c5221f, #f28b82);
    --spotify: #1db954;

    /* Elevation */
    --shadow-box: 0 1px 6px light-dark(rgb(32 33 36 / 0.18), rgb(0 0 0 / 0.5));
    --shadow-box-hover: 0 1px 8px light-dark(rgb(32 33 36 / 0.24), rgb(0 0 0 / 0.6));
    --shadow-pop: 0 4px 6px light-dark(rgb(32 33 36 / 0.1), rgb(0 0 0 / 0.3)),
                  0 12px 32px -8px light-dark(rgb(32 33 36 / 0.22), rgb(0 0 0 / 0.6));

    /* Shape & motion */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 24px;
    --radius-pill: 999px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --dur: 150ms;

    /* Type — system fonts: no downloads, instant text */
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Layout */
    --page-x: clamp(16px, 2.4vw, 28px);
    --brand-w: 104px;
    --col-gap: 28px;
    --search-w: 690px;
    --content-w: 652px;
}

[data-theme='light'] { color-scheme: light; }
[data-theme='dark'] { color-scheme: dark; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden], .hidden { display: none !important; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }

@font-face {
    font-family: 'Material Symbols Rounded';
    font-style: normal;
    font-weight: 100 700;
    font-display: block;
    src: url(../fonts/MaterialSymbolsRounded.woff2) format('woff2');
}

.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 22px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection { background: color-mix(in oklab, var(--accent) 25%, transparent); }

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 2000;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--bg);
    text-decoration: none;
    transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* ==========================================================================
   Header — home page
   ========================================================================== */
.app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        'controls'
        'brand'
        'search'
        'tabs'
        'tagline';
    justify-items: center;
    align-content: start;
    min-height: 72vh;
    padding: 12px var(--page-x) 24px;
    padding-top: max(12px, env(safe-area-inset-top));
}

.brand {
    grid-area: brand;
    display: inline-flex;
    margin-top: clamp(40px, 16vh, 150px);
    border-radius: var(--radius-sm);
}

.logo-image {
    height: clamp(72px, 11vw, 96px);
    width: auto;
}

/* ---------- Search box ---------- */
.search-form {
    grid-area: search;
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-top: 28px;
}

.search-bar {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 6px 0 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.search-bar:hover,
.search-bar:focus-within {
    border-color: transparent;
    box-shadow: var(--shadow-box);
}

/* When the dropdown is open, box + list read as one surface */
.search-bar.is-open {
    border-color: transparent;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-box);
}

.search-icon {
    color: var(--text-3);
    font-size: 20px;
    margin-right: 12px;
}

#searchInput {
    flex: 1;
    min-width: 0;
    height: 100%;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 16px;
    color: var(--text);
}
#searchInput::placeholder { color: var(--text-3); }
#searchInput::-webkit-search-cancel-button,
#searchInput::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.search-kbd {
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    margin-right: 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-3);
}
.search-bar:focus-within .search-kbd,
.search-bar.has-value .search-kbd { display: none; }
@media (pointer: coarse) { .search-kbd { display: none; } }

.icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-3);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

#clearBtn { position: relative; margin-right: 4px; }
#clearBtn::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 9px;
    bottom: 9px;
    width: 1px;
    background: var(--border);
}

.search-submit {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    color: var(--accent);
    transition: background var(--dur) var(--ease);
}
.search-submit:hover { background: var(--accent-soft); }
.search-submit .material-symbols-rounded { font-size: 24px; font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* ---------- Recent searches dropdown ---------- */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 0 0 8px;
    list-style: none;
    background: var(--surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-box);
    clip-path: inset(0 -12px -12px -12px); /* hide the shadow where it meets the box */
}

.suggestions::before {
    content: '';
    display: block;
    height: 1px;
    margin: 0 16px 6px;
    background: var(--border-soft);
}

.suggestion {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 36px;
    padding: 0 8px 0 16px;
    color: var(--text);
    cursor: pointer;
}

.suggestion > .material-symbols-rounded { font-size: 20px; color: var(--text-3); }
.suggestion:hover,
.suggestion[aria-selected='true'] { background: var(--surface-2); }

.suggestion-text {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.suggestion-text strong { font-weight: 700; }

.suggestion-remove {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-3);
    opacity: 0;
}
.suggestion-remove .material-symbols-rounded { font-size: 18px; display: block; }
.suggestion:hover .suggestion-remove,
.suggestion[aria-selected='true'] .suggestion-remove { opacity: 1; }
.suggestion-remove:hover { color: var(--text); background: var(--surface-3); }
@media (hover: none) { .suggestion-remove { opacity: 1; } }

/* ---------- Provider tabs ---------- */
.search-tabs {
    grid-area: tabs;
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.provider-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 14px;
    color: var(--text-2);
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.provider-btn:hover { border-color: var(--text-3); color: var(--text); }
.provider-btn[aria-pressed='true'] {
    background: var(--accent-soft);
    border-color: color-mix(in oklab, var(--accent) 45%, transparent);
    color: var(--text);
    font-weight: 500;
}
.provider-btn img { width: 16px; height: 16px; }

.hero-tagline {
    grid-area: tagline;
    margin-top: 28px;
    font-size: 13px;
    color: var(--text-3);
}

/* ---------- Header controls ---------- */
.header-controls {
    grid-area: controls;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}

.round-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-2);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.round-btn:hover { background: var(--surface-2); color: var(--text); }
.settings-btn[aria-expanded='true'] { background: var(--surface-2); color: var(--text); }

.signin-btn { height: 38px; padding: 0 22px; border-radius: var(--radius-pill); }

.avatar-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: 0 3px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--border);
}

/* Spotify now playing */
.spotify-now-playing {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 340px;
    height: 40px;
    padding: 0 5px 0 4px;
    background: var(--surface-2);
    border-radius: var(--radius-pill);
}

.spotify-album-art {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-3);
}

.spotify-track-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 150px;
    line-height: 1.2;
}

.spotify-track-name,
.spotify-artist-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spotify-track-name { font-size: 12.5px; font-weight: 500; }
.spotify-artist-name { font-size: 11.5px; color: var(--text-3); }

.spotify-controls { display: flex; align-items: center; gap: 2px; }

.spotify-control-btn {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--text-2);
}
.spotify-control-btn:hover { background: var(--surface-3); color: var(--text); }
.spotify-play-btn { background: var(--spotify); color: #fff; }
.spotify-play-btn:hover { background: #1ed760; color: #fff; }
.spotify-play-btn .pause-icon,
.spotify-play-btn.is-playing .play-icon { display: none; }
.spotify-play-btn.is-playing .pause-icon { display: block; }

/* ==========================================================================
   Header — results page (sticky bar)
   ========================================================================== */
.has-results .app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 0;
    grid-template-columns: var(--brand-w) minmax(0, var(--search-w)) minmax(0, 1fr) auto;
    grid-template-areas:
        'brand search . controls'
        '.     tabs   . .';
    column-gap: var(--col-gap);
    justify-items: start;
    align-items: center;
    padding: 18px var(--page-x) 0;
    padding-top: max(18px, env(safe-area-inset-top));
    background: var(--bg);
    border-bottom: 1px solid var(--border-soft);
}

.has-results .brand { margin: 0; justify-self: start; }
.has-results .logo-image { height: 34px; }
.has-results .search-form { width: 100%; max-width: none; margin: 0; }
.has-results .search-bar { height: 46px; box-shadow: var(--shadow-box); border-color: transparent; }
.has-results .search-bar:hover,
.has-results .search-bar:focus-within { box-shadow: var(--shadow-box-hover); }
.has-results .hero-tagline { display: none; }

/* Tabs become underlined nav tabs */
.has-results .search-tabs { gap: 4px; margin: 12px 0 0 6px; }
.has-results .provider-btn {
    position: relative;
    height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-3);
}
.has-results .provider-btn:hover { color: var(--text); }
.has-results .provider-btn[aria-pressed='true'] { color: var(--accent); font-weight: 500; }
.has-results .provider-btn[aria-pressed='true']::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
}

/* ==========================================================================
   Results
   ========================================================================== */
.app-main {
    flex: 1;
    padding: 0 var(--page-x) 48px;
}

.content-column {
    max-width: var(--content-w);
    margin-left: calc(var(--brand-w) + var(--col-gap));
}

.results { padding-top: 14px; }

.stats-text {
    min-height: 20px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}
.stats-text strong { font-weight: 400; }

.results-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.result-card {
    display: block;
    color: inherit;
    text-decoration: none;
    animation: fade 160ms ease-out both;
}

.result-card:hover .result-title,
.result-card:focus-visible .result-title { text-decoration: underline; text-underline-offset: 2px; }
.result-card:visited .result-title { color: var(--link-visited); }
.result-card:focus-visible { outline-offset: 6px; }

.result-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.result-main { flex: 1; min-width: 0; }

.result-site {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.result-favicon-wrap {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: light-dark(#f1f3f4, #e8eaed);
    border: 1px solid var(--border-soft);
    overflow: hidden;
}

.result-favicon { width: 18px; height: 18px; }

.result-icon-fallback {
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
}

.result-site-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.result-site-name {
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-breadcrumb {
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-title {
    margin: 6px 0 3px;
    padding-top: 2px;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--link);
    overflow-wrap: anywhere;
}

.result-snippet {
    font-size: 14px;
    line-height: 1.58;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.result-thumbnail {
    width: 92px;
    height: 92px;
    flex-shrink: 0;
    margin-top: 32px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--surface-2);
}

/* Sponsored: labelled, otherwise same shape as an organic result */
.badge-ad {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.result-card.is-ad .result-site { gap: 8px; }

/* ---------- Skeleton ---------- */
.skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.skeleton-row { display: flex; align-items: center; gap: 12px; }

.skeleton {
    height: 12px;
    border-radius: 4px;
    background: var(--surface-2);
    animation: pulse 1.2s ease-in-out infinite;
}

.skeleton.circle { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.skeleton.w-25 { width: 30%; }
.skeleton.w-60 { width: 62%; height: 18px; margin-top: 2px; }
.skeleton.w-100 { width: 100%; }
.skeleton.w-80 { width: 78%; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 44px;
    flex-wrap: wrap;
}

.page-numbers { display: flex; gap: 2px; }

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--link);
    font-variant-numeric: tabular-nums;
}
.page-btn:hover:not(:disabled) { background: var(--surface-2); text-decoration: underline; }
.page-btn[aria-current='page'] { color: var(--text); font-weight: 700; cursor: default; }
.page-btn[aria-current='page']:hover { background: none; text-decoration: none; }

.page-step { padding: 0 10px; }
.page-step .material-symbols-rounded { font-size: 20px; }
#prevPageBtn { margin-right: 8px; }
#nextPageBtn { margin-left: 8px; }
.page-btn:disabled { visibility: hidden; }

/* ---------- Empty / error state ---------- */
.message {
    padding: 48px 0;
    animation: fade 160ms ease-out both;
}

.message-icon-wrap {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-3);
}
.message-icon-wrap .material-symbols-rounded { font-size: 26px; }
.message.is-error .message-icon-wrap {
    background: color-mix(in oklab, var(--danger) 12%, transparent);
    color: var(--danger);
}

#messageTitle {
    font-size: 20px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 6px;
}

#messageText {
    max-width: 520px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-2);
    overflow-wrap: anywhere;
}

.message-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.message-actions:not(:has(button:not([hidden]))) { display: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn .material-symbols-rounded { font-size: 18px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); }
.btn-spotify { background: var(--spotify); color: #fff; }
.btn-spotify:hover { background: #1ed760; }
.btn-ghost-danger { border-color: var(--border); color: var(--text-2); }
.btn-ghost-danger:hover { border-color: var(--danger); color: var(--danger); }

.link-btn {
    font-size: inherit;
    color: inherit;
    text-decoration: none;
}
.link-btn:hover { text-decoration: underline; color: var(--text); }

/* ==========================================================================
   Settings popover
   ========================================================================== */
.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: transparent;
    visibility: hidden;
}
.settings-overlay.is-open { visibility: visible; }

.settings-panel {
    position: fixed;
    top: 60px;
    right: var(--page-x);
    z-index: 1001;
    width: 360px;
    max-width: calc(100vw - 2 * var(--page-x));
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 160ms var(--ease), transform 160ms var(--ease), visibility 160ms;
}
.settings-panel.is-open { opacity: 1; visibility: visible; transform: none; }

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 8px 20px;
}

.settings-header h2 { font-size: 18px; font-weight: 500; }

.settings-section { padding: 14px 20px 18px; border-top: 1px solid var(--border-soft); }

.settings-section h3 {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
}

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

.settings-label {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-size: 14px;
}
.settings-label > .material-symbols-rounded { color: var(--text-2); }
.settings-label > svg { flex-shrink: 0; }

.settings-label-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.settings-sublabel {
    font-size: 12.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#accountEmail { color: var(--accent); font-weight: 500; }
.spotify-status-text.connected { color: var(--spotify); font-weight: 500; }

.account-status,
.spotify-account-status { display: flex; gap: 8px; flex-shrink: 0; }

.switch {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 24px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    transition: background var(--dur) var(--ease);
}
.switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
    transition: transform var(--dur) var(--ease);
}
.switch[aria-checked='true'] { background: var(--accent); }
.switch[aria-checked='true']::after { transform: translateX(16px); }

.settings-block-btn { width: 100%; margin-top: 14px; }

.theme-switcher {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.theme-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    font-size: 13px;
    color: var(--text-2);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.theme-option + .theme-option { border-left: 1px solid var(--border); }
.theme-option:hover { background: var(--surface-2); }
.theme-option[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.theme-option .material-symbols-rounded { font-size: 18px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
    padding: 14px var(--page-x);
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    background: var(--surface-2);
    font-size: 13px;
    color: var(--text-3);
}
.footer-links { display: flex; gap: 20px; }
.has-results .app-footer { padding-left: calc(var(--page-x) + var(--brand-w) + var(--col-gap)); }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulse {
    50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .has-results .spotify-track-info { display: none; }
}

@media (max-width: 880px) {
    :root { --brand-w: 0px; --col-gap: 0px; }

    .has-results .app-header {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            'brand . controls'
            'search search search'
            'tabs tabs tabs';
        column-gap: 12px;
        row-gap: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
    }
    .has-results .logo-image { height: 28px; }
    .has-results .search-tabs { margin: 0; }

    .content-column { margin-left: 0; }
    .has-results .app-footer { padding-left: var(--page-x); }
}

@media (max-width: 600px) {
    .app-header { min-height: 0; padding-bottom: 32px; }
    .brand { margin-top: 32px; }
    .signin-btn { padding: 0 16px; }
    .spotify-track-info { max-width: 100px; }

    .result-title { font-size: 18px; }
    .result-thumbnail { width: 72px; height: 72px; }
    .page-step-label { display: none; }
    .settings-panel { top: 56px; }
}
