/* Album a Day: artwork first, bold type, mono labels. */

:root {
  --bg: #f5f3ee;
  --bg-tint: #ece8df;
  --surface: #ffffff;
  --surface-2: #eeebe4;
  --ink: #131211;
  --ink-soft: #66625b;
  --line: rgba(19, 18, 17, .09);
  --line-strong: rgba(19, 18, 17, .18);
  --accent: #ff4f2b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 79, 43, .12);
  --star: #f5a623;
  --star-empty: rgba(19, 18, 17, .14);
  --danger: #d23a1c;
  --shadow: 0 1px 2px rgba(19, 18, 17, .06), 0 18px 40px -12px rgba(19, 18, 17, .22);
  --shadow-art: 0 2px 6px rgba(0, 0, 0, .12), 0 30px 60px -20px rgba(0, 0, 0, .45);
  --radius: 20px;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --tabbar-h: 0px;
  --ambient-opacity: .28;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0b0a;
    --bg-tint: #141312;
    --surface: #161514;
    --surface-2: #201e1c;
    --ink: #f6f3ee;
    --ink-soft: #9c968c;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .18);
    --accent: #ff5a36;
    --accent-ink: #160a06;
    --accent-soft: rgba(255, 90, 54, .16);
    --star: #ffb83d;
    --star-empty: rgba(255, 255, 255, .14);
    --danger: #ff7a5c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 40px -12px rgba(0, 0, 0, .7);
    --shadow-art: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 70px -18px rgba(0, 0, 0, .85);
    --ambient-opacity: .42;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + 64px);
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.eyebrow {
  font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft);
}

/* Ambient colour behind the page, taken from the current album */
.ambient {
  position: fixed; inset: 0 0 auto; height: 95vh; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(60% 60% at 30% 30%, var(--c1, transparent), transparent 70%),
              radial-gradient(50% 50% at 75% 20%, var(--c2, transparent), transparent 70%);
  opacity: var(--ambient-opacity); filter: blur(40px) saturate(1.3);
  transition: opacity .8s ease;
}
.ambient-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: blur(90px) saturate(1.6); transform: scale(1.2); opacity: 0; transition: opacity 1.2s ease;
}
.ambient-img.on { opacity: 1; }
.ambient::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg));
}
.ambient.off { opacity: 0; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 30; padding: 14px 0; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background: color-mix(in srgb, var(--bg) 70%, transparent); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 700 18px/1 var(--display); letter-spacing: -.02em; text-decoration: none; }
.logo-disc {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle, var(--bg) 0 2px, var(--accent) 2.5px 6px, transparent 6.5px),
    repeating-radial-gradient(circle, #1c1b19 0 1px, #2c2a27 1.5px 2.5px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.topnav { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.topnav a {
  padding: 7px 16px; border-radius: 999px; text-decoration: none;
  font-size: 14px; font-weight: 500; color: var(--ink-soft); transition: color .15s, background .15s;
}
.topnav a:hover { color: var(--ink); }
.topnav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

.tabbar { display: none; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: filter .15s, transform .15s, background .15s, box-shadow .15s;
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: scale(.98); }
.button[disabled] { opacity: .4; cursor: not-allowed; filter: none; transform: none; }
.button-quiet { background: var(--surface-2); color: var(--ink); }
.button-quiet:hover { filter: none; background: color-mix(in srgb, var(--surface-2) 80%, var(--ink) 8%); }
.button-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.button-ghost:hover { filter: none; background: var(--surface-2); }
.button-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px currentColor; }
.button-large { min-height: 56px; padding: 0 30px; font-size: 16px; }
.icon-button {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--ink-soft);
}
.icon-button:hover { background: var(--surface-2); color: var(--ink); }
.icon-button[disabled] { opacity: .3; cursor: default; background: none; }
.link-button {
  border: 0; background: none; padding: 4px 0; cursor: pointer;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; font-size: 14px;
}
.link-button:hover { color: var(--ink); }
.link-button.danger { color: var(--danger); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Views */
.view { padding-top: 28px; animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.view-head h1, .today-head h1 {
  font: 700 clamp(44px, 7vw, 76px)/.95 var(--display); letter-spacing: -.035em;
}

/* Today */
.today-head { margin-bottom: 32px; }
.today-head p { margin: 14px 0 0; }
.today-done {
  display: flex; align-items: center; gap: 14px; margin-bottom: 24px;
  padding: 12px 18px 12px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  max-width: 520px;
}
.today-done .cover { width: 48px; flex: none; border-radius: 8px; }
.today-done p { margin: 0; font-size: 14px; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mode {
  --g1: #ff4f2b; --g2: #ff2f7a;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px;
  padding: 24px; aspect-ratio: 1 / 1.05; text-align: left; color: #fff;
  border: 0; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(150deg, var(--g1), var(--g2));
  box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.mode-old { --g1: #f2b134; --g2: #b8541e; }
.mode-surprise { --g1: #5b4cff; --g2: #0f9bd7; }
.mode-disc { /* record peeking out of the sleeve */
  position: absolute; z-index: -1; width: 78%; aspect-ratio: 1; top: -18%; right: -26%; border-radius: 50%;
  display: grid; place-items: center;
  background:
    conic-gradient(from 20deg, transparent, rgba(255, 255, 255, .07), transparent 25%, rgba(255, 255, 255, .05) 60%, transparent 75%),
    repeating-radial-gradient(circle, #121110 0 1.2%, #23211e 1.4% 2.2%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.mode-label {
  width: 38%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--g1) 80%, #fff), var(--g1) 55%, var(--g2));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18), 0 0 0 3px rgba(0, 0, 0, .35);
  color: #fff;
}
.mode-label svg { width: 52%; height: 52%; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.mode::after { /* grain and sheen */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent 55%);
}
.mode:hover { transform: translateY(-4px); box-shadow: var(--shadow), 0 24px 48px -18px var(--g2); }
.mode:hover .mode-disc { transform: translateX(-10%) rotate(40deg); }
.mode-kicker { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; opacity: .8; margin-bottom: 6px; }
.mode-name { font: 700 clamp(26px, 3vw, 34px)/1 var(--display); letter-spacing: -.03em; }
.mode-desc { font-size: 14px; opacity: .85; }

.today-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 22px; font-size: 14px; color: var(--ink-soft); }

/* Recently logged shelf */
.shelf { margin-top: 48px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.shelf-head h2 { font: 700 24px/1 var(--display); letter-spacing: -.02em; }
.shelf-head a { font-size: 14px; color: var(--ink-soft); }
.shelf-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 14px;
  overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.shelf-item { scroll-snap-align: start; border: 0; padding: 0; background: none; text-align: left; cursor: pointer; }
.shelf-item .cover { box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5); transition: transform .2s; }
.shelf-item:hover .cover { transform: translateY(-3px); }
.shelf-title { margin-top: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-item .stars { margin-top: 2px; }

/* Pick */
.pick { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: clamp(90px, 12vw, 160px); align-items: center; padding-top: 8px; }
.pick-art { position: relative; }
.pick-art .cover { position: relative; z-index: 1; border-radius: 10px; box-shadow: var(--shadow-art); }
.vinyl {
  position: absolute; z-index: 0; top: 4%; left: 4%; width: 92%; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, var(--bg) 0 1.6%, var(--c2, #e2552d) 2% 17%, rgba(0, 0, 0, .25) 17.4%, transparent 18%),
    conic-gradient(from 30deg, rgba(255, 255, 255, .0), rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, .07) 55%, rgba(255, 255, 255, 0) 70%),
    repeating-radial-gradient(circle, #141311 0 .55%, #34302b .7% 1.1%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 20px 50px -16px rgba(0, 0, 0, .8);
  animation: vinyl-out 1s .15s cubic-bezier(.2, .8, .2, 1) both, spin 6s linear infinite 1.1s;
}
@keyframes vinyl-out { from { transform: translateX(0); } to { transform: translateX(32%); } }
@keyframes spin { from { transform: translateX(32%) rotate(0); } to { transform: translateX(32%) rotate(360deg); } }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
}
.pick-title { margin: 18px 0 10px; font: 700 clamp(40px, 6vw, 72px)/.95 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.pick-artist { margin: 0; font-size: 22px; font-weight: 500; }
.pick-meta { margin: 10px 0 0; font: 400 13px/1.4 var(--mono); letter-spacing: .02em; color: var(--ink-soft); text-transform: uppercase; }
.pick-note { margin: 14px 0 0; font-size: 14px; color: var(--ink-soft); }
.listen { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
.listen a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 11px; border-radius: 999px; background: var(--surface-2);
  font-size: 14px; font-weight: 500; text-decoration: none; transition: background .15s, transform .15s;
}
.listen svg { width: 20px; height: 20px; flex: none; color: var(--dot); }
.listen a:hover { background: color-mix(in srgb, var(--surface-2) 75%, var(--dot) 25%); }
.listen .l-spotify { --dot: #1ed760; }
.listen .l-apple { --dot: #fa2d48; }
.listen .l-youtube { --dot: #ff0033; }
.pick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Covers */
.cover {
  position: relative; aspect-ratio: 1; width: 100%; overflow: hidden; border-radius: 8px;
  background: linear-gradient(135deg, var(--c1, #1f3a5f), var(--c2, #e2552d));
  container-type: inline-size;
}
.cover-initial {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 800 52cqw/1 var(--display); letter-spacing: -.05em; color: rgba(255, 255, 255, .88);
}
.cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: fade .4s ease;
}
.cover.loading { background: var(--surface-2); }
.cover-spinner {
  position: absolute; top: 50%; left: 50%; width: clamp(14px, 22cqw, 40px); aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ink) 14%, transparent); border-top-color: var(--ink-soft);
  animation: spin-only .8s linear infinite;
}
@keyframes spin-only { to { rotate: 360deg; } }
.cover-none {
  position: absolute; top: 50%; left: 50%; width: 42cqw; translate: -50% -50%; color: rgba(255, 255, 255, .7);
}
@keyframes fade { from { opacity: 0; } }

/* Stars (display) */
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.star {
  --fill: 0%;
  width: var(--size, 16px); height: var(--size, 16px);
  background: linear-gradient(90deg, var(--star) var(--fill), var(--star-empty) var(--fill));
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Stars (input) */
.rating-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stars-input { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; cursor: pointer; touch-action: none; }
.stars-input .star { --size: 40px; pointer-events: none; }
.rating-value { font: 700 22px/1 var(--display); min-width: 4ch; }

/* Diary */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.stat { padding: 20px 22px; background: var(--surface); }
.stat-value { font: 700 42px/1 var(--display); letter-spacing: -.03em; }
.stat-label { margin-top: 8px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }

.calendar-card { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.calendar-card > * { max-width: 600px; margin-left: auto; margin-right: auto; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.calendar-head h2 { font: 700 24px/1 var(--display); letter-spacing: -.02em; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { text-align: center; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding-bottom: 6px; }
.cal-day {
  position: relative; aspect-ratio: 1; border-radius: 8px; background: var(--surface-2);
  border: 0; padding: 0; overflow: hidden; cursor: default;
}
.cal-day.empty { background: transparent; }
.cal-day.has { cursor: pointer; transition: transform .15s; }
.cal-day.has:hover { transform: scale(1.05); z-index: 3; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.has.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-num { position: absolute; top: 4px; left: 6px; font: 500 11px/1.2 var(--mono); color: var(--ink-soft); z-index: 2; }
.cal-day.has .cal-num { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.cal-day .cover { position: absolute; inset: 0; border-radius: 0; }
.cal-more {
  position: absolute; right: 4px; bottom: 4px; z-index: 2; padding: 1px 6px; border-radius: 999px;
  background: rgba(0, 0, 0, .7); color: #fff; font: 500 11px/1.4 var(--mono);
}

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 44px 0 16px; }
.list-title { font: 700 30px/1 var(--display); letter-spacing: -.025em; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.segmented button {
  border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }

.entry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.entry {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center;
  width: 100%; padding: 10px 16px 10px 10px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .15s, transform .15s;
}
.entry:hover { border-color: var(--line-strong); }
.entry .cover { border-radius: 8px; }
.entry-title { font-weight: 600; }
.entry-sub { font-size: 14px; color: var(--ink-soft); }
.entry-fav { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.entry-right { text-align: right; font: 400 12px/1.4 var(--mono); color: var(--ink-soft); white-space: nowrap; }
.entry-right .stars { display: flex; justify-content: flex-end; margin-bottom: 6px; }

.entry-list.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; }
.tile { display: block; width: 100%; border: 0; padding: 0; background: none; text-align: left; cursor: pointer; }
.tile .cover { box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.tile:hover .cover { transform: translateY(-4px); }
.tile-title { margin-top: 10px; font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-artist { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .stars { margin-top: 6px; }

.empty-state { grid-column: 1 / -1; padding: 48px 20px; text-align: center; color: var(--ink-soft); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* Settings */
.panel { padding: 24px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { font: 700 20px/1.2 var(--display); letter-spacing: -.015em; margin-bottom: 8px; }
.panel p { margin: 0 0 16px; font-size: 15px; }
.panel-danger h2 { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent;
  font-size: 14px; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink-soft); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.inline-field { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; }
.inline-field input[type="number"] { width: 96px; flex: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Forms */
.field { margin-bottom: 18px; }
.field label, .field .label { display: block; margin-bottom: 8px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.field-narrow { max-width: 200px; }
.optional { text-transform: none; letter-spacing: 0; margin-left: 4px; opacity: .8; }
input[type="text"], input[type="number"], input[type="date"], textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--bg); font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin: 6px 0 0; font-size: 13px; color: var(--danger); }

/* Dialog */
dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
}
dialog[open] { animation: pop .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
dialog::backdrop { background: rgba(8, 7, 6, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog form { padding: 22px 24px 24px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dialog-head h2 { font: 700 30px/1 var(--display); letter-spacing: -.03em; }
.log-album { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.log-album .cover { width: 72px; flex: none; border-radius: 8px; }
.log-album strong { display: block; font-size: 17px; }
.dialog-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.spacer { flex: 1; }

/* Share dialog */
.share-dialog { width: min(520px, calc(100vw - 24px)); }
.share-inner { padding: 22px 24px 20px; }
.share-stage {
  position: relative; display: grid; place-items: center; margin-bottom: 16px;
  aspect-ratio: 4 / 5; max-height: 58dvh; margin-inline: auto; border-radius: 14px; background: var(--surface-2); overflow: hidden;
  container-type: inline-size;
}
.share-stage[data-format="story"] { aspect-ratio: 9 / 16; }
.share-stage img { width: 100%; height: 100%; object-fit: contain; animation: fade .3s ease; }
.share-stage .cover-spinner { display: none; }
.share-stage.busy .cover-spinner { display: block; width: 40px; }
.share-stage.busy img { opacity: .35; }
.share-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-note { margin: 12px 0 0; }
.button-small { min-height: 34px; padding: 0 14px; font-size: 13px; }
.today-done p { flex: 1; }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 72px; padding-top: 22px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-soft);
}
.site-footer a { color: inherit; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--ink); }
.site-footer .support {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; text-decoration: none;
}
.site-footer .spacer { flex: 1; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px); transform: translateX(-50%);
  z-index: 50; padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  max-width: calc(100vw - 32px); animation: pop .25s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .vinyl { transform: translateX(32%); }
}

/* Phone */
@media (max-width: 760px) {
  :root { --tabbar-h: 64px; }
  .wrap { padding: 0 16px; }
  .topnav { display: none; }
  .topbar { padding: 12px 0; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(3, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-size: 11px; font-weight: 500; text-decoration: none; color: var(--ink-soft);
  }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] svg { color: var(--accent); }

  .view { padding-top: 12px; }
  .today-head { margin-bottom: 22px; }
  .modes { grid-template-columns: 1fr; gap: 12px; }
  .mode { aspect-ratio: auto; min-height: 120px; padding: 20px; }
  .mode-disc { width: 150px; top: 50%; right: -40px; transform: translateY(-50%); }
  .mode:hover .mode-disc { transform: translateY(-50%) translateX(-10%) rotate(40deg); }
  .mode-name { font-size: 28px; }

  .shelf { margin-top: 36px; }
  .shelf-row { grid-auto-columns: 112px; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 16px; }

  .pick { grid-template-columns: 1fr; gap: 28px; }
  .pick-art { width: min(280px, 64vw, 36vh); margin: 0 auto; transform: translateX(-14%); }
  .pick-title { margin-top: 14px; }
  .pick-artist { font-size: 19px; }
  .listen { margin: 20px 0; }
  .pick-actions .button { flex: 1 1 auto; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 16px; }
  .stat-value { font-size: 34px; }
  .calendar-card { padding: 14px 10px; }
  .calendar-grid { gap: 4px; }
  .cal-num { font-size: 9px; top: 2px; left: 3px; }
  .cal-more { font-size: 9px; padding: 0 4px; }
  .list-head { margin-top: 36px; }
  .list-title { font-size: 26px; }
  .entry { grid-template-columns: 52px 1fr; padding: 10px; }
  .entry-right { grid-column: 2; text-align: left; display: flex; gap: 10px; align-items: center; }
  .entry-right .stars { margin: 0; }
  .entry-list.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }

  .view-head .button { min-height: 40px; padding: 0 14px; font-size: 14px; }
  dialog form { padding: 18px; }
  .stars-input .star { --size: 46px; }
}
