/* Current-line Welcome: a lightweight pre-Flutter preview over the existing Hub. */
html.lf-show-welcome,
html.lf-show-welcome body {
  overflow: hidden;
  background: #f2f6ff;
}

#lf-preboot-shell.lf-current-welcome {
  --lf-surface: #ffffff;
  --lf-ink: #1c2230;
  --lf-muted: #5f6773;
  --lf-faint: #89919d;
  --lf-line: rgba(56, 66, 88, .14);
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--lf-soft-background);
  color: var(--lf-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  opacity: 1;
  transition: opacity 220ms ease;
}

#lf-preboot-shell.lf-current-welcome *,
#lf-preboot-shell.lf-current-welcome *::before,
#lf-preboot-shell.lf-current-welcome *::after {
  box-sizing: border-box;
}

#lf-preboot-shell.lf-current-welcome.lf-hide {
  opacity: 0;
  pointer-events: none;
}

.lf-skip-welcome #lf-preboot-shell { display: none; }

.lf-current-preview { display: none; }
.lf-demo-visible .lf-current-preview { display: grid; }
.lf-pair-unavailable .lf-current-preview,
.lf-pair-choice .lf-current-preview,
.lf-pair-saving .lf-current-preview { display: none; }
.lf-pair-unavailable .lf-current-layout,
.lf-pair-choice .lf-current-layout,
.lf-pair-saving .lf-current-layout {
  grid-template-columns: minmax(0, 1fr);
}
.lf-demo-visible .lf-current-choice,
.lf-pair-saving .lf-current-choice { display: none; }

#lf-preboot-pair-loading {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}

#lf-pair-status { margin: 0; }
#lf-preboot-pair-loading[data-state="error"] .lf-returning-spinner { display: none; }
#lf-pair-retry {
  min-height: 44px;
  border: 1px solid #24479f;
  border-radius: 12px;
  padding: 9px 18px;
  background: #24479f;
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
#lf-pair-retry:focus-visible { outline: 3px solid #1c2230; outline-offset: 3px; }

#lf-preboot-returning {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.lf-returning-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 360px);
  gap: 22px;
  text-align: center;
}

.lf-returning-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.lf-returning-brand > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--lf-returning-dark, #1c2230);
  color: var(--lf-returning-soft, #f2f6ff);
  font-size: 17px;
}

.lf-returning-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  color: #5f6773;
  font-size: 14px;
  line-height: 1.45;
}

#lf-returning-status { margin: 0; }

.lf-returning-spinner {
  flex: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--lf-returning-border, #b9c9f5);
  border-top-color: var(--lf-returning-primary, #315bc7);
  border-radius: 50%;
  animation: lf-returning-spin .8s linear infinite;
}

#lf-preboot-returning[data-state="error"] .lf-returning-spinner { display: none; }

#lf-returning-retry {
  min-height: 44px;
  border: 1px solid var(--lf-returning-dark, #24479f);
  border-radius: 12px;
  padding: 9px 18px;
  background: var(--lf-returning-dark, #24479f);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

#lf-returning-retry:focus-visible {
  outline: 3px solid #1c2230;
  outline-offset: 3px;
}

@keyframes lf-returning-spin { to { transform: rotate(360deg); } }

.lf-current-welcome button,
.lf-current-welcome select,
.lf-current-welcome input { font: inherit; }

/* Demo controls keep their visual affordance without starting real actions. */
.lf-current-welcome .lf-current-scene button:disabled {
  opacity: 1;
  cursor: default;
}

.lf-current-welcome button:focus-visible,
.lf-current-welcome select:focus-visible,
.lf-current-welcome input:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--lf-primary-dark);
}

.lf-current-topbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(8px, env(safe-area-inset-top)) 24px 8px;
  border-bottom: 1px solid var(--lf-line);
  background: rgba(255, 255, 255, .42);
}

.lf-current-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--lf-ink);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.lf-current-brand > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--lf-ink);
  color: var(--lf-soft-background);
  font-size: 13px;
}

.lf-current-edit-pair {
  flex: 0 1 auto;
  max-width: min(46vw, 250px);
  min-height: 44px;
  border: 1px solid var(--lf-border);
  border-radius: 11px;
  padding: 8px 12px;
  overflow: hidden;
  background: var(--lf-surface);
  color: var(--lf-primary-dark);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.lf-current-sr-only,
.lf-current-welcome .lf-select-native-mirror {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.lf-current-welcome #lf-preboot-interface-locale,
.lf-current-welcome #lf-preboot-target-language-trigger,
.lf-current-welcome .lf-levels button,
.lf-current-welcome #lf-preboot-catalog-retry,
.lf-current-welcome #lf-preboot-retry {
  min-height: 44px;
  border: 1px solid var(--lf-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, .8);
  color: var(--lf-ink);
}

.lf-current-welcome #lf-preboot-interface-locale {
  width: 100%;
  padding: 8px 34px 8px 12px;
  appearance: auto;
  cursor: pointer;
  text-overflow: ellipsis;
}

.lf-current-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(310px, .88fr) minmax(430px, 1.12fr);
  overflow: hidden;
}

.lf-current-copy {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(32px, 6vh, 64px) clamp(28px, 4.8vw, 64px);
}

.lf-pair-choice .lf-current-copy,
.lf-pair-saving .lf-current-copy {
  width: min(100%, 720px);
  margin-inline: auto;
}

.lf-current-copy > h1 {
  max-width: 650px;
  margin: 0;
  white-space: pre-line;
  font-size: clamp(34px, 3.2vw, 42px);
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.lf-current-intro {
  max-width: 610px;
  margin: 19px 0 0;
  color: var(--lf-muted);
  font-size: 16px;
  line-height: 1.52;
}

.lf-current-choice {
  max-width: 440px;
  margin-top: 28px;
  padding-top: 19px;
  border-top: 1px solid var(--lf-ink);
}

.lf-current-next {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.lf-current-welcome .lf-preboot-field {
  display: grid;
  gap: 6px;
}

.lf-current-welcome .lf-preboot-field + .lf-preboot-field { margin-top: 12px; }

.lf-current-confirm {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  border: 0;
  border-radius: 11px;
  padding: 10px 16px;
  background: var(--lf-primary-dark);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.lf-current-confirm:focus-visible,
.lf-current-preview-skip:focus-visible,
.lf-current-open-app:focus-visible {
  outline: 3px solid var(--lf-ink);
  outline-offset: 2px;
}
.lf-current-confirm:disabled { opacity: .55; cursor: not-allowed; }

.lf-current-welcome .lf-preboot-field > label,
.lf-current-welcome .lf-field-label {
  color: var(--lf-muted);
  font-size: 12px;
  font-weight: 650;
}

.lf-current-welcome .lf-select-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.lf-current-welcome #lf-preboot-target-language-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  text-align: start;
  cursor: pointer;
}

.lf-current-welcome #lf-preboot-target-language-trigger::after {
  content: "⌄";
  flex: 0 0 auto;
  color: var(--lf-primary-dark);
}

.lf-current-welcome #lf-preboot-target-language-trigger[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.lf-current-welcome .lf-language-listbox {
  position: fixed;
  z-index: 10020;
  max-height: min(320px, calc(100dvh - 24px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--lf-border);
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(32, 39, 53, .24);
}

.lf-current-welcome .lf-language-listbox[hidden] { display: none; }

.lf-current-welcome .lf-language-option {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--lf-ink);
  text-align: start;
  cursor: pointer;
}

.lf-current-welcome .lf-language-option:hover,
.lf-current-welcome .lf-language-option[data-active="true"],
.lf-current-welcome .lf-language-option[aria-selected="true"] {
  background: var(--lf-card-background);
  color: var(--lf-primary-dark);
}

.lf-current-welcome .lf-language-option[aria-selected="true"] { font-weight: 700; }

.lf-current-welcome .lf-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.lf-current-welcome .lf-levels button {
  padding: 7px 8px;
  cursor: pointer;
}

.lf-current-welcome .lf-levels button[aria-pressed="true"] {
  border-color: var(--lf-primary);
  background: var(--lf-card-background);
  color: var(--lf-primary-dark);
  font-weight: 750;
}

.lf-current-welcome button:disabled,
.lf-current-welcome select:disabled { cursor: wait; opacity: .66; }

.lf-current-welcome .lf-preboot-catalog-state,
.lf-current-welcome .lf-preboot-runtime {
  margin: 7px 0 0;
  color: var(--lf-muted);
  font-size: 12px;
  line-height: 1.35;
}

.lf-current-welcome .lf-preboot-runtime[data-state="error"],
.lf-current-welcome .lf-preboot-catalog-state[role="alert"] { color: #9b2f3e; }

.lf-current-welcome #lf-preboot-catalog-retry,
.lf-current-welcome #lf-preboot-retry {
  margin-top: 8px;
  padding: 7px 12px;
  cursor: pointer;
}

.lf-current-preview {
  min-width: 0;
  min-height: 0;
  display: none;
  grid-template-rows: minmax(64px, auto) minmax(0, 1fr);
  border-inline-start: 1px solid var(--lf-line);
  background: rgba(255, 255, 255, .38);
  overflow: hidden;
}

.lf-current-tabs {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--lf-line);
}

.lf-current-tabs > button {
  position: relative;
  min-width: 0;
  border: 0;
  padding: 10px;
  overflow: visible;
  background: transparent;
  color: var(--lf-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.28;
  cursor: pointer;
}

.lf-current-tabs > button::before {
  content: "1";
  display: block;
  margin-bottom: 3px;
  color: var(--lf-primary-dark);
  font-size: 13px;
  font-weight: 800;
}
.lf-current-tabs > button:nth-child(2)::before { content: "2"; }
.lf-current-tabs > button:nth-child(3)::before { content: "3"; }

.lf-current-tabs > button[aria-selected="true"] {
  color: var(--lf-primary-dark);
  background: var(--lf-card-background);
  font-weight: 750;
}

.lf-current-preview-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: start;
  align-items: start;
  padding: clamp(22px, 4.2vw, 50px);
  overflow: visible;
}

.lf-current-status-card {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  max-width: 610px;
  margin-top: 18px;
  border: 1px solid var(--lf-border);
  border-radius: 14px;
  padding: 13px 15px;
  background: var(--lf-card-background);
  color: var(--lf-ink);
}

.lf-current-status-card[hidden] { display: none; }

.lf-current-status-copy { min-width: 0; }

.lf-current-preview-skip {
  flex: none;
  min-height: 44px;
  margin-inline-start: auto;
  border: 1px solid var(--lf-border);
  border-radius: 11px;
  padding: 8px 12px;
  background: var(--lf-surface);
  color: var(--lf-primary-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.lf-current-open-app {
  flex: none;
  min-height: 44px;
  margin-inline-start: auto;
  border: 0;
  border-radius: 11px;
  padding: 8px 14px;
  background: var(--lf-primary-dark);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.lf-current-status-card .lf-preboot-runtime {
  min-width: 0;
  margin: 0;
  color: var(--lf-primary-dark);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.lf-current-status-hint {
  margin: 4px 0 0;
  color: var(--lf-muted);
  font-size: 13px;
  line-height: 1.35;
}

.lf-demo-visible .lf-current-status-hint { display: none; }

.lf-current-status-indicator {
  display: none;
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border: 2px solid var(--lf-border);
  border-top-color: var(--lf-primary);
  border-radius: 50%;
  animation: lf-current-status-spin 1s linear infinite;
}

.lf-current-status-card[data-state="loading"] .lf-current-status-indicator,
.lf-current-status-card[data-state="progress"] .lf-current-status-indicator,
.lf-current-status-card[data-state="slow"] .lf-current-status-indicator,
.lf-current-status-card[data-state="delayed"] .lf-current-status-indicator {
  display: block;
}

@keyframes lf-current-status-spin { to { transform: rotate(360deg); } }

.lf-current-scene { display: none; min-width: 0; }
.lf-current-scene.is-active { display: block; }
.lf-current-scene[hidden] { display: none !important; }

.lf-current-kicker {
  margin: 0 0 10px;
  color: var(--lf-primary-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lf-current-benefit {
  max-width: 560px;
  margin: 0 0 18px;
  color: var(--lf-muted);
  font-size: 16px;
  line-height: 1.42;
}

.lf-current-scene > h2 {
  margin: 0 0 18px;
  font-size: clamp(25px, 3.2vw, 36px);
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.lf-current-story-lines {
  display: grid;
  gap: 3px;
  font-size: 16px;
  line-height: 1.36;
}

.lf-current-story-line {
  position: relative;
  margin: 0;
  padding: 8px 10px 8px 24px;
  border: 1px solid transparent;
  border-radius: 13px;
}

.lf-current-story-line.is-active {
  border-color: var(--lf-border);
  background: var(--lf-card-background);
  font-weight: 620;
}

.lf-current-story-line.is-active::before {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  top: 10px;
  width: 3px;
  height: 22px;
  border-radius: 99px;
  background: var(--lf-primary);
}

.lf-current-inline-word {
  min-width: 44px;
  min-height: 44px;
  margin-block: -12px;
  border: 0;
  padding: 10px 2px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.lf-current-inline-word-part {
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.lf-current-player {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.lf-current-player > button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--lf-ink);
}

.lf-current-player > button > span {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-inline-start: 10px solid #ffffff;
  transform: translateX(1px);
}

.lf-current-wave {
  flex: 1;
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
}

.lf-current-wave > i {
  flex: 1 1 3px;
  max-width: 4px;
  height: 45%;
  border-radius: 99px;
  background: var(--lf-border);
}

.lf-current-wave > i:nth-child(3n) { height: 78%; }
.lf-current-wave > i:nth-child(-n+9) { background: var(--lf-primary); }
.lf-current-player > span { color: var(--lf-muted); font-size: 11px; }

.lf-current-word-reader {
  position: relative;
  min-height: 0;
  padding: 8px 5px 20px;
}

.lf-current-word-reader > h2 {
  margin: 0 0 15px;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 680;
}

.lf-current-word-background {
  display: grid;
  gap: 15px;
  padding: 14px;
  color: var(--lf-muted);
  font-size: 15px;
  line-height: 1.42;
  opacity: .7;
}

.lf-current-word-background > p { margin: 0; }

.lf-current-word-overlay {
  position: relative;
  z-index: 1;
  margin-top: -20px;
  max-width: 540px;
  margin-inline: auto;
  border: 1px solid var(--lf-border);
  border-radius: 16px;
  padding: 24px 26px 19px;
  background: var(--lf-card-background);
  box-shadow: 0 12px 28px rgba(26, 39, 76, .15);
}

.lf-current-word-close {
  position: absolute;
  inset-inline-end: 10px;
  top: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--lf-muted);
  font-size: 24px;
  cursor: pointer;
}

.lf-current-word-sentence,
.lf-current-word-sentence-translation,
.lf-current-word-meaning,
.lf-current-word-form { margin: 0; line-height: 1.4; }
.lf-current-word-sentence { padding-inline-end: 14px; font-size: 17px; }
.lf-current-word-sentence mark {
  padding: 0 2px;
  background: #fff59d;
  color: var(--lf-ink);
  font-weight: 700;
}
.lf-current-word-sentence-translation {
  margin-top: 11px;
  color: var(--lf-muted);
  font-size: 16px;
  font-style: italic;
}
.lf-current-word-meaning { margin-top: 11px; font-size: 16px; }
.lf-current-word-form {
  margin-top: 5px;
  color: var(--lf-muted);
  font-size: 13px;
  font-style: italic;
}
.lf-current-word-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}
.lf-current-word-actions > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid;
  border-radius: 50%;
}
.lf-current-word-actions svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lf-current-word-reset {
  border-color: rgba(198, 71, 84, .5) !important;
  background: #fff0f1;
  color: #b83e50;
}
.lf-current-word-trainer {
  border-color: var(--lf-border) !important;
  background: var(--lf-surface);
  color: var(--lf-primary-dark);
}

.lf-current-practice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.lf-current-practice-head > h2 { margin: 0; font-size: 17px; }
.lf-current-practice-head > span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--lf-border);
  border-radius: 99px;
  background: var(--lf-card-background);
  color: var(--lf-primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.lf-current-prompt {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 620;
  line-height: 1.12;
  letter-spacing: -.035em;
  text-align: center;
}

.lf-current-answer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
}

.lf-current-input-pill {
  height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--lf-line);
  border-radius: 24px;
  background: var(--lf-surface);
}

.lf-current-input-pill > input {
  width: 100%;
  height: 46px;
  border: 0;
  padding: 0 4px 0 17px;
  background: transparent;
  color: var(--lf-ink);
  outline: 0;
}

[dir="rtl"] .lf-current-input-pill > input { padding: 0 17px 0 4px; }
.lf-current-input-pill > input::placeholder { color: var(--lf-faint); }

.lf-current-input-pill > button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--lf-primary-dark);
  font-size: 19px;
}

.lf-current-answer > #lf-preview-mic {
  width: 48px;
  height: 48px;
  border: 1px solid var(--lf-line);
  border-radius: 50%;
  padding: 0;
  background: var(--lf-surface);
  color: var(--lf-primary-dark);
  font-size: 15px;
}

.lf-current-answer > #lf-preview-mic > svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.lf-current-skip {
  display: block;
  min-height: 40px;
  margin: 9px auto 0;
  border: 0;
  padding: 7px 13px;
  background: transparent;
  color: var(--lf-muted);
  font-weight: 650;
}

[hidden] { display: none !important; }

@media (max-width: 799px) {
  #lf-preboot-shell.lf-current-welcome {
    grid-template-rows: 54px minmax(0, 1fr);
    overflow: hidden;
  }

  .lf-current-topbar { padding: max(6px, env(safe-area-inset-top)) 14px 6px; }
  .lf-current-brand { font-size: 15px; }
  .lf-current-brand > span { width: 26px; height: 26px; }
  .lf-current-welcome #lf-preboot-interface-locale { min-height: 40px; font-size: 12px; }

  .lf-current-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .lf-current-copy {
    display: block;
    padding: 10px 16px 8px;
  }

  .lf-current-copy > h1 {
    font-size: clamp(23px, 7.5vw, 31px);
    line-height: 1.04;
  }

  /* The active scene carries the same explanation without duplicating it. */
  .lf-current-intro { display: none; }

  .lf-current-choice { margin-top: 8px; padding-top: 7px; }
  .lf-current-next { display: none; }
  .lf-current-welcome .lf-preboot-field { gap: 4px; }
  .lf-current-welcome .lf-preboot-field + .lf-preboot-field { margin-top: 6px; }
  .lf-current-confirm { margin-top: 8px; }
  .lf-current-welcome #lf-preboot-target-language-trigger { min-height: 38px; font-size: 12px; }
  .lf-current-welcome .lf-levels button { min-height: 34px; font-size: 12px; }
  .lf-current-welcome .lf-preboot-catalog-state,
  .lf-current-welcome .lf-preboot-runtime { margin-top: 4px; font-size: 11px; }

  .lf-current-preview {
    grid-template-rows: minmax(56px, auto) minmax(0, 1fr);
    border-inline-start: 0;
    border-top: 1px solid var(--lf-line);
  }

  .lf-current-status-card {
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 9px;
    padding: 9px 11px;
  }
  .lf-current-status-card .lf-preboot-runtime { margin: 0; font-size: 15px; }
  .lf-current-status-hint { margin-top: 2px; font-size: 12px; }
  .lf-current-preview-skip,
  .lf-current-open-app {
    width: 100%;
    min-height: 44px;
    margin-inline-start: 0;
    padding-inline: 9px;
    font-size: 13px;
  }

  .lf-demo-visible .lf-current-status-card:not([data-state="error"]) {
    align-items: center;
    flex-wrap: nowrap;
    gap: 7px;
    min-height: 52px;
    margin-top: 6px;
    padding: 3px 6px 3px 8px;
  }
  .lf-demo-visible .lf-current-status-card:not([data-state="error"])
    .lf-current-status-copy { flex: 1; }
  .lf-demo-visible .lf-current-status-card:not([data-state="error"])
    .lf-preboot-runtime { font-size: 13px; line-height: 1.3; }
  .lf-demo-visible .lf-current-preview-skip,
  .lf-demo-visible .lf-current-open-app {
    width: auto;
    max-width: 49%;
    margin-inline-start: auto;
    white-space: normal;
  }

  /* Short localized names remain visible; full names are the accessible labels. */
  .lf-current-tabs > button { min-height: 50px; padding: 2px 3px; font-size: 13px; line-height: 1.15; }
  .lf-current-tabs > button::before { margin: 0 0 2px; font-size: 13px; line-height: 1; }
  .lf-current-preview-body {
    padding: 11px 14px 16px;
    overflow: visible;
  }
  .lf-current-kicker { display: none; }
  .lf-current-benefit { margin-bottom: 10px; font-size: 14px; line-height: 1.4; }
  .lf-current-scene > h2 { margin-bottom: 8px; font-size: 21px; }
  .lf-current-story-lines { gap: 1px; font-size: 14px; line-height: 1.4; }
  .lf-current-story-line { padding: 5px 7px 5px 21px; border-radius: 10px; }
  .lf-current-story-line.is-active::before { inset-inline-start: 8px; top: 7px; height: 18px; }
  .lf-current-player { margin-top: 10px; }
  .lf-current-player > button { width: 40px; height: 40px; }
  .lf-current-word-reader { min-height: 0; padding: 2px 0 0; }
  .lf-current-word-reader > h2 { margin-bottom: 7px; font-size: 17px; }
  .lf-current-word-background {
    position: relative;
    gap: 8px;
    padding: 8px;
    font-size: 14px;
  }
  .lf-current-word-overlay {
    margin-top: -18px;
    border-radius: 12px;
    padding: 12px 12px 8px;
  }
  .lf-current-word-sentence { padding-inline-end: 12px; font-size: 14px; }
  .lf-current-word-sentence-translation,
  .lf-current-word-meaning { margin-top: 7px; font-size: 14px; }
  .lf-current-word-form { font-size: 14px; }
  .lf-current-word-actions { margin-top: 6px; }
  .lf-current-word-actions > span { width: 27px; height: 27px; }
  .lf-current-practice-head { margin-bottom: 12px; }
  .lf-current-practice-head > h2 { font-size: 14px; }
  .lf-current-prompt { font-size: clamp(21px, 7vw, 29px); }
  .lf-current-answer { margin-top: 18px; }
}

@media (max-width: 799px) and (max-height: 620px) {
  #lf-preboot-shell.lf-current-welcome { grid-template-rows: 46px minmax(0, 1fr); }
  .lf-current-topbar { padding: max(3px, env(safe-area-inset-top)) 11px 3px; }
  .lf-current-copy { padding: 5px 11px 4px; }
  .lf-current-copy > h1 { font-size: 20px; line-height: 1.04; }
  .lf-demo-visible .lf-current-status-card:not([data-state="error"]) {
    min-height: 44px;
    margin-top: 4px;
  }
  .lf-current-preview { grid-template-rows: 50px minmax(0, 1fr); }
  .lf-current-preview-body { padding: 6px 11px 8px; }
  .lf-current-benefit { margin-bottom: 5px; }
  .lf-current-scene > h2 { margin-bottom: 4px; font-size: 19px; }
  .lf-current-story-lines { gap: 0; }
  .lf-current-story-line { padding-block: 3px; }
  .lf-current-player { margin-top: 2px; }
  .lf-current-word-reader > h2 { margin-bottom: 4px; }
  .lf-current-word-background { gap: 4px; padding: 5px; }
  .lf-current-word-overlay { margin-top: -12px; padding: 6px 10px 5px; }
  .lf-current-word-sentence-translation,
  .lf-current-word-meaning { margin-top: 5px; }
  .lf-current-word-actions { margin-top: 2px; }
  .lf-current-practice-head { margin-bottom: 7px; }
  .lf-current-answer { margin-top: 10px; }
}

@media (max-width: 350px) {
  .lf-current-copy { padding-inline: 12px; }
  .lf-current-copy > h1 { font-size: 22px; }
  .lf-current-intro { font-size: 11.5px; }
  .lf-current-preview-body { padding-inline: 11px; }
  .lf-current-status-card { padding-inline: 10px; }
}

@media (max-height: 620px) and (min-width: 800px) {
  .lf-current-copy { padding-block: 20px; }
  .lf-current-copy > h1 { font-size: 34px; }
  .lf-current-intro { margin-top: 10px; }
  .lf-current-choice { margin-top: 16px; padding-top: 12px; }
  .lf-current-preview-body { padding-block: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  #lf-preboot-shell.lf-current-welcome { transition: none; }
  .lf-current-status-indicator { animation: none; }
  .lf-returning-spinner { animation: none; }
}
