/* 小猴教练 — 设计 token + 整站视觉 */
:root {
  --bg0: #eef6f1;
  --bg1: #f7faf8;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, #d8f3e4 0%, transparent 55%),
             radial-gradient(900px 500px at 100% 0%, #dbeafe 0%, transparent 50%),
             linear-gradient(180deg, var(--bg0), var(--bg1) 40%, #f3f4f6);
  --card: #ffffff;
  --card-soft: #f4faf7;
  --text: #14201a;
  --muted: #6b7c74;
  --primary: #1cb0f6;
  --primary-strong: #1899d6;
  --primary-soft: #e8f7fe;
  --accent: #58cc02;
  --accent-strong: #58a700;
  --accent-soft: #e7f8d8;
  --ok: #58cc02;
  --ok-bg: #e7f8d8;
  --bad: #ff4b4b;
  --bad-bg: #ffe5e5;
  --warn: #ff9600;
  --border: #e2ebe6;
  --border-strong: #c9d9d0;
  --shadow-sm: 0 1px 2px rgba(20, 32, 26, .04), 0 1px 3px rgba(20, 32, 26, .06);
  --shadow-md: 0 4px 14px rgba(20, 32, 26, .08), 0 1px 3px rgba(20, 32, 26, .04);
  --shadow-lg: 0 12px 28px rgba(20, 32, 26, .1);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --nav-h: 58px;
  --bottom-nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-family: var(--font);
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--primary-strong); text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Top bar（毛玻璃） ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  min-height: var(--nav-h);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(226, 235, 230, .9);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: var(--shadow-sm);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--text) !important;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.brand-text { font-size: 17px; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-chip {
  font-size: 12px;
  color: var(--muted);
  background: var(--card-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.top-logout { font-size: 13px; color: var(--muted) !important; }
.desktop-nav { display: flex; gap: 4px; margin-left: 18px; }
.nav-item {
  color: var(--muted) !important;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: var(--primary-soft); color: var(--primary-strong) !important; }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong) !important;
  box-shadow: inset 0 0 0 1px rgba(28, 176, 246, .25);
}

/* ---- Bottom nav（移动端 App 感） ---- */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(20, 32, 26, .06);
  justify-content: space-around;
  align-items: stretch;
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted) !important;
  font-size: 11px;
  font-weight: 600;
  border-radius: 14px;
  padding: 6px 4px;
  transition: color .15s ease, background .15s ease;
}
.bn-ico-img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bn-ico-img img {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: block;
}
.bn-ico { font-size: 18px; line-height: 1; }
.bn-item.active {
  color: var(--primary-strong) !important;
  background: var(--primary-soft);
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 20px auto 0;
  padding: 0 16px 48px;
  flex: 1;
}
.container-coach {
  max-width: 1080px;
  padding-bottom: 24px;
}
body.page-coach .container-coach { margin-top: 14px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(226, 235, 230, .85);
}
.muted { color: var(--muted); }
.tip { font-size: 13px; margin-top: 8px; }
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 12px 16px 28px;
}

/* ---- Buttons ---- */
.btn, .module-btn {
  appearance: none;
  border: 2px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--border-strong);
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease, border-color .15s ease;
}
.btn:hover, .module-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
}
.btn:active, .module-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--border-strong);
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-strong);
  box-shadow: 0 3px 0 var(--primary-strong);
}
.btn.primary:hover { background: #33b9f7; box-shadow: 0 4px 0 var(--primary-strong); }
.btn.primary:active { box-shadow: 0 1px 0 var(--primary-strong); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 12px; box-shadow: 0 2px 0 var(--border-strong); }
.btn.primary.small { box-shadow: 0 2px 0 var(--primary-strong); }
.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--primary-strong);
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.chip {
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--card-soft);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.chip:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

/* ---- Home ---- */
.hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.hero > p { margin: 0; color: var(--muted); }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.stats div, .stats.big div {
  background: var(--card-soft);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  border: 1px solid var(--border);
}
.stats b { display: block; font-size: 22px; font-weight: 800; color: var(--text); }
.stats span { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-link { display: block; font-size: 12px; margin-top: 4px; font-weight: 700; }

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.module-grid form { margin: 0; }
.module-btn {
  width: 100%;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #fff 0%, var(--card-soft) 100%);
}
.module-btn small.sub { font-weight: 500; font-size: 12px; color: var(--muted); }
.module-grid form:nth-child(1) .module-btn { border-color: #fbbf24; box-shadow: 0 3px 0 #f59e0b; }
.module-grid form:nth-child(2) .module-btn { border-color: #34d399; box-shadow: 0 3px 0 #10b981; }
.module-grid form:nth-child(3) .module-btn { border-color: #60a5fa; box-shadow: 0 3px 0 #3b82f6; }
.module-grid form:nth-child(4) .module-btn { border-color: #a78bfa; box-shadow: 0 3px 0 #8b5cf6; }
.module-grid form:nth-child(5) .module-btn { border-color: #fb7185; box-shadow: 0 3px 0 #f43f5e; }
.module-grid form:nth-child(6) .module-btn { border-color: #2dd4bf; box-shadow: 0 3px 0 #14b8a6; }

.continue-card {
  border-color: rgba(28, 176, 246, .35);
  background: linear-gradient(135deg, #e8f7fe 0%, #fff 55%);
}
.continue-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.continue-body h2 { margin: 0 0 4px; font-size: 18px; }
.continue-body p { margin: 0; }
.continue-btn { white-space: nowrap; padding: 12px 18px; }

.recent-list, .list, .wrong-list { list-style: none; padding: 0; margin: 0; }
.recent-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.recent-list li:first-child { border-top: none; padding-top: 4px; }
.recent-title { font-weight: 700; }
.list li { padding: 8px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: none; }

/* ---- Login ---- */
.login-card {
  max-width: 420px;
  margin: 48px auto;
  box-shadow: var(--shadow-lg);
}
.login-card h1 { margin-top: 0; }
.stack label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.stack input, .agent-form input, .coach-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  margin-top: 6px;
  font-size: 15px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.stack input:focus, .agent-form input:focus, .coach-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(28, 176, 246, .18);
}

/* ---- Practice ---- */
.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.progress-track {
  height: 10px;
  background: #e5eee9;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 0 0 14px;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #89e219, var(--accent));
  border-radius: var(--radius-pill);
  width: 0;
  transition: width .45s cubic-bezier(.2, .85, .3, 1);
  box-shadow: 0 0 8px rgba(88, 204, 2, .35);
}
.practice-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -4px 0 14px;
  font-size: 13px;
}
.link-quiet {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-quiet:hover { color: var(--primary-strong); }
.tip-inline { font-size: 12px; }
.stem { font-size: 16.5px; margin: 12px 0; font-weight: 500; }
.passage {
  background: var(--card-soft);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  transition: transform .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-sm);
}
.option:hover { border-color: #93c5fd; background: var(--primary-soft); transform: translateY(-1px); }
.option input { margin-top: 3px; accent-color: var(--primary); }
.option.is-answer {
  border-color: var(--accent-strong);
  background: var(--ok-bg);
  animation: option-ok .5s ease both;
}
.option.is-wrong {
  border-color: var(--bad);
  background: var(--bad-bg);
  animation: feedback-bad .4s ease;
}
.options.readonly .option:hover { background: inherit; border-color: inherit; transform: none; }
.options.readonly .option { cursor: default; }
.feedback {
  padding: 12px 14px;
  border-radius: 14px;
  margin: 12px 0;
  font-weight: 700;
}
.feedback.ok { background: var(--ok-bg); color: var(--accent-strong); animation: feedback-ok .45s cubic-bezier(.2,.9,.3,1); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); animation: feedback-bad .4s ease; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row.between { justify-content: space-between; align-items: center; }
.row.tight { gap: 6px; }
.center { text-align: center; }
.center-row { justify-content: center; }

.agent-panel { position: sticky; bottom: 12px; }
.agent-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-log {
  max-height: 220px;
  overflow: auto;
  background: var(--card-soft);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
  font-size: 14px;
  border: 1px solid var(--border);
}
.msg { margin: 8px 0; white-space: pre-wrap; }
.msg.user { color: #0c4a6e; font-weight: 600; }
.msg.assistant { color: var(--text); }
.agent-form { display: flex; gap: 8px; }
.agent-form input { margin-top: 0; }

.html-body img { max-width: 100%; height: auto; }
.html-body p { margin: 0.4em 0; }

/* ---- Wrong book ---- */
.wrong-list li { border-top: 1px solid var(--border); padding: 4px 0; }
.wrong-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 12px;
  border-radius: 14px;
  transition: background .15s ease;
}
.wrong-link:hover { background: var(--card-soft); }
.wrong-link .go { font-size: 12px; color: var(--primary-strong); margin-top: 6px; font-weight: 700; }
.meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.stem-preview { max-height: 72px; overflow: hidden; }
.stem-preview.plain { max-height: none; overflow: visible; color: var(--text); font-size: 14px; }
.due { color: var(--accent-strong); font-weight: 700; }
.tag { font-style: normal; font-size: 12px; margin-left: 8px; padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.tag.ok { background: var(--ok-bg); color: var(--accent-strong); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }

.flash {
  background: #fff7ed;
  color: #9a3412;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  border: 1px solid #fed7aa;
  font-weight: 600;
  animation: card-in .3s ease both;
}
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: #fecaca; }
.warn { color: var(--bad); }
.analysis-body {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  background: var(--card-soft);
  padding: 14px;
  border-radius: 14px;
  margin: 0;
  line-height: 1.65;
  border: 1px solid var(--border);
}
.analysis h2 { margin-top: 0; }
.analysis-source { margin: -4px 0 10px; font-size: 12px; }

/* ---- Coach multi-conversation ---- */
.coach-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  min-height: min(74vh, 680px);
}
.conv-sidebar {
  background: linear-gradient(180deg, #f3faf6 0%, #eef6f1 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.conv-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}
.conv-sidebar-head h2 { margin: 0; font-size: 15px; }
.conv-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow: auto;
  flex: 1;
}
.conv-item {
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  margin-bottom: 4px;
}
.conv-item.active {
  background: #fff;
  box-shadow: var(--shadow-sm);
  outline: 2px solid rgba(28, 176, 246, .35);
}
.conv-link {
  flex: 1;
  padding: 10px 12px;
  color: inherit !important;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.conv-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-meta { font-size: 11px; }
.conv-del {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  width: 32px;
  cursor: pointer;
  font-size: 18px;
  border-radius: 0 12px 12px 0;
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.conv-item:hover .conv-del, .conv-item.active .conv-del { opacity: 1; }
.conv-del:hover { background: var(--bad-bg); color: var(--bad); }

.coach-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 18px 14px;
  background: #fff;
}
.coach-head h1 { margin: 0 0 4px; font-size: 20px; }
.coach-head .tip-line { margin: 0 0 8px; font-size: 13px; }
.coach-head-row { display: flex; gap: 10px; align-items: flex-start; }
.coach-banner {
  margin: 0 0 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: #9a3412;
  background: #fff7ed;
  border-radius: 12px;
  border: 1px solid #fed7aa;
}
.coach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.coach-log {
  flex: 1;
  overflow: auto;
  background: linear-gradient(180deg, #f4faf7 0%, #f0f7f3 100%);
  border-radius: 16px;
  padding: 14px;
  min-height: 260px;
  max-height: 52vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
}
.coach-log .msg {
  margin: 0;
  display: flex;
  max-width: 88%;
  animation: card-in .28s ease both;
}
.coach-log .msg.user { align-self: flex-end; }
.coach-log .msg.assistant { align-self: flex-start; }
.coach-log .bubble {
  padding: 11px 14px;
  border-radius: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
}
.coach-log .msg.user .bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.coach-log .msg.assistant .bubble {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.coach-log .msg.pending .bubble {
  color: var(--muted);
  font-style: italic;
}
.coach-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  background: #fff;
  padding-top: 4px;
}
.coach-form input { flex: 1; margin-top: 0; }
.coach-form .btn { white-space: nowrap; padding: 12px 18px; }
.conv-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 26, .35);
  z-index: 45;
}
.only-mobile { display: none; }

/* ---- Result ---- */
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  transition: opacity .45s ease;
}
.celebrate.done { opacity: 0; visibility: hidden; }
.fw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fw-skip {
  pointer-events: auto;
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 51;
  appearance: none;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(20, 32, 26, .55);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.celebrate.done .fw-skip { display: none; }
.result-hero { position: relative; overflow: hidden; }
.result-badge {
  display: inline-block;
  margin: 0 0 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 700;
}
.result-title {
  margin: 0;
  font-size: 30px;
  letter-spacing: -.02em;
  animation: result-pop .55s cubic-bezier(.2,.9,.3,1) both;
}
.result-mod { margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.result-stats {
  margin-top: 16px;
  grid-template-columns: 1fr 1fr;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.stat-pop {
  animation: result-pop .6s cubic-bezier(.2,.9,.3,1) both;
  animation-delay: var(--d, 0s);
}
.stat-pop b { font-size: 28px; color: var(--primary-strong); }
.ok-line { color: var(--accent-strong); font-weight: 700; margin: 0; }

/* ---- Motion ---- */
.container > .card,
.container > section.card {
  animation: card-in .38s cubic-bezier(.2,.85,.3,1) both;
}
.container > .card:nth-child(1) { animation-delay: .02s; }
.container > .card:nth-child(2) { animation-delay: .06s; }
.container > .card:nth-child(3) { animation-delay: .1s; }
.container > .card:nth-child(4) { animation-delay: .14s; }
.container > .card:nth-child(5) { animation-delay: .18s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes result-pop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes feedback-ok {
  0% { transform: scale(.96); opacity: .6; }
  55% { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes feedback-bad {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@keyframes option-ok {
  from { transform: scale(.98); }
  to { transform: none; }
}

h1, h2 { letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0 0 10px; }

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .bottom-nav { display: flex; }
  .container { padding-bottom: calc(28px + var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); }
  .footer { padding-bottom: calc(12px + var(--bottom-nav-h)); }
  .agent-panel { bottom: calc(12px + var(--bottom-nav-h)); }

  .coach-layout { grid-template-columns: 1fr; min-height: min(70vh, 620px); }
  .conv-sidebar {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    bottom: var(--bottom-nav-h);
    width: min(86vw, 300px);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .conv-sidebar.open { transform: translateX(0); }
  .only-mobile { display: inline-flex; }
  .coach-log { max-height: 46vh; }
  .fw-skip { bottom: calc(18px + var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: 1fr; }
  .brand-text { font-size: 15px; }
  .card { padding: 16px; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .container > .card,
  .container > section.card,
  .feedback.ok,
  .feedback.bad,
  .option.is-answer,
  .option.is-wrong,
  .flash,
  .result-title,
  .stat-pop,
  .coach-log .msg {
    animation: none !important;
  }
  .progress-fill { transition: none; }
  .btn, .module-btn, .chip, .option { transition: none; }
  .module-btn:hover, .btn:hover, .module-btn:active, .btn:active { transform: none; }
  .celebrate { display: none !important; }
  .conv-sidebar { transition: none; }
}
