/* Quicksand (SIL OFL) — see fonts/OFL.txt. Latin variable font, weight axis 300–700. */
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/quicksand-latin.woff2") format("woff2");
}

:root {
  --safe-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --cream: #fff8eb;
  --cream-deep: #fff3df;
  --white: #ffffff;
  --ink: #2e2118;
  --ink-soft: #6f6258;
  --muted: #8a7b70;
  --coral: #ff5a39;
  --teal: #0eaea3;
  --teal-deep: #0c9c92;
  --yellow: #fdcb45;
  --pink: #fed6d6;
  --sky: #b8e6fe;
  --sky-card: #b7e4fd;
  --mint: #caf2d7;
  --line: #e7d4c0;
  --shadow: 0 12px 34px rgba(46, 33, 24, 0.06);
  --radius: 28px;
  --content: 1200px;
  --font: "Quicksand", "Avenir Next Rounded", "Trebuchet MS", sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.update-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  padding: 8px 16px;
  background: var(--cream-deep);
  color: var(--ink);
}

.update-banner button {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.update-banner button:focus-visible {
  outline: 3px solid var(--teal-deep);
  outline-offset: 2px;
}

html {
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

::selection {
  background: var(--yellow);
  color: var(--ink);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 5;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

.shell {
  width: min(var(--content), calc(100% - 28px));
  margin: 0 auto;
}

main {
  flex: 1;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.art-save-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.gallery-view {
  padding: 24px 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}

.gallery-card {
  min-width: 0;
  padding: 16px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.gallery-card h3 {
  overflow-wrap: anywhere;
}

.gallery-card img,
.gallery-comparison img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.gallery-card label {
  display: block;
  margin: 10px 0;
}

.gallery-card .btn {
  margin: 4px 4px 0 0;
}

.gallery-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.gallery-comparison figure {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Header */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 12px) 0 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex: 1;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
  flex: none;
}

.logo-sm {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.brand-name {
  display: block;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
}

.brand-tag {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.pill-nav {
  order: 3;
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 999px;
  padding: 5px;
  box-shadow: var(--shadow);
}

.nav-link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
}

.nav-link.is-active {
  background: var(--ink);
  color: white;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: var(--yellow);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 6px 2px 7px;
  font-size: 12px;
  line-height: 1.15;
}

.nav-badge span[aria-hidden="true"] {
  font-size: 9px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.avatars {
  display: none;
}

.avatar {
  width: 36px;
  height: 36px;
  margin-left: -8px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.avatar:first-child {
  margin-left: 0;
}

.avatar-m { background: #cfeaf6; }
.avatar-z { background: #f8d4de; }
.avatar-more { background: #d7f5e2; font-size: 12px; }

.save-button {
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--teal);
  color: white;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(14, 174, 163, 0.22);
}

.save-button:active,
.btn:active,
.tool:active,
.letter-key:active,
.tile:active {
  transform: translateY(1px);
}

/* Home */

.daily-practice-card,
.daily-practice-banner {
  margin-top: 14px;
  padding: 18px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.daily-practice-card h2 { margin: 0; font-size: 20px; }
.daily-practice-card p { margin: 8px 0; }
.daily-practice-card label { font-weight: 700; }
.daily-practice-card select { margin: 6px; padding: 8px; font: inherit; }
.daily-practice-card ol { margin: 10px 0; padding-left: 24px; }
.daily-practice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.daily-practice-actions[hidden] { display: none; }
.daily-practice-banner a { margin-left: 10px; font-weight: 700; }

.hero {
  display: grid;
  gap: 22px;
  margin-top: 14px;
  background: var(--white);
  border-radius: 32px;
  padding: 22px 18px 20px;
  box-shadow: var(--shadow);
}

.resume-section {
  margin-top: 14px;
}

.resume-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.resume-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--mint);
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
}

.resume-copy {
  flex: 1;
  min-width: 0;
}

.resume-copy h2 {
  margin: 0;
  font-size: 18px;
}

.resume-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.free-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  background: #e7f8ee;
  color: #1d8a72;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.free-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #14b89a;
}

.hero h1,
.practice-title h1 {
  margin: 12px 0 10px;
  font-size: clamp(40px, 11vw, 64px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.hero-lead {
  margin: 0;
  max-width: 420px;
  color: #8d7d72;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border: none;
  border-radius: 16px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}

.btn-coral {
  background: var(--coral);
  color: white;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(255, 90, 57, 0.25);
}

.btn-cream {
  background: #fff4e4;
  border-radius: 999px;
}

.btn-teal {
  background: var(--teal);
  color: white;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(14, 174, 163, 0.2);
}

.btn-soft {
  background: #f6efe3;
}

.btn-white {
  background: var(--white);
  border: 1.5px solid #efe4d6;
}

.btn-light {
  background: var(--cream);
  color: var(--ink);
  border-radius: 999px;
  min-height: 44px;
}

.btn-keep {
  margin-left: auto;
  background: white;
  color: var(--ink);
  border-radius: 16px;
  min-height: 52px;
  flex: none;
}

.loved {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.loved-stars {
  display: inline-flex;
  gap: 2px;
  color: #e2b63a;
}

.loved-stars svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 420px) {
  .resume-card {
    flex-wrap: wrap;
  }

  .resume-card .btn {
    width: 100%;
  }
}

.preview {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 16px;
  border-radius: 26px;
  background: var(--sky-card);
  overflow: hidden;
}

.float-chip {
  position: absolute;
  z-index: 1;
  padding: 8px 12px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  box-shadow: 0 8px 16px rgba(46, 33, 24, 0.06);
}

.float-aa {
  top: 16px;
  left: 16px;
  background: white;
  transform: rotate(-8deg);
}

.float-bb {
  top: 16px;
  right: 16px;
  background: var(--yellow);
  transform: rotate(8deg);
}

.preview-letters {
  margin: 36px 0 0;
  text-align: center;
  color: white;
  font-size: clamp(108px, 18vw, 156px);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.04em;
}

.preview-dots {
  width: 88%;
  height: 52px;
  margin: 4px auto 8px;
}

.you-can {
  position: absolute;
  right: 22px;
  top: 58%;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 7px 12px;
}

.you-can::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -5px;
  border-width: 6px 6px 0 0;
  border-style: solid;
  border-color: var(--ink) transparent transparent transparent;
}

.preview-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  background: white;
  border-radius: 18px;
  padding: 10px 12px;
}

.mini-pencil,
.mini-score {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 700;
}

.mini-pencil {
  background: var(--coral);
  color: white;
}

.mini-score {
  gap: 2px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 14px;
}

.preview-status-copy {
  flex: 1;
  min-width: 0;
}

.preview-status-copy strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.mini-bar {
  display: block;
  height: 8px;
  background: #f6e7d4;
  border-radius: 999px;
  overflow: hidden;
}

.mini-bar span {
  display: block;
  width: 68%;
  height: 100%;
  background: #1aae8a;
}

.features {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.feature,
.picker-card,
.trace-card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.feature {
  padding: 20px 18px 18px;
}

.icon-bubble {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.icon-bubble.sky { background: #d7f1ff; }
.icon-bubble.yellow { background: var(--yellow); }
.icon-bubble.mint { background: #d9f6e4; }

.feature h2,
.parents h2,
.picker-head h2 {
  margin: 14px 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.parents {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 18px;
  padding: 20px 18px;
  border-radius: 28px;
  background: var(--ink);
  color: white;
  scroll-margin: 24px;
}

.parents.is-highlight {
  box-shadow: 0 0 0 4px rgba(253, 203, 69, 0.75);
}

.heart-badge {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--yellow);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}

.parents h2 {
  margin: 0;
  font-size: 20px;
}

.parents p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14.5px;
  line-height: 1.45;
}

.parents-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.parent-summary {
  margin-top: 12px;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: white;
  color: var(--ink);
}

.parent-summary summary {
  cursor: pointer;
  font-weight: 700;
}

.parent-summary-content {
  overflow-wrap: anywhere;
}

.parent-summary-content h3 {
  margin: 16px 0 4px;
  font-size: 16px;
}

.parent-summary-content p,
.parent-summary-content ul {
  margin: 4px 0;
  line-height: 1.5;
}

.parent-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.pill-cream {
  background: var(--cream);
  color: var(--ink);
}

.pill-teal {
  background: var(--teal);
  color: white;
}

.chart-section {
  margin: 28px 0 8px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.text-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  white-space: nowrap;
}

.tile-row,
.full-chart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.full-chart {
  margin-top: 14px;
}

.tile {
  min-height: 64px;
  border: none;
  border-radius: 18px;
  color: var(--ink);
  font-weight: 700;
  font-size: 26px;
  cursor: pointer;
}

.tile.pink { background: var(--pink); }
.tile.sky { background: var(--sky); }
.tile.mint { background: var(--mint); }

.tile-more {
  background: var(--ink);
  color: white;
  font-size: 14px;
  line-height: 1.15;
}

.tile.is-current {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.tile.has-stars {
  box-shadow: inset 0 -8px 0 rgba(46, 33, 24, 0.08);
}

/* Practice */

.practice-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin: 16px 0 14px;
}

.practice-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.practice-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 36px);
}

.trace-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.back-button {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: white;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(46, 33, 24, 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.stars-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border-radius: 999px;
  padding: 8px 14px 8px 12px;
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 14px;
}

.stars-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.stars-label span[aria-hidden="true"] {
  color: #e2b63a;
}

.stars-track {
  flex: 1;
  min-width: 72px;
  height: 8px;
  background: #f3e6d0;
  border-radius: 999px;
  overflow: hidden;
}

.stars-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--yellow);
}

.practice-layout {
  display: grid;
  gap: 16px;
}

.trace-card {
  padding: 14px;
}

.trace-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.trace-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.case-pill {
  margin: 0;
  background: var(--ink);
  color: white;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 700;
}

.hear-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  border: none;
  background: transparent;
  color: #7c6e64;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.tool-group {
  display: flex;
  gap: 8px;
}

.tool {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid #efe6da;
  background: white;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.tool.is-on {
  background: var(--yellow);
  border-color: transparent;
}

.tool-minus {
  background: #f6efe4;
}

.tool-undo {
  background: var(--teal);
  border-color: transparent;
  color: white;
}

.tool:disabled {
  opacity: 0.45;
  cursor: default;
}

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1.02;
  min-height: 260px;
  border: 2px dashed var(--line);
  border-radius: 22px;
  background: #fff8ee;
  overflow: hidden;
  user-select: none;
}

.paper {
  position: absolute;
  inset: 22% 7% 18%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.paper span {
  border-top: 2px solid rgba(46, 33, 24, 0.08);
}

.paper span.dashed {
  border-top-style: dashed;
}

.guide {
  margin: 0;
  transform: translateY(-6%);
  color: rgba(88, 76, 66, 0.30);
  font-size: clamp(156px, 42vw, 240px);
  font-weight: 700;
  line-height: 0.85;
  user-select: none;
  pointer-events: none;
}

body[data-view="practice"] #guide,
body:not([data-view="practice"]) .stroke-guide-canvas {
  display: none;
}

.stroke-guide-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.character-reference {
  width: 25px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stroke-demo-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.stroke-demo-button {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1.5px solid #d5ece8;
  border-radius: 999px;
  background: #eaf8f5;
  color: #175f5a;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.stroke-demo-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.stroke-demo-canvas {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
  transition: opacity 900ms ease;
}

.stroke-demo-canvas.is-fading {
  opacity: 0.16;
}

.trace-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.trace-canvas {
  z-index: 4;
  display: block;
  background: transparent;
  touch-action: none;
  cursor: crosshair;
}

.celebration-sound {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
}

.star-bloom {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
}

.bloom-particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 13px;
  height: 13px;
  background: var(--color);
  animation: star-bloom 1.4s ease-out var(--delay) both;
}

.bloom-particle.is-star {
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 94%, 50% 72%, 21% 94%, 32% 57%, 2% 35%, 39% 35%);
}

.bloom-particle.is-confetti {
  width: 6px;
  height: 11px;
  border-radius: 2px;
}

.completed-card > .star-bloom {
  bottom: auto;
  height: 280px;
}

.completed-card > .star-bloom .bloom-particle {
  width: 18px;
  height: 18px;
}

.completed-card > .star-bloom .bloom-particle.is-confetti {
  width: 8px;
  height: 15px;
}

.star-bloom.is-static .bloom-particle {
  animation: none;
}

.bloom-glow {
  animation: bloom-glow 1.5s ease-out;
}

.stage.bloom-preview {
  width: min(100%, 360px);
  min-height: 0;
  margin: 16px auto;
  pointer-events: none;
}

@keyframes star-bloom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  25% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(-50%, 12px) scale(1); }
}

@keyframes bloom-glow {
  35% { filter: drop-shadow(0 0 9px #f9df8b); }
  100% { filter: none; }
}

.follow-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 20px);
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  pointer-events: none;
}

.trace-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.trace-actions .btn {
  width: 100%;
  padding: 0 10px;
  font-size: 15px;
}

.picker-card {
  padding: 16px;
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.picker-head h2 {
  margin: 0;
  font-size: 22px;
}

.done-pill {
  margin: 0;
  background: #e5f8ee;
  color: #1c8f78;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.picker-meter {
  height: 8px;
  margin: 12px 0;
  background: #f6ebd8;
  border-radius: 999px;
  overflow: hidden;
}

#meter-done {
  display: block;
  height: 100%;
  width: 0;
  background: var(--teal);
}

#meter-done.has-cap {
  box-shadow: 8px 0 0 var(--yellow);
}

.picker-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #f8f1e4;
}

.picker-tabs button {
  min-height: 40px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
}

.picker-tabs button.is-active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(46, 33, 24, 0.06);
}

.letter-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  max-height: 230px;
  overflow: auto;
  padding: 2px 2px 8px;
}

.letter-key {
  position: relative;
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: #fff8ee;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  box-shadow: inset 0 0 0 1.5px #f3e6d4;
  cursor: pointer;
}

.letter-key.is-current {
  background: var(--ink);
  color: white;
  box-shadow: none;
}

.letter-key.is-star3 { background: #dff6e6; box-shadow: none; }
.letter-key.is-star2 { background: #d7f0ff; box-shadow: none; }
.letter-key.is-star1 { background: #ffe4e4; box-shadow: none; }

.key-stars {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  padding: 1px 3px 0;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
  pointer-events: none;
}

.letter-key.is-current .key-stars {
  background: var(--yellow);
  color: var(--ink);
}

.super-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  background: #fff6df;
}

.trophy {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--yellow);
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}

.super-card p {
  margin: 0;
}

.super-card strong {
  display: block;
  font-size: 15px;
}

.super-card span {
  color: var(--muted);
  font-size: 13.5px;
}

.success-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 26px;
  background: #12b3a6;
  color: white;
}

.success-orb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: white;
  display: grid;
  place-items: center;
  flex: none;
}

.success-copy {
  min-width: 0;
}

.success-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.12;
}

.success-title span {
  display: block;
}

.success-detail {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.tip-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: white;
  color: var(--ink-soft);
  font-size: 14.5px;
  box-shadow: var(--shadow);
}

.info-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-soft);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

/* Write My Name */

.name-view {
  margin-top: 12px;
}

.name-entry {
  max-width: 760px;
  margin: 0 auto;
}

.name-back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--ink-soft);
  font-weight: 700;
  text-decoration: none;
}

.name-entry-card,
.completed-card,
.name-progress-card {
  background: white;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.name-entry-card {
  padding: clamp(20px, 5vw, 42px);
}

.name-entry-card h1,
.completed-card h1 {
  margin: 16px 0 6px;
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.name-subtitle,
.completed-message {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.name-input-wrap {
  margin-top: 26px;
}

.name-input-wrap label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
}

.name-input-row {
  display: flex;
  gap: 8px;
}

.name-input-row input {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.name-input-row input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(14, 174, 163, 0.18);
  outline-offset: 1px;
}

.name-input-row input[aria-invalid="true"] {
  border-color: var(--coral);
}

.name-clear {
  width: 56px;
  min-height: 56px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.name-helper,
.name-error {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.name-helper {
  color: var(--muted);
}

.name-error {
  min-height: 20px;
  color: #b43e2c;
}

.name-preview-block {
  margin-top: 22px;
  padding: 16px;
  border-radius: 20px;
  background: #fff8ee;
}

.name-preview-heading,
.name-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.name-preview-heading h2,
.name-progress-heading h2 {
  margin: 0;
  font-size: 18px;
}

.name-preview-heading span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.name-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.name-tile {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 50px;
  border-radius: 14px;
  background: var(--mint);
  color: var(--ink);
  font-size: 23px;
  font-weight: 700;
}

.name-preview-tiles:empty::after {
  content: "Your letters will appear here";
  grid-column: 1 / -1;
  padding: 10px 0;
  color: var(--muted);
  font-size: 14px;
}

.name-start {
  width: 100%;
  margin-top: 20px;
}

.name-start:disabled {
  opacity: 0.48;
  box-shadow: none;
  cursor: not-allowed;
}

.name-privacy {
  margin: 12px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.name-tracing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 16px;
}

.name-position {
  margin: 0 0 3px;
  color: var(--teal-deep);
  font-size: 14px;
  font-weight: 700;
}

.name-tracing-head h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.name-overall-progress {
  display: grid;
  gap: 6px;
  width: min(250px, 42%);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.name-progress-track {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f3e6d0;
}

.name-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 180ms ease;
}

.name-progress-card {
  padding: 16px;
}

.name-progress-heading {
  flex-wrap: wrap;
}

.name-progress-heading h2 {
  font-size: 20px;
}

.name-progress-card .picker-meter {
  margin: 0 0 14px;
}

#name-panel-meter {
  display: block;
  width: 0;
  height: 100%;
  background: var(--teal);
}

.name-progress-tiles .name-tile {
  width: 100%;
  min-height: 48px;
  border: 2px solid transparent;
  background: #fff8ee;
  box-shadow: inset 0 0 0 1px #f0dfc9;
  cursor: pointer;
}

.name-progress-tiles .name-tile.is-current {
  border-color: var(--ink);
  box-shadow: none;
}

.name-progress-tiles .name-tile.is-complete,
.completed-tiles .name-tile {
  background: #d9f6e4;
  box-shadow: none;
}

.name-tile-status {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 11px;
  line-height: 1;
}

.name-encouragement {
  margin: 14px 0 8px;
  color: var(--ink-soft);
  font-size: 14px;
}

.name-change {
  min-height: 40px;
}

.name-tracing .practice-head,
.name-tracing .trace-toolbar,
.name-tracing .tip-bar,
.name-tracing .picker-card,
.name-tracing #success-card {
  display: none !important;
}

.name-tracing .name-tracing-head,
.name-tracing .name-progress-card {
  display: block;
}

.name-tracing .name-tracing-head {
  display: flex;
}

.name-tracing .practice-layout {
  align-items: start;
}

.name-tracing .trace-card {
  padding: 12px;
}

.name-tracing .stage {
  aspect-ratio: 16 / 10;
  min-height: 300px;
}

.name-tracing .guide {
  font-size: clamp(180px, 28vw, 260px);
}

.name-tracing .trace-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.name-tracing .trace-actions .btn {
  min-height: 50px;
  font-size: 14px;
}

.name-tracing #prev-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.name-completed {
  max-width: 780px;
  margin: 24px auto 10px;
}

.completed-card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 6vw, 52px);
  text-align: center;
}

.completed-badge {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--mint);
  color: var(--teal-deep);
  font-size: 38px;
  font-weight: 700;
}

.completed-full-name {
  margin: 18px 0;
  color: var(--coral);
  font-size: clamp(36px, 9vw, 68px);
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.completed-tiles {
  max-width: 600px;
  margin: 0 auto;
}

.completed-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.celebration-stars {
  position: absolute;
  inset: 12px 16px auto;
  display: flex;
  justify-content: space-between;
  color: var(--yellow);
  font-size: 24px;
  pointer-events: none;
}

.celebration-stars span:nth-child(2),
.celebration-stars span:nth-child(4) {
  animation: name-sparkle 1.8s ease-in-out infinite alternate;
}

@keyframes name-sparkle {
  from { opacity: 0.55; transform: scale(0.9) rotate(-8deg); }
  to { opacity: 1; transform: scale(1.12) rotate(8deg); }
}

/* Footer */

.site-footer {
  width: 100%;
  margin-top: 28px;
  padding: 26px 0 28px;
  border-radius: 32px 32px 0 0;
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.footer-brand,
.footer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 14px;
}

.footer-meta {
  color: rgba(255, 255, 255, 0.72);
  flex-wrap: wrap;
}

.footer-host {
  color: rgba(255, 255, 255, 0.55);
}

/* Wider layouts */

@media (min-width: 720px) {
  .shell {
    width: min(var(--content), calc(100% - 48px));
  }

  .avatars {
    display: flex;
  }

  .tile-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .full-chart {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .trace-actions {
    grid-template-columns: 1fr 1fr 1.35fr 1.05fr;
  }

  .follow-tip {
    align-items: center;
    border-radius: 999px;
    white-space: nowrap;
  }

  .success-card {
    flex-wrap: nowrap;
  }
}

@media (max-width: 979px) {
  .name-tracing .practice-layout {
    display: flex;
    flex-direction: column;
  }

  .name-tracing .practice-side {
    order: 0;
    width: 100%;
  }

  .name-tracing .trace-card {
    order: 1;
    width: 100%;
  }
}

@media (max-width: 719px) {
  .pill-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .name-tracing .trace-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 800px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 22px;
  }

  .stage {
    aspect-ratio: 16 / 10.4;
    min-height: 320px;
  }

  .guide {
    font-size: clamp(160px, 16vw, 210px);
  }
}

@media (min-width: 980px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    padding-top: calc(var(--safe-top) + 22px);
  }

  .brand {
    flex: unset;
  }

  .pill-nav {
    order: 0;
    width: auto;
    justify-self: center;
  }

  .nav-link {
    flex: unset;
    padding: 0 16px;
    font-size: 15px;
  }

  .top-actions {
    justify-self: end;
    margin-left: 0;
  }

  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 28px;
    padding: 36px 28px 32px 40px;
  }

  .hero h1 {
    margin-top: 16px;
  }

  .preview {
    min-height: 360px;
  }

  .parents {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding: 22px 22px 22px 22px;
  }

  .parents-copy {
    max-width: 640px;
  }

  .parents-pills {
    margin-left: auto;
    flex: none;
  }

  .tile-row {
    grid-template-columns: repeat(11, minmax(0, 1fr));
  }

  .practice-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .stars-pill .stars-track {
    width: 92px;
    flex: none;
  }

  .practice-layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.9fr);
    gap: 18px;
    align-items: start;
  }

  .name-tracing .practice-layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
  }

  .name-tracing .name-progress-card {
    padding: 18px;
  }

  .letter-grid {
    max-height: 112px;
  }

  .footer-meta {
    margin-left: auto;
  }

  .site-footer {
    border-radius: 40px 40px 0 0;
  }
}

@media (max-width: 420px) {
  .success-card {
    flex-wrap: wrap;
  }

  .btn-keep {
    width: 100%;
    margin-left: 0;
  }

  .nav-link {
    padding: 0 8px;
    font-size: 13.5px;
  }

  .pill-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .name-tracing-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 10px;
  }

  .name-overall-progress {
    width: 100%;
  }

  .name-tracing .practice-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .name-tracing .practice-side {
    order: 0;
    width: 100%;
  }

  .name-tracing .trace-card {
    order: 1;
    width: 100%;
  }

  .name-tracing .name-progress-card {
    padding: 12px;
  }

  .name-tracing .name-progress-heading {
    margin-bottom: 8px;
  }

  .name-tracing .stage {
    aspect-ratio: 4 / 3;
    min-height: 225px;
  }

  .name-tracing .guide {
    font-size: clamp(150px, 48vw, 210px);
  }

  .name-tracing .trace-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .name-tracing .trace-actions .btn {
    min-height: 46px;
    font-size: 14px;
  }

  .name-tracing .name-position {
    font-size: 13px;
  }

  .completed-actions .btn {
    width: 100%;
  }

  .celebration-stars {
    inset-inline: 8px;
  }
}

@media (max-width: 360px) {
  .name-tracing .stage {
    min-height: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .stroke-demo-canvas {
    transition: none;
  }

  .bloom-particle,
  .bloom-glow {
    animation: none;
  }

  .btn,
  .tile,
  .tool,
  .name-progress-track span,
  .celebration-stars span {
    transition: none;
    animation: none;
  }
}

.accuracy-setting { margin: 16px 0; text-align: left; }
.accuracy-setting label { display: block; font-weight: 700; margin-bottom: 8px; }
.accuracy-slider { width: 100%; }

.accuracy-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 32px;
  border: 0;
  border-radius: 24px;
  color: #263345;
  text-align: center;
  box-shadow: 0 24px 80px rgb(34 51 72 / 24%);
}

.accuracy-dialog::backdrop {
  background: rgb(25 39 57 / 52%);
  backdrop-filter: blur(4px);
}

.accuracy-dialog-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 50%;
  background: #fff1d6;
  color: #b86516;
  font-size: 30px;
  font-weight: 800;
}

.accuracy-dialog-kicker {
  margin: 0 0 6px;
  color: #d76650;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.accuracy-dialog h2 {
  margin: 0;
  font-size: 24px;
}

.accuracy-dialog p:not(.accuracy-dialog-kicker) {
  margin: 12px 0 22px;
  color: #627087;
  line-height: 1.55;
}

.accuracy-dialog .btn {
  width: 100%;
}

.mobile-more,
.mobile-nav,
.mobile-word-tabs,
.mobile-tools-toggle,
.mobile-tool-settings {
  display: none;
}

@media (min-width: 720px) {
  #word-panel-today .wp-rewards {
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    padding-bottom: 0;
  }

  #word-panel-stickers {
    margin-top: 0;
    border-top: 0;
    border-radius: 0 0 18px 18px;
    padding-top: 0;
  }
}

@media (max-width: 719px) {
  body {
    padding-bottom: calc(88px + var(--safe-bottom));
  }

  .skip-link,
  .text-link {
    min-height: 44px;
  }

  .pill-nav,
  .top-actions {
    display: none;
  }

  .mobile-more {
    display: block;
    position: relative;
    z-index: 10;
  }

  .mobile-more summary,
  .mobile-more-panel a,
  .mobile-more-panel button,
  .mobile-tools-toggle,
  .mobile-tool-settings,
  .mobile-word-tabs button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 14px;
    border: 0;
    border-radius: 14px;
    background: #eaf8f5;
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
  }

  .mobile-more summary {
    list-style: none;
  }

  .mobile-more summary::-webkit-details-marker {
    display: none;
  }

  .mobile-more-panel {
    position: absolute;
    right: 0;
    width: min(280px, calc(100vw - 28px));
    padding: 12px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 12px 34px rgba(46, 33, 24, 0.18);
  }

  .mobile-more-panel a,
  .mobile-more-panel button {
    width: 100%;
    margin-bottom: 8px;
  }

  .mobile-more-panel .accuracy-setting {
    margin: 12px 0 0;
  }

  .accuracy-slider {
    min-height: 44px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 9;
    bottom: calc(var(--safe-bottom) + 8px);
    left: 12px;
    right: 12px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(46, 33, 24, 0.12);
    border-radius: 22px;
    background: var(--cream);
    box-shadow: 0 2px 10px rgba(46, 33, 24, 0.1);
  }

  .mobile-nav a {
    display: grid;
    min-width: 0;
    min-height: 48px;
    place-items: center;
    align-content: center;
    border-radius: 18px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.15;
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-nav a span {
    font-size: 17px;
    line-height: 1;
  }

  .mobile-nav a.is-active {
    background: var(--mint);
    color: var(--ink);
  }

  .practice-head {
    margin: 8px 0;
  }

  .practice-title h1 {
    font-size: 24px;
  }

  .trace-subtitle,
  .tip-bar,
  .name-privacy,
  .wp-select-card > .free-badge,
  .wp-select-card > .name-subtitle {
    display: none;
  }

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

  .trace-card {
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  .celebration-sound {
    order: 4;
  }

  .trace-card .stage {
    order: 0;
    aspect-ratio: 4 / 3;
    min-height: 200px;
  }

  .trace-actions {
    order: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .trace-actions #prev-button {
    grid-column: 1 / -1;
    order: 1;
  }

  .trace-actions .btn {
    min-width: 0;
    font-size: 13px;
  }

  .trace-actions .btn svg {
    display: none;
  }

  .mobile-tools-toggle {
    display: flex;
    order: 2;
    margin-top: 8px;
  }

  .mobile-tool-settings {
    display: none;
  }

  .trace-toolbar,
  #character-picker {
    display: none;
  }

  .stroke-demo-controls:not([hidden]) {
    display: flex;
    order: 2;
    margin: 8px 0 0;
  }

  .mobile-tools-open .trace-toolbar {
    display: flex;
    order: 3;
    margin: 10px 0 0;
  }

  .mobile-tools-open .mobile-tool-settings {
    display: flex;
    order: 4;
    margin-top: 10px;
  }

  .mobile-tools-open #character-picker:not([hidden]) {
    display: block;
  }

  .letter-grid {
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  }

  .letter-key,
  .picker-tabs button,
  .name-change {
    min-width: 44px;
    min-height: 44px;
  }

  .name-tracing .mobile-tools-toggle,
  .name-tracing .mobile-tool-settings {
    display: none;
  }

  .name-tracing .practice-side {
    order: 1;
  }

  .name-tracing .trace-card {
    order: 0;
  }

  .name-tracing .trace-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .name-tracing .trace-actions #prev-button {
    grid-column: auto;
    order: 0;
  }

  .name-entry-card > .accuracy-setting,
  .wp-select-card > .accuracy-setting {
    display: none;
  }

  .wp-select-card {
    padding: 18px 14px;
  }

  .wp-select-card h1 {
    margin: 0 0 12px;
    font-size: 28px;
  }

  .mobile-word-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-word-tabs button {
    padding: 8px 4px;
  }

  .mobile-word-tabs button[aria-selected="true"] {
    background: var(--teal);
    color: white;
  }

  [data-mobile-tab="words"] #word-panel-today,
  [data-mobile-tab="words"] #word-panel-stickers,
  [data-mobile-tab="today"] #word-panel-words,
  [data-mobile-tab="today"] #word-panel-stickers,
  [data-mobile-tab="stickers"] #word-panel-words,
  [data-mobile-tab="stickers"] #word-panel-today {
    display: none;
  }
}

body[data-view="name-tracing"] #view-practice {
  max-width: 1100px;
  margin: 0 auto;
}

body[data-view="name-tracing"] #next-button {
  background: #b93c23;
  color: white;
}

.name-tracing .name-tracing-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 250px);
  gap: 10px 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: var(--shadow);
}

.name-tracing .name-overall-progress {
  width: 100%;
  align-self: center;
}

.name-tracing .name-progress-tiles {
  grid-column: 1 / -1;
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 4px;
}

.name-progress-tiles .name-position-item {
  flex: 0 0 52px;
}

.name-progress-tiles .name-tile.is-current {
  border-color: #b93c23;
  background: #ffe0d5;
}

.name-progress-tiles .name-tile.is-complete {
  color: #155d51;
  background: #c9efdf;
}

.name-tracing .stage {
  background: #e7f6ff;
  border-color: #a7d6e8;
}

.name-tracing .follow-tip {
  position: static;
  width: auto;
  max-width: none;
  height: auto;
  transform: none;
  margin: 10px 0 0;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  clip: auto;
  overflow: visible;
  white-space: normal;
}

.name-hear {
  align-self: flex-start;
  margin: 0 0 10px;
}

@media (max-width: 719px) {
  .name-tracing .name-tracing-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .name-tracing .name-progress-tiles {
    grid-column: 1;
  }

  .name-tracing .trace-card .name-hear {
    order: 0;
  }

  .name-tracing .trace-card .stage {
    order: 1;
  }

  .name-tracing .follow-tip {
    order: 2;
  }

  .name-tracing .trace-actions {
    order: 3;
  }

  body[data-view="name-tracing"] #next-button {
    grid-column: 1 / -1;
  }

  .name-tracing .celebration-sound {
    order: 4;
  }
}
