/* Look based on JCD's "Your FMR 101 Favourites" campaign design (26 Oct 2026).
   Avenir is built into iPhones and Macs; other devices fall back to a similar system font.
   campaign-logo.png is a stand-in cut from the design PDF until JCD sends the logo files. */
:root {
  --campaign: #193b93;      /* campaign blue */
  --campaign-ink: #ffffff;
  --accent: #f0c927;        /* yellow */
  --vote: #95242a;          /* red "Vote now" */
  --vote-ink: #f0c927;
  --classical: #8fdeff;     /* light blue from the logo's keyboard (to confirm against JCD's palette) */
  --classical-ink: #193b93; /* text on the light blue */
  --classical-tint: #d3f2ff;
  --classical-soft: #eef9ff;
  --jazz: #61528c;          /* purple */
  --jazz-tint: #c0bad1;
  --jazz-soft: #efedf5;
  --tab: #bfbfbf;
  --ink: #23252f;
  --muted: #595c65;
  --line: #dcdfe6;
  --card: #ffffff;
  --error: #b00020;
  --radius: 10px;
  --wrap: 720px;
  --font: "Avenir Next", Avenir, "Segoe UI", "Nunito Sans", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--campaign); }
body { margin: 0; font-family: var(--font); color: var(--campaign-ink); background: var(--campaign); line-height: 1.45; }
h1, h2 { font-family: var(--font); line-height: 1.2; }
h1 { font-size: 1.75rem; font-weight: 400; text-transform: uppercase; margin: 0 0 .75rem; padding-bottom: .5rem; border-bottom: 1px solid rgba(255,255,255,.8); letter-spacing: .01em; }
h1 em { font-style: normal; font-weight: 800; color: var(--accent); }
h2 { font-size: 1.25rem; margin: 0; }
a { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

.hero-top { display: flex; justify-content: center; padding: 20px 0 12px; }
.campaign-logo { display: block; width: min(78%, 300px); height: auto; }
.hero { padding: 4px 0 12px; }
.hero p { margin: 0; }
.banner { margin: 8px 0 0; padding: 12px 16px; border-radius: var(--radius); background: #fff; color: var(--ink); }
.notice { padding: 24px 0; }
.notice h1 { font-weight: 800; }
.notice:focus { outline: none; }

.controls { position: sticky; top: 0; z-index: 5; background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 12px; margin: 0 -4px 8px; box-shadow: 0 6px 14px rgba(0,0,0,.15); }
.search { display: block; }
.search-label { display: block; font-weight: 700; font-size: .875rem; margin-bottom: 6px; }
.search input { width: 100%; font: inherit; font-size: 16px; min-height: 46px; padding: 10px 14px 10px 38px; border: 1px solid #c4c6cc; border-radius: 6px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23595c65' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 13px center; color: var(--ink); }
.controls-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex: 1 1 240px; }
.tab { flex: 1; min-height: 44px; font: inherit; font-size: .875rem; text-transform: uppercase; letter-spacing: .03em; border: 0; border-radius: 2px; background: var(--tab); color: #fff; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--ink); font-weight: 700; }
.tab-classical[aria-selected="true"] { background: var(--classical); color: var(--classical-ink); }
.tab-jazz[aria-selected="true"] { background: var(--jazz); }
.result-count { color: var(--muted); font-size: .8125rem; margin: 0; }

.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.track { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: var(--card); color: var(--ink); border-radius: var(--radius); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.track.has-votes[data-genre="Classical"] { background: var(--classical-soft); box-shadow: inset 4px 0 0 var(--classical), 0 2px 6px rgba(0,0,0,.12); }
.track.has-votes[data-genre="Jazz"] { background: var(--jazz-soft); box-shadow: inset 4px 0 0 var(--jazz), 0 2px 6px rgba(0,0,0,.12); }
.track-text { flex: 1; min-width: 0; }
.track-title { font-weight: 700; overflow-wrap: anywhere; }
.track-meta { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.genre { display: inline-block; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; margin-right: 6px; border-radius: 2px; vertical-align: 1px; }
.genre-Classical { background: var(--classical-tint); color: var(--classical-ink); }
.genre-Jazz { background: var(--jazz-tint); color: #3f3461; }
.track-action { flex: none; }

.btn { font: inherit; font-weight: 700; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--vote); color: var(--vote-ink); text-transform: uppercase; letter-spacing: .03em; }
.btn-secondary { background: #fff; color: var(--campaign); border-color: currentColor; }
.btn-block { width: 100%; }
.btn-vote { border-radius: 2px; min-width: 76px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--ink); }
.track[data-genre="Classical"] .btn-vote { background: var(--classical); color: var(--classical-ink); }
.track[data-genre="Jazz"] .btn-vote { background: var(--jazz); }

.stepper { display: inline-flex; align-items: center; gap: 4px; --c: var(--ink); --c-ink: #fff; --c-line: var(--ink); }
.track[data-genre="Classical"] .stepper, .review-list [data-genre="Classical"] .stepper { --c: var(--classical); --c-ink: var(--classical-ink); --c-line: var(--classical-ink); }
.track[data-genre="Jazz"] .stepper, .review-list [data-genre="Jazz"] .stepper { --c: var(--jazz); --c-ink: #fff; --c-line: var(--jazz); }
.stepper button { width: 44px; height: 44px; border-radius: 2px; border: 2px solid var(--c-line); background: #fff; font-size: 1.375rem; font-weight: 700; line-height: 1; cursor: pointer; color: var(--c-line); }
.stepper button[data-act="inc"] { background: var(--c); border-color: var(--c); color: var(--c-ink); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 28px; text-align: center; font-weight: 800; font-size: 1.125rem; color: var(--ink); }

.no-results { text-align: center; padding: 16px 0 0; }
.suggest-cta { text-align: center; padding: 24px 0 120px; }
.suggest-cta p { margin: 0 0 8px; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; color: var(--ink); border-top: 4px solid var(--accent); box-shadow: 0 -4px 16px rgba(0,0,0,.18); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar-count { margin: 0; }
.bar.full .bar-count { color: var(--vote); }

.dialog { width: min(100% - 16px, 560px); max-height: calc(100% - 32px); border: 0; border-radius: 14px; padding: 0; color: var(--ink); font-family: var(--font); }
.dialog::backdrop { background: rgba(10, 14, 30, .6); }
.dialog form { padding: 16px 16px 20px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin: -16px -16px 12px; padding: 8px 8px 8px 16px; background: var(--campaign); color: #fff; }
.dialog-head h2 { text-transform: uppercase; font-weight: 400; }
.close { width: 44px; height: 44px; border: 0; background: none; font-size: 1.75rem; cursor: pointer; color: inherit; }
.review-list { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 8px; }
.review-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.review-list .track-text { font-size: .9375rem; }
.remove { border: 0; background: none; color: var(--error); font: inherit; text-decoration: underline; min-height: 44px; cursor: pointer; padding: 0 4px; }
.field { display: grid; gap: 4px; margin: 12px 0; font-weight: 600; }
.field input { font: inherit; font-size: 16px; font-weight: 400; min-height: 48px; padding: 10px 12px; border: 1px solid #9aa0ad; border-radius: 6px; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.req, .opt { font-weight: 400; color: var(--muted); }
.hint { font-weight: 400; font-size: .9375rem; color: var(--campaign); }
button.hint { background: none; border: 0; padding: 0; text-align: left; text-decoration: underline; cursor: pointer; font: inherit; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 4px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--campaign); }
.privacy { font-size: .875rem; color: var(--muted); }
.privacy a { color: var(--campaign); }
.error { color: var(--error); font-weight: 600; }
.leave-test { display: inline; padding: 0; border: 0; background: none; color: var(--campaign); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.notice .error, .banner .error { color: var(--accent); }
.turnstile { margin: 8px 0; min-height: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.summary { padding-left: 20px; }

.site-footer { font-size: .875rem; padding: 8px 0 120px; opacity: .85; }

@media (min-width: 600px) {
  h1 { font-size: 2.125rem; }
  .controls { margin: 0 0 10px; padding: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .track { transition: background-color .15s; }
}

.privacy-page { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 20px 16px; margin: 16px auto 40px; }
.privacy-page h1 { border-bottom-color: var(--line); }
.privacy-page a { color: var(--campaign); }

.tester { margin-top: 32px; font-size: .9375rem; }
.tester summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; opacity: .8; }
.tester-form { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 4px 16px 16px; margin-top: 8px; }
.tester-form .btn-secondary { width: 100%; }
.notice .tester-form .error { color: var(--error); }
