:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #eef2f5;
    --surface-strong: #e4e9ee;
    --ink: #141417;
    --ink-soft: #2b2f36;
    --muted: #69727d;
    --line: #dce3ea;
    --accent: #ff4d5e;
    --accent-strong: #e6374c;
    --teal: #13b8a6;
    --gold: #ffd166;
    --danger: #d92d20;
    --success: #15845f;
    --radius: 8px;
    --shadow: 0 12px 30px rgba(20, 20, 23, .08);
    --shadow-soft: 0 6px 18px rgba(20, 20, 23, .07);
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --font-display: "Segoe UI", var(--font-body);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255, 77, 94, .09) 0, rgba(255, 77, 94, 0) 280px),
        var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.55;
}

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

a:hover {
    color: var(--ink);
}

h1,
h2,
h3 {
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.08;
}

h1 {
    font-size: 2.2rem;
}

h2 {
    font-size: 1.15rem;
}

p {
    color: var(--muted);
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.main {
    min-height: calc(100vh - 170px);
    padding: 2rem 0 4rem;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(220, 227, 234, .78);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 76px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--ink);
}

.brand:hover {
    color: var(--ink);
}

.brand-copy {
    display: grid;
    gap: .1rem;
}

.brand-name {
    color: var(--ink);
    font-size: 1.52rem;
    font-weight: 900;
    letter-spacing: -.03em;
    line-height: .92;
}

.brand-tag {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.logo {
    flex: 0 0 auto;
    filter: drop-shadow(0 10px 14px rgba(20, 20, 23, .22));
}

.logo-disc {
    fill: #050506;
}

.logo-grooves {
    fill: none;
    stroke: rgba(255, 255, 255, .2);
    stroke-width: .75;
}

.logo-shine {
    fill: none;
    opacity: .55;
    stroke: rgba(255, 255, 255, .62);
    stroke-linecap: round;
    stroke-width: 1.4;
}

.logo-label {
    fill: var(--gold);
}

.logo-k-mark {
    fill: #f7f4ed;
    stroke: rgba(5, 5, 6, .72);
    stroke-linejoin: round;
    stroke-width: .75;
}

.nav {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.nav-link {
    color: var(--ink-soft);
    font-size: .95rem;
    font-weight: 700;
}

.nav-link-friends {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-badge {
    position: absolute;
    top: -1.05rem;
    right: -.8rem;
    display: inline-grid;
    min-width: 19px;
    height: 19px;
    place-items: center;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1;
    padding: 0 .28rem;
    box-shadow: 0 8px 16px rgba(255, 77, 94, .28);
}

.nav-user {
    max-width: 160px;
    overflow: hidden;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 42px;
    padding: .62rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font: inherit;
    font-size: .94rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: transform .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
    white-space: nowrap;
}

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

.btn-primary {
    border-color: var(--ink);
    background: var(--ink);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(20, 20, 23, .16);
}

.btn-primary:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.btn-ghost {
    border-color: var(--line);
    background: rgba(255, 255, 255, .72);
    color: var(--ink);
}

.btn-ghost:hover {
    border-color: var(--ink);
    background: #ffffff;
}

.btn-danger {
    border-color: rgba(217, 45, 32, .35);
    background: #fff6f5;
    color: var(--danger);
}

.btn-danger:hover {
    border-color: var(--danger);
    background: var(--danger);
    color: #ffffff;
}

.btn-lg {
    min-height: 48px;
    padding: .8rem 1.2rem;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}

.btn-icon {
    display: inline-grid;
    place-items: center;
    position: relative;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0;
    font-weight: 900;
    line-height: 0;
}

.btn-icon::before,
.btn-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 999px;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.btn-icon::before {
    width: .48rem;
    height: 2px;
}

.btn-icon::after {
    width: 2px;
    height: .48rem;
}

.btn-primary .btn-icon {
    background: var(--gold);
    color: var(--ink);
}

.collection-hero,
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.collection-hero {
    align-items: center;
    min-height: 132px;
}

.hero-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    flex-wrap: wrap;
}

.quick-add-panel {
    display: flex;
    justify-content: center;
    gap: .7rem;
    margin: -0.45rem 0 1.25rem;
    flex-wrap: wrap;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .45rem;
    color: var(--accent-strong);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: .65rem;
    height: .65rem;
    border-radius: 999px;
    background: var(--teal);
    box-shadow: .45rem 0 0 var(--gold);
}

.subtitle {
    margin-top: .45rem;
    font-size: .98rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .9rem;
    margin-bottom: 1.25rem;
}

.home-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .35fr);
    gap: .9rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.stats-compact {
    margin-bottom: 0;
}

.stats-compact .stat {
    min-height: 88px;
    padding: .9rem;
}

.stats-compact .stat-value {
    font-size: 1.7rem;
}

.home-insight {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: .95rem;
    box-shadow: var(--shadow-soft);
}

.home-insight-value {
    margin-top: .28rem;
    color: var(--ink);
    font-size: 1.28rem;
    font-weight: 900;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.home-insight p {
    margin-top: .35rem;
    font-size: .86rem;
    font-weight: 700;
}

.media-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
    margin-bottom: .9rem;
}

.media-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .74);
    color: var(--ink);
    font-weight: 900;
    padding: .65rem .8rem;
}

.media-tab:hover,
.media-tab.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #ffffff;
}

.media-tab strong {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: .82rem;
}

.media-tab.is-active strong,
.media-tab:hover strong {
    background: var(--gold);
}

.media-tabs-empty .media-tab {
    pointer-events: none;
}

.stat {
    position: relative;
    min-height: 104px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.stat::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 44px;
    height: 6px;
    background: var(--accent);
}

.stat:nth-child(2)::after {
    background: var(--teal);
}

.stat:nth-child(3)::after {
    background: var(--gold);
}

.stat-label,
.field label,
.meta-item label {
    color: var(--muted);
    font-size: .73rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.stat-value {
    margin-top: .38rem;
    color: var(--ink);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.stat-text {
    font-size: 1.18rem;
    line-height: 1.15;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(150px, auto) minmax(150px, auto) minmax(150px, auto) auto;
    gap: .65rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .78);
    padding: .7rem;
    box-shadow: var(--shadow-soft);
}

.toolbar input,
.toolbar select,
.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-size: .95rem;
    outline: none;
    padding: .65rem .78rem;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.toolbar input:focus,
.toolbar select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(19, 184, 166, .16);
}

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

.card {
    display: flex;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    flex-direction: column;
}

.card:hover {
    border-color: rgba(255, 77, 94, .55);
    color: var(--ink);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.card-main {
    display: flex;
    min-width: 0;
    color: inherit;
    flex: 1;
    flex-direction: column;
}

.card-main:hover {
    color: inherit;
}

.card-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background-color: var(--surface-soft);
    background-position: center;
    background-size: cover;
}

.card-cover.placeholder {
    display: grid;
    place-items: center;
}

.mini-record,
.empty-record {
    display: inline-block;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, var(--gold) 0 10%, var(--ink) 11% 18%, transparent 19%),
        repeating-radial-gradient(circle at center, var(--ink) 0 3px, #23252a 4px 7px);
}

.mini-record {
    width: 72px;
    height: 72px;
    opacity: .88;
}

.card-grade {
    position: absolute;
    top: .62rem;
    right: .62rem;
}

.card-media {
    position: absolute;
    top: .62rem;
    left: .62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border-radius: 999px;
    background: rgba(20, 20, 23, .86);
    color: #ffffff;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1;
    padding: .24rem .52rem;
    text-transform: uppercase;
}

.card-body {
    display: flex;
    min-height: 126px;
    padding: .85rem;
    flex: 1;
    flex-direction: column;
}

.card-title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.18;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-artist {
    margin-top: .32rem;
    color: var(--accent-strong);
    font-size: .88rem;
    font-weight: 800;
}

.card-meta {
    display: flex;
    gap: .45rem;
    margin-top: auto;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    flex-wrap: wrap;
}

.card-meta span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-actions {
    display: flex;
    margin-top: .75rem;
}

.card-actions .preview-play {
    width: 100%;
    border-radius: var(--radius);
}

.card-actions-bar {
    margin-top: 0;
    padding: 0 .85rem .85rem;
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 24px;
    border-radius: 999px;
    color: #ffffff;
    font-size: .7rem;
    font-weight: 900;
    line-height: 1;
    padding: .22rem .5rem;
}

.rating-stars-display {
    display: inline-flex;
    align-items: center;
    gap: .08rem;
    color: #c7ced6;
    line-height: 1;
}

.rating-stars-display span {
    font-size: 1.02rem;
}

.rating-stars-display .is-filled {
    color: var(--gold);
    text-shadow: 0 2px 8px rgba(255, 209, 102, .28);
}

.rating-number,
.rating-count,
.rating-empty {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 800;
}

.rating-number,
.rating-count {
    margin-left: .35rem;
}

.rating-control {
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-wrap: wrap;
}

.rating-stars-input {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: .1rem;
}

.rating-control input,
.rating-stars-input input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.rating-stars-input label {
    color: #c7ced6;
    cursor: pointer;
    font-size: 1.9rem;
    line-height: 1;
    transition: color .14s ease, transform .14s ease;
}

.rating-stars-input label:hover,
.rating-stars-input label:hover ~ label,
.rating-stars-input input:checked ~ label {
    color: var(--gold);
}

.rating-stars-input label:hover {
    transform: translateY(-1px);
}

.rating-clear {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    cursor: pointer;
    font-size: .8rem;
    font-weight: 900;
    padding: .34rem .6rem;
}

.rating-control input:checked + .rating-clear {
    border-color: var(--ink);
    color: var(--ink);
}

.card-rating {
    display: grid;
    gap: .28rem;
    margin-top: .7rem;
    min-height: 2.55rem;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 900;
}

.card-rating-empty {
    visibility: hidden;
}

.card-rating span {
    display: flex;
    align-items: center;
    gap: .3rem;
    min-width: 0;
}

.card-rating .rating-stars-display span {
    font-size: .78rem;
}

.card-rating em {
    color: var(--muted);
    font-style: normal;
}

.empty {
    display: grid;
    justify-items: center;
    gap: .9rem;
    padding: 4rem 1rem;
    text-align: center;
}

.empty-record {
    width: 96px;
    height: 96px;
    box-shadow: 0 16px 30px rgba(20, 20, 23, .2);
}

.empty-record.small {
    width: 118px;
    height: 118px;
}

.empty h2 {
    max-width: 560px;
}

.empty p {
    max-width: 520px;
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 260px);
    place-items: center;
    padding: 2rem 0;
}

.auth-panel {
    width: min(480px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1.4rem;
    box-shadow: var(--shadow);
}

.auth-panel h1 {
    margin-bottom: .45rem;
}

.auth-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.2rem;
}

.auth-switch {
    margin-top: 1rem;
    font-size: .92rem;
    font-weight: 700;
    text-align: center;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.35;
}

.check-row input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: .08rem;
    accent-color: var(--accent);
}

.vinyl-form {
    display: grid;
    gap: 1rem;
}

.vinyl-form.is-awaiting-analysis .js-analysis-section,
.vinyl-form.is-analyzing .js-analysis-section {
    display: none;
}

.section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .84);
    padding: 1.15rem;
    box-shadow: var(--shadow-soft);
}

.text-section p {
    white-space: pre-wrap;
}

.text-section + .text-section {
    margin-top: 1rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1rem;
}

.section-title span {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: var(--ink);
    color: #ffffff;
    font-size: .82rem;
    font-weight: 900;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.field {
    display: grid;
    gap: .38rem;
}

.locked-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: .62rem .78rem;
}

.locked-choice strong {
    color: var(--ink);
    font-weight: 900;
}

.locked-choice a {
    font-size: .82rem;
    font-weight: 900;
    white-space: nowrap;
}

.field textarea {
    min-height: 116px;
    resize: vertical;
}

.field input[type="file"] {
    min-height: auto;
    padding: .7rem;
}

.capture-zone {
    position: relative;
    min-height: 260px;
    overflow: hidden;
    border: 2px dashed #c7d0da;
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(19, 184, 166, .12), rgba(255, 209, 102, .12)),
        #ffffff;
    cursor: default;
    padding: 1rem;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.capture-zone:hover,
.capture-zone.dragover {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 4px rgba(255, 77, 94, .08);
}

.capture-zone.has-image {
    border-style: solid;
    background: #ffffff;
}

.capture-placeholder {
    display: grid;
    min-height: 224px;
    place-items: center;
    gap: .8rem;
    text-align: center;
}

.capture-icon {
    width: 84px;
    height: 84px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, var(--accent) 0 11%, var(--gold) 12% 20%, transparent 21%),
        repeating-radial-gradient(circle at center, var(--ink) 0 3px, #292b31 4px 7px);
    box-shadow: 0 16px 30px rgba(20, 20, 23, .2);
}

.capture-text {
    max-width: 440px;
    color: var(--ink);
    font-weight: 800;
}

.capture-buttons {
    display: flex;
    justify-content: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.capture-preview {
    width: min(380px, 100%);
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: var(--radius);
    background-position: center;
    background-size: cover;
    box-shadow: var(--shadow);
}

.capture-zone input[type="file"] {
    display: none;
}

.ai-loader {
    display: none;
    justify-items: center;
    gap: .75rem;
    padding: 1.25rem 0 0;
    text-align: center;
}

.ai-loader.active {
    display: grid;
}

.ai-loader-disc {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, var(--accent) 0 14%, var(--gold) 15% 23%, transparent 24%),
        repeating-radial-gradient(circle at center, var(--ink) 0 3px, #282a30 4px 7px);
    animation: spin 1.2s linear infinite;
}

.ai-loader-text {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 800;
}

.is-hidden {
    display: none;
}

.tracklist-preview {
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: .8rem;
}

.tracklist-preview p {
    font-size: .9rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .65rem;
    padding-top: .25rem;
    flex-wrap: wrap;
}

.form-cancel {
    margin-right: auto;
}

.save-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    flex-wrap: wrap;
}

.social-search {
    grid-template-columns: minmax(220px, 1fr) auto;
    margin-bottom: .9rem;
}

.social-search input,
.social-search button {
    grid-column: auto;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    margin-top: 1rem;
}

.social-list {
    display: grid;
    gap: .7rem;
}

.social-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    min-width: 0;
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    padding: .8rem;
}

.social-row strong {
    overflow-wrap: anywhere;
}

.social-row p {
    font-size: .86rem;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: wrap;
}

.row-actions form {
    display: inline-flex;
}

.data-actions {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.data-actions form {
    display: grid;
    gap: .8rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.edit-cover-preview {
    display: block;
    width: min(220px, 100%);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.detail-back {
    margin-bottom: 1.1rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(250px, 390px) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.detail-cover {
    position: sticky;
    top: 96px;
    aspect-ratio: 1;
    border-radius: var(--radius);
    background-color: var(--surface-soft);
    background-position: center;
    background-size: cover;
    box-shadow: var(--shadow);
}

.detail-cover.is-placeholder {
    display: grid;
    place-items: center;
}

.detail-info {
    min-width: 0;
}

.detail-info h1 {
    margin-bottom: .35rem;
    overflow-wrap: anywhere;
}

.detail-artist {
    margin-bottom: 1.1rem;
    color: var(--accent-strong);
    font-size: 1.25rem;
    font-weight: 900;
}

.actions-bar {
    display: flex;
    gap: .65rem;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
}

.actions-bar form {
    display: inline-flex;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .8rem;
    margin-bottom: 1.1rem;
}

.meta-item {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: .82rem;
}

.meta-item label {
    display: block;
    margin-bottom: .25rem;
}

.meta-item .value {
    color: var(--ink);
    font-size: .98rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.muted-inline {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 700;
}

.rating-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr);
    gap: .9rem;
    margin-bottom: 1.1rem;
}

.rating-update,
.rating-average {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: .95rem;
    box-shadow: var(--shadow-soft);
}

.rating-update {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
}

.rating-label {
    display: block;
    margin-bottom: .38rem;
    color: var(--muted);
    font-size: .73rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.rating-read {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
}

.rating-average p {
    font-size: .9rem;
    font-weight: 700;
}

.listen-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-soft);
    flex-wrap: wrap;
}

.listen-panel h2 {
    margin-bottom: .2rem;
}

.listen-panel p {
    font-size: .9rem;
}

.preview-player {
    display: grid;
    min-width: min(360px, 100%);
    gap: .55rem;
    justify-items: end;
}

.preview-player-inline {
    justify-items: start;
    margin-bottom: .9rem;
}

.preview-now {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 800;
}

#preview-audio {
    width: min(360px, 100%);
    height: 38px;
}

#preview-audio:not([src]) {
    display: none;
}

.tracklist {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-soft);
}

.tracklist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.tracklist h2 {
    margin-bottom: 0;
}

.tracks {
    list-style: none;
}

.track {
    display: grid;
    grid-template-columns: 42px 38px minmax(0, 1fr) auto auto;
    gap: .65rem;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: .6rem 0;
    font-size: .92rem;
}

.track:last-child {
    border-bottom: 0;
}

.track-side {
    display: inline-grid;
    min-height: 26px;
    place-items: center;
    border-radius: 999px;
    background: var(--ink);
    color: #ffffff;
    font-size: .75rem;
    font-weight: 900;
}

.track-side-muted {
    background: var(--surface-soft);
    color: var(--muted);
}

.track-num,
.track-duration {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 800;
}

.track-title {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.preview-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 38px;
    border: 1px solid rgba(255, 77, 94, .28);
    border-radius: 999px;
    background: var(--ink);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: .86rem;
    font-weight: 900;
    line-height: 1;
    padding: .55rem .8rem;
    white-space: nowrap;
}

.preview-play:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.preview-play:disabled {
    cursor: wait;
    opacity: .65;
}

.preview-play-small {
    min-height: 30px;
    font-size: .76rem;
    padding: .4rem .65rem;
}

.play-icon {
    width: 0;
    height: 0;
    border-top: .32rem solid transparent;
    border-bottom: .32rem solid transparent;
    border-left: .48rem solid currentColor;
    transform: translateX(1px);
}

.detail-dates {
    margin-top: 1rem;
    font-size: .82rem;
    font-weight: 700;
}

.alert {
    border: 1px solid;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    font-weight: 800;
}

.alert-error {
    border-color: rgba(217, 45, 32, .28);
    background: #fff1f0;
    color: #9f1f16;
}

.alert-success {
    border-color: rgba(21, 132, 95, .28);
    background: #ecfdf5;
    color: #0f684b;
}

.alert-info {
    border-color: rgba(19, 184, 166, .32);
    background: #edfffc;
    color: #087568;
}

.footer {
    border-top: 1px solid var(--line);
    padding: 1.3rem 0;
    text-align: center;
}

.footer p {
    font-size: .84rem;
    font-weight: 700;
}

.footer-credit {
    margin-top: .25rem;
    color: var(--ink);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    .home-dashboard {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .toolbar input,
    .toolbar button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    h1 {
        font-size: 1.7rem;
    }

    .main {
        padding-top: 1.25rem;
    }

    .collection-hero,
    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .collection-hero .btn,
    .page-head .btn {
        width: 100%;
    }

    .hero-actions {
        width: 100%;
    }

    .hero-actions .btn,
    .quick-add-panel .btn {
        flex: 1 1 180px;
    }

    .quick-add-panel {
        justify-content: stretch;
    }

    .detail-layout {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .detail-cover {
        position: static;
        width: min(440px, 100%);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .social-grid,
    .social-search {
        grid-template-columns: 1fr;
    }

    .social-search input,
    .social-search button {
        grid-column: 1 / -1;
    }

    .listen-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .rating-panel {
        grid-template-columns: 1fr;
    }

    .rating-update {
        align-items: stretch;
        flex-direction: column;
    }

    .preview-player {
        justify-items: stretch;
    }

    .track {
        grid-template-columns: 38px minmax(0, 1fr) auto;
    }

    .track-num,
    .track-duration {
        display: none;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 24px, 1180px);
    }

    .topbar-inner {
        min-height: 68px;
    }

    .brand-tag {
        display: none;
    }

    .brand {
        gap: .32rem;
    }

    .brand-name {
        font-size: 1.16rem;
    }

    .nav {
        gap: .45rem;
    }

    .nav-user {
        max-width: 86px;
    }

    .topbar .btn {
        min-height: 38px;
        padding: .55rem .7rem;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .stats,
    .toolbar {
        grid-template-columns: 1fr;
    }

    .stats-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem;
    }

    .stats-compact .stat {
        min-height: 76px;
        padding: .75rem;
    }

    .stats-compact .stat-value {
        font-size: 1.45rem;
    }

    .media-tabs {
        gap: .45rem;
    }

    .media-tab {
        min-height: 44px;
        padding: .55rem .6rem;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .75rem;
    }

    .card-body {
        min-height: 116px;
        padding: .7rem;
    }

    .card-actions-bar {
        padding: 0 .7rem .7rem;
    }

    .card-title {
        font-size: .92rem;
    }

    .card-artist {
        font-size: .8rem;
    }

    .section {
        padding: 1rem;
    }

    .social-row {
        align-items: stretch;
        flex-direction: column;
    }

    .row-actions,
    .row-actions form,
    .row-actions .btn {
        width: 100%;
    }

    .capture-zone {
        min-height: 236px;
    }

    .capture-placeholder {
        min-height: 202px;
    }

    .form-actions .btn {
        width: 100%;
    }

    .form-cancel,
    .save-actions {
        width: 100%;
    }

    .save-actions .btn {
        width: 100%;
    }

    .locked-choice {
        align-items: stretch;
        flex-direction: column;
    }

    .preview-play {
        flex: 1 1 46%;
    }

    .actions-bar .btn,
    .actions-bar form,
    .actions-bar button {
        width: 100%;
    }
}

@media (max-width: 410px) {
    .brand-copy {
        display: none;
    }

    .nav-user {
        display: none;
    }
}
