:root {
  --sunset: #e8692e;
  --sunset-deep: #b94a16;
  --sunset-soft: #ffe0cc;
  --sunset-line: #f4a878;
  --sky: #7ec8e3;
  --sky-deep: #1f5f86;
  --sky-soft: #dcf0f8;
  --sky-line: #9fd2e8;
  --sand: #f5ead6;
  --sand-deep: #e6d3b0;
  --sand-soft: #fbf6ec;
  --wood: #b9784a;
  --wood-deep: #8a5530;
  --slate: #23445e;
  --chalk: #fdfaf3;
  --ink: #2d2823;
  --ink-soft: #5f564c;
  --surface: #fffcf6;
  --line: #eadcc2;
  --focus: #1f5f86;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(80, 55, 20, 0.06), 0 12px 32px rgba(80, 55, 20, 0.1);
  --font-ui: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-hand: "Patrick Hand", "Comic Sans MS", cursive;
  --font-ipa: "Charis SIL", "Doulos SIL", "Gentium Plus", "Noto Serif", "Lucida Sans Unicode", serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  background-color: var(--sand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%23d6bf95' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' opacity='0.55'%3E%3Cg transform='rotate(-35 40 50)'%3E%3Crect x='10' y='44' width='56' height='12' rx='2'/%3E%3Cpath d='M66 44l14 6-14 6M18 44v12'/%3E%3C/g%3E%3Cpath d='M150 40q20-10 40 0v34q-20-10-40 0zM190 40q20-10 40 0v34q-20-10-40 0z'/%3E%3Cpath d='M40 150h60a10 10 0 0 1 10 10v26a10 10 0 0 1-10 10H66l-14 12v-12H40a10 10 0 0 1-10-10v-26a10 10 0 0 1 10-10z'/%3E%3Cpath d='M190 160l7 14 15 2-11 10 3 15-14-7-14 7 3-15-11-10 15-2z'/%3E%3Cpath d='M120 232c6-12 18-12 24 0M110 226c10-24 34-24 44 0'/%3E%3C/g%3E%3Cg fill='%23d6bf95' opacity='0.55' font-family='Georgia,serif' font-size='22'%3E%3Ctext x='52' y='124'%3Eabc%3C/text%3E%3Ctext x='196' y='126'%3E/%C9%99/%3C/text%3E%3Ctext x='20' y='244'%3E%C3%A6%3C/text%3E%3Ctext x='214' y='246'%3E%CA%83%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-size: 260px 260px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='380' height='380' viewBox='0 0 380 380'%3E%3Cg fill='none' stroke='%23a9ba8f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' opacity='0.4'%3E%3Cg transform='translate(96 150)'%3E%3Cpath d='M0 60C10 40 20 20 40 0'/%3E%3Cpath d='M10 42C0 36-2 26 4 22c6 6 8 14 6 20zM18 30c12 0 18-8 18-14-8 0-16 6-18 14zM26 18c-8-8-8-16-4-20 6 6 8 14 4 20zM34 8c8 2 14-2 16-8-8-2-14 2-16 8z'/%3E%3C/g%3E%3Cg transform='translate(300 330) rotate(160)'%3E%3Cpath d='M0 60C10 40 20 20 40 0'/%3E%3Cpath d='M10 42C0 36-2 26 4 22c6 6 8 14 6 20zM18 30c12 0 18-8 18-14-8 0-16 6-18 14zM26 18c-8-8-8-16-4-20 6 6 8 14 4 20z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: 380px 380px;
  background-position: 70px 40px;
}

a {
  color: var(--sky-deep);
  text-underline-offset: 2px;
}

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

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

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

.ipa {
  font-family: var(--font-ipa);
}

.hero {
  position: relative;
  padding: 40px 0 96px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0 calc(100% - 64px), var(--sky-soft) calc(100% - 64px) calc(100% - 58px), #cbe7f3 calc(100% - 58px)),
    linear-gradient(180deg, #fbf2e1 0%, #f4e4c7 100%);
  border-bottom: 6px solid var(--wood);
}

.hero__room {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 48px;
  align-items: stretch;
}

.board {
  position: relative;
  padding: 32px 36px 44px;
  border-radius: 12px;
  border: 14px solid var(--wood);
  box-shadow: inset 0 0 0 2px var(--wood-deep), inset 0 0 60px rgba(0, 0, 0, 0.35), 0 16px 30px rgba(80, 55, 20, 0.25);
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.07), transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 255, 255, 0.05), transparent 50%),
    var(--slate);
  color: var(--chalk);
}

.board__note {
  margin: 0 0 4px;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: #ffc9a3;
}

.board h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.6), 0 2px 0 rgba(0, 0, 0, 0.2);
}

.board__ipa {
  margin: 6px 0 16px;
  font-family: var(--font-ipa);
  font-size: 1.5rem;
  color: #b6e2f3;
}

.hero__lede {
  max-width: 580px;
  margin: 0;
  font-size: 1.08rem;
  color: rgba(253, 250, 243, 0.9);
}

.hero__lede em {
  color: #ffc9a3;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.hero__facts li {
  padding: 4px 14px;
  border: 2px dashed rgba(253, 250, 243, 0.45);
  border-radius: 999px;
  font-size: 0.92rem;
}

.hero__facts b {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #ffd2b0;
}

.board__tray {
  position: absolute;
  left: -14px;
  right: -14px;
  bottom: -26px;
  height: 14px;
  background: var(--wood-deep);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 10px rgba(80, 55, 20, 0.25);
}

.chalk,
.eraser {
  position: absolute;
  bottom: 12px;
  border-radius: 3px;
}

.chalk {
  width: 34px;
  height: 7px;
  left: 40px;
  background: var(--chalk);
}

.chalk--orange {
  left: 82px;
  width: 26px;
  background: #ffb27a;
}

.chalk--blue {
  left: 116px;
  width: 30px;
  background: var(--sky);
}

.eraser {
  right: 48px;
  width: 64px;
  height: 14px;
  background: linear-gradient(180deg, var(--sunset) 0 55%, #5b3a21 55%);
}

.decor {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: -26px;
}

.window {
  display: block;
  width: 88%;
  height: auto;
  filter: drop-shadow(0 10px 14px rgba(80, 55, 20, 0.18));
}

.shelf {
  width: 100%;
}

.shelf__items {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  overflow-x: clip;
}

.books {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.book {
  position: relative;
  display: block;
  width: 22px;
  height: 74px;
  border-radius: 3px 3px 1px 1px;
}

.book::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 12px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.75);
}

.book--tall {
  height: 88px;
  width: 26px;
}

.book--short {
  height: 62px;
}


.book--navy {
  background: var(--sky-deep);
}

.book--orange {
  background: var(--sunset);
}

.book--sand {
  background: var(--sand-deep);
}

.book--sand::after {
  background: rgba(138, 85, 48, 0.4);
}

.book--sky {
  background: var(--sky);
}

.book--sky::after {
  background: rgba(31, 95, 134, 0.6);
}

.book--rust {
  background: var(--sunset-deep);
}

.blocks {
  display: grid;
  grid-template-columns: repeat(2, 42px);
  grid-template-rows: repeat(2, 42px);
  gap: 4px;
}

.block {
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-family: var(--font-ipa);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate);
}

.block--top {
  grid-column: 1 / span 2;
  grid-row: 1;
  justify-self: center;
  width: 42px;
}

.block--sky {
  grid-row: 2;
  background: var(--sky);
}

.block--peach {
  grid-row: 2;
  background: #f3a26d;
}

.block--sand {
  background: var(--sand-deep);
}

.shelf__plank {
  height: 14px;
  border-radius: 4px;
  background: var(--wood-deep);
  box-shadow: 0 6px 10px rgba(80, 55, 20, 0.25);
}

main.wrap {
  position: relative;
  margin-top: 32px;
  padding-bottom: 40px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 32px;
}

.panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}

.controls {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.controls__row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field--type {
  flex: 1 1 240px;
  max-width: 320px;
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field--freq {
  flex: 1 1 260px;
  max-width: 380px;
}

.field label,
.field legend {
  display: flex;
  align-items: center;
  font-weight: 800;
  padding: 0;
  white-space: nowrap;
}

.field--count {
  flex: 1 1 260px;
  max-width: 300px;
}

.step {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--sky-deep);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1;
}

.hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.hint--inline {
  font-weight: 400;
  margin-left: 8px;
}

.select {
  position: relative;
  display: block;
  width: 100%;
}

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 13px;
  height: 8px;
  margin-top: -4px;
  pointer-events: none;
  background: var(--sky-deep);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform 0.18s ease;
}

.select.is-open::after {
  transform: rotate(180deg);
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
}

.select:has(select:disabled)::after {
  opacity: 0.4;
}

input[type="number"],
select {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--sand-deep);
  border-radius: 12px;
  padding: 10px 14px;
  min-height: 48px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input[type="number"],
.field select {
  height: 56px;
  padding-top: 0;
  padding-bottom: 0;
}

input[type="number"] {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--sky-deep);
  box-shadow: 0 0 0 4px var(--sky-soft);
}

.syllables__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.chip span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 10px 10px 8px;
  border: 2px solid var(--sand-deep);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  line-height: 1.1;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.chip span:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(80, 55, 20, 0.1);
}

.chip b {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.chip small {
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.chip input:checked + span {
  background: var(--sky-deep);
  border-color: var(--sky-deep);
  color: #fff;
  box-shadow: 0 6px 14px rgba(31, 95, 134, 0.25);
}

.chip input:checked + span small {
  color: var(--sky-soft);
}

.chip input:focus-visible + span {
  outline: 3px solid var(--sunset);
  outline-offset: 2px;
}

.syllables__actions {
  display: flex;
  gap: 18px;
  margin-top: 8px;
}

.link-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sky-deep);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.more {
  margin: 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--sand-soft);
  border: 1px dashed var(--sand-deep);
}

.more summary {
  font-weight: 800;
  cursor: pointer;
}

.more[open] summary {
  margin-bottom: 14px;
}

.more .field {
  flex: 1 1 220px;
  max-width: 320px;
}

.controls__row--options {
  gap: 10px 32px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--sky-deep);
  flex: none;
}

.check--off {
  opacity: 0.45;
  cursor: not-allowed;
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -12px;
  cursor: pointer;
  font-weight: 700;
  align-self: flex-start;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 40px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}

.switch__track {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--sand-deep);
  transition: background 0.15s;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.switch input:checked + .switch__track {
  background: var(--sky-deep);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch__track {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.controls__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.pool {
  margin: 0;
  color: var(--ink-soft);
}

.pool strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--sunset-deep);
}

.btn {
  font: inherit;
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
  min-height: 44px;
  padding: 10px 20px;
  border: 2px solid transparent;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn--primary {
  font-family: var(--font-display);
  background: linear-gradient(180deg, #d4602a, var(--sunset-deep));
  color: #fff;
  font-size: 1.2rem;
  padding: 12px 36px;
  box-shadow: 0 6px 18px rgba(185, 74, 22, 0.35);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(185, 74, 22, 0.4);
}

.btn--primary:disabled {
  background: #c7a58f;
  box-shadow: none;
  cursor: progress;
}

.btn--ghost {
  background: #fff;
  color: var(--sky-deep);
  border-color: var(--sky-line);
  padding: 8px 18px;
  font-size: 0.95rem;
}

.btn--ghost:hover {
  background: var(--sky-soft);
}

.results {
}

.results__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.results__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-right: 4px;
}

.inline-select .select {
  width: auto;
}

.inline-select select {
  width: auto;
  min-height: 42px;
  padding: 6px 36px 6px 12px;
}

.inline-select .select::after {
  right: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 20px;
  padding: 10px 14px;
  list-style: none;
  font-size: 0.88rem;
  color: var(--ink-soft);
  background: var(--sand-soft);
  border-radius: 12px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend .syl,
.legend .phon {
  min-width: 32px;
  text-align: center;
  font-size: 1rem;
}

.notice {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--sunset-soft);
  border-left: 4px solid var(--sunset);
}

.group + .group {
  margin-top: 32px;
}

.group__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--sunset-deep);
}

.group__title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--sand-deep) 0 8px, transparent 8px 14px);
}

.group__title small {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--sky-deep);
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sky-soft);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(80, 55, 20, 0.05);
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(80, 55, 20, 0.1);
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.card__word {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.card__ipa {
  font-family: var(--font-ipa);
  font-size: 1.2rem;
  color: var(--sky-deep);
  overflow-wrap: anywhere;
}

.card__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sky-soft);
  color: var(--sky-deep);
  font-size: 0.8rem;
  letter-spacing: 0;
}

.badge--sand {
  background: var(--sand);
  color: var(--wood-deep);
}

.segs,
.phons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.syl {
  font-family: var(--font-ipa);
  font-size: 1.2rem;
  line-height: 1.5;
  padding: 2px 12px;
  border-radius: 10px;
  background: var(--sand-soft);
  border: 2px solid var(--sand-deep);
  color: var(--ink);
}

.syl--primary {
  background: var(--sunset-soft);
  border-color: var(--sunset);
  color: #7a2e0b;
  font-weight: 700;
}

.syl--secondary {
  background: var(--sky-soft);
  border-color: var(--sky);
  color: #174a69;
}

.phon-group {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--sand-soft);
}

.phon {
  font-family: var(--font-ipa);
  font-size: 1.1rem;
  line-height: 1.5;
  min-width: 30px;
  text-align: center;
  padding: 0 6px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--sand-deep);
}

.phon--vowel {
  background: #fff;
  border-color: var(--sky);
  color: var(--sky-deep);
  font-weight: 700;
}

.phon--target {
  background: var(--sunset);
  border-color: var(--sunset-deep);
  color: #fff;
  font-weight: 700;
}

.empty {
  margin: 0;
  padding: 32px;
  text-align: center;
  color: var(--ink-soft);
}

.about {
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px 32px;
  margin: 18px 0 0;
}

.about dt {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sky-deep);
  margin-bottom: 4px;
}

.about dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.about .ipa {
  color: var(--ink);
}

.footer {
  margin-top: 8px;
  padding: 28px 0 36px;
  background: var(--slate);
  color: rgba(253, 250, 243, 0.8);
  border-top: 6px solid var(--wood);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer p {
  margin: 0;
}

.footer__credit {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--chalk);
}

.footer__credit strong {
  color: #ffc9a3;
  font-weight: 400;
}

.footer__note {
  font-size: 0.85rem;
  max-width: 520px;
}

.floor-plant {
  position: absolute;
  bottom: 0;
  width: 130px;
  height: auto;
  z-index: 0;
  filter: drop-shadow(0 8px 10px rgba(80, 55, 20, 0.18));
}

.floor-plant--left {
  left: max(10px, calc(50% - 720px));
}

.floor-plant--right {
  right: max(6px, calc(50% - 720px));
  width: 160px;
}

.hero__room {
  position: relative;
  z-index: 1;
}

.succulent {
  flex: none;
  width: 48px;
  height: 52px;
  align-self: flex-end;
}


.toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--sand);
  border: 1px solid var(--sand-deep);
}

.toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
}

.toggle__btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.toggle__btn[aria-pressed="true"] {
  background: #fff;
  color: var(--sky-deep);
  box-shadow: 0 2px 6px rgba(80, 55, 20, 0.12);
}

.btn--flash {
  background: var(--sunset-soft);
  color: #7a2e0b;
  border-color: var(--sunset-line);
  padding: 8px 18px;
  font-size: 0.95rem;
}

.btn--flash:hover {
  background: #ffd0b3;
}

.words {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.words th {
  text-align: left;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 10px 14px;
  background: var(--sand-soft);
  border-bottom: 1px solid var(--line);
}

.words td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.words tbody tr:last-child td {
  border-bottom: 0;
}

.words tbody tr:hover td {
  background: #fffaf2;
}

.words__word {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.words__num {
  text-align: center;
  font-weight: 800;
  color: var(--ink-soft);
  width: 48px;
}

.words th.words__num {
  text-align: center;
}

.words__ipa {
  font-family: var(--font-ipa);
  font-size: 1.15rem;
  color: var(--sky-deep);
  white-space: nowrap;
}

.words .syl {
  font-size: 1.05rem;
  padding: 0 9px;
}

.words .phon {
  font-size: 1rem;
  min-width: 26px;
}

.flash {
  width: min(960px, calc(100vw - 32px));
  max-width: none;
  height: min(720px, calc(100dvh - 32px));
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--slate);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(20, 30, 40, 0.45);
}

.flash::backdrop {
  background: rgba(35, 50, 65, 0.6);
  backdrop-filter: blur(3px);
}

.flash__frame {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px 22px 16px;
  border: 12px solid var(--wood);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 255, 255, 0.07), transparent 55%),
    var(--slate);
}

.flash__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flash__counter {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: #ffc9a3;
}

.flash__close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--chalk);
  font-size: 1.2rem;
  cursor: pointer;
}

.flash__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.flash__stage {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 12px 0;
  overflow: auto;
}

.card--flash {
  width: min(100%, 720px);
  gap: 22px;
  padding: 32px 36px;
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  animation: flash-in 0.22s ease-out;
}

.card--flash:hover {
  transform: none;
}

.card--flash .card__head {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 20px;
  text-align: center;
}

.card--flash .card__word {
  font-size: clamp(2.6rem, 8vw, 4.8rem);
}

.card--flash .card__ipa {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.card--flash .card__row {
  align-items: center;
  gap: 10px;
}

.card--flash .card__label {
  font-size: 0.85rem;
}

.card--flash .segs,
.card--flash .phons {
  justify-content: center;
  gap: 10px;
}

.card--flash .syl {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  padding: 4px 18px;
  border-radius: 14px;
}

.card--flash .phon {
  font-size: clamp(1.3rem, 3.4vw, 1.8rem);
  min-width: 44px;
  padding: 2px 10px;
  border-radius: 10px;
}

.card--flash .phon-group {
  gap: 5px;
  padding: 5px;
  border-radius: 14px;
}

@keyframes flash-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.flash__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 8px;
}

.flash__arrow {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--chalk);
  color: var(--slate);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.flash__arrow:hover {
  transform: scale(1.06);
}

.flash__arrow svg,
.flash__random svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flash__random {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 26px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  background: linear-gradient(180deg, #d4602a, var(--sunset-deep));
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.flash__random svg {
  width: 22px;
  height: 22px;
}

.flash__hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(253, 250, 243, 0.6);
}

.qz {
  width: min(520px, calc(100vw - 32px));
  padding: 24px 26px 26px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(20, 30, 40, 0.35);
}

.qz::backdrop {
  background: rgba(35, 50, 65, 0.55);
  backdrop-filter: blur(3px);
}

.qz__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qz h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

.qz__close {
  background: var(--sand);
  color: var(--ink);
  flex: none;
}

.qz__close:hover {
  background: var(--sand-deep);
}

.qz__status {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--sky-soft);
  color: var(--sky-deep);
  font-weight: 700;
}

.qz__steps {
  margin: 16px 0 0;
  padding-left: 22px;
}

.qz__steps li + li {
  margin-top: 6px;
}

.qz__note {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.qz__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.qz__go {
  display: inline-flex;
  align-items: center;
  font-size: 1.05rem;
  padding: 10px 26px;
  text-decoration: none;
}

.tabs {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 -1px;
}

.tab {
  font: inherit;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: #f3e6cf;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  padding: 9px 18px;
  min-height: 44px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  background: #faf0df;
}

.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--sunset-deep);
  padding-bottom: 11px;
}

.tabpanel > .controls {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.pair {
  gap: 14px;
}

.pair__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.pair__side {
  text-align: center;
  padding: 10px 8px;
  border-radius: 14px;
  background: var(--sand-soft);
}

.pair__word {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.pair__ipa {
  margin: 2px 0 8px;
  font-family: var(--font-ipa);
  font-size: 1.05rem;
  color: var(--sky-deep);
  overflow-wrap: anywhere;
}

.pair__sound {
  display: inline-block;
  margin: 0;
  padding: 2px 14px;
  border-radius: 10px;
  background: var(--sunset-soft);
  border: 2px solid var(--sunset);
  color: #7a2e0b;
  font-family: var(--font-ipa);
  font-size: 1.25rem;
  font-weight: 700;
}

.pair__vs {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--ink-soft);
}

.pair__meta {
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: center;
}

.cards--ret {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

.ret {
  gap: 12px;
}

.ret__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.ret__stimulus {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
}

.ret__kind {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.ret__steps {
  margin: 0;
  padding-left: 22px;
  font-size: 0.95rem;
}

.ret__steps > li {
  margin-bottom: 8px;
}

.ret__steps b {
  color: var(--sky-deep);
}

.ret__cues {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
}

.ret__notes {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.ret__line {
  flex: 1;
  border-bottom: 1px solid var(--sand-deep);
  height: 18px;
}

@media (max-width: 760px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 3px;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 0.92rem;
  }

  .cards--ret {
    grid-template-columns: 1fr;
  }

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

  .pair__vs {
    justify-self: center;
  }
}

.spt-steps {
  padding: 18px 20px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: var(--sand-soft);
  border: 1px dashed var(--sand-deep);
}

.spt-steps h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--sunset-deep);
}

.spt-steps__list {
  margin: 0;
  padding-left: 22px;
  font-size: 0.95rem;
}

.spt-steps__list > li {
  margin-bottom: 8px;
}

.spt-steps__list b {
  color: var(--sky-deep);
}

.spt-steps__note {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.spt__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
}

.spt__num {
  width: 42px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 800;
}

.spt__trials {
  width: 130px;
  white-space: nowrap;
}

.spt__trials span {
  display: inline-block;
  width: 26px;
  height: 26px;
  margin-right: 6px;
  border: 1px solid var(--sand-deep);
  border-radius: 6px;
  background: #fff;
}

.spt__notes {
  min-width: 150px;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 760px) {
  .spt__trials,
  .spt__notes,
  .spt__num {
    display: none;
  }
}

@media (max-width: 1399px) {
  .floor-plant {
    display: none;
  }
}

@media (max-width: 900px) {
  .hero__room {
    grid-template-columns: 1fr;
  }

  .decor {
    display: none;
  }
}

@media (max-width: 760px) {
  .hero {
    padding: 20px 0 84px;
  }

  .board {
    padding: 22px 20px 34px;
    border-width: 10px;
  }

  .board__tray {
    left: -10px;
    right: -10px;
  }

  .panel {
    padding: 20px 16px;
  }

  .field--type,
  .field--count,
  .field--freq {
    flex: 1 1 100%;
    max-width: none;
  }

  .chip span {
    min-width: 58px;
  }

  .results__tools {
    width: 100%;
  }

  .inline-select {
    width: 100%;
  }

  .inline-select select {
    flex: 1;
  }

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

  .card {
    padding: 16px;
  }

  .words thead {
    display: none;
  }

  .words,
  .words tbody,
  .words tr,
  .words td {
    display: block;
    width: 100%;
  }

  .words tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .words tbody tr:last-child {
    border-bottom: 0;
  }

  .words td {
    border: 0;
    padding: 3px 0;
  }

  .words td.words__num {
    display: none;
  }

  .words__ipa {
    white-space: normal;
  }

  .flash__frame {
    padding: 12px 12px 10px;
    border-width: 8px;
  }

  .card--flash {
    padding: 22px 18px;
  }

  .flash__arrow {
    width: 52px;
    height: 52px;
  }

  .flash__random {
    padding: 10px 18px;
  }

  .flash__hint {
    display: none;
  }
}

@media print {
  :root {
    --font-ui: Arial, "Helvetica Neue", Helvetica, sans-serif;
    --font-display: Arial, "Helvetica Neue", Helvetica, sans-serif;
    --font-hand: Arial, "Helvetica Neue", Helvetica, sans-serif;
    --font-ipa: "Charis SIL", "Doulos SIL", "Times New Roman", serif;
  }

  body {
    background: #fff;
    font-family: var(--font-ui);
  }

  h1,
  h2,
  h3,
  h4,
  .card__word,
  .pair__word,
  .ret__stimulus,
  .spt__title,
  .words__word,
  .group__title,
  .badge,
  input[type="number"] {
    font-family: var(--font-ui);
    letter-spacing: 0;
  }

  body::before,
  .flash {
    display: none !important;
  }

  .hero,
  .tabs,
  .controls,
  .about,
  .results__tools,
  .legend,
  .notice {
    display: none !important;
  }

  .footer {
    display: none;
  }

  main {
    margin: 0;
  }

  .panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
  }

  .syl,
  .phon,
  .phon-group,
  .badge {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .panel {
    margin: 0 0 10px;
    background: none;
  }

  .results__bar h2 {
    font-size: 13pt;
    margin: 0 0 6px;
  }

  .group + .group {
    margin-top: 8px;
  }

  .group__title {
    font-size: 11pt;
    margin: 8px 0 3px;
    color: #000;
  }

  .group__title::after {
    display: none;
  }

  .group__title small {
    background: none;
    color: #000;
    padding: 0;
  }

  .cards,
  .cards--ret {
    display: block;
  }

  .card {
    display: block;
    border: 0;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    box-shadow: none;
    background: none;
    padding: 2px 0;
    margin: 0;
    gap: 0;
    font-size: 10pt;
    line-height: 1.35;
    break-inside: avoid;
  }

  .card__head,
  .card__row,
  .segs,
  .phons,
  .phon-group,
  .card__word,
  .card__ipa {
    display: inline;
    border: 0;
    padding: 0;
    margin: 0;
    gap: 0;
    background: none;
    text-align: left;
  }

  .card__word {
    font-size: 10pt;
    font-weight: 700;
  }

  .card__ipa {
    color: #000;
    margin-left: 6px;
    font-size: 10pt;
  }

  .card__label,
  .card__row .badge {
    display: none;
  }

  .card__row::before {
    content: " \2014  ";
  }

  .syl,
  .phon {
    display: inline;
    background: none !important;
    border: 0 !important;
    border-radius: 0;
    padding: 0;
    margin: 0;
    color: #000;
    font-size: 10pt;
    font-weight: 400;
  }

  .syl + .syl::before {
    content: "\00b7";
  }

  .phon + .phon::before,
  .phon-group + .phon-group::before {
    content: " ";
  }

  .words {
    display: table;
    width: 100%;
    border: 0;
    border-radius: 0;
    font-size: 10pt;
  }

  .words thead {
    display: table-header-group;
  }

  .words tbody {
    display: table-row-group;
  }

  .words tr {
    display: table-row;
    padding: 0;
    border: 0;
  }

  .words td,
  .words th {
    display: table-cell;
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
  }

  .words th {
    white-space: normal;
  }

  .words:not(.spt__table) {
    table-layout: fixed;
  }

  .words:not(.spt__table) th:nth-child(1),
  .words:not(.spt__table) td:nth-child(1) {
    width: 18%;
  }

  .words:not(.spt__table) th:nth-child(2),
  .words:not(.spt__table) td:nth-child(2) {
    width: 21%;
  }

  .words:not(.spt__table) th:nth-child(3),
  .words:not(.spt__table) td:nth-child(3),
  .words:not(.spt__table) th:nth-child(5),
  .words:not(.spt__table) td:nth-child(5) {
    width: 5%;
  }

  .words:not(.spt__table) th:nth-child(4),
  .words:not(.spt__table) td:nth-child(4) {
    width: 30%;
  }

  .words:not(.spt__table) th:nth-child(6),
  .words:not(.spt__table) td:nth-child(6) {
    width: 21%;
  }

  .words td[data-label]::before {
    display: none;
  }

  .words td.words__num {
    display: table-cell;
    text-align: center;
  }

  .spt__trials,
  .spt__notes,
  .spt__num {
    display: table-cell;
  }

  .words th {
    background: none;
    border-bottom: 1px solid #999;
    padding: 2px 8px 2px 0;
    font-size: 8pt;
  }

  .words td {
    padding: 2px 8px 2px 0;
    border-bottom: 1px solid #ddd;
  }

  .words tbody tr:nth-child(even) td,
  .words tbody tr:hover td {
    background: none;
  }

  .words__word,
  .words__ipa {
    font-size: 10pt;
    color: #000;
  }

  .pair__row {
    display: block;
  }

  .pair__side,
  .pair__word,
  .pair__ipa,
  .pair__sound,
  .pair__vs,
  .pair__meta {
    display: inline;
    background: none;
    border: 0;
    padding: 0;
    margin: 0 4px 0 0;
    font-size: 10pt;
    color: #000;
  }

  .pair__meta::before {
    content: " \2014  ";
  }

  .spt-steps,
  .ret__steps {
    font-size: 9pt;
  }
}
