/* Training portal — builds on /shared/base.css */
.logo-text { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.sidebar .brand-logo.badge img { height: 92px; }
.sidebar .brand-logo.wide img { height: 44px; }
.topbar .badge img { height: 40px; }
.sidebar .brand-logo.badge { justify-content: center; }
.powered { font-size: 0.78rem; color: var(--ink-4); padding: 0.35rem 0.6rem 0; }

/* ---------- public landing ---------- */
.public-top { display: flex; align-items: center; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 3rem); }
.public-top .logo-img { height: 72px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.public-top.wide .logo-img { height: 44px; }
.landing { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem) 4rem; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(1.5rem, 5vw, 4.5rem) 0 clamp(2rem, 5vw, 4rem);
}
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.4rem); line-height: 0.98; font-weight: 800; letter-spacing: -0.005em; max-width: 13ch; }
.hero .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 46ch; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); } .hero-art { order: -1; max-width: 360px; margin: 0 auto; } }

/* Terminal in the hero: the screen cycles card price -> cash price -> approved */
.terminal-art { position: relative; width: min(100%, 380px); margin-left: auto; }
.terminal-art svg { display: block; width: 100%; height: auto; }
.terminal-screen {
  position: absolute;
  left: 21.5%;
  right: 21.5%;
  top: 12.5%;
  height: 31%;
  display: grid;
  place-items: center;
  text-align: center;
  color: #dff7ea;
  font-family: var(--font-display);
  overflow: hidden;
}
.terminal-screen .s { position: absolute; inset: 0; display: grid; place-content: center; gap: 0.15rem; opacity: 0; transition: opacity 0.45s; }
.terminal-screen .s.on { opacity: 1; }
.terminal-screen .k { font-size: clamp(0.7rem, 2.6vw, 0.95rem); font-weight: 600; opacity: 0.8; }
.terminal-screen .v { font-size: clamp(1.4rem, 6vw, 2.2rem); font-weight: 800; letter-spacing: 0.01em; }
.terminal-screen .ok { color: #7cf0b0; }
.pair { display: flex; gap: 1.2rem; justify-content: center; }
.pair div { display: grid; }

.section { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.section > h2 { margin-bottom: 0.25rem; }
.section > .sub { color: var(--ink-3); margin-bottom: 1.5rem; max-width: 60ch; }
.syllabus { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 2rem; counter-reset: mod; }
.syllabus li { display: grid; grid-template-columns: 2.6rem 1fr; gap: 0.75rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line-soft); counter-increment: mod; }
.syllabus li::before { content: counter(mod); font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1; color: var(--brand); }
.syllabus strong { display: block; font-size: 1.05rem; }
.syllabus span { color: var(--ink-3); font-size: 0.92rem; }
.meet { display: grid; grid-template-columns: 180px 1fr; gap: 2rem; align-items: center; }
@media (max-width: 620px) { .meet { grid-template-columns: 1fr; } .meet .avatar-lg { width: 140px; } }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: min(520px, 100%); background: var(--panel); border-radius: var(--r-lg); border: 1px solid var(--line-soft); padding: clamp(1.25rem, 4vw, 2.25rem); }
.auth-card .logo-img { display: block; height: 84px; width: auto; max-width: 240px; margin: 0 auto 1rem; object-fit: contain; }
.auth-card h1 { font-size: 2rem; text-align: center; }
.auth-card .sub { text-align: center; color: var(--ink-3); margin-bottom: 1.25rem; }
.auth-card form { display: grid; gap: 0.9rem; }
.auth-card .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 520px) { .auth-card .two { grid-template-columns: 1fr; } }
.auth-alt { text-align: center; margin-top: 1rem; color: var(--ink-3); font-size: 0.95rem; }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.5rem; align-items: start; }
@media (max-width: 1060px) { .dash { grid-template-columns: minmax(0, 1fr); } }
.continue { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; background: var(--brand); color: var(--brand-ink); border-radius: var(--r-md); padding: 1.4rem 1.5rem; }
.continue h2, .continue h3 { color: inherit; margin: 0.1rem 0 0.3rem; }
.continue p { margin: 0; opacity: 0.85; }
.continue .btn { --b-bg: var(--brand-ink); --b-ink: var(--brand); --b-line: var(--brand-ink); }
@media (max-width: 620px) { .continue { grid-template-columns: 1fr; } }

/* The training receipt: progress printed like a terminal receipt */
.receipt-wrap { filter: drop-shadow(0 8px 18px rgba(23, 34, 49, 0.12)); }
.receipt {
  --z: 7px;
  position: relative;
  background: var(--paper);
  color: #26292e;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  padding: 1.7rem 1.35rem 1.9rem;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--z)) 51% repeat-x;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--z)) 51% repeat-x;
}
.receipt .r-head { text-align: center; margin-bottom: 0.9rem; }
.receipt .r-head img { height: 54px; width: auto; max-width: 160px; object-fit: contain; filter: grayscale(1); opacity: 0.9; }
.receipt .r-title { font-weight: 600; letter-spacing: 0.04em; }
.receipt .r-meta { color: #6a6f78; font-size: 0.78rem; }
.receipt .r-rule { border-top: 1px dashed #b8bcc4; margin: 0.7rem 0; }
.receipt .r-line { display: flex; align-items: baseline; gap: 0.4rem; text-decoration: none; color: inherit; }
.receipt a.r-line:hover .r-label { text-decoration: underline; }
.receipt .r-label { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt .r-fill { flex: 1; border-bottom: 1px dotted #a9aeb7; transform: translateY(-0.25em); min-width: 1rem; }
.receipt .r-val { flex: none; font-weight: 600; }
.receipt .r-val.ok { color: var(--ok); }
.receipt .r-val.muted { color: #8b9099; font-weight: 400; }
.receipt .r-total { font-size: 1rem; font-weight: 700; }
.receipt .r-foot { text-align: center; margin-top: 0.9rem; color: #6a6f78; font-size: 0.78rem; }
.receipt .stamp {
  position: absolute;
  right: 1rem;
  top: 38%;
  transform: rotate(-13deg);
  border: 3px solid var(--ok);
  color: var(--ok);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: 0.06em;
  padding: 0.05em 0.45em;
  border-radius: 8px;
  opacity: 0.82;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  pointer-events: none;
}

.prompt-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.prompt-chips .chip { text-align: left; }

/* ---------- course / modules ---------- */
.module-list { display: grid; gap: 0.9rem; }
.module-row { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 1rem 1.2rem; text-decoration: none; color: inherit; }
.module-row:hover { border-color: var(--brand-line); }
.module-row .n { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--brand); text-align: center; line-height: 1; }
.module-row.locked { opacity: 0.6; }
.module-row.locked .n { color: var(--ink-4); }
.module-row.done .n { color: var(--ok); }
.module-row h3 { margin: 0 0 0.15rem; font-size: 1.2rem; }
.module-row p { margin: 0; color: var(--ink-3); font-size: 0.93rem; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li a { display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 0.2rem; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.lesson-list li a:hover { color: var(--brand); }
.lesson-list .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.lesson-list .tick svg { width: 15px; height: 15px; }
.lesson-list .done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- lesson ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; font-size: 0.9rem; color: var(--ink-3); margin-bottom: 0.6rem; }
.crumbs a { color: var(--ink-3); }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
@media (max-width: 1060px) { .lesson-grid { grid-template-columns: minmax(0, 1fr); } .lesson-rail { order: 2; position: static; } }
.lesson-body { max-width: 72ch; font-size: 1.06rem; line-height: 1.65; }
.lesson-body h3 { margin-top: 1.8rem; font-size: 1.45rem; }
.lesson-body ul, .lesson-body ol { padding-left: 1.25rem; }
.lesson-body li { margin: 0.3rem 0; }
.lesson-body figure { margin: 1.5rem 0; }
.lesson-body figure .art { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 1rem; }
.lesson-body figcaption { font-size: 0.88rem; color: var(--ink-3); margin-top: 0.45rem; }
.callout { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: 0.9rem 1.1rem; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 1.25rem 0; }
.callout strong.t { display: block; margin-bottom: 0.2rem; }
.callout.warn { border-color: var(--warn); background: var(--warn-bg); }
.callout.rule { border-color: var(--bad); background: var(--bad-bg); }
.callout.tip { border-color: var(--ok); background: var(--ok-bg); }
.callout p:last-child { margin-bottom: 0; }
.terms { display: grid; grid-template-columns: minmax(130px, 30%) 1fr; gap: 0.1rem 1rem; margin: 1rem 0; }
.terms dt { font-weight: 700; padding: 0.55rem 0; border-top: 1px solid var(--line-soft); }
.terms dd { margin: 0; padding: 0.55rem 0; border-top: 1px solid var(--line-soft); color: var(--ink-2); }
@media (max-width: 620px) { .terms { grid-template-columns: 1fr; } .terms dd { border-top: 0; padding-top: 0; } }
.script { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 1rem 1.1rem; margin: 1.25rem 0; }
.script h4 { margin-bottom: 0.6rem; }
.script .say { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; padding: 0.35rem 0; }
.script .who { font-weight: 700; color: var(--brand); font-size: 0.9rem; padding-top: 0.1rem; }
.script .who.m { color: var(--ink-3); }
.lesson-body table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 1rem 0; background: var(--panel); }
.lesson-body th, .lesson-body td { padding: 0.55rem 0.7rem; border: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.lesson-body th { background: var(--sunk); font-weight: 600; }
.lesson-foot { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.lesson-rail { position: sticky; top: 1.5rem; display: grid; gap: 1rem; }

/* Narrated "video" lesson player */
.player { background: #0f1720; color: #f4f7fb; border-radius: var(--r-md); overflow: hidden; margin-bottom: 1.5rem; }
.player .stage { position: relative; aspect-ratio: 16 / 9; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.25rem; align-items: center; padding: clamp(1rem, 3vw, 2rem); background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--brand) 55%, #0f1720) 0%, #0f1720 60%); }
.player .stage h3 { color: #fff; font-size: clamp(1.3rem, 1rem + 1.4vw, 2.1rem); margin-bottom: 0.4rem; }
.player .stage p { color: #c8d2de; font-size: clamp(0.85rem, 0.75rem + 0.4vw, 1.05rem); margin: 0; max-width: 40ch; }
.player .stage .art-slot { background: #f7f9fc; border-radius: var(--r-md); padding: 0.6rem; display: grid; place-items: center; max-height: 100%; overflow: hidden; }
.player .stage .art-slot svg { max-height: 100%; }
@media (max-width: 620px) { .player .stage { grid-template-columns: 1fr; aspect-ratio: auto; } .player .stage .art-slot { max-height: 180px; } }
.player .controls { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.9rem; background: #0b1118; }
.player .controls .btn { --b-bg: transparent; --b-ink: #fff; --b-line: rgba(255,255,255,0.25); }
.player .controls .btn:hover { --b-bg: rgba(255,255,255,0.08); }
.player .dots { display: flex; gap: 0.35rem; flex: 1; }
.player .dots button { flex: 1; height: 4px; border: 0; border-radius: 2px; background: rgba(255,255,255,0.22); cursor: pointer; padding: 0; }
.player .dots button.on { background: var(--accent); }
.player .dots button.seen { background: rgba(255,255,255,0.55); }
.player .cc { font-size: 0.85rem; color: #aab6c4; padding: 0.55rem 0.9rem 0.7rem; background: #0b1118; border-top: 1px solid rgba(255,255,255,0.06); min-height: 2.6rem; }
.video-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: #000; margin-bottom: 1.5rem; }
.video-embed iframe, .video-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Savings calculator (inside lessons) */
.calc { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 1.1rem; margin: 1.25rem 0; }
.calc .inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 620px) { .calc .inputs { grid-template-columns: 1fr; } }
.calc .out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.calc .out div { background: var(--sunk); border-radius: var(--r-sm); padding: 0.75rem; }
.calc .out b { display: block; font-family: var(--font-display); font-size: 1.6rem; }
.calc .out span { font-size: 0.85rem; color: var(--ink-3); }
.calc .out .good { background: var(--ok-bg); color: var(--ok); }

/* ---------- quiz & exam ---------- */
.q-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 1.2rem 1.3rem; }
.q-card + .q-card { margin-top: 1rem; }
.q-card h3 { font-family: var(--font); font-size: 1.08rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.85rem; }
.q-num { color: var(--ink-3); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.opts { display: grid; gap: 0.5rem; }
.opt { display: flex; gap: 0.7rem; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.7rem 0.85rem; cursor: pointer; background: var(--panel); }
.opt:hover { border-color: var(--brand-line); }
.opt input { margin-top: 0.2rem; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.explain { margin-top: 0.75rem; font-size: 0.95rem; color: var(--ink-2); }
.exam-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 0.75rem 1rem; margin-bottom: 1rem; }
.timer { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); }
.qnav { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.qnav button { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); font: 600 0.82rem var(--font); cursor: pointer; color: var(--ink-2); }
.qnav button.answered { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.qnav button.cur { outline: 2px solid var(--brand); outline-offset: 1px; }
.result-hero { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; }
.score-ring { --p: 0; --c: var(--brand); width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-soft) 0); }
.score-ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 2rem; }
.score-ring.ok { --c: var(--ok); }
.score-ring.bad { --c: var(--bad); }
@media (max-width: 520px) { .result-hero { grid-template-columns: 1fr; justify-items: start; } }

/* ---------- certificate ---------- */
.cert-wrap { display: grid; place-items: center; }
.certificate {
  width: min(100%, 1000px);
  aspect-ratio: 1.414 / 1;
  background: #fffdf8;
  color: #1d232b;
  position: relative;
  padding: clamp(1.25rem, 4vw, 3.4rem);
  display: grid;
  grid-template-rows: auto 1fr auto;
  text-align: center;
  border: 1px solid #e5dfd2;
  box-shadow: 0 20px 50px rgba(23, 34, 49, 0.16);
}
.certificate::before { content: ''; position: absolute; inset: clamp(8px, 1.4vw, 16px); border: 2px solid var(--brand); pointer-events: none; }
.certificate::after { content: ''; position: absolute; inset: clamp(13px, 2.1vw, 24px); border: 1px solid color-mix(in srgb, var(--brand) 40%, #fff); pointer-events: none; }
.certificate .c-logo { height: clamp(48px, 9vw, 104px); width: auto; max-width: 300px; object-fit: contain; margin: 0 auto; display: block; }
.certificate .c-kicker { font-size: clamp(0.8rem, 1.5vw, 1.05rem); color: #6b7280; margin-top: 0.5rem; }
.certificate .c-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 6vw, 4.2rem); line-height: 1; margin: 0.4em 0 0.15em; color: #12171d; }
.certificate .c-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 2.8vw, 1.9rem); color: var(--brand); }
.certificate .c-sub { font-size: clamp(0.85rem, 1.6vw, 1.1rem); color: #4b5563; }
.certificate .c-body { display: grid; align-content: center; }
.certificate .c-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1rem; font-size: clamp(0.65rem, 1.2vw, 0.85rem); color: #4b5563; }
.certificate .c-foot .sig { border-top: 1px solid #9aa1ab; padding-top: 0.35rem; }
.certificate .seal { width: clamp(64px, 11vw, 110px); height: clamp(64px, 11vw, 110px); border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: clamp(0.7rem, 1.6vw, 1.05rem); line-height: 1.05; box-shadow: 0 0 0 4px #fffdf8, 0 0 0 6px var(--brand); }
@media print {
  @page { size: landscape; margin: 0; }
  .certificate { width: 100vw; height: 100vh; aspect-ratio: auto; box-shadow: none; border: 0; }
}

/* ---------- Marcus ---------- */
.avatar { border-radius: 50%; background: var(--brand-soft); position: relative; flex: none; }
.avatar svg { display: block; width: 100%; height: 100%; border-radius: 50%; }
.avatar-sm { width: 40px; height: 40px; }
.avatar-md { width: 64px; height: 64px; }
.avatar-lg { width: 168px; height: 168px; }
.avatar.speaking::after, .avatar.listening::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
.avatar.listening::after { border-color: var(--bad); }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.07); opacity: 0.4; } }
.marcus-page { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 1000px) { .marcus-page { grid-template-columns: minmax(0, 1fr); } }
.marcus-side { display: grid; gap: 1rem; position: sticky; top: 1.5rem; }
@media (max-width: 1000px) { .marcus-side { position: static; } }
.marcus-id { display: grid; justify-items: center; text-align: center; gap: 0.5rem; }
.marcus-id h2 { margin: 0.4rem 0 0; }
.mode-list { display: grid; gap: 0.35rem; }
.mode-list button { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-sm); padding: 0.65rem 0.8rem; cursor: pointer; font: 500 0.95rem var(--font); color: var(--ink-2); }
.mode-list button strong { display: block; color: var(--ink); }
.mode-list button span { font-size: 0.82rem; color: var(--ink-3); }
.mode-list button.on { border-color: var(--brand); background: var(--brand-soft); }
.chat { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); min-height: 560px; height: calc(100vh - 9rem); max-height: 860px; }
@media (max-width: 860px) { .chat { height: calc(100vh - 12rem); min-height: 460px; } }
.chat-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line-soft); }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.msg { display: flex; gap: 0.6rem; max-width: 88%; }
.msg .bubble { padding: 0.65rem 0.9rem; border-radius: 14px; background: var(--sunk); line-height: 1.5; font-size: 0.98rem; }
.msg .bubble p { margin: 0 0 0.5em; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg .bubble ul, .msg .bubble ol { margin: 0.3rem 0; padding-left: 1.2rem; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.msg.marcus .bubble { border-bottom-left-radius: 4px; }
.msg .speak-again { flex: none; border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 0.2rem; align-self: flex-end; border-radius: 6px; }
.msg .speak-again:hover { color: var(--brand); background: var(--sunk); }
.msg .speak-again svg { width: 16px; height: 16px; }
.msg .related { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.msg .related button { font-size: 0.8rem; padding: 0.2rem 0.6rem; }
.typing { display: inline-flex; gap: 4px; padding: 0.3rem 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.chat-input { border-top: 1px solid var(--line-soft); padding: 0.75rem; display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: end; }
.chat-input textarea { min-height: 44px; max-height: 140px; resize: none; }
.mic { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; cursor: pointer; }
.mic svg { width: 22px; height: 22px; }
.mic.on { background: var(--bad); animation: pulse 1.2s ease-in-out infinite; }
.mic[disabled] { background: var(--line); color: var(--ink-4); cursor: not-allowed; }
.chat-tools { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; padding: 0 0.75rem 0.65rem; font-size: 0.85rem; color: var(--ink-3); }
.toggle { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.65rem; background: var(--panel); cursor: pointer; font: 500 0.82rem var(--font); color: var(--ink-2); }
.toggle svg { width: 15px; height: 15px; }
.toggle.on { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand); }
.voice-lang { width: auto; min-height: 30px; padding: 0.15rem 0.5rem; font-size: 0.82rem; border-radius: 999px; }
.scenarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.75rem; }
.scenario { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-md); padding: 0.9rem; cursor: pointer; font: inherit; color: inherit; display: grid; gap: 0.25rem; }
.scenario:hover { border-color: var(--brand); }
.scenario strong { font-size: 1.02rem; }
.scenario span { color: var(--ink-3); font-size: 0.88rem; }
.grade-card { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 1rem; background: var(--sunk); }
.cat-row { display: grid; grid-template-columns: 110px 1fr 2.2rem; gap: 0.6rem; align-items: center; font-size: 0.9rem; }

/* Floating "Ask Marcus" */
.dock-btn { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 50; display: flex; align-items: center; gap: 0.55rem; border: 0; border-radius: 999px; padding: 0.4rem 1rem 0.4rem 0.4rem; background: var(--ink); color: #fff; font: 600 0.95rem var(--font); cursor: pointer; box-shadow: var(--shadow-pop); }
.dock-btn .avatar { width: 38px; height: 38px; }
@media (max-width: 860px) { .dock-btn { bottom: 5.3rem; right: 0.9rem; padding-right: 0.4rem; } .dock-btn .lbl { display: none; } }
.dock .chat { height: 100%; max-height: none; min-height: 0; border: 0; border-radius: 0; }
.dock .drawer-body { padding: 0; display: flex; }

/* ---------- admin ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 1rem 1.1rem; }
.kpi .value { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.kpi .label { color: var(--ink-3); font-size: 0.86rem; margin-top: 0.35rem; }
.hbars { display: grid; gap: 0.55rem; }
.hbar { display: grid; grid-template-columns: minmax(110px, 34%) 1fr 2.5rem; gap: 0.7rem; align-items: center; font-size: 0.9rem; }
.hbar .track { height: 12px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--brand); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 1fr auto; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line-soft); font-size: 0.92rem; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--ink-4); font-size: 0.82rem; white-space: nowrap; }
.agent-cell { display: flex; align-items: center; gap: 0.6rem; }
.initials { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; flex: none; }
.agent-cell small { display: block; color: var(--ink-3); }
.prog-cell { display: flex; align-items: center; gap: 0.5rem; min-width: 120px; }
.prog-cell .bar { flex: 1; }
.check-grid { display: grid; gap: 0.25rem 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.check-grid .item { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; }
.check-grid .item svg { width: 16px; height: 16px; color: var(--ok); flex: none; }
.check-grid .item.no svg { color: var(--line); }
.admin-badge { background: var(--accent); color: var(--accent-ink); font-size: 0.72rem; font-weight: 700; border-radius: 4px; padding: 0.05rem 0.4rem; }

/* ---------- small-screen refinements ---------- */
@media (max-width: 620px) {
  .dash .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .value { font-size: 1.8rem; }
  .hero h1 { max-width: none; }
}
@media (max-width: 1000px) {
  .marcus-id { display: none; }
  .mode-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-list button { padding: 0.5rem 0.65rem; }
  .mode-list button span { display: none; }
}
@media (max-width: 480px) {
  .public-top { padding: 0.75rem 1rem; gap: 0.5rem; }
  .public-top .btn-primary { display: none; }
  .public-top.wide .logo-img { height: 36px; }
  .public-top .logo-img { height: 56px; }
}
