/* LINGORA — Webview design layer: tokens, text styles, shell, home, dashboard, learning.
   Loaded last. Colours keep the Lingora blue and orange. */

:root {
  --wv-bg: #FAFCF9;
  --wv-surface: #FFFFFF;
  --wv-surface-2: #F4F8F1;
  --wv-line: #E5EFDF;
  --wv-text: #325021;
  --wv-muted: #637E54;
  --wv-primary: #558837;
  --wv-primary-hover: #47722F;
  --wv-primary-soft: #F4F8F1;
  --wv-link: #558837;
  --wv-accent: #F39A38;
  --wv-accent-ink: #8F4E06;
  --wv-accent-soft: #FFF3E2;
  --wv-ok: #1F7A63;
  --wv-ok-soft: #E4F5F0;
  --wv-err: #B5353F;
  --wv-err-soft: #FCECEE;
  --wv-shadow: 0 8px 24px rgba(50, 80, 33, 0.12);
  --wv-font: 'Manrope', 'Noto Sans Thai', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', sans-serif;
  --wv-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wv-topbar: 56px;
  --wv-tabbar: 64px;
  --wv-rail: 248px;
}

html[data-theme='dark'] {
  --wv-bg: #181818;
  --wv-surface: #1F1F1F;
  --wv-surface-2: #272727;
  --wv-line: #313131;
  --wv-text: #F5F9F2;
  --wv-muted: #B2C2A9;
  --wv-primary: #64A042;
  --wv-primary-hover: #71B54A;
  --wv-primary-soft: #272727;
  --wv-link: #BAD6A9;
  --wv-accent-ink: #F6B56C;
  --wv-accent-soft: #272727;
  --wv-ok: #5CC9AD;
  --wv-ok-soft: #272727;
  --wv-err: #F0838C;
  --wv-err-soft: #272727;
  --wv-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Text styles. Line heights are looser than the Latin defaults because Thai stacks
   vowels and tone marks above and below the line. */
.heading-4 { font-size: 30px; line-height: 40px; font-weight: 600; }
.heading-5 { font-size: 24px; line-height: 32px; font-weight: 600; }
.heading-6 { font-size: 20px; line-height: 28px; font-weight: 600; }
.title-2 { font-size: 18px; line-height: 28px; font-weight: 500; }
.title-3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.title-4 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-2 { font-size: 16px; line-height: 24px; font-weight: 500; }
.body-3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-5 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-6 { font-size: 14px; line-height: 20px; font-weight: 400; }
.button-md { font-size: 16px; line-height: 24px; font-weight: 600; }
.button-sm { font-size: 14px; line-height: 20px; font-weight: 600; }
.caption-1 { font-size: 14px; line-height: 20px; font-weight: 500; }
.caption-2 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-3 { font-size: 12px; line-height: 16px; font-weight: 600; }
.caption-4 { font-size: 12px; line-height: 16px; font-weight: 500; }
.caption-5 { font-size: 12px; line-height: 16px; font-weight: 400; }

/* Shell */
html { -webkit-text-size-adjust: 100%; }
body { background: var(--wv-bg); }
::selection { background: var(--wv-primary); color: #fff; }

html .lingora-platform-shell {
  background: var(--wv-bg);
  color: var(--wv-text);
  font-family: var(--wv-font);
  min-height: 100dvh;
}
html[data-theme='dark'] .lingora-platform-shell { background: var(--wv-bg); color: var(--wv-text); }

.wv-icon { flex: none; display: block; }
.wv-muted { color: var(--wv-muted); }
.wv-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wv-clamp-1, .wv-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.wv-clamp-1 { -webkit-line-clamp: 1; }
.wv-clamp-2 { -webkit-line-clamp: 2; }
.wv-page :is(h1, h2, h3, p) { margin: 0; text-wrap: pretty; }
.wv-page :is(h1, h2, h3) { text-wrap: balance; color: inherit; }
.wv-page ul { margin: 0; padding: 0; list-style: none; }

.lingora-platform-shell :is(button, a, input, select, summary):focus-visible {
  outline: 2px solid var(--wv-link);
  outline-offset: 2px;
}

/* Top bar */
.wv-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--wv-topbar);
  padding: env(safe-area-inset-top) 16px 0;
  background: color-mix(in srgb, var(--wv-surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wv-line);
}
.wv-brand { display: flex; align-items: center; text-decoration: none; color: inherit; flex: none; }
.wv-topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.wv-topbar .lingora-logo-cluster { gap: 8px; }

.wv-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--wv-text);
  cursor: pointer;
  transition: background-color 200ms var(--wv-ease);
}
.wv-icon-btn.sm { width: 32px; height: 32px; color: var(--wv-muted); }
.wv-icon-btn:hover { background: var(--wv-surface-2); }
.wv-icon-btn:active { transform: scale(0.96); }
.wv-icon-btn .theme-icon-to-dark, .wv-icon-btn .theme-icon-to-light { display: none; }
html:not([data-theme='dark']) .theme-toggle-btn .theme-icon-to-dark { display: inline-flex; }
html[data-theme='dark'] .theme-toggle-btn .theme-icon-to-light { display: inline-flex; }
html:not([data-theme='dark']) .theme-toggle-btn .theme-icon-to-light,
html[data-theme='dark'] .theme-toggle-btn .theme-icon-to-dark { display: none; }

.wv-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  padding: 1px 4px;
  border-radius: 9999px;
  background: var(--wv-err);
  color: #fff;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
html[data-theme='dark'] .wv-badge { color: #181818; }
.wv-badge.static { position: static; }

.wv-coin-chip, .wv-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 9999px;
  background: var(--wv-accent-soft);
  color: var(--wv-accent-ink);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: opacity 200ms var(--wv-ease);
}
.wv-coin-chip:hover, .wv-streak:hover { opacity: 0.8; }

.wv-search { position: relative; display: flex; align-items: center; flex: 1; max-width: 420px; height: 40px; padding: 0 8px 0 12px; gap: 8px; border-radius: 12px; background: var(--wv-surface-2); color: var(--wv-muted); }
.wv-search-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--wv-text); font-family: inherit; }
.wv-search-input::-webkit-search-cancel-button { display: none; }
.wv-search-input::placeholder { color: var(--wv-muted); }
.wv-search-toggle { display: none; }
.wv-search .global-search-results-panel { font-family: var(--wv-font); }

.wv-anchor { position: relative; display: flex; }
.wv-avatar-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px; border: 0; border-radius: 12px; background: transparent; color: var(--wv-text); font-family: inherit; cursor: pointer; }
.wv-avatar-btn:hover { background: var(--wv-surface-2); }
.wv-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wv-avatar-btn .human-avatar-frame, .wv-user-summary .human-avatar-frame { flex: none; }

.wv-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(320px, calc(100vw - 32px));
  max-height: 70dvh;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--wv-line);
  border-radius: 16px;
  background: var(--wv-surface);
  box-shadow: var(--wv-shadow);
}
.wv-popover-head { display: flex; align-items: center; justify-content: space-between; padding: 8px; }
.wv-notif-list { margin: 0; padding: 0; list-style: none; }
.wv-notif { padding: 8px; border-radius: 8px; cursor: pointer; }
.wv-notif:hover { background: var(--wv-surface-2); }
.wv-notif.is-unread { background: var(--wv-primary-soft); }
.wv-user-summary { display: flex; align-items: center; gap: 12px; padding: 8px; }
.wv-user-menu .wv-user-summary { margin-bottom: 4px; }

.wv-link { border: 0; padding: 0; background: none; color: var(--wv-link); font-family: inherit; cursor: pointer; }
.wv-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Layout */
html .lingora-platform-body { display: block; }
html .lingora-platform-main, html[data-theme='dark'] .lingora-platform-main {
  min-height: calc(100dvh - var(--wv-topbar));
  min-width: 0;
  padding: 16px 16px calc(var(--wv-tabbar) + 32px + env(safe-area-inset-bottom));
  background: transparent;
}

/* Side menu: rail on desktop, full-height sheet on phones */
.wv-menu {
  position: fixed;
  z-index: 60;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: calc(8px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--wv-surface);
  border-right: 1px solid var(--wv-line);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 500ms var(--wv-ease), visibility 500ms;
}
.wv-menu.is-open { transform: none; visibility: visible; box-shadow: var(--wv-shadow); }
.wv-scrim { position: fixed; inset: 0; z-index: 55; border: 0; background: rgba(27, 43, 17, 0.45); cursor: pointer; }
.wv-menu-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wv-menu-sheet-head .wv-user-summary { cursor: pointer; min-width: 0; }
.wv-menu-groups { display: flex; flex-direction: column; gap: 16px; }
.wv-menu-group ul { margin: 0; padding: 0; list-style: none; }
.wv-menu-heading { padding: 0 12px 4px; }
.wv-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--wv-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 200ms var(--wv-ease);
}
.wv-menu-item:hover { background: var(--wv-surface-2); }
.wv-menu-item.is-active { background: var(--wv-primary-soft); color: var(--wv-link); font-weight: 600; }
.wv-menu-item.is-danger { color: var(--wv-err); }
.wv-menu-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.wv-lang-row { display: flex; align-items: center; gap: 4px; padding: 0 12px; color: var(--wv-muted); }
.wv-lang { min-width: 32px; height: 32px; padding: 0 4px; border: 0; border-radius: 8px; background: transparent; color: var(--wv-muted); font-family: inherit; cursor: pointer; }
.wv-lang:hover { background: var(--wv-surface-2); }
.wv-lang.is-active { background: var(--wv-primary-soft); color: var(--wv-link); }
.wv-menu-item .theme-icon-to-dark, .wv-menu-item .theme-icon-to-light { align-items: center; }

/* Bottom tabs */
.wv-tabbar {
  position: fixed;
  z-index: 45;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--wv-surface) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--wv-line);
}
.wv-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--wv-tabbar); border: 0; background: none; color: var(--wv-muted); font-family: inherit; cursor: pointer; }
.wv-tab.is-active { color: var(--wv-link); }
.wv-tab:active { transform: scale(0.96); }
.wv-tab-icon { position: relative; display: flex; }
.wv-tab-icon .wv-badge { top: -4px; right: -12px; }

/* Shared pieces */
.wv-page { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; font-family: var(--wv-font); color: var(--wv-text); }
.wv-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wv-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.wv-section-title { padding-bottom: 8px; color: var(--wv-text); }

.wv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 200ms var(--wv-ease), transform 200ms var(--wv-ease);
}
.wv-btn:active { transform: scale(0.98); }
.wv-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.wv-btn-primary { background: var(--wv-primary); color: #fff; }
.wv-btn-primary:hover { background: var(--wv-primary-hover); }
.wv-btn-secondary { background: var(--wv-surface); border-color: var(--wv-line); color: var(--wv-text); }
.wv-btn-secondary:hover { background: var(--wv-surface-2); }
.wv-btn-ghost { background: transparent; color: var(--wv-text); }
.wv-btn-ghost:hover:not(:disabled) { background: var(--wv-surface-2); }
.wv-btn-on-brand { background: #fff; color: #47722F; }
.wv-btn-on-brand:hover { background: #F4F8F1; }

.wv-group { overflow: hidden; border: 1px solid var(--wv-line); border-radius: 16px; background: var(--wv-surface); }
.wv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--wv-line);
  background: transparent;
  color: var(--wv-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 200ms var(--wv-ease);
}
.wv-group > .wv-row:first-child, .wv-group > :first-child { border-top: 0; }
.wv-row:hover { background: var(--wv-surface-2); }
.wv-row.static { cursor: default; }
.wv-row.static:hover { background: transparent; }
.wv-row.dense { min-height: 48px; padding: 8px 16px; }
.wv-row.is-me { background: var(--wv-primary-soft); }
.wv-row > .wv-icon:last-child { color: var(--wv-muted); }
.wv-row-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--wv-surface-2); color: var(--wv-link); }
.wv-row-icon.is-done { background: var(--wv-ok-soft); color: var(--wv-ok); }
.wv-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.wv-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wv-row-split { display: flex; justify-content: space-between; gap: 8px; }
.wv-script { font-size: 18px; font-weight: 600; }
.wv-rank { width: 16px; text-align: center; color: var(--wv-muted); font-variant-numeric: tabular-nums; }
.wv-empty-line { padding: 16px; color: var(--wv-muted); }

.wv-meter { display: block; height: 8px; overflow: hidden; border-radius: 9999px; background: var(--wv-surface-2); }
.wv-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--wv-accent); }
.wv-meter.sm { height: 4px; margin-top: 4px; }
.wv-meter.sm > span { background: var(--wv-primary); }
html[data-theme='dark'] .wv-meter.sm > span { background: var(--wv-link); }

/* Dashboard */
.wv-next {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  overflow: hidden;
  padding: 24px;
  border-radius: 16px;
  background: #558837;
  color: #fff;
}
.wv-next-body { position: relative; display: flex; flex-direction: column; gap: 4px; max-width: 560px; }
.wv-next-label { color: #F9CF9E; }
.wv-next-note { color: #E8F1E3; }
.wv-next .wv-btn { position: relative; }

.wv-level { display: flex; flex-direction: column; gap: 8px; }
.wv-level-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.wv-columns { display: grid; gap: 24px; }
.wv-column-main, .wv-column-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.wv-rail { display: flex; gap: 12px; margin: 0 -16px; padding: 0 16px 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.wv-rail::-webkit-scrollbar { display: none; }
.wv-course {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: none;
  width: 208px;
  padding: 16px;
  border: 1px solid var(--wv-line);
  border-radius: 16px;
  background: var(--wv-surface);
  color: var(--wv-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background-color 200ms var(--wv-ease);
}
.wv-course:hover { background: var(--wv-surface-2); }
.wv-course-symbol { font-size: 20px; line-height: 28px; font-weight: 600; color: var(--wv-link); }
.wv-course-price { margin-top: auto; padding-top: 8px; color: var(--wv-accent-ink); }

/* Learning */
.wv-segments { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wv-segment { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--wv-line); border-radius: 12px; background: var(--wv-surface); color: var(--wv-text); font-family: inherit; text-align: left; cursor: pointer; transition: background-color 200ms var(--wv-ease); }
.wv-segment:hover { background: var(--wv-surface-2); }
.wv-segment.is-active { border-color: var(--wv-link); background: var(--wv-primary-soft); }
.wv-segment-top { display: flex; align-items: center; gap: 8px; }
.wv-script-sm { font-weight: 600; color: var(--wv-link); }

html .wv-page .st-entry-card, html[data-theme='dark'] .wv-page .st-entry-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  padding: 24px;
  border: 0;
  border-radius: 16px;
  background: #558837;
  color: #fff;
  box-shadow: none;
}
.wv-page .st-entry-card :is(.st-entry-title, .st-entry-pinyin, .st-entry-desc) { color: inherit; margin: 0; font-family: var(--wv-font); }
.wv-page .st-entry-card .st-entry-title { font-size: 24px; line-height: 32px; font-weight: 600; }
.wv-page .st-entry-card .st-entry-pinyin { font-size: 14px; line-height: 20px; font-weight: 400; color: #E8F1E3; }
.wv-page .st-entry-card .st-entry-desc { font-size: 14px; line-height: 20px; color: #E8F1E3; margin-top: 4px; }
html .wv-page .st-entry-card .st-entry-tag { display: inline-block; margin-bottom: 8px; padding: 2px 8px; border-radius: 9999px; background: #F39A38; color: #325021; font-size: 12px; line-height: 16px; font-weight: 600; }
html .wv-page .st-entry-card .btn-lingora-primary { min-height: 44px; padding: 8px 16px; border: 0; border-radius: 12px; background: #fff; color: #47722F; font-family: var(--wv-font); font-size: 16px; line-height: 24px; font-weight: 600; box-shadow: none; }

.wv-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.wv-field-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--wv-line); border-radius: 12px; background: var(--wv-surface); color: var(--wv-muted); }
.wv-field-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--wv-text); font-family: inherit; }
.wv-filter-selects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wv-select, .wv-input { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--wv-line); border-radius: 12px; background-color: var(--wv-surface); color: var(--wv-text); font-family: inherit; }
.wv-input::placeholder { color: var(--wv-muted); }

.wv-placement { display: flex; flex-direction: column; gap: 16px; padding: 16px; border-top: 1px solid var(--wv-line); background: var(--wv-bg); }
.wv-placement-result { padding: 12px; border-radius: 12px; background: var(--wv-primary-soft); }
.wv-question { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.wv-question legend { padding: 0 0 8px; }
.wv-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.wv-choices.stacked { flex-direction: column; }
.wv-choice { min-height: 44px; padding: 8px 16px; border: 1px solid var(--wv-line); border-radius: 12px; background: var(--wv-surface); color: var(--wv-text); font-family: inherit; text-align: left; cursor: pointer; transition: background-color 200ms var(--wv-ease); }
.wv-choice:hover { background: var(--wv-surface-2); }
.wv-choice.is-selected { border-color: var(--wv-link); background: var(--wv-primary-soft); }
.wv-choice.is-ok { border-color: var(--wv-ok); background: var(--wv-ok-soft); }
.wv-choice.is-err { border-color: var(--wv-err); background: var(--wv-err-soft); }

/* Lesson */
.wv-lesson { max-width: 720px; }
.wv-lesson-head { display: flex; align-items: flex-start; gap: 8px; margin-left: -8px; }
.wv-lesson-title { min-width: 0; padding-top: 2px; }
.wv-vocab { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 8px 12px 16px; border-top: 1px solid var(--wv-line); }
.wv-vocab-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wv-vocab-word { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.wv-disclosure { margin-top: 8px; padding: 12px 16px; border: 1px solid var(--wv-line); border-radius: 16px; background: var(--wv-surface); }
.wv-disclosure summary, .wv-faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.wv-disclosure summary::-webkit-details-marker, .wv-faq-item summary::-webkit-details-marker { display: none; }
.wv-disclosure[open] summary .wv-icon, .wv-faq-item[open] summary .wv-icon { transform: rotate(180deg); }
.wv-disclosure ul { margin: 12px 0 8px; padding-left: 20px; list-style: disc; }
.wv-exercise { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--wv-line); border-radius: 16px; background: var(--wv-surface); }
.wv-exercise .wv-section-title { padding-bottom: 0; }
.wv-steps { display: flex; gap: 8px; }
.wv-step-dot { flex: 1; height: 24px; padding: 10px 0; border: 0; background: none; cursor: pointer; position: relative; }
.wv-step-dot::after { content: ''; position: absolute; inset: 10px 0; border-radius: 9999px; background: var(--wv-surface-2); }
.wv-step-dot.is-done::after { background: var(--wv-ok); }
.wv-step-dot.is-current::after { background: var(--wv-primary); }
.wv-fill { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wv-fill .wv-input { flex: 1 1 120px; width: auto; }
.wv-match { display: flex; flex-direction: column; gap: 8px; }
.wv-match-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; gap: 12px; }
.wv-feedback { display: flex; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 12px; }
.wv-feedback.is-ok { background: var(--wv-ok-soft); color: var(--wv-ok); }
.wv-feedback.is-err { background: var(--wv-err-soft); color: var(--wv-err); }
.wv-exercise-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wv-summary { display: flex; flex-direction: column; gap: 16px; padding: 16px; border: 1px solid var(--wv-line); border-radius: 16px; background: var(--wv-surface); }
.wv-summary-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; }
.wv-summary-stats dd { margin: 0; }
.wv-summary .wv-row { padding: 12px; border: 1px solid var(--wv-line); border-radius: 12px; }

/* Public home */
.wv-home { max-width: 1120px; gap: 64px; }
.wv-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; min-height: calc(100dvh - var(--wv-topbar) - 48px); padding: 24px 0; text-align: center; }
.wv-hero-copy { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 680px; }
.wv-hero-title { font-size: 36px; line-height: 48px; font-weight: 600; }
.wv-hero-sub { color: var(--wv-muted); max-width: 60ch; }
.wv-hero-cta { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 8px; }

.wv-tone-stage { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 480px; min-width: 0; }
.wv-tone-caption { text-align: center; }
.wv-tone-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wv-tone-btn { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 4px 12px; border: 1px solid var(--wv-line); border-radius: 12px; background: var(--wv-surface); color: var(--wv-text); font-family: inherit; cursor: pointer; transition: background-color 200ms var(--wv-ease), transform 200ms var(--wv-ease); }
.wv-tone-btn:hover { background: var(--wv-surface-2); }
.wv-tone-btn:active { transform: scale(0.98); }
.wv-tone-btn.is-playing { border-color: var(--wv-link); background: var(--wv-primary-soft); }
.wv-tone-char { font-size: 24px; line-height: 32px; font-weight: 600; }

.wv-home-steps { display: flex; flex-direction: column; gap: 40px; }
.wv-step { display: grid; gap: 16px; align-items: center; }
.wv-step-copy { display: flex; flex-direction: column; gap: 8px; }
.wv-sample { display: flex; flex-direction: column; gap: 4px; padding: 24px; border: 1px solid var(--wv-line); border-radius: 16px; background: var(--wv-surface); }
.wv-sample-word { font-size: 36px; line-height: 48px; font-weight: 600; color: var(--wv-link); }
.wv-sample-line { font-size: 20px; line-height: 32px; font-weight: 500; }
.wv-sample-rows { display: flex; flex-direction: column; }
.wv-sample-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--wv-line); }
.wv-sample-row:first-child { border-top: 0; }

.wv-tagline { padding: 40px 0; }
.wv-tagline .scroll-reveal { margin: 0; }
.wv-tagline-text { display: block; max-width: 680px; margin: 0; font-size: 30px; line-height: 44px; font-weight: 600; color: var(--wv-text); }
.scroll-reveal-word, .scroll-reveal-piece { display: inline-block; }

.wv-faq { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.wv-faq-item { padding: 16px; border-top: 1px solid var(--wv-line); }
.wv-faq-item summary .wv-icon { color: var(--wv-muted); transition: transform 300ms var(--wv-ease); }
.wv-faq-item p { margin-top: 8px; }
.wv-final-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-bottom: 24px; }

/* Signed-out pages have no tabs */
#platform-top-nav:not(:has(#global-search-input)) ~ .lingora-platform-body .lingora-platform-main {
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

@media (max-width: 1023px) {
  .wv-desktop-only { display: none; }
  .wv-search { display: none; }
  .wv-search-toggle { display: inline-flex; }
  .wv-topbar.is-searching .wv-brand { display: none; }
  .wv-topbar.is-searching .wv-search { display: flex; max-width: none; }
  .wv-topbar.is-searching .wv-coin-chip, .wv-topbar.is-searching .wv-anchor { display: none; }
  .wv-search .global-search-results-panel { position: fixed; top: calc(var(--wv-topbar) + env(safe-area-inset-top)); left: 8px; right: 8px; width: auto; max-height: 70dvh; overflow: auto; }
}

@media (min-width: 640px) {
  .wv-segments { grid-template-columns: repeat(4, 1fr); }
  .wv-filter-selects { grid-template-columns: repeat(4, 1fr); }
  .wv-next { flex-direction: row; align-items: center; justify-content: space-between; }
  .wv-next .wv-btn { flex: none; }
  html .wv-page .st-entry-card, html[data-theme='dark'] .wv-page .st-entry-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .wv-rail { margin: 0; padding: 0 0 4px; }
  .wv-summary-stats { grid-template-columns: repeat(4, 1fr); }
  .wv-step { grid-template-columns: 1fr 1fr; gap: 48px; }
  .wv-step:nth-child(even) .wv-sample { order: -1; }
}

@media (min-width: 1024px) {
  html .lingora-platform-main, html[data-theme='dark'] .lingora-platform-main { margin-left: var(--wv-rail); padding: 24px 32px 48px; }
  .wv-topbar { padding: 0 24px; gap: 32px; }
  .wv-topbar .wv-search { margin-left: calc(var(--wv-rail) - 150px); }
  .wv-tabbar, .wv-scrim, .wv-menu-sheet-head, .wv-sheet-only { display: none; }
  .wv-menu { top: var(--wv-topbar); z-index: 30; width: var(--wv-rail); transform: none; visibility: visible; padding-top: 16px; transition: none; box-shadow: none; }
  .wv-columns { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .wv-hero-title { font-size: 48px; line-height: 64px; }
  .wv-tagline-text { font-size: 36px; line-height: 52px; }
  .wv-home { gap: 96px; }
  /* Signed-out home has no rail */
  #platform-top-nav:not(:has(#global-search-input)) ~ .lingora-platform-body .lingora-platform-main { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wv-menu, .wv-btn, .wv-row, .wv-icon-btn { transition: none; }
}

/* Pages not yet redesigned must still fit a phone. */
.community-main-col, .community-page-grid, .wv-page { min-width: 0; }
@media (max-width: 639px) {
  .form-grid-3, .form-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .community-layout-grid, .community-page-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Public home: over the animated veil, in white or black */
.lingora-platform-shell:has(#page-public-home) {
  --wv-bg: #FFF6E3;
  --wv-surface: rgba(255, 255, 255, 0.72);
  --wv-surface-2: rgba(255, 255, 255, 0.92);
  --wv-line: rgba(150, 100, 20, 0.22);
  --wv-muted: #3C5A2B;
}
html[data-theme='dark'] .lingora-platform-shell:has(#page-public-home) {
  --wv-bg: #000000;
  --wv-surface: rgba(24, 24, 24, 0.78);
  --wv-surface-2: rgba(49, 49, 49, 0.78);
  --wv-line: rgba(255, 255, 255, 0.14);
  --wv-muted: #ECF2E8;
  --wv-primary-soft: rgba(100, 160, 66, 0.3);
}
html .lingora-platform-shell:has(#page-public-home), body:has(#page-public-home) { background: #FFF6E3; }
html[data-theme='dark'] .lingora-platform-shell:has(#page-public-home), html[data-theme='dark'] body:has(#page-public-home) { background: #000000; }
.wv-veil { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.wv-home > :not(.wv-veil) { position: relative; z-index: 1; }
.dark-veil-container { position: relative; width: 100%; height: 100%; overflow: hidden; }
.dark-veil-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* Speaking test: typing instead of the microphone */
.st-type-form { display: flex; gap: 8px; width: 100%; max-width: 480px; margin: 12px auto 0; }
.st-type-form input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--wv-line); border-radius: 8px; background: var(--wv-surface); color: var(--wv-text); font: inherit; }
