:root {
  color-scheme: light;
  --bg: #faf9f6;
  --surface: #fff;
  --surface2: #f3f1ed;
  --ink: #292735;
  --muted: #72717b;
  --line: #e7e4e0;
  --accent: #6853a4;
  --accent-soft: #eee9f7;
  --button-ink: #fff;
  --green: #38715f;
  --green-soft: #ecf4ee;
  --latin: #a36546;
  --latin-soft: #f8eee6;
  --blue: #4e749a;
  --shadow: 0 6px 26px #302d4210;
  --radius: 16px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #19191f;
  --surface: #23232c;
  --surface2: #2c2b35;
  --ink: #eeecf4;
  --muted: #b6b3c1;
  --line: #3e3b48;
  --accent: #c3b0fa;
  --accent-soft: #383048;
  --button-ink: #211b31;
  --green: #9ad6bd;
  --green-soft: #263d33;
  --latin: #e8b598;
  --latin-soft: #443229;
  --blue: #a9c9ec;
  --shadow: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
button {
  border: 0;
  background: none;
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.serif {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}
h1 {
  font-size: 42px;
  letter-spacing: -1.2px;
  line-height: 1.2;
}
h2 {
  font-size: 25px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 21px;
}
p {
  color: var(--muted);
}
small {
  font-size: 12px;
}
.sidebar {
  width: 238px;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 36px 22px 25px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: Georgia, serif;
  font-size: 21px;
  white-space: nowrap;
}
.brand-icon {
  width: 41px;
  height: 46px;
  display: grid;
  place-content: center;
  background: var(--accent);
  color: var(--surface);
  border-radius: 12px;
  font-size: 45px;
  line-height: 1;
  position: relative;
}
.brand-icon span {
  position: absolute;
  font-size: 30px;
  right: 4px;
  bottom: 1px;
  color: #d8cafa;
}
.brand small {
  font:
    9px -apple-system,
    sans-serif;
  display: block;
  letter-spacing: 2.8px;
  color: var(--muted);
  margin-top: 3px;
}
.nav-label,
.eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.8px;
}
.nav-label {
  color: var(--muted);
  margin: 52px 12px 14px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
nav a {
  padding: 12px 15px;
  border-radius: 9px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  align-items: center;
  font-weight: 500;
}
nav a > span {
  font-size: 24px;
  width: 25px;
  line-height: 1;
  text-align: center;
}
nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}
nav a:hover {
  background: var(--surface2);
}
.sidebar-note {
  margin: 48px 10px 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.sidebar-note .eyebrow {
  font-size: 9px;
  color: var(--muted);
}
.sidebar-note p {
  font:
    23px/1.45 Georgia,
    serif;
  color: var(--ink);
  margin: 12px 0 18px;
}
.sidebar-note a {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 13px;
  color: var(--muted);
}
.sidebar-bottom a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
}
.version {
  font-size: 10px;
  display: block;
  margin: 14px 12px 0;
}
.app-body {
  margin-left: 238px;
}
.topbar {
  height: 80px;
  padding: 0 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.topbar > div {
  display: flex;
  gap: 20px;
  align-items: center;
}
.local-label {
  font-size: 12px;
  color: var(--muted);
}
.circle-link {
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 22px;
}
main {
  padding: 42px 48px;
  max-width: 1450px;
  margin: auto;
  min-height: calc(100vh - 146px);
}
footer {
  max-width: 1354px;
  margin: 0 48px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
footer span {
  letter-spacing: 0;
  font-size: 11px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 30px;
  gap: 20px;
}
.page-head p {
  margin-top: 10px;
  font-size: 14px;
}
.page-head .eyebrow {
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}
.pill {
  font-size: 11px;
  border-radius: 20px;
  padding: 6px 12px;
  background: var(--surface2);
  color: var(--muted);
  white-space: nowrap;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 5px #302d4203;
}
.searchbox > span {
  font-size: 28px;
  color: var(--accent);
  line-height: 1;
}
.searchbox input {
  border: 0;
  background: none;
  outline: none;
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-size: 16px;
}
.keycap {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--muted);
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 17px 0 28px;
  align-items: center;
}
.filter {
  font-size: 12px;
  padding: 7px 16px;
  border-radius: 7px;
  border: 1px solid transparent;
  color: var(--muted);
}
.filter.selected {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 15%, transparent);
}
.filters .hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(270px, 1fr);
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.daily-card {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 15%, var(--line));
  position: relative;
  overflow: hidden;
  min-height: 268px;
  display: flex;
  flex-direction: column;
  align-items: start;
}
.daily-card .eyebrow {
  color: var(--green);
  display: flex;
  gap: 9px;
  align-items: center;
}
.daily-word {
  font-size: 46px;
  color: var(--green);
  letter-spacing: -1px;
  margin: 19px 0 2px;
  position: relative;
  z-index: 1;
  overflow-wrap: anywhere;
}
.daily-card > p {
  font-size: 14px;
  max-width: 82%;
  color: var(--green);
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.daily-card .btn-link {
  margin-top: auto;
  padding-top: 22px;
  position: relative;
  z-index: 1;
  color: var(--green);
}
.daily-art {
  position: absolute;
  right: -18px;
  bottom: -28px;
  font:
    200px Georgia,
    serif;
  color: var(--green);
  opacity: 0.07;
  transform: rotate(-15deg);
  pointer-events: none;
}
.btn-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}
.btn-link span {
  margin-left: 8px;
}
.study-teaser {
  display: flex;
  flex-direction: column;
  align-items: start;
}
.small-icon {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 25px;
  margin-bottom: 20px;
}
.study-teaser p {
  font-size: 13px;
  margin: 8px 0 20px;
}
.study-teaser .button {
  margin-top: auto;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--button-ink);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 17px;
  font-size: 13px;
  font-weight: 600;
  min-height: 42px;
}
.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.button.ghost {
  background: var(--accent-soft);
  color: var(--accent);
}
.button.green {
  background: var(--green);
  color: var(--surface);
}
.button.danger {
  background: var(--latin-soft);
  color: var(--latin);
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 31px 0 15px;
}
.section-title h2 {
  font-size: 23px;
}
.section-title > span {
  font-size: 11px;
  color: var(--muted);
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.quick-card {
  padding: 21px;
  transition:
    transform 0.15s,
    border-color 0.15s;
}
.quick-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.quick-card .eyebrow {
  color: var(--muted);
  font-size: 9px;
}
.quick-card h3 {
  font-size: 24px;
  margin: 11px 0 5px;
}
.quick-card p {
  font-size: 12px;
}
.quick-card .arrow {
  float: right;
  margin-top: 8px;
  color: var(--accent);
}
.bottom-strip {
  margin-top: 27px;
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--accent-soft);
  padding: 18px 22px;
  border-radius: 12px;
}
.bottom-strip > span {
  font-size: 24px;
  color: var(--accent);
}
.bottom-strip h3 {
  font:
    500 13px -apple-system,
    sans-serif;
}
.bottom-strip p {
  font-size: 12px;
  margin-top: 4px;
}
.bottom-strip .btn-link {
  margin-left: auto;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--surface2);
  color: var(--muted);
  border-radius: 5px;
  padding: 4px 7px;
}
.badge.grc {
  background: var(--green-soft);
  color: var(--green);
}
.badge.la {
  background: var(--latin-soft);
  color: var(--latin);
}
.badge.en {
  background: var(--accent-soft);
  color: var(--accent);
}
.results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 11px;
}
.result:hover {
  border-color: var(--accent);
}
.result .headword {
  font:
    23px Georgia,
    serif;
}
.result .result-text {
  flex: 1;
  min-width: 0;
}
.result p {
  font-size: 13px;
  margin-top: 3px;
}
.result .parse {
  font-size: 11px;
  color: var(--accent);
}
.result .arrow {
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 50px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.empty h2 {
  margin-bottom: 9px;
}
.empty p {
  margin-bottom: 16px;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.back {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
  display: inline-block;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr);
  gap: 24px;
  align-items: start;
}
.detail-title {
  font-size: 52px;
  overflow-wrap: anywhere;
  margin: 12px 0;
}
.detail-lead {
  font-size: 18px;
  margin: 16px 0 22px;
  color: var(--ink);
  line-height: 1.6;
}
.subtle {
  color: var(--muted);
  font-size: 13px;
}
.chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.root-chip {
  display: inline-flex;
  flex-direction: column;
  background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green) 18%, transparent);
  border-radius: 12px;
  padding: 14px 22px;
  color: var(--green);
}
.root-chip.la {
  background: var(--latin-soft);
  color: var(--latin);
  border-color: color-mix(in srgb, var(--latin) 18%, transparent);
}
.root-chip strong {
  font:
    27px Georgia,
    serif;
}
.root-chip span {
  font-size: 11px;
  max-width: 180px;
}
.flow-plus {
  color: var(--muted);
  font-size: 22px;
}
.journey {
  margin: 18px 0 0;
  border-left: 1px solid var(--line);
  padding-left: 22px;
}
.journey-step {
  padding: 0 0 23px;
  position: relative;
}
.journey-step:before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: -27px;
  top: 8px;
  border: 2px solid var(--surface);
}
.journey-step h3 {
  display: inline;
  margin-left: 7px;
  font-size: 22px;
}
.journey-step p {
  font-size: 13px;
  margin-top: 6px;
}
.word-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.word-links a {
  font-size: 13px;
  padding: 7px 12px;
  background: var(--surface2);
  border-radius: 6px;
}
.word-links a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.detail-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-aside p {
  font-size: 13px;
  margin: 10px 0;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.roots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.root-tile h3 {
  font-size: 30px;
  margin: 14px 0 4px;
  color: var(--green);
}
.root-tile.la h3 {
  color: var(--latin);
}
.root-tile p {
  font-size: 13px;
}
.root-tile small {
  display: block;
  color: var(--muted);
  margin-top: 14px;
}
select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  max-width: 100%;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  padding: 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stat strong {
  font:
    32px Georgia,
    serif;
  color: var(--accent);
  display: block;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.deck {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.deck .toolbar {
  margin: 4px 0 0;
}
.deck p {
  font-size: 13px;
}
.path-card {
  padding: 23px;
}
.path-card p {
  font-size: 13px;
  margin: 8px 0 16px;
}
.lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  gap: 10px;
}
.lesson-row span {
  color: var(--muted);
  font-size: 12px;
}
.progress {
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
  margin: 15px 0;
}
.paradigm-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.paradigm-row {
  display: flex;
  gap: 18px;
  align-items: center;
}
.paradigm-row h3 {
  min-width: 65px;
  color: var(--green);
}
.paradigm-row p {
  font-size: 12px;
}
.table-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: var(--surface);
}
th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface2);
}
td {
  font:
    24px Georgia,
    serif;
  color: var(--green);
}
td:first-child {
  font:
    12px -apple-system,
    sans-serif;
  color: var(--muted);
}
tr:last-child td {
  border-bottom: 0;
}
.cell-reveal {
  font: inherit;
  color: inherit;
  min-width: 60px;
  min-height: 32px;
}
.form-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.form-list > div {
  padding: 12px;
  background: var(--surface2);
  border-radius: 7px;
}
.form-list strong {
  font:
    20px Georgia,
    serif;
  display: block;
}
.form-list span {
  font-size: 11px;
  color: var(--muted);
}
dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  width: min(630px, calc(100vw - 28px));
  max-height: 90dvh;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 120px #0005;
}
dialog::backdrop {
  background: #19132288;
  backdrop-filter: blur(4px);
}
#modal-content {
  padding: 30px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.modal-head h2 {
  font-size: 22px;
}
.close {
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 20px;
}
.flashcard {
  text-align: center;
  padding: 35px 15px 26px;
  min-height: 290px;
}
.flashcard h2 {
  font-size: 45px;
  margin: 22px 0 14px;
  overflow-wrap: anywhere;
}
.flashcard .answer {
  color: var(--green);
  font:
    25px/1.5 Georgia,
    serif;
  margin: 25px 0 12px;
}
.flashcard p {
  max-width: 480px;
  margin: 10px auto;
}
.grade-buttons {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin-top: 20px;
}
.grade-buttons .button {
  flex: 1;
}
.choice {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px 17px;
  margin-top: 10px;
}
.choice:hover {
  background: var(--accent-soft);
}
.choice.correct {
  border-color: var(--green);
  background: var(--green-soft);
}
.choice.wrong {
  border-color: var(--latin);
  background: var(--latin-soft);
}
.feedback-box {
  padding: 17px;
  border-radius: 10px;
  background: var(--surface2);
  margin: 16px 0;
  font-size: 14px;
}
.lesson-concept {
  padding: 20px 0;
}
.lesson-concept h2 {
  font-size: 45px;
  color: var(--green);
  margin: 14px 0;
}
.lesson-concept p {
  margin: 13px 0;
  color: var(--ink);
}
.lesson-concept .example {
  background: var(--surface2);
  padding: 17px;
  border-radius: 12px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-child {
  border: 0;
}
.settings-row p {
  font-size: 13px;
  margin-top: 4px;
}
.settings-row h3 {
  font:
    600 14px -apple-system,
    sans-serif;
}
.preview {
  background: var(--surface2);
  padding: 22px;
  border-radius: 10px;
  margin-top: 20px;
  font:
    25px Georgia,
    serif;
}
.preview span {
  margin-right: 20px;
}
textarea {
  width: 100%;
  min-height: 140px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  margin: 14px 0;
}
label {
  font-size: 13px;
}
.loading {
  padding: 70px;
  text-align: center;
  color: var(--muted);
}
.error {
  padding: 24px;
  border: 1px solid var(--latin);
  border-radius: 12px;
  background: var(--latin-soft);
}
.error p {
  color: var(--ink);
  margin: 10px 0;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px 20px;
  z-index: 100;
  max-width: 90vw;
  font-size: 13px;
  display: none;
}
#toast.visible {
  display: block;
}
.skip {
  position: fixed;
  left: 10px;
  top: -100px;
  z-index: 200;
  padding: 12px;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.skip:focus {
  top: 10px;
}
.note {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.space-top {
  margin-top: 24px;
}
.full-width {
  width: 100%;
}
.language-la {
  color: var(--latin);
}
.language-grc {
  color: var(--green);
}
.language-en {
  color: var(--accent);
}
.onboard p {
  margin: 14px 0;
}
.onboard h2 {
  font-size: 32px;
}
.onboard .toolbar {
  margin-top: 22px;
  margin-bottom: 0;
}
@media (min-width: 1500px) {
  main {
    padding-top: 54px;
  }
  .home-grid {
    grid-template-columns: 1.8fr 1fr;
  }
  .daily-card {
    min-height: 290px;
  }
}
@media (max-width: 1120px) {
  .sidebar {
    width: 205px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .brand {
    font-size: 18px;
  }
  .app-body {
    margin-left: 205px;
  }
  .topbar {
    padding: 0 30px;
  }
  main {
    padding: 30px;
  }
  .home-grid {
    grid-template-columns: 1.35fr 1fr;
  }
  .quick-grid,
  .roots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-grid .quick-card:last-child {
    grid-column: 1/-1;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  h1 {
    font-size: 36px;
  }
  .daily-word {
    font-size: 39px;
  }
  .card {
    padding: 23px;
  }
  footer {
    margin: 0 30px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: 75px;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
  }
  .brand,
  .nav-label,
  .sidebar-note,
  .sidebar-bottom {
    display: none;
  }
  nav {
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
  }
  nav a {
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
    padding: 7px 13px;
    border-radius: 9px;
  }
  nav a > span {
    font-size: 22px;
  }
  .app-body {
    margin: 0;
    padding-bottom: 75px;
  }
  .topbar {
    height: 62px;
    padding: 0 22px;
  }
  .local-label {
    display: none;
  }
  main {
    padding: 28px 21px;
    min-height: calc(100vh - 195px);
  }
  h1 {
    font-size: 34px;
  }
  .page-head {
    align-items: start;
    margin-bottom: 25px;
  }
  .page-head > .pill {
    display: none;
  }
  .page-head p {
    font-size: 13px;
  }
  .home-grid {
    grid-template-columns: 1fr;
  }
  .daily-card {
    min-height: 260px;
  }
  .study-teaser {
    display: flex;
    gap: 12px;
  }
  .study-teaser .small-icon {
    display: none;
  }
  .study-teaser p {
    margin-bottom: 0;
  }
  .study-teaser .button {
    align-self: flex-start;
    margin-top: 3px;
  }
  .study-teaser h2 {
    font-size: 22px;
  }
  .quick-grid,
  .roots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  .quick-card {
    padding: 17px;
  }
  .quick-card h3 {
    font-size: 24px;
  }
  .bottom-strip {
    align-items: start;
  }
  .bottom-strip .btn-link {
    display: none;
  }
  .filters {
    gap: 2px;
  }
  .filter {
    padding: 7px 11px;
  }
  .filters .hint {
    display: none;
  }
  .searchbox {
    padding: 14px;
  }
  .keycap {
    display: none;
  }
  .detail-title {
    font-size: 43px;
  }
  .detail-aside {
    display: flex;
  }
  .paradigm-list {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 9px;
  }
  .stat {
    padding: 15px;
  }
  .stat strong {
    font-size: 27px;
  }
  .stat span {
    font-size: 11px;
  }
  .card {
    padding: 21px;
  }
  .root-tile {
    padding: 18px;
  }
  .root-tile h3 {
    font-size: 28px;
  }
  .detail-grid {
    gap: 18px;
  }
  .form-list {
    grid-template-columns: 1fr;
  }
  th,
  td {
    padding: 12px;
    font-size: 21px;
  }
  th {
    font-size: 11px;
  }
  #modal-content {
    padding: 23px;
  }
  .flashcard {
    padding: 20px 0;
    min-height: 260px;
  }
  .flashcard h2 {
    font-size: 36px;
  }
  .grade-buttons {
    flex-wrap: wrap;
  }
  .settings-row {
    align-items: start;
  }
  .result {
    padding: 15px;
    gap: 10px;
  }
  .result .headword {
    font-size: 22px;
  }
  footer {
    margin: 0 21px;
  }
  .toolbar {
    gap: 8px;
  }
  .button {
    padding: 10px 13px;
  }
  .flashcard .button {
    margin-top: 10px;
  }
  .roots-grid .root-tile p {
    font-size: 12px;
  }
  #toast {
    bottom: 90px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Route changes move keyboard focus to main without outlining the whole page. */
main:focus { outline: none; }

/* iOS promotion uses the app's original icon and an authentic screen capture. */
.ios-header-link { color: var(--accent); font-weight: 600; }
.ios-promo { max-width: 1354px; margin: 32px 48px 0; padding: 36px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 36px; align-items: center; background: var(--accent-soft); border: 1px solid var(--line); border-radius: 24px; }
.ios-promo[hidden] { display: none; }
.ios-promo { position: relative; }
.ios-promo-dismiss { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; font-size: 26px; line-height: 1; color: var(--ink); }
.ios-promo-dismiss:hover { background: var(--surface); }
.ios-sidebar-link { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); font-size: 13px; font-weight: 600; }
.ios-sidebar-link[hidden] { display: none; }
.ios-sidebar-link:hover { background: var(--accent-soft); }
@media (min-width: 761px) { .ios-promo-dismissed .ios-header-link { display: none; } }
@media (max-width: 760px) { .ios-sidebar-link { display: none; } }
.ios-app-identity { display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: 1.5px; font-weight: 600; }
.ios-app-identity img { border-radius: 13px; }
.ios-app-identity small { display: block; margin-top: 3px; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.ios-promo h2 { margin: 22px 0 14px; font-size: clamp(30px, 3.1vw, 46px); line-height: 1.12; letter-spacing: -1px; }
.ios-promo-copy > p { max-width: 55ch; color: var(--ink); }
.ios-benefits { padding-left: 20px; margin: 18px 0 22px; line-height: 1.85; font-size: 14px; }
.ios-promo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.ios-download { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 48px; padding: 12px 18px; border-radius: 10px; background: #292735; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none !important; }
.ios-download:hover { background: #49386d; }
.ios-promo-actions button { padding: 10px 0; text-decoration: underline; text-underline-offset: 4px; font-size: 13px; }
.ios-promo-copy > .ios-requirements { margin-top: 12px; font-size: 12px; color: var(--muted); }
.ios-app-preview { margin: 0; text-align: center; }
.ios-app-preview img { width: 100%; height: auto; display: block; border: 5px solid #292735; border-radius: 30px; box-shadow: 0 12px 24px #302d4225; }
.ios-app-preview figcaption { margin-top: 12px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.ios-reference-promo { margin-top: 40px; padding: 24px; border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--line); }
.ios-reference-promo h2 { margin: 0 0 8px; font-size: 26px; }
.ios-reference-promo p { margin: 0 0 18px; }
.study-language { display: flex; gap: 8px; margin-bottom: 24px; }
.study-language .button { min-width: 120px; }
.reference-practice { margin-bottom: 32px; }
.reference-practice h2 { margin-bottom: 8px; }
.study-topic-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.study-topic-section h2 { margin-bottom: 16px; font-family: inherit; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.study-topics { display: grid; gap: 10px; }
.study-topic { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: 15px; min-height: 64px; }
.study-topic > span:last-child { margin-left: auto; }
.study-topic:hover, .term-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.topic-symbol { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); border-radius: 50%; font-family: Georgia, serif; }
.reference-controls { display: flex; flex-wrap: wrap; gap: 18px; margin: 20px 0; }
.reference-select { display: grid; gap: 6px; flex: 1; min-width: 180px; font-size: 12px; font-weight: 600; }
.reference-select select { min-height: 44px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 15px; }
.reference-search { margin: 20px 0; }
.reference-sources { margin-top: 28px; color: var(--muted); }
.reference-sources summary { cursor: pointer; padding: 12px 0; }
.reference-sources a { color: var(--accent); text-decoration: underline; }
.quick-table { margin: 16px 0; }
.quick-table h2 { margin-bottom: 18px; }
.quick-table th[scope="row"] { text-align: left; font-size: 15px; }
.quick-table td { font-size: 15px; white-space: normal; }
.quick-table .table-wrap { margin-top: 12px; }
.terminology-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.terminology-category { display: grid; gap: 12px; }
.terminology-category:hover { border-color: var(--accent); }
.terminology-symbol { display: grid; place-items: center; height: 120px; background: var(--surface2); color: var(--accent); border-radius: 12px; font-size: 70px; font-family: Georgia, serif; }
.term-list { display: grid; gap: 10px; margin-top: 18px; }
.term-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.term-row > span:first-child { flex: 1; }
.term-row strong { font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.term-row > span:first-child > span { display: block; color: var(--muted); margin-top: 3px; }
.terminology-sources { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 20px; }
.terminology-sources a { display: grid; gap: 8px; padding: 16px; background: var(--surface2); border-radius: 12px; }
.terminology-sources strong { font-family: Georgia, serif; font-size: 25px; }
.terminology-breakdown { margin-top: 16px; padding: 12px; background: var(--accent-soft); color: var(--ink); border-radius: 8px; }
.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; }
@media (max-width: 760px) { .study-topic-columns { grid-template-columns: 1fr; gap: 28px; } .terminology-grid { gap: 12px; } .terminology-category { padding: 16px; } .terminology-symbol { height: 90px; font-size: 50px; } .term-row { padding: 14px; } .term-row > .subtle { display: none; } .sidebar nav a { flex: 1; padding: 7px 4px; font-size: 10px; } .reference-select { min-width: 100%; } .page-head { flex-wrap: wrap; gap: 18px; } .quick-table { padding: 14px; } }
@media (max-width: 1120px) { .ios-promo { margin: 24px 28px 0; padding: 28px; grid-template-columns: minmax(0, 1fr) 170px; gap: 24px; } }
@media (max-width: 760px) { .ios-promo { margin: 18px 20px 0; padding: 24px; grid-template-columns: 1fr; } .ios-app-preview { display: none; } .ios-promo h2 { font-size: 34px; } .ios-promo-actions { align-items: stretch; flex-direction: column; gap: 6px; } .ios-promo-actions button { text-align: left; } .ios-benefits { font-size: 13px; } .ios-header-link { font-size: 12px; } }
