/* Aurora: reading room, stories, vocabulary book, lessons mode and lesson library
   Owned by the "library" screen group, and only by it. Loaded after /style.css and
   /aurora/base.css, so a rule here overrides both. Never edit style.css or
   base.css from here: use the tokens (--au-*, --ink, --muted...) and the base
   pieces (.card, .btn.brand, .au-hero, .au-tile, .au-chip, .au-stat, .au-ring,
   .au-progress, .seg/.tabs, .au-row, .au-dock...) described in base.css.
   Scope every rule to this group's own classes.

   The phone app is the reference (linguino-mobile/mobile/src/screens/
   Reading.tsx, Story.tsx, Vocab.tsx and ui/StoryParts.tsx):
   - a story or a text is a cover: a full-bleed gradient of two unit hues
     (--ca, --cb, set by web/shared/reading.tsx coverVars), a Fluent picture,
     a dark fade at the bottom and white words. Covers are dark islands in
     the day theme too;
   - levels and topics show their hue only as a glowing dot or a soft glow;
   - a word to tap gets a teal underline; a tapped word a soft orange wash;
   - one orange (.btn.brand) per screen: keeping a word is violet. */

/* ======================================================================
   Shared pieces
   ====================================================================== */

/* A level as a glass chip with a glowing dot of its hue (A1 teal, A2 sky,
   B1 orange, B2 violet). */
.rd-level, .ls-level-pill {
  --lv: var(--au-teal);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px 2px 7px; border-radius: 999px; border: 0;
  font: 700 11.5px/1.5 var(--font); letter-spacing: 0.04em; color: var(--ink);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.rd-level::before, .ls-level-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--lv); box-shadow: 0 0 8px 1px color-mix(in srgb, var(--lv) 60%, transparent);
}
.rd-level.lv-a1, .ls-level:has(.lv-A1) .ls-level-pill { --lv: #3ee6c8; }
.rd-level.lv-a2, .ls-level:has(.lv-A2) .ls-level-pill { --lv: #5ab8ff; }
.rd-level.lv-b1, .ls-level:has(.lv-B1) .ls-level-pill { --lv: #ff9a4d; }
.rd-level.lv-b2, .ls-level:has(.lv-B2) .ls-level-pill { --lv: #9a83ff; }
:root[data-theme="light"] .rd-level.lv-a1, :root[data-theme="light"] .ls-level:has(.lv-A1) .ls-level-pill { --lv: #0fb39b; }
:root[data-theme="light"] .rd-level.lv-a2, :root[data-theme="light"] .ls-level:has(.lv-A2) .ls-level-pill { --lv: #2a8de0; }
:root[data-theme="light"] .rd-level.lv-b1, :root[data-theme="light"] .ls-level:has(.lv-B1) .ls-level-pill { --lv: #f07a1a; }
:root[data-theme="light"] .rd-level.lv-b2, :root[data-theme="light"] .ls-level:has(.lv-B2) .ls-level-pill { --lv: #6b56f0; }

/* A progress line: teal to violet on a quiet track (base .au-progress). */
.vb-meter, .ls-progress {
  display: block; height: 6px; border-radius: 99px; overflow: hidden;
  background: var(--line-hi);
}
.vb-meter > *, .ls-progress > div {
  display: block; height: 100%; min-width: 6px; border-radius: inherit;
  background: var(--au-progress); transition: width var(--dur-4) var(--ease-out);
}

/* The cover's sky: a gradient of the two hues into deep violet, a star glow
   behind the picture and a few specks of starlight at fixed places. */
.rd-cover, .st-cover, .rd-head-art { --ca: #5ab8ff; --cb: #9a83ff; --deep: #1b1d50; }
.rd-cover-art, .st-cover-art, .rd-head-art {
  background:
    radial-gradient(circle at 12% 14%, rgba(234, 244, 255, 0.8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 30% 32%, rgba(234, 244, 255, 0.7) 0 0.8px, transparent 1.4px),
    radial-gradient(circle at 8% 46%, rgba(234, 244, 255, 0.7) 0 0.8px, transparent 1.4px),
    radial-gradient(circle at 46% 10%, rgba(234, 244, 255, 0.8) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 22% 60%, rgba(234, 244, 255, 0.6) 0 0.6px, transparent 1.2px),
    radial-gradient(70% 55% at 78% 22%, rgba(234, 244, 255, 0.3), transparent 70%),
    linear-gradient(160deg, var(--ca) 0%, var(--cb) 62%, var(--deep) 100%);
  background-color: var(--deep);
}
.rd-cover-pic, .st-cover-pic, .rd-head-art > .pic, .rd-head-art > span {
  display: block; width: var(--pic, 42px); height: var(--pic, 42px); font-size: var(--pic, 42px); line-height: 1;
  object-fit: contain; filter: drop-shadow(0 8px 12px rgba(4, 10, 25, 0.35));
}

/* ======================================================================
   Story covers (the library, the profile's shelf, a room's picker)
   ====================================================================== */

.st-cover {
  --pic: 88px;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch;
  height: 210px; min-width: 0; padding: 12px 14px 14px;
  border: 0; border-radius: var(--au-r-tile);
  background: var(--deep); color: #fff; text-align: left; font: inherit; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 18px 34px -18px color-mix(in srgb, var(--cb) 70%, #000);
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2);
}
.st-cover-art { position: absolute; inset: 0; z-index: -1; display: block; height: auto; overflow: hidden; }
/* The dark fade the words sit on. */
.st-cover-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 10, 25, 0) 34%, rgba(4, 10, 25, 0.7)); }
.st-cover-pic { position: absolute; top: 26px; right: 14px; transform: rotate(-8deg); }
@media (hover: hover) and (pointer: fine) {
  .st-cover:hover { transform: translateY(-2px); filter: brightness(1.06) saturate(1.05); }
  .st-cover:hover .st-cover-pic { transform: rotate(-3deg) scale(1.06); }
}
.st-cover-pic { transition: transform var(--dur-3) var(--ease-spring); }
.st-cover:active { transform: scale(0.97); }
.st-cover:focus-visible { outline: 2px solid var(--au-teal); outline-offset: 3px; }
.st-cover > .rd-level {
  position: absolute; left: 12px; top: 12px; padding: 2px 8px; gap: 0;
  background: rgba(255, 255, 255, 0.88); color: #1b1d50; box-shadow: none; letter-spacing: 0.05em;
}
.st-cover > .rd-level::before { display: none; }
.st-cover-body { position: relative; display: grid; gap: 2px; padding: 0; }
.st-cover-title {
  font: 600 17px/1.18 var(--display); letter-spacing: -0.01em; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 12px rgba(4, 10, 25, 0.35);
}
.st-cover-tr { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-cover-found {
  position: static; display: flex; align-items: center; gap: 5px; margin-top: 6px; padding: 0; background: none; border-radius: 0;
  font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.82); white-space: nowrap; overflow: hidden;
}
.st-cover-found .i { width: 13px; height: 13px; flex: none; }
.st-cover-found.all { color: var(--au-gold); }
.st-cover-min { color: rgba(255, 255, 255, 0.7); overflow: hidden; text-overflow: ellipsis; }
.st-cover.lg { --pic: 74px; height: 166px; }
.st-cover.lg .st-cover-art { height: auto; }
.st-cover.lg .st-cover-pic { top: 20px; right: 10px; }
.st-cover.lg .st-cover-min { display: none; }

/* The library: two to a row on a phone, a grid that uses the width above. */
.st-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 641px) { .st-grid { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
@media (min-width: 1024px) { .st-grid .st-cover { --pic: 96px; height: 232px; } }
@media (max-width: 380px) { .st-grid .st-cover { --pic: 70px; height: 190px; padding: 10px 12px 12px; } }

/* The profile's shelf: 138 × 166 covers that scroll past the screen edge on a
   phone, a row of four on a wide screen. */
.st-shelf-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 640px) {
  .st-shelf-row {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--au-gutter)); padding: 2px var(--au-gutter) 10px; scroll-padding: 0 var(--au-gutter);
  }
  .st-shelf-row::-webkit-scrollbar { display: none; }
  .st-shelf-row .st-cover { flex: 0 0 138px; width: 138px; scroll-snap-align: start; }
}
@media (min-width: 641px) { .st-shelf-row .st-cover.lg { --pic: 84px; height: 190px; } }

/* ======================================================================
   Reading covers: a row in the library, a standing cover on the shelf
   ====================================================================== */

.rd-cover {
  --pic: 42px;
  display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: none; gap: 14px; align-items: center;
  min-width: 0; padding: 12px; overflow: visible;
  border: 0; border-radius: var(--au-r-tile); color: var(--ink); text-align: left; font: inherit; cursor: pointer;
  background-color: var(--au-glass-base); background-image: var(--au-glass);
  box-shadow: var(--au-shadow);
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2);
}
@media (hover: hover) and (pointer: fine) { .rd-cover:hover { transform: translateY(-1px); filter: brightness(1.07); border-color: transparent; box-shadow: var(--au-shadow); } }
.rd-cover:active { transform: scale(0.985); }
.rd-cover-art {
  position: relative; display: grid; place-items: center; width: 64px; height: 84px; overflow: hidden;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.rd-cover-body { display: grid; gap: 4px; align-content: center; min-width: 0; padding: 2px 0; }
.rd-cover-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rd-cover-done {
  position: static; display: inline-flex; gap: 4px; align-items: center; padding: 0; background: none; border-radius: 0;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.rd-cover-done.good { color: var(--au-teal); }
.rd-cover-done .i { width: 14px; height: 14px; }
.rd-cover-meta { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rd-cover-meta .i { width: 13px; height: 13px; }
.rd-cover-title {
  font: 600 16.5px/1.2 var(--display); letter-spacing: -0.01em; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rd-cover-sum { font-size: 13px; line-height: 18px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rd-cover.read .rd-cover-art::after {
  content: ''; position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--au-teal); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--au-teal) 60%, transparent);
}

/* On the shelf the cover stands above the words. */
.rd-cover.lg { --pic: 64px; grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; gap: 10px; padding: 8px 8px 14px; }
.rd-cover.lg .rd-cover-art { width: auto; height: 116px; border-radius: 16px; }
.rd-cover.lg .rd-cover-art .rd-cover-pic { transform: rotate(-6deg); }
.rd-cover.lg .rd-cover-body { padding: 0 6px; align-content: start; }
.rd-cover.lg .rd-cover-title { font-size: 16px; }

/* The profile's reading shelf: four in a row, two on a tablet, a strip that
   scrolls past the edge on a phone. */
.rd-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .rd-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .rd-shelf {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--au-gutter)); padding: 2px var(--au-gutter) 10px; scroll-padding: 0 var(--au-gutter);
  }
  .rd-shelf::-webkit-scrollbar { display: none; }
  .rd-shelf .rd-cover { flex: 0 0 168px; scroll-snap-align: start; }
}

/* A shelf that scrolls sideways fades out at its edges instead of cutting a
   cover in half: the right edge says "there is more", the left edge fades in
   once it has been scrolled. Where scroll timelines exist the fades follow
   the scroll (none on the left at the start, none on the right at the end);
   elsewhere only the right edge fades. The same media queries as the rules
   that make the rows scroll, here and in profile.css. */
@property --au-shelf-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --au-shelf-r { syntax: '<length>'; inherits: false; initial-value: 56px; }
@keyframes au-shelf-edges {
  0% { --au-shelf-l: 0px; --au-shelf-r: 56px; }
  8% { --au-shelf-l: 32px; }
  92% { --au-shelf-r: 56px; }
  100% { --au-shelf-l: 32px; --au-shelf-r: 0px; }
}
@media (max-width: 1023px) {
  .pf-shelf .rd-shelf, .pf-stories .st-shelf-row {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--au-shelf-l), #000 calc(100% - var(--au-shelf-r)), transparent);
    mask-image: linear-gradient(to right, transparent, #000 var(--au-shelf-l), #000 calc(100% - var(--au-shelf-r)), transparent);
  }
}
@media (max-width: 640px) {
  .st-shelf-row {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--au-shelf-l), #000 calc(100% - var(--au-shelf-r)), transparent);
    mask-image: linear-gradient(to right, transparent, #000 var(--au-shelf-l), #000 calc(100% - var(--au-shelf-r)), transparent);
  }
}
@media (max-width: 560px) {
  .rd-shelf {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--au-shelf-l), #000 calc(100% - var(--au-shelf-r)), transparent);
    mask-image: linear-gradient(to right, transparent, #000 var(--au-shelf-l), #000 calc(100% - var(--au-shelf-r)), transparent);
  }
}
@media (min-width: 1024px) {
  .pf-col-side .pf-stories .st-shelf-row {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--au-shelf-l), #000 calc(100% - var(--au-shelf-r)), transparent);
    mask-image: linear-gradient(to right, transparent, #000 var(--au-shelf-l), #000 calc(100% - var(--au-shelf-r)), transparent);
  }
}
@supports (animation-timeline: scroll()) {
  .rd-shelf, .st-shelf-row { animation: au-shelf-edges linear both; animation-timeline: scroll(self inline); }
}

/* ======================================================================
   The reading room and the vocabulary book: two rooms in a sheet
   ====================================================================== */

.vb-modal { gap: 14px; }
.vb-modal .modal-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.vb-modal .modal-head h2 > .i { width: 24px; height: 24px; color: var(--au-teal); }
/* The close: a round glass button, like every close in Aurora. */
.vb-modal .modal-head > .btn {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background-color: var(--au-glass-base); background-image: linear-gradient(rgb(var(--fg) / 0.1) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi); color: var(--ink);
}
.vb-modal .modal-head > .btn .i { width: 18px; height: 18px; }
.vb-scroll { gap: 16px; padding: 2px 2px 4px; scrollbar-gutter: stable; }
/* A phone scrolls by touch: no reserved gutter, so the sheet's two side
   margins stay equal. */
@media (max-width: 480px) {
  .vb-scroll { scrollbar-gutter: auto; scrollbar-width: none; }
  .vb-scroll::-webkit-scrollbar { display: none; }
}
/* The desktop width of a library dialog (also used by .rv-modal). */
:root { --au-dialog-w: min(1040px, calc(100vw - 48px)); }
/* On a wider screen the reserved gutter goes into the sheet's right
   padding, so the scroller's content ends on the same line as the search
   row and the close. Engines that style ::-webkit-scrollbar draw it 10px
   wide (style.css); the others mostly overlay their bar, so they reserve
   nothing and get --vb-sb: 0. The 2px pull on both sides cancels the
   scroller's own 2px padding (kept so focus rings are not clipped). */
@media (min-width: 481px) {
  .vb-scroll { --vb-sb: 0px; scrollbar-gutter: auto; margin-left: -2px; margin-right: calc(-2px - var(--vb-sb)); }
  @supports selector(::-webkit-scrollbar) {
    .vb-scroll { --vb-sb: 10px; scrollbar-gutter: stable; }
  }
  /* One width for the sibling dialogs (the vocabulary, the reading list, an
     open text, and the review deck in review.css), so their edges and the
     close stay put when you move between them; an open text keeps its side
     panel inside that width. Only the short quiz and its end are narrower. */
  .vb-modal { width: var(--au-dialog-w); max-height: calc(100dvh - 48px); }
  .rd-modal, .rd-modal.at-text, .rd-modal.at-quiz:has(.rd-quiz.peeking) { width: var(--au-dialog-w); }
  .rd-modal:is(.at-quiz, .at-done):not(:has(.rd-quiz.peeking)) { width: min(760px, calc(100vw - 48px)); }
}
/* Desktop: one steady box for every view of the vocabulary and the reading
   dialogs (and the review deck, review.css), not a box sized to its content
   and centred: the top edge, the title and the close stay put when you go
   from the topics to a topic, or from the list to a text, its questions and
   their end. What is taller scrolls inside .vb-scroll; a short end screen
   sits in the middle of it. */
@media (min-width: 1024px) {
  .modal-backdrop > .vb-modal { height: min(800px, calc(100dvh - 48px)); max-height: none; grid-template-rows: auto auto minmax(0, 1fr); }
  .modal-backdrop > .rd-modal { grid-template-rows: auto minmax(0, 1fr); }
  .vb-modal > .vb-scroll { min-height: 0; overscroll-behavior: contain; }
  .vb-modal > .vb-scroll:has(> .vb-done) { align-content: center; }
}
/* A room, not a dialog: on a phone it fills the sheet. */
@media (max-width: 480px) {
  .modal-backdrop > .vb-modal { height: calc(100dvh - 24px); grid-template-rows: auto auto minmax(0, 1fr); }
  .modal-backdrop > .rd-modal { grid-template-rows: auto minmax(0, 1fr); }
}

/* ---------- the reading library ---------- */

.rd-note {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 0; border-radius: var(--au-r-small);
  font-size: 13.5px; color: var(--ink-2);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.rd-levels { align-self: start; justify-self: start; flex-wrap: wrap; max-width: 100%; }
.rd-levels button { display: inline-flex; align-items: baseline; gap: 6px; }
.rd-count { font: 600 11.5px/1 var(--font); color: var(--muted); }
.rd-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
@media (min-width: 1024px) { .rd-grid { gap: 14px; } }

/* ---------- a text ---------- */

.rd-head { display: grid; gap: 12px; align-items: end; }
.rd-head > .btn { justify-self: start; }
.rd-head-title { display: flex; gap: 14px; align-items: flex-end; min-width: 0; }
.rd-head-title > div { display: grid; gap: 8px; min-width: 0; }
.rd-head-title h3 { margin: 0; font: 700 var(--au-fs-hero-sm)/1.08 var(--display); letter-spacing: -0.02em; }
.rd-head-art {
  --pic: 44px;
  display: grid; place-items: center; flex: none; width: 64px; height: 80px; border-radius: 18px; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 12px 24px -14px color-mix(in srgb, var(--cb) 70%, #000);
}
.rd-head-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.rd-head-meta .i { width: 14px; height: 14px; }
/* Desktop: one column, the back button on its own row above the cover and
   the title, so the cover starts on the same left edge as the tools and the
   text card below it (a side column for the button pushed the title onto
   an edge nothing else in the dialog uses). */
@media (min-width: 1024px) {
  .rd-modal.at-text .rd-head { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rd-modal.at-text .rd-head > .btn { justify-self: start; }
  .rd-head-title h3 { font-size: var(--au-fs-hero); }
}

/* The text in a calm column; the key words and the way on beside it on a
   desktop, under it on a phone. */
.rd-read { display: grid; gap: 16px; align-items: start; }
.rd-main { display: grid; gap: 14px; min-width: 0; }
.rd-side { display: grid; gap: 14px; min-width: 0; }
/* On a desktop the main column dissolves into the grid, so the tools sit
   above the text alone and the side panel starts level with the text card
   (or the penguin's tip, when it shows). */
@media (min-width: 1024px) {
  .rd-read {
    grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto auto auto minmax(0, 1fr);
    column-gap: 28px; row-gap: 14px;
  }
  .rd-main { display: contents; }
  .rd-main > .rd-tools { grid-column: 1; grid-row: 1; }
  .rd-main > .rd-pg { grid-column: 1; grid-row: 2; }
  .rd-main > .rd-text { grid-column: 1; grid-row: 2 / -1; justify-self: center; width: 100%; }
  .rd-read:has(> .rd-main > .rd-pg) > .rd-main > .rd-text { grid-row: 3 / -1; }
  .rd-read > .rd-sheet { grid-column: 2; grid-row: 2; position: sticky; top: 0; bottom: auto; }
  .rd-side { grid-column: 2; grid-row: 2 / -1; align-content: start; }
  .rd-read:is(:has(> .rd-sheet), :has(> .rd-main > .rd-pg)) > .rd-side { grid-row: 3 / -1; }
  .rd-side .rd-cta { order: -1; padding: 0; }
  .rd-side .rd-cta .btn { width: 100%; justify-content: center; }
  .rd-key-item { padding-block: 8px; }
}

.rd-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* On a phone the tools are one chip row that scrolls sideways, never a
   lone button wrapped onto a second line. */
@media (max-width: 480px) {
  .rd-tools {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
    margin-inline: -2px; padding: 2px 24px 2px 2px; scroll-padding-inline: 2px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 calc(var(--au-shelf-l) / 2), #000 calc(100% - var(--au-shelf-r) * 0.4), transparent);
    mask-image: linear-gradient(to right, transparent, #000 calc(var(--au-shelf-l) / 2), #000 calc(100% - var(--au-shelf-r) * 0.4), transparent);
  }
  @supports (animation-timeline: scroll()) {
    .rd-tools { animation: au-shelf-edges linear both; animation-timeline: scroll(self inline); }
  }
  .rd-tools::-webkit-scrollbar { display: none; }
  .rd-tools > * { flex: none; white-space: nowrap; }
  .rd-rate button { padding-inline: 8px; }
}
.rd-listen:not(.violet) .i { color: var(--au-teal); }
.rd-rate { padding: 3px; }
.rd-rate button { padding: 5px 10px 7px; font-size: 12.5px; gap: 4px; display: inline-flex; align-items: center; }
.rd-rate .i { width: 14px; height: 14px; }

/* The sheet of paper: flat glass, a comfortable measure, generous lines. */
.rd-text {
  max-width: 68ch; padding: 20px 18px; border-radius: var(--au-r-card);
  font-size: 18px; line-height: 30px; font-weight: 500; color: var(--ink);
  background-color: var(--au-glass-base); background-image: linear-gradient(var(--au-glass-flat) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), var(--au-drop);
}
@media (min-width: 768px) { .rd-text { padding: 28px 34px; font-size: 19px; line-height: 1.72; } }
.rd-para { margin: 0 0 16px; }
.rd-para:last-child { margin-bottom: 0; }
.rd-sent { border-radius: 6px; transition: background-color var(--dur-2), box-shadow var(--dur-2); }
.rd-sent.on { background: rgb(var(--violet-rgb) / 0.18); box-shadow: 0 0 0 3px rgb(var(--violet-rgb) / 0.18); }
/* Every word can be tapped: a teal underline says so on hover. */
.rd-w {
  cursor: pointer; border-radius: 4px;
  text-decoration-line: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 5px;
  transition: text-decoration-color var(--dur-2), background-color var(--dur-2);
}
@media (hover: hover) and (pointer: fine) { .rd-w:hover { background: none; text-decoration-color: var(--au-teal); } }
.rd-key { font-weight: 700; text-decoration-style: solid; text-decoration-color: color-mix(in srgb, var(--au-teal) 75%, transparent); }
.rd-w.picked { background: rgb(var(--brand-rgb) / 0.3); box-shadow: 0 0 0 2px rgb(var(--brand-rgb) / 0.3); text-decoration-color: transparent; }
.rd-tr {
  margin: 8px 0 0 !important; padding-left: 12px; border-left: 3px solid color-mix(in srgb, var(--au-teal) 45%, transparent);
  font-size: 15px; line-height: 1.55; font-weight: 500; color: var(--ink-2);
}
.rd-note .flag, .rd-tr .flag, .rd-sheet-tr .flag { width: 18px; height: 13px; flex: none; }

/* The key words: rows in one glass card, like the phone. */
.rd-keys {
  display: grid; gap: 4px; padding: 14px 10px 10px; border-top: 0; border-radius: var(--au-r-card);
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
}
.rd-keys-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; margin: 0 0 4px; }
.rd-keys-head .rd-h { margin: 0 4px; }
.rd-keys-head .rd-save-all { margin-left: auto; }
.rd-h { display: flex; gap: 8px; align-items: center; margin: 0 4px 6px; font: 600 var(--au-fs-section)/1.2 var(--display); letter-spacing: -0.01em; }
.rd-h .i { width: 18px; height: 18px; color: var(--au-teal); }
.rd-key-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
@media (min-width: 641px) and (max-width: 1023px) { .rd-key-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; } }
.rd-key-item {
  display: flex; gap: 12px; align-items: baseline; padding: 10px 12px; border: 0; border-radius: var(--au-r-small);
  background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer;
  transition: background-color var(--dur-2);
}
.rd-key-item b { flex: none; font-size: 15px; font-weight: 700; }
.rd-key-item .muted { flex: 1; min-width: 0; font-size: 13.5px; }
.rd-key-item::after { content: '›'; flex: none; align-self: center; font: 600 18px/1 var(--display); color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .rd-key-item:hover { background: var(--au-glass-hi); border-color: transparent; } }
:root[data-theme="light"] .rd-key-item:hover { background: rgb(var(--fg) / 0.05); }
.rd-cta { display: flex; justify-content: center; padding: 6px 0 80px; }

/* The word tapped: a lifted glass sheet with a teal glow. It rides at the
   bottom of a phone, and at the top of the side panel on a desktop. */
.rd-sheet {
  display: flex; gap: 10px; align-items: center; padding: 12px 12px 12px 14px; border: 0; border-radius: var(--au-r-tile);
  background-color: var(--panel-solid);
  background-image: radial-gradient(90px 90px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-teal) 30%, transparent), transparent 72%), var(--au-glass);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi), 0 22px 44px -18px rgba(0, 0, 0, 0.6);
  animation: rd-up var(--dur-3) var(--ease-out);
}
:root[data-theme="light"] .rd-sheet { box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--line), 0 18px 36px -16px rgba(30, 70, 130, 0.4); }
.rd-sheet-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.rd-sheet-word { font: 700 22px/1.15 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.rd-sheet-tr { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 15px; color: var(--ink); }
.rd-sheet-def { font-size: 12.5px; }
.rd-sheet .btn.icon { width: 38px; height: 38px; border-radius: 50%; padding: 0; display: inline-grid; place-items: center; flex: none; }
.rd-sheet .rd-sheet-say { width: 42px; height: 42px; color: var(--au-teal); }
.rd-sheet .btn.violet { flex: none; }
@media (min-width: 1024px) {
  .rd-read > .rd-sheet { flex-wrap: wrap; }
  .rd-read > .rd-sheet .rd-sheet-body { flex: 1 1 160px; }
  .rd-read > .rd-sheet .btn.violet { order: 5; flex: 1 1 100%; justify-content: center; }
  .rd-read > .rd-sheet .rd-hide-sm { display: inline; }
}

/* The penguin's tip, beside the text. */
.rd-pg { display: flex; gap: 8px; align-items: flex-end; }
.rd-pg .pg-bubble { font-size: 14px; padding: 10px 12px; }
.rd-pg-x { align-self: flex-start; width: 32px; height: 32px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; }
/* Wider screens: the tip's close sits inside the bubble's right end, so the
   bubble runs to the column's right edge like the top bar and the buttons
   (and the close does not float above the corner on its own line). Bottom
   5px centres it on a one-line bubble: 14px x 1.5 + 2 x 10px + 2px border. */
@media (min-width: 481px) {
  .rd-pg:has(> .rd-pg-x) { position: relative; }
  .rd-pg:has(> .rd-pg-x) > .pg-bubble { padding-right: 48px; }
  .rd-pg > .rd-pg-x { position: absolute; right: 6px; bottom: 5px; z-index: 1; }
}

/* ---------- the questions ---------- */

.rd-quiz, .rd-quiz-top, .rd-quiz-main { display: grid; gap: 12px; min-width: 0; }
.rd-quiz { gap: 14px; }
@media (min-width: 1024px) {
  .rd-quiz.peeking { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .rd-quiz.peeking .rd-quiz-top { grid-column: 1; grid-row: 1; }
  .rd-quiz.peeking .rd-quiz-main { grid-column: 1; grid-row: 2; }
  .rd-quiz.peeking .rd-peek { grid-column: 2; grid-row: 1 / span 2; max-height: calc(min(800px, 100dvh - 48px) - 190px); position: sticky; top: 0; }
}
.rd-peek {
  max-height: 38vh; overflow: auto; display: grid; gap: 10px; padding: 12px; border: 0; border-radius: var(--au-r-card);
  background: var(--well-soft); box-shadow: inset 0 0 0 1px var(--au-edge);
}
.rd-peek .rd-text { font-size: 15.5px; line-height: 1.6; padding: 14px 16px; box-shadow: none; }
.rd-quiz-pg { justify-content: flex-start; margin-bottom: -4px; }
.rd-quiz-pg .pg-bubble { flex: 0 1 auto; }
/* The question: lifted glass with a violet glow, the options as glass rows. */
.rd-quiz .sp-card {
  display: grid; gap: 14px; padding: 18px; border-radius: var(--au-r-card);
  background-image: radial-gradient(110px 110px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-violet) 38%, transparent), transparent 72%), var(--au-glass);
}
.rd-quiz .sp-sentence { font: 600 18px/26px var(--font); color: var(--ink); }
.rd-quiz .sp-blank { color: var(--brand-3); font-weight: 800; }
.rd-quiz .sp-options { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.rd-quiz .sp-options.rd-tf { grid-template-columns: 1fr 1fr; }
.rd-quiz .sp-option, .btn.ls-option {
  display: flex; gap: 10px; align-items: center; justify-content: flex-start; min-height: 52px; padding: 12px 16px;
  border-radius: 16px; text-align: left; white-space: normal;
  font: 600 16px/22px var(--font); color: var(--ink);
  background: var(--au-glass-flat); box-shadow: inset 0 0 0 1.5px var(--au-edge), inset 0 1px 0 var(--au-highlight);
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2), box-shadow var(--dur-2);
}
.rd-quiz .sp-options.rd-tf .sp-option { justify-content: center; }
@media (hover: hover) and (pointer: fine) { .rd-quiz .sp-option:hover:not(:disabled), .btn.ls-option:hover:not(:disabled) { background: var(--au-glass-hi); filter: none; } }
.rd-quiz .sp-option:active:not(:disabled), .btn.ls-option:active:not(:disabled) { transform: scale(0.985); }
.rd-quiz .sp-option:disabled { opacity: 1; cursor: default; }
.rd-quiz .sp-option.right { background: color-mix(in srgb, var(--ok) 14%, transparent); box-shadow: inset 0 0 0 1.5px var(--ok); color: var(--ink); }
.rd-quiz .sp-option.wrong { background: color-mix(in srgb, var(--bad) 12%, transparent); box-shadow: inset 0 0 0 1.5px var(--bad); color: var(--ink); }
.rd-quiz .sp-option:disabled:not(.right, .wrong) { opacity: 0.6; }

/* ---------- the end of a text, and of a vocabulary run ---------- */

.vb-done {
  justify-items: center; gap: 12px; padding: 18px 12px 14px; border: 0; border-radius: var(--au-r-card);
  background: radial-gradient(260px 200px at 50% 70px, color-mix(in srgb, var(--au-teal) 26%, transparent), transparent 72%);
}
.vb-done.rd-done.low { background: radial-gradient(260px 200px at 50% 70px, color-mix(in srgb, var(--au-violet) 28%, transparent), transparent 72%); }
.vb-done h3 { margin: 0; font: 700 26px/1.12 var(--display); letter-spacing: -0.02em; }
.vb-done .penguin { margin: 0 auto -4px; }
.vb-done .hero-icon { border: 0; background: color-mix(in srgb, var(--au-teal) 16%, transparent); color: var(--au-teal); box-shadow: 0 0 30px 4px color-mix(in srgb, var(--au-teal) 30%, transparent); }
.rd-done-pct { font: 700 56px/1 var(--display); letter-spacing: -0.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.rd-done.good .rd-done-pct { color: var(--ok); }
.vb-done > .row { gap: 10px; }

/* ======================================================================
   The vocabulary book
   ====================================================================== */

.vb-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.vb-search { position: relative; flex: 1; min-width: 200px; }
.vb-search > .i { left: 14px; width: 17px; height: 17px; z-index: 1; color: var(--muted); }
.vb-search .input { width: 100%; padding-left: 40px; border-radius: var(--au-r-btn); }
/* <Icon> wraps the svg in a <span>, so the magnifier is placed through that
   wrapper: inside the field, not on a line of its own above it. */
@media (min-width: 481px) {
  .vb-search > span:has(> .i) {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%); z-index: 1;
    display: flex; line-height: 0; pointer-events: none; color: var(--muted);
  }
  .vb-search > span > .i { width: 17px; height: 17px; }
}
.vb-dir { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.vb-dir button { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.vb-overall { display: grid; gap: 8px; }
.vb-overall > :first-child { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Topics: practice tiles, each with its own glow. */
.vb-topics { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 1024px) { .vb-topics { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.vb-topic {
  --hue: var(--au-teal);
  position: relative; display: grid; align-content: end; gap: 3px; min-height: 148px; padding: 12px 13px 13px;
  border: 0; border-radius: var(--au-r-tile); color: var(--ink); text-align: left; cursor: pointer;
  background-color: var(--au-glass-base);
  background-image: radial-gradient(110px 110px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue) 40%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2);
}
:root[data-theme="light"] .vb-topic { background-image: radial-gradient(110px 110px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue) 30%, transparent), transparent 72%), var(--au-glass); }
.vb-topic:nth-child(6n + 2) { --hue: var(--au-sky-hue); }
.vb-topic:nth-child(6n + 3) { --hue: var(--au-violet); }
.vb-topic:nth-child(6n + 4) { --hue: #f472b6; }
.vb-topic:nth-child(6n + 5) { --hue: #ff9a4d; }
.vb-topic:nth-child(6n + 6) { --hue: var(--au-green); }
@media (hover: hover) and (pointer: fine) { .vb-topic:hover { transform: translateY(-1px); filter: brightness(1.08); border-color: transparent; box-shadow: var(--au-shadow); } }
.vb-topic:active { transform: scale(0.985); }
.vb-topic-icon {
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 0 18px -2px color-mix(in srgb, var(--hue, var(--au-teal)) 55%, transparent);
  color: var(--hue, var(--au-teal));
}
.vb-topic .vb-topic-icon { position: absolute; top: 12px; left: 12px; }
.vb-topic-icon .i { width: 19px; height: 19px; }
.vb-topic-name { font: 600 var(--au-fs-tile)/1.15 var(--display); font-size: 15px; letter-spacing: -0.01em; }
.vb-topic-sub { font-size: 12px; font-weight: 600; color: var(--muted); }
.vb-topic .vb-meter { height: 4px; margin-top: 4px; }

/* One topic open. */
.vb-topic-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.vb-topic-title { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 200px; }
.vb-topic-title .vb-topic-icon { width: 56px; height: 56px; border-radius: 18px; }
.vb-topic-title .vb-topic-icon .i { width: 24px; height: 24px; }
.vb-topic-title h3 { margin: 0; font: 700 24px/1.12 var(--display); letter-spacing: -0.02em; }
.vb-topic-title .muted { font-size: 12.5px; font-weight: 600; }
.vb-list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .vb-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.vb-word {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px;
  border: 0; border-radius: var(--au-r-tile);
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
}
.vb-word.known {
  background-image: radial-gradient(90px 90px at calc(100% - 6px) 0, color-mix(in srgb, var(--au-teal) 26%, transparent), transparent 72%), var(--au-glass);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 45%, transparent), var(--au-shadow);
}
.vb-emoji {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; line-height: 1; color: var(--au-teal);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.vb-emoji .i { width: 22px; height: 22px; }
.vb-emoji.big { width: auto; height: auto; font-size: 64px; background: none; box-shadow: none; justify-self: center; filter: drop-shadow(0 10px 16px rgba(4, 10, 25, 0.3)); }
.vb-main { font: 600 21px/25px var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.vb-pf { font: 500 14px/1.2 var(--font); }
.vb-lat { font-size: 14px; font-style: italic; color: var(--violet-ink); }
.vb-tr { font-size: 14px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.vb-ex { font-size: 13px; line-height: 1.4; margin-top: 4px; font-style: italic; color: var(--ink-2); }
.vb-tools { display: flex; gap: 6px; }
.vb-tools .btn.icon { width: 34px; height: 34px; border-radius: 50%; padding: 0; display: inline-grid; place-items: center; }
.vb-tools [data-act="vb-say"] { color: var(--au-teal); }
@media (max-width: 560px) { .vb-word { grid-template-columns: 40px minmax(0, 1fr); } .vb-emoji { width: 40px; height: 40px; font-size: 24px; } .vb-tools { grid-column: 1 / -1; justify-content: flex-end; } }
/* Wider screens put two cards in a row at one height: their content starts
   at the top, so the headwords in a row share a line however long each
   example is. */
@media (min-width: 561px) { .vb-word { align-items: start; align-content: start; } }

/* Cards: one word at a time, on lifted glass with a violet glow. */
.vb-flash {
  min-height: 280px; align-content: center; gap: 12px; padding: 24px 18px; border: 0; border-radius: var(--au-r-hero); cursor: pointer;
  background-color: var(--au-glass-base);
  background-image: radial-gradient(160px 140px at calc(100% - 10px) 0, color-mix(in srgb, var(--au-violet) 36%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
  transition: transform var(--dur-2) var(--ease-out);
}
.vb-flash .front { font: 700 34px/38px var(--display); letter-spacing: -0.02em; }
.vb-flash:active { transform: scale(0.99); }
.vb-hidden { font: 600 20px/1.25 var(--display); }
.vb-modal .vb-scroll > .row .btn.icon { width: 44px; height: 44px; border-radius: 50%; padding: 0; display: inline-grid; place-items: center; color: var(--au-teal); }

/* A word saved from somebody's captions (web/live): the learner's words
   carry a teal underline, and one already kept a soft teal wash. */
.vocab-word { border-bottom: 0; text-decoration: underline dotted color-mix(in srgb, var(--au-teal) 55%, transparent); text-decoration-thickness: 2px; text-underline-offset: 4px; border-radius: 4px; }
@media (hover: hover) and (pointer: fine) { .vocab-word:hover { background: color-mix(in srgb, var(--au-teal) 16%, transparent); text-decoration-style: solid; text-decoration-color: var(--au-teal); } }
.vocab-word.saved { color: inherit; background: color-mix(in srgb, var(--au-teal) 18%, transparent); text-decoration-style: solid; text-decoration-color: var(--au-teal); }
.vocab-word.saved:hover { background: color-mix(in srgb, var(--au-teal) 26%, transparent); }

/* ======================================================================
   Stories: the whole screen
   ====================================================================== */

.st-screen {
  background-color: var(--au-bg0);
  background-image:
    radial-gradient(70% 42% at 16% 3%, rgb(var(--au-blob-teal) / calc(0.24 * var(--au-blob-o))), transparent 75%),
    radial-gradient(62% 44% at 92% 12%, rgb(var(--au-blob-violet) / calc(0.24 * var(--au-blob-o))), transparent 75%),
    var(--au-sky);
  color: var(--ink);
}
.st-top { width: min(760px, 100%); gap: 8px; padding: 14px var(--au-gutter) 8px; }
.st-lib .st-top { width: min(1132px, 100%); padding-top: 18px; }
.st-top-t { gap: 10px; font: 700 var(--au-fs-screen)/1.05 var(--display); letter-spacing: -0.025em; }
.st-top-t .i { width: 28px; height: 28px; color: var(--au-teal); }
@media (max-width: 480px) { .st-top-t { font-size: 28px; } .st-top-t .i { width: 24px; height: 24px; } }
.st-toggle.on { color: var(--au-teal); background: color-mix(in srgb, var(--au-teal) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-teal) 45%, transparent); }
.st-lib-body { padding: 8px var(--au-gutter) 40px; }
.st-lib-body > * { width: min(1100px, 100%); }
.st-lib-body > * + * { margin-top: 16px; }
/* The level bar is a .seg (inline-flex), which the auto margins above cannot
   centre and the 1100px width stretches into a long empty pill. As a block
   that hugs its chips, it starts on the column's left edge like the grid. */
@media (min-width: 481px) {
  .st-lib-body > .rd-levels {
    display: flex; width: fit-content; max-width: min(var(--st-col), 100%);
    margin-left: max(0px, calc((100% - var(--st-col)) / 2)); margin-right: auto;
  }
}
/* Wider screens: the library's column is the app shell's (.au-page: a 1180
   box with --au-gutter inside), so opening Stories from the profile, the
   room or home keeps both edges where they were. The top bar pads by the
   gutter itself, so its box is the full 1180. */
@media (min-width: 481px) {
  .st-lib { --st-col: calc(1180px - 2 * var(--au-gutter)); }
  .st-lib .st-top { width: min(calc(var(--st-col) + 2 * var(--au-gutter)), 100%); }
  .st-lib-body > * { width: min(var(--st-col), 100%); }
}

/* ---------- the chat ---------- */

.st-chat { padding: 8px var(--au-gutter) 28px; }
.st-chat > * + * { margin-top: 14px; }
/* The chat column is the top bar's content box (760px less its gutters), so
   the tip, the lines and the Continue button end where the close does. */
@media (min-width: 481px) { .st-chat > * { width: min(calc(760px - 2 * var(--au-gutter)), 100%); } }
.st-intro { gap: 10px; padding: 12px 0 18px; border-bottom: 0; position: relative; }
.st-intro::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-hi), transparent); }
.st-intro h2 { font: 700 clamp(24px, 3.6vw, 30px)/1.1 var(--display); letter-spacing: -0.02em; }
.st-intro p { font-size: 15px; }
.st-intro-c { gap: 6px; font-size: 13px; }
.st-intro-c b { font-weight: 700; }
.st-you { gap: 8px; min-height: 30px; padding: 3px 12px 3px 4px; }

/* A face: the picture on glass, the character's colour as a glow behind it. */
.st-avatar {
  position: relative; background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 0 18px 1px rgb(var(--c) / 0.45);
}
:root[data-theme="light"] .st-avatar { box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--line), 0 0 16px 0 rgb(var(--c) / 0.4); }
.st-avatar .pic { width: 64%; height: 64%; }
.st-avatar .pic.art { width: 100%; height: 100%; }

/* A line: glass for the others, the violet bubble for mine. */
.st-line { gap: 8px; }
.st-bubble {
  max-width: min(80%, 560px); padding: 10px 15px 12px; border: 0; border-radius: 20px 20px 20px 6px;
  background-color: var(--au-glass-base); background-image: var(--au-glass);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 12px 26px -18px rgba(0, 0, 0, 0.6);
}
.st-line:not(.now) .st-bubble { opacity: 0.92; }
.st-line.now .st-bubble { background-image: linear-gradient(180deg, var(--au-glass-hi), var(--au-glass-bottom)); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi), 0 16px 30px -18px rgb(var(--c) / 0.7); }
.st-line.mine .st-bubble {
  border-radius: 20px 20px 6px 20px; color: #fff;
  background-color: #7a62f5; background-image: linear-gradient(180deg, #a996ff, #7a62f5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 14px 28px -16px rgba(122, 98, 245, 0.7);
}
.st-who { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.st-who::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--c)); box-shadow: 0 0 8px 1px rgb(var(--c) / 0.6); }
.st-who b { font: 700 12.5px/1.3 var(--font); letter-spacing: 0.02em; }
.st-line.mine .st-who, .st-line.mine .st-gloss, .st-line.mine .st-who .muted { color: rgba(255, 255, 255, 0.8); }
.st-text { margin: 4px 0 0; font-size: 18px; line-height: 26px; font-weight: 500; }
.st-w {
  border-radius: 4px; text-decoration-line: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 5px;
  transition: text-decoration-color var(--dur-2), background-color var(--dur-2);
}
@media (hover: hover) and (pointer: fine) {
  .st-w:hover { background: none; text-decoration-color: var(--au-teal); }
  .st-line.mine .st-w:hover { text-decoration-color: #b6fff0; }
}
.st-w.picked { background: rgb(var(--brand-rgb) / 0.3); box-shadow: 0 0 0 2px rgb(var(--brand-rgb) / 0.3); text-decoration-color: transparent; }
.st-gloss { font-size: 14px; line-height: 19px; }
.st-say {
  width: 36px; height: 36px; color: var(--ink-2);
  background-color: var(--au-glass-base); background-image: linear-gradient(rgb(var(--fg) / 0.1) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
  transition: color var(--dur-2), transform var(--dur-1);
}
.st-say:hover { color: var(--au-teal); }
.st-say:active { transform: scale(0.94); }
.st-sheet { bottom: 116px; width: min(600px, calc(100% - 2 * var(--au-gutter))); }
.st-qdone { font-size: 13.5px; font-weight: 600; }
.st-qdone.ok .i { color: var(--au-teal); }

/* A question in the chat: lifted glass with a violet glow. */
.st-q {
  gap: 14px; padding: 16px; border-radius: var(--au-r-card);
  background-image: radial-gradient(110px 110px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-violet) 36%, transparent), transparent 72%), var(--au-glass);
}
.st-q-head { gap: 10px; font: 600 17px/1.25 var(--display); color: var(--ink); }
.st-q-head .i {
  width: 32px; height: 32px; padding: 7px; flex: none; border-radius: 11px; box-sizing: border-box;
  color: var(--au-teal); background: color-mix(in srgb, var(--au-teal) 14%, transparent);
}
.st-q-cue { font-size: 15px; color: var(--muted); }
.st-quote { padding: 12px 14px; border-radius: 16px; background: var(--well); font: 700 18px/25px var(--font); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); }
:root[data-theme="light"] .st-quote { background: rgb(var(--fg) / 0.05); box-shadow: none; }
.st-quote .i { color: var(--au-teal); }
.st-order { min-height: 64px; }

/* ---------- the foot: go on, or choose ---------- */

.st-foot-hint { color: var(--au-teal); }
.st-choose-h { gap: 10px; font: 600 17px/1.25 var(--display); }
.st-choices { gap: 8px; }
.st-choice-go {
  gap: 12px; min-height: 56px; padding: 12px 14px; border: 0; border-radius: 16px;
  background: var(--au-glass-flat); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line), inset 0 1px 0 var(--au-highlight);
  transition: transform var(--dur-1) var(--ease-out), background-color var(--dur-2), box-shadow var(--dur-2);
}
:root[data-theme="light"] .st-choice-go { background: var(--au-glass-hi); box-shadow: inset 0 0 0 1.5px var(--line-hi), 0 6px 14px -10px rgba(30, 70, 130, 0.4); }
.st-choice-go:hover:not(:disabled) { border-color: transparent; background: var(--au-glass-hi); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 50%, transparent); }
.st-choice-go:active:not(:disabled) { transform: scale(0.985); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 60%, transparent); }
.st-choice-n { background: color-mix(in srgb, var(--au-teal) 14%, transparent); color: var(--au-teal); }
.st-choice-t { font-size: 17px; font-weight: 700; line-height: 23px; }
.st-choice-t small { font-size: 13px; font-weight: 500; line-height: 1.35; }
.st-choice.taken .st-choice-go { border-color: transparent; background: var(--au-glass-hi); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 75%, transparent), 0 0 0 5px color-mix(in srgb, var(--au-teal) 16%, transparent); }
.st-choice.taken .st-choice-n { background: color-mix(in srgb, var(--au-teal) 26%, transparent); }

/* ---------- an ending ---------- */

.st-end { gap: 12px; padding: 18px var(--au-gutter) 40px; }
.st-end > .penguin { filter: drop-shadow(0 12px 22px rgba(4, 10, 25, 0.35)); }
.st-end[data-flavour="good"] { background: radial-gradient(300px 220px at 50% 70px, color-mix(in srgb, var(--au-teal) 24%, transparent), transparent 72%); }
.st-end[data-flavour="neutral"] { background: radial-gradient(300px 220px at 50% 70px, color-mix(in srgb, var(--au-violet) 26%, transparent), transparent 72%); }
.st-end[data-flavour="funny"] { background: radial-gradient(300px 220px at 50% 70px, color-mix(in srgb, var(--au-gold) 20%, transparent), transparent 72%); }
.st-flavour {
  gap: 6px; padding: 5px 12px; border-radius: 999px; font: 700 11px/1.4 var(--font); letter-spacing: 0.14em;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.st-flavour .i { width: 14px; height: 14px; }
.st-flavour.good { background: linear-gradient(color-mix(in srgb, var(--au-teal) 14%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); color: var(--au-teal); }
.st-flavour.neutral { background: linear-gradient(color-mix(in srgb, var(--au-violet) 16%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); color: var(--violet-ink); }
.st-flavour.funny { background: linear-gradient(color-mix(in srgb, var(--au-gold) 16%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); color: var(--warn); }
.st-end-t { font: 700 clamp(28px, 5vw, 38px)/1.08 var(--display); letter-spacing: -0.025em; }
.st-end-tr { font-weight: 600; }
.st-end-text { font-size: 17px; line-height: 1.5; font-weight: 500; }
.st-end-new { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.st-end-new.fresh { color: var(--au-gold); }
:root[data-theme="light"] .st-end-new.fresh { color: var(--warn); }
.st-slots { gap: 8px; }
.st-slot {
  gap: 6px; padding: 7px 12px; border: 0; border-radius: var(--au-r-small); font-size: 14px; font-weight: 700; color: var(--muted);
  background: var(--well-soft); box-shadow: inset 0 0 0 1.5px var(--line);
}
.st-slot.got {
  color: var(--ink); background-color: var(--au-glass-base); background-image: var(--au-glass);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.st-slot.got.good .i { color: var(--au-teal); }
.st-slot.got.neutral .i { color: var(--au-violet); }
.st-slot.got.funny .i { color: var(--au-gold); }
:root[data-theme="light"] .st-slot.got.funny .i { color: var(--warn); }
.st-slot.now { box-shadow: inset 0 0 0 1.5px var(--au-teal), 0 0 0 4px color-mix(in srgb, var(--au-teal) 18%, transparent), 0 0 20px -2px color-mix(in srgb, var(--au-teal) 50%, transparent); }
.st-all { color: var(--au-gold); font: 700 17px/1.2 var(--display); }
:root[data-theme="light"] .st-all { color: var(--warn); }

/* ---------- together, in a room ---------- */

.st-room-pick .st-peek {
  gap: 12px; border: 0;
  background-image: radial-gradient(180px 160px at calc(100% - 8px) 0, rgb(var(--g) / 0.38), transparent 72%), var(--au-glass);
}
.st-room-pick .st-peek h3 { font: 700 24px/1.12 var(--display); letter-spacing: -0.02em; }
.st-cast { gap: 8px; }
.st-cast-c {
  gap: 6px; padding: 3px 11px 3px 3px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.st-cast-c.me { background: linear-gradient(color-mix(in srgb, var(--au-teal) 14%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 65%, transparent); }
.st-cast-c.muted { padding-left: 11px; }
.st-room-chat { padding: 10px 6px 18px; border-radius: var(--au-r-card); background: var(--well-soft); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.18), inset 0 0 0 1px var(--au-edge); }
:root[data-theme="light"] .st-room-chat { box-shadow: inset 0 0 0 1px var(--line); }
.st-room-foot {
  gap: 12px; padding: 12px 14px; border: 0; border-radius: var(--au-r-tile);
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
}
.st-room-foot.mine { background-image: radial-gradient(140px 120px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-teal) 30%, transparent), transparent 72%), var(--au-glass); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 55%, transparent), var(--au-drop); }
.st-room-foot.right { background-image: linear-gradient(color-mix(in srgb, var(--ok) 14%, transparent) 0 0); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 50%, transparent); }
.st-room-foot.wrong { background-image: linear-gradient(color-mix(in srgb, var(--bad) 12%, transparent) 0 0); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 45%, transparent); }
.st-verdict.ok { color: var(--ok); }

@media (max-width: 640px) {
  .st-text { font-size: 17px; line-height: 24px; }
  .st-bubble { max-width: 82%; }
  .st-line .st-say { width: 32px; height: 32px; }
  .st-sheet { bottom: 100px; }
  .st-top { padding: 10px 12px 6px; gap: 4px; }
}

/* ======================================================================
   Lessons (the room's lesson mode)
   ====================================================================== */

.ls-head h2, .ls-intro h2 { font: 700 22px/1.15 var(--display); letter-spacing: -0.02em; }
.ls-head-icon, .ls-card-icon {
  border: 0; border-radius: 50%; color: var(--hue, var(--au-violet));
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 0 22px -2px color-mix(in srgb, var(--hue, var(--au-violet)) 55%, transparent);
}
.ls-head { background-image: radial-gradient(140px 130px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-violet) 34%, transparent), transparent 72%), var(--au-glass); }

/* The steps of a lesson: a trail of 3D nodes, like the path. */
.ls-stepper { gap: 6px; padding: 6px 2px; scrollbar-width: none; }
.ls-stepper::-webkit-scrollbar { display: none; }
/* Desktop: the rail sits inside the cards' 18px padding, like their content,
   and has room for the active dot's ring and glow (a scroller clips at its
   padding edge); the negative block margin keeps the spacing around it. */
@media (min-width: 1024px) { .ls-stepper { padding: 14px 18px; margin-block: -8px; } }
.ls-step { gap: 8px; font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--muted); }
.ls-step-dot {
  width: 32px; height: 32px; border: 0; color: var(--muted);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.28), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
:root[data-theme="light"] .ls-step-dot { box-shadow: 0 3px 0 var(--line-hi), inset 0 1px 0 #fff, inset 0 0 0 1px var(--line); }
.ls-step.on { color: var(--ink); }
.ls-step.on .ls-step-dot { color: #fff; border: 0; background: linear-gradient(180deg, #ffa04d, #ff7a1a); box-shadow: 0 3px 0 #c24f05, 0 0 0 5px rgba(255, 122, 26, 0.2), 0 0 22px rgba(255, 122, 26, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.ls-step.done .ls-step-dot { color: #053a33; border: 0; background: linear-gradient(180deg, #5af0d4, #22c3a6); box-shadow: 0 3px 0 #11806d, inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.ls-step-line { height: 3px; background: var(--line-hi); }
.ls-step.done + .ls-step-line { background: var(--au-teal); box-shadow: 0 0 8px color-mix(in srgb, var(--au-teal) 50%, transparent); }

.ls-person {
  gap: 6px; padding: 5px 11px; border: 0; font-weight: 600; color: var(--muted);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.ls-person.ok { color: var(--ink); background: linear-gradient(color-mix(in srgb, var(--au-teal) 14%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 60%, transparent); }
.ls-person.ok .i { color: var(--au-teal); }

/* The words of the lesson: glass tiles that turn over. */
.ls-vocab { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.ls-word {
  gap: 6px; padding: 14px; border: 0; border-radius: var(--au-r-tile);
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2), filter var(--dur-2);
}
@media (hover: hover) and (pointer: fine) { .ls-word:hover { border-color: transparent; filter: brightness(1.07); } }
.ls-word:active { transform: scale(0.985); }
.ls-word.open { border-color: transparent; background-image: radial-gradient(100px 100px at calc(100% - 6px) 0, color-mix(in srgb, var(--au-teal) 30%, transparent), transparent 72%), var(--au-glass); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 45%, transparent), var(--au-drop); }
.ls-word-en { font: 600 19px/1.2 var(--display); letter-spacing: -0.01em; }
.ls-word-tr { font-size: 14px; font-weight: 500; }
.ls-word-tools .btn.icon, .btn.ls-say { width: 32px; height: 32px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; color: var(--au-teal); }

/* Grammar: points with teal numerals, examples as glass rows. */
.ls-points { gap: 12px; line-height: 1.6; }
.ls-points li::marker { color: var(--au-teal); font-weight: 700; font-family: var(--display); }
.ls-sub { font: 700 11px/14px var(--font); letter-spacing: 0.14em; color: var(--au-teal); }
.ls-example, .ls-tips > div, .ls-sum-card, .ls-how-steps li {
  border: 0; border-radius: var(--au-r-small);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.ls-example { padding: 10px 12px; }
.ls-example-en { font: 600 16px/1.3 var(--display); }
.ls-tips .i { color: var(--au-teal); }
.ls-sum-card { padding: 14px; border-radius: var(--au-r-tile); }
.ls-sum-name { font-family: var(--display); font-weight: 600; }
.ls-sum-row b { font-family: var(--display); font-variant-numeric: tabular-nums; }

/* An exercise. */
.ls-prompt-label { font: 700 11px/14px var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--au-teal); }
.ls-prompt { font: 600 26px/1.3 var(--display); letter-spacing: -0.01em; margin-top: -6px; }
.ls-blank { border-bottom: 3px solid var(--au-teal); }
.ls-options { gap: 8px; }
.ls-letter {
  width: 28px; height: 28px; border-radius: 9px; font: 700 13px/1 var(--display); color: var(--au-teal);
  background: color-mix(in srgb, var(--au-teal) 14%, transparent);
}
/* Tiles to build a sentence: glass with a 3px lip, in a recessed well. */
.ls-order-built {
  min-height: 64px; gap: 8px; padding: 8px; border: 0; border-radius: 16px;
  background: var(--well); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.22), inset 0 0 0 1.5px var(--au-edge);
}
:root[data-theme="light"] .ls-order-built { background: rgb(var(--fg) / 0.04); box-shadow: inset 0 0 0 1.5px var(--line-hi); }
.ls-chip {
  min-height: 44px; padding: 9px 14px; border: 0; border-radius: var(--au-r-small);
  font: 700 16px/1.2 var(--font); color: var(--ink);
  background: var(--au-glass-hi);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 3px 0 rgb(0 0 0 / 0.3);
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-2), box-shadow var(--dur-1);
}
:root[data-theme="light"] .ls-chip { background: #fff; box-shadow: inset 0 0 0 1px var(--line-hi), 0 3px 0 var(--line-hi); }
@media (hover: hover) and (pointer: fine) { .ls-chip:hover:not(:disabled) { transform: translateY(-1px); border-color: transparent; } }
.ls-chip:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 0 0 1px var(--au-edge), 0 1px 0 rgb(0 0 0 / 0.3); }
.ls-chip:disabled { opacity: 0.22; box-shadow: none; }
.ls-chip.on { background: color-mix(in srgb, var(--au-teal) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-teal) 40%, transparent), 0 3px 0 color-mix(in srgb, var(--au-teal) 40%, transparent); }
.ls-waiting { border-radius: var(--au-r-small); background: var(--well-soft); box-shadow: inset 0 0 0 1px var(--au-edge); }
.ls-hint { border: 0; border-radius: var(--au-r-small); background: color-mix(in srgb, var(--au-gold) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-gold) 35%, transparent); }
.ls-hint .i { color: var(--warn); }
/* A verdict: tinted glass with a ring, no border. */
.ls-result { gap: 6px; padding: 14px 16px; border: 0; border-radius: var(--au-r-tile); }
.ls-result.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 45%, transparent); }
.ls-result.close { background: color-mix(in srgb, var(--warn) 11%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 45%, transparent); }
.ls-result.wrong { background: color-mix(in srgb, var(--bad) 10%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 42%, transparent); }
.ls-result-head { font: 700 18px/1.2 var(--display); }
.ls-solution { font: 600 18px/1.3 var(--display); }

/* A dialogue: rows like the story's chat, the line to read lit violet. */
.ls-lines { gap: 8px; }
.ls-line {
  gap: 12px; padding: 12px; border: 0; border-radius: var(--au-r-tile); opacity: 0.6;
  background-color: var(--au-glass-base); background-image: var(--au-glass);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.ls-line.read { opacity: 0.82; }
.ls-line.current { opacity: 1; border-color: transparent; background-image: radial-gradient(120px 110px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-violet) 34%, transparent), transparent 72%), var(--au-glass); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-violet) 55%, transparent), var(--au-drop); }
.ls-line-en { font-size: 17px; font-weight: 600; line-height: 1.4; }
.ls-role { width: 30px; height: 30px; border-radius: 50%; font: 700 13px/1 var(--display); color: #fff; }
.ls-role-A { background: linear-gradient(180deg, #a996ff, #7a62f5); box-shadow: 0 2px 0 #4f37c9; }
.ls-role-B { background: linear-gradient(180deg, #5af0d4, #22c3a6); color: #053a33; box-shadow: 0 2px 0 #11806d; }
.ls-speak-prompt { font: 600 22px/1.4 var(--display); }

/* The tracks and the coach. */
.ls-tracks { max-width: 100%; }
/* Wider screens: the tracks share the full-width bar evenly instead of
   bunching on its left; they still scroll when they do not fit. */
@media (min-width: 481px) {
  .ls-tracks button { flex: 1 0 auto; justify-content: center; }
}
.ls-you { background: var(--au-teal); box-shadow: 0 0 8px 2px color-mix(in srgb, var(--au-teal) 55%, transparent); }
.pill.coach-pill { color: var(--warn); background: linear-gradient(color-mix(in srgb, var(--au-gold) 14%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); border-color: color-mix(in srgb, var(--au-gold) 30%, transparent); }
.banner.coach-banner { border: 0; border-radius: var(--au-r-small); color: var(--ink); background: color-mix(in srgb, var(--au-gold) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-gold) 32%, transparent); }
.pill.ok-pill { color: var(--au-teal); background: linear-gradient(color-mix(in srgb, var(--au-teal) 14%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); border-color: color-mix(in srgb, var(--au-teal) 45%, transparent); }
:root[data-theme="light"] .pill.ok-pill { color: #0a7f6e; }
.ls-soon { display: flex; gap: 8px; align-items: center; }

/* ---------- the lesson library: lessons by level ---------- */

details.ls-how > summary { font-family: var(--display); font-weight: 600; font-size: 15px; }
details.ls-how > summary::after { color: var(--au-teal); }
.ls-how-steps li { padding: 12px; font-size: 14px; line-height: 1.45; }
.ls-how-steps b { width: 26px; height: 26px; background: color-mix(in srgb, var(--au-teal) 16%, transparent); color: var(--au-teal); font: 700 13px/1 var(--display); }

.ls-level { gap: 12px; margin-top: 10px; }
.ls-level-h { gap: 10px; margin: 0; font: 600 var(--au-fs-section)/1.2 var(--display); letter-spacing: -0.01em; }
.ls-level-h .ls-level-pill { min-width: 0; padding: 3px 10px 3px 8px; font-size: 12px; }
.ls-level:has(.lv-A1) .ls-level-pill, .ls-level:has(.lv-A2) .ls-level-pill, .ls-level:has(.lv-B1) .ls-level-pill, .ls-level:has(.lv-B2) .ls-level-pill {
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); color: var(--ink);
}
.ls-library { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
@media (min-width: 1024px) { .ls-library { gap: 12px; } }

/* A lesson: a glass tile with its level's glow and a glowing disc. */
.ls-card.lv-A1 { --hue: #3ee6c8; }
.ls-card.lv-A2 { --hue: #5ab8ff; }
.ls-card.lv-B1 { --hue: #ff9a4d; }
.ls-card.lv-B2 { --hue: #9a83ff; }
:root[data-theme="light"] .ls-card.lv-A1 { --hue: #0fb39b; }
:root[data-theme="light"] .ls-card.lv-A2 { --hue: #2a8de0; }
:root[data-theme="light"] .ls-card.lv-B1 { --hue: #f07a1a; }
:root[data-theme="light"] .ls-card.lv-B2 { --hue: #6b56f0; }
.ls-card {
  grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 14px; padding: 14px 14px 14px 13px;
  border: 0; border-radius: var(--au-r-tile); color: var(--ink);
  background-color: var(--au-glass-base);
  background-image: radial-gradient(120px 110px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue) 34%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2);
}
:root[data-theme="light"] .ls-card { background-image: radial-gradient(120px 110px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue) 24%, transparent), transparent 72%), var(--au-glass); }
@media (hover: hover) and (pointer: fine) { .ls-card:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.07); border-color: transparent; box-shadow: var(--au-shadow); } }
.ls-card:active:not(:disabled) { transform: scale(0.985); }
.ls-card:disabled { opacity: 1; }
.ls-card .ls-card-icon { width: 44px; height: 44px; border-radius: 50%; border: 0; color: var(--hue); background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); }
.ls-card-top { min-height: 24px; }
.ls-card-no { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/14px var(--font); letter-spacing: 0.12em; color: var(--muted); filter: none; }
.ls-card-no::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--hue); box-shadow: 0 0 8px 1px color-mix(in srgb, var(--hue) 60%, transparent); }
.ls-card h3 { font: 600 16.5px/1.2 var(--display); letter-spacing: -0.01em; }
.ls-card-en { font-size: 12.5px; font-weight: 600; }
.ls-card-grammar { color: var(--ink-2); font-weight: 600; }
.ls-card-grammar > .i, .ls-card-grammar .i { color: var(--au-gold); }
:root[data-theme="light"] .ls-card-grammar > .i { color: var(--warn); }
.ls-card p { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) {
  .ls-library { gap: 8px; }
  .ls-card { padding: 12px; gap: 12px; }
  .ls-card .ls-card-icon { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .st-cover, .st-cover-pic, .rd-cover, .vb-topic, .ls-card, .rd-sheet { transition: none; animation: none; }
}
