/* ==========================================================================
   BlankSound — dark audio-library UI. No frameworks, no external requests.
   ========================================================================== */

:root {
    --bg:        #080a10;
    --bg-soft:   #0d1018;
    --panel:     #12161f;
    --panel-2:   #171c28;
    --line:      #222a3a;
    --line-soft: #1a2130;
    --text:      #e8ebf4;
    --muted:     #939cb4;
    --accent:    #5b8cff;
    --accent-2:  #b06bff;
    --good:      #37d39b;
    --radius:    14px;
    --radius-lg: 22px;
    --shadow:    0 18px 40px -24px rgb(0 0 0 / .9);
    --font:      "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono:      ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Ambient glow behind everything. */
body::before {
    content: "";
    position: fixed;
    inset: -30vh 0 auto 0;
    height: 90vh;
    background:
        radial-gradient(60% 55% at 22% 0%, rgb(91 140 255 / .20), transparent 70%),
        radial-gradient(55% 50% at 82% 6%, rgb(176 107 255 / .16), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

main { position: relative; z-index: 1; }

img { max-width: 100%; }

a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; font-weight: 650; }

.wrap { width: min(1240px, 100% - 3rem); margin-inline: auto; }

.skip {
    position: absolute; left: -9999px; top: 0; z-index: 50;
    background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------------ header */

.site-head {
    position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

.head-inner {
    display: flex; align-items: center; gap: 1.25rem;
    min-height: 68px;
}

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -.02em; }
.brand-name { font-size: 1.12rem; }

.brand-mark { display: flex; align-items: center; gap: 3px; height: 22px; }
.brand-mark i {
    width: 3px; border-radius: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    animation: bounce 1.6s ease-in-out infinite;
}
.brand-mark i:nth-child(1) { height: 40%; animation-delay: 0s; }
.brand-mark i:nth-child(2) { height: 85%; animation-delay: .18s; }
.brand-mark i:nth-child(3) { height: 60%; animation-delay: .36s; }
.brand-mark i:nth-child(4) { height: 100%; animation-delay: .54s; }
.brand-mark i:nth-child(5) { height: 45%; animation-delay: .72s; }
@keyframes bounce { 0%, 100% { transform: scaleY(.55); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .brand-mark i { animation: none; } }

.search { position: relative; flex: 1 1 auto; max-width: 520px; }
.search input {
    width: 100%; height: 42px; padding: 0 42px 0 16px;
    background: var(--panel); color: var(--text);
    border: 1px solid var(--line); border-radius: 999px;
    font: inherit; font-size: .94rem; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: #6d7690; }
.search input:focus { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 4px rgb(91 140 255 / .12); }
.search button {
    position: absolute; right: 5px; top: 5px; width: 32px; height: 32px;
    display: grid; place-items: center;
    background: transparent; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer;
}
.search button:hover { color: #fff; background: var(--panel-2); }
.search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.suggest {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; padding: .35rem;
}
.suggest a { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .7rem; border-radius: 9px; font-size: .9rem; }
.suggest a:hover, .suggest a.on { background: var(--panel-2); }
.suggest .c { color: var(--muted); font-size: .8rem; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 1.1rem; margin-left: auto; font-size: .92rem; color: var(--muted); }
.nav a:hover { color: #fff; }
.nav-admin {
    padding: .38rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text);
}
.nav-admin:hover { border-color: var(--accent); }
.pill {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
    background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700;
}
.pill:empty, .pill[data-zero] { display: none; }

/* -------------------------------------------------------------------- hero */

.hero { padding: 5rem 0 3rem; }
.eyebrow {
    display: inline-block; margin: 0 0 1rem; padding: .3rem .8rem;
    border: 1px solid var(--line); border-radius: 999px;
    font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
    background: var(--panel);
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 750; }
.grad {
    background: linear-gradient(100deg, var(--accent), var(--accent-2) 60%, #6ee7ff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; margin: 1rem 0 0; }
.sub { color: var(--muted); font-size: .9rem; margin: .4rem 0 0; }

.hero-search { display: flex; gap: .6rem; margin: 2rem 0 1.25rem; max-width: 620px; }
.hero-search input {
    flex: 1; height: 52px; padding: 0 20px; font: inherit;
    background: var(--panel); color: var(--text);
    border: 1px solid var(--line); border-radius: 999px; outline: none;
}
.hero-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(91 140 255 / .12); }
/* .btn is 38px tall by default, which left the hero button short and top-aligned
   next to the 52px input. */
.hero-search .btn { height: 52px; padding: 0 1.6rem; border-radius: 999px; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 2.5rem; }
.chips a {
    display: block; padding: .38rem .85rem; font-size: .87rem; color: var(--muted);
    background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
    transition: .15s;
}
.chips a:hover { color: #fff; border-color: var(--accent); transform: translateY(-1px); }

.stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin: 0; padding: 1.5rem 0 0; border-top: 1px solid var(--line-soft); }
.stats dt { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.stats dd { margin: .15rem 0 0; font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; }

/* ------------------------------------------------------------------ blocks */

.block { padding: 2.25rem 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.block-head h2 { font-size: 1.4rem; }
.more { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.more:hover { color: var(--accent); }

.page-head { padding: 3rem 0 .5rem; }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }

/* Two columns once there is room: heading on the left, the description beside
   it. Category descriptions run to six lines in a 62ch column, which left the
   right half of a 1240px page empty and the text pinned to one side.
   Placement is line-based and every child is given a column, including ones
   these rules have never seen (the buttons on the 404 page), so nothing can be
   auto-placed into a cell by accident. */
@media (min-width: 900px) {
    .page-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 3rem;
        row-gap: 0;                 /* spacing stays with the elements' own margins */
        align-items: start;
    }
    /* Row 4 is the catch-all. An unplaced child would otherwise be auto-placed
       into the first free cell, and on a page without breadcrumbs that is the
       row above the heading — which is exactly where the 404 buttons went. */
    .page-head > *             { grid-column: 1; grid-row: 4; }
    .page-head > .crumbs       { grid-row: 1; grid-column: 1 / -1; }
    .page-head > h1            { grid-row: 2; }
    .page-head > .sub          { grid-row: 3; }
    .page-head > .head-actions { margin-top: 1.4rem; }
    .page-head > .lead {
        /* Spanning both rows rather than sitting in the first: otherwise the
           description alone sets the height of row 2 and the counter under the
           heading is pushed down to clear it. */
        grid-row: 2 / span 2;
        grid-column: 2;
        /* The column already limits the line length to about 70 characters, so
           the 62ch cap would only re-introduce the gap this rule removes. */
        max-width: none;
        margin-top: .6rem;          /* optically level with the cap height of h1 */
    }
}

.crumbs { color: var(--muted); font-size: .85rem; margin-bottom: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { opacity: .45; }

.result-count { color: var(--muted); font-size: .88rem; margin: 0 0 1rem; }
.empty {
    padding: 3rem 1rem; text-align: center; color: var(--muted);
    border: 1px dashed var(--line); border-radius: var(--radius-lg); background: var(--bg-soft);
}

/* ------------------------------------------------------------------- cards */

.grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

.card {
    --accent: #5b8cff;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    /* The title gets its own full-width row; the play button, the meta line and
       the buttons sit on the row below it, clear of the heading. */
    grid-template-areas:
        "title title   title"
        "play  meta    actions"
        "wave  wave    wave";
    align-items: center; column-gap: .9rem; row-gap: .55rem;
    padding: .95rem 1rem 1.05rem;
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--line-soft); border-radius: var(--radius);
    transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.card.is-playing { border-color: var(--accent); }

/* Placement is set per grid (.card, .detail) — keeping grid-area here would
   leak into the detail layout, which has no area of that name, and the browser
   would auto-place the button out to the right. */
.card > .card-play { grid-area: play; }

.card-play {
    width: 46px; height: 46px; display: grid; place-items: center;
    border: 0; border-radius: 50%; cursor: pointer; color: #fff;
    background: color-mix(in srgb, var(--accent) 22%, var(--panel-2));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
    transition: background .15s, transform .12s;
}
.card-play:hover { background: var(--accent); transform: scale(1.05); }
.card-play svg { width: 22px; height: 22px; fill: currentColor; }
.card-play .i-pause, .is-playing .card-play .i-play { display: none; }
.is-playing .card-play .i-pause { display: block; }
.is-playing .card-play { background: var(--accent); }

.card-title {
    grid-area: title; min-width: 0; margin: 0;
    font-size: 1rem; font-weight: 600;
}
.card-title a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { grid-area: meta; display: flex; align-items: center; gap: .55rem; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.card-meta .tag {
    padding: .1rem .5rem; border-radius: 999px; font-size: .74rem;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: color-mix(in srgb, var(--accent) 70%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.card-meta .tag:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.card-actions { grid-area: actions; display: flex; align-items: center; gap: .4rem; }
.dl {
    padding: .32rem .6rem; font-size: .74rem; font-weight: 700; letter-spacing: .04em;
    color: var(--muted); border: 1px solid var(--line); border-radius: 8px;
}
.dl:hover { color: #fff; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }

.fav {
    width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
    background: transparent; border: 1px solid var(--line); border-radius: 9px; color: var(--muted);
    transition: .15s;
}
.fav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.fav:hover { color: #ff7597; border-color: #ff7597; }
.fav.on { color: #ff5f83; border-color: #ff5f83; }
.fav.on svg { fill: #ff5f83; }

/* Entries whose mp3 has not been fetched yet: visible, but plainly not playable. */
.card.no-audio, .detail.no-audio { opacity: .72; }
.no-audio .wave { cursor: default; }
.no-audio .bars i { background: #232a38; }
.is-missing {
    cursor: default; color: #5d6579 !important;
    background: transparent !important; box-shadow: inset 0 0 0 1px var(--line-soft) !important;
}
.card-play.is-missing svg { width: 20px; height: 20px; fill: currentColor; opacity: .7; }
.detail-side .btn.is-missing { border-style: dashed; }

/* ---------------------------------------------------------------- waveform */

.card > .wave { grid-area: wave; }
/* overflow:hidden and min-width:0 together: 96 bars with a 1px floor could not
   shrink below ~286px, so the detail waveform escaped its track on narrow
   viewports and made the whole document scroll sideways. */
.wave { position: relative; height: 38px; cursor: pointer; overflow: hidden; }
.wave[role="slider"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.bars i { flex: 1 1 0; min-width: 0; border-radius: 2px; background: #2c3446; }
.bars.played { clip-path: inset(0 100% 0 0); }
.bars.played i { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); }
.wave:hover .bars i { background: #384259; }
.wave:hover .bars.played i { background: var(--accent); }
/* Same specificity as the hover rule but declared later, so a not-yet-downloaded
   sound no longer lights up under the cursor while claiming to be unplayable. */
.no-audio .wave:hover .bars i, .no-audio .bars i { background: #232a38; }

/* ---------------------------------------------------------------- sections */

.sections { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.section-card {
    position: relative; overflow: hidden;
    padding: 1.4rem 1.3rem 1.2rem;
    background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 12%, var(--panel)), var(--bg-soft) 65%);
    border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
    transition: .18s;
}
.section-card::after {
    content: ""; position: absolute; inset: auto -30% -60% auto; width: 220px; height: 220px;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%);
    opacity: .5; transition: .3s;
}
.section-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.section-card:hover::after { opacity: .9; }
.section-card .num { font-family: var(--mono); font-size: .78rem; color: color-mix(in srgb, var(--accent) 75%, #fff); }
.section-card h3 { font-size: 1.2rem; margin: .35rem 0 .4rem; }
.section-card p { color: var(--muted); font-size: .88rem; margin: 0 0 1rem; min-height: 2.6em; }
.section-meta { font-size: .78rem; color: var(--muted); position: relative; }

.group { padding: 1.2rem 0 .4rem; border-top: 1px solid var(--line-soft); }
.group-head { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; margin-bottom: .8rem; }
.group-head h3 { font-size: 1.05rem; }
.group-head p { margin: 0; color: var(--muted); font-size: .86rem; }

.cat-list { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); list-style: none; padding: 0; margin: 0; }
.cat-list a {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .6rem .85rem; font-size: .9rem;
    background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px;
    transition: .15s;
}
.cat-list a:hover { border-color: color-mix(in srgb, var(--accent, #5b8cff) 55%, var(--line)); transform: translateX(2px); }
.cat-list em { font-style: normal; font-size: .76rem; color: var(--muted); }
.cat-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------------- filters */

.filters {
    display: flex; flex-wrap: wrap; align-items: end; gap: .75rem;
    padding: 1rem; margin-bottom: 1.25rem;
    background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.field { display: flex; flex-direction: column; gap: .3rem; font-size: .78rem; color: var(--muted); }
.field span { letter-spacing: .06em; text-transform: uppercase; font-size: .68rem; }
select, .field input, textarea, .input {
    min-width: 170px; height: 38px; padding: 0 .7rem;
    background: var(--panel); color: var(--text);
    border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: .88rem; outline: none;
}
select:focus, .field input:focus, textarea:focus, .input:focus { border-color: var(--accent); }
textarea { height: auto; padding: .6rem .7rem; line-height: 1.5; resize: vertical; }

.field.is-waiting select { color: #5d6579; border-style: dashed; cursor: not-allowed; }
optgroup { color: var(--muted); font-style: normal; }
optgroup option { color: var(--text); }

.btn {
    display: inline-flex; align-items: center; gap: .45rem; justify-content: center;
    height: 38px; padding: 0 1.1rem; cursor: pointer;
    background: var(--panel-2); color: var(--text);
    border: 1px solid var(--line); border-radius: 9px;
    font: inherit; font-size: .88rem; font-weight: 550;
    transition: .15s;
}
.btn:hover { border-color: var(--accent); color: #fff; }
.btn.primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    border-color: transparent; color: #fff; font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #7a2b3c; color: #ff8fa4; background: transparent; }
.btn.danger:hover { background: #3a1620; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.btn.fav.on svg { fill: currentColor; }

/* -------------------------------------------------------------- pagination */

.pager { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: 2rem; }
.pager a, .pager .here, .pager .gap {
    min-width: 38px; height: 38px; padding: 0 .7rem;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 9px; font-size: .88rem; color: var(--muted);
    background: var(--panel);
}
.pager a:hover { color: #fff; border-color: var(--accent); }
.pager .here { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pager .gap { border-color: transparent; background: transparent; }

/* ------------------------------------------------------------ sound detail */

.detail {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "play wave side";
    align-items: center; gap: 1.25rem;
    padding: 1.5rem; border-radius: var(--radius-lg);
    background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--bg-soft));
    border: 1px solid var(--line);
}
.detail > .card-play { grid-area: play; }
.detail > .wave      { grid-area: wave; }
.detail-side         { grid-area: side; }

.detail-play { width: 62px; height: 62px; }
.detail-play svg { width: 28px; height: 28px; }
.detail-wave { height: 84px; }
.detail-side { display: flex; gap: .5rem; align-items: center; }
.detail-side .fav { width: auto; height: 38px; padding: 0 .9rem; gap: .4rem; }

.specs {
    display: grid; gap: .1rem 2rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    margin: 1.5rem 0 0; padding: 1.25rem 0 0; border-top: 1px solid var(--line-soft);
}
.specs dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; }
.specs dd { margin: .1rem 0 1rem; font-size: 1rem; font-weight: 550; }
.source { color: var(--muted); font-size: .82rem; word-break: break-all; }
.source a:hover { color: var(--accent); }

/* ------------------------------------------------------------------- prose */

.prose { max-width: 74ch; }
.prose h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; }
.prose p { color: var(--muted); }
.prose a { color: var(--accent); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--panel); padding: .12em .4em; border-radius: 6px; }
.prose pre { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }

/* ------------------------------------------------------------ sticky dock */

.dock {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
    z-index: 45; width: min(900px, calc(100% - 2rem));
    display: grid; grid-template-columns: auto minmax(0, 220px) minmax(0, 1fr) auto auto auto;
    align-items: center; gap: .9rem;
    padding: .6rem .8rem;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    backdrop-filter: blur(18px);
    border: 1px solid var(--line); border-radius: 999px;
    box-shadow: 0 24px 50px -20px rgb(0 0 0 / .85);
    animation: dock-in .25s ease;
}
/* An author `display` beats the UA rule for [hidden], so without this the empty
   dock sat over every page and the close button appeared to do nothing. */
.dock[hidden] { display: none; }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 20px); } }

.dock-play {
    width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    position: relative;
}
.dock-play::before {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 0; height: 0; border-style: solid;
    border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #fff;
    transform: translateX(2px);
}
.dock.playing .dock-play::before {
    width: 12px; height: 14px; border: 0; transform: none;
    background: linear-gradient(90deg, #fff 0 4px, transparent 4px 8px, #fff 8px 12px);
}
.dock-meta { min-width: 0; }
.dock-title { display: block; font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-cat { font-size: .74rem; color: var(--muted); }
.dock-bar { height: 6px; border-radius: 99px; background: #262e3f; cursor: pointer; }
.dock-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.dock-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.dock-time { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.dock-dl { font-size: .74rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); padding: .28rem .55rem; border-radius: 8px; }
.dock-dl:hover { color: #fff; border-color: var(--accent); }
.dock-close { background: none; border: 0; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.dock-close:hover { color: #fff; }

/* ------------------------------------------------------------------ footer */

.site-foot { margin-top: 4rem; padding: 2.5rem 0 3rem; border-top: 1px solid var(--line-soft); background: var(--bg-soft); position: relative; z-index: 1; }
.foot-inner { display: grid; gap: 1rem; }
.foot-inner p { margin: .25rem 0 0; color: var(--muted); font-size: .88rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .9rem; color: var(--muted); }
.foot-links a:hover { color: var(--accent); }
.credit { font-size: .8rem !important; color: #6d7690 !important; }
.credit a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------------- admin */

.admin { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--bg-soft); border-right: 1px solid var(--line-soft); padding: 1.4rem 1rem; }
.admin-side .brand { margin-bottom: 1.6rem; }
.admin-nav { display: grid; gap: .2rem; }
.admin-nav a { padding: .55rem .8rem; border-radius: 9px; font-size: .9rem; color: var(--muted); }
.admin-nav a:hover { background: var(--panel); color: #fff; }
.admin-nav a.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: #fff; }
.admin-main { padding: 2rem 2.2rem 4rem; }
.admin-main h1 { font-size: 1.6rem; margin-bottom: 1.2rem; }

.tiles { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-bottom: 2rem; }
.tile { padding: 1.1rem 1.2rem; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.tile b { display: block; font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
.tile span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
tbody tr:hover { background: var(--panel); }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: .82rem; }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; }

.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); max-width: 900px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: grid; gap: .35rem; font-size: .78rem; color: var(--muted); }
.form-grid label.checkbox {
    grid-template-columns: auto 1fr; align-items: start; gap: .6rem;
    padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
    font-size: .84rem; line-height: 1.5;
}
.form-grid label.checkbox input { width: 18px; height: 18px; margin-top: .15rem; accent-color: #e2445c; }
.form-grid label.checkbox strong { color: var(--text); }

/* Auditioning a clip from an admin table: the same player, a smaller button. */
.sound-row { display: flex; align-items: center; gap: .7rem; }
.card-play-sm { width: 32px; height: 32px; flex: 0 0 32px; }
.card-play-sm svg { width: 15px; height: 15px; }
tr.is-playing { background: color-mix(in srgb, var(--accent) 10%, transparent); }
tr.is-playing td:first-child a { color: #fff; }
tr.no-audio .card-play-sm { cursor: default; }

.badge {
    display: inline-block; padding: .18rem .55rem; border-radius: 999px;
    font-size: .72rem; font-weight: 600; letter-spacing: .02em;
}
.badge-live    { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.badge-blocked { color: #ff8fa4; background: #3a1620; }
tr.is-blocked td:first-child a { color: #ff8fa4; }
tr.is-blocked { opacity: .72; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }
.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: 1.5rem; }
.notice { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }
.notice.error { background: #3a1620; border: 1px solid #7a2b3c; color: #ffb3c1; }
.notice.ok    { background: #12301f; border: 1px solid #2c6b45; color: #a7e8c0; }

/* A hint sitting under its own field, rather than under the whole form. */
.form-grid label > small.hint { font-size: .74rem; line-height: 1.4; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(380px, 100%); padding: 2rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.35rem; margin-bottom: .3rem; }
.login-card p.hint { color: var(--muted); font-size: .82rem; margin: 0 0 1.5rem; }
.login-card label { display: grid; gap: .35rem; margin-bottom: 1rem; font-size: .78rem; color: var(--muted); }
.login-card input { width: 100%; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
    .head-inner { flex-wrap: wrap; min-height: 0; padding: .7rem 0; row-gap: .6rem; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .grid { grid-template-columns: 1fr; }
    .detail {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "play wave" "side side";
    }
    /* minmax(0, 1fr), not 1fr: dropping the min-0 guard let a wide admin table
       inflate the track past the viewport and drag the whole page with it. */
    .admin { grid-template-columns: minmax(0, 1fr); }
    .admin-side { border-right: 0; border-bottom: 1px solid var(--line-soft); }
    .admin-nav { grid-auto-flow: column; overflow-x: auto; }
    .admin-main { padding: 1.5rem 1.1rem 4rem; }
    /* The desktop dock has six children in six columns. Redefining only the
       columns left them auto-placed, so the full-width progress bar pushed the
       time, MP3 and close controls onto a third row. Named areas pin them. */
    .dock {
        grid-template-columns: auto minmax(0, 1fr) auto auto auto;
        grid-template-areas:
            "play meta time dl close"
            "bar  bar  bar  bar bar";
        row-gap: .5rem; border-radius: 18px;
    }
    .dock-play  { grid-area: play; }
    .dock-meta  { grid-area: meta; }
    .dock-time  { grid-area: time; }
    .dock-dl    { grid-area: dl; justify-self: end; }
    .dock-close { grid-area: close; }
    .dock-bar   { grid-area: bar; }
}

@media (max-width: 560px) {
    .wrap { width: calc(100% - 2rem); }
    .stats { gap: 1.5rem; }
    .stats dd { font-size: 1.3rem; }
    .hero { padding: 3rem 0 2rem; }
    .filters { flex-direction: column; align-items: stretch; }
    .field, select { width: 100%; min-width: 0; }
}
