:root {
  color-scheme: light;
  --ink: #142c52;
  --muted: #405775;
  --blue: #22539a;
  --blue-hover: #17427f;
  --light-blue: #e8f0fa;
  --page-blue: #edf4f8;
  --line: #d5e2ec;
  --paper: #fcf9f0;
  --white: #fff;
  --coral: #eb725f;
  --sans: Nunito, ui-rounded, "Segoe UI", sans-serif;
  --card-font: Quicksand, "Segoe Print", ui-rounded, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page-blue);
  color: var(--ink);
  font: 500 1rem/1.5 var(--sans);
}

h1, h2, p, figure {
  margin: 0;
}

button, input, textarea {
  color: inherit;
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 3px solid #ad4534;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #f9fcfe;
}

.header-inner {
  width: min(1180px, calc(100% - 64px));
  min-height: 74px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.43rem;
  font-weight: 850;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.brand-icon, .lesson-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--blue);
  background: #dce9f8;
}

.brand-icon svg {
  width: 25px;
  height: 25px;
}

.header-inner nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.header-inner nav a {
  padding-block: 10px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
}

.header-inner nav a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 45px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  font-size: .94rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  transition: background-color .15s, border-color .15s;
}

.button-outline {
  border-color: #c8d9e8;
}

.button-outline:hover:not(:disabled), .button-soft:hover {
  border-color: #9eb9d8;
  background: #f0f6fc;
}

.button-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}

.button-primary:hover {
  border-color: var(--blue-hover);
  background: var(--blue-hover);
}

.button-soft {
  background: var(--light-blue);
  color: var(--blue);
}

.button-small {
  min-height: 38px;
  padding: 7px 11px;
  font-size: .87rem;
  white-space: nowrap;
}

.button-small svg {
  width: 16px;
  height: 16px;
}

.button-icon {
  width: 45px;
  padding-inline: 0;
}

.button:disabled {
  color: #8c9aaa;
  background: #f7f9fc;
  border-color: var(--line);
}

.link-button {
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: .9rem;
  font-weight: 750;
  text-underline-offset: 3px;
}

.link-button:hover {
  text-decoration: underline;
}

.page {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
  padding: 38px 0 56px;
}

.intro, .library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 23px;
}

.intro h1 {
  font-size: clamp(2rem, 5vw, 3.05rem);
  font-weight: 850;
  letter-spacing: -.047em;
  line-height: 1.12;
}

.intro p, .library-heading p {
  margin-top: 7px;
  color: var(--muted);
}

.intro .button {
  flex: none;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.94fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 4px 14px #17385b09;
}

.lesson, .card-panel {
  padding: 24px;
}

.lesson-top, .lesson-heading, .feedback-row, .lesson-actions,
.card-panel-heading, .card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lesson-top {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.lesson-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .93rem;
  font-weight: 800;
}

.lesson-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #e8f0fa;
}

.lesson-icon svg {
  width: 16px;
  height: 16px;
}

.lesson-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 750;
  white-space: nowrap;
}

.lesson-progress progress {
  appearance: none;
  width: 72px;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: #e8edf4;
  color: var(--coral);
}

.lesson-progress progress::-webkit-progress-bar {
  background: #e8edf4;
}

.lesson-progress progress::-webkit-progress-value {
  border-radius: 10px;
  background: var(--coral);
}

.lesson-progress progress::-moz-progress-bar {
  border-radius: 10px;
  background: var(--coral);
}

.lesson-heading {
  padding-block: 16px 13px;
}

.lesson-heading h2, #paper-title {
  font-size: clamp(1.3rem, 3vw, 1.93rem);
  font-weight: 850;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.tracing-board {
  --board-height: clamp(170px, 30vw, 290px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #e7dfd0;
  border-radius: 15px;
  background: #fcfaf4;
}

.board-half {
  position: relative;
  display: grid;
  justify-items: center;
  grid-template-rows: 21px var(--board-height);
  padding: 10px 9px 12px;
  color: #5a6374;
  font-size: .84rem;
  font-weight: 750;
}

.board-half + .board-half {
  border-left: 1px solid #e7dfd0;
  background: #f9fbfe;
}

.board-half::before {
  content: "";
  position: absolute;
  inset: calc(31px + var(--board-height) * .159) 9px auto;
  height: calc(var(--board-height) * .614);
  border-block: 1px solid #8eb2d2;
  pointer-events: none;
}

.board-half::after {
  content: "";
  position: absolute;
  top: calc(31px + var(--board-height) * .426);
  inset-inline: 9px;
  border-top: 1px dashed #a4bbd2;
  pointer-events: none;
}

.board-half canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, calc(var(--board-height) * 140 / 176));
  height: var(--board-height);
}

#trace {
  touch-action: none;
  cursor: crosshair;
}

.feedback-row {
  min-height: 46px;
}

.feedback-row p {
  color: var(--muted);
  font-size: .92rem;
}

.feedback-row p[data-complete="true"] {
  color: #246047;
  font-weight: 750;
}

.lesson-actions {
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.letter-nav, .dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#paper-title {
  margin-top: 22px;
}

.paper-steps {
  display: grid;
  gap: 12px;
  margin: 15px 0 18px;
  padding-left: 28px;
}

.paper-steps li {
  padding: 10px 12px;
  border-radius: 9px;
  background: #f1f6fa;
  color: var(--muted);
}

.paper-steps strong {
  color: var(--ink);
}

.card-panel-heading {
  align-items: baseline;
  margin-bottom: 14px;
}

.card-panel-heading h2, .library-heading h2, #custom-title {
  font-size: 1.43rem;
  font-weight: 850;
  letter-spacing: -.035em;
  line-height: 1.2;
}

#card-category {
  color: var(--muted);
  font-size: .83rem;
  font-weight: 700;
  text-align: right;
}

.card-preview, #print-card {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
  aspect-ratio: 3 / 2;
}

.card-preview {
  min-height: 168px;
  border: 1px solid #e6dcc7;
  border-radius: 9px;
  box-shadow: 0 4px 8px #49330713;
}

.card-preview img, #print-card img {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

#card-message, #print-message {
  width: 74%;
  color: var(--card-ink, #1a4b89);
  font-family: var(--card-font);
  font-weight: var(--card-weight, 700);
  line-height: 1.32;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#card-message {
  padding-block: 12px;
  font-size: var(--card-size, 1.28rem);
}

.letter-picker-label {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: .87rem;
  font-weight: 750;
}

.letter-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 149px;
  overflow: auto;
  padding: 4px;
  margin: -4px;
}

.letter-picker button {
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 33px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6f9fc;
  font-size: .96rem;
  font-weight: 800;
}

.letter-picker button:hover {
  border-color: #759ec8;
}

.letter-picker button[data-done="true"] {
  border-color: #a1c8b2;
  background: #edf7ee;
  color: #285f48;
}

.letter-picker button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.card-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.library {
  scroll-margin-top: 16px;
  margin-top: 32px;
  padding-top: 23px;
  border-top: 1px solid #cddde9;
}

.library-heading {
  margin-bottom: 15px;
}

.library-heading h2 {
  font-size: 1.85rem;
}

.search-box {
  display: flex;
  align-items: center;
  width: min(270px, 100%);
  min-height: 46px;
  gap: 9px;
  padding-inline: 12px;
  border: 1px solid #c8d9e8;
  border-radius: 11px;
  background: white;
  color: var(--muted);
}

.search-box:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.search-box input {
  width: 100%;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.filters button {
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid #c8d9e8;
  border-radius: 20px;
  background: #f8fbfd;
  color: var(--ink);
  font-size: .86rem;
  font-weight: 750;
}

.filters button:hover {
  border-color: #759ec8;
}

.filters button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.library-count {
  min-height: 23px;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: .9rem;
}

.text-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.text-option {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 79px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  text-align: left;
}

.text-option:hover, .text-option[aria-pressed="true"] {
  border-color: #7aa3d1;
  background: #f6faff;
}

.text-option strong {
  font-size: .98rem;
  line-height: 1.25;
}

.text-option span {
  color: var(--muted);
  font-size: .79rem;
}

.library-footer {
  padding-top: 16px;
  text-align: center;
}

.site-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-page {
  max-width: 660px;
}

.privacy-page h1 {
  margin-block: 22px 12px;
  font-size: clamp(1.75rem, 5vw, 2.45rem);
  line-height: 1.15;
}

.privacy-page h2 {
  margin-block: 18px 5px;
  font-size: 1.17rem;
}

.privacy-page p {
  color: var(--muted);
}

dialog {
  width: min(100% - 28px, 490px);
  max-height: 90dvh;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: white;
  color: var(--ink);
  box-shadow: 0 18px 54px #10294744;
}

dialog::backdrop {
  background: #10294775;
}

#custom-form > p {
  margin: 8px 0 15px;
  color: var(--muted);
}

#custom-form label {
  display: block;
  margin-bottom: 6px;
  font-size: .92rem;
  font-weight: 750;
}

#custom-message {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #a8bed3;
  border-radius: 10px;
  resize: vertical;
}

.custom-details {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  color: var(--muted);
  font-size: .85rem;
}

#custom-error {
  color: #9a3628;
}

#custom-count {
  margin-left: auto;
  white-space: nowrap;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 9px;
}

#print-area {
  display: none;
}

@media (max-width: 860px) {
  .header-inner, .page {
    width: calc(100% - 36px);
  }

  .workspace {
    gap: 13px;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }

  .lesson, .card-panel {
    padding: 16px;
  }

  .lesson-heading {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .header-inner, .page {
    width: calc(100% - 28px);
  }

  .header-inner {
    min-height: 64px;
    gap: 12px;
    justify-content: space-between;
  }

  .header-inner nav {
    display: none;
  }

  .header-action {
    padding-inline: 10px;
  }

  .brand {
    gap: 7px;
    font-size: 1.22rem;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
  }

  .page {
    padding-top: 25px;
  }

  .intro, .library-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 15px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-preview {
    max-width: 380px;
    margin-inline: auto;
  }

  .search-box {
    width: 100%;
  }

  .text-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .lesson, .card-panel {
    padding: 12px;
  }

  .lesson-progress progress {
    width: 43px;
  }

  .lesson-actions > .button, .letter-nav > .button-primary {
    padding-inline: 8px;
  }

  .text-list {
    grid-template-columns: 1fr;
  }
}

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

  *, *::before, *::after {
    transition-duration: 0s !important;
  }
}

@page {
  margin: 15mm;
}

@media print {
  body {
    background: white;
    color: #101d30;
  }

  body > :not(#print-area) {
    display: none !important;
  }

  #print-area {
    display: block;
  }

  #print-card {
    width: min(100%, 6in);
    border: 1px solid #b0a58d;
    break-inside: avoid;
  }

  #print-message {
    font-size: var(--card-size, 23pt);
  }

  #print-sheet, body[data-print="sheet"] #print-card {
    display: none;
  }

  body[data-print="sheet"] #print-sheet {
    display: block;
  }

  #print-sheet h1 {
    font-size: 23pt;
  }

  #sheet-letters {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4mm 2mm;
    margin-block: 6mm;
  }

  #sheet-letters img {
    width: 100%;
    max-height: 20mm;
    object-fit: contain;
    border-bottom: 1px solid #9aa8b6;
  }

  #sheet-message {
    margin-block: 6mm 0;
    font-size: 16pt;
    font-family: var(--card-font);
    white-space: pre-wrap;
  }

  .sheet-line {
    height: 13mm;
    border-bottom: 1px solid #9aa8b6;
  }
}

/* ---------- Style studio, fonts, celebrations, ads ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.star-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 5px 12px 5px 9px;
  border: 1px solid #f3d58a;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff9e6, #fff1c7);
  color: #8a5a00;
  font-weight: 850;
  white-space: nowrap;
}

.star-badge svg {
  width: 19px;
  height: 19px;
  color: #f2a900;
  filter: drop-shadow(0 1px 0 #c98a0055);
}

.header-inner nav + .star-badge {
  margin-left: -14px;
}

.lesson-heading {
  flex-wrap: wrap;
}

.lesson-heading h2 {
  flex: 1 1 260px;
}

.studio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 13px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, #fbfdff, #f3f8fd);
}

.studio-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.studio-label {
  margin-right: 3px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.studio-group button, .studio-sound {
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid #c8d9e8;
  border-radius: 9px;
  background: white;
  font-size: .86rem;
  font-weight: 800;
  transition: transform .12s, background-color .15s, border-color .15s;
}

.studio-group button:hover, .studio-sound:hover {
  border-color: #759ec8;
}

.studio-group button:active, .studio-sound:active, .font-picker button:active {
  transform: scale(.94);
}

.studio-group button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.swatches button {
  width: 26px;
  min-height: 26px;
  height: 26px;
  padding: 0;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #c8d9e8;
}

.swatches button[aria-pressed="true"] {
  border-color: white;
  background: var(--swatch);
  box-shadow: 0 0 0 2.5px var(--ink);
  transform: scale(1.12);
}

.swatches .rainbow-swatch,
.swatches .rainbow-swatch[aria-pressed="true"] {
  background: conic-gradient(#e5484d, #f08c2e, #f2c200, #2f8a5b, #2f7fd0, #7b4cc2, #e5484d);
}

.sizes button {
  display: grid;
  place-items: center;
  width: 32px;
  padding: 0;
}

.sizes i {
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: currentColor;
}

.studio-sound {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--blue);
}

.studio-sound svg {
  width: 16px;
  height: 16px;
}

.studio-sound {
  width: 34px;
  padding: 0;
  justify-content: center;
}

.studio-sound svg {
  width: 17px;
  height: 17px;
}

.studio-sound[aria-pressed="false"] {
  color: #9aa7b6;
  background: linear-gradient(to top right, white calc(50% - 1px), #9aa7b6 50%, white calc(50% + 1px));
}

.feedback-row p[data-complete="true"] {
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1);
}

@keyframes pop {
  from { transform: scale(.85); opacity: .3; }
  to { transform: none; opacity: 1; }
}

.font-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.font-picker button {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 6px 2px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  transition: transform .12s, border-color .15s, background-color .15s;
}

.font-picker button:hover {
  border-color: #759ec8;
  transform: translateY(-1px);
}

.font-picker strong {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.15;
}

.font-picker span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
}

.font-picker button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--light-blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.card-inks {
  margin-top: 10px;
}

:root[data-card-ink="rainbow"] #card-message,
:root[data-card-ink="rainbow"] #print-message {
  background: linear-gradient(90deg, #e5484d, #f08c2e, #d9a400, #2f8a5b, #2f7fd0, #7b4cc2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.card-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.card-actions .link-button {
  margin-left: auto;
}

.letter-picker button {
  position: relative;
}

.letter-picker button[data-done="true"]::after {
  content: "★";
  position: absolute;
  top: -7px;
  right: -5px;
  color: #f2a900;
  font-size: .78rem;
  line-height: 1;
  text-shadow: 0 0 2px white, 0 0 2px white;
}

.text-option {
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.text-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px #17385b14;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ad-slot {
  margin: 28px auto 0;
  padding: 8px 10px 10px;
  max-width: 970px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fbfdfe;
  text-align: center;
}

.ad-slot-bottom {
  margin-top: 32px;
}

.ad-label {
  display: block;
  margin-bottom: 4px;
  color: #6c7c90;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.guide {
  scroll-margin-top: 16px;
  margin-top: 34px;
  padding-top: 23px;
  border-top: 1px solid #cddde9;
}

.guide h2 {
  margin-bottom: 15px;
  font-size: 1.85rem;
  font-weight: 850;
  letter-spacing: -.035em;
}

.guide h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  font-weight: 850;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.guide-card p, .tips li {
  color: var(--muted);
}

.guide-step {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 11px;
  background: #fde8e3;
  color: #b4462f;
  font-weight: 900;
}

.guide-card:nth-child(2) .guide-step {
  background: #e3effb;
  color: var(--blue);
}

.guide-card:nth-child(3) .guide-step {
  background: #e3f4ea;
  color: #2a7a50;
}

.tips {
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  background: #fff9eb;
  border: 1px solid #f1e2b8;
}

.tips ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.tips strong {
  color: var(--ink);
}

@media (max-width: 860px) {
  .font-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .star-badge {
    margin-left: auto;
    padding-inline: 8px 10px;
  }

  .header-action span:last-child {
    display: none;
  }

  .studio-sound {
    margin-left: 0;
  }

  .font-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-row p[data-complete="true"] {
    animation: none;
  }
}

.ad-slot:has(ins[data-ad-status="unfilled"]) {
  display: none;
}

.board-half span[data-playing="true"] {
  padding-inline: 9px;
  border-radius: 20px;
  background: var(--coral);
  color: white;
}

.font-picker {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.font-picker strong {
  font-size: 1.2rem;
}

.font-picker span {
  font-size: .64rem;
}

@media (max-width: 860px) {
  .font-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Phones: the writing area gets the full width so letters are big enough to trace. */
@media (max-width: 640px) {
  .tracing-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .board-half {
    --board-height: 150px;
  }

  .board-half + .board-half {
    --board-height: min(380px, (100vw - 84px) * 176 / 140);
    border-left: 0;
    border-top: 1px solid #e7dfd0;
  }

  .font-picker {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
