/* ── Reset & tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Brand colours extracted from the LibreDeck logo */
    --teal:          #1a9aaa;
    --teal-h:        #22b5c8;
    --teal-dark:     #136e7a;
    --green:         #46c14a;
    --green-h:       #55d659;
    --grad:          linear-gradient(135deg, #1a9aaa 0%, #46c14a 100%);
    --grad-glow:     linear-gradient(135deg, rgba(26,154,170,.35) 0%, rgba(70,193,74,.25) 100%);

    /* Backgrounds – dark with subtle teal tint */
    --bg:            #080d0e;
    --bg-2:          #0c1415;
    --surface:       #101c1e;
    --surface-2:     #162224;
    --border:        #1c3236;
    --border-h:      #2a4e54;

    /* Text */
    --text:          #dff0f2;
    --text-muted:    #6e9ea6;
    --text-dim:      #3a6068;

    --radius:        14px;
    --radius-sm:     8px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
strong { color: var(--text); }

/* ── Layout ── */
.section-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -.5px;
    margin-bottom: .5rem;
}
.section-sub {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}
.accent { color: var(--teal); }

/* ── Navbar ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8,13,14,.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: .7rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    height: 40px;
    width: auto;
    display: block;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--grad);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: .6rem 1.25rem;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s, box-shadow .15s;
    white-space: nowrap;
    line-height: 1;
}
.btn:hover {
    filter: brightness(1.12);
    box-shadow: 0 0 22px rgba(26,154,170,.4), 0 0 22px rgba(70,193,74,.2);
}
.btn-sm  { font-size: .82rem; padding: .45rem .9rem; border-radius: 6px; }
.btn-lg  { font-size: 1rem; padding: .8rem 1.9rem; border-radius: 10px; }

/* ── Hero ── */
.hero {
    padding: 6rem 0 5rem;
    background:
        radial-gradient(ellipse 55% 45% at 65% 0%, rgba(26,154,170,.13) 0%, transparent 70%),
        radial-gradient(ellipse 35% 30% at 80% 80%, rgba(70,193,74,.08) 0%, transparent 70%);
}
.hero-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: center;
}
.hero-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hero-brand-logo {
    width: 260px;
    height: auto;
    filter: drop-shadow(0 0 32px rgba(26,154,170,.5)) drop-shadow(0 0 64px rgba(70,193,74,.25));
    animation: logoPulse 5s ease-in-out infinite;
}
@keyframes logoPulse {
    0%, 100% {
        filter: drop-shadow(0 0 32px rgba(26,154,170,.5))  drop-shadow(0 0 64px rgba(70,193,74,.25));
    }
    50% {
        filter: drop-shadow(0 0 48px rgba(26,154,170,.75)) drop-shadow(0 0 96px rgba(70,193,74,.4));
    }
}
.hero-eyebrow {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 1rem;
}
.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}
.hero-sub {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 480px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* ── Card Mockups ── */
.hero-cards {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-shrink: 0;
}
.card-mockup {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    border: 1px solid rgba(26,154,170,.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
    background: #fff;
    color: #111;
    box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(26,154,170,.15);
}
.card-mockup.small  { width: 90px; height: 90px; border-radius: 7px; }
.card-front         { margin-top: 20px; }

.mock-year   { font-size: 22px; font-weight: 900; color: #1a7a8a; letter-spacing: -1px; line-height: 1; }
.mock-divider { width: 70%; height: 1px; background: #c5e6ea; margin: 2px 0; }
.mock-artist { font-size: 8.5px; color: #555; text-align: center; padding: 0 6px; line-height: 1.2; }
.mock-title  { font-size: 8.5px; font-weight: 700; color: #1a7a8a; text-align: center; padding: 0 6px; line-height: 1.2; }
.mock-brand  { position: absolute; bottom: 4px; font-size: 6px; color: #aac; letter-spacing: .05em; }

.card-mockup.small .mock-year   { font-size: 16px; }
.card-mockup.small .mock-artist,
.card-mockup.small .mock-title  { font-size: 6.5px; }

.mock-qr { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; }
.qr-grid {
    width: 72px; height: 72px;
    background-image:
        linear-gradient(#1a7a8a 0, #1a7a8a 100%),
        linear-gradient(#1a7a8a 0, #1a7a8a 100%),
        linear-gradient(#1a7a8a 0, #1a7a8a 100%),
        repeating-linear-gradient(90deg, transparent 0, transparent 6px, #1a7a8a 6px, #1a7a8a 8px),
        repeating-linear-gradient(0deg,  transparent 0, transparent 6px, #1a7a8a 6px, #1a7a8a 8px);
    background-size: 18px 18px, 18px 18px, 18px 18px, 100% 100%, 100% 100%;
    background-position: 0 0, calc(100% - 0px) 0, 0 calc(100% - 0px), 0 0, 0 0;
    background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat;
    opacity: .8;
    border: 1px solid #c5e6ea;
    border-radius: 2px;
}

/* ── How it works ── */
.how-section {
    padding: 5rem 0;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.steps-viewport {
    display: grid;
    overflow: hidden;
}
.how-steps {
    grid-column: 1;
    grid-row: 1;
    transition: transform .35s ease;
}
.steps {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.step {
    flex: 1;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    transition: border-color .2s;
}
.step:hover { border-color: var(--border-h); }

.step-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(26,154,170,.15), rgba(70,193,74,.1));
    border: 1px solid rgba(26,154,170,.25);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--teal);
}
.step-icon svg { width: 22px; height: 22px; }
.step h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; color: var(--text); }
.step p  { font-size: .9rem; color: var(--text-muted); line-height: 1.55; margin: 0; }

.step-arrow {
    font-size: 1.5rem;
    color: var(--text-dim);
    align-self: center;
    flex-shrink: 0;
    margin-top: -1rem;
}

/* ── Card detail ── */
.detail-section { padding: 5rem 0; }
.detail-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.detail-text h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -.5px;
    margin-bottom: 1.75rem;
}
.detail-list { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }
.detail-list li { display: flex; gap: 1rem; align-items: flex-start; }
.detail-icon {
    flex-shrink: 0;
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem; font-weight: 800;
    color: var(--teal);
}
.detail-list strong { display: block; font-size: .95rem; margin-bottom: .2rem; }
.detail-list p { font-size: .875rem; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* ── Card grid: 2 × 3, each card slightly tilted ── */
.preview-stack {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 10px;
    padding: 8px;
}
.preview-stack .card-mockup:nth-child(1) { transform: rotate(-4deg) translate(0,  3px); }
.preview-stack .card-mockup:nth-child(2) { transform: rotate( 3deg) translate(0,  6px); }
.preview-stack .card-mockup:nth-child(3) { transform: rotate( 5deg) translate(2px, -4px); }
.preview-stack .card-mockup:nth-child(4) { transform: rotate(-3deg) translate(0,  -2px); }
.preview-stack .card-mockup:nth-child(5) { transform: rotate(-2deg) translate(-3px, 5px); }
.preview-stack .card-mockup:nth-child(6) { transform: rotate( 4deg) translate(1px, -3px); }

/* ── Generator ── */
.generator-section {
    padding: 5rem 0 6rem;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
}
.generator-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: 0 0 60px rgba(26,154,170,.06);
}
.field-label {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: .6rem;
}
.input-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.url-input {
    flex: 1;
    min-width: 200px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    padding: .7rem 1rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.url-input::placeholder { color: var(--text-dim); }
.url-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26,154,170,.2);
}

/* ── Hint details ── */
.hint-details {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}
.hint-details summary {
    font-size: .88rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.hint-details summary::before {
    content: '▶';
    font-size: .65rem;
    color: var(--teal);
    transition: transform .15s;
}
.hint-details[open] summary::before { transform: rotate(90deg); }
.hint-steps {
    color: var(--text-muted);
    font-size: .88rem;
    padding-left: 1.5rem;
    margin: .75rem 0;
}
.hint-steps li  { margin-bottom: .3rem; }
.hint-example   { font-size: .82rem; color: var(--text-muted); margin: 0; }
.hint-example code {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: .15rem .5rem;
    border-radius: 5px;
    font-size: .8rem;
}

/* ── Review section ── */
.review-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.75rem;
}
.review-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .5rem;
}
.review-sub {
    font-size: .88rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.55;
}
.review-table {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.review-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 80px auto;
    gap: .5rem;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
}
/* YouTube rows have an extra swap button between artist and title columns */
.review-row:has(.btn-swap) {
    grid-template-columns: 1fr auto 1.5fr 80px auto;
}
.btn-swap {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: .2rem .3rem;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s;
}
.btn-swap:hover { color: var(--accent); }
.review-artist-input,
.review-title-input {
    font-size: .85rem;
    padding: .3rem .5rem;
    min-width: 0;
}
.review-row .year-input {
    min-width: 0;
    text-align: center;
    padding: .45rem .5rem;
    font-size: .9rem;
}
.btn-check {
    background: transparent;
    border: 1px solid var(--border-h);
    color: var(--text-muted);
    border-radius: 6px;
    padding: .35rem .7rem;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
    line-height: 1;
}
.btn-check:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.btn-check:disabled { opacity: .45; cursor: default; }

.year-suggestion {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.suggestion-year { color: var(--teal); font-weight: 700; }
.suggestion-accept, .suggestion-reject {
    background: transparent;
    border: 1px solid var(--border-h);
    border-radius: 4px;
    padding: .2rem .45rem;
    font-size: .75rem;
    cursor: pointer;
    line-height: 1;
    transition: background .12s, color .12s;
}
.suggestion-accept { color: var(--green); }
.suggestion-accept:hover { background: rgba(70,193,74,.15); }
.suggestion-reject { color: var(--text-muted); }
.suggestion-reject:hover { background: rgba(255,255,255,.06); }

.check-cell {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.review-row--missing {
    border-color: rgba(180,120,30,.4);
    background: rgba(180,120,30,.06);
}
.year-input--missing {
    border-color: rgba(180,120,30,.5) !important;
}
.review-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.btn-play {
    background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
}

/* ── Play dialog ── */
.play-dialog-inner {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-h);
    border-radius: var(--radius);
    padding: 2.5rem 2rem 2rem;
    width: min(480px, 96vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
}
.play-close {
    position: absolute;
    top: .9rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: .25rem .5rem;
    border-radius: 6px;
    transition: color .15s;
}
.play-close:hover { color: var(--text); }
.play-remaining {
    font-size: .82rem;
    color: var(--text-dim);
    margin-bottom: .25rem;
    align-self: flex-end;
}

/* card flip */
#playCardWrap {
    perspective: 900px;
}
.play-card {
    width: min(260px, 72vw);
    height: min(260px, 72vw);
    position: relative;
    transform-style: preserve-3d;
    transition: transform .55s cubic-bezier(.4,0,.2,1);
}
.play-card.flipped { transform: rotateY(180deg); }
.play-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    background: #ffffff;
    border: 1.5px solid #1a9aaa;
    border-radius: 4px;
    overflow: hidden;
}
.play-front {
    display: flex;
    align-items: center;
    justify-content: center;
}
.play-back { transform: rotateY(180deg); }
.play-qr {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}
.play-qr img {
    display: block;
    width: 100%;
    height: 100%;
}
/* Back face — absolute layout matching PDF proportions */
.play-back-year {
    position: absolute;
    left: 0; right: 0;
    top: 22%;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: #136e7a;
    margin: 0;
    letter-spacing: -.5px;
}
.play-back-divider {
    position: absolute;
    top: 39%;
    left: 8%; right: 8%;
    border: none;
    border-top: 1px solid #c5e6ea;
    margin: 0;
}
.play-back-artist {
    position: absolute;
    top: 43%;
    left: 6%; right: 6%;
    text-align: center;
    font-size: .82rem;
    color: #555555;
    margin: 0;
    line-height: 1.35;
}
.play-back-title {
    position: absolute;
    top: 62%;
    left: 6%; right: 6%;
    text-align: center;
    font-size: .9rem;
    font-weight: 700;
    color: #1a9aaa;
    margin: 0;
    line-height: 1.35;
}
.play-brand {
    position: absolute;
    bottom: 5%;
    left: 0; right: 0;
    text-align: center;
    font-size: .55rem;
    color: #aaaacc;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.play-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.25rem;
    justify-content: center;
}
.bulk-progress {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .25rem;
}
.bulk-progress-label {
    font-size: .85rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.review-row--updated {
    border-color: rgba(26,154,170,.45);
    background: rgba(26,154,170,.06);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-h);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: .6rem 1.25rem;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    white-space: nowrap;
    line-height: 1;
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }

/* ── Error ── */
.error-msg {
    background: rgba(180,30,30,.12);
    border: 1px solid rgba(180,30,30,.35);
    color: #ffaaaa;
    border-radius: var(--radius-sm);
    padding: .8rem 1rem;
    margin-top: 1rem;
    font-size: .9rem;
}

/* ── Loading overlay ── */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8,13,14,.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    z-index: 999;
}
#loading-overlay p { color: var(--text); font-size: 1.1rem; margin: 0; }
.loading-sub { color: var(--text-muted) !important; font-size: .9rem !important; }

.btn-cancel {
    background: transparent;
    border: 1px solid var(--border-h);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: .45rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    margin-top: .25rem;
}
.btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }

.spotify-auth-box {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid #1db954;
    border-radius: var(--radius-sm);
    background: rgba(29,185,84,.07);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.spotify-auth-box p { margin: 0; font-size: .9rem; color: var(--text-muted); flex: 1; }
.spotify-btn { background: #1db954; }
.spotify-btn:hover { filter: brightness(1.1); }
.tidal-btn { background: #000; border: 1px solid #444; }
.tidal-btn:hover { background: #111; }

#progressWrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    width: 260px;
}
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--grad);
    border-radius: 99px;
    transition: width .35s ease;
}

.spinner {
    width: 44px; height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--teal);
    border-right-color: var(--green);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal dialog ── */
#deezerNotice,
#bulkCheckDialog {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8,13,14,.75);
    backdrop-filter: blur(4px);
}
.dialog-box {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-h);
    border-radius: var(--radius);
    padding: 2rem 2rem 1.75rem;
    max-width: 460px;
    width: calc(100% - 2rem);
    box-shadow: 0 24px 64px rgba(0,0,0,.6), 0 0 0 1px rgba(26,154,170,.15);
}
.dialog-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}
.dialog-body {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}
.dialog-body strong { color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; }

/* ── Footer ── */
/* ── Android Download ── */
.download-section {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 4rem 0;
}
.download-inner {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}
.download-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--grad-glow);
    border: 1px solid var(--border-h);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
}
.download-icon svg { width: 36px; height: 36px; }
.download-text { flex: 1; min-width: 220px; }
.download-text h2 { font-size: 1.45rem; margin-bottom: .5rem; }
.download-text > p { color: var(--text-muted); margin-bottom: 1.25rem; }
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}
.download-hint {
    margin-top: .75rem !important;
    font-size: .78rem !important;
    color: var(--text-dim) !important;
}

/* ── Footer ── */
.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.footer-logo-img { height: 32px; width: auto; opacity: .8; }
.site-footer p { color: var(--text-dim); font-size: .82rem; margin: 0; }

/* ── Service Topbar ── */
.service-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: .825rem 0;
}
body { padding-top: 4rem; }
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.875rem;
}
.topbar-service {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 165px;
    justify-content: center;
}
.topbar-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    object-fit: contain;
}
.topbar-service-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}
.topbar-nav {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-size: 1.5rem;
    padding: .45rem 1.125rem;
    transition: background .15s, border-color .15s;
    line-height: 1;
}
.topbar-nav:hover { background: var(--surface); border-color: var(--teal); }

.service-hint {
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}
.gen-viewport {
    display: grid;
    overflow: hidden;
}
.service-panel {
    grid-column: 1;
    grid-row: 1;
    transition: transform .35s ease;
}
#panelSpotify, #panelTidal, #panelApple { text-align: center; }
.spotify-url-row {
    display: flex;
    gap: .5rem;
    margin-top: 1rem;
    text-align: left;
}

/* ── Playlist Picker ── */
.picker-label { font-size: .85rem; color: var(--text-muted); margin: 1rem 0 0; }
.picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0 .25rem;
}
.btn-refresh {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: .15rem .45rem;
    line-height: 1;
    transition: color .15s, border-color .15s;
}
.btn-refresh:hover { color: var(--text); border-color: var(--teal); }

/* ── Carousel ── */
.playlist-carousel {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-top: .5rem;
}
.carousel-viewport {
    container-type: inline-size;   /* enables cqw on children */
    flex: 1;
    overflow: hidden;
    min-width: 0;
}
.carousel-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    transition: transform .35s cubic-bezier(.25,.46,.45,.94);
    will-change: transform;
}
/* 5 cards per row – width derived from the viewport container, not the track */
.carousel-track .playlist-card {
    flex-shrink: 0;
    width: calc((100cqw - 4 * 10px) / 5);
}
@container (max-width: 500px) {
    .carousel-track .playlist-card {
        width: calc((100cqw - 2 * 10px) / 3);
    }
}
.carousel-btn {
    flex-shrink: 0;
    width: 34px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    transition: background .15s, border-color .15s, opacity .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.carousel-btn:hover:not(:disabled) { background: var(--surface); border-color: var(--teal); }
.carousel-btn:disabled { opacity: .22; cursor: default; }

.playlist-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .55rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex-shrink: 0;
    min-width: 0;
}
.playlist-card:hover { border-color: var(--teal); background: var(--surface); }
.playlist-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--surface-2); display: block; }
.playlist-card-nocover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}
.playlist-card-name {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* constrain URL input rows and single-action panels to a readable width */
.spotify-url-row { max-width: 600px; margin-left: auto; margin-right: auto; }
#panelDeezer .input-row,
#panelDeezer .hint-details { max-width: 600px; margin-left: auto; margin-right: auto; }
#panelYoutube .input-row,
#panelYoutube .hint-details { max-width: 600px; margin-left: auto; margin-right: auto; }
.youtube-notice {
    font-size: .85rem;
    color: var(--text-muted);
    margin: .75rem auto 0;
    max-width: 600px;
    text-align: center;
}

/* ── Responsive ── */
@media (max-width: 760px) {
    .hero-inner          { grid-template-columns: 1fr; gap: 2.5rem; }
    .hero-brand          { justify-content: center; }
    .hero-brand-logo     { width: 200px; }
    .hero-cards          { justify-content: center; }
    .detail-inner        { grid-template-columns: 1fr; gap: 3rem; }
    .steps               { flex-direction: column; }
    .step-arrow          { display: none; }
    .hero                { padding: 4rem 0 3rem; }
    .generator-card      { padding: 1.75rem 1rem; }
    .review-row          { grid-template-columns: 1fr 70px auto; }
    .review-artist-input { display: none; }
}

/* ── Mobile scan FAB ── */
.mobile-scan-btn {
    display: none; /* hidden on desktop */
}
@media (max-width: 768px) {
    .mobile-scan-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 1.75rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 400;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--teal), var(--teal-dark));
        border: none;
        cursor: pointer;
        color: #fff;
        box-shadow: 0 4px 20px rgba(26,154,170,.55);
        transition: transform .15s, box-shadow .15s;
    }
    .mobile-scan-btn:active {
        transform: translateX(-50%) scale(.93);
        box-shadow: 0 2px 10px rgba(26,154,170,.4);
    }
}

/* ── Mobile scanner dialog ── */
.scan-close-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    font-size: 1.3rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scan-viewport {
    position: relative;
    width: 100vw;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* semi-dark vignette around the guide box */
.scan-viewport::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 55% 55% at 50% 48%,
                transparent 40%, rgba(0,0,0,.55) 100%);
    pointer-events: none;
    z-index: 1;
}
.scan-guide {
    position: absolute;
    width: min(260px, 70vw);
    height: min(260px, 70vw);
    z-index: 2;
    pointer-events: none;
}
.scan-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: #1a9aaa;
    border-style: solid;
}
.scan-tl { top: 0; left: 0;  border-width: 3px 0 0 3px; }
.scan-tr { top: 0; right: 0; border-width: 3px 3px 0 0; }
.scan-bl { bottom: 0; left: 0;  border-width: 0 0 3px 3px; }
.scan-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; }
.scan-hint {
    position: absolute;
    bottom: 3rem;
    left: 0; right: 0;
    text-align: center;
    color: rgba(255,255,255,.75);
    font-size: .9rem;
    z-index: 2;
    pointer-events: none;
}
/* result overlay */
.scan-result {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem;
    text-align: center;
}
.scan-result-check {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
}
.scan-result-label {
    color: rgba(255,255,255,.75);
    font-size: 1rem;
}
.scan-result-actions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    width: 100%;
    max-width: 260px;
}

/* ── Footer links ── */
.footer-links {
    display: flex;
    gap: .6rem;
    align-items: center;
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: .4rem;
}
.footer-links a {
    color: var(--text-muted);
    transition: color .15s;
}
.footer-links a:hover { color: var(--teal); }

/* ── Cookie Banner ── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 800;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    box-shadow: 0 -4px 24px rgba(0,0,0,.4);
}
.cookie-text {
    font-size: .88rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 200px;
}
.cookie-text a {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-btn { white-space: nowrap; flex-shrink: 0; }

/* ── Legal pages ── */
.legal-header {
    padding: 1rem 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}
.legal-header .section-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.legal-back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--text-muted);
    font-size: .9rem;
    transition: color .15s;
}
.legal-back:hover { color: var(--teal); }
.legal-logo {
    height: 32px;
    width: auto;
    margin-left: auto;
    opacity: .75;
}
.legal-main {
    padding: 4rem 0 6rem;
    min-height: calc(100vh - 200px);
}
.legal-inner h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -.5px;
    margin-bottom: 2.5rem;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.legal-section {
    margin-bottom: 2.25rem;
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--border);
}
.legal-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.legal-section h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--teal);
    margin-bottom: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .82rem;
}
.legal-section p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: .75rem;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul {
    list-style: none;
    margin: .5rem 0 .75rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.legal-section ul li {
    color: var(--text-muted);
    padding-left: 1.1rem;
    position: relative;
    line-height: 1.7;
}
.legal-section ul li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--teal);
}
.legal-section a {
    color: var(--teal);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .15s;
}
.legal-section a:hover { color: var(--teal-h); }
