:root {
  color-scheme: light;
  --blue: #0754d9;
  --blue-deep: #063fb5;
  --blue-soft: #dceaff;
  --ink: #071d49;
  --muted: #53627d;
  --white: #ffffff;
  --paper: #f8fbff;
  --sky: #eff6ff;
  --line: #bbd2f5;
  --coral: #ff665c;
  --coral-dark: #e74d45;
  --yellow: #ffd83d;
  --yellow-dark: #e4b800;
  --mint: #ddf8ec;
  --green: #07885e;
  --red-soft: #ffebe9;
  --red: #c33f37;
  --shadow: 0 14px 30px rgb(3 31 92 / 14%);
  --shadow-small: 0 6px 14px rgb(3 31 92 / 12%);
  --radius-small: 14px;
  --radius: 20px;
  --radius-large: 28px;
  --max: 1400px;
  font-family: "Avenir Next", Avenir, Nunito, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--blue);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--blue);
  font-size: 16px;
  line-height: 1.5;
}

button {
  font: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100% - 48px, var(--max));
  min-height: 104px;
  margin: 0 auto;
  color: var(--white);
  background: var(--blue);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-self: start;
  padding: 0;
  color: inherit;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.05;
  text-align: left;
  letter-spacing: -0.02em;
  background: none;
  border: 0;
  cursor: pointer;
}

.brand-star {
  width: 52px;
  height: 52px;
  overflow: visible;
  fill: var(--yellow);
  stroke: var(--white);
  stroke-linejoin: round;
  stroke-width: 3;
}

.brand-star .spark {
  fill: none;
  stroke: var(--white);
  stroke-linecap: round;
  stroke-width: 3;
}

.main-nav {
  display: flex;
  gap: 4px;
  padding: 5px;
  background: var(--white);
  border-radius: 17px;
  box-shadow: var(--shadow-small);
}

.main-nav button {
  min-width: 112px;
  padding: 12px 22px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.main-nav button:hover {
  background: var(--sky);
}

.main-nav button:active {
  transform: translateY(1px);
}

.main-nav button[aria-current="page"] {
  color: var(--white);
  background: var(--coral);
}

.star-bank {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-self: end;
  min-width: 72px;
  padding: 9px 12px;
  color: var(--ink);
  font-weight: 850;
  background: var(--yellow);
  border: 2px solid rgb(255 255 255 / 70%);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-small);
}

.star-bank svg {
  width: 24px;
  height: 24px;
  fill: var(--white);
  stroke: var(--ink);
  stroke-linejoin: round;
  stroke-width: 1.5;
}

main {
  min-height: calc(100vh - 104px);
}

.screen {
  animation: screen-in 280ms ease both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-screen {
  background: var(--blue);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(480px, 1.15fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  width: min(100% - 64px, var(--max));
  min-height: 490px;
  margin: 0 auto;
  padding: 34px 0 44px;
  color: var(--white);
}

.home-intro h1 {
  max-width: 620px;
  margin: 0 0 18px;
  font-size: clamp(48px, 6vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.home-intro p {
  margin: 0 0 28px;
  font-size: clamp(19px, 2vw, 25px);
}

.home-actions {
  display: grid;
  gap: 14px;
  max-width: 500px;
}

.action-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 14px 22px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius-small);
  cursor: pointer;
  box-shadow: var(--shadow-small);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.action-button {
  justify-content: space-between;
  min-height: 76px;
  font-size: 20px;
}

.action-button:hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.action-button.coral,
.primary-button.coral {
  color: var(--white);
  background: var(--coral);
}

.action-button.coral:hover,
.primary-button.coral:hover {
  background: var(--coral-dark);
}

.action-button.yellow,
.primary-button.yellow {
  background: var(--yellow);
}

.action-button.yellow:hover,
.primary-button.yellow:hover {
  background: #f5c928;
}

.button-label {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.ui-icon {
  width: 25px;
  height: 25px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.home-word-card {
  position: relative;
  min-height: 374px;
  padding: 34px 46px 30px;
  color: var(--ink);
  text-align: center;
  background: var(--white);
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgb(1 21 70 / 26%);
}

.word-status {
  position: absolute;
  top: 24px;
  left: 28px;
  padding: 7px 12px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
  background: var(--mint);
  border-radius: 9px;
}

.flip-button {
  position: absolute;
  top: 20px;
  right: 24px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 9px 12px;
  color: var(--blue-deep);
  font-weight: 800;
  background: var(--sky);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.home-word-card h2 {
  margin: 54px 0 14px;
  font-size: clamp(36px, 4vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.term-rule {
  width: 72px;
  height: 5px;
  margin: 0 auto 20px;
  background: var(--blue);
  border-radius: 99px;
}

.card-definition {
  max-width: 580px;
  min-height: 56px;
  margin: 0 auto 20px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.35;
}

.card-prompt {
  display: grid;
  place-items: center;
  min-height: 130px;
  margin: 26px auto 20px;
  color: var(--muted);
  font-size: 20px;
  border: 2px dashed var(--line);
  border-radius: 16px;
}

.example-box {
  max-width: 560px;
  margin: 0 auto 18px;
  padding: 16px 20px;
  text-align: left;
  background: var(--sky);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.example-box small {
  display: block;
  margin-bottom: 3px;
  color: var(--blue-deep);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.math {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2em;
  font-style: italic;
}

.card-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--blue-deep);
  background: var(--sky);
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}

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

.dot,
.quiz-dot {
  width: 11px;
  height: 11px;
  background: #cad4e5;
  border-radius: 50%;
}

.dot.active,
.quiz-dot.done {
  background: var(--blue);
}

.progress-strip-wrap {
  width: 100%;
  padding: 0 32px;
  background: var(--blue);
}

.progress-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, var(--max));
  margin: 0 auto;
  color: var(--ink);
  background: var(--white);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow);
}

.progress-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
  min-height: 104px;
  padding: 20px 28px;
}

.progress-stat + .progress-stat {
  border-left: 1px solid var(--line);
}

.stat-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--blue-deep);
  font-size: 26px;
  font-weight: 900;
  background: var(--sky);
  border-radius: 13px;
}

.progress-stat:nth-child(2) .stat-icon {
  color: var(--green);
  background: var(--mint);
}

.progress-stat:nth-child(3) .stat-icon {
  background: #fff5c7;
}

.stat-label {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.stat-number {
  margin: 2px 0 0;
  font-size: 25px;
  font-weight: 900;
}

.stat-number span {
  color: #8d99ac;
  font-size: 16px;
}

.meter {
  width: 100%;
  height: 8px;
  margin-top: 7px;
  overflow: hidden;
  background: #dbe2ed;
  border-radius: 999px;
}

.meter > span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.progress-stat:nth-child(2) .meter > span {
  background: var(--green);
}

.home-lower {
  padding: 26px 32px 34px;
  background: var(--white);
}

.lower-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.section-title-row p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.nightly-path {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.path-step {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 146px;
  padding: 22px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 16px;
}

.path-step.complete {
  border-color: var(--green);
}

.path-step.reward {
  border-color: var(--yellow-dark);
}

.step-number {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--white);
  font-weight: 850;
  background: var(--blue);
  border-radius: 50%;
}

.complete .step-number {
  background: var(--green);
}

.reward .step-number {
  color: var(--ink);
  background: var(--yellow);
}

.step-visual {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  font-size: 36px;
  background: var(--sky);
  border-radius: 50%;
}

.step-copy strong {
  display: block;
  margin: 0 0 3px;
  font-size: 18px;
}

.step-copy span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.step-state {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--blue-deep);
  font-weight: 900;
  background: var(--sky);
  border-radius: 11px;
}

.complete .step-state {
  color: var(--green);
  background: var(--mint);
}

.save-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.paper-screen {
  min-height: calc(100vh - 104px);
  padding: 0 24px 40px;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath d='M36 0H0V36' fill='none' stroke='%23D8E9FF' stroke-width='1'/%3E%3C/svg%3E");
}

.activity-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding-top: 28px;
}

.activity-heading {
  margin: 0 auto 20px;
  text-align: center;
}

.activity-heading h1 {
  margin: 0 0 6px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.activity-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.learn-progress,
.quiz-progress {
  display: grid;
  gap: 10px;
  margin: 0 auto 18px;
  text-align: center;
}

.progress-label {
  font-weight: 850;
}

.learn-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 720px);
  height: 20px;
  margin: 0 auto;
}

.learn-track::before {
  position: absolute;
  top: 8px;
  right: 0;
  left: 0;
  height: 4px;
  content: "";
  background: #cadbf4;
  border-radius: 99px;
}

.learn-track > span {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 18px;
  height: 18px;
  background: #cadbf4;
  border: 4px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 2px #cadbf4;
}

.learn-track > span.done {
  background: var(--blue);
  box-shadow: 0 0 0 2px var(--blue);
}

.learn-track > span.current {
  background: var(--white);
  box-shadow: 0 0 0 4px var(--blue);
}

.study-card {
  position: relative;
  width: min(100%, 1080px);
  min-height: 430px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 54px);
  background: var(--white);
  border: 4px solid var(--blue);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.study-front {
  display: grid;
  min-height: 310px;
  place-items: center;
  text-align: center;
}

.study-front h2,
.study-back h2 {
  margin: 0;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.study-front p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.reveal-card-button {
  position: absolute;
  inset: 0;
  width: 100%;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: inherit;
  cursor: pointer;
}

.study-back h2 {
  padding-bottom: 22px;
  text-align: center;
  border-bottom: 2px solid var(--blue-soft);
}

.definition-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.definition-row {
  display: grid;
  grid-template-columns: 165px 1fr;
  gap: 26px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.definition-row:last-child {
  border-bottom: 0;
}

.definition-row dt {
  font-weight: 850;
}

.definition-row dd {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.examples-stack {
  display: grid;
  gap: 7px;
}

.example-good {
  text-decoration: underline 4px var(--green);
  text-underline-offset: 5px;
}

.example-not {
  text-decoration: underline 4px var(--coral);
  text-underline-offset: 5px;
}

.confidence-panel {
  min-height: 104px;
  margin-top: 18px;
  text-align: center;
}

.confidence-panel > p {
  margin: 0 0 9px;
  font-weight: 850;
}

.confidence-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.confidence-button {
  min-width: 220px;
  min-height: 58px;
  padding: 12px 22px;
  color: var(--ink);
  font-weight: 850;
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: 13px;
  cursor: pointer;
}

.confidence-button.got-it {
  color: var(--green);
  background: var(--mint);
  border-color: var(--green);
}

.activity-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1240px);
  margin: 18px auto 0;
}

.secondary-button {
  color: var(--blue-deep);
  background: var(--white);
  border: 2px solid var(--blue);
  box-shadow: none;
}

.quiz-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 32px 0;
}

.quiz-panel {
  padding: clamp(24px, 4vw, 46px);
  background: var(--white);
  border: 1px solid var(--blue-soft);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quiz-counter {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 17px;
  font-weight: 850;
}

.quiz-dots {
  display: flex;
  gap: 10px;
}

.quiz-dot {
  width: 14px;
  height: 14px;
  background: var(--white);
  border: 2px solid var(--blue);
}

.quiz-dot.done {
  background: var(--blue);
}

.quiz-dot.wrong {
  background: var(--coral);
  border-color: var(--coral);
}

.row-streak {
  padding: 10px 14px;
  color: var(--green);
  font-weight: 850;
  background: var(--mint);
  border-radius: 12px;
}

.quiz-title {
  margin: 0;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1;
  text-align: center;
  letter-spacing: -0.045em;
}

.quiz-title::after {
  display: block;
  width: 90px;
  height: 7px;
  margin: 18px auto 18px;
  content: "";
  background: var(--yellow);
  border-radius: 99px;
}

.quiz-question {
  max-width: 820px;
  min-height: 72px;
  margin: 0 auto 24px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.24;
  text-align: center;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.answer-button {
  display: flex;
  gap: 15px;
  align-items: center;
  min-height: 92px;
  padding: 18px 24px;
  color: var(--ink);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  text-align: left;
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.answer-button:hover:not(:disabled) {
  background: var(--sky);
  transform: translateY(-2px);
}

.answer-button:disabled {
  cursor: default;
}

.answer-marker {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 3px solid var(--blue);
  border-radius: 50%;
}

.answer-button.correct {
  color: var(--green);
  background: var(--mint);
  border-color: var(--green);
}

.answer-button.correct .answer-marker {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
}

.answer-button.incorrect {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--coral);
}

.answer-button.incorrect .answer-marker {
  border-color: var(--coral);
}

.feedback-band {
  display: flex;
  gap: 16px;
  align-items: center;
  min-height: 88px;
  margin-top: 18px;
  padding: 18px 24px;
  color: var(--green);
  font-size: 20px;
  font-weight: 750;
  background: var(--mint);
  border-radius: 16px;
}

.feedback-band.wrong {
  color: var(--red);
  background: var(--red-soft);
}

.feedback-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  color: var(--white);
  font-size: 25px;
  font-weight: 900;
  background: var(--green);
  border-radius: 50%;
}

.feedback-band.wrong .feedback-symbol {
  background: var(--red);
}

.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  margin-top: 18px;
}

.result-panel {
  max-width: 800px;
  margin: 0 auto;
  padding: 46px;
  text-align: center;
  background: var(--white);
  border: 4px solid var(--blue);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.result-star {
  display: grid;
  width: 116px;
  height: 116px;
  margin: 0 auto 18px;
  place-items: center;
  font-size: 64px;
  background: #fff6c7;
  border-radius: 50%;
  animation: star-pop 500ms cubic-bezier(.2, .85, .35, 1.3) both;
}

@keyframes star-pop {
  from { opacity: 0; transform: scale(.55) rotate(-15deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.result-panel h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.result-score {
  margin: 12px 0 6px;
  color: var(--blue-deep);
  font-size: 28px;
  font-weight: 900;
}

.result-copy {
  max-width: 600px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 18px;
}

.result-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.reward-list {
  display: grid;
  gap: 11px;
  max-width: 560px;
  margin: 24px auto;
  text-align: left;
}

.reward-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--sky);
  border-radius: 13px;
}

.reward-item.earned {
  background: var(--mint);
}

.reward-item strong {
  display: block;
}

.reward-item small {
  color: var(--muted);
}

.words-screen {
  padding-bottom: 64px;
}

.words-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding-top: 30px;
}

.words-heading {
  display: flex;
  gap: 28px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.words-heading h1 {
  margin: 0 0 5px;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.words-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.reviewed-summary {
  display: grid;
  min-width: 132px;
  padding: 15px 18px;
  color: var(--blue-deep);
  text-align: center;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-small);
}

.reviewed-summary strong {
  font-size: 28px;
  line-height: 1;
}

.reviewed-summary strong span {
  color: var(--muted);
  font-size: 16px;
}

.reviewed-summary > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.word-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-small);
  scrollbar-width: thin;
}

.word-filters button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 15px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
}

.word-filters button:hover {
  background: var(--sky);
}

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

.word-filters button strong {
  display: grid;
  min-width: 25px;
  height: 25px;
  padding: 0 5px;
  place-items: center;
  color: var(--blue-deep);
  font-size: 12px;
  background: var(--blue-soft);
  border-radius: 99px;
}

.word-filters button[aria-pressed="true"] strong {
  color: var(--ink);
  background: var(--yellow);
}

.word-list {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.word-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(260px, 1fr) 190px;
  gap: 26px;
  align-items: center;
  min-height: 142px;
  padding: 24px 28px;
}

.word-row + .word-row {
  border-top: 1px solid var(--line);
}

.word-row:hover {
  background: var(--paper);
}

.word-category {
  display: block;
  margin-bottom: 3px;
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.word-row h2 {
  margin: 0 0 5px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.word-row p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.42;
}

.word-example {
  padding-left: 22px;
  color: var(--ink);
  border-left: 2px solid var(--blue-soft);
}

.word-example > span:first-child {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.word-row-action {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.confidence-state {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  background: var(--sky);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.confidence-state.learning {
  color: var(--red);
  background: var(--red-soft);
  border-color: #ffc8c3;
}

.confidence-state.comfortable {
  color: #8a6700;
  background: #fff6c7;
  border-color: #efd46b;
}

.confidence-state.mastered {
  color: var(--green);
  background: var(--mint);
  border-color: #91dabc;
}

.review-word-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 850;
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: 10px;
  cursor: pointer;
}

.review-word-button:hover {
  color: var(--white);
  background: var(--blue);
}

.review-word-button .ui-icon {
  width: 19px;
  height: 19px;
}

.word-empty {
  padding: 60px 24px;
  text-align: center;
}

.word-empty > span {
  font-size: 54px;
}

.word-empty h2 {
  margin: 10px 0 4px;
  font-size: 28px;
}

.word-empty p {
  margin: 0 auto 18px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 36px));
  padding: 13px 17px;
  color: var(--white);
  font-weight: 750;
  background: var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    width: min(100% - 28px, var(--max));
  }

  .main-nav button {
    min-width: 78px;
    padding-inline: 13px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    width: min(100% - 40px, 760px);
    padding-top: 20px;
  }

  .home-intro {
    text-align: center;
  }

  .home-intro h1,
  .home-actions {
    margin-right: auto;
    margin-left: auto;
  }

  .progress-strip {
    grid-template-columns: 1fr;
  }

  .progress-stat + .progress-stat {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .nightly-path {
    grid-template-columns: 1fr;
  }

  .word-row {
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr);
  }

  .word-row-action {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    min-height: 132px;
    padding: 12px 0;
  }

  .brand {
    font-size: 16px;
  }

  .brand-star {
    width: 42px;
    height: 42px;
  }

  .star-bank {
    min-width: 64px;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
  }

  .main-nav button {
    flex: 1;
    min-width: 0;
    padding: 10px 9px;
  }

  main {
    min-height: calc(100vh - 132px);
  }

  .home-hero {
    width: min(100% - 28px, 680px);
    min-height: auto;
    padding: 24px 0 30px;
  }

  .home-intro h1 {
    font-size: clamp(44px, 13vw, 66px);
  }

  .action-button {
    min-height: 66px;
    padding: 12px 16px;
    font-size: 17px;
  }

  .home-word-card {
    min-height: 360px;
    padding: 30px 22px 24px;
  }

  .word-status {
    top: 18px;
    left: 18px;
  }

  .flip-button {
    top: 14px;
    right: 14px;
  }

  .progress-strip-wrap,
  .home-lower {
    padding-right: 14px;
    padding-left: 14px;
  }

  .progress-stat {
    min-height: 92px;
    padding: 16px;
  }

  .section-title-row {
    display: block;
  }

  .section-title-row p {
    margin-top: 4px;
  }

  .path-step {
    grid-template-columns: 58px 1fr auto;
    min-height: 120px;
    padding: 18px 14px;
  }

  .step-visual {
    width: 58px;
    height: 58px;
    font-size: 28px;
  }

  .paper-screen {
    min-height: calc(100vh - 132px);
    padding-right: 12px;
    padding-left: 12px;
  }

  .activity-heading p {
    font-size: 16px;
  }

  .study-card {
    min-height: 390px;
    padding: 28px 20px;
    border-width: 3px;
  }

  .study-front {
    min-height: 300px;
  }

  .definition-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 13px 0;
  }

  .confidence-buttons,
  .activity-footer,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .confidence-button,
  .activity-footer button,
  .result-actions button {
    width: 100%;
  }

  .activity-footer {
    gap: 10px;
  }

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

  .answer-button {
    min-height: 70px;
  }

  .quiz-meta {
    gap: 10px;
    align-items: start;
  }

  .quiz-counter {
    display: grid;
    gap: 7px;
  }

  .row-streak {
    font-size: 14px;
  }

  .quiz-question {
    min-height: auto;
  }

  .feedback-band {
    align-items: start;
    font-size: 17px;
  }

  .quiz-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quiz-actions button {
    width: 100%;
  }

  .result-panel {
    padding: 32px 18px;
  }

  .words-screen {
    padding-right: 12px;
    padding-left: 12px;
  }

  .words-heading {
    display: grid;
    align-items: start;
  }

  .words-heading p {
    font-size: 16px;
  }

  .reviewed-summary {
    grid-template-columns: auto auto;
    gap: 9px;
    align-items: center;
    justify-self: start;
    min-width: 0;
  }

  .reviewed-summary > span {
    margin: 0;
  }

  .word-row {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 22px 18px;
  }

  .word-example {
    padding: 14px 0 0;
    border-top: 1px solid var(--blue-soft);
    border-left: 0;
  }

  .word-row-action {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
