:root {
  --font-sans: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --ink: #183149;
  --muted: #69798a;
  --line: #dfe5ea;
  --canvas: #f5f4ef;
  --surface: #ffffff;
  --nav: #142c42;
  --nav-soft: #1d3b55;
  --mint: #bfe9d4;
  --mint-strong: #2f976d;
  --blue: #4d7fe7;
  --blue-soft: #e9f0ff;
  --amber: #e49a41;
  --amber-soft: #fff1dc;
  --violet: #8268c7;
  --violet-soft: #eee9fb;
  --red: #c55c55;
  --shadow: 0 18px 45px rgba(29, 47, 63, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(77, 127, 231, 0.32);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 30px 22px 24px;
  color: #eef6fb;
  background:
    radial-gradient(circle at 20% 88%, rgba(91, 174, 139, 0.18), transparent 28%),
    linear-gradient(180deg, #17344c 0%, #10283c 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #143247;
  background: var(--mint);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.06em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.brand-mark span {
  color: var(--mint-strong);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--font-sans);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 2px;
  color: #9fb3c2;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 48px;
}

.nav-item {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  border-radius: 12px;
  color: #b9c8d3;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  color: #ffffff;
  background: var(--nav-soft);
  box-shadow: inset 3px 0 0 var(--mint);
}

.nav-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--mint);
  background: rgba(191, 233, 212, 0.09);
  font-weight: 800;
}

.sidebar-progress {
  margin-top: auto;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.sidebar-progress-label span,
.sidebar-progress p {
  color: #9fb3c2;
}

.progress-track,
.session-progress,
.quiz-track {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-track {
  margin-top: 11px;
}

.progress-track span,
.session-progress span,
.quiz-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
  transition: width 300ms ease;
}

.sidebar-progress p {
  margin: 9px 0 0;
  font-size: 11px;
}

.source-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding: 10px 13px;
  color: #aabdc9;
  text-decoration: none;
  font-size: 12px;
}

.source-link:hover {
  color: #ffffff;
}

.main-column {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  padding: 20px clamp(24px, 4vw, 58px);
  border-bottom: 1px solid rgba(24, 49, 73, 0.07);
  background: rgba(245, 244, 239, 0.88);
  backdrop-filter: blur(14px);
}

.eyebrow,
.section-kicker,
.hero-kicker,
.question-label,
.result-kicker,
.card-label {
  margin: 0 0 5px;
  color: var(--mint-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.2;
  font-size: clamp(21px, 2.2vw, 29px);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.install-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid #b9ddcc;
  border-radius: 999px;
  color: #246c50;
  background: #e7f6ee;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.install-button:hover {
  background: #d9f0e4;
}

.install-button[hidden] {
  display: none;
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border: 1px solid #dfddd5;
  border-radius: 999px;
  color: #715020;
  background: #fffaf0;
  font-size: 12px;
}

.streak-pill > span:first-child {
  color: var(--amber);
}

.reset-button,
.text-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.reset-button {
  padding: 9px;
  font-size: 12px;
}

.reset-button:hover,
.text-button:hover {
  color: var(--ink);
}

.mobile-menu {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

main {
  padding: 36px clamp(24px, 4vw, 58px) 64px;
}

.view {
  display: none;
  animation: fade-in 220ms ease;
}

.view.is-visible {
  display: block;
}

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(260px, 0.65fr);
  gap: 20px;
}

.hero-card,
.daily-card,
.panel,
.quiz-shell,
.session-sidebar {
  border: 1px solid rgba(24, 49, 73, 0.07);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 300px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
  border-radius: var(--radius-lg);
  color: #f5fbff;
  background:
    radial-gradient(circle at 78% 16%, rgba(191, 233, 212, 0.18), transparent 26%),
    linear-gradient(135deg, #183a54 0%, #10283d 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 42px 18px 38px 42px;
}

.hero-copy h2,
.panel-heading h2,
.workspace-heading h2 {
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
}

.hero-copy h2 {
  max-width: 570px;
  margin: 8px 0 14px;
  font-size: clamp(29px, 3.2vw, 46px);
  line-height: 1.04;
  font-weight: 600;
}

.hero-copy h2 em {
  color: var(--mint);
  font-weight: inherit;
}

.hero-copy p {
  max-width: 560px;
  margin: 0 0 26px;
  color: #bcd0dd;
  font-size: 14px;
  line-height: 1.65;
}

.primary-button,
.secondary-button,
.danger-button,
.load-more {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.primary-button {
  color: #153349;
  background: var(--mint);
  box-shadow: 0 8px 24px rgba(92, 193, 142, 0.17);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.load-more:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: #d0f2e1;
}

.secondary-button,
.load-more {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.danger-button {
  color: #ffffff;
  background: var(--red);
}

.hero-visual {
  position: relative;
  min-height: 260px;
}

.word-family {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 210px;
  height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(191, 233, 212, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
}

.word-family span {
  color: #b5c9d6;
  font-family: var(--font-sans);
  font-size: 16px;
}

.word-family strong {
  color: var(--mint);
  font-family: var(--font-sans);
  font-size: 25px;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(191, 233, 212, 0.14);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 16px rgba(191, 233, 212, 0.6);
}

.orbit-one { width: 270px; height: 270px; }
.orbit-one::after { top: 35px; right: 35px; }
.orbit-two { width: 340px; height: 340px; }
.orbit-two::after { bottom: 57px; left: 37px; }

.daily-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 27px;
  border-radius: var(--radius-lg);
}

.daily-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.goal-badge {
  padding: 5px 9px;
  border-radius: 999px;
  color: #267552;
  background: #e4f6ed;
  font-size: 11px;
  font-weight: 800;
}

.goal-ring {
  --goal-progress: 0deg;
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  margin: 19px 0 12px;
  border-radius: 50%;
  background: conic-gradient(var(--mint-strong) var(--goal-progress), #e9efec 0);
}

.goal-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 109px;
  height: 109px;
  border-radius: 50%;
  background: #ffffff;
}

.goal-ring div {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
  text-align: center;
}

.goal-ring strong,
.goal-ring span {
  display: block;
}

.goal-ring strong {
  font-family: var(--font-sans);
  font-size: 38px;
  line-height: 1;
}

.goal-ring span,
.daily-card > p {
  color: var(--muted);
  font-size: 12px;
}

.daily-card > p {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.stat-card {
  min-height: 118px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  padding: 19px;
  border: 1px solid rgba(24, 49, 73, 0.07);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

.stat-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-weight: 900;
}

.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.green { color: var(--mint-strong); background: #e2f4eb; }
.stat-icon.violet { color: var(--violet); background: var(--violet-soft); }
.stat-icon.amber { color: #ae6a19; background: var(--amber-soft); }

.stat-card div strong,
.stat-card div span {
  display: block;
}

.stat-card div strong {
  font-size: 25px;
  line-height: 1;
}

.stat-card div span {
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.stat-card small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.home-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 20px;
  margin-top: 20px;
}

.panel {
  padding: 28px;
  border-radius: var(--radius-lg);
}

.panel-heading,
.workspace-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.panel-heading h2,
.workspace-heading h2 {
  margin: 4px 0 0;
  font-size: 25px;
  font-weight: 650;
}

.text-button {
  flex: none;
  padding: 8px 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
}

.level-list {
  display: grid;
  gap: 11px;
  margin-top: 24px;
}

.level-row {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.level-row:hover {
  transform: translateY(-1px);
  border-color: #b8c5ce;
  background: #fafcfd;
}

.level-number {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 700;
}

.level-row.level-1 .level-number { color: #287a56; background: #dcf3e7; }
.level-row.level-2 .level-number { color: #305fad; background: #e6efff; }
.level-row.level-3 .level-number { color: #875318; background: #fff0db; }

.level-info strong,
.level-info span {
  display: block;
}

.level-info strong {
  font-size: 13px;
}

.level-info span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.mini-progress {
  width: 88px;
  height: 6px;
  overflow: hidden;
  margin-top: 9px;
  border-radius: 999px;
  background: #ebeff2;
}

.mini-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--mint-strong);
}

.level-count {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.rule-list {
  padding: 0;
  margin: 23px 0 0;
  list-style: none;
}

.rule-list li {
  display: flex;
  gap: 13px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.rule-list li > span {
  color: var(--mint-strong);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
}

.rule-list strong {
  font-size: 12px;
}

.rule-list p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.warning-note {
  margin-top: 14px;
  padding: 14px 15px;
  border-left: 3px solid var(--amber);
  border-radius: 0 10px 10px 0;
  background: var(--amber-soft);
}

.warning-note strong {
  color: #8c5718;
  font-size: 12px;
}

.warning-note p {
  margin: 4px 0 0;
  color: #765a38;
  font-size: 11px;
  line-height: 1.5;
}

.workspace-heading {
  margin-bottom: 27px;
}

.workspace-heading > div > p {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.compact-filters {
  display: flex;
  gap: 10px;
}

.compact-filters label {
  display: grid;
  gap: 5px;
}

.compact-filters label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

select,
.search-field {
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
}

select {
  min-height: 42px;
  padding: 0 36px 0 12px;
  cursor: pointer;
}

.study-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 24px;
  align-items: start;
}

.flashcard-area {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

.session-progress-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
}

.session-progress {
  background: #dfe5e7;
}

.session-progress span,
.quiz-track span {
  background: var(--blue);
}

.flashcard {
  width: 100%;
  height: 420px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-perspective: 1400px;
  perspective: 1400px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  -webkit-transition: -webkit-transform 550ms cubic-bezier(0.2, 0.7, 0.2, 1);
  transition: transform 550ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}

.flashcard.is-flipped .flashcard-inner {
  -webkit-transform: rotateY(180deg);
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  border: 1px solid rgba(24, 49, 73, 0.08);
  border-radius: 28px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease;
  will-change: transform, opacity;
}

.flashcard-front {
  -webkit-transform: rotateY(0deg) translateZ(1px);
  transform: rotateY(0deg) translateZ(1px);
  opacity: 1;
  color: #f8fbfd;
  background:
    radial-gradient(circle at 84% 16%, rgba(191, 233, 212, 0.18), transparent 24%),
    linear-gradient(145deg, #1b405b, #10283d);
}

.flashcard-front::before,
.flashcard-front::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(191, 233, 212, 0.1);
  border-radius: 50%;
}

.flashcard-front::before { width: 360px; height: 360px; right: -160px; top: -160px; }
.flashcard-front::after { width: 240px; height: 240px; left: -110px; bottom: -130px; }

.flashcard-front strong {
  position: relative;
  z-index: 1;
  margin: 10px 0 15px;
  color: var(--mint);
  font-family: var(--font-sans);
  font-size: clamp(54px, 8vw, 82px);
  font-weight: 600;
  letter-spacing: -0.05em;
}

.flashcard-front p {
  margin: 0;
  color: #bacdd9;
  font-size: 14px;
}

.flip-hint {
  position: absolute;
  bottom: 27px;
  color: #8fa6b5;
  font-size: 11px;
}

.flashcard-back {
  -webkit-transform: rotateY(180deg) translateZ(1px);
  transform: rotateY(180deg) translateZ(1px);
  opacity: 0;
  background: var(--surface);
}

.flashcard.is-flipped .flashcard-front {
  opacity: 0;
  pointer-events: none;
}

.flashcard.is-flipped .flashcard-back {
  opacity: 1;
}

.flashcard-back > strong {
  margin: 7px 0 15px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(35px, 5vw, 52px);
}

.flashcard-back > p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}

.example-box {
  width: min(100%, 560px);
  margin-top: 24px;
  padding: 16px;
  border-radius: 13px;
  background: var(--blue-soft);
  text-align: left;
}

.example-box span {
  color: var(--blue);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.example-box p {
  margin: 5px 0 0;
  color: #315585;
  font-size: 13px;
  line-height: 1.5;
}

.rating-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 13px;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.flashcard.is-flipped + .rating-actions {
  opacity: 1;
  pointer-events: auto;
}

.rating-actions button {
  min-height: 55px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.rating-actions button:hover {
  border-color: #aebbc5;
  background: #fbfcfd;
}

.rating-actions strong,
.rating-actions span {
  display: block;
}

.rating-actions strong {
  font-size: 12px;
}

.rating-actions span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.session-sidebar {
  position: sticky;
  top: 122px;
  padding: 24px;
  border-radius: var(--radius-lg);
}

.session-number {
  margin: 19px 0;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
}

.session-number strong,
.session-number span {
  display: block;
}

.session-number strong {
  font-family: var(--font-sans);
  font-size: 43px;
}

.session-number span {
  color: var(--muted);
  font-size: 11px;
}

.session-metric {
  display: flex;
  justify-content: space-between;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
}

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

.session-sidebar .secondary-button {
  width: 100%;
  margin-top: 13px;
}

.keyboard-hint {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.quiz-shell {
  max-width: 850px;
  margin: 0 auto;
  padding: 26px;
  border-radius: var(--radius-lg);
}

.quiz-topline {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: 11px;
}

.quiz-track {
  background: #e5e9ec;
}

.quiz-card {
  padding: 52px 26px 28px;
  text-align: center;
}

.quiz-card h3 {
  margin: 9px 0 10px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(50px, 8vw, 76px);
  letter-spacing: -0.05em;
}

.quiz-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin: 32px auto 0;
}

.quiz-option {
  position: relative;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fbfcfd;
  cursor: pointer;
  font-weight: 700;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.quiz-option.is-correct {
  border-color: #64b58f;
  color: #256847;
  background: #e4f5ec;
}

.quiz-option.is-wrong {
  border-color: #d78a84;
  color: #97423c;
  background: #fbe9e7;
}

.quiz-feedback {
  min-height: 54px;
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.next-question {
  display: none;
  margin: 0 auto;
  color: #ffffff;
  background: var(--blue);
}

.next-question.is-visible {
  display: inline-flex;
}

.quiz-result {
  padding: 55px 25px;
  text-align: center;
}

.result-score {
  margin-top: 14px;
}

.result-score strong {
  font-family: var(--font-sans);
  font-size: 76px;
  line-height: 1;
}

.result-score span {
  color: var(--muted);
  font-size: 23px;
}

.quiz-result h3 {
  margin: 14px 0 7px;
  font-family: var(--font-sans);
  font-size: 28px;
}

.quiz-result p {
  max-width: 520px;
  margin: 0 auto 24px;
  color: var(--muted);
  line-height: 1.6;
}

.library-heading {
  align-items: flex-end;
}

.library-count {
  text-align: right;
}

.library-count strong,
.library-count span {
  display: block;
}

.library-count strong {
  font-family: var(--font-sans);
  font-size: 40px;
}

.library-count span {
  color: var(--muted);
  font-size: 10px;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.74);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
}

.search-field span {
  color: var(--muted);
  font-size: 19px;
}

.search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-field input::placeholder {
  color: #9da8b1;
}

.library-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 14px 2px 20px;
  color: var(--muted);
  font-size: 10px;
}

.library-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.noun { background: var(--blue); }
.dot.adjective { background: var(--amber); }
.dot.adverb { background: var(--violet); }
.dot.verb { background: var(--mint-strong); }

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

.suffix-card {
  position: relative;
  min-height: 205px;
  display: flex;
  flex-direction: column;
  padding: 19px;
  border: 1px solid rgba(24, 49, 73, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 9px 25px rgba(29, 47, 63, 0.045);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.suffix-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 32px rgba(29, 47, 63, 0.085);
}

.suffix-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.suffix-card h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 27px;
  letter-spacing: -0.03em;
}

.level-chip,
.pos-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.level-chip {
  padding: 5px 8px;
  color: #596873;
  background: #edf1f3;
}

.pos-chip {
  align-self: flex-start;
  margin-top: 15px;
  padding: 5px 9px;
}

.pos-chip.noun { color: #2f5fae; background: var(--blue-soft); }
.pos-chip.adjective { color: #965814; background: var(--amber-soft); }
.pos-chip.adverb { color: #684fa4; background: var(--violet-soft); }
.pos-chip.verb { color: #2e7657; background: #e1f3ea; }
.pos-chip.multi { color: #5a6170; background: #eef0f4; }

.suffix-meaning {
  display: -webkit-box;
  overflow: hidden;
  margin: 13px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.suffix-example {
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: #4c6275;
  font-size: 10px;
  line-height: 1.45;
}

.suffix-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}

.page-ref {
  color: #9aa6af;
  font-size: 9px;
}

.learn-toggle {
  border: 0;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}

.learn-toggle.is-learned {
  color: #287455;
  background: #e3f4eb;
}

.source-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #8c5718;
  background: var(--amber-soft);
  font-size: 9px;
  line-height: 1.45;
}

.load-more {
  display: flex;
  margin: 22px auto 0;
}

.load-more[hidden] {
  display: none;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 55px 20px;
  border: 1px dashed #cbd3d9;
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: 340px;
  padding: 13px 16px;
  border-radius: 12px;
  color: #ffffff;
  background: #183149;
  box-shadow: 0 14px 34px rgba(17, 39, 57, 0.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 200ms ease;
  font-size: 12px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 27, 40, 0.56);
  backdrop-filter: blur(5px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(100%, 430px);
  padding: 32px;
  border-radius: 21px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(8, 25, 38, 0.28);
  text-align: center;
}

.modal-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 50%;
  color: var(--red);
  background: #fbe9e7;
  font-size: 25px;
}

.modal-icon.install {
  color: #246c50;
  background: #e1f3ea;
}

.modal h2 {
  margin: 17px 0 8px;
  font-family: var(--font-sans);
  font-size: 24px;
}

.modal p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 23px;
}

@media (max-width: 1180px) {
  .hero-grid,
  .home-content-grid {
    grid-template-columns: 1fr;
  }

  .daily-card {
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 24px;
  }

  .daily-card-top {
    display: grid;
    gap: 8px;
  }

  .goal-ring {
    width: 105px;
    height: 105px;
    margin: 0;
  }

  .goal-ring::before { width: 82px; height: 82px; }
  .goal-ring strong { font-size: 29px; }

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

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-105%);
    width: 250px;
    transition: transform 220ms ease;
    box-shadow: 20px 0 60px rgba(11, 28, 42, 0.2);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: grid;
    place-items: center;
  }

  .topbar {
    gap: 14px;
    min-height: 82px;
  }

  .topbar > div:nth-child(2) {
    flex: 1;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .study-layout {
    grid-template-columns: 1fr;
  }

  .session-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 13px;
  }

  .session-sidebar .section-kicker,
  .session-sidebar .secondary-button,
  .session-sidebar .keyboard-hint {
    grid-column: 1 / -1;
  }

  .session-number {
    margin: 0;
    padding: 0;
    border: 0;
  }

  .session-metric {
    display: block;
    margin: 0;
  }

  .session-metric strong,
  .session-metric span {
    display: block;
  }

  .session-metric strong {
    margin-top: 6px;
    font-size: 21px;
  }
}

@media (max-width: 700px) {
  .topbar {
    padding: 15px 17px;
  }

  .topbar-actions .reset-button,
  .eyebrow {
    display: none;
  }

  .install-button {
    width: 39px;
    padding: 0;
    justify-content: center;
  }

  .install-button span:last-child {
    display: none;
  }

  main {
    padding: 22px 16px 50px;
  }

  .hero-card {
    min-height: 410px;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 31px 27px 12px;
  }

  .hero-visual {
    min-height: 180px;
  }

  .word-family {
    width: 155px;
    height: 155px;
  }

  .orbit-one { width: 205px; height: 205px; }
  .orbit-two { width: 260px; height: 260px; }

  .daily-card {
    grid-template-columns: 1fr auto;
  }

  .daily-card > p {
    grid-column: 1 / -1;
  }

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

  .panel {
    padding: 22px;
  }

  .workspace-heading {
    display: grid;
  }

  .compact-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .compact-filters select {
    width: 100%;
  }

  .flashcard {
    height: 390px;
  }

  .flashcard-face {
    padding: 30px 23px;
  }

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

  .quiz-shell {
    padding: 18px;
  }

  .quiz-card {
    padding: 42px 2px 18px;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }

  .library-toolbar {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 430px) {
  .topbar h1 {
    font-size: 17px;
  }

  .streak-pill > span:last-child {
    display: none;
  }

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

  .level-row {
    grid-template-columns: 43px 1fr;
  }

  .level-count {
    grid-column: 2;
  }

  .flashcard {
    height: 360px;
  }
}

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