:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --panel: #fffaf1;
  --panel-strong: #ffffff;
  --ink: #18221f;
  --muted: #65706c;
  --line: #ddd4c2;
  --blue: #2468a8;
  --blue-dark: #164773;
  --green: #23745a;
  --red: #b44435;
  --gold: #c68722;
  --shadow: 0 18px 45px rgba(35, 49, 43, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(36, 104, 168, 0.08), transparent 30%),
    linear-gradient(315deg, rgba(35, 116, 90, 0.08), transparent 34%), var(--bg);
  color: var(--ink);
}

body.menu-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.menu-toggle,
.menu-backdrop {
  display: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 24px;
  background: #132723;
  color: #f6f3eb;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f7f2e7;
  color: #145a86;
  font-weight: 900;
}

.brand-title {
  font-size: 1rem;
  font-weight: 800;
}

.brand-subtitle {
  color: #becbc3;
  font-size: 0.86rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #edf4ef;
  text-align: left;
}

.nav-item span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-panel p {
  margin: 8px 0 0;
  color: #ccd8d1;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  line-height: 1.02;
}

.eyebrow,
.small-label {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.streak-box {
  display: grid;
  place-items: center;
  min-width: 76px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.streak-box span {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.streak-box small {
  color: var(--muted);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
}

.progress-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.8fr);
  gap: 22px;
  min-height: 340px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.progress-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 720px;
}

.progress-copy h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 2.05rem);
  line-height: 1.12;
}

.progress-copy p:not(.eyebrow),
.theory-text,
.listen-prompt,
.muted-text {
  color: var(--muted);
  line-height: 1.6;
}

.quick-actions,
.card-actions,
.pronunciation-actions,
.answer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.primary-button,
.secondary-button,
.ghost-button,
.option-button {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

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

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

.secondary-button {
  border-color: #a6c6ba;
  background: #eaf4ee;
  color: #14543e;
}

.ghost-button {
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--ink);
}

.progress-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  overflow: hidden;
  border-radius: 8px;
  background: #0f312e;
}

.aurora-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(110deg, transparent 10%, rgba(95, 187, 133, 0.75) 32%, transparent 56%),
    linear-gradient(145deg, transparent 18%, rgba(70, 144, 204, 0.72) 45%, transparent 68%),
    linear-gradient(#123e47, #0d2526 58%, #102b25);
}

.sun {
  position: absolute;
  right: 22%;
  top: 18%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f6d382;
  box-shadow: 0 0 28px rgba(246, 211, 130, 0.8);
}

.lake {
  position: absolute;
  right: -8%;
  bottom: -16%;
  width: 120%;
  height: 42%;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, rgba(61, 132, 150, 0.7), rgba(26, 73, 78, 0.95));
}

.tree {
  position: absolute;
  bottom: 20%;
  width: 0;
  height: 0;
  border-right: 22px solid transparent;
  border-bottom: 90px solid #071c17;
  border-left: 22px solid transparent;
}

.tree-one {
  left: 14%;
}

.tree-two {
  left: 25%;
  bottom: 16%;
  transform: scale(1.25);
}

.tree-three {
  left: 42%;
  bottom: 18%;
  transform: scale(0.9);
}

.meter {
  position: relative;
  display: grid;
  place-items: center;
  width: min(64%, 230px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(3px);
}

.meter svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.meter circle {
  fill: none;
  stroke-width: 10;
}

.track {
  stroke: rgba(255, 255, 255, 0.22);
}

.fill {
  stroke: #f3cf75;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.3s ease;
}

.meter-value {
  position: absolute;
  display: grid;
  place-items: center;
  color: white;
}

.meter-value strong {
  font-size: 2.15rem;
}

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

.stat-card,
.practice-panel,
.list-panel,
.plan-section,
.reference-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 10px 24px rgba(35, 49, 43, 0.07);
}

.stat-card {
  display: grid;
  gap: 6px;
  min-height: 120px;
  padding: 18px;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
}

.stat-card strong {
  font-size: 2rem;
}

.plan-section {
  padding: 22px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.timeline-card {
  min-height: 172px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
}

.timeline-card strong {
  display: block;
  margin-bottom: 8px;
}

.timeline-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.practice-panel,
.list-panel {
  padding: 24px;
}

.practice-panel {
  min-height: 520px;
}

.large-translation {
  margin: 12px 0 0;
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 900;
}

.example-line {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.answer-row input {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.feedback {
  min-height: 34px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.feedback.good {
  color: var(--green);
}

.feedback.bad {
  color: var(--red);
}

.word-session-stats,
.word-plan {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

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

.word-session-stats span,
.word-plan div {
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
  color: var(--muted);
  font-size: 0.86rem;
}

.word-session-stats strong,
.word-plan strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
}

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

.import-box summary {
  cursor: pointer;
  font-weight: 900;
}

.import-box textarea {
  width: 100%;
  min-height: 150px;
  margin-top: 12px;
  padding: 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: 0.9rem ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.import-box .primary-button {
  width: 100%;
  margin-top: 10px;
}

.topic-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.topic-button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
  text-align: left;
}

.topic-button.active {
  border-color: #8eb5a8;
  background: #edf7f1;
}

.topic-button small {
  color: var(--muted);
}

.quiz-box {
  margin-top: 22px;
}

.quiz-box p {
  font-size: 1.15rem;
  font-weight: 800;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.option-button {
  border-color: var(--line);
  background: #fffaf2;
  color: var(--ink);
  text-align: left;
}

.option-button:hover {
  border-color: #95b5aa;
  background: #eef7f2;
}

.audio-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.control-row {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 800;
}

.focus-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.reference-layout {
  display: grid;
  gap: 18px;
}

.reference-panel {
  padding: 24px;
}

.level-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.level-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
}

.level-card h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.level-card h4 {
  margin: 14px 0 6px;
  font-size: 0.9rem;
}

.level-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.level-card a {
  display: inline-block;
  margin-top: 12px;
  color: var(--blue);
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .menu-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 40;
    display: grid;
    place-items: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: 0 8px 20px rgba(24, 34, 31, 0.14);
  }

  .menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(12, 22, 20, 0.42);
  }

  body.menu-open .menu-backdrop {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 35;
    width: min(82vw, 310px);
    height: 100dvh;
    padding: 64px 16px 16px;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.22);
  }

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

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

  .nav-item {
    justify-content: flex-start;
    font-size: 1rem;
  }

  .sidebar-panel {
    display: none;
  }

  .main {
    padding: 12px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 62px;
    margin: -12px -12px 12px;
    padding: 10px 12px 10px 62px;
    border-bottom: 1px solid var(--line);
    background: rgba(244, 241, 234, 0.95);
    backdrop-filter: blur(10px);
  }

  .topbar h1 {
    font-size: 1.25rem;
    overflow: hidden;
    max-width: 42vw;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .eyebrow {
    display: none;
  }

  .streak-box {
    min-width: 56px;
    height: 42px;
  }

  .streak-box span {
    font-size: 1rem;
  }

  .streak-box small {
    font-size: 0.72rem;
  }

  #resetButton {
    min-height: 36px;
    padding: 7px 10px;
  }

  .progress-band,
  .tool-layout,
  .level-guide {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .topbar {
    align-items: center;
    flex-direction: row;
  }

  .top-actions {
    margin-left: auto;
  }

  .ghost-button,
  .primary-button,
  .secondary-button,
  .option-button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .dashboard-grid {
    gap: 10px;
  }

  .progress-band {
    min-height: 0;
    gap: 12px;
  }

  .progress-copy p:not(.eyebrow) {
    display: none;
  }

  .progress-copy h2 {
    font-size: 1.2rem;
  }

  .quick-actions {
    margin-top: 12px;
  }

  .progress-visual {
    min-height: 145px;
  }

  .meter {
    width: 132px;
  }

  .meter-value strong {
    font-size: 1.35rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(68px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .stat-card {
    min-height: 72px;
    padding: 10px;
  }

  .stat-card strong {
    font-size: 1.15rem;
  }

  .stat-card span,
  .stat-card small {
    font-size: 0.72rem;
  }

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

  .timeline-card {
    min-height: 0;
  }

  .plan-section {
    display: none;
  }

  .tool-layout {
    gap: 10px;
  }

  .practice-panel {
    min-height: 0;
  }

  .section-heading h2 {
    font-size: 1.35rem;
  }

  #wordPrompt {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .large-translation {
    margin-top: 8px;
    font-size: 1rem;
  }

  .example-line {
    min-height: 24px;
    margin-top: 8px;
    font-size: 0.95rem;
  }

  .answer-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 12px;
  }

  .answer-row input {
    min-width: 0;
    min-height: 42px;
  }

  .feedback {
    min-height: 28px;
    margin-top: 8px;
    font-size: 0.9rem;
  }

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

  .word-session-stats span,
  .word-plan div {
    min-height: 48px;
    padding: 7px;
    font-size: 0.7rem;
  }

  .word-session-stats strong,
  .word-plan strong {
    font-size: 1rem;
  }

  .card-actions {
    margin-top: 8px;
  }

  .card-actions .ghost-button {
    width: 100%;
  }

  .list-panel {
    max-height: 42dvh;
    overflow: auto;
  }

  .word-plan {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
  }

  .topic-list {
    gap: 6px;
  }

  .topic-button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .option-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quiz-box {
    margin-top: 12px;
  }

  .quiz-box p,
  .theory-text,
  .listen-prompt,
  .muted-text,
  .focus-list {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .progress-band,
  .practice-panel,
  .list-panel,
  .plan-section {
    padding: 12px;
  }
}


.study-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.today-study-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.today-study-summary.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.today-study-summary div,
.study-result-grid div {
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
}

.today-study-summary strong,
.study-result-grid strong {
  display: block;
  color: var(--ink);
  font-size: 1.45rem;
}

.today-study-summary span,
.study-result-grid span {
  color: var(--muted);
  font-size: 0.82rem;
}

.study-card {
  display: flex;
  flex-direction: column;
}

.study-progress-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.study-progress-row h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 2.05rem);
}

.study-progress-row > strong {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
  white-space: nowrap;
}

.study-idle,
.study-exercise,
.study-finished {
  margin-top: 28px;
}

.study-idle .primary-button,
.study-finished .primary-button {
  margin-top: 18px;
}

.study-type {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eaf4ee;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.study-exercise h3,
.study-finished h3 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
}

.study-exercise .audio-button {
  margin-top: 16px;
}

.study-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

@media (max-width: 980px) {
  .study-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .today-study-summary {
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    gap: 6px;
    overflow-x: auto;
  }

  .today-study-summary.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }

  .today-study-summary div,
  .study-result-grid div {
    min-height: 52px;
    padding: 7px;
  }

  .today-study-summary strong,
  .study-result-grid strong {
    font-size: 1rem;
  }

  .today-study-summary span,
  .study-result-grid span {
    font-size: 0.7rem;
  }

  .study-layout {
    gap: 10px;
  }

  .study-card {
    min-height: 0;
  }

  .study-idle,
  .study-exercise,
  .study-finished {
    margin-top: 18px;
  }

  .study-exercise h3,
  .study-finished h3 {
    font-size: 2rem;
  }

  .study-progress-row > strong {
    font-size: 0.85rem;
  }
}


.study-translation {
  margin: 10px 0 0;
  color: var(--green);
  font-weight: 800;
}


.study-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.study-rating-row span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

#studyHardToggle.active,
#studyHardToggle[aria-pressed="true"] {
  border-color: #c89a45;
  background: #fff3d8;
  color: #805a17;
}

.study-stats-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.study-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.study-mini-stats div {
  min-height: 62px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
}

.study-mini-stats strong {
  display: block;
  font-size: 1.2rem;
}

.study-mini-stats span {
  color: var(--muted);
  font-size: 0.75rem;
}

.weak-words {
  margin-top: 18px;
}

.weak-words > strong {
  display: block;
  margin-bottom: 8px;
}

.weak-word-list {
  display: grid;
  gap: 7px;
}

.weak-word-item {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
}

.weak-word-item > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.weak-word-item span,
.weak-word-item small {
  color: var(--muted);
  font-size: 0.78rem;
}

.weak-word-item small {
  display: block;
}

@media (max-width: 620px) {
  .study-rating-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .study-rating-row .ghost-button {
    width: 100%;
  }

  .study-stats-panel {
    margin-top: 16px;
    padding-top: 14px;
  }
}


.study-word-reveal {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 2px;
  padding: 3px 8px;
  border: 1px dashed #9aa9a3;
  border-radius: 7px;
  background: #f7f4ec;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  vertical-align: baseline;
}

.study-word-reveal:hover {
  border-color: var(--green);
  color: var(--green);
}

.study-word-reveal.revealed {
  border-style: solid;
  border-color: #a6c6ba;
  background: #eaf4ee;
  color: var(--green);
  cursor: default;
}


.recent-sessions {
  margin-top: 18px;
}

.recent-sessions > strong {
  display: block;
  margin-bottom: 8px;
}

.recent-session-list {
  display: grid;
  gap: 7px;
}

.recent-session-item {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
}

.recent-session-item > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.recent-session-item span,
.recent-session-item small {
  color: var(--muted);
  font-size: 0.78rem;
}


.morphology-layout {
  align-items: start;
}

.morphology-practice {
  min-height: 560px;
}

.morphology-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.morphology-mode-switch .active {
  box-shadow: inset 0 0 0 1px rgba(35, 116, 90, 0.15);
}

.morphology-exercise-card {
  margin-top: 28px;
}

.morphology-exercise-card h3 {
  margin: 6px 0 0;
  font-size: clamp(2.3rem, 7vw, 4.6rem);
  line-height: 1;
}

.morphology-hint {
  margin: 12px 0 0;
  color: var(--green);
  font-size: 1rem;
  font-weight: 800;
}

.morphology-explanation {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: #fff7e7;
  color: #5f4b27;
  line-height: 1.5;
}

.morphology-browser {
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.morphology-word-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.morphology-word-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
  text-align: left;
}

.morphology-word-button:hover,
.morphology-word-button.active {
  border-color: #8eb5a8;
  background: #edf7f1;
}

.morphology-word-button span {
  display: grid;
  gap: 2px;
}

.morphology-word-button small {
  color: var(--muted);
}

.morphology-word-button em {
  min-width: 28px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #eaf4ee;
  color: var(--green);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.morphology-forms {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.morphology-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid #ece5d8;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.morphology-form-row:hover strong {
  color: var(--blue);
}

.morphology-form-row span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: lowercase;
}

.morphology-form-row strong {
  font-size: 1.02rem;
}

.morphology-form-note {
  margin: -1px 0 5px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .morphology-browser {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .morphology-practice {
    min-height: 0;
  }

  .morphology-exercise-card {
    margin-top: 18px;
  }

  .morphology-exercise-card h3 {
    font-size: clamp(2.2rem, 14vw, 3.6rem);
  }

  .morphology-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .morphology-mode-switch button {
    width: 100%;
  }

  .morphology-browser {
    max-height: 48dvh;
  }
}


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

.morphology-stats div {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ef;
}

.morphology-stats strong {
  display: block;
  font-size: 1.15rem;
}

.morphology-stats span {
  color: var(--muted);
  font-size: 0.75rem;
}

.morphology-weak {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.morphology-weak-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
  text-align: left;
}

.morphology-weak-item:hover {
  border-color: #8eb5a8;
  background: #edf7f1;
}

.morphology-weak-item small {
  color: var(--muted);
  white-space: nowrap;
}
