/* tunebard: a bard who turns written music into sound. The look is a cosy autumn-forest evening: a deep teal night,
   dark wooden stalls, rust and amber leaves, pumpkin, golden fairy lights, a wine-red blanket, cream highlights.
   A working tool first: mobile-first, WCAG AA for every text/background pair (ARCHITECTURE.md lists them), visible
   gold focus, no motion for those who ask for none. One dark theme (color-scheme: dark) with explicit backgrounds
   everywhere so the OS theme can't leak in. The score itself and the original pages stay on light paper (.paper
   re-scopes the text tokens to ink). Fonts are self-hosted (SIL OFL 1.1, web/vendor/README.md); motifs are in
   /img/motifs.svg. */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/vendor/fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 500; font-display: swap;
  src: url("/vendor/fonts/fraunces-latin-500-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/vendor/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/vendor/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/vendor/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  /* the night: page background (a teal gradient) */
  --night: #1b2a2c;
  --night-2: #22343a;
  /* wood: cards and surfaces */
  --wood: #3a2a22;         /* cards */
  --wood-2: #43302a;       /* raised fills, popovers */
  --wood-3: #2c201a;       /* inset fills: inputs, chips, tracks */
  /* text */
  --text: #f3e6cf;         /* cream: 10:1 or more on every night/wood surface */
  --muted: #cbb89a;        /* sand: 6.4:1 or more on every night/wood surface */
  --line: #5a4436;         /* hairlines (decorative) */
  --line-strong: #9c7f62;  /* input / control borders: 3:1 or more on wood and night */
  /* lantern light */
  --pumpkin: #d9822b;      /* primary actions; text on it is --on-pumpkin (6.2:1) */
  --pumpkin-hi: #e8954a;   /* hover (7.6:1 with --on-pumpkin) */
  --pumpkin-deep: #8f4f15; /* the pressed edge under a pumpkin button */
  --on-pumpkin: #1f1410;
  --gold: #f2c46b;         /* fairy lights: sparkles, focus, links (7.6:1 or more on night/wood) */
  --gold-soft: rgba(242, 196, 107, 0.16);
  --rust: #b8562a;         /* leaves (decoration only) */
  --wine: #7a2e3a;         /* the blanket: secondary accent; cream on it 7.5:1 */
  --wine-hi: #8e3846;
  --wine-edge: #c0697a;
  /* states (all AA on --wood and on their own -bg) */
  --ok: #a9d59b;
  --ok-bg: #263a2e;
  --warn: #f2c46b;
  --warn-bg: #43361c;
  --err: #ff9e8a;
  --err-bg: #4a2226;
  --focus: #f2c46b;
  /* light paper, for the score and the original pages (OSMD draws dark ink on light) */
  --paper: #fffaf0;
  --paper-2: #f6ecd9;
  --ink: #2b1d14;
  --ink-muted: #65513f;    /* 7.2:1 on --paper */
  --paper-line: #e2d2b4;
  --amber-ink: #8a5212;    /* amber that reads on paper (focus there too) */

  --radius: 14px;
  --bar-h: 72px;
  --shadow: 0 1px 0 rgba(255, 236, 200, 0.06) inset, 0 2px 4px rgba(0, 0, 0, 0.25), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
  --glow: 0 0 0 1px rgba(242, 196, 107, 0.35), 0 0 22px -4px rgba(242, 196, 107, 0.45);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* a CSS-only wood grain (SVG noise stretched sideways into streaks), tiled over the wooden surfaces */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .22' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .05 0 0 0 0 .03 0 0 0 .32 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  /* a string of fairy lights for the header: per 72 px tile, two sags of one wire (each starts and ends at y=2, so the
     tiles join without a seam; no T: its reflected control point would arch the second span up out of the tile) with a
     gold and an amber bulb hanging by a short cap from each low point (y=6) */
  --lights: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='14' viewBox='0 0 72 14'%3E%3Cpath d='M0 2Q18 10 36 2Q54 10 72 2' fill='none' stroke='%23cbb89a' stroke-opacity='.45' stroke-width='.8'/%3E%3Cpath d='M17.3 5.6h1.4v1.9h-1.4zM53.3 5.6h1.4v1.9h-1.4z' fill='%23a8916f'/%3E%3Ccircle cx='18' cy='9.6' r='4' fill='%23f2c46b' fill-opacity='.16'/%3E%3Ccircle cx='18' cy='9.4' r='1.9' fill='%23f2c46b'/%3E%3Ccircle cx='54' cy='9.6' r='4' fill='%23e8954a' fill-opacity='.14'/%3E%3Ccircle cx='54' cy='9.4' r='1.8' fill='%23e8954a'/%3E%3C/svg%3E");
}

/* light paper: the score panes and the original pages. The text tokens turn to ink inside. */
.paper {
  --text: var(--ink);
  --muted: var(--ink-muted);
  --line: var(--paper-line);
  --line-strong: #c9b089;
  --focus: var(--amber-ink);
  color: var(--text);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0;
  font: 17px/1.55 var(--sans);
  color: var(--text);
  background-color: var(--night);
  /* lantern glow top right, a cooler moonlit haze top left, the night deepening down to the forest floor */
  background-image:
    radial-gradient(ellipse 60% 40% at 88% -6%, rgba(242, 196, 107, 0.13) 0%, rgba(242, 196, 107, 0) 70%),
    radial-gradient(ellipse 50% 35% at 8% 0%, rgba(120, 170, 170, 0.08) 0%, rgba(120, 170, 170, 0) 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 55%, #1d2c30 100%);
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body:not(.ready) main { visibility: hidden; }
body.has-player { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 8px; padding-bottom: 40px; }

a { color: var(--gold); text-underline-offset: 0.15em; }
a:hover { color: #f7d692; }
.paper a { color: var(--amber-ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
h1 { font-size: 1.65rem; line-height: 1.2; margin: 0.6em 0 0.4em; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 1.3em 0 0.5em; }
h3 { font-size: 1.05rem; }
.card h1, .card h2 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.error { color: var(--err); font-weight: 600; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
[hidden] { display: none !important; }
svg use { pointer-events: none; }
code { font-size: 0.95em; padding: 0 4px; border-radius: 4px; background: var(--wood-3); color: var(--text); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------------ header / footer */
.top {
  position: relative; background: rgba(20, 32, 34, 0.72); border-bottom: 1px solid rgba(203, 184, 154, 0.12);
  margin-bottom: 8px;
}
.top::after {  /* the string of fairy lights hanging under the header */
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 14px; pointer-events: none;
  background: var(--lights) repeat-x 6px 0 / 72px 14px; opacity: 0.9;
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 58px; gap: 12px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none;
  font-family: var(--serif); font-weight: 600; font-size: 1.4rem; letter-spacing: 0.005em;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 30px; color: var(--gold); flex: none; filter: drop-shadow(0 0 6px rgba(242, 196, 107, 0.45)); }
.top nav { display: flex; gap: 18px; align-items: center; font-size: 0.98rem; }
.top nav a, .linklike { color: var(--text); }
.top nav a:hover, .top nav .linklike:hover { color: var(--gold); }
.linklike { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.foot { font-size: 0.92rem; padding: 8px 0 22px; background: transparent; }
.foot .wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.foot-orn { display: flex; align-items: center; gap: 8px; }
.flourish { width: 160px; height: 16px; color: var(--gold); opacity: 0.8; }
.foot-leaf { width: 16px; height: 16px; color: var(--rust); }
.foot-leaf.r { transform: scaleX(-1); color: var(--pumpkin); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; }
.foot a, .foot .linklike { color: var(--muted); }
.foot a:hover, .foot .linklike:hover { color: var(--gold); }
body.has-player .foot { display: none; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 20px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.25;
  -webkit-tap-highlight-color: transparent; transition: background-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { flex: none; }
.btn-primary { background: var(--pumpkin); color: var(--on-pumpkin); box-shadow: 0 2px 0 var(--pumpkin-deep); }
.btn-primary:hover:not(:disabled) { background: var(--pumpkin-hi); color: var(--on-pumpkin); }
.btn-secondary { background: var(--wood-3); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--wood-2); color: var(--text); border-color: var(--gold); }
.btn-accent {
  background: var(--wine); color: var(--text); width: 100%; font-size: 1.05rem; border-color: var(--wine-edge);
  box-shadow: 0 2px 0 #4f1c26;
}
.btn-accent:hover:not(:disabled) { background: var(--wine-hi); color: var(--text); }
.btn-google { background: #fff; color: #1f1f1f; border-color: #c4c7c5; width: 100%; max-width: 22rem; }
.btn-google:hover { color: #1f1f1f; background: #fdfbf7; }

.card {
  background-color: var(--wood); background-image: var(--grain); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; box-shadow: var(--shadow);
}

/* ------------------------------------------------------------------ signed out: the landing */
.landing { padding-top: 8px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; font-family: var(--serif);
  font-style: italic; font-weight: 500; color: var(--gold); font-size: 1.05rem;
}
.i-spark { width: 16px; height: 16px; color: var(--gold); filter: drop-shadow(0 0 4px rgba(242, 196, 107, 0.6)); }
.hero { font-size: 2.1rem; line-height: 1.12; margin: 0.25em 0 0.45em; letter-spacing: -0.015em; }
.lead { font-size: 1.12rem; margin: 0 0 18px; color: var(--text); }
.signin-box { margin: 0 0 8px; }
.signin-note { margin: 10px 0 0; }
.dev { margin-top: 24px; border-style: dashed; border-color: var(--gold); background: var(--warn-bg); box-shadow: none; }
.dev h2 { font-size: 1rem; font-family: var(--sans); font-weight: 700; }
.dev label { display: block; font-weight: 600; margin-bottom: 4px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
input[type="email"] {
  font: inherit; color: var(--text); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px;
  min-height: 48px; background: var(--wood-3);
}

.points { list-style: none; padding: 0; margin: 22px 0 8px; display: grid; gap: 10px; }
.points li {
  display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center;
  padding: 12px 14px; background: rgba(58, 42, 34, 0.82); border: 1px solid var(--line); border-radius: 12px;
}
.points svg {
  width: 40px; height: 40px; padding: 8px; border-radius: 50%; color: var(--pumpkin-hi);
  background: var(--wood-3); border: 1px solid rgba(242, 196, 107, 0.35);
}

/* the illustrated promise: page -> lute -> files, on a little lantern-lit wooden stall */
.hero-art {
  margin: 22px 0 0; padding: 18px 14px 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 6px; background-color: var(--wood); background-image: var(--grain); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); position: relative;
}
.hero-art::before {  /* a thin gold inner frame */
  content: ""; position: absolute; inset: 6px; border: 1px solid rgba(242, 196, 107, 0.3); border-radius: 13px; pointer-events: none;
}
.art-leaf { position: absolute; width: 22px; height: 22px; pointer-events: none; }
.art-leaf.l1 { top: -9px; left: 18px; color: var(--rust); transform: rotate(-25deg); }
.art-leaf.l2 { bottom: -8px; right: 26px; color: var(--pumpkin); transform: rotate(140deg); width: 18px; height: 18px; }
.art-page { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.art-sheet { width: 92px; height: 115px; transform: rotate(-4deg); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45)); }
.art-label, .art-file small { font-size: 0.8rem; color: var(--muted); text-align: center; line-height: 1.25; }
.art-bard { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.art-lute { width: 50px; height: 50px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(242, 196, 107, 0.5)); }
.art-spark { position: absolute; color: var(--gold); }
.art-spark.s1 { width: 16px; height: 16px; top: -4px; left: 0; }
.art-spark.s2 { width: 11px; height: 11px; bottom: 2px; right: -2px; }
.art-out { display: grid; gap: 10px; justify-items: stretch; }
.art-file {
  display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 8px 10px; background: var(--wood-3); border: 1px solid var(--line); border-radius: 10px;
}
.art-file svg { grid-row: span 2; width: 24px; height: 24px; color: var(--pumpkin-hi); }
.art-file b { font-size: 0.98rem; line-height: 1.1; }
.art-file small { text-align: left; }

/* ------------------------------------------------------------------ upload */
.upload { position: relative; padding-top: 20px; }
.upload h1 { margin-bottom: 2px; }
.upload-sub { margin: 0 0 14px; }
.upload .btn-file { width: 100%; font-size: 1.08rem; min-height: 56px; }
.upload .btn-file svg { width: 22px; height: 22px; }
.upload #upload-submit { margin-top: 8px; }
.file-list { list-style: none; padding: 0; margin: 8px 0; font-size: 0.95rem; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tips { margin-top: 12px; font-size: 0.97rem; }
.tips summary { cursor: pointer; color: var(--gold); font-weight: 600; }
.tips ul { margin: 8px 0 0; padding-left: 1.2em; color: var(--muted); }

/* ------------------------------------------------------------------ my scores */
.section-title { display: flex; align-items: center; gap: 10px; margin-top: 1.5em; }
.section-title svg { width: 22px; height: 22px; color: var(--pumpkin-hi); }
.score-list { list-style: none; padding: 0; margin: 0; }
.score-list a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  padding: 13px 16px; margin-bottom: 10px; background-color: var(--wood); background-image: var(--grain);
  border: 1px solid var(--line); border-left: 4px solid var(--pumpkin); border-radius: 12px; color: var(--text);
  text-decoration: none; box-shadow: var(--shadow); transition: box-shadow 0.15s, border-color 0.15s;
}
.score-list a:hover { border-color: rgba(242, 196, 107, 0.5); border-left-color: var(--gold); box-shadow: var(--shadow), var(--glow); color: var(--text); }
.s-title { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-meta { font-size: 0.88rem; grid-column: 1; }
.badges { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 2px 10px; border-radius: 999px;
  background: var(--wood-3); color: var(--muted); white-space: nowrap; border: 1px solid var(--line);
}
.b-done { background: var(--ok-bg); color: var(--ok); border-color: #3f5c48; }
.b-failed { background: var(--err-bg); color: var(--err); border-color: #6e3438; }
.b-processing, .b-queued, .b-exporting { background: var(--warn-bg); color: var(--warn); border-color: #6b5526; }
.b-unlocked { background: var(--wine); color: var(--text); border-color: var(--wine-edge); }
.paper .badge.b-processing { background: #f3e2b5; color: var(--amber-ink); border-color: #e6cd8f; }
.empty { padding: 18px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 12px; background: rgba(44, 32, 26, 0.6); }

/* ------------------------------------------------------------------ score view */
.back { margin: 14px 0 0; font-size: 0.97rem; }
.back a { text-decoration: none; }
.score-title { word-break: break-word; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--gold-soft); border-top-color: var(--gold);
  animation: spin 0.9s linear infinite; flex: none; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* progress: the bard reading, page by page, by lantern light */
.progress-head { display: flex; gap: 14px; align-items: flex-start; }
.progress-head h2 { margin: 2px 0 4px; }
.progress-head p { margin: 0; }
.quill-wrap {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(242, 196, 107, 0.28) 0%, rgba(242, 196, 107, 0.08) 70%);
  border: 1px solid rgba(242, 196, 107, 0.45);
}
.quill { width: 30px; height: 30px; color: var(--gold); transform-origin: 15% 85%; animation: write 1.6s ease-in-out infinite; }
@keyframes write {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(2px, -1px) rotate(-6deg); }
  50% { transform: translate(4px, 0) rotate(2deg); }
  75% { transform: translate(2px, 1px) rotate(-4deg); }
}
.page-list { list-style: none; padding: 0; margin: 12px 0 0; }
.page { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  padding: 11px 0; border-top: 1px dashed var(--line); }
.page-list > li.muted { padding: 11px 0; border-top: 1px dashed var(--line); font-style: italic; }
.p-name { font-weight: 600; }
.p-msg { flex-basis: 100%; margin: 0; font-size: 0.92rem; }
.p-msg.warn { color: var(--warn); }
.page.p-processing .p-name::after { content: " ✦"; color: var(--gold); }
.failed { border-color: #6e3438; background-color: #3a2224; }
.failed h2 { color: var(--err); }
#failed-text { font-size: 1.05rem; }
.warnings { background-color: var(--warn-bg); background-image: none; border-color: #6b5526; font-size: 0.97rem; box-shadow: none; }
.warnings summary { cursor: pointer; font-weight: 700; color: var(--warn); }
.warnings ul { margin: 8px 0 0; padding-left: 1.2em; }
#sheet-status { padding: 24px 0; text-align: center; font-style: italic; }
.sheet { background: #fff; min-height: 40px; }
.sheet svg { display: block; max-width: 100%; height: auto; }

/* the buy card: a normal offer with its price. What happens on the click is the surprise (the gift dialog below). */
.buy {
  text-align: center; position: relative; padding-top: 20px; border-color: rgba(242, 196, 107, 0.4);
  background-image: var(--grain), linear-gradient(180deg, #46322a 0%, #3a2a22 100%);
}
.buy::before {  /* the stall's lit inner frame */
  content: ""; position: absolute; inset: 5px; border: 1px solid rgba(242, 196, 107, 0.22); border-radius: 10px; pointer-events: none;
}
.buy-lead { margin: 0 0 14px; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.btn-buy {
  width: 100%; min-height: 58px; padding: 10px 20px; font-size: 1.1rem; color: var(--on-pumpkin); background: var(--pumpkin);
  box-shadow: 0 2px 0 var(--pumpkin-deep), 0 0 26px -6px rgba(242, 160, 70, 0.65);
}
.btn-buy:hover:not(:disabled) { background: var(--pumpkin-hi); color: var(--on-pumpkin); }
.btn-buy svg { width: 22px; height: 22px; }
.buy-what { margin: 12px 0 0; }
.buy #buy-note { margin: 8px 0 0; }
.buy .dev-tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--warn-bg); border: 1px dashed var(--gold); color: var(--warn);
}
.downloads { border-color: rgba(242, 196, 107, 0.45); }
.downloads h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.downloads h2:focus { outline: none; }
.downloads h2:focus-visible { outline: 3px solid var(--focus); }
.downloads h2 .seal { width: 32px; height: 32px; flex: none; }
.downloads .gift-note {
  display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 12px; padding: 2px 12px 2px 8px;
  border-radius: 999px; background: var(--wine); border: 1px solid var(--wine-edge); color: var(--text);
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 0.95rem;
}
.gift-note svg { width: 14px; height: 14px; color: var(--gold); }
.parts-title { font-size: 1rem; margin: 16px 0 8px; }
.downloads p { margin: 12px 0 0; }
.download-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.download-list.parts { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.btn-download {
  width: 100%; height: 100%; flex-direction: column; gap: 0; padding: 8px 12px;
  background: var(--wood-3); color: var(--text); border-color: var(--line-strong);
}
.btn-download:hover { background: var(--wood-2); color: var(--text); border-color: var(--gold); }
.dl-label { font-size: 1.02rem; color: var(--gold); }
.dl-sub { font-size: 0.8rem; font-weight: 400; color: var(--muted); line-height: 1.3; }

/* the surprise: a small modal (native <dialog>: focus stays inside, Esc closes) with the wax seal and sparkles */
.gift-dialog {
  width: min(26rem, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 26px 20px 20px;
  border: 1px solid rgba(242, 196, 107, 0.55); border-radius: 18px; color: var(--text); text-align: center;
  background-color: var(--wood);
  background-image: radial-gradient(ellipse 90% 55% at 50% 0%, rgba(242, 196, 107, 0.2) 0%, rgba(242, 196, 107, 0) 70%), var(--grain);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.75), var(--glow);
}
.gift-dialog::backdrop { background: rgba(10, 18, 20, 0.74); }
.gift-dialog[open] { animation: gift-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) 1; }
@keyframes gift-in { from { opacity: 0; transform: translateY(10px) scale(0.94); } to { opacity: 1; transform: none; } }
.gift-x {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.gift-x:hover { color: var(--text); background: var(--wood-2); }
.gift-seal { position: relative; width: 84px; height: 84px; margin: 0 auto 6px; display: grid; place-items: center; }
.gift-seal .seal { width: 72px; height: 72px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); animation: seal-in 0.6s ease-out 1; }
@keyframes seal-in {
  0% { transform: scale(1.4) rotate(-12deg); opacity: 0; }
  70% { transform: scale(0.96) rotate(2deg); opacity: 1; }
  100% { transform: none; }
}
.gift-seal .sp { position: absolute; color: var(--gold); filter: drop-shadow(0 0 5px rgba(242, 196, 107, 0.8)); animation: twinkle 1.6s ease-in-out 3; }
.gift-seal .sp1 { width: 18px; height: 18px; top: -4px; left: -10px; }
.gift-seal .sp2 { width: 12px; height: 12px; top: 8px; right: -12px; animation-delay: 0.4s; }
.gift-seal .sp3 { width: 14px; height: 14px; bottom: -2px; right: -4px; animation-delay: 0.8s; }
.gift-seal .lf { position: absolute; width: 20px; height: 20px; bottom: 0; left: -14px; color: var(--rust); transform: rotate(-30deg); }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
.gift-kicker { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.15rem; color: var(--gold); }
.gift-dialog h2 { margin: 2px 0 6px; font-size: 1.5rem; }
.gift-text { margin: 0 0 16px; }
.gift-dialog .gift-more { margin-top: 12px; width: 100%; }

/* original | recognised */
.view-toggle {
  display: flex; margin: 16px 0 8px; padding: 4px; gap: 4px; background: var(--wood-3); border: 1px solid var(--line);
  border-radius: 12px;
}
.view-toggle button {
  flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer;
}
.view-toggle button[aria-selected="true"] { background: var(--wood-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--pumpkin), 0 1px 3px rgba(0, 0, 0, 0.35); }
.compare[data-show="original"] .pane-recognised, .compare[data-show="recognised"] .pane-original { display: none; }
.pane {
  border: 1px solid #d9c6a2; border-radius: var(--radius); overflow: hidden; margin: 0 0 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 34px -14px rgba(0, 0, 0, 0.7), 0 0 40px -18px rgba(242, 196, 107, 0.4);
}
.pane-title {
  margin: 0; padding: 9px 14px; font-family: var(--serif); font-size: 0.98rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink); border-bottom: 1px solid var(--paper-line); background: var(--paper-2);
}
.originals { padding: 8px; display: grid; gap: 12px; background: var(--paper); }
.original { margin: 0; }
.original img { display: block; width: 100%; height: auto; border: 1px solid var(--paper-line); border-radius: 6px; background: #fff; }
.original figcaption { padding: 4px 2px 0; }
.original-missing { padding: 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 6px; }
.credit { margin-top: 6px; font-size: 0.82rem; }

/* instruments: one row per part; staff boxes on the original page */
.instruments summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.instruments summary .muted { font-family: var(--sans); font-weight: 400; }
.inst-intro { margin: 6px 0 10px; }
.inst-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0 20px; }
.inst-row {
  display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; align-items: center; gap: 2px 8px;
  padding: 9px 0; border-top: 1px dashed var(--line);
}
.inst-part { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.inst-select {
  font: inherit; font-size: 1rem; min-height: 44px; min-width: 0; width: 100%; padding: 6px 32px 6px 10px;
  border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); -webkit-appearance: none; appearance: none;
  background: var(--wood-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23cbb89a' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.inst-select option, .inst-select optgroup { background: var(--wood); color: var(--text); }
.inst-select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.inst-select:disabled { opacity: 0.6; }
.inst-row.low .inst-select { border-color: var(--gold); background-color: var(--warn-bg); }
.inst-hint { grid-column: 2 / span 2; margin: 0; font-size: 0.84rem; color: var(--muted); line-height: 1.35; }
.inst-hint.low { color: var(--warn); }
.inst-mute {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
}
.inst-mute:hover { background: var(--wood-2); color: var(--text); }
.inst-mute .i-mute, .inst-mute[aria-pressed="true"] .i-waves { display: none; }
.inst-mute[aria-pressed="true"] .i-mute { display: inline; }
.inst-mute[aria-pressed="true"] { color: var(--err); background: var(--err-bg); }
.inst-row.muted-part .inst-part { color: var(--muted); text-decoration: line-through; }
.inst-status { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; color: var(--gold); font-weight: 600; }
.inst-status.error { color: var(--err); }
.pane-title .badge { margin-left: 8px; font-family: var(--sans); vertical-align: 1px; }
.page-frame { position: relative; }
.staff-boxes { position: absolute; inset: 0; pointer-events: none; }
.staff-box {
  position: absolute; border-radius: 4px; border: 2px solid transparent; transition: background-color 0.12s, border-color 0.12s;
}
.staff-box.on { border-color: rgba(176, 102, 20, 0.9); background: rgba(214, 150, 46, 0.18); }
.staff-tag {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%); display: none; opacity: 0.95;
  font: 700 0.7rem/1 var(--sans); color: #fff; background: var(--amber-ink); padding: 3px 5px; border-radius: 4px;
}
.staff-box.on .staff-tag { display: block; }

/* bottom player bar: a dark wooden shelf under a line of lantern light */
.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(36, 26, 21, 0.97);
  border-top: 1px solid rgba(242, 196, 107, 0.55); box-shadow: 0 -2px 0 rgba(242, 196, 107, 0.08), 0 -8px 24px rgba(0, 0, 0, 0.45);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.player-row { display: flex; align-items: center; gap: 12px; }
.btn-play { background: var(--pumpkin); color: var(--on-pumpkin); min-width: 7.5rem; border-radius: 999px; box-shadow: 0 2px 0 var(--pumpkin-deep); }
.btn-play:hover { background: var(--pumpkin-hi); color: var(--on-pumpkin); }
.btn-play .i-pause, .btn-play.playing .i-play { display: none; }
.btn-play.playing .i-pause { display: inline; }
.btn-icon { background: var(--wood-2); color: var(--text); border-color: var(--line-strong); padding: 10px 12px; border-radius: 999px; }
.btn-icon:hover { border-color: var(--gold); color: var(--text); }
.sound-note { margin: 6px auto 0; }

/* progress: where we are in the piece; click, drag or arrow keys to move the playhead */
.seek { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.time { flex: none; min-width: 2.7em; font-size: 0.9rem; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
#time-elapsed { text-align: right; }
.seek-bar {
  position: relative; flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; cursor: pointer;
  touch-action: none; -webkit-tap-highlight-color: transparent; border-radius: 8px;
}
.seek-track {
  width: 100%; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--wood-3); box-shadow: inset 0 0 0 1px var(--line-strong);  /* the track's edge: 3:1 on the bar */
}
.seek-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--pumpkin), var(--gold)); border-radius: 999px 0 0 999px; }
.seek-thumb {
  position: absolute; top: 50%; left: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--wood-3); box-shadow: 0 0 0 1px var(--gold), 0 0 10px rgba(242, 196, 107, 0.6);
  transition: transform 0.12s;
}
.seek-bar:hover .seek-thumb, .seek-bar.dragging .seek-thumb, .seek-bar:focus-visible .seek-thumb { transform: scale(1.2); }
.seek-bar:focus-visible { outline-offset: 0; }

/* tempo: a compact pill at the side (- 184 bpm +); its popover has the slider and the score's tempo */
.tempo {
  position: relative; flex: none; display: flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--wood-2); border: 1px solid var(--line-strong); border-radius: 999px;
}
.tempo button {
  display: inline-flex; align-items: center; justify-content: center; font: inherit; color: var(--text);
  background: transparent; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tempo-step {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.tempo-step:hover:not(:disabled) { background: var(--wood-3); }
.tempo-step:disabled { color: #8f7a62; cursor: not-allowed; }
.tempo-btn { gap: 4px; min-height: 38px; padding: 0 8px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tempo-btn:hover, .tempo-btn[aria-expanded="true"] { background: var(--gold-soft); }
.tempo-btn .i-note { color: var(--gold); }
.tempo-num { min-width: 1.9em; text-align: center; font-size: 1.02rem; }
.tempo-unit { font-weight: 400; font-size: 0.82rem; color: var(--muted); }
.tempo-pop {
  position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 25; width: 18rem; max-width: calc(100vw - 32px);
  padding: 12px 14px 10px; background: var(--wood-2); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.7);
}
.tempo-pop::after {  /* a little tail pointing at the tempo button */
  content: ""; position: absolute; right: 40px; bottom: -7px; width: 12px; height: 12px; transform: rotate(45deg);
  background: var(--wood-2); border: solid var(--line-strong); border-width: 0 1px 1px 0;
}
.tempo-pop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 6px; }
.tempo-pop-head span { font-family: var(--serif); font-weight: 600; }
.tempo-pop-head output { font-variant-numeric: tabular-nums; font-size: 0.95rem; text-align: right; color: var(--muted); }
.tempo-pop-row { display: flex; align-items: center; gap: 8px; }
.tempo-pop-row .tempo-step { border: 1px solid var(--line-strong); background: var(--wood-3); }
.tempo-pop-row input { flex: 1; min-width: 0; accent-color: var(--pumpkin); }
.tempo-pop .tempo-reset {
  display: flex; gap: 6px; justify-content: flex-start; margin: 8px 0 0; padding: 4px 6px 4px 2px; border-radius: 8px;
  font-size: 0.92rem; font-weight: 600; color: var(--gold); text-align: left; line-height: 1.35;
}
.tempo-pop .tempo-reset svg { flex: none; }
.tempo-pop .tempo-reset:hover:not(:disabled) span { text-decoration: underline; text-underline-offset: 0.15em; }
.tempo-pop .tempo-reset:disabled { color: var(--muted); font-weight: 400; cursor: default; }

@media (max-width: 639px) {  /* phones: icon-only play, the times under the bar, tempo as just note + number */
  .player-row { gap: 8px; }
  .btn-play { min-width: 0; width: 48px; padding: 0; }
  .btn-play #play-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .btn-icon { padding: 10px; }
  .seek { display: grid; grid-template-columns: auto auto; justify-content: space-between; row-gap: 0; column-gap: 0; }
  .seek-bar { grid-column: 1 / -1; grid-row: 1; height: 28px; }
  .time { grid-row: 2; font-size: 0.78rem; min-width: 0; }
  #time-elapsed { text-align: left; }
  #time-total { text-align: right; }
  .tempo-step-inline, .tempo-unit { display: none !important; }
  .tempo { padding: 2px; }
  .tempo-btn { min-height: 42px; padding: 0 10px 0 6px; }
  .tempo-pop::after { right: 22px; }
}

/* cookie banner: a wooden shelf at the bottom with a gold edge */
.cookie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; color: var(--text);
  background-color: var(--wood); background-image: var(--grain);
  border-top: 2px solid var(--gold); box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); font-size: 0.95rem;
}
.cookie p { margin: 0 0 10px; }
.cookie-actions { display: flex; gap: 8px; }
.cookie-actions .btn { flex: 1; min-height: 44px; }

/* flash */
.flash { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--err-bg); color: var(--err); font-weight: 600; border: 1px solid #6e3438; }

/* legal pages (text from en.json legal.<page>.<n>, rendered by js/legal.js) */
.legal { padding-top: 16px; padding-bottom: 24px; max-width: 46rem; }
.legal-card {
  background-color: var(--wood); background-image: var(--grain); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 8px; box-shadow: var(--shadow); line-height: 1.55; overflow-wrap: anywhere;
}
.legal-card h1 { margin: 0 0 0.2em; }
.legal-card h2 { font-size: 1.15rem; padding-top: 0.9em; border-top: 1px dashed var(--line); }
.legal-card ul { padding-left: 1.2em; }
.legal-card li { margin: 0.3em 0; }
.legal-updated { margin: 0 0 1em; }
.legal-summary { background: var(--wood-3); border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0; padding: 4px 16px; margin: 0 0 1em; }
.legal-summary ul { margin: 0.5em 0; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 0.6em 0 1em; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); }
.legal-table th { font-weight: 600; color: var(--gold); }
.legal-table { overflow-wrap: normal; }
.legal-table code { font-size: 0.95em; white-space: nowrap; }
.legal .linklike { color: var(--gold); }

/* landing pages (/pdf-to-midi, ...: web/landing.html, rendered by the server from en.json seo.<key>.*), the home's
   "Popular conversions" and the footer's conversion links */
.lp { padding-bottom: 32px; }
.lp-hero .hero { font-size: 1.95rem; }
.lp-cta { border-color: rgba(242, 196, 107, 0.45); }
.lp-cta h2 { margin-bottom: 12px; }
.lp-upload { width: 100%; font-size: 1.08rem; min-height: 56px; text-decoration: none; }
.lp-upload svg { width: 22px; height: 22px; }
.lp-cta p { margin: 10px 0 0; }
.lp-outs { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lp-outs li {
  display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; align-items: center; padding: 8px 10px;
  background: var(--wood-3); border: 1px solid var(--line); border-radius: 10px;
}
.lp-outs svg { grid-row: span 2; width: 22px; height: 22px; color: var(--pumpkin-hi); }
.lp-outs b { font-size: 0.98rem; line-height: 1.15; }
.lp-outs small { font-size: 0.8rem; color: var(--muted); line-height: 1.25; }
.lp-body { line-height: 1.6; font-size: 1.04rem; }
.lp-body h2 { display: flex; align-items: center; gap: 10px; margin-top: 1.6em; }
.lp-body h2::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--pumpkin);
  box-shadow: 0 0 10px rgba(232, 149, 74, 0.6); }
.lp-body p { margin: 0.6em 0; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0.8em 0; display: grid; gap: 10px; }
.steps li {
  counter-increment: step; position: relative; padding: 12px 14px 12px 56px; background: rgba(58, 42, 34, 0.82);
  border: 1px solid var(--line); border-radius: 12px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; color: var(--on-pumpkin); background: var(--gold);
}
.lp-list { padding-left: 1.2em; }
.lp-list li { margin: 0.35em 0; }
.lp-list li::marker { color: var(--gold); }
.faq { display: grid; gap: 10px; margin-top: 0.8em; }
.faq-item { padding: 12px 16px; background: rgba(58, 42, 34, 0.82); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 0 12px 12px 0; }
.faq-item h3 { margin: 0.1em 0 0.3em; font-size: 1.05rem; }
.faq-item p { margin: 0.3em 0; }
.lp-cta-end { margin-top: 28px; text-align: center; }
.lp-related h2, .popular h2 { font-size: 1.2rem; }
.conv-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.conv-list li {
  display: grid; gap: 2px; padding: 10px 14px; background: rgba(58, 42, 34, 0.82); border: 1px solid var(--line);
  border-left: 3px solid var(--pumpkin); border-radius: 0 12px 12px 0;
}
.conv-list a { font-weight: 600; }
.popular { margin-top: 28px; }
.foot-conv { text-align: center; margin: 4px 0 6px; }
.foot-conv-title { margin: 0 0 4px; color: var(--text); font-weight: 600; }
.foot-conv ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; }

@media (min-width: 640px) {
  h1 { font-size: 1.9rem; }
  .hero { font-size: 2.7rem; }
  .card { padding: 22px; }
  .cookie-row { display: flex; align-items: center; gap: 16px; }
  .cookie p { margin: 0; flex: 1; }
  .cookie-actions .btn { flex: none; }
  .points { grid-template-columns: repeat(3, 1fr); }
  .points li { grid-template-columns: 1fr; align-items: start; padding: 16px; }
  .upload .btn-file { width: auto; min-width: 20rem; }
  .upload #upload-submit { width: auto; min-width: 20rem; }
  .btn-buy { width: auto; min-width: 22rem; }
  .gift-dialog { padding: 30px 28px 24px; }
  .lp-hero .hero { font-size: 2.4rem; }
  .lp-upload { width: auto; min-width: 20rem; }
  .conv-list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  body[data-view="score"] .wrap { max-width: 84rem; }
  body[data-view="signin"] .wrap { max-width: 68rem; }
  .landing { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); column-gap: 48px; align-items: start; padding-top: 24px; }
  .hero-text { grid-column: 1; }
  .hero-art { grid-column: 2; grid-row: 1; margin: 150px 0 0; padding: 32px 22px; transform: rotate(1deg); }
  .art-sheet { width: 128px; height: 160px; }
  .art-bard { width: 84px; height: 84px; }
  .art-lute { width: 64px; height: 64px; }
  .points { grid-column: 1 / -1; margin-top: 32px; }
  .hero { font-size: 3.1rem; }
  .popular { grid-column: 1 / -1; }
  .lp-page .wrap { max-width: 68rem; }
  .lp-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); column-gap: 48px; align-items: center; padding-top: 16px; }
  .lp-hero .hero { font-size: 2.7rem; }
  .lp-hero .lp-cta { transform: rotate(0.6deg); }
  .lp-hero .lp-upload { width: 100%; min-width: 0; }
  .lp-body, .lp-cta-end, .lp-related { max-width: 46rem; }
  .lp-cta-end .lp-upload { min-width: 20rem; }
  .view-toggle { display: none; }
  .compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .compare .pane { display: block !important; margin: 0; }
  /* each side scrolls on its own, so any bar of the original can sit next to the same bar as read */
  .pane { height: calc(100vh - 58px - var(--bar-h) - 32px); min-height: 420px; overflow: auto; }
  .pane-title { position: sticky; top: 0; z-index: 1; }
  .score-title { margin-bottom: 0.2em; }
  .buy { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 28px; text-align: left; padding: 20px 24px; }
  .buy-lead { margin: 0; grid-column: 1; }
  .buy .btn-buy { grid-column: 2; grid-row: 1 / span 3; min-width: 0; }
  .buy-what, .buy #buy-note { margin: 0; grid-column: 1; justify-self: start; }
  .download-list { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
  .gift-dialog .download-list { grid-template-columns: 1fr 1fr; }
  .inst-list { grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); }
}

/* the downloads card opening after the gift: one soft glow, nothing more */
.downloads.just-opened { animation: opened 1.4s ease-out 1; }
@keyframes opened {
  0% { box-shadow: 0 0 0 0 rgba(242, 196, 107, 0.6), var(--shadow); }
  100% { box-shadow: 0 0 0 14px rgba(242, 196, 107, 0), var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
