:root {
  --ink: #17191c;
  --muted: #656b73;
  --line: #d9dde2;
  --paper: #f7f8f9;
  --surface: #ffffff;
  --signal: #d71920;
  --signal-dark: #a70e14;
  --spotify: #16733a;
  --spotify-dark: #0d5629;
  --focus: #1769aa;
  --success-bg: #e7f5ec;
  --error-bg: #fae8e8;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(135deg, rgba(23, 25, 28, 0.018) 0, rgba(23, 25, 28, 0.018) 1px, transparent 1px, transparent 14px);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}

a { color: inherit; }
button, input, textarea { min-height: 42px; font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(23, 105, 170, 0.48); outline-offset: 2px; }

.page-width { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.topbar { color: #fff; background: var(--ink); border-bottom: 4px solid var(--signal); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-mark { color: inherit; font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: 0; }
.brand-mark span { display: inline-grid; width: 24px; height: 24px; margin-inline: 2px 4px; place-items: center; color: #fff; background: var(--signal); }
.top-actions, .top-actions form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }

.summary-band { padding: 40px 0 34px; background: var(--surface); border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.summary-heading { margin-bottom: 28px; }
.eyebrow { margin: 0 0 4px; color: var(--signal); font-size: 12px; font-weight: 800; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: "Iowan Old Style", "Palatino Linotype", serif; font-weight: 700; letter-spacing: 0; }
h1 { font-size: 48px; line-height: 1; }
h2 { font-size: 25px; line-height: 1.1; }
.last-run, .count-label { margin: 0; color: var(--muted); font-size: 13px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-block: 1px solid var(--line); }
.metrics div { min-height: 104px; padding: 18px 24px; border-right: 1px solid var(--line); }
.metrics div:first-child { padding-left: 0; }
.metrics div:last-child { border-right: 0; }
.metrics dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.metrics dd { margin: 7px 0 0; font-size: 34px; font-weight: 800; line-height: 1; }
.metrics .metric-date { padding-top: 6px; font-size: 15px; line-height: 1.35; }

.content-stack { display: grid; gap: 42px; padding-block: 30px 64px; }
.command-band { padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.command-grid { display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.inline-form { display: grid; grid-template-columns: auto minmax(150px, 190px) auto minmax(150px, 190px) auto; align-items: center; gap: 10px; }
.inline-form label { color: var(--muted); font-size: 13px; font-weight: 700; }
.sync-form { margin: 0; }

input, textarea { width: 100%; padding: 9px 11px; color: var(--ink); background: var(--surface); border: 1px solid #b8bec6; border-radius: var(--radius); }
input:hover, textarea:hover { border-color: #7b838d; }
textarea { resize: vertical; }
.button { display: inline-flex; min-width: 112px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 750; text-decoration: none; white-space: nowrap; }
.button-primary { color: #fff; background: var(--signal); }
.button-primary:hover { background: var(--signal-dark); }
.button-spotify { color: #fff; background: var(--spotify); }
.button-spotify:hover { background: var(--spotify-dark); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: #aeb4bc; }
.button-secondary:hover { background: #eef0f2; }
.button-quiet { min-width: auto; color: inherit; background: transparent; border-color: transparent; }
.button-quiet:hover { text-decoration: underline; }
.topbar .button-secondary { color: #fff; background: transparent; border-color: #666c73; }

.notice { margin: 0; padding: 13px 16px; border-left: 4px solid; border-radius: 0 var(--radius) var(--radius) 0; }
.notice-success { background: var(--success-bg); border-color: var(--spotify); }
.notice-warning { background: #fff4d6; border-color: #b06b00; }
.notice-error { background: var(--error-bg); border-color: var(--signal); }

.playlist-list { border-top: 1px solid var(--line); }
.playlist-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 22px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.playlist-cover-link { display: block; width: 112px; height: 112px; }
.playlist-cover { display: block; width: 112px; height: 112px; object-fit: cover; border-radius: var(--radius); }
.playlist-cover-placeholder { display: flex; align-items: center; justify-content: center; color: #fff; background: var(--ink); font-size: 17px; font-weight: 800; text-decoration: none; }
.playlist-cover-placeholder span { display: inline-grid; width: 30px; height: 30px; margin-left: 3px; place-items: center; background: var(--signal); }
.playlist-copy h3 { margin: 0 0 7px; font-family: "Iowan Old Style", "Palatino Linotype", serif; font-size: 23px; line-height: 1.15; }
.playlist-copy h3 a { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.playlist-copy p { max-width: 760px; margin: 0; color: var(--muted); }

.playlist-detail-heading { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 30px; align-items: center; }
.playlist-detail-cover { width: 180px; height: 180px; }
.playlist-detail-copy { min-width: 0; }
.playlist-detail-copy h1 { margin-top: 12px; overflow-wrap: anywhere; }
.playlist-description { max-width: 760px; margin: 15px 0 0; color: var(--muted); font-size: 16px; }
.playlist-detail-copy .last-run { margin-top: 12px; }
.back-link { color: var(--focus); font-size: 13px; font-weight: 750; text-underline-offset: 3px; }
.playlist-entry-count { margin-bottom: 10px; text-align: right; }
.target-note { margin: -6px 0 14px; color: var(--muted); font-size: 13px; }
.secondary-heading { margin-top: 34px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid #e6e8eb; vertical-align: middle; }
th { color: var(--muted); background: #f1f3f4; font-size: 11px; font-weight: 800; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfb; }
.rank { width: 56px; color: var(--muted); font-variant-numeric: tabular-nums; }
.song-title { font-weight: 750; }
.play-count-cell { width: 86px; }
.play-count-button { min-width: 36px; min-height: 34px; padding: 4px 9px; color: var(--focus); background: #edf5fb; border: 1px solid #b8d3e7; border-radius: var(--radius); font-weight: 800; font-variant-numeric: tabular-nums; text-decoration: underline; text-underline-offset: 3px; }
.play-count-button:hover { color: #0d4c7c; background: #dcecf7; border-color: #82b5d7; }
.status { font-size: 12px; font-weight: 800; text-transform: uppercase; }
.status-accepted { color: var(--spotify); }
.status-review { color: #8a5300; }
.status-rejected { color: var(--signal-dark); }
.status-pending { color: var(--muted); }
.status-warning { color: #8a5300; }
.sync-causes { min-width: 240px; color: var(--muted); font-size: 12px; }
.action-cell { width: 58px; padding-inline: 8px; text-align: right; }
.context-menu { position: relative; display: inline-block; }
.context-menu summary { display: grid; width: 36px; min-height: 36px; padding: 0; place-items: center; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted); cursor: pointer; font-size: 25px; line-height: 1; list-style: none; }
.context-menu summary::-webkit-details-marker { display: none; }
.context-menu summary:hover, .context-menu[open] summary { color: var(--ink); background: #eef0f2; border-color: var(--line); }
.context-menu-popover { position: absolute; z-index: 3; top: calc(100% + 4px); right: 0; min-width: 170px; padding: 5px; background: var(--surface); border: 1px solid #aeb4bc; border-radius: var(--radius); box-shadow: 0 10px 28px rgba(23, 25, 28, 0.18); }
.context-menu-popover button { width: 100%; min-height: 36px; padding: 7px 10px; text-align: left; color: var(--signal-dark); background: transparent; border: 0; border-radius: 4px; white-space: nowrap; }
.context-menu-popover button:hover { background: var(--error-bg); }
.context-menu-popover .context-menu-primary { color: var(--ink); }
.context-menu-popover .context-menu-primary:hover { background: #eef0f2; }

.match-list { border-top: 1px solid var(--line); }
.match-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 28px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.match-song { display: grid; }
.match-song span { color: var(--muted); font-size: 13px; }
.match-dialog-trigger { justify-self: end; }

.runs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.compact-table { font-size: 13px; }
.truncate { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 24px; color: var(--muted); text-align: center; }

.app-dialog { width: min(520px, calc(100% - 32px)); max-height: min(720px, calc(100vh - 32px)); margin: auto; padding: 0; overflow-y: auto; color: var(--ink); background: var(--surface); border: 1px solid #aeb4bc; border-top: 5px solid var(--signal); border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34); }
.app-dialog::backdrop { background: rgba(23, 25, 28, 0.64); }
.dialog-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 24px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dialog-heading h3 { margin: 0; font-family: "Iowan Old Style", "Palatino Linotype", serif; font-size: 25px; line-height: 1.1; }
.dialog-heading form { margin: 0; }
.dialog-close { display: grid; width: 36px; min-height: 36px; padding: 0; place-items: center; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: var(--radius); font-size: 28px; line-height: 1; }
.dialog-close:hover { color: var(--ink); background: #eef0f2; border-color: var(--line); }
.dialog-song { display: grid; gap: 2px; margin: 0; padding: 17px 24px; background: #f1f3f4; border-bottom: 1px solid var(--line); }
.dialog-song strong { font-size: 17px; }
.dialog-song span { color: var(--muted); font-size: 13px; }
.play-time-list { margin: 0; padding: 8px 24px 20px; list-style: none; }
.play-time-list li { position: relative; padding: 12px 0 12px 22px; border-bottom: 1px solid #e6e8eb; }
.play-time-list li:last-child { border-bottom: 0; }
.play-time-list li::before { position: absolute; top: 19px; left: 2px; width: 7px; height: 7px; content: ""; background: var(--signal); border-radius: 50%; }
.play-time-list time { font-weight: 700; font-variant-numeric: tabular-nums; }

.ignore-song-form { display: grid; gap: 12px; padding: 0 24px 24px; }
.ignore-song-form .dialog-song { margin-inline: -24px; }
.ignore-song-form > label { font-weight: 750; }
.optional-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.scope-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 0; padding: 0; border: 0; }
.scope-selector legend { margin-bottom: 7px; font-weight: 750; }
.scope-selector label { position: relative; }
.scope-selector input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.scope-selector span { display: grid; min-height: 42px; padding: 8px 12px; place-items: center; border: 1px solid #aeb4bc; border-radius: var(--radius); cursor: pointer; font-weight: 750; }
.scope-selector input:checked + span { color: #fff; background: var(--ink); border-color: var(--ink); }
.scope-selector input:focus-visible + span { outline: 3px solid rgba(23, 105, 170, 0.48); outline-offset: 2px; }
.scope-impact, .sync-note, .character-count { margin: 0; color: var(--muted); font-size: 12px; }
.character-count { margin-top: -8px; text-align: right; font-variant-numeric: tabular-nums; }
.sync-note { padding-top: 10px; border-top: 1px solid var(--line); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.spotify-match-dialog { width: min(880px, calc(100% - 32px)); }
.spotify-match-body { display: grid; gap: 18px; padding: 20px 24px 24px; }
.source-song { display: grid; gap: 2px; margin: -20px -24px 0; padding: 16px 24px; background: #f1f3f4; border-bottom: 1px solid var(--line); }
.source-song strong { font-size: 17px; }
.source-song > span:last-child { color: var(--muted); font-size: 13px; }
.source-label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.mapping-scope { margin: -8px 0 0; color: var(--muted); font-size: 12px; }
.current-match { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; border-left: 4px solid var(--spotify); background: var(--success-bg); }
.current-match > div { display: grid; gap: 2px; min-width: 0; }
.current-match strong, .current-match span { overflow-wrap: anywhere; }
.current-match > div > span:not(.source-label) { color: var(--muted); font-size: 12px; }
.current-match a, .spotify-result-link { color: var(--focus); font-size: 12px; font-weight: 750; text-underline-offset: 3px; white-space: nowrap; }
.spotify-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.search-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.search-fields label, .manual-track-form label, .ignore-match-section label { display: grid; gap: 5px; font-weight: 750; }
.spotify-search-message { min-height: 22px; margin: -7px 0 -8px; color: var(--muted); font-size: 13px; }
.spotify-search-error { color: var(--signal-dark); font-weight: 750; }
.spotify-results { display: grid; gap: 8px; }
.spotify-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 90px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.spotify-result-selected { background: var(--success-bg); border-color: var(--spotify); box-shadow: inset 4px 0 0 var(--spotify); }
.spotify-result-choice { display: grid; grid-template-columns: 20px 64px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0; cursor: pointer; }
.spotify-result-choice input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--spotify); }
.spotify-result-cover { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.spotify-result-cover-placeholder { display: grid; place-items: center; color: #fff; background: var(--ink); font-family: "Iowan Old Style", "Palatino Linotype", serif; font-size: 27px; font-weight: 700; }
.spotify-result-copy { display: grid; gap: 2px; min-width: 0; }
.spotify-result-copy strong, .spotify-result-copy span, .spotify-result-copy small { overflow-wrap: anywhere; }
.spotify-result-copy > span:not(.current-match-badge) { color: var(--muted); }
.spotify-result-copy small { color: var(--muted); font-size: 12px; }
.current-match-badge { width: fit-content; margin-bottom: 2px; padding: 2px 6px; color: var(--spotify-dark); background: #c8ead4; border-radius: 3px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.load-more-button { justify-self: center; }
.selection-form { display: flex; justify-content: flex-end; padding-top: 2px; }
.manual-track-fallback { padding-top: 15px; border-top: 1px solid var(--line); }
.manual-track-fallback summary { width: fit-content; color: var(--focus); cursor: pointer; font-weight: 750; }
.manual-track-form { display: grid; gap: 7px; margin-top: 12px; }
.manual-track-form > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.dialog-action-section { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.dialog-action-section h4 { margin: 0; font-family: "Iowan Old Style", "Palatino Linotype", serif; font-size: 18px; }
.dialog-action-section > .danger-action, .ignore-match-section .danger-action { justify-self: start; padding-left: 0; color: var(--signal-dark); }
.ignore-match-section form { display: grid; gap: 9px; }
.inline-confirmation { padding: 13px 15px; background: var(--error-bg); border-left: 4px solid var(--signal); }
.inline-confirmation p { margin: 0 0 10px; }
.inline-confirmation form { margin: 0; }

.ignored-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ignored-toolbar form { margin: 0; }
.toggle-control { display: flex; align-items: center; gap: 9px; font-weight: 750; cursor: pointer; }
.toggle-control input { width: 18px; min-height: 18px; accent-color: var(--signal); }
.ignored-song-list { border-top: 1px solid var(--line); }
.ignored-song-group { padding: 24px 0; border-bottom: 1px solid var(--line); }
.ignored-song-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ignored-song-heading h2 { font-size: 22px; }
.ignored-song-heading p { margin: 4px 0 0; color: var(--muted); }
.ignore-rule-list { display: grid; gap: 8px; margin-top: 16px; }
.ignore-rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 13px 15px; background: var(--surface); border-left: 4px solid var(--signal); }
.ignore-rule-history { border-left-color: #aeb4bc; opacity: 0.78; }
.ignore-rule-copy { min-width: 0; }
.ignore-rule-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin: 0; color: var(--muted); font-size: 12px; }
.scope-label { color: var(--ink); font-weight: 800; }
.ignore-reason { margin: 7px 0 0; overflow-wrap: anywhere; }

.login-page { min-height: 100vh; background-color: var(--ink); background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 16px); }
.login-shell { min-height: 100vh; display: grid; padding: 24px; place-items: center; }
.login-panel { width: min(430px, 100%); padding: 34px; background: var(--surface); border-top: 5px solid var(--signal); border-radius: var(--radius); box-shadow: 0 20px 55px rgba(0, 0, 0, 0.3); }
.login-panel h1 { margin: 30px 0 24px; font-size: 40px; }
.login-panel .brand-mark { color: var(--ink); }
.stack-form { display: grid; gap: 12px; }
.stack-form label { font-weight: 750; }
.stack-form .button { margin-top: 6px; }
.error-code { margin: 30px 0 0; color: var(--signal); font-size: 13px; font-weight: 800; }
.technical-details { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.technical-details h2 { margin: 0 0 12px; font-size: 16px; }
.technical-details dl { display: grid; gap: 10px; margin: 0; }
.technical-details dl div { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; }
.technical-details dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.technical-details dd { min-width: 0; margin: 0; }
.technical-details code { overflow-wrap: anywhere; font-size: 12px; }
.login-panel > .button { margin-top: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.public-page { min-height: 100vh; display: flex; flex-direction: column; background-color: #f3f5f4; }
.public-header { color: #fff; background: var(--ink); border-bottom: 5px solid var(--signal); }
.public-header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.public-brand { display: inline-flex; align-items: center; color: inherit; font-size: 17px; font-weight: 800; text-decoration: none; text-transform: uppercase; }
.public-brand span { display: inline-grid; width: 28px; height: 28px; margin-inline: 3px 7px; place-items: center; color: #fff; background: var(--signal); }
.public-header .button-secondary { color: #fff; background: transparent; border-color: #666c73; }
.public-intro { position: relative; padding: 54px 0 48px; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--line); }
.public-intro::after { position: absolute; top: 0; right: max(20px, calc((100vw - 1180px) / 2)); width: 9px; height: 100%; content: ""; background: var(--signal); }
.public-intro-inner { padding-right: 50px; }
.public-intro h1 { max-width: 760px; font-size: 54px; line-height: 1.02; }
.public-intro h1 + p { max-width: 720px; margin: 20px 0 0; color: #464c53; font-size: 18px; line-height: 1.55; }
.public-playlists { flex: 1; padding-block: 38px 70px; }
.public-playlists > .section-heading { padding-bottom: 4px; }
.public-empty { margin: 0; padding: 32px 0; color: var(--muted); border-block: 1px solid var(--line); }
.public-playlist-list { border-top: 1px solid var(--line); }
.public-playlist { padding: 26px 0; border-bottom: 1px solid var(--line); }
.public-playlist-summary { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.public-playlist-cover { display: block; width: 132px; height: 132px; object-fit: cover; border-radius: var(--radius); }
.public-cover-placeholder { display: flex; align-items: center; justify-content: center; color: #fff; background: var(--ink); font-size: 18px; font-weight: 800; }
.public-cover-placeholder span { display: inline-grid; width: 32px; height: 32px; margin-left: 3px; place-items: center; background: var(--signal); }
.public-playlist-copy { min-width: 0; }
.public-playlist-copy h3 { margin: 0; overflow-wrap: anywhere; font-family: "Iowan Old Style", "Palatino Linotype", serif; font-size: 28px; line-height: 1.12; }
.public-playlist-copy > p { max-width: 720px; margin: 9px 0 0; color: #4d535a; }
.public-playlist-copy .public-updated { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.public-spotify-link { min-width: 154px; color: #fff; background: var(--spotify); }
.public-spotify-link:hover { background: var(--spotify-dark); }
.public-tracks { margin: 20px 0 0 156px; border-top: 1px solid var(--line); }
.public-tracks summary { width: fit-content; min-height: 44px; padding: 12px 0 8px; color: var(--focus); cursor: pointer; font-weight: 800; list-style-position: inside; }
.public-tracks ol { margin: 5px 0 0; padding: 0; list-style: none; counter-reset: public-track; border-top: 1px solid var(--line); }
.public-tracks li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 58px; padding: 8px 0; border-bottom: 1px solid #dfe3e1; counter-increment: public-track; }
.public-tracks li::before { color: var(--muted); content: counter(public-track); font-size: 12px; font-variant-numeric: tabular-nums; }
.public-tracks li > span { display: grid; min-width: 0; }
.public-tracks li strong, .public-tracks li small { overflow-wrap: anywhere; }
.public-tracks li small { color: var(--muted); font-size: 12px; }
.public-tracks li > a { color: var(--focus); font-size: 12px; font-weight: 800; text-underline-offset: 3px; }
.public-footer { padding: 24px 0; color: #d5d9dc; background: var(--ink); font-size: 12px; }
.public-error { flex: 1; padding-block: 15vh 70px; }
.public-error h1 { max-width: 780px; }
.public-error > p:not(.eyebrow) { max-width: 650px; color: var(--muted); font-size: 17px; }
.public-error-id { margin-top: 25px; font-size: 12px !important; }
.public-error .button { margin-top: 14px; }

@media (max-width: 850px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics div:nth-child(2) { border-right: 0; }
  .metrics div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metrics div:first-child, .metrics div:nth-child(3) { padding-left: 0; }
  .command-grid, .topbar-inner { align-items: stretch; flex-direction: column; }
  .topbar-inner { padding-block: 14px; }
  .inline-form { grid-template-columns: auto 1fr; }
  .inline-form .button { grid-column: 1 / -1; }
  .sync-form .button { width: 100%; }
  .match-row { grid-template-columns: 1fr; gap: 12px; }
  .match-dialog-trigger { justify-self: start; }
  .runs-grid { grid-template-columns: 1fr; }
  .ignored-song-heading { align-items: flex-start; }
  .public-playlist-summary { grid-template-columns: 112px minmax(0, 1fr); }
  .public-playlist-cover { width: 112px; height: 112px; }
  .public-spotify-link { grid-column: 2; justify-self: start; }
  .public-tracks { margin-left: 136px; }
}

@media (max-width: 560px) {
  .page-width { width: min(100% - 24px, 1180px); }
  .top-actions { width: 100%; justify-content: space-between; }
  .top-actions .button { min-width: auto; }
  .summary-band { padding-top: 30px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  h1 { font-size: 36px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics div { min-height: 92px; padding: 14px 12px; }
  .metrics dd { font-size: 27px; }
  .metrics .metric-date { overflow-wrap: anywhere; font-size: 12px; }
  .button { min-width: 0; }
  .playlist-row { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; }
  .playlist-cover-link, .playlist-cover { width: 84px; height: 84px; }
  .playlist-copy h3 { font-size: 19px; }
  .playlist-detail-heading { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; }
  .playlist-detail-cover { width: 96px; height: 96px; }
  .playlist-detail-copy h1 { margin-top: 7px; font-size: 28px; }
  .playlist-description { font-size: 14px; }
  .play-history-dialog { width: calc(100% - 24px); max-height: calc(100vh - 24px); }
  .app-dialog { width: calc(100% - 24px); max-height: calc(100vh - 24px); }
  .dialog-heading, .dialog-song { padding-inline: 18px; }
  .play-time-list { padding-inline: 18px; }
  .ignore-song-form { padding-inline: 18px; }
  .ignore-song-form .dialog-song { margin-inline: -18px; }
  .ignored-toolbar, .ignored-song-heading { align-items: stretch; flex-direction: column; }
  .ignore-rule { grid-template-columns: 1fr; gap: 8px; }
  .ignore-rule form .button { padding-left: 0; }
  .scope-selector { grid-template-columns: 1fr; }
  .spotify-match-body { padding-inline: 18px; }
  .source-song { margin-inline: -18px; padding-inline: 18px; }
  .spotify-search-form, .search-fields, .manual-track-form > div { grid-template-columns: 1fr; }
  .spotify-result { grid-template-columns: 1fr; }
  .spotify-result-link { padding-left: 44px; }
  .current-match { align-items: flex-start; flex-direction: column; }
  .login-panel { padding: 26px 22px; }
  .public-header-inner { min-height: 68px; }
  .public-header .button { padding-inline: 10px; }
  .public-intro { padding-block: 38px 34px; }
  .public-intro::after { right: 12px; width: 5px; }
  .public-intro-inner { padding-right: 28px; }
  .public-intro h1 { font-size: 38px; }
  .public-intro h1 + p { margin-top: 16px; font-size: 16px; }
  .public-playlists { padding-block: 28px 50px; }
  .public-playlist { padding-block: 20px; }
  .public-playlist-summary { grid-template-columns: 82px minmax(0, 1fr); gap: 14px; align-items: start; }
  .public-playlist-cover { width: 82px; height: 82px; }
  .public-cover-placeholder { font-size: 13px; }
  .public-cover-placeholder span { width: 24px; height: 24px; }
  .public-playlist-copy h3 { font-size: 21px; }
  .public-playlist-copy > p { font-size: 13px; }
  .public-spotify-link { grid-column: 1 / -1; width: 100%; }
  .public-tracks { margin: 16px 0 0; }
  .public-tracks li { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; }
  .public-tracks li > a { padding: 8px 0 8px 8px; }
  .public-footer { line-height: 1.55; }
}