:root {
  --paper: #f6f8f5;
  --surface: #ffffff;
  --ink: #182522;
  --muted: #66736f;
  --line: #dbe2de;
  --line-strong: #bdc9c3;
  --teal: #087e78;
  --teal-dark: #05625d;
  --teal-pale: #e3f2ef;
  --red: #d44b3e;
  --red-pale: #fbeae6;
  --yellow: #f0c84b;
  --yellow-pale: #fff6d8;
  --shadow: 0 18px 45px rgba(24, 37, 34, 0.1);
  --thai: "Noto Sans Thai Looped", "Thonburi", sans-serif;
  --sans: "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(24, 37, 34, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 28px;
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(8, 126, 120, 0.25);
  outline-offset: 2px;
}

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

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

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid rgba(189, 201, 195, 0.75);
  background: rgba(246, 248, 245, 0.94);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 4px;
  background: var(--ink);
  color: white;
  font-family: var(--thai);
  font-size: 24px;
  font-weight: 600;
}

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

.brand strong {
  font-family: var(--thai);
  font-size: 20px;
  font-weight: 600;
}

.brand small {
  margin-top: -3px;
  color: var(--muted);
  font-size: 11px;
}

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

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 600;
}

.button svg,
.icon-button svg,
.search-control svg,
.sort-control svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

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

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

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

.button-secondary:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.practice-launch {
  border-color: #cda92c;
  background: var(--yellow-pale);
  color: #66520f;
}

.account-button.is-synced {
  border-color: var(--teal);
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.auth-modal {
  width: min(520px, calc(100vw - 28px));
}

.auth-copy {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.auth-email {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.auth-email span {
  font-size: 13px;
  font-weight: 600;
}

.auth-email input {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.auth-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--teal-dark);
  font-size: 13px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 20px;
}

.auth-links button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  font-size: 13px;
  text-decoration: underline;
}

.search-band {
  display: grid;
  max-width: 1480px;
  grid-template-columns: minmax(260px, 0.85fr) minmax(350px, 1.45fr) minmax(250px, 0.7fr);
  align-items: end;
  gap: clamp(26px, 4vw, 60px);
  margin: 0 auto;
  padding: clamp(42px, 6vw, 80px) clamp(18px, 4vw, 58px) 42px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-copy h1 {
  margin: 0;
  font-family: var(--thai), var(--sans);
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 500;
  line-height: 1.12;
}

.search-copy > p:last-child {
  max-width: 420px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.search-control {
  display: grid;
  min-height: 62px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-bottom: 3px solid var(--ink);
  border-radius: 5px 5px 2px 2px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(24, 37, 34, 0.06);
}

.search-tools {
  min-width: 0;
}

.speech-settings {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.speech-settings svg {
  width: 15px;
  height: 15px;
  color: var(--teal-dark);
}

.speech-settings select {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
}

.search-control:focus-within {
  border-color: var(--teal);
  border-bottom-color: var(--teal);
  box-shadow: 0 10px 35px rgba(8, 126, 120, 0.12);
}

.search-control input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-control input::placeholder {
  color: #929d99;
}

kbd {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
}

.stat-strip div {
  padding-left: 16px;
  border-left: 1px solid var(--line-strong);
}

.stat-strip dt {
  font-family: var(--thai);
  font-size: 27px;
  font-weight: 600;
}

.stat-strip dd {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.workspace {
  display: grid;
  max-width: 1480px;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 4vw, 54px);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 58px) 90px;
}

.filters {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 112px);
  padding: 30px 10px 30px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.filter-block {
  padding: 0 0 25px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.filter-heading,
.section-heading,
.modal-header,
.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-heading h2 {
  margin: 0 0 12px;
  font-size: 13px;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal-dark);
  font-size: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #edf1ee;
}

.segmented button {
  min-height: 34px;
  padding: 6px 5px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(24, 37, 34, 0.1);
  font-weight: 700;
}

.category-list {
  display: grid;
  gap: 3px;
}

.category-button {
  display: grid;
  min-height: 38px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
}

.category-button span:last-child {
  font-family: var(--thai);
  font-size: 11px;
}

.category-button:hover,
.category-button.is-active {
  border-left-color: var(--teal);
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.source-figure {
  position: relative;
  margin: 30px 0 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
}

.source-figure img {
  display: block;
  width: 100%;
  height: 128px;
  object-fit: cover;
  object-position: top center;
  filter: saturate(0.8) contrast(0.94);
}

.source-figure figcaption {
  display: block;
  padding: 12px;
}

.source-figure strong,
.source-figure span {
  display: block;
}

.source-figure strong {
  font-size: 12px;
}

.source-figure span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.results-area {
  min-width: 0;
}

.initial-index {
  padding: 28px 0 30px;
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.initial-scroll {
  display: flex;
  gap: 7px;
  margin-top: 20px;
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.initial-button {
  display: grid;
  width: 46px;
  height: 52px;
  flex: 0 0 46px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--thai);
  font-size: 23px;
}

.initial-button:hover,
.initial-button.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  transform: translateY(-2px);
}

.roman-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.roman-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.roman-button,
.filter-chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

.roman-button:hover,
.roman-button.is-active {
  border-color: var(--yellow);
  background: var(--yellow-pale);
  color: #6b5716;
}

.result-section {
  padding-top: 34px;
  scroll-margin-top: 92px;
}

.result-heading {
  margin-bottom: 18px;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.sort-control select {
  padding: 7px 28px 7px 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.active-filters {
  display: flex;
  min-height: 0;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-color: #b9d8d4;
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.result-list {
  border-top: 1px solid var(--line-strong);
}

.pagination {
  display: grid;
  min-height: 72px;
  grid-template-columns: 38px minmax(0, auto) auto 38px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-strong);
}

.pagination-arrow,
.pagination-pages button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
}

.pagination-arrow svg {
  width: 18px;
  height: 18px;
}

.pagination-arrow:hover:not(:disabled),
.pagination-pages button:hover,
.pagination-pages button.is-active {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.pagination-pages button.is-active {
  background: var(--teal);
  color: white;
  font-weight: 700;
}

.pagination-arrow:disabled {
  cursor: default;
  opacity: 0.38;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination-ellipsis {
  display: inline-grid;
  width: 24px;
  height: 38px;
  place-items: center;
  color: var(--muted);
}

.page-summary {
  min-width: 86px;
  color: var(--muted);
  font-family: var(--thai);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.entry-row {
  display: grid;
  min-height: 116px;
  grid-template-columns: minmax(230px, 1fr) minmax(220px, 0.9fr) 160px;
  align-items: center;
  gap: 24px;
  padding: 20px 12px 20px 4px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  transition: background 180ms ease, transform 180ms ease;
}

.entry-row:hover {
  z-index: 1;
  background: var(--surface);
  transform: translateX(4px);
  box-shadow: -4px 0 0 var(--teal);
}

.entry-thai-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entry-thai-line h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--thai);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.4;
}

.initial-badge {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  padding: 0 7px;
  border: 1px solid #b9d8d4;
  border-radius: 3px;
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-family: var(--thai);
  font-size: 14px;
}

.entry-pronunciation {
  margin: 5px 0 0;
  color: var(--teal-dark);
  font-family: var(--thai);
  font-size: 16px;
  line-height: 1.5;
}

.entry-pronunciation-line,
.review-pronunciation-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-button {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-color: #b9d8d4;
  color: var(--teal-dark);
}

.audio-button:hover {
  background: var(--teal-pale);
}

.entry-meaning strong,
.category-tag,
.review-state {
  display: block;
}

.entry-meaning strong {
  font-size: 16px;
  line-height: 1.65;
}

.category-tag {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.entry-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.review-state {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.favorite-button.is-active {
  border-color: #e4b83d;
  background: var(--yellow-pale);
  color: #806510;
}

.empty-state {
  padding: 65px 20px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-glyph {
  display: block;
  color: var(--line-strong);
  font-family: var(--thai);
  font-size: 64px;
}

.empty-state h3 {
  margin: 5px 0;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
}

.modal,
.review-modal {
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal {
  width: min(660px, calc(100vw - 30px));
}

.modal::backdrop,
.review-modal::backdrop {
  background: rgba(14, 25, 22, 0.66);
  backdrop-filter: blur(4px);
}

.modal form {
  padding: 26px;
}

.modal-header h2 {
  margin: 0;
  font-size: 25px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 28px 0;
}

.form-grid label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.form-grid input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
}

.modal-actions {
  justify-content: flex-end;
}

.review-modal {
  width: min(760px, calc(100vw - 28px));
}

.review-shell {
  min-height: min(650px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.review-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.review-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 13px;
}

#review-position {
  color: var(--muted);
  font-size: 11px;
}

.review-progress {
  width: min(260px, 34vw);
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.review-progress span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--teal);
  transition: width 250ms ease;
}

.review-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 45px 25px;
  text-align: center;
}

.review-prompt {
  margin: 15px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.review-card > h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 500;
}

.review-answer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  animation: reveal 300ms ease both;
}

.review-thai {
  margin: 0;
  color: var(--teal-dark);
  font-family: var(--thai);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.25;
}

.review-pronunciation {
  margin: 9px 0 0;
  color: var(--muted);
  font-family: var(--thai);
  font-size: 18px;
}

.review-pronunciation-line {
  justify-content: center;
}

.review-footer {
  padding: 22px 24px;
  border-top: 1px solid var(--line);
}

.reveal-button {
  width: 100%;
}

.review-ratings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.review-ratings button {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
}

.review-ratings button:first-child:hover {
  border-color: var(--red);
  background: var(--red-pale);
}

.review-ratings button:nth-child(2):hover {
  border-color: var(--yellow);
  background: var(--yellow-pale);
}

.review-ratings button:last-child:hover {
  border-color: var(--teal);
  background: var(--teal-pale);
}

.review-ratings strong,
.review-ratings span {
  display: block;
}

.practice-modal {
  width: min(820px, calc(100vw - 28px));
}

.practice-shell {
  min-height: min(690px, calc(100vh - 34px));
}

.practice-header-meta,
.practice-kicker,
.practice-prompt-wrap,
.practice-feedback {
  display: flex;
  align-items: center;
}

.practice-header-meta {
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.practice-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 38px clamp(20px, 6vw, 70px);
}

.practice-kicker {
  justify-content: center;
  gap: 8px;
}

.practice-kicker span {
  padding: 5px 9px;
  border: 1px solid #b9d8d4;
  border-radius: 3px;
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 700;
}

.practice-kicker span:last-child {
  border-color: #ead987;
  background: var(--yellow-pale);
  color: #6b5716;
}

.practice-instruction {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.practice-prompt-wrap {
  min-height: 100px;
  justify-content: center;
  gap: 18px;
}

.practice-prompt-wrap h2 {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--thai), var(--sans);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}

.practice-audio {
  display: grid;
  width: 116px;
  min-height: 82px;
  flex: 0 0 66px;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.practice-audio svg {
  width: 29px;
  height: 29px;
}

.practice-audio span {
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 700;
}

.practice-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 26px;
}

.practice-options button {
  display: grid;
  min-width: 0;
  min-height: 72px;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.practice-options button:hover:not(:disabled) {
  border-color: var(--teal);
  background: var(--teal-pale);
  transform: translateY(-1px);
}

.practice-options button span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 11px;
}

.practice-options button strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--thai), var(--sans);
  font-size: 17px;
  font-weight: 600;
}

.practice-options button.is-correct {
  border-color: var(--teal);
  background: var(--teal-pale);
}

.practice-options button.is-wrong {
  border-color: var(--red);
  background: var(--red-pale);
}

.practice-input-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 28px;
}

.practice-input-form input {
  min-width: 0;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-bottom: 3px solid var(--ink);
  border-radius: 5px;
  background: var(--paper);
  font-family: var(--thai);
  font-size: 20px;
}

.practice-feedback {
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  padding: 15px 16px;
  border-left: 4px solid var(--teal);
  background: var(--teal-pale);
}

.practice-feedback.is-wrong {
  border-left-color: var(--red);
  background: var(--red-pale);
}

.practice-feedback p {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: var(--thai), var(--sans);
  font-size: 13px;
  line-height: 1.55;
}

.practice-footer {
  padding: 15px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

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

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

@media (max-width: 1050px) {
  .search-band {
    grid-template-columns: 1fr 1.2fr;
  }

  .stat-strip {
    grid-column: 1 / -1;
    max-width: 500px;
  }

  .workspace {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .entry-row {
    grid-template-columns: minmax(180px, 1fr) minmax(170px, 0.8fr) 110px;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 66px;
    padding: 9px 14px;
  }

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

  .brand small,
  #add-entry-button span {
    display: none;
  }

  .button {
    min-height: 40px;
    padding: 8px 11px;
  }

  .top-actions {
    gap: 6px;
  }

  #start-practice-button,
  #start-review-button {
    font-size: 12px;
  }

  .practice-card {
    padding: 26px 16px;
  }

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

  .practice-feedback {
    align-items: stretch;
    flex-direction: column;
  }

  .search-band {
    display: block;
    padding: 34px 16px 27px;
  }

  .search-copy h1 {
    font-size: 35px;
  }

  .search-control {
    margin-top: 25px;
  }

  .stat-strip {
    margin-top: 25px;
  }

  .workspace {
    display: block;
    padding: 0 16px 70px;
  }

  .filters {
    position: static;
    max-height: none;
    padding: 0;
    overflow: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }

  .filter-block:first-child {
    padding-bottom: 18px;
    margin-bottom: 18px;
  }

  .filter-block:nth-child(2),
  .source-figure {
    display: none;
  }

  .initial-index {
    padding-top: 22px;
  }

  .entry-row {
    min-height: 0;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 18px 4px;
  }

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

  .entry-meaning {
    grid-column: 1;
    grid-row: 2;
  }

  .entry-meta {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .review-state {
    display: none;
  }

  .entry-thai-line h3 {
    font-size: 29px;
  }

  .pagination {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 7px;
  }

  .pagination-pages {
    justify-content: center;
  }

  .pagination-pages button {
    width: 34px;
    height: 36px;
  }

  .pagination-ellipsis {
    width: 16px;
    height: 36px;
  }

  .page-summary {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

  .review-ratings {
    grid-template-columns: 1fr;
  }

  .review-ratings button {
    min-height: 50px;
  }
}

@media (max-width: 430px) {
  #add-entry-button {
    display: none;
  }

  .practice-launch,
  #start-review-button {
    padding-inline: 9px;
  }

  .practice-input-form {
    grid-template-columns: 1fr;
  }
  .top-actions .button-secondary {
    width: 40px;
    padding: 0;
    font-size: 0;
  }

  .top-actions .button-secondary svg {
    width: 18px;
  }

  .top-actions .button-primary {
    padding-inline: 10px;
    font-size: 12px;
  }

  .roman-filter-row {
    display: block;
  }

  .roman-filter {
    margin-top: 8px;
  }
}
