/* SongAZ web — "Liner Notes", the same tokens as the app (ios/SongAZ/DesignSystem/Theme.swift).
   Warm paper and ink neutrals, Pretendard set tight, hairlines instead of heavy cards.
   The dusk-indigo accent is only for actions and active state. */

:root {
  --canvas: #F6F5F1; --surface: #FFFFFF; --muted: #EDEBE5;
  --ink: #18181C; --ink2: #6C6B70; --ink3: #A3A2A6; --line: #E3E1DA;
  --accent: #4A4FA3; --accent-soft: #E8E8F4; --on-accent: #FFFFFF;
  --danger: #C0392B; --warn: #B7791F;
  --shadow: 0 10px 30px rgb(0 0 0 / .12);
  --radius: 12px;
  --tabbar: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #111113; --surface: #1B1B1F; --muted: #26262B;
    --ink: #F2F1ED; --ink2: #9B9AA1; --ink3: #5F5E65; --line: #2B2B31;
    --accent: #8C90D8; --accent-soft: #23243A; --on-accent: #111113;
    --danger: #E57368; --warn: #E0A84A;
    --shadow: 0 10px 30px rgb(0 0 0 / .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 16px/1.5 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  letter-spacing: -.01em; -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.boot { text-align: center; color: var(--ink2); padding: 30vh 16px; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type scale */
.t-display { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; margin: 0; word-break: keep-all; overflow-wrap: anywhere; }
.t-title { font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -.022em; margin: 0; }
.t-title3 { font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -.018em; margin: 0; }
.t-headline { font-size: 16px; font-weight: 600; letter-spacing: -.012em; }
.t-sub { font-size: 14px; color: var(--ink2); }
.t-foot { font-size: 13px; color: var(--ink2); }
.t-cap { font-size: 12px; font-weight: 500; color: var(--ink2); }
.t-tert { color: var(--ink3); }
.overline { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wordmark { font-weight: 700; font-size: 22px; letter-spacing: -.03em; text-decoration: none; color: var(--ink); }
.wordmark b { color: var(--accent); font-weight: 700; }

/* Shell: sidebar on wide screens, bottom tab bar on phones */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.main { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 500; color: var(--ink2); text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--accent); }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
    padding: 28px 16px; border-right: 1px solid var(--line); }
  .sidebar .wordmark { padding: 0 12px 20px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    text-decoration: none; font-weight: 500; color: var(--ink2); }
  .sidebar nav a:hover { background: var(--muted); color: var(--ink); }
  .sidebar nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
  .sidebar nav a[aria-current="page"] svg { color: var(--accent); }
  .sidebar .grow { flex: 1; }
  .sidebar .foot { font-size: 12px; color: var(--ink3); padding: 0 12px; }
  .sidebar .foot a { color: var(--ink2); }
  .main { padding: 36px 32px 80px; }
}

/* Page header */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 20px; }
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 0; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--ink2); font-size: 15px; font-weight: 500; margin: 0 0 12px -4px; }
.back:hover { color: var(--ink); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.gap-6 { gap: 6px; } .gap-12 { gap: 12px; } .gap-20 { gap: 20px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: var(--radius); font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .08s ease, background .15s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); width: 100%; }
.btn.secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); flex: 1; }
.btn.secondary:hover:not(:disabled) { background: var(--muted); }
.btn.secondary.active { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; flex: none; }
.btn.danger { color: var(--danger); }
.btn.fit { width: auto; flex: none; }
.link-btn { color: var(--accent); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.link-btn.quiet { color: var(--ink2); font-weight: 500; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--muted); }
.icon-btn.outlined { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.accent { color: var(--accent); }
.actions { display: grid; gap: 10px; }
.actions .row { gap: 10px; }

/* Text tabs (인기 / 최신, 곡 / 플레이리스트, …) */
.text-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.text-tabs button { padding: 8px 0 10px; font-size: 16px; font-weight: 600; color: var(--ink3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.text-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }

/* Chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 14px; font-weight: 500;
  padding: 7px 13px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.chip[aria-pressed="true"].filter { background: var(--ink); color: var(--canvas); box-shadow: none; }
.chip[aria-pressed="true"].pick { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.chip.suggested:not([aria-pressed="true"]) { box-shadow: inset 0 0 0 1px var(--accent); }
.label-genre { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 99px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); color: var(--ink); text-decoration: none; white-space: nowrap; }
.label-tag { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 99px; background: var(--muted); color: var(--ink2); white-space: nowrap; }
a.label-genre:hover { background: var(--muted); }

/* Surfaces */
.card { background: var(--surface); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.group { background: var(--surface); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.group > * + * { border-top: 1px solid var(--line); }
.group-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 52px; width: 100%; text-align: left; text-decoration: none; }
button.group-row:hover:not(:disabled), a.group-row:hover { background: var(--muted); }
.section-head { font-size: 13px; font-weight: 600; color: var(--ink2); margin: 28px 4px 8px; }
.section-foot { font-size: 12px; color: var(--ink3); margin: 8px 4px 0; line-height: 1.5; }
.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; }
.banner.soft { background: var(--accent-soft); color: var(--ink); }
.banner.warn { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink2); }
.banner.warn svg { color: var(--warn); flex: none; margin-top: 1px; }

/* Home */
.masthead { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.masthead-title { font-size: 28px; line-height: 1.22; font-weight: 700; letter-spacing: -.03em; margin: 0 0 24px; white-space: pre-line; }
@media (min-width: 900px) { .masthead .wordmark { visibility: hidden; } .masthead-title { font-size: 34px; } }

/* Playlist cards and rows */
.featured { display: block; padding: 16px; margin-bottom: 12px; text-decoration: none; }
.featured:hover { background: color-mix(in srgb, var(--surface) 80%, var(--muted)); }
.featured .top { display: flex; gap: 16px; }
.featured .info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.featured .title { font-size: 19px; font-weight: 600; letter-spacing: -.018em; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.featured .desc { margin-top: 14px; font-size: 14px; color: var(--ink2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 10px; align-items: center; font-size: 12px; font-weight: 500; color: var(--ink2); font-variant-numeric: tabular-nums; }
.meta span { display: inline-flex; align-items: center; gap: 3px; }
.p-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; width: 100%; text-align: left; }
.p-row:hover .p-title { color: var(--accent); }
.p-row .rank { width: 22px; font-size: 13px; font-weight: 600; color: var(--ink3); font-variant-numeric: tabular-nums; flex: none; }
.p-row .body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.p-title { font-size: 16px; font-weight: 500; letter-spacing: -.012em; display: flex; align-items: center; gap: 4px; min-width: 0; }
.p-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-title svg { color: var(--ink3); flex: none; }
.list-plain > .p-row:last-child { border-bottom: 0; }

/* Covers. Every measure is a fraction of the side (container query units), so the same markup works
   at 56px in a row and 232px in a header, like the app's TypographicCover. */
.cover { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--muted);
  container-type: inline-size; flex: none; }
.cover.shadow { box-shadow: var(--shadow); }
.cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink3); }
.cover .ph svg { width: 34%; height: 34%; }
.mosaic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr)); width: 100%; height: 100%; }
.mosaic.count-1 { grid-template-columns: 1fr; }
.mosaic.count-1, .mosaic.count-2 { grid-template-rows: 1fr; }
.mosaic.count-3 img:first-child { grid-column: 1 / -1; }
.mosaic img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
.cover-song-option { display: flex; align-items: center; width: 100%; gap: 10px; padding: 8px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.cover-song-option img { width: 40px; height: 40px; border-radius: 5px; object-fit: cover; }
.cover-song-option span:nth-child(2) { flex: 1; min-width: 0; }
.cover-song-option strong, .cover-song-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-song-option small { color: var(--ink2); }
.cover-song-option[aria-pressed="true"] > span:last-child { color: var(--accent); }
.tc { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 8cqw; gap: 3.5cqw; }
.tc .tt { font-weight: 700; letter-spacing: -.04em; line-height: 1.02; overflow: hidden; word-break: keep-all; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.tc .ts { font-size: max(4.5cqw, 5px); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .72;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.tc .rule { height: max(.6cqw, 1px); flex: none; }
.tc.liner .tt { font-size: 13cqw; margin-top: auto; }
.tc.liner .top { display: flex; justify-content: space-between; gap: 8px; }
.tc.block { justify-content: flex-end; gap: 4cqw; }
.tc.block .tt { font-size: 15cqw; }
.tc.block .bar { width: 18cqw; height: 3cqw; flex: none; }
.tc.block .by { margin-bottom: auto; }
.tc.stripe { padding: 0; gap: 0; }
.tc.stripe .band { height: 20%; flex: none; display: flex; align-items: center; padding: 0 8cqw; }
.tc.stripe .mid { flex: 1; display: flex; align-items: center; padding: 0 8cqw; }
.tc.stripe .tt { font-size: 11cqw; }
.tc.stamp { align-items: center; justify-content: center; padding: 0; }
.tc.stamp .ring { position: absolute; border-radius: 50%; border: max(.4cqw, .5px) solid; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .8; }
.tc.stamp .label { width: 50%; aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6cqw; position: relative; gap: 1.5cqw; }
.tc.stamp .tt { font-size: 7cqw; }
.tc.stamp .hole { position: absolute; width: 3.5cqw; aspect-ratio: 1; border-radius: 50%; left: 50%; top: 67%; transform: translateX(-50%); }

/* Artwork + song rows */
.art { border-radius: 4px; background: var(--muted); object-fit: cover; flex: none; }
.s-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
.s-row + .s-row { border-top: 1px solid var(--line); }
.s-row .idx { width: 22px; flex: none; text-align: center; font-size: 13px; font-weight: 500; color: var(--ink3); padding-top: 13px; font-variant-numeric: tabular-nums; }
.s-row .art { margin-top: 0; }
.s-row .body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.s-row .s-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-row .s-artist { font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-row.playing .s-title, .s-row.playing .idx { color: var(--accent); font-weight: 600; }
.s-row .trail { display: flex; align-items: center; gap: 2px; align-self: center; flex: none; }
.s-row.clickable { cursor: pointer; }
.s-row.clickable:hover .s-title { color: var(--accent); }
.note { display: flex; gap: 7px; margin-top: 5px; font-size: 13px; font-weight: 500; color: color-mix(in srgb, var(--ink) 80%, transparent); overflow-wrap: anywhere; }
.note::before { content: ""; width: 2px; border-radius: 1px; background: color-mix(in srgb, var(--accent) 60%, transparent); flex: none; }
.preview { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); flex: none; }
.preview.on { background: var(--accent); box-shadow: none; color: var(--on-accent); }
.preview.on svg path { animation: wave 1s ease-in-out infinite; transform-origin: center; }
.preview.on svg path:nth-child(2) { animation-delay: -.2s; } .preview.on svg path:nth-child(3) { animation-delay: -.4s; }
.preview.on svg path:nth-child(4) { animation-delay: -.6s; } .preview.on svg path:nth-child(5) { animation-delay: -.8s; }
@keyframes wave { 50% { transform: scaleY(.45); } }
@media (prefers-reduced-motion: reduce) { .preview.on svg path { animation: none; } }
.pick-toggle { width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink3); flex: none; }
.pick-toggle.on { color: var(--accent); }

/* Playlist detail */
.detail-cover { width: min(232px, 64vw); margin: 4px auto 24px; }
.detail-head { display: flex; flex-direction: column; gap: 10px; }
.owner-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 15px; font-weight: 500; }
.owner-link .h { font-size: 13px; color: var(--ink3); font-weight: 400; }
.owner-link:hover span:first-of-type { text-decoration: underline; text-underline-offset: 3px; }
.avatar { border-radius: 50%; display: grid; place-items: center; background: var(--muted); color: var(--ink2); font-weight: 600; flex: none; }
.tracklist-head { display: flex; align-items: baseline; gap: 8px; margin: 28px 0 6px; }
@media (min-width: 900px) {
  .detail-top { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: end; }
  .detail-top .detail-cover { width: 232px; margin: 0; }
}
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 210px; padding: 6px;
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; font-size: 15px; text-align: left; }
.menu button:hover { background: var(--muted); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > .lbl { font-size: 13px; font-weight: 600; color: var(--ink2); }
.field > .hint { font-size: 12px; color: var(--ink3); }
.field > .hint.err { color: var(--danger); }
.input { width: 100%; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 0;
  box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; resize: vertical; }
.input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
.input-wrap { display: flex; align-items: center; gap: 4px; padding: 0 14px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.input-wrap:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.input-wrap input { flex: 1; min-width: 0; border: 0; background: none; padding: 12px 0; font-size: 16px; outline: none; }
.input-wrap .pre { color: var(--ink3); }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 46px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink3); }
.search-box:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.search-box input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; color: var(--ink); }
.search-box input::placeholder, .input::placeholder, .input-wrap input::placeholder { color: var(--ink3); }
.search-box input::-webkit-search-cancel-button { display: none; }
.bare-title { width: 100%; border: 0; background: none; outline: none; padding: 0; resize: none; overflow: hidden;
  font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; color: var(--ink); field-sizing: content; }
.bare-desc { width: 100%; border: 0; background: none; outline: none; padding: 0; resize: none; font-size: 16px; color: var(--ink2); field-sizing: content; min-height: 1.5em; }
.bare-title::placeholder, .bare-desc::placeholder { color: var(--ink3); }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--muted); box-shadow: inset 0 0 0 1px var(--line); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgb(0 0 0 / .2); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); box-shadow: none; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Genre tiles */
.genre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 600px) { .genre-grid { grid-template-columns: repeat(3, 1fr); } }
.genre-tile { display: flex; align-items: flex-end; justify-content: space-between; min-height: 76px; padding: 14px;
  background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; }
.genre-tile:hover { background: var(--muted); }
.genre-tile .n { font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; align-self: flex-start; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 0; }
.stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats b.hi { color: var(--accent); }
.stats span { font-size: 12px; font-weight: 500; color: var(--ink2); }

/* Empty / loading */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 16px; }
.empty .ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); color: var(--ink2); margin-bottom: 4px; }
.empty p { margin: 0; max-width: 360px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.sm { width: 16px; height: 16px; }
.center { display: grid; place-items: center; padding: 48px 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: var(--muted); border-radius: 6px; color: transparent !important; }

/* Modal: bottom sheet on phones, dialog on wide screens */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .38); display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease; }
.sheet { width: 100%; max-height: 92vh; display: flex; flex-direction: column; background: var(--canvas);
  border-radius: 18px 18px 0 0; box-shadow: var(--shadow); animation: up .22s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.sheet.tall { height: 92vh; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 16px; font-weight: 600; margin: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .l { justify-self: start; } .sheet-head .r { justify-self: end; }
.sheet-head .txt { font-size: 15px; font-weight: 500; color: var(--ink2); padding: 6px 8px; border-radius: 8px; }
.sheet-head .txt.strong { color: var(--accent); font-weight: 600; }
.sheet-body { overflow-y: auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); flex: 1; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--canvas); }
@media (min-width: 700px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: 18px; max-height: 86vh; animation: pop .18s ease; }
  .sheet.tall { height: 80vh; }
  .sheet-body { padding-bottom: 24px; }
  .sheet-foot { padding-bottom: 12px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.dialog { width: 100%; max-width: 360px; background: var(--surface); border-radius: 16px; padding: 22px 20px 16px; box-shadow: var(--shadow); margin: auto; animation: pop .15s ease; }
.dialog h2 { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.dialog p { font-size: 14px; color: var(--ink2); margin: 0 0 16px; }
.dialog .btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.dialog .input { margin-top: 4px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: var(--canvas); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: up .2s ease; }
.toast button { color: var(--accent-soft); font-weight: 600; white-space: nowrap; }
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + 120px); } }

/* Export */
.platform-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; flex: none; }
.progress { height: 6px; border-radius: 3px; background: var(--muted); overflow: hidden; width: 100%; }
.progress > div { height: 100%; background: var(--accent); transition: width .2s ease; }
.done-mark { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; margin: 8px auto 4px; }
.steps { display: grid; gap: 10px; padding: 14px 16px; }
.steps li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; list-style: none; }
.steps li b { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-grid; place-items: center; font-size: 12px; flex: none; }
.steps { margin: 0; }

/* Cover picker */
.cover-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cover-grid button { border-radius: 10px; padding: 0; }
.cover-grid button[aria-pressed="true"] { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
.swatch[aria-pressed="true"] { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* Sign in */
.oauth-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px; font-weight: 600; font-size: 15px; }
.oauth-btn.google { background: #fff; color: #1f1f1f; box-shadow: inset 0 0 0 1px #747775; }
.oauth-btn.kakao { background: #FEE500; color: rgb(0 0 0 / .85); }
.oauth-btn.apple { background: var(--ink); color: var(--canvas); }
.oauth-btn span { flex: 1; text-align: center; margin-right: 32px; }

.fullscreen { position: fixed; inset: 0; z-index: 55; background: var(--canvas); overflow-y: auto; }
.fullscreen .inner { max-width: 520px; margin: 0 auto; padding: 40px 24px 120px; }
.fullscreen .bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.fullscreen .bar > * { max-width: 472px; margin: 0 auto; }

.editor-cover { position: relative; width: 200px; margin: 4px auto 18px; display: block; }
.editor-cover .badge { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(8px); color: var(--ink); }
.sticky-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -16px -16px 16px; padding: 10px 16px; background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .sticky-bar { margin: -36px -32px 20px; padding: 14px 32px; } }
.sticky-bar h1 { font-size: 16px; font-weight: 600; margin: 0; }

/* Optional editorial stories use the same paper, ink and track typography. */
.story-text { padding: 24px 0; overflow-wrap: anywhere; }
.story-text h3 { margin: 0 0 10px; }
.story-text p { margin: 0; color: var(--ink2); font-size: 16px; line-height: 1.85; }
/* The story editor follows the playlist editor and note editor, without grouped form cards. */
.story-editor { padding: 8px 4px 0; }
.story-editor-head { display: grid; gap: 10px; margin-bottom: 28px; }
.story-editor-head .t-sub { margin: 0; line-height: 1.7; }
.story-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 20px 0; min-width: 0; }
.story-field-label { color: var(--ink2); font-size: 13px; font-weight: 600; }
.story-field textarea { resize: vertical; min-height: 106px; line-height: 1.7; }
.story-field textarea::placeholder, .story-chapter-title::placeholder { color: var(--ink3); }
.story-chapter-editor { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 28px; }
.story-chapter-head { min-height: 44px; margin-bottom: 12px; }
.story-chapter-head button { font-size: 12px; min-height: 44px; }
.story-chapter-title { width: 100%; min-height: 30px; border: 0; background: none; padding: 0; outline: none;
  font-size: 19px; font-weight: 600; letter-spacing: -.018em; line-height: 1.5; resize: none; field-sizing: content; }
.story-song-choice { width: 100%; min-width: 0; text-align: left; border-radius: 10px; padding: 0 12px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.story-song-choice > .row { padding: 18px 2px; color: var(--ink2); }
.story-song-choice .s-row { padding: 12px 0; border: 0; }
.story-song-choice .trail { color: var(--ink3); }
.story-add-chapter { margin: 28px 0; }
.story-add-chapter .btn, .story-preview { width: 100%; }
.story-add-chapter p { margin: 12px 0 0; line-height: 1.6; }
.story-ending { border-top: 1px solid var(--line); padding-top: 8px; }
.story-delete { display: flex; justify-content: center; width: 100%; min-height: 44px; margin-top: 24px; font-size: 13px; }
.story-error { color: var(--danger); }
.story-song-option { display: block; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.story-song-option[aria-pressed="true"] .trail { color: var(--accent); }
.story-song-option .trail { white-space: nowrap; }
