:root {
  --bg: #faf8f5;
  --ink: #2e2e2e;
  --muted: #8a867f;
  --line: #ece8e1;
  --ai: #e6edf3;
  --user: #f0eeea;
  --ok: #8fae98;
  --ok-ink: #4f7a5b;
  --ok-bg: #e3ede6;
  --warn-ink: #b5655a;
  --amber: #e9d39b;
  --amber-ink: #8a6d2b;
  --amber-bg: #fbf5e6;
  --card: #fff;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: .45; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- layout ---------- */
.app { display: flex; flex-direction: column; height: 100dvh; max-width: 760px; margin: 0 auto; }
.top {
  display: flex; align-items: center; gap: 6px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px 16px;
  border-bottom: 1px solid var(--line);
}
.topic { display: flex; align-items: center; gap: 4px; font-weight: 600; padding: 6px 8px; margin-left: -8px; border-radius: 10px; max-width: 40%; }
.topic span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { padding: 8px; border-radius: 10px; display: flex; align-items: center; gap: 4px; font-size: 14px; }
.icon.on { background: var(--ink); color: #fff; }

.chat {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 16px; display: flex; flex-direction: column; gap: 10px;
}
.empty { margin: auto; text-align: center; color: var(--muted); max-width: 320px; }
.empty b { color: var(--ink); font-weight: 500; }

/* ---------- bubbles ---------- */
.msg {
  max-width: min(82%, 560px); padding: 10px 14px; border-radius: var(--radius);
  animation: rise .35s ease both; overflow-wrap: anywhere;
  transition: box-shadow .3s, opacity .25s, transform .25s;
}
.msg.user { align-self: flex-end; background: var(--user); border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--ai); border-bottom-left-radius: 6px; cursor: pointer; }
.msg.ai { position: relative; }
.msg.ai.speaking { box-shadow: 0 0 0 3px rgba(143, 174, 152, .4); }
.msg .text { margin: 0; transition: opacity .25s, filter .3s; }
.msg .text.out { opacity: 0; filter: blur(3px); }
.msg.leaving { opacity: 0; transform: scale(.96); }
.word { opacity: 0; animation: fade .3s ease forwards; }

/* hidden subtitles: the AI is heard, not read, until the learner taps the bubble */
.msg.ai.hide .text:not(:has(.dots)) { filter: blur(6px); user-select: none; }
.meta { margin-top: 6px; }

/* audio state, beside the bubble: grey dots fading in turn = preparing audio, green bars = speaking */
.wave {
  position: absolute; left: calc(100% + 8px); bottom: 8px; height: 18px; display: flex; align-items: center; gap: 3px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.wave i { width: 4px; height: 4px; border-radius: 2px; background: var(--muted); }
.msg.ai.loading .wave, .msg.ai.speaking .wave { opacity: 1; }
.msg.ai.loading .wave i { animation: wait 1.2s ease-in-out infinite; }
.msg.ai.speaking .wave i { background: var(--ok); animation: talk .9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .15s !important; }
.wave i:nth-child(3) { animation-delay: .3s !important; }
.wave i:nth-child(4) { animation-delay: .45s !important; }
.msg.ai.loading .text { animation: wait-text 1.6s ease-in-out infinite; }

.msg.ai.target { outline: 2px dashed var(--amber); outline-offset: 4px; }
.msg.ai.nudge { animation: nudge 1s ease 2; }

.undo { display: flex; align-items: center; gap: 3px; margin: 4px 0 -2px auto; font-size: 12px; color: var(--muted); padding: 2px 0; }
.undo svg { width: 14px; height: 14px; }

.dots { display: inline-flex; gap: 4px; padding: 6px 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }

/* correction branch, attached under the sentence being corrected */
.thread {
  align-self: stretch; display: flex; flex-direction: column; gap: 8px;
  margin: 2px 0 4px 14px; padding: 8px 0 8px 14px; border-left: 2px solid var(--amber);
  animation: rise .3s ease both; transition: opacity .4s;
}
.thread-label { font-size: 12px; color: var(--muted); }
.thread .msg { font-size: 15px; padding: 8px 12px; }
.thread .msg.user { background: var(--amber-bg); }
.thread.done { opacity: .6; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 99px; }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag.warn { background: #f6e5dc; color: var(--warn-ink); }
.tag.info { background: var(--amber-bg); color: var(--amber-ink); }

/* strike the wrong words, then pop the fix in */
del { text-decoration: none; color: var(--warn-ink); background: linear-gradient(currentColor, currentColor) left 55% / 0% 2px no-repeat; animation: strike .5s ease forwards; }
mark { display: inline-block; background: none; color: var(--ok-ink); font-weight: 600; box-shadow: inset 0 -2px var(--ok); animation: pop .5s ease; }

/* ---------- knowledge card ---------- */
.card {
  align-self: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin: 4px 0 6px; font-size: 15px; animation: rise .45s ease both;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .04);
}
.card-h { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 17px; }
.pair s { color: var(--warn-ink); }
.pair b { color: var(--ok-ink); font-weight: 600; }
.pair small { color: var(--muted); font-size: 13px; }
.card p { margin: 6px 0; }
.card .alt { color: var(--muted); font-size: 14px; }
.card ul { margin: 6px 0 0; padding-left: 18px; color: #555; }

/* ---------- bottom bar ---------- */
.bar {
  padding: 6px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg); transition: background .3s;
}
body.correcting .bar { background: var(--amber-bg); }
.bar-top { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.live { flex: 1; min-width: 0; text-align: center; color: var(--muted); font-style: italic; font-size: 14px; padding-left: 34px; }
.live .undone { font-style: normal; font-size: 13px; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; }
.kb { padding: 6px; border-radius: 10px; color: var(--muted); display: grid; place-items: center; }
.kb.on { color: var(--ink); background: var(--line); }
.text-row input {
  width: 100%; padding: 10px 14px; margin: 2px 0 10px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; outline: none;
}
.text-row input:focus { border-color: var(--ok); }

/* the two intents get equal weight */
.buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.act {
  height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px; font-weight: 500; transition: transform .15s, background .3s, box-shadow .3s;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; /* hold to talk */
}
.act svg { width: 24px; height: 24px; }
.act:active:not(:disabled) { transform: scale(.97); }
.mic { background: var(--ink); color: #fff; }
.fix { background: var(--amber); color: var(--ink); }
.act.rec { animation: ring 1.3s ease-out infinite; }
.mic.rec { background: var(--warn-ink); }
.fix.rec { background: #dcbf72; }
.act.rec { transform: scale(.97); }
.act.cancel { background: #cfcac2; color: var(--ink); animation: none; }
.live.warn { color: var(--warn-ink); font-style: normal; }
body.correcting .fix { box-shadow: 0 0 0 3px rgba(233, 211, 155, .6); }
.fix.hint { animation: glow 1.2s ease 3; }
.shake { animation: shake .4s ease; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); z-index: 40;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  max-width: min(90vw, 460px); padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 14px; text-align: center;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- side panel / bottom sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 10; background: rgba(40, 36, 30, .25); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.panel {
  position: fixed; z-index: 20; background: var(--bg); overflow-y: auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  visibility: hidden; transition: transform .3s ease, visibility .3s;
}
body.panel-open .scrim { opacity: 1; visibility: visible; }
body.panel-open .panel { visibility: visible; transform: none; }
@media (min-width: 768px) {
  .panel { top: 0; right: 0; bottom: 0; width: 400px; transform: translateX(100%); box-shadow: -8px 0 30px rgba(0, 0, 0, .06); }
}
@media (max-width: 767px) {
  .panel { left: 0; right: 0; bottom: 0; max-height: 85dvh; border-radius: 20px 20px 0 0; transform: translateY(100%); }
  .panel::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: -8px auto 12px; }
  .icon.labeled span { display: none; }
}
.panel h2, .page h2 { font-size: 18px; margin: 0 0 16px; }
.panel h3, .page h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 20px 0 8px; }
textarea, input[type=text] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; resize: vertical;
}
textarea:focus, input[type=text]:focus { border-color: var(--ok); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button, .chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.add { border-style: dashed; color: var(--muted); }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row input { flex: 1; }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; accent-color: var(--ink); }
.primary { width: 100%; margin-top: 22px; padding: 12px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 500; }
.ghost-btn { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
.link-card {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; margin-top: 20px;
  padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
}
.link-card div { flex: 1; }
.link-card small { display: block; color: var(--muted); }
.topics { display: flex; flex-direction: column; gap: 4px; }
.topics button { text-align: left; padding: 10px 12px; border-radius: 10px; }
.topics button.on { background: var(--ai); font-weight: 600; }
.note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* ---------- full page: mistake practice ---------- */
.page {
  position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-y: auto;
  transform: translateX(100%); visibility: hidden; transition: transform .3s ease, visibility .3s;
}
.page.open { transform: none; visibility: visible; }
.page-head {
  position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.page-head h2 { margin: 0; flex: 1; font-size: 17px; }
.page-head .saved { font-size: 12px; color: var(--ok-ink); opacity: 0; transition: opacity .3s; }
.page-head .saved.show { opacity: 1; }
.page-body { max-width: 760px; margin: 0 auto; padding: 8px 16px calc(32px + env(safe-area-inset-bottom)); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  text-align: left; padding: 14px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line);
  transition: border-color .2s, background .2s;
}
.mode b { display: block; font-size: 16px; margin-bottom: 4px; }
.mode span { font-size: 13px; color: var(--muted); }
.modes.tiers { grid-template-columns: 1fr; }
.mode.on { border-color: var(--ink); background: var(--amber-bg); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cat {
  position: relative; text-align: left; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line);
  transition: border-color .2s, background .2s;
}
.cat b { display: block; font-weight: 600; }
.cat p { margin: 4px 0; font-size: 13px; color: var(--muted); }
.cat i { font-size: 13px; color: var(--warn-ink); font-style: normal; }
.cat small { position: absolute; top: 12px; right: 12px; font-size: 12px; color: var(--muted); }
.cat.on { border-color: var(--ok); background: var(--ok-bg); }
.cat.on::after { content: "✓"; position: absolute; right: 12px; bottom: 10px; color: var(--ok-ink); font-weight: 700; }
.items { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); animation: rise .25s ease both; }
.item span { flex: 1; overflow-wrap: anywhere; }
.item small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.item button { color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; }
.page .hint-box { padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); font-size: 13px; color: var(--amber-ink); margin-top: 10px; }

/* ---------- login ---------- */
.login {
  --auth-radius: 12px;
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: safe center; padding: 32px 24px; overflow-y: auto; background: var(--bg);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
body.logged-out .login { opacity: 1; visibility: visible; }
.login form { width: min(100%, 380px); text-align: center; animation: rise .4s ease both; }
.login h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: .5px; }
.login p { color: var(--muted); font-size: 14px; margin: 0 0 24px; text-wrap: pretty; }
.login input:not([type=hidden]) {
  width: 100%; height: 52px; padding: 12px 14px; text-align: left; font-size: 16px; line-height: 1.5;
  border: 1px solid var(--line); border-radius: var(--auth-radius); background: var(--card);
  appearance: none; outline: none; box-shadow: none;
}
.login input:not([type=hidden]):focus { border-color: var(--ok-ink); box-shadow: 0 0 0 3px var(--ok-bg); }
.login input::placeholder { color: var(--muted); opacity: 1; }
.login .primary { height: 52px; margin-top: 12px; border-radius: var(--auth-radius); }
.login button:focus-visible { outline: 2px solid var(--ok-ink); outline-offset: 3px; }
.login label { display: block; text-align: left; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.login #turnstileWidget { display: flex; justify-content: center; margin-top: 18px; min-height: 65px; }
.login .auth-error { color: var(--amber-ink); margin: 12px 0 0; min-height: 20px; }
.login #authSwitch { display: block; margin: 14px auto 0; padding: 6px 12px; border-radius: var(--auth-radius); color: var(--ok-ink); }
.login .auth-note { margin: 20px 0 0; font-size: 12px; line-height: 1.7; }
.me { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* hover only where there is a real pointer, so taps on phones don't leave buttons highlighted */
@media (hover: hover) {
  .topic:hover, .icon:not(.on):hover, .kb:hover, .topics button:hover { background: var(--line); }
  .cat:hover:not(.on), .mode:hover:not(.on), .link-card:hover { border-color: #d6d0c6; }
}

/* ---------- keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fade { to { opacity: 1; } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes ring { from { box-shadow: 0 0 0 0 rgba(181, 101, 90, .35); } to { box-shadow: 0 0 0 14px rgba(181, 101, 90, 0); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes nudge { 50% { box-shadow: 0 0 0 6px rgba(233, 211, 155, .6); } }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(233, 211, 155, .7); } }
@keyframes wait { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes talk { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@keyframes wait-text { 50% { opacity: .55; } }
@keyframes strike { to { background-size: 100% 2px; } }
@keyframes pop { 0% { transform: scale(.8); opacity: 0; } 60% { transform: scale(1.08); } }

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

/* ---------- quiz: spoken grammar drill ---------- */
body.quiz #fixBtn { display: none; }
body.quiz .buttons { grid-template-columns: 1fr; }
.question { display: flex; flex-direction: column; gap: 10px; animation: rise .3s ease both; transition: opacity .4s; }
.question + .question { border-top: 1px dashed var(--line); padding-top: 14px; }
.question.done { opacity: .6; }
.q-label { font-size: 12px; color: var(--muted); text-align: center; }
.start {
  align-self: center; margin-top: 6px; padding: 10px 28px; border-radius: 99px;
  background: var(--ink); color: #fff; font-weight: 500; animation: rise .3s ease both;
}

/* ---------- settings page: sections with a jump bar, preset cards in tabs ---------- */
.page-nav { flex-basis: 100%; display: flex; gap: 4px; overflow-x: auto; margin: 2px -4px -4px; scrollbar-width: none; }
.page-nav button { padding: 5px 12px; border-radius: 99px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.sec {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-top: 14px;
  scroll-margin-top: 110px; animation: rise .3s ease both;
}
.page .sec-h { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.sec-h small { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.sec-sub { margin: 2px 0 12px; font-size: 13px; color: var(--muted); }
.sec-h + .modes, .sec-h + .tabs, .sec-h + h4 { margin-top: 12px; }
.sec h4 { font-size: 13px; font-weight: 500; color: var(--muted); margin: 18px 0 8px; }
.sec .mode { background: var(--bg); }
.sec .mode.on { background: var(--amber-bg); }
.sec .cat { background: var(--bg); }
.sec .cat.on { background: var(--ok-bg); }
.sec .seg button { background: var(--bg); }
.sec .seg button.on { background: var(--ink); }
.sec .item { background: var(--bg); }
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 12px; scrollbar-width: none; }
.tabs button { padding: 8px 10px; font-size: 14px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s; }
.tabs button.on { color: var(--ink); border-color: var(--ink); font-weight: 500; }
.cats.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cat .en { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.cats.compact .cat small { position: static; display: block; margin-top: 2px; color: var(--ok-ink); }
/* the chosen scene's sub-scenes, tinted like the chosen card so the two read as one */
.cats.compact { grid-auto-flow: dense; } /* the cards after the panel fill the rest of the chosen card's row */
.subs { grid-column: 1 / -1; padding: 12px 14px 14px; border-radius: 14px; background: var(--ok-bg); }
.subs.fresh { animation: rise .25s ease both; }
.subs-h { font-size: 14px; font-weight: 600; color: var(--ok-ink); }
.subs p { margin: 2px 0 10px; font-size: 12px; color: var(--muted); }
.sub-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sub {
  display: flex; flex-direction: column; align-items: flex-start; padding: 7px 12px; border-radius: 12px;
  background: #fff; border: 1.5px solid transparent; text-align: left; transition: border-color .2s, background .2s, color .2s;
}
.sub b { font-size: 14px; font-weight: 500; }
.sub span { font-size: 11px; color: var(--muted); }
.sub.on { background: var(--ok-ink); color: #fff; }
.sub.on span { color: rgba(255, 255, 255, .75); }
.cat b + .en + p { margin-top: 6px; }
.row textarea { flex: 1; }
.row.actions { flex-wrap: wrap; }
.ghost-btn.main { background: var(--ink); border-color: var(--ink); color: #fff; }
.sec .hint-box { padding: 10px 12px; border-radius: 10px; background: var(--amber-bg); font-size: 13px; line-height: 1.7; color: var(--amber-ink); margin-top: 10px; }
.item em { font-style: normal; color: var(--muted); }
.item b { color: var(--ok-ink); font-weight: 500; }
.text-btn { margin-top: 10px; font-size: 13px; color: var(--warn-ink); padding: 4px 0; }
@media (hover: hover) {
  .page-nav button:hover, .tabs button:hover { color: var(--ink); }
  .sub:hover:not(.on) { border-color: var(--ok); }
}
.sec .cat.on::after { top: 10px; bottom: auto; }
.sec .cat b { padding-right: 18px; }
.page-head { padding-left: max(16px, calc(50% - 364px)); padding-right: max(16px, calc(50% - 364px)); } /* lines up with .page-body */
/* redraws after a change: no entrance animation, and the page keeps its own scroll position (see fullPage) */
.page { overflow-anchor: none; }
.page.settled .sec, .page.settled .item { animation: none; }

/* ---------- placeholders while waiting for the server ---------- */
.skel {
  display: block; height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, var(--line) 30%, #f7f4ef 50%, var(--line) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skel-row { display: flex; flex-direction: column; gap: 8px; width: min(70%, 460px); padding: 6px 0; }
.skel-row.user { align-self: flex-end; align-items: flex-end; }
.scene .skel { display: inline-block; height: 12px; vertical-align: middle; }
.topics .skel { height: 18px; margin: 11px 12px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
