/* =============================================================================
 * styles.css — Collocations
 * Quiet, phone-first. Palette: sky-blue + turquoise + soft yellow.
 * Flip 3D: perspective lives on .flip-card, preserve-3d on .flip-inner only.
 * ========================================================================== */

:root {
  --c-blue:          #2f9fd4;
  --c-blue-600:      #2589ba;
  --c-blue-700:      #1f7fb0;
  --c-turquoise:     #2fc4c0;
  --c-turquoise-600: #22aaa6;
  --c-yellow:        #fff0b1;
  --c-yellow-deep:   #f4dd7a;

  --c-bg:        #f3f7f8;
  --c-bg-tint:   #eaf3f4;
  --c-surface:   #ffffff;
  --c-surface-2: #eef5f6;
  --c-ink:       #14343b;
  --c-ink-2:     #4a6b72;
  --c-ink-3:     #86a0a6;
  --c-line:      #e3eef0;
  --c-focus:     #2fc4c0;

  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-12: 48px;

  --r-sm:   12px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-pill: 999px;

  --sh-1:    0 1px 2px rgba(20, 52, 59, 0.04);
  --sh-2:    0 8px 24px rgba(20, 52, 59, 0.05);
  --sh-card: 0 1px 2px rgba(20, 52, 59, 0.04), 0 10px 28px rgba(20, 52, 59, 0.06);
  --sh-pop:  0 10px 22px rgba(47, 196, 192, 0.28);
  --sh-warm: 0 8px 18px rgba(244, 221, 122, 0.35);

  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fs-11: 0.6875rem;
  --fs-12: 0.75rem;
  --fs-13: 0.8125rem;
  --fs-15: 0.9375rem;
  --fs-17: 1.0625rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-28: 1.75rem;

  --dur-fast:      150ms;
  --dur-base:      250ms;
  --dur-slow:      480ms;
  --ease:          cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-emphatic: cubic-bezier(0.20, 0.80, 0.20, 1);

  --col-max: 600px;
  --gutter:  16px;
  --tabbar:  78px;
  --card-h:     252px;
  --card-max-w: 380px;
}
@media (min-width: 600px) {
  :root {
    --card-h:     292px;
    --card-max-w: 420px;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
  color-scheme: light;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  tap-highlight-color: rgba(0, 0, 0, 0);
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  color: var(--c-ink);
  background:
    radial-gradient(110% 50% at 50% -8%, #d7f1f4 0%, transparent 58%),
    var(--c-bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  max-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  touch-action: manipulation;
}

button,
[role="button"],
[role="tab"] {
  font: inherit;
  color: inherit;
  cursor: default;
  border: 0;
  background: none;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-user-drag: none;
  transition:
    transform 80ms ease-out,
    opacity 80ms ease-out,
    background-color 120ms ease-out,
    box-shadow 120ms ease-out,
    color 120ms ease-out;
}
button::-moz-focus-inner {
  border: 0;
  padding: 0;
}

:focus { outline: none; }
:focus-visible { outline: none; }
html.is-kb :focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

svg {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
  -webkit-user-drag: none;
}

.dash-kicker,
.dash-sub,
.g-page,
.quiz-gap,
.build-prompt,
.explanation,
.tk-why {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.wrap {
  width: 100%;
  max-width: var(--col-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------------------
 * HEADER
 * ------------------------------------------------------------------------- */
.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: 8px 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.brand:visited,
.brand:hover,
.brand:active {
  color: inherit;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: var(--sh-1);
  object-fit: cover;
  background: linear-gradient(160deg, var(--c-blue), var(--c-turquoise));
  -webkit-user-drag: none;
  user-select: none;
}

.app-header h1 {
  font-size: var(--fs-17);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--c-ink);
}
body.page-home .app-header h1,
body.page-grammar .app-header h1,
body.page-tricky .app-header h1,
body.page-translate .app-header h1 {
  opacity: 0;
  pointer-events: none;
}

body.page-tricky {
  background:
    radial-gradient(110% 48% at 50% -10%, #f6edc4 0%, transparent 56%),
    var(--c-bg);
}

body.page-translate {
  background:
    radial-gradient(110% 48% at 50% -10%, #cfeeee 0%, transparent 56%),
    var(--c-bg);
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  background: var(--c-yellow);
  border-radius: var(--r-pill);
  font-size: var(--fs-13);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c-ink);
  user-select: none;
  box-shadow: var(--sh-warm);
}
.streak .flame { font-size: 0.95rem; line-height: 1; }
.streak.pop { animation: streak-pop var(--dur-base) var(--ease-emphatic); }

@keyframes streak-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---------------------------------------------------------------------------
 * BOTTOM TABS
 * ------------------------------------------------------------------------- */
.tabs {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  width: calc(100% - 20px);
  max-width: var(--col-max);
  margin: 8px 10px calc(8px + env(safe-area-inset-bottom));
  padding: 5px;
  align-self: center;
  background: rgba(255, 255, 255, 0.88);
  border: 0;
  border-radius: 22px;
  box-shadow: var(--sh-2), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  min-width: 0;
  padding: 6px 0 5px;
  border: 0;
  background: transparent;
  color: var(--c-ink-3);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
  border-radius: 16px;
}
.tab svg { width: 18px; height: 18px; }
.tab.is-active {
  background: rgba(47, 196, 192, 0.14);
  color: var(--c-turquoise-600);
}
.tab:active { transform: scale(0.96); opacity: 1; }

/* ---------------------------------------------------------------------------
 * THEME CHIPS
 * ------------------------------------------------------------------------- */
.theme-bar {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding-block: 4px 8px;
  padding-inline: var(--gutter);
  max-width: var(--col-max);
  margin-inline: auto;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.theme-bar::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  min-height: 34px;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--c-surface);
  color: var(--c-ink-2);
  font-size: var(--fs-13);
  font-weight: 600;
  box-shadow: var(--sh-1);
}
.chip-emoji { font-size: var(--fs-13); line-height: 1; }
.chip.is-active {
  background: var(--c-yellow);
  color: var(--c-ink);
  box-shadow: var(--sh-warm);
}
.chip:active { transform: scale(0.97); }
.chip-due {
  margin-left: 1px;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  border-radius: var(--r-pill);
  background: rgba(20, 52, 59, 0.08);
  color: var(--c-ink);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.chip.is-active .chip-due { background: rgba(255, 255, 255, 0.7); }

/* ---------------------------------------------------------------------------
 * MAIN
 * ------------------------------------------------------------------------- */
.app-main {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.view {
  display: none;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
}
.view.is-active { display: flex; }

.is-hidden { display: none !important; }

/* ---------------------------------------------------------------------------
 * TOOLBARS
 * ------------------------------------------------------------------------- */
.cards-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: 4px 2px;
}

.progress { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.progress-count {
  font-size: var(--fs-15);
  font-weight: 650;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}
.progress-mode {
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--c-ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-group { display: flex; gap: 6px; align-items: center; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-width: 44px;
  min-height: 40px;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--c-surface);
  color: var(--c-blue-700);
  font-size: var(--fs-13);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--sh-1);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:active { transform: scale(0.96); }
.icon-btn:disabled,
.btn-primary:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.icon-btn.is-active {
  background: var(--c-turquoise);
  color: #fff;
  box-shadow: var(--sh-pop);
}

.label-collapsible { display: inline; }
@media (max-width: 380px) {
  .label-collapsible { display: none; }
  .icon-btn { padding-inline: 10px; }
}

/* ---------------------------------------------------------------------------
 * FLIP CARD
 * perspective on .flip-card only. preserve-3d on .flip-inner only.
 * ------------------------------------------------------------------------- */
.flip-stage {
  position: relative;
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px var(--gutter) 14px;
}

.flip-card {
  position: relative;
  z-index: 1;
  width: min(100%, var(--card-max-w));
  height: var(--card-h);
  max-height: calc(100% - 8px);
  flex-shrink: 0;
  perspective: 1600px;
  -webkit-perspective: 1600px;
  -webkit-user-drag: none;
  transition:
    opacity   var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease-emphatic),
    filter 80ms ease-out;
}

.flip-card.entering {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
}

.flip-card.answered-know  { animation: ack-know  var(--dur-base) var(--ease-emphatic); }
.flip-card.answered-learn { animation: ack-learn var(--dur-base) var(--ease); }

@keyframes ack-know {
  0%   { transform: scale(1) translateY(0); }
  40%  { transform: scale(1.02) translateY(-4px); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes ack-learn {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  75%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.flip-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform var(--dur-slow) var(--ease-emphatic);
}
.flip-card.is-flipped .flip-inner { transform: rotateY(180deg); }

.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 28px;
  background: var(--c-surface);
  box-shadow: var(--sh-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 44px 22px 38px;
  overflow: hidden;
  gap: 10px;
}

.face-front {
  background:
    radial-gradient(90% 70% at 50% 0%, #f4fcfd 0%, #ffffff 55%);
}

.face-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(90% 80% at 50% 100%, #e7f6f7 0%, #ffffff 58%);
}

.face-theme {
  position: absolute;
  top: 14px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--c-ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.face-theme > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.collocation {
  font-size: clamp(1.1rem, 5vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--c-ink);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.example {
  font-size: var(--fs-15);
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  color: var(--c-ink-2);
  max-width: 32ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.translation {
  font-size: clamp(1.15rem, 5vw, 1.5rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--c-blue-700);
  overflow-wrap: anywhere;
}

.explanation {
  font-size: var(--fs-13);
  line-height: 1.45;
  color: var(--c-ink-2);
  max-width: 34ch;
  background: var(--c-bg-tint);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.explanation:empty { display: none; }

.tap-hint {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: var(--fs-11);
  font-weight: 500;
  color: var(--c-ink-3);
  opacity: 0.55;
  user-select: none;
}
.tap-hint svg { width: 12px; height: 12px; }

.flip-card:active { filter: brightness(0.97); }

/* ---------------------------------------------------------------------------
 * ANSWERS
 * ------------------------------------------------------------------------- */
.answer-row {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-block: 4px 10px;
}

.answer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 50px;
  padding: 10px 12px;
  border-radius: var(--r-pill);
  border: 0;
  font-size: var(--fs-15);
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.answer svg { width: 16px; height: 16px; }
.answer:active { transform: scale(0.98); }

.answer-learn {
  background: var(--c-surface);
  color: var(--c-blue-700);
  box-shadow: var(--sh-1);
}
.answer-know {
  background: var(--c-yellow);
  color: var(--c-ink);
  box-shadow: var(--sh-warm);
}

@media (max-width: 360px) {
  .answer { font-size: var(--fs-13); padding-inline: 8px; }
  .answer svg { display: none; }
}

/* ---------------------------------------------------------------------------
 * EMPTY
 * ------------------------------------------------------------------------- */
.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-12) var(--sp-4);
}
.empty[hidden] { display: none; }

.empty-badge {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--c-surface);
  display: grid;
  place-items: center;
  color: var(--c-turquoise-600);
  box-shadow: var(--sh-2);
}
.empty-badge svg { width: 26px; height: 26px; }
.empty-title { font-size: var(--fs-20); font-weight: 650; color: var(--c-ink); }
.empty-sub { font-size: var(--fs-15); color: var(--c-ink-2); max-width: 28ch; }
.empty .icon-btn { margin-top: var(--sp-2); }

/* ---------------------------------------------------------------------------
 * BUTTONS
 * ------------------------------------------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-turquoise);
  color: #fff;
  font-size: var(--fs-17);
  font-weight: 650;
  letter-spacing: -0.02em;
  box-shadow: var(--sh-pop);
}
.btn-primary svg { width: 16px; height: 16px; }
.btn-primary:active { transform: scale(0.98); }

.btn-primary-inline {
  width: auto;
  min-height: 44px;
  padding-inline: var(--sp-4);
  font-size: var(--fs-15);
  border-radius: var(--r-pill);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-blue-700);
  font-size: var(--fs-15);
  font-weight: 650;
  box-shadow: var(--sh-1);
}
.btn-secondary:active { transform: scale(0.98); }

/* ---------------------------------------------------------------------------
 * HOME
 * ------------------------------------------------------------------------- */
.home-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-block: 12px 24px;
}
.home-scroll > * {
  flex-shrink: 0;
}

.dash-hero {
  padding: 8px 4px 0;
  background: transparent;
}
.dash-kicker {
  font-size: clamp(1.85rem, 7vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.12;
  color: var(--c-ink);
}
.dash-sub {
  margin-top: 10px;
  font-size: var(--fs-15);
  font-weight: 400;
  color: var(--c-ink-2);
  max-width: 24ch;
  line-height: 1.5;
}

.dash-actions {
  display: block;
}

.home-themes-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-section-title {
  font-size: var(--fs-13);
  font-weight: 650;
  color: var(--c-ink-2);
  margin: 0;
  padding-inline: 6px;
}

.theme-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  padding: 4px 0;
  box-shadow: var(--sh-2);
}

.theme-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 12px 18px 12px 14px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--c-ink);
  box-shadow: none;
}
.theme-row + .theme-row::before {
  content: "";
  position: absolute;
  left: 62px;
  right: 16px;
  top: 0;
  height: 1px;
  background: var(--c-line);
}
.theme-row:active { background: var(--c-bg-tint); }
.theme-row.is-due { background: transparent; }
.theme-row::after {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  margin-left: 6px;
  border-right: 1.6px solid var(--c-ink-3);
  border-bottom: 1.6px solid var(--c-ink-3);
  transform: rotate(-45deg);
  opacity: 0.45;
}
.theme-row-name {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-15);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.theme-row-meta {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--c-turquoise-600);
}

.ico-bubble {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--c-bg-tint);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

/* leftover unused tiles */
.theme-grid, .theme-tile { display: none; }

/* ---------------------------------------------------------------------------
 * QUIZ
 * ------------------------------------------------------------------------- */
.quiz-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 16px;
}
.quiz-scroll > * { flex-shrink: 0; }

.quiz-q { padding-top: 2px; }

.quiz-card {
  position: relative;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: 36px 20px 24px;
  text-align: center;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.quiz-card .collocation {
  font-size: clamp(1.15rem, 5vw, 1.45rem);
  font-weight: 700;
}
.quiz-card .face-theme {
  position: absolute;
}

.quiz-gap {
  font-size: clamp(1.05rem, 4.6vw, 1.25rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--c-ink);
  max-width: 34ch;
}
.quiz-gap[hidden],
.collocation[hidden],
.quiz-example[hidden] { display: none; }

.gap-blank {
  display: inline-block;
  min-width: 4.5ch;
  border-bottom: 1.5px solid var(--c-turquoise);
  color: var(--c-turquoise-600);
  font-weight: 700;
  padding-inline: 2px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.option-btn {
  width: 100%;
  min-height: 56px;
  padding: 16px 18px;
  text-align: left;
  background: var(--c-surface);
  border: 0;
  border-radius: 18px;
  color: var(--c-ink);
  font-size: var(--fs-15);
  font-weight: 550;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--sh-1);
}
.option-btn:active { transform: scale(0.985); }
.option-correct {
  background: var(--c-yellow);
  color: var(--c-ink);
  box-shadow: var(--sh-warm);
}
.option-missed { opacity: 0.4; }
.option-btn.is-odd { font-weight: 550; }

.opt-key { display: none; }
.opt-txt { min-width: 0; }

.quiz-card.is-in {
  animation: quiz-in var(--dur-base) var(--ease);
}
@keyframes quiz-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------------
 * TRICKY — soft noticing, phone-first
 * ------------------------------------------------------------------------- */
.tk-nudge {
  flex-shrink: 0;
  margin: 0 auto 2px;
  max-width: var(--col-max);
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--c-ink-3);
  letter-spacing: -0.01em;
}

.tk-stage {
  padding-top: 4px;
}
.tk-stage .flip-card {
  width: min(100%, 420px);
  height: min(360px, calc(100% - 4px));
}
@media (max-width: 380px) {
  .tk-stage .flip-card { height: min(330px, calc(100% - 4px)); }
}

.tk-card .face {
  text-align: left;
  align-items: stretch;
  justify-content: flex-start;
  padding: 48px 20px 56px;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tk-card .face-theme {
  justify-content: flex-start;
  left: 18px;
  right: 18px;
}
.tk-card .tap-hint {
  justify-content: flex-start;
  left: 20px;
  right: 20px;
  opacity: 0.5;
}

.tricky-badge {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 18px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--c-yellow);
  font-size: var(--fs-12);
  font-weight: 650;
  color: var(--c-ink);
  box-shadow: var(--sh-warm);
}

.tk-old-kicker[hidden] { display: none; }

.tricky-error {
  font-size: clamp(1.15rem, 5.4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.4;
  color: var(--c-ink);
  max-width: none;
  overflow-wrap: anywhere;
}

.tk-old {
  color: #8aa0a6;
  font-weight: 550;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #8aa0a6;
  text-decoration-skip-ink: none;
  -webkit-text-decoration-skip-ink: none;
}

.face-tricky {
  background:
    radial-gradient(120% 80% at 0% 0%, #fff8dc 0%, #fffdf8 52%);
}

.face-tricky-ok {
  background:
    radial-gradient(120% 80% at 100% 0%, #e7f7f6 0%, #ffffff 55%);
}

.tk-kicker {
  margin-top: 18px;
  font-size: var(--fs-13);
  font-weight: 550;
  color: var(--c-ink-3);
}

.tk-swap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 2px 0 4px;
}
.tk-swap[hidden] { display: none; }

.tk-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: var(--fs-15);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.tk-chip-old {
  background: var(--c-surface-2);
  color: var(--c-ink-3);
  font-weight: 550;
}
.tk-chip-new {
  background: var(--c-yellow);
  color: var(--c-ink);
  box-shadow: var(--sh-warm);
}
.tk-swap-to {
  font-size: var(--fs-15);
  font-weight: 700;
  color: var(--c-turquoise-600);
}

.tricky-correction {
  font-size: clamp(1.15rem, 5.4vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.35;
  color: var(--c-ink);
  max-width: none;
  overflow-wrap: anywhere;
}
.tk-mark {
  background: var(--c-yellow);
  border-radius: 6px;
  padding: 0 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.tk-why {
  font-size: var(--fs-13);
  line-height: 1.45;
  color: var(--c-ink-2);
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 12px;
  border-radius: 14px;
  max-width: none;
  -webkit-line-clamp: 4;
}
.tk-why[hidden] { display: none; }

.tk-listen-row {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-bottom: 2px;
  opacity: 0.38;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease);
}
#view-tricky.is-revealed .tk-listen-row {
  opacity: 1;
  pointer-events: auto;
}

.tk-listen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px 8px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-turquoise-600);
  font-size: var(--fs-13);
  font-weight: 650;
  box-shadow: var(--sh-1);
}
.tk-listen svg { width: 16px; height: 16px; }
.tk-listen:disabled { opacity: 0.7; }
.tk-listen:active:not(:disabled) { transform: scale(0.97); }

.tk-answers {
  opacity: 0.38;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease);
}
#view-tricky.is-revealed .tk-answers {
  opacity: 1;
  pointer-events: auto;
}

body.page-tricky .answer {
  min-height: 52px;
  font-size: var(--fs-13);
}

/* ---------------------------------------------------------------------------
 * BUILD
 * ------------------------------------------------------------------------- */
.build-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-block: 4px 16px;
}
.build-scroll > * { flex-shrink: 0; }

.build-prompt {
  font-size: clamp(1.15rem, 5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  text-align: center;
}
.build-hint {
  font-size: var(--fs-13);
  color: var(--c-ink-3);
  text-align: center;
  margin-top: -6px;
}
.build-hint:empty { display: none; }

.build-slots {
  min-height: 84px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  padding: 14px;
  background: var(--c-surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.build-slots.is-ready { background: #eefafa; }

.build-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.build-token {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--c-surface);
  color: var(--c-ink);
  font-size: var(--fs-15);
  font-weight: 650;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: var(--sh-1);
}
.build-token:active { transform: scale(0.96); }
.build-token.is-placed {
  background: var(--c-bg-tint);
  color: var(--c-blue-700);
}
.build-token.is-ghost {
  opacity: 0.35;
  pointer-events: none;
}

.build-feedback {
  min-height: 22px;
  text-align: center;
  font-size: var(--fs-15);
  font-weight: 550;
  color: var(--c-turquoise-600);
}
.build-feedback.is-retry { color: var(--c-ink-2); }
.build-feedback:empty { min-height: 0; }

.build-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

/* ---------------------------------------------------------------------------
 * GRAMMAR
 * ------------------------------------------------------------------------- */
.g-picks {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 2px var(--gutter) 8px;
  max-width: var(--col-max);
  margin-inline: auto;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.g-picks::-webkit-scrollbar { display: none; }

.g-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-ink-2);
  font-size: var(--fs-13);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--sh-1);
}
.g-chip > span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.95em;
}
.g-chip.is-active {
  background: var(--c-yellow);
  color: var(--c-ink);
  box-shadow: var(--sh-warm);
}
.g-chip:active { transform: scale(0.97); }

.g-stage {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  padding: 0 var(--gutter) 4px;
}

.g-page {
  width: 100%;
  max-width: var(--col-max);
  margin-inline: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 2px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  touch-action: pan-y;
}
.g-page.is-in-right {
  animation: g-in-right var(--dur-base) var(--ease);
}
.g-page.is-in-left {
  animation: g-in-left var(--dur-base) var(--ease);
}
@keyframes g-in-right {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes g-in-left {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: none; }
}

.g-kicker { display: none; }

.g-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 6.6vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.18;
  color: var(--c-ink);
}
.g-emoji {
  font-size: 1.12em;
  line-height: 1.18;
  letter-spacing: 0;
  flex-shrink: 0;
  width: 1.25em;
  text-align: center;
  margin-top: 0.04em;
}

.g-label {
  margin: 0 0 8px;
  padding: 0;
  font-size: var(--fs-13);
  font-weight: 550;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
  color: var(--c-ink-3);
}

.g-speak {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  color: inherit;
  border: 0;
  text-align: left;
  background: transparent;
}
.g-speak-text { min-width: 0; }
.g-speak-ico {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(47, 196, 192, 0.16);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2322aaa6' d='M3 9.5v5h3.4L12 19V5L6.4 9.5H3zm12.8-1.4a4.8 4.8 0 0 1 0 7.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 46% 50%;
  background-size: 14px;
}
.g-speak:active .g-speak-ico {
  background-color: rgba(47, 196, 192, 0.28);
}

.g-mark {
  background: var(--c-yellow);
  border-radius: 5px;
  padding: 0 4px;
  font-weight: 700;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.g-visual {
  margin: 0 0 22px;
}

.g-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  column-gap: 8px;
  row-gap: 12px;
  padding: 0;
}
.g-slot {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.g-slot-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: max-content;
  min-width: 0;
}
.g-slot-pill {
  min-height: 44px;
  padding: 0 8px 0 14px;
  border-radius: 16px;
  font-size: var(--fs-15);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  gap: 8px;
  width: max-content;
}
.g-slot-pill .g-speak-ico {
  width: 24px;
  height: 24px;
  background-size: 12px;
}
.g-slot-pill:active { transform: scale(0.97); }
.g-slot-pill.is-teal { background: #d9f4f2; color: var(--c-turquoise-600); }
.g-slot-pill.is-blue { background: #dcebf6; color: var(--c-blue-700); }
.g-slot-pill.is-yellow { background: var(--c-yellow); color: var(--c-ink); }
.g-slot-pill.is-soft { background: var(--c-surface); color: var(--c-ink); }
.g-slot-note {
  font-size: var(--fs-12);
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-ink-3);
  text-align: left;
  line-height: 1.3;
  padding: 0 2px;
  width: 0;
  min-width: 100%;
}
.g-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 44px;
  margin: 0;
  padding: 0;
  color: var(--c-ink-3);
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1;
  flex-shrink: 0;
  transform: translateY(1px);
}

.g-buckets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.g-bucket {
  background: var(--c-surface);
  border-radius: 22px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  box-shadow: var(--sh-1);
}
.g-bucket-title {
  font-size: var(--fs-17);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.g-bucket-note {
  font-size: var(--fs-13);
  color: var(--c-ink-3);
  margin: 0;
  line-height: 1.4;
}
.g-bucket-title + .g-bucket-note { margin-top: -2px; }
.g-bucket-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.g-mini {
  min-height: 40px;
  padding: 0 8px 0 12px;
  border-radius: var(--r-pill);
  background: var(--c-bg-tint);
  font-size: var(--fs-13);
  font-weight: 650;
  color: var(--c-ink);
  gap: 8px;
}
.g-mini .g-speak-ico {
  width: 22px;
  height: 22px;
  background-size: 11px;
}
.g-mini:active { transform: scale(0.97); }

.g-pairs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.g-pair {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.g-pair-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--c-yellow);
  color: var(--c-ink);
  font-weight: 700;
  font-size: var(--fs-12);
  line-height: 1;
  transform: none;
}
.g-pair-card {
  background: var(--c-surface);
  border-radius: 20px;
  padding: 14px 14px 12px;
  min-width: 0;
  box-shadow: var(--sh-1);
}
.g-pair-text {
  width: 100%;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-15);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
  gap: 10px;
}
.g-pair-text .g-speak-text { flex: 1; }
.g-pair-text:active { transform: scale(0.99); }
.g-pair-note {
  margin: 8px 0 0;
  font-size: var(--fs-13);
  color: var(--c-ink-3);
  line-height: 1.4;
}

.g-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.g-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--c-surface);
  border-radius: 20px;
  padding: 14px 14px 14px 12px;
  box-shadow: var(--sh-1);
}
.g-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 0;
  border-radius: 50%;
  background: #d9f4f2;
  color: var(--c-turquoise-600);
  font-size: var(--fs-13);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.g-step-body { flex: 1; min-width: 0; }
.g-step-title {
  font-size: var(--fs-15);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 28px;
}
.g-step-note {
  margin-top: 2px;
  font-size: var(--fs-13);
  color: var(--c-ink-2);
  line-height: 1.45;
}
.g-step-ex {
  width: 100%;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border-radius: 14px;
  background: var(--c-bg-tint);
  font-size: var(--fs-15);
  font-style: italic;
  font-weight: 550;
  color: var(--c-blue-700);
  gap: 8px;
}
.g-step-ex .g-speak-text { flex: 1; }
.g-step-ex:active { transform: scale(0.99); }

.g-fill {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 0;
}
.g-fill-empty {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--c-surface);
  color: var(--c-ink-3);
  font-size: var(--fs-15);
  font-weight: 600;
  box-shadow: var(--sh-1);
}
.g-fill-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 24px;
  padding: 3px 10px;
  margin: 2px 0;
  border-radius: var(--r-pill);
  background: #d9f4f2;
  color: var(--c-turquoise-600);
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: 1;
}
.g-fill-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 18px;
  background: var(--c-surface);
  box-shadow: var(--sh-1);
}
.g-fill-rest {
  font-size: var(--fs-15);
  font-weight: 650;
  color: var(--c-ink);
  line-height: 1.2;
}

.g-contrast {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 22px;
}
.g-contrast-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.g-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 24px;
  padding: 3px 10px;
  margin: 2px 0;
  border-radius: var(--r-pill);
  background: var(--c-yellow);
  color: var(--c-ink);
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: 1;
}
.g-contrast-bad,
.g-contrast-good {
  margin: 0;
  font-size: var(--fs-15);
  line-height: 1.45;
  padding: 14px 14px 14px 16px;
  border-radius: 20px;
  box-shadow: var(--sh-1);
}
.g-contrast-bad {
  background: var(--c-surface);
  color: var(--c-ink-3);
}
.g-contrast-good {
  width: 100%;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  background: #d9f4f2;
  color: var(--c-ink);
  font-weight: 550;
}
.g-contrast-good .g-speak-text { flex: 1; }
.g-contrast-good:active { transform: scale(0.99); }
.g-caption {
  display: block;
  margin: 0 0 6px;
  font-size: var(--fs-12);
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
  color: var(--c-ink-3);
}

.g-rule {
  margin: 0 0 22px;
  font-size: var(--fs-15);
  font-weight: 500;
  line-height: 1.5;
  color: var(--c-turquoise-600);
}

.g-examples {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 22px;
  padding: 4px;
  background: var(--c-surface);
  border-radius: 20px;
  box-shadow: var(--sh-1);
}

.g-line {
  width: 100%;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--c-ink);
  font-size: var(--fs-15);
  font-style: italic;
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.45;
  padding: 10px 8px 10px 14px;
  border-radius: 16px;
  box-shadow: none;
  gap: 8px;
}
.g-line .g-speak-text { flex: 1; }
.g-line:active { background: var(--c-bg-tint); }

.g-why {
  font-size: var(--fs-15);
  line-height: 1.55;
  color: var(--c-ink-2);
}

.g-soft {
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--c-ink-3);
  padding: 14px 16px;
  background: var(--c-surface);
  border-radius: 20px;
  box-shadow: var(--sh-1);
}
.g-soft span {
  display: block;
  margin-bottom: 4px;
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-ink-3);
}

.g-more {
  align-self: flex-start;
  min-height: 44px;
  margin: 2px 0 0;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-ink-2);
  font-size: var(--fs-15);
  font-weight: 600;
  box-shadow: var(--sh-1);
}
.g-more:active { transform: scale(0.97); }
.g-more[aria-expanded="true"] {
  background: var(--c-yellow);
  color: var(--c-ink);
  box-shadow: var(--sh-warm);
}

.g-hint {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 0;
  font-size: var(--fs-15);
  line-height: 1.55;
  color: var(--c-ink-2);
  padding: 14px 16px;
  background: var(--c-surface);
  border-radius: 20px;
  box-shadow: var(--sh-1);
}
.g-hint[hidden] { display: none; }
.g-hint p { margin: 0; }

.g-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 6px 8px;
}

.g-nav-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-ink);
  box-shadow: var(--sh-1);
}
.g-nav-btn svg { width: 20px; height: 20px; }
.g-nav-btn:active { transform: scale(0.96); }

.g-pos {
  font-size: var(--fs-13);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--c-ink-3);
  line-height: 1;
}

/* ---------------------------------------------------------------------------
 * TRANSLATE
 * ------------------------------------------------------------------------- */
.tr-ways {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  padding: 4px;
  max-width: var(--col-max);
  margin-inline: auto;
  background: var(--c-surface);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-1);
}
.tr-way {
  flex: 1 1 0;
  min-height: 40px;
  padding: 6px 6px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--c-ink-2);
  font-size: var(--fs-12);
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.tr-way.is-active {
  background: var(--c-yellow);
  color: var(--c-ink);
  box-shadow: var(--sh-warm);
}
.tr-way:active { transform: scale(0.98); }

.tr-nudge {
  flex-shrink: 0;
  margin: 8px auto 4px;
  max-width: var(--col-max);
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--c-ink-3);
  letter-spacing: -0.01em;
}

.tr-stage {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  align-items: center;
  padding-block: 8px 10px;
}

.tr-card {
  width: 100%;
  max-width: var(--col-max);
  min-height: 220px;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--c-surface);
  border-radius: 28px;
  box-shadow: var(--sh-card);
  padding: 48px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  position: relative;
}
.tr-card.is-in {
  animation: quiz-in var(--dur-base) var(--ease);
}
.tr-card.answered-know  { animation: ack-know  var(--dur-base) var(--ease-emphatic); }
.tr-card.answered-learn { animation: ack-learn var(--dur-base) var(--ease); }
.tr-card.is-to-en {
  background:
    radial-gradient(120% 80% at 0% 0%, #e7f7f6 0%, #ffffff 58%);
}

.tr-card .face-theme {
  justify-content: flex-start;
  left: 18px;
  right: 18px;
}

.tr-path {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 2px;
}
.tr-lang {
  min-height: 28px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.tr-lang.is-from {
  background: #dcebf6;
  color: var(--c-blue-700);
}
.tr-lang.is-to {
  background: var(--c-yellow);
  color: var(--c-ink);
}
.tr-path-arrow {
  color: var(--c-ink-3);
  font-weight: 700;
}

.tr-dir {
  font-size: var(--fs-15);
  font-weight: 650;
  color: var(--c-turquoise-600);
}

.tr-prompt {
  font-size: clamp(1.35rem, 6.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.22;
  color: var(--c-ink);
  overflow-wrap: anywhere;
}
.tr-prompt.is-sentence {
  font-size: clamp(1.12rem, 5.1vw, 1.42rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.38;
}
.tr-mark {
  background: var(--c-yellow);
  color: var(--c-ink);
  font-style: normal;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.tr-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.tr-slot {
  min-height: 44px;
  min-width: 52px;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: var(--fs-15);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}
.tr-slot.is-empty {
  min-width: 64px;
  background: var(--c-surface-2);
  box-shadow: inset 0 0 0 1.5px var(--c-line);
}
.tr-slot.is-hint {
  background: var(--c-yellow);
  color: var(--c-ink-3);
}
.tr-slot.is-on.is-teal { background: #d9f4f2; color: var(--c-turquoise-600); }
.tr-slot.is-on.is-blue { background: #dcebf6; color: var(--c-blue-700); }
.tr-slot.is-on.is-yellow { background: var(--c-yellow); color: var(--c-ink); }
.tr-slot.is-on.is-soft { background: var(--c-surface-2); color: var(--c-ink); }

.tr-count {
  font-size: var(--fs-12);
  font-weight: 550;
  color: var(--c-ink-3);
}
.tr-count:empty { display: none; }

.tr-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.tr-pair-ru,
.tr-pair-en {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: var(--fs-13);
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tr-pair-ru { background: #dcebf6; color: var(--c-blue-700); }
.tr-pair-en { background: var(--c-yellow); color: var(--c-ink); }
.tr-pair-eq {
  color: var(--c-ink-3);
  font-weight: 700;
}

.tr-example {
  font-size: var(--fs-15);
  font-style: italic;
  color: var(--c-ink-2);
  line-height: 1.45;
}
.tr-example:empty { display: none; }

.tr-peek-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--c-yellow);
  color: var(--c-ink);
  font-size: var(--fs-17);
  font-weight: 700;
  box-shadow: var(--sh-warm);
}
.tr-peek-chip[hidden] { display: none; }

.tr-answer {
  width: 100%;
  margin-top: 8px;
  padding: 14px 14px 12px;
  background: #d9f4f2;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tr-answer[hidden] { display: none; }

.tr-kicker {
  font-size: var(--fs-12);
  font-weight: 550;
  color: var(--c-ink-3);
}

.tr-result {
  font-size: clamp(1.2rem, 5.4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  color: var(--c-ink);
  overflow-wrap: anywhere;
}

.tr-note {
  font-size: var(--fs-13);
  color: var(--c-ink-2);
  line-height: 1.45;
}
.tr-note:empty { display: none; }

.tr-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-block: 4px 6px;
}
.tr-actions .icon-btn,
.tr-actions .btn-primary {
  min-height: 44px;
}
#view-translate.is-revealed .tr-actions {
  opacity: 0.38;
  pointer-events: none;
}

.tr-answers {
  opacity: 0.38;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease);
}
#view-translate.is-revealed .tr-answers {
  opacity: 1;
  pointer-events: auto;
}

body.page-translate .answer {
  min-height: 52px;
  font-size: var(--fs-13);
}

/* ---------------------------------------------------------------------------
 * SESSION
 * ------------------------------------------------------------------------- */
.session-hits {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--c-ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.session-meter {
  flex-shrink: 0;
  height: 3px;
  padding-inline: var(--gutter);
  max-width: var(--col-max);
  margin-inline: auto;
  width: 100%;
  background: transparent;
}
.session-meter-fill {
  height: 100%;
  width: 0%;
  background: var(--c-turquoise);
  border-radius: var(--r-pill);
  transition: width var(--dur-base) var(--ease);
}

.session-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(20, 52, 59, 0.32);
  animation: sheet-in var(--dur-base) var(--ease);
}
.session-sheet[hidden] { display: none; }
.session-sheet-card {
  width: 100%;
  max-width: var(--col-max);
  background: var(--c-surface);
  border-radius: 28px;
  box-shadow: var(--sh-card);
  padding: 32px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  animation: sheet-up var(--dur-base) var(--ease);
}
.session-kicker {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--c-ink-3);
}
.session-title {
  font-size: var(--fs-24);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.session-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.session-pill {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--c-yellow);
  font-size: var(--fs-13);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.session-pill-soft {
  background: var(--c-surface-2);
  color: var(--c-ink-2);
}
.session-stats {
  font-size: var(--fs-15);
  color: var(--c-ink-2);
  margin-bottom: 6px;
}

@keyframes sheet-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes sheet-up {
  from { transform: translateY(12px); }
  to   { transform: none; }
}

/* ---------------------------------------------------------------------------
 * PWA
 * ------------------------------------------------------------------------- */
.pwa-offline {
  flex-shrink: 0;
  z-index: 25;
  margin: 0 10px 4px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--c-yellow);
  color: var(--c-ink);
  font-size: var(--fs-13);
  font-weight: 650;
  text-align: center;
  box-shadow: var(--sh-warm);
}
.pwa-offline[hidden] { display: none; }

.pwa-update {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 24px);
  max-width: var(--col-max);
  padding: 10px 10px 10px 16px;
  border-radius: var(--r-lg);
  background: var(--c-surface);
  color: var(--c-ink);
  box-shadow: var(--sh-card);
}
.pwa-update[hidden] { display: none; }
.pwa-update p {
  flex: 1;
  font-size: var(--fs-13);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.pwa-update button {
  flex-shrink: 0;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--c-turquoise);
  color: #fff;
  font-size: var(--fs-13);
  font-weight: 700;
}

.pwa-chip {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 28;
  display: flex;
  align-items: stretch;
  width: calc(100% - 24px);
  max-width: var(--col-max);
  padding: 6px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(47, 196, 192, 0.28);
  box-shadow: var(--sh-card), 0 12px 32px rgba(47, 159, 212, 0.14);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  animation: pwa-chip-in 520ms var(--ease-emphatic);
}
.pwa-chip[hidden] { display: none; }
.pwa-chip-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  min-height: 56px;
  padding: 4px 8px 4px 4px;
  text-align: left;
  border-radius: 16px;
}
.pwa-chip-icon {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}
.pwa-chip-icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 210, 63, 0.55), transparent 68%);
  animation: pwa-glow 2.4s var(--ease) infinite;
  pointer-events: none;
}
.pwa-chip-icon img {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: var(--sh-1);
}
.pwa-chip-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.pwa-chip-kicker {
  font-size: var(--fs-11);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-turquoise-600);
}
.pwa-chip-title {
  font-size: var(--fs-15);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--c-ink);
}
.pwa-chip-x {
  flex-shrink: 0;
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--c-ink-3);
  border-radius: var(--r-pill);
}
.pwa-chip-x svg { width: 18px; height: 18px; }

.pwa-sheet {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(20, 52, 59, 0.28);
  animation: sheet-in var(--dur-base) var(--ease);
}
.pwa-sheet[hidden] { display: none; }
.pwa-sheet-card {
  position: relative;
  width: 100%;
  max-width: var(--col-max);
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(47, 196, 192, 0.22), transparent 46%),
    radial-gradient(90% 70% at 0% 0%, rgba(255, 210, 63, 0.28), transparent 42%),
    var(--c-surface);
  border-radius: 28px;
  box-shadow: var(--sh-card);
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  animation: sheet-up 420ms var(--ease-emphatic);
}
.pwa-dock {
  position: relative;
  height: 118px;
  display: grid;
  place-items: end center;
  margin: -4px -8px 4px;
}
.pwa-dock-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 196, 192, 0.28), transparent 68%);
  top: -12px;
  pointer-events: none;
}
.pwa-dock-bar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  width: min(78%, 280px);
  height: 72px;
  padding: 10px 18px 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(227, 238, 240, 0.9);
  box-shadow: var(--sh-2);
  backdrop-filter: blur(10px);
}
.pwa-dock-ghost {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--c-surface-2);
  opacity: 0.85;
}
.pwa-dock-app {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 10px 18px rgba(47, 159, 212, 0.28);
  animation: pwa-dock-pop 900ms var(--ease-emphatic) both;
}
.pwa-sheet-kicker {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--c-ink-3);
}
.pwa-sheet-title {
  font-size: var(--fs-24);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.pwa-sheet-copy {
  font-size: var(--fs-15);
  color: var(--c-ink-2);
  margin-bottom: 4px;
}
.pwa-ios-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
}
.pwa-ios-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  font-size: var(--fs-11);
  font-weight: 650;
  color: var(--c-ink-2);
  line-height: 1.25;
}
.pwa-ios-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--c-bg-tint);
  color: var(--c-blue-700);
  font-size: 1.15rem;
  font-weight: 700;
}
.pwa-ios-ico svg { width: 20px; height: 20px; }
.pwa-ios-ico img { width: 22px; height: 22px; border-radius: 6px; }
.pwa-ios-ico-hot {
  background: var(--c-yellow);
  color: var(--c-ink);
  box-shadow: var(--sh-warm);
}
.pwa-ios-steps[hidden] { display: none; }

@keyframes pwa-chip-in {
  from { opacity: 0; transform: translateX(-50%) translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes pwa-glow {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.08); }
}
@keyframes pwa-dock-pop {
  0%   { transform: translateY(18px) scale(0.84); opacity: 0; }
  60%  { transform: translateY(-6px) scale(1.04); opacity: 1; }
  100% { transform: none; }
}

@media (min-width: 768px) {
  .pwa-sheet { align-items: center; }
}

.pwa-data {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 6px 8px;
  color: var(--c-ink-3);
  font-size: var(--fs-12);
  text-align: center;
}
.pwa-data-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.pwa-data-btn {
  min-height: 44px;
  padding: 8px 4px;
  color: var(--c-blue-700);
  font-size: var(--fs-13);
  font-weight: 650;
}

/* ---------------------------------------------------------------------------
 * RESPONSIVE
 * ------------------------------------------------------------------------- */
@media (max-width: 400px) {
  :root { --gutter: 14px; }
  .tab { font-size: 8px; }
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
  .answer { min-height: 52px; }
  .session-sheet { align-items: center; }
  .tabs {
    max-width: var(--col-max);
    margin-inline: auto;
  }
}

@media (min-width: 1024px) {
  :root { --col-max: 640px; }
}

@media (hover: hover) and (min-width: 900px) {
  .opt-key {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--c-surface-2);
    color: var(--c-ink-3);
    font-size: var(--fs-11);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
  }
  .option-correct .opt-key { background: #fff; color: var(--c-ink); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .flip-inner { transition: none; }
}
