/* Anything marked hidden stays hidden, even if a class sets display. */
[hidden] { display: none !important; }

:root {
  --ink: #16241d;
  --muted: #55655b;
  --paper: #f4f7f3;
  --card: #ffffff;
  --line: #d8e3db;
  --robe: #2d6a4f;
  --robe-deep: #1b4332;
  --robe-soft: #e1eee6;
  --brass: #c4932b;
  --brass-deep: #8a6414;
  --brass-soft: #f6ecd2;
  --danger: #a3302a;
  --field: #ffffff;
  --tint: #f8fbf8;
  --line-strong: #b5ccbd;
  --box-line: #a3b6aa;
  --ink-soft: #31443a;
  --top: #1b4332;
  --accent-bg: #2d6a4f;
  --brass-line: #e2c983;
  --danger-bg: #a3302a;
  --danger-soft: #fbefee;
  --danger-line: #e7b9b5;
  --bad-soft: #f6d5d2;
  --ok: #1d7465;
  --ok-soft: #d2eee8;
  --ok-ink: #13514a;
  --toast-bg: #16241d;
  --toast-ink: #ffffff;
  color-scheme: light;
  --display: "Bitter", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px;
  --r-md: 12px;
}

/* Dark mode: follows the device setting, unless the learner picks Light or Dark in the footer. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6f0ea;
    --muted: #a3b6aa;
    --paper: #0e1612;
    --card: #16211b;
    --field: #1c2a22;
    --line: #2a3d32;
    --line-strong: #3f5a49;
    --box-line: #5f7a69;
    --tint: #1a271f;
    --ink-soft: #c9dbcf;
    --robe: #8fd3ac;
    --robe-deep: #12291e;
    --robe-soft: #1f3327;
    --top: #0f2219;
    --accent-bg: #2c7352;
    --brass: #c99a32;
    --brass-deep: #e6c77e;
    --brass-soft: #33291a;
    --brass-line: #6b5524;
    --danger: #ff8f85;
    --danger-bg: #b23a32;
    --danger-soft: #2e1a1c;
    --danger-line: #6e3330;
    --bad-soft: #3d2022;
    --ok: #6fd3c0;
    --ok-soft: #163a33;
    --ok-ink: #9be3d4;
    --toast-bg: #e6f0ea;
    --toast-ink: #0e1612;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e6f0ea;
  --muted: #a3b6aa;
  --paper: #0e1612;
  --card: #16211b;
  --field: #1c2a22;
  --line: #2a3d32;
  --line-strong: #3f5a49;
  --box-line: #5f7a69;
  --tint: #1a271f;
  --ink-soft: #c9dbcf;
  --robe: #8fd3ac;
  --robe-deep: #12291e;
  --robe-soft: #1f3327;
  --top: #0f2219;
  --accent-bg: #2c7352;
  --brass: #c99a32;
  --brass-deep: #e6c77e;
  --brass-soft: #33291a;
  --brass-line: #6b5524;
  --danger: #ff8f85;
  --danger-bg: #b23a32;
  --danger-soft: #2e1a1c;
  --danger-line: #6e3330;
  --bad-soft: #3d2022;
  --ok: #6fd3c0;
  --ok-soft: #163a33;
  --ok-ink: #9be3d4;
  --toast-bg: #e6f0ea;
  --toast-ink: #0e1612;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--body);
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--robe); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--toast-bg); color: var(--toast-ink); padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 50; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--top); color: #fff;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: #fff; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.brand img { height: 30px; width: auto; display: block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
/* Contact (#/contact): a field people never see, left empty by people and filled in by bots. */
.contact .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact select { font: inherit; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--box-line); background: var(--field); color: var(--ink); }

/* OneRoot for Mac (#/mac) and the places that point to it. */
.mac-page { max-width: 1040px; margin: 0 auto; padding: 8px 0 48px; display: flex; flex-direction: column; gap: 40px; }
.mac-hero { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.mac-hero-text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.mac-kicker { margin: 0; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; color: var(--brass-deep); }
.mac-hero h1 { margin: 0; font-family: var(--display); font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; }
.mac-hero .lede { margin: 0; font-size: 1.15rem; line-height: 1.55; color: var(--ink-soft); }
.mac-hero-art { flex: 1 1 360px; min-width: 0; width: 100%; max-width: 480px; aspect-ratio: 1200 / 670; height: auto; object-fit: cover; border-radius: 16px; background: var(--top); }
.mac-feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.mac-feat { padding: 18px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.mac-feat h3 { margin: 0 0 6px; font-size: 1.05rem; }
.mac-feat p { margin: 0; color: var(--muted); line-height: 1.5; }
.mac-need h2, .mac-ask h2 { font-family: var(--display); margin: 0 0 10px; }
.mac-need ul { margin: 0; padding-left: 1.2em; line-height: 1.6; }
.mac-ask { padding: 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.mac-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.mac-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.mac-form select, .mac-form input, .mac-form textarea { font: inherit; font-weight: 400; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--box-line); background: var(--field); color: var(--ink); }
.mac-form button { align-self: flex-start; }
.mac-sent { margin: 0; line-height: 1.6; }
.mac-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 28px 0 8px; padding: 18px 20px;
  border-radius: 14px; background: var(--top); color: #fff; text-decoration: none; }
.mac-banner > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.mac-banner b { font-family: var(--display); font-size: 1.2rem; }
.mac-banner > span:first-child > span { color: #d4e5da; }
.mac-banner .gt-go { color: var(--brass); font-weight: 700; }
.dash-mac { border-color: var(--brass-line); background: var(--brass-soft); }

/* The way to OneRoot's home (/oneroot): at the top of Tools and on Home. */
.oneroot-banner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 4px 0 8px; padding: 18px 20px;
  border-radius: 14px; background: var(--top); color: #fff; text-decoration: none; border: 2px solid var(--brass); }
.oneroot-banner img { height: 30px; width: auto; }
.oneroot-banner > span:not(.btn) { display: flex; flex-direction: column; gap: 4px; flex: 1 1 16rem; }
.oneroot-banner b { font-family: var(--display); font-size: 1.25rem; }
.oneroot-banner > span:not(.btn) > span { color: #d4e5da; }
.oneroot-banner:hover { box-shadow: 0 0 0 3px var(--brass-line); }
.dash-oneroot { display: grid; gap: 6px; justify-items: start; padding: 16px; margin-bottom: 12px; border-radius: var(--r-md);
  background: var(--top); color: #fff; text-decoration: none; border: 2px solid var(--brass); }
.dash-oneroot img { height: 26px; width: auto; }
.dash-oneroot b { font-family: var(--display); font-size: 1.15rem; }
.dash-oneroot > span:not(.btn) { color: #d4e5da; font-size: .9rem; }
.dash-oneroot .btn { margin-top: 4px; }
.dash-oneroot:hover { box-shadow: 0 0 0 3px var(--brass-line); }

/* Tools in OneRoot's three groups. */
.tool-group { margin: 28px 0 8px; }
.tool-group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 14px; }
.tool-group-head h2 { margin: 0; font-family: var(--display); font-size: 1.5rem; }
.tool-group-head span { color: var(--muted); }
.nav a, .nav button {
  color: #e2efe7; text-decoration: none; background: none; border: 0; cursor: pointer;
  padding: 8px 12px; border-radius: var(--r-sm); font-weight: 500;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--brass); border-radius: 0; }
.demo-banner { background: var(--brass-soft); color: var(--brass-deep); text-align: center; padding: 8px 16px; font-size: .9rem; }

main { max-width: 1040px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 40px) 64px; }
main:focus { outline: none; }
.footer { text-align: center; color: var(--muted); font-size: .9rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 10px 18px;
  font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px;
}
.btn-primary { background: var(--accent-bg); color: #fff; }
.btn-primary:hover { background: var(--robe-deep); }
.btn-quiet { background: transparent; color: var(--robe); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--robe); }
.btn-brass { background: var(--brass); color: #231a05; }
.btn-brass:hover { background: #b3841f; }
.btn:disabled { opacity: .6; cursor: default; }
.linklike { background: none; border: 0; padding: 0; color: var(--robe); text-decoration: underline; cursor: pointer; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--field); min-height: 44px;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--robe); outline: none; box-shadow: 0 0 0 3px var(--robe-soft); }
.hint { color: var(--muted); font-size: .9rem; }
.error { color: var(--danger); font-weight: 500; margin-bottom: 12px; }
.notice { background: var(--robe-soft); padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 16px; }

/* Home */
.hero-keys { background: var(--robe-deep); border-radius: var(--r-md); padding: 18px 18px 22px; }
.hero-keys figcaption { color: #d3e6da; font-size: .9rem; margin-top: 12px; }

/* Keyboard */
.keys { display: block; max-width: 100%; height: auto; }
.keys.fit { width: 100%; }
.keys-wrap { overflow-x: auto; }
.key-w { fill: #fff; stroke: #1f3a2c; stroke-width: 1; }
.key-b { fill: #17241d; stroke: #17241d; }
.key-w.watching { fill: #d7eadf; }
.key-b.watching { fill: #3f8a66; }
.key-w.practicing { fill: #a9d6bd; }
.key-b.practicing { fill: #5fae86; }
.key-w.done { fill: var(--brass); }
.key-b.done { fill: #e0b552; }
.keys [data-id] { cursor: pointer; }
.keys [data-id]:hover { filter: brightness(.92); }
.key-w.lit { animation: lightup-w 1.2s ease-out both; }
.key-b.lit { animation: lightup-b 1.2s ease-out both; }
@keyframes lightup-w { 0% { fill: #fff; } 45%, 100% { fill: var(--brass); } }
@keyframes lightup-b { 0% { fill: #17241d; } 45%, 100% { fill: #e0b552; } }
@media (prefers-reduced-motion: reduce) { .keys .lit { animation: none; fill: var(--brass); } }

/* Auth */
.auth { max-width: 420px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px; }
.auth h1 { font-size: 1.9rem; margin-bottom: 8px; }
.auth > p { color: var(--muted); margin-bottom: 20px; }
.auth .alt { margin-top: 18px; color: var(--muted); font-size: .95rem; display: grid; gap: 6px; }

/* Onboarding */
.level-choices { display: grid; gap: 12px; margin: 20px 0; }
.level-choice { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--field); cursor: pointer; }
.level-choice:has(input:checked) { border-color: var(--robe); box-shadow: 0 0 0 2px var(--robe-soft); }
.level-choice input { margin-top: 4px; accent-color: var(--robe); width: 18px; height: 18px; }
.level-choice strong { display: block; font-family: var(--display); font-size: 1.1rem; }
.level-choice span { color: var(--muted); }

/* Path */
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 38rem; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { background: none; border: 0; padding: 10px 14px 12px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--robe); }
.tab small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.continue { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--accent-bg); color: #fff; border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 24px; }
.continue p { color: #d6eadd; font-size: .95rem; }
.continue strong { font-family: var(--display); font-size: 1.2rem; display: block; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.toggle input { accent-color: var(--robe); width: 18px; height: 18px; }
.level-blurb { color: var(--muted); }

.group { padding: 22px 0 6px; border-top: 1px solid var(--line); }
.group:first-of-type { border-top: 0; }
.group-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.group-head .mod { color: var(--muted); font-size: .9rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 3rem 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; }
.row + .row { border-top: 1px dashed var(--line); }
.row .num { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.row .title { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-weight: 600; color: var(--ink); line-height: 1.35; }
.row .title:hover { color: var(--robe); text-decoration: underline; }
.row .tag { font-size: .8rem; font-weight: 600; color: var(--muted); display: block; margin-top: 2px; }
.row .tag.song { color: var(--brass-deep); }
.row .len { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.row.is-optional .title { font-weight: 500; color: var(--ink-soft); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--muted); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.check:hover { border-color: var(--brass); color: var(--ink); }
.check .box { width: 22px; height: 22px; border: 2px solid var(--box-line); border-radius: 50%; display: grid; place-items: center; flex: none; transition: background .15s, border-color .15s; }
.check[aria-pressed="true"] { background: var(--brass-soft); border-color: var(--brass-line); color: var(--brass-deep); }
.check[aria-pressed="true"] .box { background: var(--brass); border-color: var(--brass); }
.check[aria-pressed="true"] .box::after { content: ""; width: 6px; height: 11px; border: solid #231a05; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.check:disabled { opacity: .6; cursor: progress; }
.check .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row.is-done .title { color: var(--muted); }
.row .tags { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; }
.row .tags .tag { margin-top: 0; }
.row .tag.state-watching, .row .tag.state-practicing { color: var(--robe); }
.know-level { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; color: var(--muted); }
#f-welcome .toggle { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 16px; }
#f-welcome .toggle[hidden] { display: none; }
.coming { margin-top: 24px; padding: 18px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--tint); }
.coming h3 { margin-bottom: 4px; }
.coming > p { color: var(--muted); margin-bottom: 10px; }
.coming ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 4px; }

/* Lesson dialog */
.lesson { width: min(880px, 94vw); max-height: 94vh; overflow-y: auto; border: 0; border-radius: var(--r-md); padding: 0; color: var(--ink); background: var(--card); }
.lesson::backdrop { background: rgba(6, 14, 10, .65); }
.lesson-video { aspect-ratio: 16 / 9; background: #000; }
.lesson-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.lesson-body { padding: 20px 22px 22px; display: grid; gap: 14px; }
.lesson-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.lesson-top h2 { font-size: 1.35rem; }
.lesson-meta { color: var(--muted); font-size: .95rem; margin-top: 4px; }
.close { background: none; border: 1px solid var(--line); border-radius: var(--r-sm); width: 40px; height: 40px; font-size: 1.3rem; cursor: pointer; flex: none; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { border: 1px solid var(--line); background: var(--field); border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--accent-bg); color: #fff; border-color: var(--accent-bg); }
.seg button.done[aria-pressed="true"] { background: var(--brass); color: #231a05; border-color: var(--brass); }
.lesson-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Progress */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 32px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.stat b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .95rem; }
.board { display: grid; gap: 28px; margin-bottom: 40px; }
.board-level { display: grid; gap: 10px; justify-items: start; }
.board-level .head { justify-self: stretch; }
.board-level .head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.board-level .head span { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: .9rem; }
.legend i { display: inline-block; width: 14px; height: 14px; border: 1px solid #1f3a2c; border-radius: 2px; vertical-align: -2px; margin-right: 6px; }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px 32px; }
.skill { display: grid; gap: 4px; }
.skill .top { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.skill .top span { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brass); border-radius: 99px; }

/* Practice */
.practice { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 40px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.panel h2 { font-size: 1.3rem; margin-bottom: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.log-day { padding: 14px 0; border-top: 1px solid var(--line); }
.log-day h3 { font-size: 1rem; margin-bottom: 8px; }
.log-entry { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 12px; align-items: start; padding: 6px 0; }
.log-entry .mins { font-family: var(--display); font-weight: 600; color: var(--robe); }
.log-entry .what { display: grid; gap: 2px; }
.log-entry .what small { color: var(--muted); }
.empty { color: var(--muted); padding: 20px 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--toast-bg); color: var(--toast-ink); padding: 10px 16px; border-radius: var(--r-sm); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .practice { grid-template-columns: 1fr; }
  .row { grid-template-columns: 2.2rem 1fr; }
  .row .len { grid-column: 2; }
  .row .check { grid-column: 2; justify-self: start; }
  .topbar { flex-wrap: wrap; }
}

/* Privacy page */
.footer p + p { margin-top: 6px; }
.footer a { color: var(--muted); }
.prose { max-width: 40rem; margin: 0 auto; }
.prose h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); margin-bottom: 12px; }
.prose h2 { font-size: 1.3rem; margin: 32px 0 10px; }
.prose p, .prose li { line-height: 1.65; }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 1.2rem; display: grid; gap: 8px; }
.prose .lede { font-size: 1.1rem; color: var(--muted); }
.prose .callout { background: var(--brass-soft); color: var(--brass-deep); border-radius: var(--r-sm); padding: 12px 16px; }
.prose .hint { margin-top: 32px; }

/* Videos that can't play inside the site */
.lesson-video.yt-only { display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; background: var(--robe-deep); color: #fff; }

/* Chapter links in the lesson window */
.chapters { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; }
.chapters summary { cursor: pointer; font-weight: 600; color: var(--robe); }
.chapters ol { list-style: none; margin: 10px 0 2px; padding: 0; display: grid; gap: 2px; }
.chapters button, .chapters a { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 6px 8px; border-radius: var(--r-sm); font: inherit; color: var(--ink); cursor: pointer; text-decoration: none; }
.chapters button:hover, .chapters a:hover { background: var(--robe-soft); }
.chapters .t { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.2rem; }

/* Reviewed lesson copy in the lesson window */
.lesson-yt { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.lesson-learn { margin: 0; }
.lesson-task { background: var(--brass-soft); border-radius: var(--r-sm); padding: 12px 16px; }
.lesson-task .k { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brass-deep); }
.lesson-task p:last-child { margin: 0; }

/* ---------- Piano basics ---------- */
.basics-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; margin-bottom: 16px; border-radius: var(--r-md); background: var(--brass-soft); border: 1px solid #e8d4a2; color: var(--ink); text-decoration: none; }
.basics-panel:hover { border-color: var(--brass); }
.basics-panel .bp-text { display: grid; gap: 2px; min-width: 0; }
.basics-panel .bp-eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brass-deep); }
.basics-panel strong { font-family: var(--display); font-size: 1.2rem; }
.basics-panel .bp-text > span:last-child { color: var(--muted); font-size: .95rem; }
.basics-panel .bp-count { font-family: var(--display); color: var(--brass-deep); white-space: nowrap; font-variant-numeric: tabular-nums; }
.basics-panel .bp-count b { font-size: 1.8rem; }
.basics-panel.complete { background: var(--card); border-color: var(--line); }
.crumb { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.basics-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.basics-list a { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.basics-list a:hover { border-color: var(--robe); }
.basics-list .n { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--robe-soft); color: var(--robe); font-weight: 700; font-family: var(--display); }
.basics-list .is-done .n { background: var(--brass); color: #231a05; }
.basics-list .body { display: grid; gap: 2px; min-width: 0; }
.basics-list .body span { color: var(--muted); font-size: .95rem; }
.basics-list .meta { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.basics-list .tick { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--brass); position: relative; }
.basics-list .tick::after { content: ""; position: absolute; left: 8px; top: 4px; width: 5px; height: 10px; border: solid #231a05; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.basics-strip { margin: 8px 0 12px; }
.basics-strip .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.basics-strip .head a { color: var(--ink); }
.basics-strip .head span { color: var(--muted); }
.basics-strip ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.basics-strip li a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--ink); text-decoration: none; font-size: .88rem; line-height: 1.25; }
.basics-strip li .n { font-weight: 700; color: var(--muted); }
.basics-strip li.done a { background: var(--brass-soft); border-color: var(--brass-line); }
.basics-strip li.done .n { color: var(--brass-deep); }

.basic { max-width: 46rem; margin: 0 auto; display: grid; gap: 14px; }
.basic h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); }
.basic .lede { color: var(--muted); font-size: 1.1rem; margin: 0; }
.basic-body { display: grid; gap: 14px; }
.basic-body > p, .basic-body li { line-height: 1.65; }
.basic-body > p { margin: 0; }
.basic-body > h2 { font-size: 1.3rem; margin-top: 14px; }
.basic-body > ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; }
.basic-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 8px; }
.widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.row-ctl { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.row-ctl.progs { align-items: center; }
.row-ctl .lbl { color: var(--muted); font-size: .9rem; font-weight: 600; }
.ctl { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.ctl select { font: inherit; font-size: .95rem; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; min-height: 38px; }
.ctl.tempo { grid-auto-flow: column; align-items: center; gap: 8px; }
.ctl.tempo input { width: 130px; accent-color: var(--robe); }
.ctl.tempo output { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; min-width: 2.2em; text-align: right; }
.readout { margin: 0; color: var(--ink); line-height: 1.5; min-height: 1.5em; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--robe); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; justify-self: start; }

/* On-screen keyboard */
.kb-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.kb-scroll svg { display: block; width: 100%; height: auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.kb-scroll .k { cursor: pointer; outline: none; }
.kb-scroll .k.w rect { fill: #fff; stroke: #1f3a2c; stroke-width: 1; }
.kb-scroll .k.b rect { fill: #17241d; stroke: #17241d; }
.kb-scroll .k text { font: 600 9px var(--body); pointer-events: none; }
.kb-scroll .k.w text { fill: #31443a; }
.kb-scroll .k.b text { fill: #fff; font-size: 7px; }
.kb-scroll .k:focus-visible rect { stroke: var(--brass); stroke-width: 2.5; }
.kb-scroll .k.hl.w rect { fill: #bfe3cd; }
.kb-scroll .k.hl.b rect { fill: #2d7a56; }
.kb-scroll .k.tgt.w rect { fill: #f1d999; }
.kb-scroll .k.tgt.b rect { fill: var(--brass); }
.kb-scroll .k.tgt.b text { fill: #231a05; }
.kb-scroll .k.ok.w rect { fill: #c6ece4; }
.kb-scroll .k.ok.b rect { fill: #1d7465; }
.kb-scroll .k.bad.w rect { fill: #f6d5d2; }
.kb-scroll .k.bad.b rect { fill: var(--danger); }
.kb-scroll .k.down rect { filter: brightness(.88); }

/* Quizzes */
.q-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: baseline; }
.q-prompt { margin: 0; font-size: 1.08rem; }
.q-score { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.q-area { display: grid; gap: 10px; }
.q-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.q-status { margin: 0; min-height: 1.5em; font-weight: 600; }
.q-status.ok { color: var(--ok); }
.q-status.bad { color: var(--danger); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { font: inherit; font-weight: 600; font-size: .92rem; padding: 8px 14px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); color: var(--ink); cursor: pointer; }
.choice:hover { border-color: var(--robe); }
.choice.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-ink); }
.choice.bad { background: var(--bad-soft); border-color: var(--danger); color: var(--danger); }

/* Chord family */
.nums { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.nums button { display: grid; gap: 2px; justify-items: center; padding: 10px 4px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--field); cursor: pointer; font: inherit; color: var(--ink); min-width: 0; }
.nums button b { font-family: var(--display); font-size: 1.4rem; line-height: 1; color: var(--robe); }
.nums button span { font-size: .8rem; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.nums button.on { background: var(--accent-bg); border-color: var(--accent-bg); }
.nums button.on b, .nums button.on span { color: #fff; }
@media (max-width: 520px) { .nums { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Metronome */
.seg-sm { display: flex; gap: 4px; flex-wrap: wrap; }
.seg-sm button { font: inherit; font-weight: 600; padding: 7px 12px; min-height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--field); color: var(--ink); cursor: pointer; }
.seg-sm button[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent-bg); color: #fff; }
.beats { display: flex; flex-wrap: wrap; gap: 6px; }
.beats span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; transition: background .06s; }
.beats span.big { border-color: #9cc9ae; color: var(--robe); }
.beats span.on { background: var(--robe-soft); }
.beats span.big.on { background: var(--accent-bg); color: #fff; }

/* Circle of fifths */
.circle-wrap { display: grid; justify-items: center; }
.circle-wrap svg { width: min(100%, 340px); height: auto; }
.circle .ring { fill: var(--robe-soft); }
.circle .hub { fill: var(--field); stroke: var(--line); }
.circle .ck { cursor: pointer; outline: none; }
.circle .ck circle { fill: var(--field); stroke: var(--line-strong); stroke-width: 1.5; }
.circle .ck .maj { font: 700 15px var(--body); fill: var(--ink); pointer-events: none; }
.circle .ck .min { font: 600 9.5px var(--body); fill: var(--muted); pointer-events: none; }
.circle .ck:hover circle, .circle .ck:focus-visible circle { stroke: var(--robe); }
.circle .ck.on circle { fill: var(--accent-bg); stroke: var(--accent-bg); }
.circle .ck.on .maj { fill: #fff; }
.circle .ck.on .min { fill: var(--robe); font-weight: 700; }
.circle .hubt { font: 700 12px var(--body); fill: var(--ink); }
.circle .hubs { font: 500 8.5px var(--body); fill: var(--muted); }

.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: ck; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.55; }
.checklist input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--brass); flex: none; }
@media (max-width: 760px) { .basics-list a { grid-template-columns: 2.4rem 1fr; } .basics-list .meta { grid-column: 2; } }

/* ---------- Units (Levels 2 and 3) ---------- */
.unit { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 12px; }
.unit[open] { border-color: var(--line-strong); }
.unit > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 2.6rem 1fr minmax(150px, 200px); gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r-md); }
.unit > summary::-webkit-details-marker { display: none; }
.unit > summary:hover { background: var(--tint); }
.unit > summary:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.u-num { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--robe-soft); color: var(--robe); font: 700 1.15rem var(--display); position: relative; }
.unit[open] .u-num { background: var(--accent-bg); color: #fff; }
.unit.complete .u-num { background: var(--brass); }
.unit.complete .u-num::after { content: ""; position: absolute; left: 50%; top: 45%; width: 7px; height: 14px; border: solid #231a05; border-width: 0 3px 3px 0; transform: translate(-50%, -50%) rotate(45deg); }
.u-main { display: grid; gap: 2px; min-width: 0; }
.u-eyebrow { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.u-main strong { font-family: var(--display); font-size: 1.2rem; line-height: 1.2; }
.u-sum { color: var(--muted); font-size: .93rem; }
.u-prog { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.u-prog .bar { height: 6px; }
.u-prog .bar i { background: var(--brass); }
.u-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.u-body > .group:first-child { margin-top: 14px; }
.song-group .group-head h3 { color: var(--brass-deep); }
.unit-check { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-top: 16px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--brass-soft); }
.unit-check .k { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brass-deep); }
.unit-check p:last-child { margin: 0; line-height: 1.55; }
.unit-check .check { flex: none; }
@media (max-width: 760px) {
  .unit > summary { grid-template-columns: 2.6rem 1fr; padding: 14px; }
  .u-prog { grid-column: 2; text-align: left; }
  .u-body { padding: 0 14px 14px; }
  .unit-check { flex-direction: column; align-items: flex-start; }
}

/* ---------- Practice timer ---------- */
.timer-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 22px; display: grid; gap: 14px; margin-bottom: 14px; }
.timer-card.running { border-color: var(--line-strong); background: linear-gradient(180deg, var(--tint), var(--card)); }
.timer-card.saving { border-color: var(--brass-line); }
.tm-head { display: grid; gap: 4px; }
.tm-head h2 { font-size: 1.35rem; }
.tm-head p { margin: 0; color: var(--muted); }
.tm-setup { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.tm-setup .field { margin: 0; }
.tm-setup select, .tm-setup input { width: 100%; }
.tm-start { justify-self: start; font-size: 1.05rem; padding: 12px 26px; }
.tm-run { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.tm-now { display: grid; gap: 6px; min-width: 0; }
.tm-label { margin: 0; color: var(--robe); font-weight: 600; }
.timer-card.paused .tm-label { color: var(--muted); }
.tm-clock { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 12vw, 4.6rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--ink); }
.timer-card.paused .tm-clock { color: var(--muted); }
.tm-goalrow { display: grid; grid-template-columns: auto minmax(120px, 260px); gap: 10px; align-items: center; color: var(--muted); font-size: .9rem; }
.tm-goalrow .bar { height: 8px; }
.tm-goalrow .bar i { background: var(--brass); transition: width .4s linear; }
.tm-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tm-btns .btn { min-width: 110px; }
.lesson-task .tm-go { margin-top: 10px; }
.la-right { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.metro-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 24px; }
.metro-panel > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--robe); }
.metro-panel > .widget { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); }
.timer-pill { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 55; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--robe-deep); color: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 6px 20px rgba(15, 34, 25, .25); }
.timer-pill b { font-variant-numeric: tabular-nums; }
.timer-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #ff6b5e; }
.timer-pill .dot.paused { background: #a8c7b3; }
@media (prefers-reduced-motion: no-preference) { .timer-pill .dot:not(.paused) { animation: pulse 1.4s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 760px) {
  .tm-setup { grid-template-columns: 1fr; }
  .tm-start { justify-self: stretch; }
  .tm-btns .btn { flex: 1; }
}

/* ---------- Practice buddies ---------- */
.group-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 22px; display: grid; gap: 14px; margin-bottom: 16px; }
.gc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.gc-head h2 { font-size: 1.4rem; }
.gc-head p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.buddy-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.buddy-board li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, .8fr); gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r-sm); background: var(--paper); }
.buddy-board li.me { background: var(--robe-soft); }
.buddy-board .who { display: grid; gap: 2px; min-width: 0; }
.buddy-board .who strong { overflow-wrap: anywhere; }
.buddy-board .you { display: inline-block; margin-left: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--robe); }
.buddy-board .who small { color: var(--muted); font-size: .85rem; }
.buddy-board .who small.today { color: var(--ok); font-weight: 600; }
.buddy-board .mins { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
.buddy-board .mins b, .buddy-board .num-stat b { color: var(--ink); font-family: var(--display); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.buddy-board .mins .bar { height: 7px; background: var(--field); }
.buddy-board .mins .bar i { background: var(--brass); }
.buddy-board .num-stat { font-size: .9rem; color: var(--muted); }
.invite { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); }
.invite .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.15rem; letter-spacing: .12em; color: var(--ink); background: var(--brass-soft); padding: 3px 8px; border-radius: 6px; margin-left: 6px; user-select: all; }
.inv-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.buddy-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.buddy-form { display: grid; gap: 10px; align-content: start; }
.buddy-form h2 { font-size: 1.25rem; margin: 0; }
.buddy-form .hint { margin: 0; }
.buddy-form .field { margin: 0; }
.buddy-form input { width: 100%; }
.buddy-form.invited { border-color: var(--brass); background: var(--brass-soft); }
#jn-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; }
.buddy-empty { color: var(--muted); margin-bottom: 12px; }
.more-groups { margin-top: 8px; }
.more-groups > summary { cursor: pointer; font-weight: 600; color: var(--robe); padding: 8px 0; }
.more-groups .buddy-forms { margin-top: 10px; }
.invite-note { background: var(--brass-soft); color: var(--brass-deep); border-radius: var(--r-sm); padding: 10px 14px; margin: 0 0 14px; font-weight: 600; }
@media (max-width: 760px) {
  .buddy-board li { grid-template-columns: 1fr 1fr; }
  .buddy-board .who, .buddy-board .mins { grid-column: 1 / -1; }
  .group-card { padding: 16px; }
}

/* ---------- Video credit ---------- */
.lesson-yt a, .footer #credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer #credit { max-width: 40rem; margin-left: auto; margin-right: auto; }

/* ---------- Home-screen install ---------- */
.install-tip { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: var(--r-md); padding: 16px 18px; margin: 0 0 24px; }
.install-tip img { border-radius: 11px; display: block; }
.install-tip strong { font-size: 1.05rem; }
.install-tip p { margin: 4px 0 0; color: var(--muted); }
.it-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.it-how { margin-top: 8px; }
.it-how summary { cursor: pointer; color: var(--robe); font-weight: 600; }
.install-steps { margin: 10px 0 0; padding-left: 1.2rem; display: grid; gap: 6px; line-height: 1.5; }
.share-glyph { vertical-align: -3px; color: var(--robe); }
.install-section { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.install-section h2 { font-size: 1.3rem; margin: 0 0 8px; }
.install-section p { margin: 0 0 12px; }
@media (max-width: 640px) {
  .install-tip { grid-template-columns: auto 1fr; align-items: start; gap: 12px; padding: 14px; }
  .install-tip img { width: 40px; height: 40px; border-radius: 9px; }
  .it-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- Delete account ---------- */
.danger-zone { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.danger-zone h2 { font-size: 1.3rem; margin: 0 0 8px; color: var(--danger); }
.danger-zone > p { margin: 0 0 14px; color: var(--muted); }
.danger-zone summary { list-style: none; display: inline-flex; }
.danger-zone summary::-webkit-details-marker { display: none; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid currentColor; cursor: pointer; }
.btn-danger:hover { background: var(--bad-soft); }
.danger-zone details[open] summary { display: none; }
.danger-zone form { margin-top: 4px; padding: 16px; border: 1px solid var(--danger-line); background: var(--danger-soft); border-radius: var(--r-sm); }
.btn-danger-solid { background: var(--danger-bg); color: #fff; border: 1px solid var(--danger-bg); }
.btn-danger-solid:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Find a lesson ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.find-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 20px; }
.find-bar input, .find-q input { flex: 1 1 260px; min-width: 0; min-height: 44px; padding: 10px 14px; font: inherit; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--ink); }
.find-bar input:focus, .find-q input:focus { outline: 2px solid var(--robe); outline-offset: 1px; border-color: var(--robe); }
.fb-browse { color: var(--robe); font-weight: 600; font-size: .95rem; padding: 0 4px; }
.find-form { display: grid; gap: 12px; margin-bottom: 16px; }
.find-q { display: flex; }
.find-q input { font-size: 1.05rem; }
.find-filters { display: flex; gap: 10px 18px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.find-filters label { display: inline-flex; gap: 8px; align-items: center; }
.find-filters select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--ink); min-height: 40px; }
.fd-clear { min-height: 38px; padding: 6px 14px; }
.find-skill { margin: 0 0 12px; color: var(--muted); }
.find-skill .chip button { background: none; border: 0; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 0 0 4px; }
.skills-browse { margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); padding: 4px 16px; }
.skills-browse > summary { cursor: pointer; font-weight: 600; color: var(--robe); padding: 10px 0; }
.skills-browse[open] { padding-bottom: 14px; }
.skill-group h3 { font-family: var(--body); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 12px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .92rem; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; text-align: left; }
.chip .n { color: var(--muted); font-size: .82rem; }
.chip:hover:not(:disabled) { border-color: var(--robe); }
.chip[aria-pressed="true"] { background: var(--accent-bg); border-color: var(--accent-bg); color: #fff; }
.chip[aria-pressed="true"] .n { color: #d7eadf; }
.chip:disabled { opacity: .45; cursor: default; }
.find-count { margin: 4px 0 8px; color: var(--muted); }
.find-count strong { color: var(--ink); }
.find-empty { color: var(--muted); padding: 18px 0; }
.find-head { font-size: 1.15rem; margin: 22px 0 4px; }
.row .ctx { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.find-part { display: inline-block; margin-top: 6px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--robe); background: var(--robe-soft); border: 0; border-radius: 999px; padding: 4px 10px; cursor: pointer; text-align: left; }
.row .tag.basics { color: var(--brass-deep); }
a.title { color: inherit; text-decoration: none; font-weight: 600; }
a.title:hover { text-decoration: underline; }
.lesson-meta a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Theme picker ---------- */
.theme-pick { display: inline-flex; gap: 2px; align-items: center; margin-top: 10px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.theme-pick span { padding: 0 8px 0 10px; font-size: .85rem; }
.theme-pick button { font: inherit; font-size: .85rem; font-weight: 600; border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: 999px; cursor: pointer; min-height: 32px; }
.theme-pick button[aria-pressed="true"] { background: var(--accent-bg); color: #fff; }

/* ---------- Ear game ---------- */
.ear { max-width: 760px; margin: 0 auto; }
.ear-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.ear-how { margin: 0 0 14px; padding-left: 1.3rem; display: grid; gap: 8px; line-height: 1.55; }
.ear-sound { color: var(--muted); margin-bottom: 18px; }
.ear-start { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.ear-bests { display: flex; gap: 18px; color: var(--muted); }
.ear-bests b { color: var(--ink); font-family: var(--display); font-size: 1.2rem; margin-left: 4px; }
.ear-h { font-size: 1.2rem; margin: 28px 0 10px; }
.ear-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ear-recent li { display: flex; gap: 14px; align-items: baseline; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); }
.ear-recent b { font-family: var(--display); font-size: 1.15rem; min-width: 3.5rem; }
.ear-recent span { color: var(--muted); }
.ear-bar { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); }
.ear-bar b { color: var(--ink); font-family: var(--display); font-size: 1.15rem; }
.ear-streak { color: var(--brass-deep); font-weight: 600; }
.ear-lives { display: inline-flex; gap: 6px; }
.ear-lives i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--box-line); }
.ear-lives i.on { background: var(--brass); border-color: var(--brass); }
.ear-play { text-align: center; transition: border-color .2s, background .2s; }
.ear-play.is-ok { border-color: var(--ok); }
.ear-play.is-bad { border-color: var(--danger); }
.ear-key { color: var(--muted); margin-bottom: 6px; }
.ear-key b { color: var(--ink); font-family: var(--display); font-size: 1.3rem; }
.ear-new { display: inline-block; margin-left: 6px; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brass-deep); background: var(--brass-soft); border-radius: 999px; padding: 2px 8px; vertical-align: 2px; }
.ear-status { min-height: 3.2em; font-size: 1.1rem; font-weight: 600; margin: 8px auto 14px; max-width: 34rem; }
.is-ok .ear-status { color: var(--ok); }
.is-bad .ear-status { color: var(--danger); }
.ear-slots { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.ear-slots span { width: 48px; height: 48px; border: 2px dashed var(--line-strong); border-radius: var(--r-sm); display: grid; place-items: center; font-family: var(--display); font-size: 1.4rem; font-weight: 700; }
.ear-slots span.on { border-style: solid; border-color: var(--robe); color: var(--robe); }
.ear-pads { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.ear-pad { display: grid; gap: 2px; justify-items: center; padding: 14px 4px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--field); color: var(--ink); cursor: pointer; font: inherit; min-height: 72px; touch-action: manipulation; }
.ear-pad b { font-family: var(--display); font-size: 1.7rem; line-height: 1; }
.ear-pad span { font-size: .8rem; color: var(--muted); }
.ear-pad:hover:not(:disabled) { border-color: var(--robe); }
.ear-pad:active:not(:disabled) { background: var(--accent-bg); color: #fff; }
.ear-pad:disabled { opacity: .35; cursor: default; }
.ear-ctl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ear-keys-hint { margin-top: 14px; color: var(--muted); font-size: .85rem; }
@media (pointer: coarse) { .ear-keys-hint { display: none; } }
.ear-quit { text-align: center; margin-top: 14px; }
.ear-over { text-align: center; display: grid; gap: 10px; justify-items: center; }
.ear-eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ear-final b { font-family: var(--display); font-size: 3.2rem; line-height: 1; }
.ear-best-flag { color: var(--brass-deep); font-weight: 700; font-size: 1.1rem; }
.ear-over .ear-start { justify-content: center; margin-top: 6px; }
@media (max-width: 560px) {
  .ear-card { padding: 16px; }
  .ear-pads { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.buddy-board .games-line { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); margin-top: -4px; }
.buddy-board .games-line b { color: var(--ink); }

/* ---------- Games page and the games ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.game-tile { display: grid; gap: 6px; align-content: start; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.game-tile:hover { border-color: var(--robe); transform: translateY(-1px); }
.game-tile strong { font-family: var(--display); font-size: 1.3rem; }
.gt-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .8rem; }
.gt-level { font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brass-deep); }
.gt-best { color: var(--muted); }
.gt-best b { color: var(--ink); }
.gt-skill { color: var(--robe); font-weight: 600; font-size: .92rem; }
.gt-blurb { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.gt-go { margin-top: 6px; justify-self: start; font-weight: 700; color: var(--robe); }
.gt-go::after { content: " →"; }
.g-opt { margin: 0 0 16px; }
.g-timer { display: flex; align-items: center; gap: 10px; min-width: 160px; flex: 0 1 260px; }
.g-timer b { color: var(--ink); font-family: var(--display); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.g-track { flex: 1; height: 8px; border-radius: 999px; background: var(--field); border: 1px solid var(--line); overflow: hidden; }
.g-track i { display: block; height: 100%; width: 100%; background: var(--brass); transition: width .1s linear; }
.g-timer.low .g-track i { background: var(--danger-bg); }
.g-timer.low b { color: var(--danger); }
.g-prompt { text-align: center; font-size: 1.1rem; color: var(--muted); }
.g-prompt b { display: block; color: var(--ink); font-family: var(--display); font-size: 2.6rem; line-height: 1.15; }
.g-sub { font-size: .9rem; }
.g-notes .ear-status, .g-sprint .ear-status { text-align: center; min-height: 1.6em; margin: 6px auto 10px; }
.g-sprint .ear-ctl { margin-top: 14px; }
.g-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 16px; }
.g-choice { align-content: center; min-height: 64px; }
.g-choice b { font-size: 1.05rem; font-family: var(--body); }
.ear-pad.lit { background: var(--accent-bg); border-color: var(--accent-bg); color: #fff; }
.ear-pad.lit span { color: #d7eadf; }

/* Feedback ("Something wrong? Tell us") */
.linkish { background: none; border: 0; padding: 8px 0; font: inherit; color: var(--robe); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linkish:hover { color: var(--ink); }
.footer .linkish { color: var(--muted); padding: 4px 0; }
.la-left { display: inline-flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.lesson.fb { width: min(560px, 94vw); }
.fb-body { padding: 20px 22px 22px; display: grid; gap: 14px; }
.fb-body .field { margin: 0; }
.fb-kinds { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fb-kinds legend { font-weight: 600; font-size: .95rem; margin-bottom: 8px; padding: 0; }
.fb-kind { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); font-weight: 600; font-size: .93rem; cursor: pointer; }
.fb-kind input { accent-color: var(--robe); width: 18px; height: 18px; margin: 0; }
.fb-kind:has(input:checked) { border-color: var(--robe); box-shadow: 0 0 0 2px var(--robe-soft); }
.fb-kind:has(input:focus-visible) { outline: 2px solid var(--robe); outline-offset: 2px; }
.fb-about { background: var(--robe-soft); padding: 10px 12px; border-radius: var(--r-sm); }
.fb-count:empty { display: none; }
.fb-body .error { margin: 0; }
.fb-body .error:empty { display: none; }
.fb-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Phones: one-row menu, bigger touch areas */
.nav .ns { display: none; }
@media (max-width: 640px) {
  .topbar { padding: 10px 16px 0; row-gap: 2px; }
  .nav { flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 10px; width: calc(100% + 32px); max-width: none; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 28px), transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a, .nav button { flex: none; white-space: nowrap; padding: 12px 11px; }
  .nav .nl { display: none; }
  .nav .ns { display: inline; }
}
body.has-pill main { padding-bottom: 104px; }
.row .title { padding: 9px 0; margin: -9px 0; }
.toggle { min-height: 40px; }
.linklike { padding: 8px 4px; min-height: 40px; }
.footer .linkish { padding: 10px 0; }
.buddy-board .you { font-size: .75rem; }
@media (pointer: coarse) { .find-part { padding: 9px 12px; } }
.toast { width: max-content; max-width: calc(100vw - 32px); text-align: center; }
body.has-pill .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.page-loading { color: var(--muted); text-align: center; padding: 15vh 0; }

/* Video practice tools (speed, back 5 s, A-B loop) */
.vid-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 4px 22px 12px; }
.vid-tools-wrap { border-bottom: 1px solid var(--line); background: var(--tint); }
.vid-tools-wrap[hidden] { display: none; }
.vid-tools-wrap summary { cursor: pointer; padding: 10px 22px; font-weight: 600; color: var(--robe); min-height: 44px; display: flex; align-items: center; }
.vid-tools[hidden] { display: none; }
.vt-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vt-label { font-weight: 600; font-size: .9rem; color: var(--muted); margin-right: 2px; }
.vt-btn { padding: 7px 12px; min-height: 38px; font-size: .93rem; }
.vt-range { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--robe); }
@media (max-width: 640px) { .vid-tools { padding: 10px 16px; } }

/* Tools: shared */
.tool { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.tool > * { min-width: 0; }  /* wide keyboards scroll inside their own box instead of widening the page */
@media (max-width: 640px) { .cf-find .field { flex-basis: 100%; } }
.tool .field { margin: 0; }
.tool-ctl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 18px; align-items: end; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.tool-ctl output { font-variant-numeric: tabular-nums; }
.tool-ctl input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--robe); }
.tool-toggles { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.tool .error:empty { display: none; }
.tool .error { margin: 0; }
.tool .kb-scroll { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }

/* Play along */
.pa-now { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-weight: 600; color: var(--robe); }
.pa-now .btn { min-width: 120px; }
.pa-chart { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pa-chart li { display: grid; gap: 2px; justify-items: center; padding: 12px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); transition: background .1s, border-color .1s; }
.pa-chart .n { font-size: .85rem; font-weight: 700; color: var(--muted); }
.pa-chart b { font-family: var(--display); font-size: 1.35rem; }
.pa-chart li.on { background: var(--accent-bg); border-color: var(--accent-bg); color: #fff; }
.pa-chart li.on .n { color: #e2efe7; }
.pa-all { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; background: var(--card); }
.pa-all summary { cursor: pointer; font-weight: 600; color: var(--robe); min-height: 32px; display: flex; align-items: center; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
.pa-all table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.pa-all th, .pa-all td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pa-all thead th { color: var(--muted); font-size: .85rem; }
.pa-all tr.cur { background: var(--robe-soft); }

/* Chord finder */
.cf-find { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.cf-find .field { flex: 1 1 220px; }
.cf-pick { display: flex; gap: 14px; flex-wrap: wrap; }
.cf-pick .field { flex: 1 1 160px; }
.cf-card { display: grid; gap: 14px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.cf-card .kb-scroll { border: 0; padding: 0; }
.cf-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: start; }
.cf-sym { font-family: var(--display); font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.cf-name { color: var(--muted); }
.cf-play { display: flex; gap: 8px; flex-wrap: wrap; }
.cf-notes { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.cf-notes span { display: grid; justify-items: center; min-width: 52px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--robe-soft); }
.cf-notes b { font-size: 1.15rem; }
.cf-notes small { color: var(--muted); font-size: .78rem; }
.cf-h { font-size: 1.1rem; margin-bottom: 4px; }
.cf-card .hint { margin: 0 0 8px; }
.cf-rungs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cf-rungs button { display: flex; gap: 12px; align-items: start; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; }
.cf-rungs button[aria-pressed="true"] { border-color: var(--robe); box-shadow: 0 0 0 2px var(--robe-soft); }
.cf-rungs .r-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-bg); color: #fff; font-weight: 700; font-size: .9rem; }
.cf-rungs .r-why { display: block; color: var(--muted); font-size: .92rem; margin-top: 2px; }

/* Reharm explorer */
.rh-tech { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rh-tech legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.rh-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px 6px 10px; border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--r-sm); background: var(--field); font-weight: 600; font-size: .93rem; cursor: pointer; }
.rh-chip input { accent-color: var(--robe); width: 18px; height: 18px; margin: 0; }
.rh-rows { display: grid; gap: 14px; }
.rh-row { padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.rh-row-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.rh-row-h h3 { font-size: 1.1rem; }
.rh-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rh-bars li { display: grid; gap: 4px; }
.bar-n { font-size: .8rem; font-weight: 700; color: var(--muted); }
.bar-cs { display: flex; gap: 4px; }
.rh-c { min-width: 0; padding: 10px 6px; text-align: center; font-weight: 700; border-radius: var(--r-sm); background: var(--tint); border: 1px solid var(--line); border-bottom-width: 4px; overflow-wrap: anywhere; font-size: .95rem; }
.rh-c.on { outline: 3px solid var(--robe); outline-offset: 1px; }
.rh-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rh-legend li { padding: 10px 12px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); border-left-width: 5px; }
.t-colors { border-left-color: var(--robe) !important; }
.rh-c.t-colors { border-color: var(--line) !important; border-bottom-color: var(--robe) !important; background: var(--robe-soft); }
.t-twofive, .t-secdom { border-left-color: var(--brass) !important; }
.rh-c.t-twofive, .rh-c.t-secdom { border-left-color: var(--line) !important; border-bottom-color: var(--brass) !important; background: var(--brass-soft); }
.t-tritone { border-left-color: var(--danger) !important; }
.rh-c.t-tritone { border-left-color: var(--line) !important; border-bottom-color: var(--danger) !important; background: var(--danger-soft); }
.t-dim { border-left-color: var(--ok) !important; }
.rh-c.t-dim { border-left-color: var(--line) !important; border-bottom-color: var(--ok) !important; background: var(--ok-soft); color: var(--ok-ink); }
.t-minor4 { border-left-color: var(--muted) !important; }
.rh-c.t-minor4 { border-left-color: var(--line) !important; border-bottom-color: var(--muted) !important; background: var(--field); }
.acc { font-family: var(--body); font-weight: 700; font-size: .82em; margin-left: .02em; }
.brand { white-space: nowrap; }
@media (max-width: 1100px) and (min-width: 641px) { .nav .nl { display: none; } .nav .ns { display: inline; } .nav a, .nav button { padding: 8px 10px; } }

/* Placement check */
.place-link { color: var(--muted); }
.place-card { display: grid; gap: 14px; max-width: 640px; }
.place-bar { height: 6px; border-radius: 999px; background: var(--robe-soft); overflow: hidden; }
.place-bar i { display: block; height: 100%; background: var(--brass); }
.place-q { font-size: 1.35rem; line-height: 1.35; }
.place-choices { grid-template-columns: 1fr; }
.place-choices .g-choice { text-align: left; justify-content: start; min-height: 52px; }
.place-unsure { justify-self: start; }
.place-result { font-size: 1.6rem; }
.place-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.place-notes li { padding: 10px 12px 10px 38px; border-radius: var(--r-sm); position: relative; line-height: 1.5; }
.place-notes li::before { position: absolute; left: 12px; top: 10px; font-weight: 700; }
.place-notes li.ok { background: var(--ok-soft); color: var(--ok-ink); }
.place-notes li.ok::before { content: "✓"; }
.place-notes li.gap { background: var(--brass-soft); color: var(--ink); }
.place-notes li.gap::before { content: "→"; color: var(--brass-deep); }
.place-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Today's practice */
.today { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 22px; }
.today-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.today-head h2 { font-size: 1.45rem; }
.today-eyebrow { font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brass-deep); }
.today-day { color: var(--muted); font-weight: 600; }
.today-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.today-steps li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.today-steps .check { padding: 6px; border-radius: 50%; }
.today-steps li.is-done .ts-title, .today-steps li.is-done .ts-text { color: var(--muted); }
.today-steps li.is-done .ts-title { text-decoration: line-through; text-decoration-thickness: 1px; }
.ts-title { font-weight: 700; }
.ts-min { display: inline-block; min-width: 52px; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: var(--robe-soft); color: var(--robe); font-size: .8rem; text-align: center; }
.ts-text { color: var(--ink-soft); margin-top: 2px; line-height: 1.5; }
.ts-go { display: inline-block; margin-top: 4px; font-weight: 600; color: var(--robe); }
a.ts-go { padding: 8px 0; }
.today-done { margin-top: 10px; font-weight: 600; color: var(--ok-ink); }
.today-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--brass-line); border-radius: var(--r-md); background: var(--brass-soft); color: var(--ink); text-decoration: none; }
.today-link b { margin-right: 8px; }
.today-link .tl-go { font-weight: 700; color: var(--brass-deep); }
.today-link.done { background: var(--ok-soft); border-color: var(--ok); }
.ts-go.linklike { padding-left: 0; padding-right: 0; }

/* 12 keys tracker */
.keys-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; margin: 18px 0 26px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); color: var(--ink); text-decoration: none; }
.keys-card b { margin-right: 8px; font-family: var(--display); font-size: 1.1rem; }
.keys-card:hover { border-color: var(--robe); }
.keys-card .tl-go { font-weight: 700; color: var(--robe); }
.ks-skills { margin-bottom: 18px; }
.ks-skills small { font-weight: 500; opacity: .85; margin-left: 4px; }
.ks-main { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 24px; align-items: center; }
.ks-circle svg { width: 100%; height: auto; display: block; }
.ks-key { cursor: pointer; outline: none; }
.ks-key circle { fill: var(--field); stroke: var(--line-strong); stroke-width: 1.5; transition: fill .12s; }
.ks-key text { font: 700 15px var(--body); fill: var(--ink); pointer-events: none; }
.ks-key:hover circle { stroke: var(--robe); }
.ks-key:focus-visible circle { stroke: var(--robe); stroke-width: 3; }
.ks-key.on circle { fill: var(--brass); stroke: var(--brass); }
.ks-key.on text { fill: #231a05; }
.ks-count { font: 700 44px var(--display); fill: var(--ink); }
.ks-of { font: 600 14px var(--body); fill: var(--muted); }
.ks-side h2 { font-size: 1.4rem; margin-bottom: 4px; }
.ks-side > p { color: var(--ink-soft); }
.ks-next { margin-top: 16px; padding: 16px; border-radius: var(--r-md); background: var(--brass-soft); border: 1px solid var(--brass-line); display: grid; gap: 6px; justify-items: start; }
.ks-next .k { font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brass-deep); }
.ks-next-key { font-family: var(--display); font-size: 1.5rem; font-weight: 700; }
.ks-chords { font-weight: 600; }
.ks-next .btn { margin-top: 6px; }
.ks-next.done { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-ink); }
.ks-side .error:empty { display: none; }
.ks-side .error { margin-top: 10px; }
.ks-h { margin: 30px 0 10px; font-size: 1.3rem; }
.ks-table { border-collapse: collapse; width: 100%; }
.ks-table th, .ks-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.ks-table tbody th { text-align: left; font-weight: 600; padding-right: 12px; }
.ks-table thead th { color: var(--muted); font-size: .85rem; }
.ks-table .dot { color: var(--muted); font-size: 1.1rem; }
.ks-table .dot.on { color: var(--brass-deep); }
@media (max-width: 700px) { .ks-main { grid-template-columns: 1fr; } .ks-circle { max-width: 340px; margin: 0 auto; width: 100%; } }
.ks-table thead th:first-child { text-align: left; }

/* Record yourself */
.rc-now { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-weight: 600; color: var(--robe); }
.rc-big { min-width: 140px; min-height: 52px; font-size: 1.05rem; }
.rc-big.on { background: var(--danger); color: #fff; }
.rc-meter { flex: 1 1 120px; max-width: 220px; height: 8px; border-radius: 999px; background: var(--robe-soft); overflow: hidden; }
.rc-meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.rc-h { font-size: 1.3rem; margin-top: 8px; }
.rc-takes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rc-take, .rc-empty { padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.rc-empty { color: var(--muted); }
.rc-take-h { display: flex; gap: 10px; align-items: start; }
.rc-cmp { min-height: 32px; }
.rc-title { font-weight: 700; }
.rc-meta { color: var(--muted); font-size: .9rem; }
.rc-wave { display: block; width: 100%; height: 90px; margin: 10px 0 6px; background: var(--tint); border-radius: var(--r-sm); }
.rc-verdict { line-height: 1.5; }
.rc-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.rc-cmp-box { padding: 16px; background: var(--brass-soft); border: 1px solid var(--brass-line); border-radius: var(--r-md); }
.rc-cmp-box h3 { margin-bottom: 8px; }
.rc-cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
p.rc-pct { font-family: var(--display); font-size: 2rem; font-weight: 700; margin-top: 4px; }
p.rc-pct small { font-family: var(--body); font-size: .85rem; font-weight: 600; color: var(--muted); margin-left: 6px; }
.rc-cmp-say { margin-top: 10px; font-weight: 600; }

/* Hymns */
.hymns-panel { background: var(--robe-soft); border-color: var(--line-strong); }
.hymns-panel .bp-eyebrow { color: var(--robe); }
.hymn-tile.is-done { border-color: var(--brass-line); }
.hymn-page .page-head { align-items: start; }
.hy-steps { margin: 0 0 18px; padding-left: 1.4em; display: grid; gap: 6px; max-width: 70ch; line-height: 1.55; }
.hy-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hy-lines > li { display: grid; gap: 6px; }
.hy-words { font-weight: 600; color: var(--ink-soft); }
.hy-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.hy-bar { display: flex; gap: 4px; padding-left: 6px; border-left: 2px solid var(--line-strong); }
.hy-bar .rh-c { display: grid; justify-items: center; gap: 0; padding: 8px 4px; }
.hy-bar .rh-c { min-width: 0; overflow-wrap: normal; }
.hy-bar .rh-c b { font-size: .9rem; white-space: nowrap; }
.hy-bar .rh-c small { font-size: .75rem; color: var(--muted); font-weight: 600; }
.hy-gospel { font-weight: 700; color: var(--robe); }
.hy-tips { margin-top: 26px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.hy-tips h2 { font-size: 1.25rem; margin-bottom: 8px; }
.hy-tips ul { padding-left: 1.2em; display: grid; gap: 6px; line-height: 1.55; }
.hy-more { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.hymn-page > .hint { margin-top: 16px; }
.hymns-panel .bp-count, .hymns-panel .bp-count b { color: var(--robe); }
.cf-card, .rh-row, .rc-take { grid-template-columns: minmax(0, 1fr); min-width: 0; } .cf-card > *, .rc-take > * { min-width: 0; }

/* Phone tab bar and the Me page */
.tabbar { display: none; }
@media (max-width: 640px) {
  body.has-tabbar .nav { display: none; }
  body.has-tabbar .topbar { padding-bottom: 10px; }
  body.has-tabbar .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--card); border-top: 1px solid var(--line); padding: 4px max(6px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600; border-radius: var(--r-sm); }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--robe); }
  .tabbar a[aria-current="page"] svg { stroke-width: 2.4; }
  body.has-tabbar main { padding-bottom: 96px; }
  body.has-tabbar .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar .timer-pill { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar.has-pill .toast { bottom: calc(136px + env(safe-area-inset-bottom, 0px)); }
}
.me-links { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.me-links a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.me-links a:hover { border-color: var(--robe); }
.me-links b { display: block; font-family: var(--display); font-size: 1.1rem; }
.me-links span span { color: var(--muted); font-size: .92rem; }
.me-go { font-size: 1.6rem; color: var(--robe); line-height: 1; }

/* Lesson window: title and close stay at the top while you scroll */
.lesson-bar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px 10px 22px; background: var(--card); border-bottom: 1px solid var(--line); }
.lesson-bar h2 { font-size: 1.2rem; line-height: 1.3; min-width: 0; }
@media (max-width: 640px) {
  .lesson-bar { padding: 8px 10px 8px 16px; }
  .lesson-bar h2 { font-size: 1.02rem; }
  .lesson-video { position: sticky; top: 57px; z-index: 2; }
}

#jn-code::placeholder { text-transform: none; letter-spacing: normal; font-family: var(--body); }
@media (max-width: 640px) { .find-bar button[type="submit"] { display: none; } .find-bar input { flex-basis: 100%; } }
.skills-wrap { margin-top: 8px; }
.skills-wrap > summary { cursor: pointer; list-style: none; display: grid; gap: 2px; padding: 10px 0; }
.skills-wrap > summary::-webkit-details-marker { display: none; }
.skills-wrap > summary h2 { display: inline; }
.skills-wrap > summary h2::after { content: " \25B8"; color: var(--robe); font-size: .8em; }
.skills-wrap[open] > summary h2::after { content: " \25BE"; }
.skills-wrap .skills { margin-top: 12px; }
.group.single { margin-top: 0; }
.ear-pad.g-choice { text-align: left; }

/* Home page (logged out) */
.home-hero { display: grid; gap: 18px; max-width: 40rem; padding: clamp(8px, 3vw, 28px) 0 32px; }
.home-hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.05; text-wrap: balance; }
.home-lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 34rem; }
.home-actions { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.home-actions .btn { min-height: 52px; padding: 12px 24px; font-size: 1.05rem; }
.home-login { font-weight: 600; color: var(--robe); padding: 10px 2px; }
.home-small { color: var(--muted); }
.home-small a { color: var(--robe); }
.hero-keys { margin: 0 0 48px; }
.home-inside h2 { font-size: 1.5rem; margin-bottom: 8px; }
.home-inside dl { margin: 0; display: grid; grid-template-columns: 1fr; column-gap: 48px; max-width: 900px; }
@media (min-width: 700px) { .home-inside dl { grid-template-columns: 1fr 1fr; } }
.home-inside dl > div { padding: 16px 0; border-top: 1px solid var(--line); }
.home-inside dt { font-family: var(--display); font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.home-inside dd { margin: 0; color: var(--muted); line-height: 1.55; }

/* Home (logged in) */
.dash-head { margin-bottom: 18px; display: grid; gap: 4px; }
.dash-date { color: var(--muted); font-weight: 600; }
.dash-head h1 { font-size: clamp(2rem, 5vw, 2.6rem); text-wrap: balance; }
.dash-sub { color: var(--ink-soft); }
.dash-grid { display: grid; gap: 22px; align-items: start; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); } }
.dash-main .today { margin-bottom: 0; }
.dash-side { display: grid; gap: 14px; }
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dash-stats div { display: grid; gap: 2px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.dash-stats b { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; color: var(--robe); font-variant-numeric: tabular-nums; }
.dash-stats span { color: var(--muted); font-size: .85rem; line-height: 1.3; }
.dash-more { justify-self: start; font-weight: 600; color: var(--robe); padding: 4px 0; }
.dash-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dash-links a, .dash-buddies { display: grid; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; }
.dash-links a:hover, .dash-buddies:hover { border-color: var(--robe); }
.dash-links b, .dash-buddies b { font-family: var(--display); font-size: 1.05rem; }
.dash-links span, .dash-buddies span { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.dash-buddies { background: var(--robe-soft); border-color: var(--line-strong); }

/* Tonic sol-fa and melody lines */
.hy-notes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hy-notes-l { font-weight: 600; color: var(--muted); font-size: .92rem; }
.hy-mel { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92rem; color: var(--robe); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.notes-pref { margin-top: 28px; }
.notes-pref h2 { font-size: 1.25rem; margin-bottom: 8px; }
