/* AiLab by Nymos Interactive
   Layout idea: calm white and off-white bands, slate type, teal as the "signal" colour
   that marks what is active, correct or moving. One light theme on purpose (brand). */
:root {
  --slate: #3c4452;
  --slate-2: #5a6372;
  --slate-3: #8a92a0;
  --ink: #2b313c;
  --teal: #1cb2ba;
  --teal-ink: #0b6d73;      /* teal dark enough for small text */
  --teal-soft: #e2f4f5;
  --teal-softer: #f0f9f9;
  --blue: #0050fd;          /* from the AiLab logo */
  --blue-soft: #e9f0ff;
  --white: #ffffff;
  --off: #f4f5ef;
  --line: #e2e4dc;
  --line-2: #d3d6cc;
  --good: #1f8a4c;
  --good-soft: #e5f5ec;
  --bad: #c2393b;
  --bad-soft: #fbeaea;
  --warn: #9a5b00;
  --warn-soft: #fdf3e1;
  --dark: #3c4452;
  --dark-2: #343b47;

  --f-head: "Poppins", Arial, sans-serif;
  --f-body: "Montserrat", Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --shadow: 0 1px 2px rgba(43, 49, 60, .06), 0 8px 24px rgba(43, 49, 60, .07);
  --shadow-lift: 0 2px 4px rgba(43, 49, 60, .08), 0 18px 40px rgba(43, 49, 60, .12);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--white);
  color: var(--slate);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--f-head); color: var(--slate); margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-weight: 700; letter-spacing: -0.02em; }
h2 { font-weight: 600; letter-spacing: -0.015em; }
h3 { font-weight: 600; }
p { margin: 0; }
a { color: var(--blue); }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.eyebrow {
  font-family: var(--f-body); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--slate-2); display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.muted { color: var(--slate-2); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 10px; padding: 12px 20px; font-weight: 700; font-size: 15px;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  font-family: var(--f-body); line-height: 1.2; min-height: 46px;
}
.btn:active { transform: translateY(1px); }
.btn-dark { background: var(--slate); color: var(--white); }
.btn-dark:hover { background: var(--ink); box-shadow: var(--shadow); }
.btn-teal { background: var(--teal); color: var(--ink); }
.btn-teal:hover { background: #31c0c7; }
.btn-light { background: var(--white); color: var(--slate); border: 1.5px solid var(--line-2); }
.btn-light:hover { border-color: var(--slate-3); }
.btn-ghost { background: transparent; color: var(--slate); padding: 10px 12px; min-height: 40px; }
.btn-ghost:hover { background: var(--off); }
.btn-sm { padding: 8px 14px; min-height: 38px; font-size: 14px; border-radius: 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-underline {
  color: var(--slate); font-weight: 700; text-decoration: none; border-bottom: 2.5px solid var(--teal); padding-bottom: 2px;
  background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font-size: 15px;
}
.link-underline:hover { color: var(--ink); border-color: var(--blue); }

/* ---------- Top bar (public) ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--white); }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 42px; width: auto; display: block; }
.topnav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.topnav a.navlink { color: var(--slate); text-decoration: none; font-weight: 600; font-size: 14.5px; padding: 8px 12px; border-radius: 8px; }
.topnav a.navlink:hover { background: var(--off); }
@media (max-width: 760px) {
  .topnav a.navlink { display: none; }
  .brand img { height: 34px; }
  .topbar .wrap { gap: 10px; }
}

/* ---------- Hero ---------- */
.hero { padding-block: 64px 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); margin-top: 18px; }
.hero h1 .accent { color: var(--teal-ink); display: block; }
.hero .lead { font-size: 18px; margin-top: 22px; max-width: 34em; color: var(--slate-2); }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 30px; }
.hero .meta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--slate-2); }
.hero .meta span { display: inline-flex; gap: 6px; align-items: center; }
.hero .meta .icon { color: var(--teal-ink); }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } .hero { padding-block: 40px 56px; } }

/* ---------- Explainer player ---------- */
.player {
  position: relative; border-radius: var(--r-l); background: var(--teal-softer); padding: 12px;
  box-shadow: var(--shadow-lift); border: 1px solid #d5ecee;
}
.player-frame { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 14px; overflow: hidden; background: var(--white); border: 1px solid var(--line); }
.player-bar { display: flex; align-items: center; gap: 10px; padding: 10px 4px 2px; }
.pbtn { width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--slate); color: var(--white); cursor: pointer; flex: none; }
.pbtn.ghost { background: transparent; color: var(--slate); width: auto; padding: 0 8px; border-radius: 8px; font-size: 13px; font-weight: 700; gap: 6px; display: inline-flex; align-items: center; }
.pbtn.ghost[aria-pressed="true"] { background: var(--white); }
.ptrack { flex: 1; display: flex; gap: 4px; min-width: 0; }
.pseg { flex: 1; height: 6px; border-radius: 4px; background: #cfe3e5; border: 0; padding: 0; cursor: pointer; position: relative; overflow: hidden; }
.pseg i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--teal); border-radius: 4px; }
.ptime { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--slate-2); min-width: 72px; text-align: right; }
.caption {
  margin: 10px 2px 0; background: var(--slate); color: var(--white); font-size: 14px; font-weight: 600;
  padding: 9px 14px; border-radius: 10px; text-align: center; line-height: 1.4; min-height: 3.2em; display: grid; place-items: center;
}
.poster { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; text-align: center; background:
  radial-gradient(circle at 18% 22%, var(--teal-soft) 0 16%, transparent 16.5%),
  radial-gradient(circle at 86% 78%, var(--blue-soft) 0 20%, transparent 20.5%), var(--white); cursor: pointer; border: 0; padding: 16px; width: 100%; }
.poster .pt, .poster .ps { display: block; }
.poster .pt { font-family: var(--f-head); font-weight: 700; font-size: clamp(18px, 3vw, 30px); color: var(--slate); line-height: 1.15; }
.poster .ps { font-size: clamp(12px, 1.6vw, 15px); color: var(--slate-2); margin-top: 6px; }
.poster .bigplay { width: clamp(58px, 9vw, 84px); height: clamp(58px, 9vw, 84px); border-radius: 50%; background: var(--slate); color: var(--white); display: grid; place-items: center; margin: 14px auto 0; box-shadow: 0 0 0 10px rgba(28, 178, 186, .22); transition: transform .2s ease; }
.poster:hover .bigplay { transform: scale(1.06); }
.poster .pmark { width: clamp(40px, 6vw, 56px); margin: 0 auto 8px; display: block; }

.stage { position: absolute; inset: 0; font-family: var(--f-body); }
.stage.paused *, .stage.paused *::before, .stage.paused *::after { animation-play-state: paused !important; }
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s ease; padding: 5% 6% 16%; }
.scene.on { opacity: 1; visibility: visible; }
.scene .s-title { font-family: var(--f-head); font-weight: 700; color: var(--slate); font-size: clamp(15px, 2.7vw, 28px); line-height: 1.15; }
.scene .s-kicker { font-size: clamp(9px, 1.15vw, 12px); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-ink); margin-bottom: 4px; }
.scene .s-body { position: absolute; left: 6%; right: 6%; top: 30%; bottom: 18%; }

/* scene pieces (sized in % / vw so they scale with the player) */
.fx-in { animation: fxIn .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }
.fx-pop { animation: fxPop .5s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: var(--d, 0s); }
.fx-fly { animation: fxFly 1.6s ease-in both; animation-delay: var(--d, 0s); }
.fx-grow { animation: fxGrow 1.1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); transform-origin: left center; }
.fx-pulse { animation: fxPulse 1.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.fx-type { overflow: hidden; white-space: nowrap; border-right: 2px solid var(--teal); animation: fxType 1.6s steps(var(--n, 20)) both, fxCaret .8s step-end infinite; animation-delay: var(--d, 0s), 0s; max-width: max-content; }
@keyframes fxIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fxPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes fxFly { 0% { opacity: 0; transform: translate(var(--fx, -60px), var(--fy, -20px)) rotate(var(--fr, -12deg)); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--tx, 120px), var(--ty, 10px)) scale(.4); } }
@keyframes fxGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fxPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes fxType { from { width: 0; } to { width: 100%; } }
@keyframes fxCaret { 50% { border-color: transparent; } }

.chip-v { display: inline-flex; align-items: center; gap: .4em; padding: .35em .8em; border-radius: 999px; font-weight: 700; font-size: clamp(9px, 1.3vw, 14px); background: var(--white); border: 1.5px solid var(--line-2); color: var(--slate); white-space: nowrap; }
.chip-v.teal { background: var(--teal-soft); border-color: #a9dfe2; color: var(--teal-ink); }
.chip-v.blue { background: var(--blue-soft); border-color: #bcd0ff; color: var(--blue); }
.chip-v.dark { background: var(--slate); border-color: var(--slate); color: var(--white); }
.chip-v.good { background: var(--good-soft); border-color: #a9dcbd; color: var(--good); }

/* ---------- Sections ---------- */
.band { padding-block: 80px; }
.band.off { background: var(--off); }
.band h2 { font-size: clamp(28px, 3.6vw, 42px); margin-top: 10px; }
.band .sub { margin-top: 10px; color: var(--slate-2); max-width: 44em; }
.track-grid { margin-top: 36px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.track-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.track-card .ti { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-ink); }
.track-card h3 { font-size: 17px; }
.track-card p { font-size: 14px; color: var(--slate-2); }
.track-card .count { margin-top: auto; font-size: 12.5px; font-weight: 700; color: var(--slate-2); }
@media (max-width: 1000px) { .track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .track-grid { grid-template-columns: 1fr; } }

.steps3 { margin-top: 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.steps3 > div { border-top: 1px solid var(--line-2); padding-top: 18px; }
.steps3 .num { font-size: 13px; font-weight: 700; color: var(--teal-ink); font-variant-numeric: tabular-nums; }
.steps3 h3 { font-size: 21px; margin-top: 12px; }
.steps3 p { margin-top: 8px; color: var(--slate-2); font-size: 15px; }
@media (max-width: 760px) { .steps3 { grid-template-columns: 1fr; gap: 20px; } }

.demo-card { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow); }
.demo-card .left { padding: 32px; background: var(--slate); color: var(--white); }
.demo-card .left h3 { color: var(--white); font-size: 24px; }
.demo-card .left p { color: #d9dde3; margin-top: 10px; }
.demo-card .right { padding: 28px; min-width: 0; }
@media (max-width: 820px) { .demo-card { grid-template-columns: 1fr; } }

.faq { margin-top: 28px; display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-head); color: var(--teal-ink); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 16px; color: var(--slate-2); }

.cta-band { background: var(--slate); color: var(--white); border-radius: var(--r-l); padding: 36px 40px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.cta-band h2 { color: var(--white); font-size: clamp(24px, 3vw, 34px); margin: 0; }
.cta-band p { color: #d9dde3; margin-top: 6px; }

.footer { padding-block: 28px 36px; border-top: 1px solid var(--line); margin-top: 64px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; font-size: 13.5px; }
.footer .tagline { font-weight: 700; color: var(--slate); }

/* ---------- Auth ---------- */
.auth-page { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--off); padding: 40px; display: flex; flex-direction: column; gap: 28px; justify-content: space-between; }
.auth-side .brand img { height: 46px; }
.auth-side h2 { font-size: clamp(26px, 3vw, 36px); }
.auth-side ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.auth-side li { display: flex; gap: 10px; align-items: flex-start; }
.auth-side li .icon { color: var(--teal-ink); margin-top: 3px; }
.auth-main { display: grid; place-items: center; padding: 40px var(--gutter-r) 40px var(--gutter-l); }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: 30px; }
.auth-box .sub { color: var(--slate-2); margin-top: 6px; }
.form { display: grid; gap: 14px; margin-top: 24px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--slate-2); margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 12px 14px; font: inherit; color: var(--ink);
  background: var(--white); min-height: 48px;
}
textarea.input { min-height: 90px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--slate); flex: none; }
.form-error { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.form-ok { background: var(--good-soft); color: var(--good); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; }
.or { display: flex; align-items: center; gap: 12px; color: var(--slate-3); font-size: 13px; margin: 6px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-note { margin-top: 18px; font-size: 13px; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 14px; }
@media (max-width: 860px) { .auth-page { grid-template-columns: 1fr; } .auth-side { order: 2; padding: 28px var(--gutter-r) 28px var(--gutter-l); } }

/* ---------- Workspace shell ---------- */
.ws { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: var(--off); }
.side { background: var(--white); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.side .brand img { height: 44px; }
.side .group-label { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--slate-3); margin: 0 10px 8px; }
.side nav { display: grid; gap: 4px; }
.side a.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--slate); text-decoration: none; font-weight: 600; font-size: 14.5px; border: 1px solid transparent; }
.side a.nav:hover { background: var(--off); }
.side a.nav.active { background: var(--teal-soft); border-color: #b8e2e5; color: var(--ink); }
.side a.nav .icon { color: var(--slate-2); }
.side a.nav.active .icon { color: var(--teal-ink); }
.side .me { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; display: flex; gap: 10px; align-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--slate); color: var(--white); display: grid; place-items: center; font-weight: 700; font-family: var(--f-head); flex: none; }
.side .me .nm { font-weight: 700; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.side .me button { background: none; border: 0; padding: 0; color: var(--slate-2); text-decoration: underline; cursor: pointer; font-size: 13px; }
.side-progress { background: var(--off); border-radius: 12px; padding: 12px; }
.side-progress .lbl { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.bar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--teal); border-radius: 6px; transition: width .6s ease; }
.main { min-width: 0; padding: 22px 32px 48px; }
.mainbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.crumb { font-size: 14px; color: var(--slate-2); font-weight: 600; }
.crumb b { color: var(--slate); }
.pill { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.pill.warn { background: var(--warn-soft); border-color: #f1d9ad; color: var(--warn); }
.pill.warn .dot { background: #e2a33a; }
.mobile-top { display: none; }
@media (max-width: 900px) {
  .ws { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-102%); transition: transform .25s ease; padding-top: calc(22px + env(safe-area-inset-top, 0px)); box-shadow: var(--shadow-lift); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(43, 49, 60, .4); z-index: 30; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--white); border-bottom: 1px solid var(--line); padding: 10px var(--gutter-r) 10px var(--gutter-l); }
  .mobile-top img { height: 32px; display: block; }
  .main { padding: 18px var(--gutter-r) 40px var(--gutter-l); }
}

/* studio hero */
.studio { background: var(--slate); color: var(--white); border-radius: var(--r-l); padding: 40px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 28px; align-items: center; position: relative; overflow: hidden; }
.studio::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }
.studio > * { position: relative; }
.studio .eyebrow { color: #c9d0da; }
.studio h1 { color: var(--white); font-size: clamp(30px, 4vw, 48px); margin-top: 14px; }
.studio p { color: #d9dde3; margin-top: 12px; max-width: 30em; }
.studio .btn { margin-top: 22px; }
.chatmock { background: var(--white); color: var(--slate); border-radius: 16px; padding: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); transform: rotate(-2deg); max-width: 360px; justify-self: end; width: 100%; }
.chatmock .hd { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.chatmock .hd .dots { display: flex; gap: 4px; } .chatmock .hd .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.chatmock .b { margin-top: 10px; font-size: 13.5px; padding: 9px 12px; border-radius: 12px; line-height: 1.4; }
.chatmock .b.u { background: var(--off); margin-left: 18%; }
.chatmock .b.a { background: var(--teal-soft); margin-right: 10%; }
.chatmock .ok { margin-top: 10px; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: var(--good); background: var(--good-soft); padding: 5px 10px; border-radius: 999px; }
@media (max-width: 860px) { .studio { grid-template-columns: 1fr; padding: 28px 22px; } .chatmock { justify-self: start; transform: none; } }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 36px 0 16px; }
.section-head h2 { font-size: 28px; margin-top: 6px; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) 170px 170px; gap: 10px; }
.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--slate-3); }
.search input { padding-left: 42px; }
@media (max-width: 700px) { .filters { grid-template-columns: 1fr 1fr; } .filters .search { grid-column: 1 / -1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { border: 1px solid var(--line-2); background: var(--white); border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--slate); }
.chip:hover { border-color: var(--slate-3); }
.chip.on { background: var(--slate); color: var(--white); border-color: var(--slate); }
.count-line { font-size: 13.5px; font-weight: 700; color: var(--slate-2); margin: 14px 0 10px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }
.ex-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; min-width: 0; }
.ex-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-2); }
.ex-card .top { display: flex; justify-content: space-between; align-items: center; }
.ex-card .ico { width: 36px; height: 36px; border-radius: 9px; background: var(--teal-soft); color: var(--teal-ink); display: grid; place-items: center; }
.lvl { font-size: 12px; font-weight: 700; color: var(--slate-2); }
.ex-card h3 { font-size: 17px; line-height: 1.25; }
.ex-card p { font-size: 14px; color: var(--slate-2); }
.ex-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; font-weight: 700; }
.tag { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; color: var(--slate); }
.done-badge { display: inline-flex; gap: 6px; align-items: center; color: var(--good); }
.empty { background: var(--white); border: 1px dashed var(--line-2); border-radius: var(--r-m); padding: 28px; text-align: center; color: var(--slate-2); grid-column: 1 / -1; }

/* tracks */
.tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .tracks { grid-template-columns: 1fr; } }
.track { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; min-width: 0; }
.track .th { display: flex; gap: 12px; align-items: center; }
.track .th .ti { width: 44px; height: 44px; border-radius: 12px; background: var(--teal-soft); color: var(--teal-ink); display: grid; place-items: center; flex: none; }
.track h3 { font-size: 19px; }
.track .desc { font-size: 14px; color: var(--slate-2); margin-top: 10px; }
.track .meta { font-size: 13px; font-weight: 700; margin-top: 14px; display: flex; justify-content: space-between; }
.track ol { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: l; display: grid; gap: 2px; }
.track li a { counter-increment: l; display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--slate); font-weight: 600; font-size: 14.5px; }
.track li a::before { content: counter(l) "."; color: var(--slate-3); font-variant-numeric: tabular-nums; width: 1.4em; }
.track li a:hover { background: var(--off); }
.track li a.is-done { color: var(--slate-2); }
.track li a .icon { margin-left: auto; color: var(--good); }

/* glossary */
.gloss { display: grid; gap: 10px; }
.gloss-item { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.gloss-item h3 { font-size: 16px; }
.gloss-item .ex { font-size: 13.5px; color: var(--slate-2); margin-top: 4px; }
.gloss-item .ex b { color: var(--slate); }
@media (max-width: 760px) { .gloss-item { grid-template-columns: 1fr; gap: 6px; } }

/* progress */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px; }
.stat .v { font-family: var(--f-head); font-weight: 700; font-size: 32px; color: var(--slate); font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .k { font-size: 13px; font-weight: 700; color: var(--slate-2); margin-top: 4px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px; min-width: 0; }
.panel h3 { font-size: 18px; }
.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 960px) { .two { grid-template-columns: 1fr; } }
.trackrow { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 54px; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; font-weight: 600; }
.trackrow .bar { margin: 0; }
.trackrow .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--slate-2); font-size: 13px; }
.badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.badge { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.badge .bi { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--off); color: var(--slate-3); flex: none; }
.badge.got .bi { background: var(--teal); color: var(--white); }
.badge b { display: block; font-size: 14px; }
.badge span { color: var(--slate-2); font-size: 12.5px; }
.cert { margin-top: 16px; border: 2px solid var(--slate); border-radius: var(--r-m); padding: 28px; text-align: center; background:
  radial-gradient(circle at 0 0, var(--teal-soft) 0 70px, transparent 71px), radial-gradient(circle at 100% 100%, var(--blue-soft) 0 90px, transparent 91px), var(--white); }
.cert img { height: 50px; }
.cert h2 { font-size: 26px; margin-top: 12px; }
.cert .who { font-family: var(--f-head); font-size: 30px; font-weight: 700; color: var(--teal-ink); margin-top: 10px; }

/* ---------- Lesson player ---------- */
.lesson-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; }
.lesson-head h1 { font-size: clamp(26px, 3.4vw, 38px); margin-top: 6px; }
.stepper { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.stepper button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--white); padding: 8px 14px 8px 8px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--slate-2); }
.stepper button .n { width: 24px; height: 24px; border-radius: 50%; background: var(--off); display: grid; place-items: center; font-size: 12px; color: var(--slate); }
.stepper button.on { border-color: var(--slate); color: var(--slate); }
.stepper button.on .n { background: var(--slate); color: var(--white); }
.stepper button.ok .n { background: var(--teal); color: var(--white); }
.stepper button[disabled] { opacity: .5; cursor: not-allowed; }
.lesson-body { margin-top: 18px; display: grid; gap: 16px; }
.learn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 960px) { .learn-grid { grid-template-columns: 1fr; } }
.what ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.what li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 15.5px; }
.what li::before { content: ""; width: 9px; height: 9px; background: var(--teal); border-radius: 3px; margin-top: 8px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--slate-2); }
.image-card { background: var(--slate); color: var(--white); border-radius: var(--r-m); padding: 22px; }
.image-card .label { color: #9fe3e7; }
.image-card blockquote { margin: 10px 0 0; font-family: var(--f-head); font-size: 19px; line-height: 1.4; font-weight: 500; }
.watch { background: var(--warn-soft); border-radius: var(--r-m); padding: 16px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; border-left: 5px solid #e2a33a; }
.watch .label { color: var(--warn); margin-top: 2px; }
.anim-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; position: relative; }
.anim-box .replay { position: absolute; top: 10px; right: 10px; z-index: 2; }
.anim-stage { position: relative; aspect-ratio: 16 / 10; max-width: 100%; overflow: hidden; border-radius: 10px; background: var(--teal-softer); }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

/* ---------- Widgets ---------- */
.widget { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); padding: 22px; min-width: 0; }
.widget h3 { font-size: 20px; }
.widget .instr { color: var(--slate-2); margin-top: 6px; }
.wstatus { margin-top: 16px; padding: 12px 14px; border-radius: 10px; font-size: 14.5px; font-weight: 600; display: flex; gap: 10px; align-items: flex-start; }
.wstatus.good { background: var(--good-soft); color: var(--good); }
.wstatus.bad { background: var(--bad-soft); color: var(--bad); }
.wstatus.info { background: var(--blue-soft); color: #1d3f9a; }
.wstatus.warn { background: var(--warn-soft); color: var(--warn); }
.wstatus .icon { margin-top: 2px; }
.wstatus .t { font-weight: 500; color: var(--slate); display: block; margin-top: 2px; }

/* sort */
.sort-deck { margin-top: 18px; display: grid; place-items: center; min-height: 120px; }
.sort-card { background: var(--white); border: 2px solid var(--slate); border-radius: 14px; padding: 18px 22px; font-weight: 700; font-size: 17px; text-align: center; max-width: 520px; width: 100%; box-shadow: 0 6px 0 var(--slate); animation: fxPop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.sort-card .k { display: block; font-size: 12px; color: var(--slate-3); font-weight: 700; margin-bottom: 6px; letter-spacing: .08em; text-transform: uppercase; }
.sort-card.out-good { animation: outGood .45s ease forwards; }
.sort-card.out-bad { animation: shake .45s ease; }
@keyframes outGood { to { opacity: 0; transform: translateY(40px) scale(.8); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.buckets { display: grid; gap: 12px; margin-top: 18px; }
.buckets.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.buckets.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 620px) { .buckets.n3 { grid-template-columns: 1fr; } }
.bucket { border: 2px dashed var(--line-2); border-radius: 14px; padding: 12px; background: var(--off); min-height: 120px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bucket-btn { border: 0; background: var(--slate); color: var(--white); font-weight: 700; padding: 12px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.bucket-btn:hover { background: var(--ink); }
.bucket-btn[disabled] { opacity: .5; cursor: default; }
.bucket .placed { font-size: 13px; background: var(--white); border-radius: 8px; padding: 7px 10px; border: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-start; animation: fxIn .3s ease both; }
.bucket .placed .icon { margin-top: 2px; }
.bucket .placed.ok .icon { color: var(--good); }
.bucket .placed.no { border-color: #efc4c4; }
.bucket .placed.no .icon { color: var(--bad); }

/* order */
.order-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.order-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--white); border: 1.5px solid var(--line-2); border-radius: 12px; padding: 10px 10px 10px 12px; transition: transform .25s ease, border-color .2s; }
.order-item .pos { width: 30px; height: 30px; border-radius: 50%; background: var(--off); display: grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.order-item .txt { font-size: 15px; font-weight: 600; }
.order-item .mv { display: flex; gap: 4px; }
.order-item .mv button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--white); cursor: pointer; display: grid; place-items: center; }
.order-item .mv button:hover { background: var(--off); }
.order-item.ok { border-color: var(--good); background: var(--good-soft); }
.order-item.no { border-color: var(--bad); background: var(--bad-soft); }
.order-item[draggable="true"] { cursor: grab; }
.order-item.dragging { opacity: .5; }

/* next word */
.nw-sentence { font-family: var(--f-head); font-size: clamp(22px, 3vw, 30px); font-weight: 600; margin-top: 18px; line-height: 1.3; }
.nw-blank { display: inline-block; min-width: 3.4em; border-bottom: 4px solid var(--teal); color: var(--teal-ink); text-align: center; }
.nw-opts { display: grid; gap: 8px; margin-top: 18px; }
.nw-opt { display: grid; grid-template-columns: 120px minmax(0, 1fr) 54px; gap: 12px; align-items: center; border: 1.5px solid var(--line-2); background: var(--white); border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: left; font-weight: 700; }
.nw-opt:hover { border-color: var(--slate); }
.nw-opt .pb { height: 12px; background: var(--off); border-radius: 6px; overflow: hidden; }
.nw-opt .pb i { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 6px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.nw-opt .pct { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--slate-2); opacity: 0; transition: opacity .3s .6s; }
.nw-opts.revealed .nw-opt .pct { opacity: 1; }
.nw-opts.revealed .nw-opt { cursor: default; }
.nw-opt.picked { border-color: var(--slate); box-shadow: inset 0 0 0 1px var(--slate); }
.nw-opt.top .pb i { background: var(--blue); }
.gen-box { margin-top: 18px; background: var(--off); border-radius: 12px; padding: 16px; }
.gen-out { font-family: var(--f-head); font-size: 20px; font-weight: 600; min-height: 1.6em; }
.gen-out .w { display: inline-block; animation: fxPop .35s ease both; }
.gen-out .w.new { color: var(--teal-ink); }
.gen-bars { display: grid; gap: 4px; margin-top: 10px; min-height: 120px; }
.gen-bar { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr) 44px; gap: 8px; align-items: center; font-size: 13px; }
.gen-bar .pb { height: 9px; background: var(--white); border-radius: 5px; overflow: hidden; }
.gen-bar .pb i { display: block; height: 100%; background: var(--slate-3); transition: width .4s ease; }
.gen-bar.chosen { font-weight: 700; }
.gen-bar.chosen .pb i { background: var(--teal); }
.gen-history { margin-top: 12px; display: grid; gap: 6px; }
.gen-history div { font-size: 14px; background: var(--white); border-radius: 8px; padding: 8px 12px; border: 1px solid var(--line); }
.slider-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: 14px; font-weight: 700; }
.slider-row input[type="range"] { flex: 1; min-width: 160px; accent-color: var(--teal-ink); }

/* tokens */
.tok-out { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px; padding: 14px; background: var(--off); border-radius: 12px; min-height: 64px; }
.tok { font-family: var(--f-mono); font-size: 15px; padding: 4px 6px; border-radius: 6px; white-space: pre; animation: fxPop .3s ease both; color: var(--ink); }
.tok-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.tok-stats div { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 700; color: var(--slate-2); }
.tok-stats b { font-family: var(--f-head); font-size: 22px; color: var(--slate); display: block; font-variant-numeric: tabular-nums; }

/* chat ui */
.chat { background: var(--off); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 220px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.45; animation: fxIn .35s ease both; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.u { align-self: flex-end; background: var(--slate); color: var(--white); border-bottom-right-radius: 4px; }
.msg.a { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .who { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--slate-3); margin-bottom: 4px; }
.msg.u .who { color: #c8ced8; }
.msg .flag { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.msg .flag.bad { background: var(--bad-soft); color: var(--bad); }
.msg .flag.good { background: var(--good-soft); color: var(--good); }
.msg .flag.warn { background: var(--warn-soft); color: var(--warn); }
.typing { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--slate-3); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; transform: translateY(-2px); } }
.act-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.act { border: 1.5px solid var(--slate); background: var(--white); color: var(--slate); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; text-align: left; }
.act:hover { background: var(--slate); color: var(--white); }
.act[disabled] { opacity: .4; cursor: default; background: var(--white); color: var(--slate); }
.act.used { border-style: dashed; }
.tabs { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line-2); background: var(--white); border-radius: 10px 10px 0 0; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.tab.on { background: var(--off); border-bottom-color: var(--off); }
.desk { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 700; color: var(--slate-2); margin-top: 10px; min-height: 36px; }
.desk .file { display: inline-flex; gap: 6px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; animation: fxPop .3s ease both; color: var(--slate); }
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.task-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.task-list li { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; color: var(--slate-2); }
.task-list li .box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; }
.task-list li.ok { color: var(--slate); }
.task-list li.ok .box { background: var(--teal); border-color: var(--teal); color: var(--white); }

/* recipe */
.slots { display: grid; gap: 12px; margin-top: 18px; }
.slot { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: start; }
.slot .sl { font-weight: 700; font-size: 14px; padding-top: 8px; display: flex; align-items: center; gap: 8px; }
.slot .sl i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.slot .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { border: 1.5px solid var(--line-2); background: var(--white); border-radius: 10px; padding: 8px 12px; font-size: 14px; cursor: pointer; text-align: left; line-height: 1.35; }
.opt:hover { border-color: var(--slate); }
.opt.on { background: var(--slate); color: var(--white); border-color: var(--slate); }
@media (max-width: 620px) { .slot { grid-template-columns: 1fr; gap: 6px; } .slot .sl { padding-top: 0; } }
.prompt-box { margin-top: 18px; background: var(--ink); color: #eef1f4; border-radius: 12px; padding: 16px; font-size: 14.5px; line-height: 1.55; min-height: 70px; }
.prompt-box .ph { color: #8e98a8; }
.prompt-box span.part { border-radius: 4px; padding: 1px 3px; }
.meter { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.meter .mbar { flex: 1; min-width: 160px; height: 14px; border-radius: 8px; background: var(--off); overflow: hidden; }
.meter .mbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #e2a33a, var(--teal) 60%, var(--good)); transition: width .5s ease; }
.meter b { font-size: 14px; min-width: 120px; }

/* profile */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 16px; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-card { background: var(--ink); color: #eef1f4; border-radius: 14px; padding: 18px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; min-height: 260px; position: relative; }
.profile-card .label { color: #9fe3e7; display: block; margin-bottom: 8px; }
.tick-list { display: grid; gap: 6px; }

/* rules */
.rule { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--white); cursor: pointer; font-size: 14.5px; }
.rule input { width: 20px; height: 20px; accent-color: var(--teal-ink); flex: none; margin-top: 1px; }
.rule.on { border-color: var(--teal); background: var(--teal-softer); }
.rulecard { background: var(--off); border-radius: 14px; padding: 14px; display: grid; gap: 8px; }

/* rag */
.doc { background: var(--white); border: 1px solid var(--line-2); border-radius: 12px; padding: 16px; font-size: 14px; position: relative; overflow: hidden; box-shadow: 0 3px 0 var(--line); }
.doc.off { opacity: .45; filter: grayscale(1); }
.doc h4 { font-size: 15px; }
.doc p { margin-top: 8px; padding: 2px 6px; border-radius: 6px; transition: background .3s ease; }
.doc p.hit { background: #fff1b8; box-shadow: inset 3px 0 0 #e2a33a; }
.doc .scan { position: absolute; left: 0; right: 0; height: 30px; background: linear-gradient(transparent, rgba(28, 178, 186, .25), transparent); top: -30px; pointer-events: none; }
.doc .scan.go { animation: scan .9s ease-in-out; }
@keyframes scan { to { top: 100%; } }
.doc input { width: 64px; border: 1.5px solid var(--teal); border-radius: 6px; padding: 2px 6px; font: inherit; font-weight: 700; color: var(--ink); }
.toggle { display: inline-flex; background: var(--off); border-radius: 999px; padding: 4px; gap: 4px; }
.toggle button { border: 0; background: transparent; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--slate-2); }
.toggle button.on { background: var(--slate); color: var(--white); }

/* agent */
.agent-steps { display: grid; gap: 8px; margin-top: 16px; }
.agent-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--white); }
.agent-step .n { width: 30px; height: 30px; border-radius: 50%; background: var(--off); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.agent-step .txt { font-weight: 600; font-size: 14.5px; }
.agent-step .txt small { display: block; font-weight: 500; color: var(--slate-2); font-size: 12.5px; }
.agent-step.run { border-color: var(--teal); background: var(--teal-softer); }
.agent-step.run .n { background: var(--teal); color: var(--white); }
.agent-step.done .n { background: var(--good); color: var(--white); }
.agent-step.wait { border-color: #e2a33a; background: var(--warn-soft); }
.agent-step.bad { border-color: var(--bad); background: var(--bad-soft); }
.seg { display: inline-flex; border: 1.5px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--white); padding: 7px 10px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--slate-2); }
.seg button.on { background: var(--slate); color: var(--white); }
.loop { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.loop span { padding: 6px 12px; border-radius: 999px; background: var(--off); font-weight: 700; font-size: 13px; transition: background .2s, color .2s; }
.loop span.on { background: var(--teal); color: var(--ink); }
@media (max-width: 620px) { .agent-step { grid-template-columns: 30px minmax(0, 1fr); } .agent-step .seg, .agent-step .gate { grid-column: 1 / -1; } }

/* spot */
.spot-doc { margin-top: 16px; background: var(--white); border: 1px solid var(--line-2); border-radius: 12px; padding: 16px; display: grid; gap: 6px; }
.spot-s { text-align: left; border: 1.5px solid transparent; background: transparent; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 15px; line-height: 1.45; }
.spot-s:hover { border-color: var(--line-2); background: var(--off); }
.spot-s.sel { border-color: var(--slate); background: var(--off); }
.spot-s.ok { border-color: var(--good); background: var(--good-soft); }
.spot-s.no { border-color: var(--bad); background: var(--bad-soft); }
.spot-s.hiddenline { color: #eef0ea; font-size: 11px; }
.spot-doc.reveal .spot-s.hiddenline { color: var(--bad); font-size: 14px; font-weight: 700; }
.mini-table { border-collapse: collapse; margin-top: 14px; font-size: 14px; min-width: 260px; }
.mini-table th, .mini-table td { border: 1px solid var(--line-2); padding: 6px 12px; text-align: left; font-variant-numeric: tabular-nums; }
.mini-table th { background: var(--off); }
.mini-table td.n { text-align: right; }
.table-scroll { overflow-x: auto; }

/* match */
.match { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 760px) { .match { grid-template-columns: 1fr; } }
.match-col { display: grid; gap: 8px; align-content: start; }
.m-item { border: 1.5px solid var(--line-2); background: var(--white); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left; font-size: 14.5px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.m-item:hover { border-color: var(--slate); }
.m-item.sel { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.m-item.done { border-color: var(--good); background: var(--good-soft); cursor: default; }
.m-item.wrong { animation: shake .4s ease; border-color: var(--bad); }
.m-item .tagn { font-size: 12px; font-weight: 700; color: var(--good); margin-left: auto; white-space: nowrap; }

/* check (quiz) */
.quiz { display: grid; gap: 16px; }
.q { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; }
.q h3 { font-size: 18px; }
.q .opts { display: grid; gap: 8px; margin-top: 14px; }
.q .opts button { text-align: left; border: 1.5px solid var(--line-2); background: var(--white); padding: 12px 14px; border-radius: 10px; font-size: 15px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.q .opts button .l { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.q .opts button:hover { border-color: var(--slate); }
.q .opts button.ok { border-color: var(--good); background: var(--good-soft); }
.q .opts button.ok .l { background: var(--good); border-color: var(--good); color: var(--white); }
.q .opts button.no { border-color: var(--bad); background: var(--bad-soft); }
.q .opts button[disabled] { cursor: default; }

/* use it */
.prompt-copy { position: relative; background: var(--ink); color: #eef1f4; border-radius: 12px; padding: 18px 18px 18px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; margin-top: 12px; overflow-wrap: anywhere; }
.prompt-copy .btn { position: absolute; top: 10px; right: 10px; }
.prompt-copy .txt { padding-right: 90px; display: block; }
@media (max-width: 560px) { .prompt-copy .btn { position: static; margin-top: 12px; } .prompt-copy .txt { padding-right: 0; } }
.checklist { display: grid; gap: 8px; margin-top: 14px; }

/* ---------- Learn animations ---------- */
.an { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-body); }
.an .lbl { font-weight: 700; font-size: clamp(11px, 1.4vw, 14px); color: var(--slate); }
.an-family .ring { position: absolute; border-radius: 50%; display: flex; justify-content: center; padding-top: 3%; }
.an-family .r1 { width: 86%; aspect-ratio: 1; max-height: 96%; background: var(--blue-soft); border: 2px solid #bcd0ff; }
.an-family .r2 { width: 60%; aspect-ratio: 1; max-height: 68%; background: var(--teal-soft); border: 2px solid #a9dfe2; top: 30%; }
.an-family .r3 { width: 34%; aspect-ratio: 1; max-height: 40%; background: var(--slate); top: 56%; color: var(--white); }
.an-family .r3 .lbl { color: var(--white); }
.an-family .r1 { top: 3%; }
.an-row { display: flex; gap: 3%; align-items: center; justify-content: center; width: 92%; flex-wrap: wrap; }
.an-box { background: var(--white); border: 2px solid var(--slate); border-radius: 12px; padding: 4% 5%; text-align: center; font-weight: 700; font-size: clamp(11px, 1.5vw, 15px); box-shadow: 0 4px 0 var(--slate); min-width: 0; }
.an-box.teal { border-color: var(--teal); box-shadow: 0 4px 0 var(--teal); }
.an-box.blue { border-color: var(--blue); box-shadow: 0 4px 0 var(--blue); }
.an-arrow { font-family: var(--f-head); font-size: clamp(18px, 3vw, 30px); color: var(--teal-ink); font-weight: 700; }
.an-col { display: flex; flex-direction: column; gap: 6px; width: 88%; }
.an-bar { display: grid; grid-template-columns: 26% minmax(0, 1fr) 13%; gap: 8px; align-items: center; font-weight: 700; font-size: clamp(11px, 1.4vw, 14px); }
.an-bar .pb { height: 12px; background: var(--white); border-radius: 6px; overflow: hidden; }
.an-bar .pb i { display: block; height: 100%; background: var(--teal); border-radius: 6px; }
.an-bar.top .pb i { background: var(--blue); }
.an-big { font-family: var(--f-head); font-weight: 700; font-size: clamp(16px, 2.6vw, 26px); color: var(--slate); }
.an-stamp { display: inline-block; border: 3px solid var(--good); color: var(--good); font-weight: 800; padding: 4px 12px; border-radius: 8px; transform: rotate(-8deg); font-size: clamp(12px, 1.7vw, 18px); text-transform: uppercase; letter-spacing: .06em; background: var(--white); }
.an-stamp.red { border-color: var(--bad); color: var(--bad); }
.an-stamp.amber { border-color: #e2a33a; color: var(--warn); }

/* ---------- Admin ---------- */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); margin-top: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-2); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--off); white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data td.n { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
.feed { display: grid; gap: 0; margin-top: 8px; }
.feed div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.feed div span { color: var(--slate-2); font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 13.5px; padding: 5px 0; }
.hbar .pb { height: 10px; background: var(--off); border-radius: 5px; overflow: hidden; }
.hbar .pb i { display: block; height: 100%; background: var(--teal); }
.hbar .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Toast, modal ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px; z-index: 100; box-shadow: var(--shadow-lift); animation: fxIn .3s ease both; max-width: calc(100% - 32px); }
.modal-back { position: fixed; inset: 0; background: rgba(43, 49, 60, .5); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--white); border-radius: var(--r-l); padding: 28px; max-width: 560px; width: 100%; max-height: 86vh; overflow: auto; box-shadow: var(--shadow-lift); }
.modal h2 { font-size: 24px; }
.modal p, .modal li { color: var(--slate-2); font-size: 15px; margin-top: 10px; }
.modal ul { padding-left: 20px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .8; } }
.done-panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-l); padding: 36px; text-align: center; }
.done-panel .big { width: 72px; height: 72px; border-radius: 50%; background: var(--teal); color: var(--white); display: grid; place-items: center; margin: 0 auto; }
.done-panel h2 { margin-top: 16px; font-size: 28px; }
.done-panel .score { font-family: var(--f-head); font-size: 44px; font-weight: 700; color: var(--teal-ink); }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--slate-2); font-weight: 600; }
.loading img { width: 64px; animation: fxPulse 1.4s ease-in-out infinite; }

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

/* scale animation pieces with their frame (container query units) */
.player-frame, .anim-stage { container-type: size; }
.scene { padding: 4.5cqw 5.5cqw 4cqw; }
.scene .s-title { font-size: max(14px, 4.6cqw); }
.scene .s-kicker { font-size: max(9px, 1.6cqw); }
.scene .s-body { top: 27%; bottom: 5%; }
.fx-fly.loop { animation-iteration-count: infinite; animation-duration: 3s; }
.player-frame .an-recipe .an-col { display: grid; grid-template-columns: 1fr 1fr; width: 94% !important; }
.player-frame .an-recipe .stamp-row { grid-column: 1 / -1; }
.player-frame .an-box, .anim-stage .an-box { font-size: max(10px, 2.3cqw); padding: 2.2cqw 2.6cqw; border-radius: 1.6cqw; }
.player-frame .chip-v, .anim-stage .chip-v { font-size: max(9px, 2.1cqw); }
.player-frame .an-bar, .anim-stage .an-bar { font-size: max(10px, 2.2cqw); }
.player-frame .an-bar .pb, .anim-stage .an-bar .pb { height: max(7px, 1.8cqw); }
.player-frame .an-big, .anim-stage .an-big { font-size: max(13px, 3.6cqw); }
.player-frame .an-stamp, .anim-stage .an-stamp { font-size: max(10px, 2.5cqw); }
.player-frame .msg, .anim-stage .msg { font-size: max(10px, 2.3cqw); padding: 1.4cqw 2.2cqw; }
.player-frame .small, .anim-stage .small { font-size: max(9px, 1.9cqw); }
.player-frame .tok, .anim-stage .tok { font-size: max(10px, 2.4cqw); }
.player-frame .an-arrow, .anim-stage .an-arrow { font-size: max(14px, 4cqw); }
.player-frame .label, .anim-stage .label { font-size: max(9px, 1.7cqw); }
.player-frame .an .icon, .anim-stage .an .icon { width: max(12px, 2.6cqw); height: max(12px, 2.6cqw); }
.player-frame .an-row, .anim-stage .an-row { gap: 1.6cqw; flex-wrap: nowrap; }
.player-frame .an-col, .anim-stage .an-col { gap: 1.2cqw; }
.anim-stage .an-row { flex-wrap: wrap; }
.doc { align-self: start; }
.anim-box { display: flex; flex-direction: column; gap: 10px; }
.anim-box .replay { position: static; align-self: flex-end; }
@media (min-width: 901px) { .ws { background: linear-gradient(90deg, var(--white) 252px, var(--off) 252px); } }
.feed { max-height: 560px; overflow: auto; }


/* ---------- footer links ---------- */
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a, .ws-foot a { color: var(--slate); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.foot-links a:hover, .ws-foot a:hover { color: var(--teal-ink); text-decoration: underline; }
.foot-links .icon, .ws-foot .icon { width: 14px; height: 14px; }
.foot-copy { flex-basis: 100%; }
.ws-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--slate-2); }
.ws-foot span { margin-left: auto; }
@media (max-width: 600px) { .ws-foot span { margin-left: 0; flex-basis: 100%; } }

/* ---------- legal pages ---------- */
.legal-wrap { max-width: 860px; }
.legal h1 { font-size: clamp(32px, 4.4vw, 46px); margin-top: 8px; }
.legal .lead { margin-top: 10px; font-size: 18px; color: var(--slate-2); }
.legal h2 { font-size: 21px; margin-top: 30px; }
.legal p, .legal ul { margin-top: 10px; line-height: 1.6; }
.legal ul { padding-left: 20px; }
.legal li { margin-top: 6px; }
.legal a { color: var(--teal-ink); font-weight: 600; }
.legal-table td { vertical-align: top; font-size: 14px; line-height: 1.5; min-width: 140px; }
.legal-modal { max-height: 70vh; overflow: auto; padding-right: 6px; }
.legal-modal .legal h1 { font-size: 28px; }

/* ---------- consent and account ---------- */
.consent { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--off); }
.consent a { color: var(--teal-ink); font-weight: 600; }
.consent .hint { margin: 0; }
.optl { font-weight: 500; font-size: 12px; color: var(--slate-3); margin-left: 4px; }
.req { font-weight: 700; font-size: 11px; color: var(--teal-ink); text-transform: uppercase; letter-spacing: .04em; margin-left: 4px; }
.consent-sum { margin-top: 16px; }
.consent-sum ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.consent-sum li { display: flex; gap: 10px; font-size: 14.5px; }
.consent-sum .icon { color: var(--teal-ink); flex: none; margin-top: 2px; }
.auth-box .btn-ghost[data-cancel] { width: 100%; }
.acct { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 22px; align-items: start; }
.acct .form { margin-top: 12px; }
.input.ro { background: var(--off); color: var(--slate-2); display: flex; align-items: center; }
.panel.danger { border-color: #efc9ca; }
.panel.danger h3 { color: var(--bad); }
.btn-danger { background: var(--bad); color: #fff; border: 1px solid var(--bad); }
.btn-danger:hover { filter: brightness(.94); }
.btn-danger:disabled { opacity: .5; }
.consent .hint { font-size: 12.5px; color: var(--slate-2); }
.panel h3 .icon { width: 18px; height: 18px; vertical-align: -3px; color: var(--teal-ink); }
.acct .form, .acct .field { min-width: 0; }
.acct .input { width: 100%; min-width: 0; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; }
.acct a, .main > div > p a, .muted a { color: var(--teal-ink); font-weight: 600; }
