/* SPDX-FileCopyrightText: 2026 Folk Register contributors
   SPDX-License-Identifier: MIT

   Themes and the app look. Loaded last, after styles.css and showcase.css.

   Three independent choices, each stored per browser and set on <html>
   before the first paint (index.html):

     data-theme   light | dark                  (the existing switch)
     data-look    (none) | sepia | contrast     (sepia is a light paper;
                                                 contrast works in both)
     data-accent  forest | ocean | fiddle | heather   (forest when unset)

   Each accent is a set of raw colours (--a-*); the theme rules below map
   them onto the site's own tokens (--accent, --accent-strong, ...), so
   every existing component follows the choice without being restyled.

   The rest of the file is the app look: one sans family, heavier headings,
   rounder surfaces, raised "pressable" buttons and coloured tiles. The
   transcription studio (html.fr-studio) keeps its own chrome. */

/* -- accent sets ------------------------------------------------------------ */
:root,
:root[data-accent="forest"] {
  --a: #1b7f53;          --a-strong: #12603e;   --a-soft: #e2f3e9;
  --a-d: #5fd39f;        --a-d-strong: #8fe3bb; --a-d-soft: #12301f;
  --a-hc: #0b4d30;       --a-hc-d: #8ff0c2;
  --a-tint: #f3faf6;     --a-d-tint: #0f1a14;
}

:root[data-accent="ocean"] {
  --a: #1f6fd1;          --a-strong: #1556a6;   --a-soft: #e3edfb;
  --a-d: #74affa;        --a-d-strong: #a4cbfc; --a-d-soft: #132640;
  --a-hc: #0a3d80;       --a-hc-d: #a9d0ff;
  --a-tint: #f3f7fd;     --a-d-tint: #0e1520;
}

:root[data-accent="fiddle"] {
  --a: #c13a22;          --a-strong: #992a16;   --a-soft: #fbe6e0;
  --a-d: #f6a08a;        --a-d-strong: #f9c0b1; --a-d-soft: #3a1d16;
  --a-hc: #7d1d0c;       --a-hc-d: #ffbfae;
  --a-tint: #fdf5f3;     --a-d-tint: #1c1210;
}

:root[data-accent="heather"] {
  --a: #7445c8;          --a-strong: #5a31a6;   --a-soft: #eee6fb;
  --a-d: #bb9ff3;        --a-d-strong: #d6c6f8; --a-d-soft: #2a1f42;
  --a-hc: #4a1f96;       --a-hc-d: #d4c2ff;
  --a-tint: #f7f3fd;     --a-d-tint: #16121f;
}

/* -- theme mapping ------------------------------------------------------------ */
:root {
  --accent: var(--a);
  --accent-strong: var(--a-strong);
  --accent-soft: var(--a-soft);
  --accent-tint: var(--a-tint);
  --focus: var(--a);
  --on-accent: #ffffff;
  --danger: #b42318;
  --app-shadow-1: 0 1px 2px rgb(20 20 30 / 6%), 0 2px 8px rgb(20 20 30 / 5%);
  --app-shadow-2: 0 2px 4px rgb(20 20 30 / 6%), 0 12px 28px rgb(20 20 30 / 10%);
  --app-press: 0 3px 0 var(--accent-strong);
  --app-radius: 16px;
  --app-radius-s: 12px;
  --app-pill: 999px;
  --tile-1: #ffd66b;
  --tile-2: #7cc7ff;
  --tile-3: #ff9e8a;
  --tile-4: #a8e07a;
  --tile-5: #c8a8ff;
  --tile-6: #ffb86b;
}

:root[data-theme="dark"] {
  --accent: var(--a-d);
  --accent-strong: var(--a-d-strong);
  --accent-soft: var(--a-d-soft);
  --accent-tint: var(--a-d-tint);
  --focus: var(--a-d);
  --on-accent: #0c0c0b;
  --danger: #ff9b8a;
  --app-shadow-1: 0 1px 2px rgb(0 0 0 / 40%), 0 2px 8px rgb(0 0 0 / 30%);
  --app-shadow-2: 0 2px 4px rgb(0 0 0 / 45%), 0 14px 32px rgb(0 0 0 / 45%);
  --app-press: 0 3px 0 color-mix(in srgb, var(--a-d) 55%, #000);
  --tile-1: #6b5418;
  --tile-2: #1d4f78;
  --tile-3: #74352a;
  --tile-4: #3c5f22;
  --tile-5: #4b3678;
  --tile-6: #6e4719;
}

/* Sepia: warm paper for long reading. A light look; the picker switches the
   theme to light when it is chosen. */
:root[data-look="sepia"] {
  color-scheme: light;
  --paper: #f3ead6;
  --paper-deep: #e9dcc0;
  --surface: #fbf5e7;
  --surface-soft: #f0e5cc;
  --ink: #33281a;
  --ink-soft: #4a3c29;
  --muted: #6a5739;
  --line: #e0d1b1;
  --line-strong: #c9b48b;
  --field-line: #8f7a55;
  --sheet-paper: #fbf3df;
  --sheet-edge: #d9c9a6;
  --on-ink: #f3ead6;
  /* the darker shade: the plain accents fall under 4.5:1 on this paper */
  --accent: var(--a-strong);
  --focus: var(--a-strong);
  --accent-tint: color-mix(in srgb, var(--a-soft) 45%, #fbf5e7);
}

/* High contrast: black on white (or white on black), every line visible,
   the darkest accent. */
:root[data-look="contrast"] {
  --paper: #ffffff;
  --paper-deep: #f0f0f0;
  --surface: #ffffff;
  --surface-soft: #f2f2f2;
  --ink: #000000;
  --ink-soft: #000000;
  --muted: #2b2b2b;
  --line: #6b6b6b;
  --line-strong: #000000;
  --field-line: #000000;
  --accent: var(--a-hc);
  --accent-strong: #000000;
  --accent-soft: #ffffff;
  --accent-tint: #ffffff;
  --focus: #000000;
  --on-accent: #ffffff;
  --sheet-paper: #ffffff;
  --sheet-edge: #000000;
  --app-shadow-1: none;
  --app-shadow-2: none;
  --app-press: 0 3px 0 #000000;
  --tile-1: #ffffff; --tile-2: #ffffff; --tile-3: #ffffff;
  --tile-4: #ffffff; --tile-5: #ffffff; --tile-6: #ffffff;
}

:root[data-look="contrast"][data-theme="dark"] {
  --paper: #000000;
  --paper-deep: #111111;
  --surface: #000000;
  --surface-soft: #141414;
  --ink: #ffffff;
  --ink-soft: #ffffff;
  --muted: #dedede;
  --line: #9a9a9a;
  --line-strong: #ffffff;
  --field-line: #ffffff;
  --accent: var(--a-hc-d);
  --accent-strong: #ffffff;
  --accent-soft: #000000;
  --accent-tint: #000000;
  --focus: #ffffff;
  --on-accent: #000000;
  --sheet-paper: #ffffff;
  --sheet-edge: #ffffff;
  --app-press: 0 3px 0 #ffffff;
  --tile-1: #000000; --tile-2: #000000; --tile-3: #000000;
  --tile-4: #000000; --tile-5: #000000; --tile-6: #000000;
}

/* The showcase bands follow the accent instead of a fixed green. */
:root {
  --show-band: color-mix(in srgb, var(--a) 78%, #0b1b14);
  --show-band-2: color-mix(in srgb, var(--a-strong) 70%, #08120d);
  --show-gold: #ffd66b;
}
:root[data-theme="dark"] {
  --show-band: color-mix(in srgb, var(--a-d-soft) 85%, #000);
  --show-band-2: color-mix(in srgb, var(--a-d-soft) 60%, #000);
}
:root[data-look="contrast"] { --show-band: #000000; --show-band-2: #000000; --show-band-ink: #ffffff; --show-band-muted: #ffffff; --show-gold: #ffffff; }

/* ==== the app look (public site only) ========================================= */
html:not(.fr-studio) {
  --serif: var(--sans);
  --radius: var(--app-radius-s);
  --radius-small: 8px;
}

html:not(.fr-studio) body {
  background: var(--paper);
  font-family: var(--sans);
}

html:not(.fr-studio) :is(h1, h2, h3, .home-display, .page-heading h1, .tune-head h1) {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.02em;
}

html:not(.fr-studio) :is(h2.label, .label, .eyebrow) {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* -- header -------------------------------------------------------------------- */
html:not(.fr-studio) .site-header {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 1px 0 var(--line);
}

html:not(.fr-studio) .wordmark {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.02em;
}

html:not(.fr-studio) .brand-mark { color: var(--accent); }

html:not(.fr-studio) .primary-nav {
  align-self: center;
  gap: var(--space-2);
}

html:not(.fr-studio) .primary-nav a {
  margin-inline: 0;
  padding: 0.55rem 0.9rem;
  font-weight: 650;
}

html:not(.fr-studio) .primary-nav a:hover { background: var(--surface-soft); }

html:not(.fr-studio) .primary-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

html:not(.fr-studio) .primary-nav a[aria-current="page"]::after { display: none; }

html:not(.fr-studio) .header-search {
  border-radius: var(--app-pill);
  background: var(--surface-soft);
  border-color: transparent;
}

html:not(.fr-studio) .header-search:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}

html:not(.fr-studio) .icon-button { border-radius: var(--app-pill); }

html:not(.fr-studio) .account-link {
  border-radius: var(--app-pill);
  font-weight: 650;
}

/* -- buttons: raised, pressable ---------------------------------------------------- */
html:not(.fr-studio) .button {
  border-radius: var(--app-radius-s);
  font-weight: 700;
  box-shadow: 0 2px 0 var(--line-strong);
  transition: transform 80ms ease, box-shadow 80ms ease, background var(--ease);
}

html:not(.fr-studio) .button:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line-strong); }

html:not(.fr-studio) .button.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: var(--app-press);
}

html:not(.fr-studio) .button.primary:hover {
  background: color-mix(in srgb, var(--accent) 90%, #fff);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--accent-strong);
}

html:not(.fr-studio) .button.primary:active { transform: translateY(3px); box-shadow: 0 0 0 var(--accent-strong); }

html:not(.fr-studio) .button.quiet { box-shadow: none; }

html:not(.fr-studio) :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

html:not(.fr-studio),
html:not(.fr-studio) body {
  overflow-x: clip;
}

html:not(.fr-studio) :is(.home .home-hero, .home-cta-inner) :focus-visible {
  outline-color: #ffffff;
}

html:not(.fr-studio) .home .home-hero .plate-paper :focus-visible {
  outline-color: #a62a1b;
}

/* -- fields ---------------------------------------------------------------------- */
html:not(.fr-studio) :is(input[type="search"], input[type="text"], input[type="email"], input[type="password"], input:not([type]), select, textarea) {
  border-radius: var(--app-radius-s);
}

html:not(.fr-studio) .search-field { border-radius: var(--app-pill); }
html:not(.fr-studio) .search-field input[type="search"] { border-radius: var(--app-pill); }

/* -- home ------------------------------------------------------------------------ */
html:not(.fr-studio) .home .home-hero {
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--show-gold) 30%, transparent), transparent 60%),
    radial-gradient(50rem 30rem at -10% 110%, color-mix(in srgb, var(--a-d) 35%, transparent), transparent 60%),
    linear-gradient(160deg, var(--show-band) 0%, var(--show-band-2) 100%);
}

html:not(.fr-studio) .home .home-hero .home-display {
  font-weight: 900;
  font-size: clamp(2.75rem, 1.6rem + 4vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

html:not(.fr-studio) .home .home-hero .home-search .button.primary {
  background: var(--show-gold);
  color: #2a1f00;
  border-color: var(--show-gold);
  box-shadow: 0 3px 0 #b8901f;
}

html:not(.fr-studio) .home .home-hero .plate {
  transform: none;
}

html:not(.fr-studio) .home .home-hero .plate:hover {
  transform: translateY(-2px);
}

html:not(.fr-studio) .home .home-hero .plate-paper {
  border-radius: var(--app-radius);
}

html:not(.fr-studio) .home .home-hero .home-try a {
  display: inline-block;
  margin: 0.15rem 0;
  padding: 0.1rem 0.6rem;
  border-radius: var(--app-pill);
  background: rgb(255 255 255 / 14%);
  text-decoration: none;
  font-weight: 650;
}

html:not(.fr-studio) .home .home-hero .home-try a:hover { background: rgb(255 255 255 / 26%); }

html:not(.fr-studio) .feature-card {
  border: 0;
  border-radius: var(--app-radius);
  background: var(--surface);
  box-shadow: var(--app-shadow-1);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

html:not(.fr-studio) .feature-card:hover { transform: translateY(-3px); box-shadow: var(--app-shadow-2); }

html:not(.fr-studio) .feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  color: #1d1a12;
  background: var(--tile-1);
  border: 0;
}

html:not(.fr-studio) .feature-grid > li:nth-child(2) .feature-icon { background: var(--tile-2); }
html:not(.fr-studio) .feature-grid > li:nth-child(3) .feature-icon { background: var(--tile-3); }
html:not(.fr-studio) .feature-grid > li:nth-child(4) .feature-icon { background: var(--tile-4); }
html:not(.fr-studio) .feature-grid > li:nth-child(5) .feature-icon { background: var(--tile-5); }
html:not(.fr-studio) .feature-grid > li:nth-child(6) .feature-icon { background: var(--tile-6); }
:root[data-theme="dark"]:not(.fr-studio) .feature-icon { color: #ffffff; }
:root[data-look="contrast"]:not(.fr-studio) :is(.feature-card, .instrument-row > li > a, .tune-tool-list a) { border: 2px solid var(--line-strong); }

html:not(.fr-studio) .home-cta-inner {
  border-radius: calc(var(--app-radius) + 8px);
  background:
    radial-gradient(30rem 16rem at 100% 0%, color-mix(in srgb, var(--show-gold) 28%, transparent), transparent 70%),
    linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

:root[data-theme="dark"]:not(.fr-studio) .home-cta-inner {
  background:
    radial-gradient(30rem 16rem at 100% 0%, color-mix(in srgb, var(--show-gold) 18%, transparent), transparent 70%),
    linear-gradient(135deg, var(--a-d-soft) 0%, #0d0d0c 100%);
}

html:not(.fr-studio) .home-cta-inner .button.primary {
  background: #ffffff;
  color: var(--a-strong);
  border-color: #ffffff;
  box-shadow: 0 3px 0 rgb(0 0 0 / 25%);
}

html:not(.fr-studio) .instrument-row > li > a {
  border: 0;
  border-radius: var(--app-radius);
  background: var(--surface);
  box-shadow: var(--app-shadow-1);
}

html:not(.fr-studio) .instrument-row > li > a:hover { box-shadow: var(--app-shadow-2); transform: translateY(-3px); }
html:not(.fr-studio) .instrument-row > li:nth-child(6n+1) > a { border-top: 5px solid var(--tile-1); }
html:not(.fr-studio) .instrument-row > li:nth-child(6n+2) > a { border-top: 5px solid var(--tile-2); }
html:not(.fr-studio) .instrument-row > li:nth-child(6n+3) > a { border-top: 5px solid var(--tile-3); }
html:not(.fr-studio) .instrument-row > li:nth-child(6n+4) > a { border-top: 5px solid var(--tile-4); }
html:not(.fr-studio) .instrument-row > li:nth-child(6n+5) > a { border-top: 5px solid var(--tile-5); }
html:not(.fr-studio) .instrument-name { font-weight: 800; }

/* -- tables become rounded lists ----------------------------------------------------- */
html:not(.fr-studio) .index-table {
  border-radius: var(--app-radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--app-shadow-1);
}

html:not(.fr-studio) .index-table thead th {
  background: var(--surface-soft);
  border-bottom: 0;
  padding-block: 0.7rem;
}

html:not(.fr-studio) .index-table tbody tr { transition: background var(--ease); }
html:not(.fr-studio) .index-table tbody tr:hover { background: var(--accent-tint); }
html:not(.fr-studio) .index-table .index-title a { font-weight: 700; }
html:not(.fr-studio) .index-table :is(td, th):first-child { padding-left: 1.1rem; }
html:not(.fr-studio) .index-table :is(td, th):last-child { padding-right: 1.1rem; }

html:not(.fr-studio) .index-initial span {
  color: var(--accent);
  font-weight: 900;
}

/* -- tunes page: filters and the A-Z rail ---------------------------------------------- */
html:not(.fr-studio) .catalog-toolbar {
  padding: 1rem 1.1rem;
  border-radius: var(--app-radius);
  background: var(--surface);
  box-shadow: var(--app-shadow-1);
}

html:not(.fr-studio) .az-rail a,
html:not(.fr-studio) .az-rail span {
  border-radius: var(--app-pill);
  font-weight: 700;
}

html:not(.fr-studio) .az-rail [aria-current="true"],
html:not(.fr-studio) .az-rail [aria-current="page"] {
  background: var(--accent);
  color: var(--on-accent);
}

html:not(.fr-studio) .segmented {
  border-radius: var(--app-pill);
  padding: 3px;
  background: var(--surface-soft);
  border-color: transparent;
}

html:not(.fr-studio) .segmented > :is(button, a, span, label) {
  border: 0;
  border-radius: var(--app-pill);
  font-weight: 650;
}

html:not(.fr-studio) .segmented > [aria-pressed="true"],
html:not(.fr-studio) .segmented > [aria-current="page"],
html:not(.fr-studio) .segmented > [aria-checked="true"] {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: var(--app-shadow-1);
}

:root[data-look="contrast"]:not(.fr-studio) .segmented > :is([aria-pressed="true"], [aria-current="page"], [aria-checked="true"]) {
  background: var(--ink);
  color: var(--paper);
}

/* pagination numbers */
html:not(.fr-studio) .pagination :is(a, span) { border-radius: var(--app-pill); }
html:not(.fr-studio) .pagination [aria-current="page"],
html:not(.fr-studio) .catalog-toolbar .segmented > [aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

/* tune cards view */
html:not(.fr-studio) .tune-card {
  border: 0;
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-1);
  overflow: hidden;
}
html:not(.fr-studio) .tune-card:hover { box-shadow: var(--app-shadow-2); }

/* -- tune and song pages ------------------------------------------------------------------ */
html:not(.fr-studio) .tune-head h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  line-height: 1.05;
}

html:not(.fr-studio) .instrument-tabs {
  gap: 0.4rem;
  border-bottom: 0;
}

html:not(.fr-studio) .instrument-tabs :is(a, span[aria-disabled], [role="tab"]) {
  border-radius: var(--app-pill);
  padding: 0.45rem 1rem;
  background: var(--surface);
  box-shadow: var(--app-shadow-1);
  font-weight: 700;
}

html:not(.fr-studio) .instrument-tabs a[aria-current="page"],
html:not(.fr-studio) .instrument-tabs [role="tab"][aria-selected="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

html:not(.fr-studio) .instrument-tabs a[aria-current="page"] *,
html:not(.fr-studio) .instrument-tabs [role="tab"][aria-selected="true"] * { color: inherit; opacity: 0.85; }

html:not(.fr-studio) .instrument-tabs :is(a, [role="tab"])::after { display: none; }

html:not(.fr-studio) .song-tools-banner {
  border: 0;
  border-radius: var(--app-radius);
  background:
    radial-gradient(24rem 10rem at 100% 0%, color-mix(in srgb, var(--show-gold) 30%, transparent), transparent 70%),
    var(--accent-soft);
  box-shadow: var(--app-shadow-1);
}

/* The song tools: one toolbar above the sheet, grouped, roomy. */
html:not(.fr-studio) :is(.practice-toolbar, .sheet-toolbar) {
  border: 0;
  border-radius: var(--app-radius);
  background: var(--surface);
  box-shadow: var(--app-shadow-1);
  padding: 0.75rem 0.9rem;
}

html:not(.fr-studio) .sheet-toolbar .sheet-group-label,
html:not(.fr-studio) .sheet-toolbar .label {
  font-weight: 800;
  color: var(--muted);
}

html:not(.fr-studio) :is(.chip, .layer-chip) {
  border-radius: var(--app-pill);
  font-weight: 650;
  box-shadow: 0 2px 0 var(--line);
}

html:not(.fr-studio) .layer-chip[aria-pressed="true"],
html:not(.fr-studio) .chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

html:not(.fr-studio) .practice-toolbar :is(button, .button) {
  border-radius: var(--app-pill);
}

html:not(.fr-studio) .key-presets > :is(button, a) { font-weight: 700; }

html:not(.fr-studio) :is(.sheet-panel .sheet-surface, .sheet-frame) {
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-2);
}

html:not(.fr-studio) .tune-tool-list a {
  border: 0;
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-1);
}

html:not(.fr-studio) .tune-tool-list li:nth-child(1) .feature-icon,
html:not(.fr-studio) .tune-tool-list li:nth-child(1) .icon-wrap { background: var(--tile-1); }

/* -- account and dialogs -------------------------------------------------------------- */
html:not(.fr-studio) .account-section {
  padding: 1.25rem 1.4rem;
  border: 0;
  border-radius: var(--app-radius);
  background: var(--surface);
  box-shadow: var(--app-shadow-1);
}

html:not(.fr-studio) .account-section + .account-section { margin-top: 1.25rem; }
html:not(.fr-studio) .account-section .section-heading { border-top: 0; padding-top: 0; }

html:not(.fr-studio) .empty-state {
  border-radius: calc(var(--app-radius) + 8px);
  border: 0;
  padding: 2.5rem 2rem;
  background:
    radial-gradient(24rem 12rem at 100% 0%, color-mix(in srgb, var(--show-gold) 25%, transparent), transparent 70%),
    var(--accent-soft);
  text-align: center;
}

html:not(.fr-studio) .dialog {
  border: 0;
  border-radius: calc(var(--app-radius) + 6px);
  box-shadow: var(--app-shadow-2);
}

/* -- footer ------------------------------------------------------------------------------- */
html:not(.fr-studio) .site-footer {
  background: var(--show-band-2);
}

/* -- the appearance menu --------------------------------------------------------------------- */
.appearance { position: relative; }

.appearance-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  width: 17.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--app-radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--app-shadow-2);
}

.appearance-menu .appearance-heading {
  margin: 0 0 0.4rem;
  font: 800 var(--step--2)/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.appearance-menu .segmented { display: flex; margin-bottom: 0.9rem; }
.appearance-menu .segmented > button { flex: 1; min-height: 2.25rem; padding-inline: 0.5rem; font-size: var(--step--1); }

.appearance-swatches {
  display: flex;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.appearance-swatches button {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer;
}

.appearance-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }

@media (max-width: 48rem) {
  .appearance-menu { position: fixed; top: var(--header-height); left: 1rem; right: 1rem; width: auto; }
}

/* ---------------------------------------------------------------------------
   Progress: the streak card (account, home), the week's day dots, and the
   song page's Learning / Learned / Log practice chips.
   --------------------------------------------------------------------------- */
.progress-card {
  display: grid;
  gap: 1rem;
  margin-block: 0 1.5rem;
  padding: 1.25rem 1.4rem;
  border-radius: var(--app-radius, 16px);
  background:
    radial-gradient(28rem 12rem at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--app-shadow-1, 0 1px 2px rgb(0 0 0 / 0.08));
}

.progress-streak {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.progress-streak > div { flex: 1 1 14rem; }

.progress-streak > .button { margin-left: auto; }

.progress-flame {
  display: inline-grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  flex: none;
}

.progress-card.has-streak .progress-flame {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.progress-card .progress-streak-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.15;
}

.progress-nudge {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.progress-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  max-width: 26rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-day {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
}

.progress-dot {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
}

.progress-day.is-done .progress-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.progress-day.is-today .progress-dot { outline: 2px solid var(--accent); outline-offset: 2px; }

.progress-day-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.progress-stat {
  display: grid;
  gap: 0.1rem;
  padding: 0.7rem 0.85rem;
  border-radius: calc(var(--app-radius, 16px) - 4px);
  background: var(--surface-soft);
}

.progress-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
}

.progress-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.progress-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.progress-list h3 {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.home-progress .progress-card { margin: 0; }

.tune-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block: 0.25rem 1rem;
}

.tune-progress .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tune-progress .tune-log { margin-left: 0.25rem; }

@media (max-width: 760px) {
  .progress-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-lists { grid-template-columns: 1fr; }
  .progress-card { padding: 1rem; }
  .progress-streak > .button { margin-left: 0; width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.fr-studio) :is(.button, .feature-card, .instrument-row > li > a, .tune-tool-list a, .appearance-swatches button, .plate, .plate-paper) {
    transition: none;
    transform: none !important;
  }
}
