:root {
  --pinky: #7b68c4;
  --ring: #e08a2c;
  --middle: #2f9d62;
  --index: #3b82e6;
  --thumb: #e16b8c;
  --gold: #f0b429;
  --leaf: #0f8f78;
  --good: #1b8a4a;
  --bad: #d64545;
  --now: #fff1c2;
  --paper: #fff8ef;
  --paper-2: #fffdf9;
  --ink: #2a3344;
  --ink-soft: #4a5568;
  --muted: #6d7888;
  --line: #eadfca;
  --sidebar: #0c6b62;
  --sidebar-soft: #e7f6ee;
  --key: #fffdf8;
  --wash-a: #ffd36a;
  --wash-b: #7ddec4;
  --wash-c: #8eb7ff;
  --spoken: #9e0b24;
  --hero-size: 2.15rem;
  --pass-size: 1.15rem;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

body[data-theme="dark"] {
  --ink: #f7f3ea;
  --ink-soft: #e4ddd0;
  --muted: #b7c9be;
  --good: #86d7a8;
  --bad: #ff9b90;
  --key: #1c2e28;
  --wash-a: #166534;
  --wash-b: #0f766e;
  --wash-c: #1d4ed8;
  --paper: #0c1c18;
  --paper-2: #132820;
  --line: #245246;
  --now: #3d4a1c;
  --sidebar: #063f3a;
  --sidebar-soft: #d5eadf;
  --leaf: #2dd4bf;
  --gold: #f0c14d;
  --spoken: #ff9a9a;
  color-scheme: dark;
}

body[data-size="sm"] { --hero-size: 1.65rem; --pass-size: 1rem; }
body[data-size="md"] { --hero-size: 2.15rem; --pass-size: 1.15rem; }
body[data-size="lg"] { --hero-size: 2.7rem; --pass-size: 1.35rem; }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(38% 42% at 12% 8%, var(--wash-a), transparent 70%),
    radial-gradient(34% 40% at 92% 4%, var(--wash-b), transparent 68%),
    radial-gradient(46% 48% at 72% 108%, var(--wash-c), transparent 72%),
    var(--paper);
}

body::after {
  background:
    radial-gradient(28% 32% at 48% 42%, var(--wash-b), transparent 70%),
    radial-gradient(24% 28% at 18% 88%, var(--wash-c), transparent 72%);
  opacity: 0.55;
  mix-blend-mode: multiply;
}

body[data-theme="dark"]::after {
  opacity: 0.45;
  mix-blend-mode: screen;
}

button { font: inherit; }
button:focus { outline: none; }
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
button:disabled { opacity: 0.35; cursor: default; }

[hidden] { display: none !important; }

[data-finger="pinky"] { --fc: var(--pinky); }
[data-finger="ring"] { --fc: var(--ring); }
[data-finger="middle"] { --fc: var(--middle); }
[data-finger="index"] { --fc: var(--index); }
[data-finger="thumb"] { --fc: var(--thumb); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: grid;
  grid-template-columns: 16rem 1fr;
}

#sidebar {
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--sidebar) 78%, var(--wash-a)) 0%, var(--sidebar) 58%, color-mix(in srgb, var(--sidebar) 82%, var(--wash-c)) 100%);
  color: #f7fff9;
  overflow: auto;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand { padding: 0.95rem 0.9rem 0.2rem; }
.brand strong {
  display: block;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.brand span { color: var(--sidebar-soft); font-size: 0.85rem; }

.grade h2 {
  margin: 0.85rem 0.75rem 0.1rem;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold);
}
.blurb {
  margin: 0 0.75rem 0.3rem;
  color: var(--sidebar-soft);
  font-size: 0.75rem;
}

.unit {
  width: calc(100% - 0.7rem);
  margin: 0.12rem 0.35rem;
  display: grid;
  grid-template-columns: 1.3rem 1fr auto;
  gap: 0.4rem;
  align-items: center;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: 12px;
  padding: 0.32rem 0.4rem;
  cursor: pointer;
}
.unit strong { display: block; font-size: 0.86rem; font-weight: 600; }
.unit small { display: block; font-size: 0.7rem; color: var(--sidebar-soft); }
.num { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--gold); }
.unit:hover { background: rgba(255, 255, 255, 0.06); }
.unit.is-on,
.unit.is-on:hover { background: var(--gold); color: #1c1608; }
.unit.is-on .num,
.unit.is-on small { color: #4a3b12; }

.pips { display: flex; gap: 3px; }
.pip {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  display: block;
}
.pip.on { background: var(--gold); }
.unit.is-on .pip { background: rgba(28, 22, 8, 0.25); }
.unit.is-on .pip.on { background: #1c1608; }
.unit.is-locked { opacity: 0.55; }
.card.is-locked { opacity: 0.72; }
.card.is-locked:hover { border-color: var(--line); }
.chapter {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
}
.verse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.45rem;
}
.verse {
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--leaf) 22%, var(--line));
  background: color-mix(in srgb, var(--paper-2) 80%, var(--wash-b));
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}
.verse strong { display: block; font-size: 0.92rem; }
.verse small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.verse:hover,
.verse.is-on { border-color: var(--gold); }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--paper) 62%, transparent);
  backdrop-filter: blur(16px);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}
.logo-btn {
  display: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0.1rem 0.2rem;
  cursor: pointer;
}
.tracks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  align-self: flex-start;
  max-width: 100%;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper-2) 70%, transparent);
}
.track-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.28rem 0.15rem 0.28rem 0.55rem;
}
.track-gap {
  width: 1px;
  align-self: stretch;
  margin: 0.28rem 0.2rem;
  background: var(--line);
}
.size-set {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper-2) 74%, transparent);
}
.size-set .tool {
  border: 0;
  background: transparent;
  border-radius: 0;
}
.size-set .tool + .tool { border-left: 1px solid var(--line); }
.track {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.catch {
  margin: 0.85rem 0 0.2rem;
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--gold);
  border-radius: 0 14px 14px 0;
  background: color-mix(in srgb, var(--paper-2) 84%, var(--wash-a));
}
.catch p { margin: 0.2rem 0; line-height: 1.45; }
.study .catch { margin-top: 0.7rem; }
.track.is-on {
  background: var(--leaf);
  color: #fff;
}
.kicker.words { color: var(--spoken); font-weight: 700; }
body[data-page="red"] .hero { border-color: var(--spoken); }
body[data-page="red"] .passage,
body[data-page="red"] .hero,
body[data-page="red"] .ch.ok,
body[data-page="red"] .ch.wait,
body[data-page="red"] .ch.now { color: var(--spoken); }
body[data-page="red"] .ch.ok { color: #6d0818; }
body[data-theme="dark"][data-page="red"] .ch.ok { color: #ffd2d2; }
body[data-page="red"] .verse small { color: var(--spoken); }
.spacer { flex: 1; }
.stars { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.tool {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-2) 74%, transparent);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.tool[aria-pressed="true"] {
  background: var(--leaf);
  color: #fff;
  border-color: var(--leaf);
}

.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#lesson {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.9rem 1.1rem 0.5rem;
  outline: none;
}
.sheet { width: min(52rem, 100%); margin: 0 auto; }

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0.1rem 0 0;
}
.teach { margin: 0.2rem 0 0.35rem; color: var(--muted); max-width: 46rem; }
.lead { color: var(--ink-soft); line-height: 1.45; max-width: 40rem; }
.lead.small { color: var(--muted); font-size: 0.92rem; }

.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.45rem 0 0.2rem; }
.chip {
  min-width: 2rem;
  text-align: center;
  border-top: 3px solid var(--fc, var(--ink));
  border-radius: 7px;
  padding: 0.28rem 0.5rem 0.2rem;
  background: var(--paper-2);
  box-shadow: 0 1px 0 var(--line);
  font-family: var(--mono);
  font-weight: 700;
}

.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0.55rem 0 0.35rem;
}
.mode {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}
.mode.is-on { background: var(--leaf); color: #fff; }
.nav-arrow {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}
.instruct { margin: 0 0 0.55rem; color: var(--ink-soft); }
.best { margin: -0.15rem 0 0.55rem; color: var(--muted); font-size: 0.85rem; }

.caps {
  background: #fff1c9;
  color: #6a4b00;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  margin: 0 0 0.5rem;
}
body[data-theme="dark"] .caps { background: #3d3420; color: #ffd98a; }

.hero {
  border: 3px solid var(--leaf);
  border-radius: 18px;
  min-height: 4.8rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--paper-2) 88%, transparent);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--sidebar) 12%, transparent);
  font-family: var(--mono);
  font-size: var(--hero-size);
  line-height: 1.35;
  text-align: center;
}
.hero .ch.now {
  box-shadow: inset 0 0 0 2.5px var(--ink);
  background: var(--now);
  border-radius: 4px;
}
.passage {
  font-family: var(--mono);
  font-size: var(--pass-size);
  line-height: 1.65;
  max-height: 7.2rem;
  overflow: auto;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-2) 84%, transparent);
  position: relative;
}
.ch.ok { color: var(--good); }
.ch.wait { color: var(--ink); }
.ch.now { color: var(--ink); }
.ch.space { white-space: pre; }
.passage .ch.space.now {
  background: var(--now);
  box-shadow: inset 0 0 0 2px var(--ink);
  border-radius: 4px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0.65rem 0 0.35rem;
}
.bar {
  flex: 1 1 8rem;
  height: 0.45rem;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  min-width: 6rem;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
}
.stat b {
  display: block;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.stat span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.restart {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0.2rem;
}

.hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.15rem 0 0.45rem;
  font-size: 1.02rem;
}
.hint::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 99px;
  background: var(--fc, var(--ink));
  flex: none;
}
.note { color: var(--bad); margin: 0 0 0.45rem; }
.sheet a { color: var(--leaf); }
.study {
  margin: 0.55rem 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper-2) 90%, var(--wash-b));
  padding: 0.2rem 0.9rem 0.8rem;
}
.study summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.55rem 0;
}
.study h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.7rem 0 0.15rem;
}
.study p, .study li { color: var(--ink-soft); line-height: 1.45; margin: 0.15rem 0; }
.study-flag { color: var(--muted); font-size: 0.88rem; }
.choices { display: grid; gap: 0.5rem; margin-top: 0.85rem; }
.choice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-2) 90%, var(--wash-b));
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 1.02rem;
}
.choice-key {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--gold) 45%, var(--paper-2));
  font-weight: 700;
}
.choice.is-right { border-color: var(--good); }
.choice.is-wrong { border-color: var(--bad); }
.choice:hover { border-color: var(--leaf); }
.miss { margin: 0.45rem 0; line-height: 1.4; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.8rem;
}
.card {
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--leaf) 28%, var(--line));
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--wash-a) 28%, var(--paper-2)), color-mix(in srgb, var(--paper-2) 86%, var(--wash-c)));
  border-radius: 18px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--sidebar) 10%, transparent);
  padding: 0.85rem 0.9rem 0.95rem;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.card .n {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 2rem;
  line-height: 1;
}
.card .promise, .card .count { color: var(--muted); font-size: 0.88rem; }
.card.is-next { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.card:hover { border-color: var(--ink); }
.continue { margin-top: 0.8rem; }
.fields { display: grid; gap: 0.65rem; max-width: 24rem; margin-top: 0.9rem; }
.fields label { display: grid; gap: 0.25rem; font-size: 0.92rem; color: var(--ink-soft); }
.fields input {
  user-select: text;
  font: inherit;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}
.username-preview { margin: 0.35rem 0 0; color: var(--muted); }
.roster { width: 100%; border-collapse: collapse; margin-top: 0.8rem; }
.roster th, .roster td {
  text-align: left;
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.roster th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.row-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}

.results { text-align: center; padding-top: 0.4rem; }
.results .stats { justify-content: center; }
.star-row { font-size: 2.3rem; letter-spacing: 0.2rem; margin: 0.35rem 0; }
.star { color: var(--line); }
.star.on { color: var(--gold); }
.result-line { font-size: 1.15rem; margin: 0.2rem 0 0.8rem; }
.actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.primary, .ghost {
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-block;
}
.primary { background: var(--leaf); color: #fff; border: 0; }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

#dock {
  border-top: 1px solid var(--line);
  padding: 0.45rem 0.7rem 0.55rem;
  background: color-mix(in srgb, var(--paper-2) 78%, transparent);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  container-type: inline-size;
}
.board { width: max-content; margin: 0 auto; }
.row {
  display: flex;
  justify-content: center;
  gap: 0.28rem;
  margin: 0.28rem 0;
}
.row:nth-child(2) { padding-left: 0.85rem; }
.row:nth-child(3) { padding-left: 1.15rem; }
.key {
  position: relative;
  width: 2.15rem;
  width: clamp(1.35rem, 5.8cqi, 2.55rem);
  height: 2.4rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--fc, var(--line));
  border-radius: 10px;
  background: var(--key);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  box-shadow: 0 1px 0 rgba(20, 28, 44, 0.18);
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.key.shift, .key.back {
  width: clamp(1.8rem, 8cqi, 3.3rem);
  font-family: var(--sans);
  font-size: 0.72rem;
}
.key.space { width: min(16rem, 42cqi); font-family: var(--sans); }
.key.is-dim { opacity: 0.34; }
.key.is-next {
  opacity: 1;
  background: var(--fc, var(--ink));
  color: #fff;
  border-color: transparent;
}
.key.is-shift { opacity: 1; box-shadow: inset 0 0 0 2px var(--gold); }
.key.is-press { transform: translateY(1px); }
.bump {
  position: absolute;
  left: 50%;
  bottom: 0.28rem;
  width: 0.7rem;
  height: 2px;
  margin-left: -0.35rem;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.75;
}
.legend {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}
.legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.legend i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 99px;
  display: block;
  background: var(--fc);
}

dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  background: var(--paper-2);
  color: var(--ink);
  max-width: 38rem;
  width: calc(100% - 2rem);
  box-shadow: 0 24px 80px rgba(16, 20, 28, 0.28);
}
dialog::backdrop { background: rgba(12, 16, 24, 0.55); }
dialog .sheet {
  padding: 1.2rem 1.3rem 1.3rem;
  max-height: min(80dvh, 40rem);
  overflow: auto;
}
dialog h2 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  margin: 0 0 0.35rem;
}
dialog h3 { margin: 1rem 0 0.3rem; font-size: 0.95rem; }
dialog p, dialog li { color: var(--ink-soft); line-height: 1.45; }
dialog ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
dialog .actions { justify-content: flex-start; margin-top: 1rem; }
.noscript {
  margin: 1rem;
  font-family: var(--sans);
}

@media (prefers-reduced-motion: no-preference) {
  .bar > span { transition: width 80ms linear; }
  .hero.is-miss { animation: shake 0.18s linear; }
  .key.is-next { animation: pulse 1.4s ease-in-out infinite; }
  body::before { animation: mesh-a 22s ease-in-out infinite alternate; }
  body::after { animation: mesh-b 28s ease-in-out infinite alternate; }
}
@keyframes mesh-a {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 3%, 0) scale(1.08); }
}
@keyframes mesh-b {
  from { transform: translate3d(3%, 1%, 0) scale(1.05); }
  to { transform: translate3d(-3%, -2%, 0) scale(1); }
}
@keyframes shake {
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
@keyframes pulse {
  50% { transform: translateY(-2px); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .logo-btn { display: inline-block; }
  .brand { display: none; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; }
  .tracks { flex-wrap: wrap; }
  .tool, .stars, .logo-btn { flex: none; }
  #sidebar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 4.5rem;
  }
  .grade { display: flex; flex-direction: row; align-items: center; }
  .grade h2, .blurb { display: none; }
  .unit { width: auto; min-width: 9.2rem; margin: 0.35rem 0.15rem; }
  .unit small { display: none; }
  .cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  h1 { font-size: 1.55rem; }
}
