.home-top {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.72fr);
  gap: 0.85rem;
  align-items: stretch;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: 0.75rem 1.1rem;
  position: relative;
  overflow: hidden;
  padding: 1.25rem 1.25rem 1.05rem;
  background:
    radial-gradient(90% 80% at 100% 100%, var(--wave), transparent 62%),
    var(--surface);
}

.hero h1 { max-width: none; margin: 0.1rem 0 0.45rem; }
.hero h1.is-fit {
  font-size: clamp(1.6rem, 2.2vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 11em;
}
.hero h1.is-title {
  font-family: var(--font);
  font-size: clamp(1.7rem, 2.4vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  max-width: 14em;
}
.hero-note { margin: -0.35rem 0 0.85rem; color: var(--muted); font-size: var(--meta); }
.hero .lead { margin-bottom: 0.85rem; }
.hero-copy { position: relative; z-index: 1; min-width: 0; }
.hero-art,
.hero-mascot {
  position: static;
  align-self: center;
  margin: 0;
  pointer-events: none;
}
.hero-art { padding: 0 0.15rem 0.15rem 0; }
.keycap {
  width: 96px;
  height: 96px;
  margin: 0;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, #f7fbff, #d5e4fb);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 2.7rem;
  font-weight: 800;
  box-shadow: 0 12px 0 #b9d0f3, 0 16px 22px rgba(7, 89, 200, 0.14);
  transform: rotate(8deg);
}
html[data-theme="dark"] .keycap {
  background: linear-gradient(180deg, #314864, #1d314c);
  box-shadow: 0 12px 0 #15263d, 0 16px 22px rgba(0, 0, 0, 0.28);
}
.hero-mascot { width: 168px; }
.hero-mascot .mascot { width: 100%; height: auto; aspect-ratio: 1; }
.mascot-greet { position: relative; }
.mascot-greet .mascot-still {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.mascot-greet.is-still .mascot-video { display: none; }
.mascot-greet.is-still .mascot-still { position: static; opacity: 1; }
.mascot-video { pointer-events: none; }
.result .mascot { width: 140px; height: 140px; }

.widgets {
  display: grid;
  gap: 0.85rem;
  grid-auto-rows: 1fr;
}
.widget {
  padding: 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}
.widget-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}
.widget .stat-value { font-size: 1.6rem; line-height: 1.1; white-space: nowrap; }
html[data-mode="child"] .widget .stat-value { font-size: 1.6rem; }
.widget .progress-bar { margin-top: 0.35rem; }
.widget-note { font-size: var(--meta); }
.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.2rem;
}
.week span {
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  color: var(--muted);
}
.week .is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.week .is-today { box-shadow: inset 0 0 0 2px var(--text); }

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin: 0.85rem 0 1.35rem;
}
.feature {
  text-align: left;
  padding: 0.95rem 1rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.3rem;
  border: 0;
  font-weight: 700;
}
.feature svg { width: 1.4rem; height: 1.4rem; }
.feature small { font-weight: 500; color: var(--muted); }
.feature.lessons { background: var(--lessons); }
.feature.speed { background: var(--speed); }
.feature.weak { background: var(--weak); }
.feature.game { background: var(--games); }

.course-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.timeline { display: grid; gap: 1.15rem; }
.tl-list {
  --rail: 0.42rem;
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0 0 0 1.25rem;
  position: relative;
}
.tl-list::before {
  content: "";
  position: absolute;
  left: var(--rail);
  top: 1.35rem;
  bottom: 1.35rem;
  width: 2px;
  transform: translateX(-1px);
  background: var(--border);
}
.tl-item { position: relative; margin: 0 0 0.6rem; }
.tl-item:last-child { margin-bottom: 0; }
.tl-node {
  position: absolute;
  left: calc(var(--rail) - 1.25rem);
  top: 50%;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--border);
  transform: translate(-50%, -50%);
  z-index: 1;
}
.tl-item.is-done .tl-node { background: var(--success); border-color: var(--success); }
.tl-item.is-current .tl-node { background: var(--primary); border-color: var(--primary); }
.tl-card {
  width: 100%;
  text-align: left;
  padding: 0.9rem 1rem;
  display: grid;
  gap: 0.25rem;
  color: inherit;
}
.tl-item.is-current .tl-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 0.95rem;
}
.tl-item.is-current .posture {
  width: 156px;
  margin: 0;
  flex: 0 0 auto;
  border-radius: 0.85rem;
}
.tl-body { display: grid; gap: 0.2rem; min-width: 0; }
.tl-item.is-locked .tl-card { color: var(--muted); }
.tl-actions { display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; }
.tl-actions > span { display: inline-flex; align-items: center; gap: 0.45rem; }
.tl-card svg { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.tl-card .stars svg { width: 0.95rem; height: 0.95rem; }
.tl-item.is-done .tl-actions svg:first-child { color: var(--success); }
.tl-card > span:last-child:not(.tl-actions):not(.muted):not(.tl-body),
.tl-body > .tl-actions span { color: var(--primary); font-weight: 700; font-size: var(--meta); }
.posture {
  width: min(100%, 440px);
  height: auto;
  display: block;
  margin: 0 auto 0.8rem;
}

.setup-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.setup-main .choice-row,
.setup-main .btn-row { margin: 0; }
.setup-card { text-align: center; display: grid; justify-items: center; gap: 0.6rem; }
.setup-card .btn-row { margin: 0; justify-content: center; }
.setup-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  width: 100%;
}
.setup-fallback .choice-row { margin: 0; }
.speed-setup {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem 1.6rem;
  padding: 1.1rem 1.4rem;
  width: fit-content;
  max-width: 100%;
}
.speed-setup .timer-ring { align-self: center; }
.speed-field { display: grid; gap: 0.35rem; }
.card.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: var(--practice-w);
  margin-inline: 0;
  padding: 2rem 1.5rem 1.6rem;
}
.card.empty h2 { margin: 0.2rem 0 0.35rem; }
.card.empty .lead {
  max-width: none;
  margin-inline: 0;
  text-wrap: balance;
}
.card.empty .btn-row {
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0;
}
.speed-setup .seg button:disabled { opacity: 0.4; }
.speed-task {
  margin: 1rem 0 0.35rem;
  font-weight: 700;
}
.family-lead {
  max-width: none;
  text-align: left;
  white-space: nowrap;
}
@media (max-width: 980px) {
  .family-lead { white-space: normal; }
}
.turn-label {
  margin: 1rem 0 0.45rem;
  font-size: var(--meta);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  text-align: left;
}
.progress-split {
  display: grid;
  grid-template-columns: minmax(220px, 280px) repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin: 1.2rem 0;
}
.progress-split .block {
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.progress-split .chart { height: auto; aspect-ratio: 360 / 128; margin-top: auto; }
.progress-split .calendar-wrap { max-width: none; }
.block > .page-head { max-width: var(--practice-w); margin-bottom: 0.6rem; }
.block > .page-head + * { margin-top: 0; }
.result { max-width: var(--practice-w); }
.result.has-mascot { display: flex; gap: 1.4rem; align-items: flex-start; }
.result.has-mascot > :first-child { flex: 0 0 auto; }
.result.has-mascot .mascot { width: 140px; height: 140px; }
.result-body { flex: 1; min-width: 0; }
.result-body .stars { display: flex; margin-bottom: 0.2rem; }
.result-body .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-body .problem-keys { margin-top: 0.2rem; }
.result-body .btn-row { margin-bottom: 0; }
.page-head { align-items: flex-start; justify-content: space-between; margin-bottom: 0.2rem; }
.page-head .lead { margin-bottom: 0; }
.weak-head > div:first-child { flex: 1 1 32rem; max-width: 54rem; min-width: min(100%, 28rem); }
.weak-head .lead { max-width: none; }
.page-head + * { margin-top: 0.8rem; }
#practice-root:not(:empty) { margin-top: 1rem; }
.legend { margin-top: 0.3rem; }
.setup-lead { max-width: none; }
.setup-lead span { display: block; white-space: nowrap; }
@media (max-width: 640px) {
  .setup-lead span { white-space: normal; }
}
.setup-yo { font-size: clamp(4rem, 12vw, 7rem); line-height: 1; margin: 0.2rem 0; font-weight: 800; }
.setup-layout { display: flex; gap: 1.15rem; align-items: flex-start; }

.chip-row, .problem-keys { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.key-chip {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.2rem 0.5rem;
  background: var(--muted-bg);
  font-family: var(--mono);
}
.key-cards { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.8rem 0; }
.key-cards article {
  min-width: 8.5rem;
  padding: 0.7rem 0.95rem;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.75rem;
  align-items: center;
}
.key-cards article strong {
  grid-row: span 2;
  font-family: var(--mono);
  font-size: 1.6rem;
  line-height: 1;
}
.key-cards article p { font-size: var(--meta); line-height: 1.35; }

.calendar-wrap { display: flex; flex-direction: column; gap: 0.45rem; }
.calendar-nav {
  display: grid;
  grid-template-columns: 2rem 1fr 2rem;
  align-items: center;
  gap: 0.35rem;
}
.calendar-range { margin: 0; font-weight: 800; text-align: center; }
.calendar-step {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}
.calendar-step:disabled { opacity: 0.35; }
.calendar-weekdays,
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; }
.calendar-weekdays span {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
}
.day {
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--muted);
}
.day-num { font-size: 0.72rem; font-weight: 800; line-height: 1; }
.day.is-empty { border-color: transparent; }
.day.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.day.is-today { box-shadow: inset 0 0 0 2px var(--text); }
.day.is-future { opacity: 0.38; }
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: var(--meta);
}
.calendar-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  box-sizing: border-box;
}
.swatch.is-on { background: var(--primary); border-color: var(--primary); }
.swatch.is-today { box-shadow: inset 0 0 0 2px var(--text); }
.chart { width: 100%; height: 8rem; }
.chart polyline { fill: none; stroke: var(--primary); stroke-width: 2; }
.chart circle { fill: var(--primary); }
.chart line, .chart text { stroke: var(--border); fill: var(--muted); font-size: 11px; }

.album {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem 1.2rem;
  margin-bottom: 1.5rem;
}
.album > .page-head { max-width: none; }
.album-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.75rem;
}
.album-meta .progress-bar { flex: 1; min-width: 0; }
.album-next { margin: 0.7rem 0 0; }
.album-open {
  border: 0;
  background: none;
  padding: 0;
  color: var(--primary);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.album-page { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--border); }
.album-page header { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.album-page h4 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.album-count { color: var(--muted); font-size: var(--meta); font-weight: 700; }
.album-seal {
  margin-left: auto;
  border: 1.5px dashed var(--success);
  color: var(--success);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: var(--meta);
  font-weight: 800;
  transform: rotate(-2deg);
}
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.sticker {
  position: relative;
  width: 100%;
  max-width: 6.75rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
button.sticker { cursor: pointer; }
.sticker-face {
  position: relative;
  width: 86%;
  height: 86%;
  border-radius: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.75), transparent 46%),
    linear-gradient(145deg, var(--a, var(--mod-start)), var(--b, var(--mod-home)));
  color: var(--sticker-ink);
  border: 3px solid var(--sticker-edge);
  box-shadow: 0 5px 0 rgba(20, 35, 75, 0.06), 0 8px 16px rgba(20, 35, 75, 0.1);
  transform: rotate(var(--tilt, 0deg));
}
.sticker-mark,
.sticker-lines {
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-align: center;
}
.sticker-lines { display: flex; flex-direction: column; align-items: center; }
.sticker-mark[data-len="1"] { font-size: 2rem; }
.sticker-mark[data-len="2"] { font-size: 1.85rem; }
.sticker-mark[data-len="3"] { font-size: 1.35rem; }
.sticker-mark[data-len="4"] { font-size: 1.15rem; }
.sticker-mark[data-len="5"] { font-size: 0.95rem; }
.sticker-mark[data-len="6"],
.sticker-mark[data-len="7"],
.sticker-mark[data-len="8"] { font-size: 0.78rem; }
.sticker-lines[data-len="3"] { font-size: 1.05rem; }
.sticker-lines[data-len="4"] { font-size: 0.92rem; }
.sticker-lines[data-len="5"],
.sticker-lines[data-len="6"] { font-size: 0.72rem; }
.sticker-mark:has(+ .sticker-beats) { line-height: 1; }
.sticker-beats { display: flex; gap: 0.28rem; margin-top: 0.7rem; }
.sticker-beats i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: currentColor;
}
.sticker.is-shiny .sticker-face {
  border-color: var(--sticker-gold);
  box-shadow: 0 0 0 2px var(--sticker-gold), 0 8px 16px rgba(224, 180, 58, 0.35);
}
.sticker.is-shiny .sticker-face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 42%, transparent 62%, rgba(255, 255, 255, 0.28));
  pointer-events: none;
}
.sticker.is-locked:not(.is-next) .sticker-face {
  background: transparent;
  color: var(--muted);
  border: 2px dashed var(--border);
  box-shadow: none;
  transform: none;
}
.sticker.is-next .sticker-face {
  border: 2px dashed var(--primary);
  box-shadow: none;
}
.sticker-tag {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 999px;
  padding: 0.05rem 0.38rem;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.3;
}
.sticker-lg { width: 6.5rem; max-width: none; }
.sticker-lg .sticker-mark[data-len="1"] { font-size: 2.6rem; }
.sticker-lg .sticker-mark[data-len="2"] { font-size: 2.35rem; }
.sticker-lg .sticker-mark[data-len="3"] { font-size: 1.7rem; }
.sticker-lg .sticker-mark[data-len="4"] { font-size: 1.45rem; }
.sticker-lg .sticker-lines[data-len="3"] { font-size: 1.35rem; }
.sticker-lg .sticker-lines[data-len="4"] { font-size: 1.15rem; }
.sticker-award {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.7rem 0 0.85rem;
}
.sticker-award p { margin: 0; font-weight: 800; }
.sticker-award .sticker { animation: stick 700ms cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes stick {
  0% { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.block { margin: 1.4rem 0; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; }
.share-card { margin: 0.35rem 0 0.85rem; }
.share-card p { margin: 0 0 0.3rem; font-size: var(--meta); }
.share-line { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.share-line code {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--muted);
}
.copy-link {
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border: 0;
  padding: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.copy-link:hover { color: var(--text); background: var(--muted-bg); }
.copy-link svg { width: 1rem; height: 1rem; }
.stepper { display: flex; gap: 0.5rem; margin-bottom: 0.7rem; }
.stepper span {
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  color: var(--muted);
}
.stepper .is-on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

.game-hud { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.75rem; }
.game-hud > span, .hud-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  line-height: 1.2;
}
.game-stack { display: grid; gap: 0.75rem; }
.game-controls { display: flex; gap: 0.6rem; align-items: center; }
.game-controls .text-input { flex: 1; min-width: 0; }
.game-controls .btn-row { margin: 0; flex-wrap: nowrap; }
.game-scene {
  position: relative;
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 20% 20%, var(--wave), transparent 70%),
    var(--elevated);
  border: 1px solid var(--border);
}
.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: var(--elevated);
  font-size: var(--h3);
  font-weight: 800;
  text-align: center;
  padding: 1rem;
}
.game-overlay p {
  margin: 0;
  max-width: 36rem;
  text-align: center;
  text-wrap: balance;
}
.floating-word {
  position: absolute;
  z-index: 1;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.floating-word.is-match { border-color: var(--primary); color: var(--primary); }
.text-input {
  width: 100%;
  margin-top: 0;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.5rem 1rem;
}
.rhythm { display: block; height: 0.5rem; background: var(--muted-bg); border-radius: 999px; overflow: hidden; min-width: 8rem; flex: 1; }
.mascot-celebrate { animation: pop 700ms ease; }
@keyframes pop { 50% { transform: translateY(-6px) scale(1.04); } }

.stat-value svg { width: 1.2rem; height: 1.2rem; vertical-align: -0.12rem; }
.plain-list { padding-left: 1.1rem; }
.intro-mini { margin-bottom: 0.8rem; }
html[data-mode="child"] .stat-value { font-size: 2rem; }
html[data-mode="child"] .widget .stat-label,
html[data-mode="child"] .stat-label { font-size: 1rem; }

@media (max-width: 1240px) {
  html[data-theme="light"] .topbar .brand-word.theme-light,
  html[data-theme="dark"] .topbar .brand-word.theme-dark { display: none; }
}

@media (max-width: 1080px) {
  .nav button svg { display: none; }
}

@media (max-width: 960px) {
  .topbar { gap: 0.35rem; }
  .nav button { padding-inline: 0.28rem; font-size: 0.92rem; }
  .header-controls { gap: 0.15rem; }
  .header-controls .icon-btn { min-width: 36px; padding-inline: 0.4rem; }
  .profile-switch button { padding-inline: 0.4rem; font-size: 0.92rem; }
}

@media (max-width: 780px) {
  .topbar { flex-wrap: wrap; }
  .nav { order: 3; flex: 1 0 100%; margin-left: 0; margin-right: 0; }
}

@media (max-width: 1024px) {
  .setup-layout, .practice-layout { display: block; }
  .mascot-rail { width: auto; flex-direction: row; align-items: center; margin-top: 0.8rem; }
  .mascot-rail .mascot { width: 96px; height: 96px; }
  .bento { grid-template-columns: 1fr 1fr; }
  .progress-split { grid-template-columns: 1fr 1fr; }
  .progress-split > :first-child { grid-column: 1 / -1; }
  .progress-split .calendar-wrap { max-width: 22rem; }
}

@media (max-width: 860px) {
  .home-top { grid-template-columns: 1fr; }
  .widgets { height: auto; }
}

@media (max-width: 768px) {
  .hero-mascot { width: 140px; }
}

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-mascot, .hero-art { justify-self: end; }
  .tl-item.is-current .tl-card { align-items: flex-start; }
  .progress-split { grid-template-columns: 1fr; }
  .game-controls { flex-wrap: wrap; }
  .result.has-mascot { flex-direction: column; }
}

@media (max-width: 430px) {
  .hero-mascot, .hero-art { display: none; }
  .bento { grid-template-columns: 1fr; }
  .header-controls .profile-switch button { padding-inline: 0.55rem; }
  main, .topbar { width: min(100% - 1rem, var(--max)); }
}

