/* TwiddleLab friendly redesign: shared styles */
:root {
  --ink: #1F2A55;
  --ink-2: #4B557F;
  --ink-3: #7A82A3;
  --line: #E9E5DE;
  --line-2: #DDD7CD;
  --cream: #FAF7F2;
  --cream-2: #F3EEE6;
  --white: #FFFFFF;
  --pip: #FF6B3D;
  --pip-btn: #F25C2A;
  --pip-edge: #C2441A;
  --pip-soft: #FFF0E8;
  --sky: #4DA3FF;
  --sky-ink: #1B6CC9;
  --sky-soft: #EEF6FF;
  --sun: #FFC93C;
  --sun-edge: #E0A400;
  --sun-ink: #B07800;
  --sun-soft: #FFF7E0;
  --violet: #8B7CFF;
  --violet-ink: #5A49DB;
  --violet-soft: #F3F1FF;
  --mint: #3DD6A3;
  --mint-btn: #13A673;
  --mint-edge: #0B7A54;
  --mint-ink: #0B7A54;
  --mint-soft: #E9F8F1;
  --coral: #FF7A6B;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --r-xl: 32px;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.06;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 5.2vw, 68px); }
h2 { font-size: clamp(32px, 3.6vw, 46px); }
h3 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.2; letter-spacing: -0.015em; }
p { margin: 0; text-wrap: pretty; }

.lead { font-size: clamp(19px, 1.6vw, 22px); color: var(--ink-2); max-width: 34em; }
.muted { color: var(--ink-2); }
.small { font-size: 16px; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons: tactile, with a darker bottom edge ---------- */
.btn {
  --bg: var(--pip-btn); --edge: var(--pip-edge); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 12px 26px;
  border: 0; border-radius: 12px;
  background: var(--bg); color: var(--fg);
  font-family: var(--body); font-weight: 700; font-size: 18px; letter-spacing: 0;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 3px 0 var(--edge);
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, filter .15s ease;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 4px 0 var(--edge); }
.btn:active, .btn.is-pressed { transform: translateY(3px); box-shadow: 0 0 0 var(--edge); }
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; }
.btn[disabled] { --bg: #ECE8E1; --edge: #DAD4CA; --fg: #9A9AAE; cursor: not-allowed; transform: none; filter: none; }
.btn-soft { --bg: #fff; --edge: var(--line-2); --fg: var(--ink); box-shadow: 0 3px 0 var(--edge), inset 0 0 0 1.5px var(--line-2); }
.btn-soft:hover { box-shadow: 0 4px 0 var(--edge), inset 0 0 0 1.5px var(--line-2); }
.btn-soft:active { box-shadow: 0 0 0 var(--edge), inset 0 0 0 1.5px var(--line-2); }
.btn-mint { --bg: var(--mint-btn); --edge: var(--mint-edge); }
.btn-sky { --bg: #2F86E8; --edge: #1B62B5; }
.btn-violet { --bg: #7464F2; --edge: #4E3FC4; }
.btn-sun { --bg: var(--sun); --edge: var(--sun-edge); --fg: var(--ink); }
.btn-small { min-height: 42px; padding: 8px 18px; font-size: 16px; border-radius: 10px; box-shadow: 0 2px 0 var(--edge); }
.btn-small:hover { box-shadow: 0 3px 0 var(--edge); }
.btn-small.btn-soft { box-shadow: 0 2px 0 var(--edge), inset 0 0 0 1.5px var(--line-2); }
.btn-wide { width: 100%; }
.link { color: var(--ink); font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--pip); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.2) blur(8px); }
.nav-in { display: flex; align-items: center; gap: 28px; height: 76px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.03em; }
.logo img { width: auto; height: 30px; object-fit: contain; }
.nav-links { display: flex; gap: 6px; margin-left: 12px; }
.nav-links a { text-decoration: none; font-weight: 500; font-size: 17px; color: var(--ink-2); padding: 8px 14px; border-radius: 10px; }
.nav-links a:hover { background: var(--cream); color: var(--ink); }
.nav-links a[aria-current] { color: var(--ink); background: var(--cream); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-login { font-weight: 600; font-size: 17px; text-decoration: none; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--violet-soft); color: var(--violet-ink); display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 19px; }
.streak-chip { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--pip-edge); text-decoration: none; }
.streak-chip svg { width: 26px; height: 26px; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-in { height: 64px; }
  .nav-login { display: none; }
}

/* ---------- sections ---------- */
.section { padding: clamp(72px, 8.5vw, 116px) 0; }
.section-cream { background: var(--cream); }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head p { margin: 14px auto 0; max-width: 30em; color: var(--ink-2); font-size: 19px; }

/* ---------- Pip ---------- */
.pip { position: relative; width: var(--size, 140px); flex: none; }
.pip img { width: 100%; height: auto; position: relative; z-index: 1; }
.pip::after { /* flat ground shadow */
  content: ""; position: absolute; left: 30%; right: 30%; bottom: 2%; height: 5%;
  border-radius: 50%; background: rgba(31, 42, 85, .08); z-index: 0;
  animation: shadow 4s ease-in-out infinite;
}
.pip.bob img { animation: bob 4s ease-in-out infinite; }
.pip.hop img { animation: hop .7s cubic-bezier(.3,.7,.4,1) 1; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.82); opacity: .7; } }
@keyframes hop { 0% { transform: translateY(0); } 35% { transform: translateY(-12px); } 70% { transform: translateY(0); } 100% { transform: translateY(0); } }

.bubble {
  position: relative; background: #fff; border-radius: 14px; padding: 12px 18px;
  font-weight: 500; font-size: 17px; line-height: 1.4; color: var(--ink);
  box-shadow: 0 0 0 1.5px var(--line-2);
  max-width: 260px;
}
.bubble::before {
  content: ""; position: absolute; left: -9px; top: 26px; width: 18px; height: 18px; background: #fff;
  transform: rotate(45deg); box-shadow: -1.5px 1.5px 0 0 var(--line-2); border-radius: 2px;
}
.bubble.pop { animation: pop .35s ease; }
@keyframes pop { 0% { opacity: .4; } 100% { opacity: 1; } }

/* ---------- toy stage ---------- */
.stage {
  position: relative; background: #fff; border-radius: var(--r-l);
  box-shadow: 0 0 0 1.5px var(--line);
  padding: 18px; overflow: hidden;
}
.stage svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage.is-won { box-shadow: 0 0 0 2px var(--mint), 0 0 0 7px rgba(61,214,163,.14); transition: box-shadow .3s ease; }
.stage-cap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; padding: 0 6px; }
.readout { font-family: var(--display); font-weight: 600; font-size: 21px; font-variant-numeric: tabular-nums; }
.readout b { font-weight: 600; }
.hint-line { color: var(--ink-2); font-weight: 500; font-size: 17px; }
.drag { cursor: grab; }
.drag:active { cursor: grabbing; }

/* ---------- hero ---------- */
.hero { background: var(--cream); padding: 72px 0 112px; overflow: hidden; }
.hero-play { margin-top: 40px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.12fr; gap: 56px; align-items: center; }
.hero h1 { max-width: 9.5em; }
.hero .lead { margin-top: 22px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px 22px; align-items: center; margin-top: 34px; }
.hero-play { position: relative; }
.hero-play .stage { padding: 14px 14px 8px; }
.hero-pip { position: absolute; right: 12px; top: -76px; display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 6px; z-index: 2; pointer-events: none; }
.hero-pip .bubble { margin-top: 70px; max-width: 240px; box-shadow: 0 0 0 1.5px var(--line-2); }
.hero-pip .bubble::before { left: auto; right: -9px; top: 20px; box-shadow: 1.5px -1.5px 0 0 var(--line-2); }
.hero-pip .pip { --size: 136px; }
.hero-pip .pip::after { display: none; }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding-top: 28px; }
  .hero-play { margin-top: 0; }
  .hero-cta { margin-top: 24px; }
  .hero h1 { max-width: 12em; }
  .hero-pip { position: static; flex-direction: row; align-items: center; margin-top: 10px; }
  .hero-pip .pip { --size: 84px; margin: -8px -8px -8px -12px; }
  .hero-pip .bubble { margin-top: 0; font-size: 16px; max-width: none; padding: 10px 14px; }
  .hero-pip .bubble::before { left: -9px; right: auto; top: 50%; margin-top: -9px; box-shadow: -1.5px 1.5px 0 0 var(--line-2); }
}

/* ---------- toy sections ---------- */
.toy-sec .stage { max-width: 760px; margin: 0 auto; }
.eq {
  font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3.4vw, 42px);
  text-align: center; margin-bottom: 18px; line-height: 1.1;
}
.eq .m { color: var(--sky-ink); }
.eq .b { color: var(--pip-edge); }
.eq-sub { text-align: center; color: var(--ink-2); font-weight: 500; margin-top: -8px; margin-bottom: 18px; font-size: 18px; }

/* sort toy */
.sort { position: relative; height: 270px; margin: 8px auto 0; max-width: 620px; }
.sort-bar {
  position: absolute; bottom: 8px; width: 15%; border: 0; padding: 0; cursor: pointer;
  background: var(--sun); border-radius: 10px 10px 8px 8px;
  box-shadow: inset 0 -4px 0 var(--sun-edge);
  transition: left .42s cubic-bezier(.5,1.6,.5,1), transform .18s ease, background .3s ease, box-shadow .3s ease;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 10px;
  font-family: var(--display); font-weight: 600; font-size: 22px; color: #5A3E00;
  -webkit-tap-highlight-color: transparent;
}
.sort-bar:hover { transform: translateY(-4px); }
.sort-bar.sel { transform: translateY(-14px); background: var(--pip); color: #fff; box-shadow: inset 0 -4px 0 var(--pip-edge); }
.sort-bar.done { background: var(--mint); box-shadow: inset 0 -4px 0 #22B386; color: #0B4A35; }
.sort-bar:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.sort-floor { position: absolute; left: 0; right: 0; bottom: 2px; height: 5px; border-radius: 5px; background: var(--ink); }

/* neuron toy */
.neuron-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
@media (max-width: 760px) { .neuron-grid { grid-template-columns: 1fr; gap: 18px; } }
.neuron-ctrl { display: grid; gap: 22px; }
.slider-row label { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; }
.slider-row output { font-family: var(--display); font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 10px; background: linear-gradient(90deg, var(--violet) var(--fill, 50%), #ECE7F7 var(--fill, 50%)); }
input[type=range]::-moz-range-track { height: 12px; border-radius: 12px; background: #ECE7F7; }
input[type=range]::-moz-range-progress { height: 12px; border-radius: 12px; background: var(--violet); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -9px; border-radius: 50%; background: #fff; border: 4px solid var(--violet-ink); box-shadow: 0 2px 0 var(--violet-ink); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid var(--violet-ink); }
input[type=range]:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; border-radius: 12px; }
.cases { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.case {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 0; cursor: pointer;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); font-weight: 600; font-size: 16px; text-align: left;
}
.case svg { width: 32px; height: 32px; flex: none; }
.case { justify-content: flex-start; min-height: 60px; }
.case .verdict { margin-left: auto; width: 24px; height: 24px; }
.case.sel { box-shadow: inset 0 0 0 2px var(--violet-ink); background: var(--violet-soft); }
.score { font-family: var(--display); font-weight: 600; font-size: 20px; text-align: center; }

/* streak toy */
.streak-toy { position: relative; max-width: 820px; margin: 0 auto; }
.streak-toy svg { width: 100%; height: auto; display: block; }
.streak-toy .pip { position: absolute; --size: 84px; transform: translate(-50%, -100%); transition: none; }
.streak-foot { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; margin-top: 26px; }
.streak-count { font-family: var(--display); font-weight: 600; font-size: 28px; }
.streak-count span { color: var(--pip-edge); display: inline-block; margin-right: .25em; }

/* course shelf (landing) */
.shelf { display: flex; justify-content: center; gap: clamp(12px, 3vw, 40px); }
.shelf-item {
  border: 0; background: transparent; cursor: pointer; padding: 0; text-align: center;
  font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--ink-2);
  -webkit-tap-highlight-color: transparent;
}
.shelf-item .toy { width: clamp(104px, 18vw, 200px); aspect-ratio: 1; border-radius: 50%; margin-bottom: 12px; transition: transform .25s ease, box-shadow .25s ease; }
.shelf-item:hover .toy { transform: translateY(-3px); }
.shelf-item[aria-selected=true] { color: var(--ink); }
.shelf-item[aria-selected=true] .toy { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--c); }
.shelf-item .dot { display: block; width: 10px; height: 10px; border-radius: 50%; margin: 10px auto 0; background: transparent; }
.shelf-item[aria-selected=true] .dot { background: var(--c, var(--pip)); }
.shelf-detail { max-width: 720px; margin: 36px auto 0; text-align: center; }
.shelf-detail h3 { font-size: clamp(28px, 3vw, 36px); }
.shelf-detail p { margin-top: 10px; color: var(--ink-2); }
.shelf-detail .row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 26px; align-items: center; }
.free-note { font-weight: 600; color: var(--mint-ink); }

/* course art: flat inline svg on a soft tint */
.toy { background: var(--cream); overflow: hidden; display: block; }
.toy svg { display: block; width: 100%; height: 100%; }
.toy-math { background: var(--sky-soft); }
.toy-code { background: var(--sun-soft); }
.toy-ai { background: var(--violet-soft); }
.toy-physics { background: #FFEEF1; }

/* pricing */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 880px; margin: 0 auto; }
.plan { border-radius: var(--r-l); padding: 34px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); display: flex; flex-direction: column; gap: 14px; }
.plan.pro { background: #fff; box-shadow: inset 0 0 0 2px var(--pip); position: relative; }
.plan h3 { font-size: 28px; }
.price { font-family: var(--display); font-weight: 600; font-size: 48px; line-height: 1; letter-spacing: -0.03em; }
.price small { font-family: var(--body); font-size: 18px; color: var(--ink-2); font-weight: 400; letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 10px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li svg { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.plan .btn { margin-top: auto; }
.plan-tag { position: absolute; right: 24px; top: -14px; background: var(--pip-btn); color: #fff; font-weight: 600; font-size: 15px; padding: 4px 12px; border-radius: 8px; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

/* faq */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: #fff; border-radius: var(--r-m); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 26px; font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: -0.015em; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 14px; height: 14px; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); width: 11px; height: 11px; transform: rotate(45deg) translate(-3px, -3px); transition: transform .2s ease; flex: none; }
.faq details[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
.faq details p { padding: 0 26px 24px; color: var(--ink-2); max-width: 36em; }

/* footer */
.footer { background: var(--cream); padding: 64px 0 48px; }
.footer-in { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; font-weight: 500; color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); }
.footer .small { margin-top: 10px; }

/* closing cta */
.closing { text-align: center; }
.closing .btn { margin-top: 30px; }

/* ---------- home ---------- */
.home-top { padding: 36px 0 24px; }
.continue {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center;
  background: var(--violet-soft); border-radius: var(--r-xl); padding: clamp(24px, 4vw, 48px);
}
.continue .course-name { font-weight: 600; color: var(--violet-ink); font-size: 17px; }
.continue h1 { font-size: clamp(38px, 4.4vw, 58px); margin-top: 8px; }
.continue .meta { margin-top: 14px; color: var(--ink-2); }
.bar { height: 10px; border-radius: 10px; background: #fff; overflow: hidden; margin-top: 18px; box-shadow: inset 0 0 0 1.5px rgba(31,42,85,.07); }
.bar i { display: block; height: 100%; border-radius: 10px; background: var(--c, var(--violet)); }
.continue .btn { margin-top: 28px; }
.continue .stage { box-shadow: none; }
@media (max-width: 900px) { .continue { grid-template-columns: 1fr; } }

.bits { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.bit { display: flex; align-items: center; gap: 22px; border-radius: var(--r-l); padding: 22px 28px; }
.bit h3 { font-size: 26px; }
.bit p { color: var(--ink-2); font-size: 17px; margin-top: 2px; }
.bit-icon { width: 64px; height: 64px; flex: none; }
.bit .btn { margin-left: auto; }
.bit-streak { background: var(--cream); }
.bit-review { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.cardstack { position: relative; width: 74px; height: 70px; flex: none; }
.cardstack i { position: absolute; width: 54px; height: 64px; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.cardstack i:nth-child(1) { left: 0; top: 6px; transform: rotate(-10deg); background: var(--sky-soft); }
.cardstack i:nth-child(2) { left: 10px; top: 2px; transform: rotate(-2deg); background: var(--sun-soft); }
.cardstack i:nth-child(3) { left: 20px; top: 0; transform: rotate(7deg); background: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-style: normal; font-size: 26px; color: var(--pip-edge); }
@media (max-width: 900px) { .bits { grid-template-columns: 1fr; } }

.courses { margin-top: 64px; }
.courses h2 { font-size: clamp(30px, 3vw, 38px); margin-bottom: 18px; }
.course-row {
  display: grid; grid-template-columns: 96px 1fr 220px auto; gap: 26px; align-items: center;
  padding: 18px 8px; border-top: 1.5px solid var(--line); text-decoration: none;
}
.course-row:last-child { border-bottom: 1.5px solid var(--line); }
.course-row .toy { width: 96px; height: 96px; border-radius: 50%; }
.course-row .subj { font-weight: 600; font-size: 16px; color: var(--c); }
.course-row h3 { font-size: 24px; }
.course-row .prog { font-weight: 500; color: var(--ink-2); font-size: 16px; }
.course-row .bar { background: var(--cream-2); margin-top: 6px; height: 8px; box-shadow: none; }
@media (max-width: 760px) {
  .course-row { grid-template-columns: 72px 1fr; gap: 14px 18px; }
  .course-row .toy { width: 72px; height: 72px; }
  .course-row .progwrap, .course-row .btn { grid-column: 2; }
  .course-row .btn { justify-self: start; }
}

/* ---------- course page ---------- */
.course-head { background: var(--cream); padding: 48px 0 80px; }
.course-head-grid { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: center; }
.course-head .toy { width: 100%; aspect-ratio: 1; border-radius: 50%; }
.course-head .subj { font-weight: 600; color: var(--c); font-size: 18px; }
.course-head h1 { margin-top: 8px; font-size: clamp(40px, 4.8vw, 64px); }
.course-head .lead { margin-top: 14px; }
.course-head .row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 28px; }
.course-head .bar { width: 220px; margin-top: 0; }
@media (max-width: 860px) {
  .course-head-grid { grid-template-columns: 1fr; gap: 20px; }
  .course-head .toy { width: 168px; }
}

.path { position: relative; max-width: 860px; margin: 0 auto; padding: 10px 0; }
.path svg.trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.step { position: relative; display: flex; align-items: center; gap: 22px; height: 108px; }
.node {
  width: 76px; height: 76px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 24px; text-decoration: none; position: relative; z-index: 1;
}
.node svg { width: 30px; height: 30px; }
.step.done .node { background: var(--mint-btn); color: #fff; box-shadow: 0 3px 0 var(--mint-edge); }
.step.current .node { width: 88px; height: 88px; background: var(--pip-btn); color: #fff; box-shadow: 0 3px 0 var(--pip-edge), 0 0 0 8px rgba(255,107,61,.12); font-size: 30px; }
.step.locked .node { background: #fff; color: #A8A4B4; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.step .label { font-weight: 600; font-size: 19px; line-height: 1.25; max-width: 340px; }
@media (max-width: 600px) { .step { margin-left: calc(4% + var(--o, 0px)) !important; } .step .label { font-size: 17px; } }
.step .label small { display: block; font-weight: 500; font-size: 15px; color: var(--ink-3); margin-top: 2px; }
.step.current .label { font-family: var(--display); font-weight: 600; font-size: 24px; }
.step.current .label small { font-family: var(--body); color: var(--pip-edge); }
.step.locked .label { color: var(--ink-3); }
.later { margin-top: 56px; text-align: center; color: var(--ink-2); }
.later strong { color: var(--ink); }

/* ---------- lesson player ---------- */
.lesson-body { background: #fff; min-height: 100vh; display: flex; flex-direction: column; }
.lbar { display: flex; align-items: center; gap: 20px; height: 76px; width: min(1000px, 100% - 32px); margin: 0 auto; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-3); text-decoration: none; }
.icon-btn:hover { background: var(--cream); color: var(--ink); }
.icon-btn svg { width: 26px; height: 26px; }
.lbar .bar { flex: 1; margin: 0; height: 10px; background: var(--cream-2); box-shadow: none; }
.lbar .bar i { background: var(--mint-btn); transition: width .5s ease; position: relative; }
.lmain { flex: 1; width: min(860px, 100% - 32px); margin: 0 auto; padding: 8px 0 170px; }
.lmain .kicker { font-weight: 600; color: var(--violet-ink); font-size: 17px; }
.lmain h1 { font-size: clamp(28px, 2.6vw, 36px); margin-top: 6px; }
.lmain .q-sub { margin-top: 8px; color: var(--ink-2); font-size: 19px; }
.lmain .stage { margin-top: 22px; padding: 12px 18px 14px; }
.lmain .stage svg { max-height: 34vh; min-height: 200px; margin: 0 auto; width: auto; max-width: 100%; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.choice {
  border: 0; cursor: pointer; border-radius: 14px; padding: 16px 14px 14px; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 3px 0 var(--line-2);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--body); font-weight: 700; font-size: 19px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.choice svg { width: 92px; height: 28px; }
.choice small { font-family: var(--body); font-weight: 500; font-size: 15px; color: var(--ink-3); }
.choice:hover { transform: translateY(-1px); }
.choice:active { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px var(--line-2), 0 0 0 var(--line-2); }
.choice[aria-pressed=true] { background: var(--sky-soft); box-shadow: inset 0 0 0 2px #2F86E8, 0 3px 0 #1B62B5; }
.choice:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
@media (max-width: 600px) { .choices { gap: 8px; } .choice { font-size: 16px; padding: 12px 4px; } .choice svg { width: 64px; } .choice small { font-size: 13px; } }

.lfoot { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1.5px solid var(--line); z-index: 20; transition: background .25s ease, border-color .25s ease; }
.lfoot-in { width: min(860px, 100% - 32px); margin: 0 auto; min-height: 104px; display: flex; align-items: center; gap: 22px; padding: 16px 0; }
.lfoot .fb { display: none; align-items: center; gap: 18px; flex: 1; }
.lfoot .fb .pip { --size: 96px; margin: -30px -6px -10px -10px; }
.lfoot .fb .pip::after { display: none; }
.lfoot .fb h3 { font-size: 26px; }
.lfoot .fb p { font-size: 18px; margin-top: 4px; max-width: 30em; }
.lfoot .spacer { flex: 1; }
.lfoot .btn { min-width: 190px; }
.lfoot.ok { background: var(--mint-soft); border-color: #BDEFD9; }
.lfoot.ok .fb.ok, .lfoot.miss .fb.miss { display: flex; }
.lfoot.ok .spacer, .lfoot.miss .spacer { display: none; }
.lfoot.ok h3 { color: var(--mint-ink); }
.lfoot.miss { background: var(--sun-soft); border-color: #F5DD95; }
.lfoot.miss h3 { color: var(--sun-ink); }
.lfoot.ok, .lfoot.miss { animation: rise .26s ease-out; }
@keyframes rise { from { transform: translateY(24px); } to { transform: translateY(0); } }
@media (max-width: 640px) {
  .lfoot-in { flex-wrap: wrap; }
  .lfoot .btn { width: 100%; }
  .lfoot .fb .pip { --size: 64px; margin: -16px -4px -8px -8px; }
  .lfoot .fb h3 { font-size: 22px; }
  .lfoot .fb p { font-size: 17px; }
}

/* confetti */
.confetti { position: fixed; pointer-events: none; z-index: 100; left: 0; top: 0; }
.confetti i { position: absolute; width: 6px; height: 9px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 600px) { .streak-toy .pip { --size: 52px; } }

/* =====================================================================
   Flow screens: onboarding, predict, practice, complete, account,
   review, pro, parent, profile. Added on top of the pages above.
   ===================================================================== */

/* simple top bar for focused screens */
.fbar { display: flex; align-items: center; gap: 20px; height: 76px; width: min(1000px, 100% - 32px); margin: 0 auto; }
.fbar .bar { flex: 1; margin: 0; height: 10px; background: var(--cream-2); box-shadow: none; }
.fbar .bar i { background: var(--pip-btn); }
.fbar .logo { margin-right: auto; }
.fbar .skip { font-weight: 600; font-size: 17px; color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 10px; }
.fbar .skip:hover { background: var(--cream); color: var(--ink); }
.screen-cream .fbar .bar { background: #fff; }

.screen { min-height: 100vh; display: flex; flex-direction: column; background: var(--white); }
.screen-cream { background: var(--cream); }
.screen-main { flex: 1; width: min(720px, 100% - 32px); margin: 0 auto; padding: 36px 0 96px; }
.screen-main.wide { width: min(1000px, 100% - 32px); }
.screen-main h1 { font-size: clamp(34px, 4vw, 50px); }
.screen-main .lead { margin-top: 14px; }

.greet { display: flex; align-items: center; gap: 22px; }
.greet .pip { --size: 104px; margin: -10px -6px -10px -14px; }
.greet .pip::after { display: none; }

/* option cards (radio style) */
.opts { display: grid; gap: 14px; margin-top: 34px; }
.opt {
  --sel: #2F86E8; --sel-edge: #1B62B5; --sel-soft: var(--sky-soft);
  border: 0; cursor: pointer; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: 16px; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 3px 0 var(--line-2);
  font-family: var(--body); font-weight: 700; font-size: 20px; line-height: 1.3; color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.opt small { display: block; font-weight: 500; font-size: 16px; color: var(--ink-2); margin-top: 2px; }
.opt:hover { transform: translateY(-1px); }
.opt:active { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px var(--line-2), 0 0 0 var(--line-2); }
.opt:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.opt .radio { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--line-2); background: #fff; transition: box-shadow .15s ease; }
.opt[aria-checked=true] { background: var(--sel-soft); box-shadow: inset 0 0 0 2px var(--sel), 0 3px 0 var(--sel-edge); }
.opt[aria-checked=true] .radio { box-shadow: inset 0 0 0 7.5px var(--sel); }
.opt .opt-ico { width: 52px; height: 52px; flex: none; }
.screen-cream .opt:not([aria-checked=true]) { background: #fff; }

.actions { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; margin-top: 32px; }
.actions .btn { min-width: 200px; }
.fine { font-size: 16px; color: var(--ink-2); }
.fine a { color: var(--ink); font-weight: 600; }

/* course picker */
.course-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.course-opt { flex-direction: column; align-items: stretch; text-align: left; padding: 18px 18px 22px; gap: 0; border-radius: var(--r-l); }
.course-opt .toy { width: 100%; aspect-ratio: 1.35; border-radius: 16px; margin-bottom: 18px; }
.course-opt .toy svg { width: 74%; height: 100%; margin: 0 auto; }
.course-opt .subj { font-weight: 600; font-size: 16px; color: var(--c); }
.course-opt .name { font-family: var(--display); font-weight: 600; font-size: 23px; letter-spacing: -0.015em; line-height: 1.15; margin-top: 2px; }
.course-opt small { margin-top: 8px; }
.course-opt .radio { position: absolute; right: 30px; top: 30px; }
.course-opt { position: relative; }
.course-opt.math { --sel: #2F86E8; --sel-edge: #1B62B5; --sel-soft: #F5FAFF; }
.course-opt.code { --sel: var(--sun-edge); --sel-edge: var(--sun-ink); --sel-soft: #FFFBEF; }
.course-opt.ai { --sel: #7464F2; --sel-edge: #4E3FC4; --sel-soft: #F8F7FF; }
@media (max-width: 760px) {
  .course-opts { grid-template-columns: 1fr; gap: 12px; }
  .course-opt { flex-direction: row; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; }
  .course-opt .toy { width: 84px; aspect-ratio: 1; border-radius: 50%; margin: 0; flex: none; }
  .course-opt .toy svg { width: 100%; }
  .course-opt .radio { position: static; }
  .course-opt .name { font-size: 20px; }
  .course-opt small { font-size: 15px; }
}

/* soft panels and fields */
.panel { background: var(--cream); border-radius: var(--r-l); padding: clamp(22px, 3vw, 32px); }
.panel-line { background: #fff; border-radius: var(--r-l); padding: clamp(22px, 3vw, 32px); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: 17px; }
.input {
  height: 56px; width: 100%; border: 0; border-radius: 12px; padding: 0 18px; background: #fff;
  font: inherit; font-size: 18px; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-2);
}
.input::placeholder { color: #A3A8BF; }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px #2F86E8, 0 0 0 4px rgba(77,163,255,.18); }
.row-field { display: flex; gap: 12px; flex-wrap: wrap; }
.row-field .input { flex: 1 1 240px; }

.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; }
.ticks li svg { width: 24px; height: 24px; flex: none; margin-top: 3px; }

/* ---------- predict ---------- */
.choices.stack { grid-template-columns: 1fr; gap: 12px; }
.choices.stack .choice { flex-direction: row; justify-content: flex-start; gap: 18px; padding: 16px 20px; text-align: left; }
.choices.stack .choice svg { width: 88px; height: 44px; flex: none; }
.choices.stack .choice span small { display: block; margin-top: 2px; }
.choice[aria-pressed=true].locked { background: var(--violet-soft); box-shadow: inset 0 0 0 2px #7464F2, 0 3px 0 #4E3FC4; }
.lfoot.wait { background: var(--violet-soft); border-color: #DDD8FF; }
.lfoot.wait .fb.wait { display: flex; }
.lfoot.wait .spacer { display: none; }
.lfoot.wait h3 { color: var(--violet-ink); }
.lfoot.wait { animation: rise .26s ease-out; }
@media (max-width: 600px) {
  .choices.stack .choice { gap: 12px; padding: 12px 14px; font-size: 17px; }
  .choices.stack .choice svg { width: 64px; height: 34px; }
}

/* ---------- practice: formula, number line, keypad ---------- */
.practice { display: grid; grid-template-columns: 1fr 320px; gap: 24px; margin-top: 22px; align-items: start; }
.practice .stage { margin-top: 0; }
.formula { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.2; text-align: center; padding: 14px 4px 6px; letter-spacing: -0.01em; }
.formula .t-m { color: var(--sky-ink); }
.formula .t-r { color: var(--violet-ink); }
.formula .t-s { color: var(--pip-edge); }
.vals { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.val { font-family: var(--display); font-weight: 600; font-size: 20px; padding: 6px 14px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.val.m { background: var(--sky-soft); color: var(--sky-ink); }
.val.r { background: var(--violet-soft); color: var(--violet-ink); }
.val.s { background: var(--pip-soft); color: var(--pip-edge); }
.lmain .stage svg.numline { min-height: 0; max-height: none; width: 100%; margin-top: 6px; }
.answer-label { font-weight: 600; font-size: 17px; display: block; margin-bottom: 8px; }
.answer {
  width: 100%; height: 78px; border: 0; border-radius: 16px; background: #fff; text-align: center;
  font-family: var(--display); font-weight: 600; font-size: 40px; color: var(--ink); font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 2px var(--line-2); caret-color: var(--pip);
}
.answer::placeholder { color: #C9C5D3; }
.answer:focus { outline: none; box-shadow: inset 0 0 0 2px #2F86E8, 0 0 0 4px rgba(77,163,255,.16); }
.answer.ok { background: var(--mint-soft); color: var(--mint-ink); box-shadow: inset 0 0 0 2px var(--mint-btn); }
.answer.miss { background: #FFFBEF; box-shadow: inset 0 0 0 2px var(--sun-edge); }
.answer.shown { background: var(--mint-soft); color: var(--mint-ink); box-shadow: inset 0 0 0 2px var(--mint-btn); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.key {
  border: 0; cursor: pointer; height: 60px; border-radius: 14px; background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 3px 0 var(--line-2);
  font-family: var(--display); font-weight: 600; font-size: 26px; display: grid; place-items: center;
  transition: transform .1s ease, box-shadow .1s ease; -webkit-tap-highlight-color: transparent;
}
.key:hover { background: var(--cream); }
.key:active, .key.is-pressed { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px var(--line-2), 0 0 0 var(--line-2); }
.key:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.key svg { width: 30px; height: 30px; }
.key[disabled] { opacity: .5; cursor: default; }
@media (max-width: 760px) {
  .practice { grid-template-columns: 1fr; gap: 16px; }
  .key { height: 54px; }
  .answer { height: 66px; font-size: 34px; }
}

/* ---------- lesson complete ---------- */
.done-head { text-align: center; }
.done-head .pip { --size: 132px; margin: 0 auto 6px; }
.done-head h1 { font-size: clamp(38px, 4.4vw, 56px); }
.done-head .lead { margin: 12px auto 0; }
.learned { display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; margin-top: 40px; align-items: stretch; }
.learned .panel h2, .learned .panel-line h2, .tile h2 { font-size: 24px; letter-spacing: -0.015em; }
.learned .ticks { margin-top: 16px; }
.frame { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.frame svg { width: 100%; height: auto; display: block; background: #fff; }
.frame figcaption { padding: 14px 22px 18px; font-size: 16px; color: var(--ink-2); font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.tile { border-radius: var(--r-l); padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.tile .tile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; min-height: 64px; }
.tile .big { font-family: var(--display); font-weight: 600; font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; }
.tile p { color: var(--ink-2); font-size: 17px; }
.tile .bar { background: var(--cream-2); box-shadow: none; margin-top: 10px; }
.tile-streak { background: var(--pip-soft); box-shadow: none; }
.plus { display: inline-block; font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--pip-edge); background: #fff; border-radius: 8px; padding: 1px 10px; margin-left: 4px; vertical-align: 4px; }
.plus.pop { animation: plus .5s ease .5s both; }
@keyframes plus { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.next-card { display: flex; align-items: center; gap: 26px; margin-top: 20px; background: var(--violet-soft); border-radius: var(--r-l); padding: 22px 28px; }
.next-card .toy { width: 84px; height: 84px; border-radius: 50%; background: #fff; flex: none; }
.next-card p { color: var(--ink-2); font-size: 17px; }
.next-card .who { color: var(--violet-ink); font-weight: 600; font-size: 16px; }
.next-card h3 { font-size: 26px; margin-top: 2px; }
.next-card .btn { margin-left: auto; }
@media (max-width: 860px) {
  .learned { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .tile { flex-direction: row; align-items: center; gap: 16px; padding: 16px 18px; }
  .tile .tile-top { margin: 0; min-height: 0; }
  .tile .big { font-size: 24px; }
  .tile p { font-size: 16px; }
  .next-card { flex-wrap: wrap; gap: 16px; padding: 20px; }
  .next-card .toy { width: 64px; height: 64px; }
  .next-card .btn { margin-left: 0; width: 100%; }
}

/* ---------- account ---------- */
.auth { display: grid; gap: 12px; margin-top: 30px; }
.auth .btn { justify-content: flex-start; gap: 16px; padding-left: 22px; min-height: 60px; font-size: 18px; }
.auth .btn svg { width: 24px; height: 24px; flex: none; }
.auth .btn span { flex: 1; text-align: center; margin-right: 40px; }
.btn-ink { --bg: #1F2A55; --edge: #0E1533; }
.saved { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); font-weight: 600; font-size: 16px; }
.chip svg { width: 22px; height: 22px; flex: none; }
.or { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-weight: 500; font-size: 16px; margin: 6px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1.5px; background: var(--line-2); }

/* ---------- review ---------- */
.rcard { margin-top: 22px; background: #fff; border-radius: var(--r-l); box-shadow: inset 0 0 0 1.5px var(--line), 0 6px 0 -2px var(--cream-2), 0 12px 0 -4px var(--line); padding: clamp(22px, 3vw, 34px); }
.rcard .from { font-weight: 600; color: var(--violet-ink); font-size: 16px; }
.rcard h2 { font-size: clamp(26px, 2.6vw, 32px); margin-top: 6px; }
.rcard svg.scene { width: 100%; max-width: 520px; height: auto; display: block; margin: 18px auto 4px; }
.review-done { text-align: center; padding-top: 24px; }
.review-done .cardstack { margin: 0 auto 22px; transform: scale(1.4); }
.review-done h1 { font-size: clamp(36px, 4vw, 50px); }
.recap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 34px auto 0; max-width: 640px; text-align: left; }
.recap .tile { padding: 18px 20px; }
@media (max-width: 600px) { .recap { grid-template-columns: 1fr; } }

/* ---------- pro ---------- */
.pro-grid { display: grid; grid-template-columns: 1fr 420px; gap: 48px; align-items: start; margin-top: 8px; }
.unlocks { display: grid; gap: 18px; margin-top: 30px; }
.unlock { display: flex; gap: 18px; align-items: flex-start; }
.unlock .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.unlock .ico svg { width: 30px; height: 30px; }
.unlock h3 { font-size: 21px; }
.unlock p { color: var(--ink-2); font-size: 17px; margin-top: 2px; }
.honest { margin-top: 36px; }
.honest h2 { font-size: 24px; letter-spacing: -0.015em; }
.honest .ticks { margin-top: 14px; }
.buy { position: sticky; top: 24px; }
.buy .opts { margin-top: 18px; gap: 12px; }
.plan-opt { padding: 16px 18px; }
.plan-opt .p-name { font-size: 19px; }
.plan-opt .p-price { margin-left: auto; text-align: right; font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -0.02em; line-height: 1.1; }
.plan-opt .p-price small { font-family: var(--body); font-size: 15px; letter-spacing: 0; }
.plan-opt .radio { margin-left: 0; }
.save-tag { display: inline-block; background: var(--mint-soft); color: var(--mint-ink); font-weight: 700; font-size: 14px; padding: 2px 9px; border-radius: 7px; margin-left: 6px; vertical-align: 2px; }
.buy .btn-wide + .btn-wide { margin-top: 12px; }
.buy .fine { text-align: center; margin-top: 14px; }
.buy .restore { display: block; text-align: center; margin-top: 18px; font-weight: 600; font-size: 16px; color: var(--ink-2); }
@media (max-width: 900px) {
  .pro-grid { grid-template-columns: 1fr; gap: 28px; }
  .buy { position: static; }
}

/* share sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(31,42,85,.36); display: none; align-items: center; justify-content: center; padding: 16px; }
.sheet-wrap.open { display: flex; animation: fade .2s ease; }
.sheet { position: relative; width: min(480px, 100%); background: #fff; border-radius: var(--r-l); padding: 28px; box-shadow: 0 24px 60px -20px rgba(31,42,85,.4); animation: rise .26s ease-out; }
.sheet h2 { font-size: 28px; padding-right: 40px; }
.sheet > p { color: var(--ink-2); margin-top: 8px; font-size: 18px; }
.sheet .icon-btn { position: absolute; right: 16px; top: 16px; }
.linkbox { display: flex; gap: 10px; margin-top: 20px; }
.linkbox .input { font-size: 16px; color: var(--ink-2); background: var(--cream); box-shadow: none; }
.targets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 22px; }
.target { border: 0; background: transparent; cursor: pointer; display: grid; justify-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--ink-2); padding: 6px 0; border-radius: 12px; }
.target:hover { background: var(--cream); }
.target i { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; }
.target svg { width: 26px; height: 26px; }
.sheet .preview { margin-top: 22px; padding: 16px 18px; border-radius: 14px; background: var(--cream); font-size: 16px; color: var(--ink-2); }
.sheet .preview b { color: var(--ink); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) {
  .sheet-wrap { align-items: flex-end; padding: 0; }
  .sheet { border-radius: var(--r-l) var(--r-l) 0 0; width: 100%; padding: 24px 20px 28px; }
}

/* ---------- parent ---------- */
.p-hero { background: var(--cream); padding: 56px 0 72px; }
.p-hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.p-hero h1 { font-size: clamp(38px, 4.4vw, 58px); }
.week { background: #fff; border-radius: var(--r-l); padding: 26px 28px; box-shadow: inset 0 0 0 1.5px var(--line); }
.week h2 { font-size: 22px; letter-spacing: -0.01em; }
.week .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat .big { font-family: var(--display); font-weight: 600; font-size: 36px; letter-spacing: -0.02em; line-height: 1.05; }
.stat p { color: var(--ink-2); font-size: 16px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 20px; }
.days span { text-align: center; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.days i { display: block; height: 36px; border-radius: 9px; background: var(--cream-2); margin-bottom: 6px; }
.days i.on { background: var(--pip); box-shadow: inset 0 -3px 0 var(--pip-edge); }
.safe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.safe .tile h3 { font-size: 22px; margin-top: 4px; }
.safe .tile svg { width: 44px; height: 44px; }
.consent { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.check { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; font-size: 18px; }
.check input { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; border-radius: 8px; flex: none; margin: 1px 0 0; background: #fff; box-shadow: inset 0 0 0 2px var(--line-2); cursor: pointer; display: grid; place-items: center; }
.check input:checked { background: var(--mint-btn); box-shadow: none; }
.check input:checked::after { content: ""; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: translate(0, -2px) rotate(45deg); }
.check input:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.email { max-width: 640px; margin: 0 auto; background: #fff; border-radius: var(--r-l); box-shadow: inset 0 0 0 1.5px var(--line-2); overflow: hidden; }
.email-head { padding: 18px 26px; border-bottom: 1.5px solid var(--line); font-size: 16px; color: var(--ink-2); display: grid; gap: 2px; }
.email-head b { color: var(--ink); }
.email-body { padding: 26px; }
.email-body h3 { font-size: 26px; }
.email-body .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; padding: 16px 18px; background: var(--cream); border-radius: 14px; }
.email-body .stat .big { font-size: 28px; }
.email-body p + p { margin-top: 12px; }
.email-body .ticks { margin-top: 12px; font-size: 18px; }
.email-foot { padding: 16px 26px 20px; border-top: 1.5px solid var(--line); font-size: 15px; color: var(--ink-3); }
@media (max-width: 860px) {
  .p-hero-grid, .consent { grid-template-columns: 1fr; gap: 28px; }
  .safe { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 480px) {
  .week .stats, .email-body .stats { gap: 8px; }
  .stat .big { font-size: 28px; }
  .email-body .stat .big { font-size: 24px; }
}

/* ---------- profile ---------- */
.prof-head { display: flex; align-items: center; gap: 24px; padding: 40px 0 8px; }
.prof-head .avatar { width: 96px; height: 96px; font-size: 42px; }
.prof-head h1 { font-size: clamp(36px, 4vw, 50px); }
.prof-head p { color: var(--ink-2); margin-top: 4px; }
.prof-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.prof-stats .tile { flex-direction: row; align-items: center; gap: 18px; }
.prof-stats .tile svg { width: 52px; height: 52px; flex: none; }
.prof-sec { margin-top: 56px; }
.prof-sec > h2 { font-size: clamp(28px, 2.8vw, 34px); margin-bottom: 16px; }
.settings { background: #fff; border-radius: var(--r-l); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.set { display: flex; align-items: center; gap: 20px; padding: 18px 24px; }
.set + .set { border-top: 1.5px solid var(--line); }
.set .what { flex: 1; min-width: 0; }
.set .what b { display: block; font-weight: 600; }
.set .what span { display: block; color: var(--ink-2); font-size: 16px; }
.set .btn { flex: none; }
.set-danger .what b { color: #C2341F; }
.btn-danger { --bg: #fff; --edge: #F2C9C1; --fg: #C2341F; box-shadow: 0 2px 0 var(--edge), inset 0 0 0 1.5px #F2C9C1; }
.btn-danger:hover { box-shadow: 0 3px 0 var(--edge), inset 0 0 0 1.5px #F2C9C1; }
.switch { position: relative; width: 58px; height: 34px; border: 0; border-radius: 34px; background: #E3DED5; cursor: pointer; flex: none; padding: 0; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(31,42,85,.12); transition: transform .2s ease; }
.switch[aria-checked=true] { background: var(--mint-btn); }
.switch[aria-checked=true]::after { transform: translateX(24px); }
.switch:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.seg { display: inline-flex; background: var(--cream-2); border-radius: 12px; padding: 4px; gap: 2px; flex: none; }
.seg button { border: 0; background: transparent; cursor: pointer; font-weight: 600; font-size: 16px; color: var(--ink-2); padding: 8px 16px; border-radius: 9px; }
.seg button[aria-checked=true] { background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--line-2); }
.seg button:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.select { height: 46px; border: 0; border-radius: 10px; padding: 0 40px 0 14px; font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231F2A55' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px; flex: none; }
.select:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.mini-courses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mini-course { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-l); background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); text-decoration: none; }
.mini-course .toy { width: 64px; height: 64px; border-radius: 50%; flex: none; }
.mini-course .what { flex: 1; min-width: 0; }
.mini-course b { display: block; font-weight: 600; font-size: 17px; line-height: 1.3; }
.mini-course span { font-size: 15px; color: var(--ink-2); }
.mini-course .bar { background: var(--cream-2); box-shadow: none; margin-top: 6px; height: 8px; }
@media (max-width: 860px) {
  .prof-stats { grid-template-columns: 1fr; gap: 10px; }
  .prof-stats .tile { padding: 14px 18px; }
  .mini-courses { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 600px) {
  .prof-head { gap: 16px; padding-top: 28px; }
  .prof-head .avatar { width: 72px; height: 72px; font-size: 32px; }
  .set { flex-wrap: wrap; padding: 16px 18px; gap: 12px; }
  .set .what { flex-basis: calc(100% - 80px); }
  .set .seg, .set .select { margin-left: 0; }
}

/* reduce motion chosen inside the app (profile switch) */
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; }

/* small screens: shared focused screens */
@media (max-width: 600px) {
  .fbar { height: 64px; gap: 14px; }
  .screen-main { padding-top: 20px; }
  .greet { gap: 12px; }
  .greet .pip { --size: 76px; }
  .actions .btn { width: 100%; }
  .opt { padding: 16px 18px; font-size: 18px; }
}
.course-opt .subj, .course-opt .name { display: block; }
.btn.is-off { --bg: #ECE8E1; --edge: #DAD4CA; --fg: #9A9AAE; pointer-events: none; }
/* round 1 fixes */
.greet .pip { --size: 124px; }
@media (max-width: 600px) { .greet .pip { --size: 84px; } }
.frame svg { padding: 16px 16px 0; }
.plus { background: var(--pip-btn); color: #fff; font-size: 18px; padding: 2px 10px; }
.tile p.big, .stat p.big { color: var(--ink); }
.email-body .ticks + p { margin-top: 16px; }
.course-opt .name { font-size: 22px; }
.linkbox .btn { flex: none; }
.frame svg { background: transparent; }

/* =====================================================================
   AI-1.1 Learning from Examples (pages in ai1/): inbox hook, guess,
   sort piles, training scrubber. Class prefixes ib-, mf-, sb-, tr-.
   ===================================================================== */
.lfoot .note { flex: 1; color: var(--ink-2); font-weight: 500; font-size: 17px; }
.lfoot .btns { display: flex; gap: 12px; }
.lfoot .btns [hidden] { display: none; }
.lfoot .note .link-btn { border: 0; background: transparent; padding: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--pip); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.lfoot .note .link-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
.lfoot .btns .btn { min-width: 150px; }
.lfoot.miss .note, .lfoot.ok .note, .lfoot.wait .note { display: none; }
.btn-calm { --bg: #fff; --edge: var(--line-2); --fg: var(--ink); box-shadow: 0 3px 0 var(--edge), inset 0 0 0 1.5px var(--line-2); }
.btn-calm:hover { box-shadow: 0 4px 0 var(--edge), inset 0 0 0 1.5px var(--line-2); }
.btn-calm:active { box-shadow: 0 0 0 var(--edge), inset 0 0 0 1.5px var(--line-2); }

/* hook: a phone inbox */
.ib-stage { background: var(--violet-soft); box-shadow: none; display: flex; flex-direction: column; align-items: center; }
.lmain .ib-stage { padding: 24px 18px 16px; }
.phone { width: min(440px, 100%); background: #fff; border-radius: 26px; overflow: hidden; box-shadow: 0 0 0 1.5px #E2DDF8, 0 4px 0 #E2DDF8; }
.ph-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1.5px solid var(--line); }
.ph-title { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -0.015em; }
.ph-head b, .ib-fhead b { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; display: inline-grid; place-items: center; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--cream-2); color: var(--ink-2); }
.ib-folder { margin: 2px 10px 10px; border-radius: 16px; background: var(--pip-soft); padding: 10px 12px 10px; }
.ib-fhead { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 16px; color: var(--pip-edge); padding: 0 2px; margin-bottom: 4px; }
.ib-fhead b { background: #fff; color: var(--pip-edge); }
.ib-folder.bump { animation: ib-bump .45s ease; }
@keyframes ib-bump { 40% { transform: scale(1.03); } }
.ib-flist { list-style: none; margin: 0; padding: 0; }
.ib-flist li { margin-top: 6px; padding: 7px 12px; border-radius: 10px; background: #fff; color: var(--pip-edge); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-list { list-style: none; margin: 0; padding: 6px 0 8px; }
.ib-msg {
  display: flex; align-items: center; gap: 12px; padding: 9px 16px; max-height: 84px; overflow: hidden;
  transition: max-height .38s ease, padding .38s ease, opacity .2s ease, background .3s ease;
}
.ib-msg.enter { animation: ib-in .4s cubic-bezier(.2,.7,.3,1) both; animation-delay: var(--d, 0ms); }
@keyframes ib-in { from { opacity: 0; transform: translateY(12px); } }
.ib-av { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 18px; color: #fff; }
.ib-txt { flex: 1; min-width: 0; line-height: 1.3; }
.ib-txt b { display: block; font-weight: 700; font-size: 16px; }
.ib-txt span { display: block; font-size: 16px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-time { font-size: 14px; color: var(--ink-3); align-self: flex-start; margin-top: 1px; font-variant-numeric: tabular-nums; }
.ib-msg.flag { background: var(--pip-soft); }
.ib-msg.flag .ib-txt span { color: var(--pip-edge); }
.ib-msg.gone { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; }
.ib-fly { position: fixed; z-index: 50; margin: 0; pointer-events: none; background: var(--pip-soft); border-radius: 14px; list-style: none; }

/* guess: the sorted inbox, small */
.lmain .mf-stage { padding: 16px; }
.mf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mf { border-radius: 16px; padding: 12px 14px 14px; background: var(--cream); }
.mf h4 { font-family: var(--body); font-weight: 700; font-size: 16px; letter-spacing: 0; line-height: 1.3; display: flex; justify-content: space-between; align-items: center; }
.mf h4 b { font-size: 14px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; display: inline-grid; place-items: center; background: #fff; }
.mf ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.mf li { font-size: 16px; line-height: 1.3; padding: 8px 12px; border-radius: 10px; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf.spam { background: var(--pip-soft); }
.mf.spam h4 { color: var(--pip-edge); }
.mf.spam li { color: var(--pip-edge); }
.choices.stack .choice svg.ico { width: 56px; height: 56px; }
.choice.dim { opacity: .55; }
.hint-link { margin-top: 14px; border: 0; background: transparent; padding: 6px 0; cursor: pointer; font-weight: 600; font-size: 17px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.hint-link:hover { color: var(--ink); text-decoration-color: var(--pip); }
.hint-link:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
.hint-box { margin-top: 14px; padding: 14px 18px; border-radius: 14px; background: var(--sun-soft); font-size: 18px; color: var(--ink); }

/* sort: drag messages into two piles */
.lmain .sb-stage { padding: 16px; }
.sb-tray { display: flex; flex-wrap: wrap; gap: 10px; min-height: 52px; align-content: flex-start; }
.sb-empty { display: none; width: 100%; text-align: center; color: var(--ink-3); font-weight: 600; font-size: 17px; padding: 12px 0; }
.sb-tray.is-empty .sb-empty { display: block; }
.sb-card {
  border: 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  background: #fff; border-radius: 12px; padding: 10px 14px; text-align: left;
  font-family: var(--body); font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 3px 0 var(--line-2);
  transition: box-shadow .15s ease, background .15s ease, opacity .15s ease;
}
.sb-card:hover { background: var(--cream); }
.sb-card:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.sb-card.sel { background: var(--sky-soft); box-shadow: inset 0 0 0 2px #2F86E8, 0 3px 0 #1B62B5; }
.sb-card.lift { opacity: .3; }
.sb-ghost { position: fixed; z-index: 70; margin: 0; pointer-events: none; cursor: grabbing; background: #fff; box-shadow: inset 0 0 0 2px #2F86E8, 0 14px 28px -10px rgba(31,42,85,.35); transform: rotate(-2deg); }
.sb-piles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.sb-pile {
  --c: var(--pip-edge); --soft: var(--pip-soft); --ln: #F6C9B3;
  border-radius: 18px; padding: 12px; min-height: 236px; background: var(--soft); cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; outline: 2px dashed var(--ln); outline-offset: -2px;
  transition: outline-color .15s ease, background .15s ease;
}
.sb-pile.ok { --c: var(--mint-ink); --soft: var(--mint-soft); --ln: #A9E5CB; }
.sb-pile.over, .sb-pile.can { outline-style: solid; outline-color: var(--c); }
.sb-pile:focus-visible { outline: 3px solid var(--sky); }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -0.015em; color: var(--c); }
.sb-head b { font-family: var(--body); font-size: 15px; font-weight: 700; min-width: 28px; height: 28px; padding: 0 9px; border-radius: 14px; display: inline-grid; place-items: center; background: #fff; font-variant-numeric: tabular-nums; }
.sb-pile .sb-card { box-shadow: inset 0 0 0 1.5px var(--ln), 0 2px 0 var(--ln); width: 100%; }
.sb-pile .sb-card.sel { box-shadow: inset 0 0 0 2px #2F86E8, 0 3px 0 #1B62B5; }
.sb-card.wrong { background: #FFFBEF; box-shadow: inset 0 0 0 2.5px var(--sun-edge), 0 3px 0 var(--sun-ink) !important; animation: sb-nudge .4s ease 1; }
@keyframes sb-nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.sb-pile .sb-card.right { box-shadow: inset 0 0 0 1.5px var(--ln), 0 2px 0 var(--ln); }
.sb-drop { margin: auto 0 0; text-align: center; color: var(--c); opacity: .7; font-weight: 600; font-size: 16px; padding: 8px 0 6px; }
.sb-pile.has .sb-drop { display: none; }
.sb-cap { margin-top: 14px; }
.stage.is-won .sb-pile { outline-style: solid; }

/* train: the machine reads your piles */
.lmain .tr-stage { padding: 18px; }
.tr-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; align-items: start; }
.tr-left { position: relative; min-height: 300px; }
.tr-title { font-weight: 700; font-size: 16px; color: var(--ink-2); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.tr-piles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; transition: opacity .3s ease; }
.tr-pile h4 { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; margin: 0 0 8px 2px; }
.tr-pile.s h4 { color: var(--pip-edge); }
.tr-pile.o h4 { color: var(--mint-ink); }
.tr-pile ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tr-msg { font-size: 16px; font-weight: 500; line-height: 1.32; padding: 8px 11px; border-radius: 10px; background: var(--pip-soft); color: var(--ink); transition: box-shadow .2s ease, opacity .25s ease, background .25s ease; }
.tr-pile.o .tr-msg { background: var(--mint-soft); }
.tr-msg.unread { opacity: .5; }
.tr-msg.reading { background: #fff !important; box-shadow: inset 0 0 0 2px var(--violet-ink); opacity: 1; }
.tr-msg.off { box-shadow: inset 0 0 0 2px var(--pip); }
.tr-msg mark { background: transparent; color: inherit; border-radius: 5px; padding: 0 1px; transition: background .25s ease, color .25s ease; }
.tr-msg mark.s { background: #FFD3BF; color: #8A2D0C; font-weight: 700; }
.tr-msg mark.o { background: #BDEBD6; color: #08573C; font-weight: 700; }
.tr-msg mark.n { background: #ECE8E1; font-weight: 700; }
.tr-new { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.tr-left.is-new .tr-piles { opacity: 0; pointer-events: none; }
.tr-left.is-new .tr-new { opacity: 1; pointer-events: auto; }
.tr-new ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tr-new li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease, background .3s ease, box-shadow .3s ease; }
.tr-new li.in { opacity: 1; transform: none; }
.tr-new li .tr-msg { background: transparent; padding: 0; flex: 1; font-size: 17px; }
.tr-new li.s { background: var(--pip-soft); box-shadow: none; }
.tr-new li.o { background: var(--mint-soft); box-shadow: none; }
.tr-new li.flagged { box-shadow: inset 0 0 0 2px var(--pip); }
.tr-tag { flex: none; font-weight: 700; font-size: 15px; padding: 4px 12px; border-radius: 999px; background: #fff; white-space: nowrap; }
.tr-new li.s .tr-tag { color: var(--pip-edge); }
.tr-new li.o .tr-tag { color: var(--mint-ink); }
.tr-why { margin-top: 12px; font-size: 16px; color: var(--ink-2); }
.tr-side { background: var(--violet-soft); border-radius: 18px; padding: 14px 16px 16px; }
.tr-side .tr-title { color: var(--violet-ink); }
.tr-axis { display: grid; grid-template-columns: 84px 1fr 1fr; font-size: 14px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.tr-axis span:nth-child(2) { text-align: left; color: var(--mint-ink); }
.tr-axis span:nth-child(3) { text-align: right; color: var(--pip-edge); }
.tr-row { display: grid; grid-template-columns: 84px 1fr; align-items: center; height: 32px; transition: opacity .3s ease; }
.tr-word { font-weight: 700; font-size: 16px; white-space: nowrap; }
.tr-bar { position: relative; height: 14px; border-radius: 7px; background: #fff; }
.tr-bar::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #D9D3F2; border-radius: 1px; }
.tr-bar i { position: absolute; top: 0; bottom: 0; width: 0; transition: width .3s ease; }
.tr-bar i.s { left: 50%; background: var(--pip); border-radius: 0 7px 7px 0; }
.tr-bar i.o { right: 50%; background: var(--mint-btn); border-radius: 7px 0 0 7px; }
.tr-side.clues .tr-row.weak { opacity: .38; }
.tr-sum { margin-top: 10px; font-size: 16px; color: var(--ink-2); min-height: 2.6em; }
.tr-sum b { color: var(--ink); }
.scrub { margin-top: 18px; padding: 16px 20px 12px; border-radius: var(--r-l); background: #fff; box-shadow: 0 0 0 1.5px var(--line); }
.scrub-top { display: flex; align-items: center; gap: 16px; }
.scrub-top input { flex: 1; }
.scrub-marks { position: relative; height: 26px; margin: 2px 72px 0 0; }
.scrub-marks span { position: absolute; top: 0; transform: translateX(-50%); font-weight: 600; font-size: 15px; color: var(--ink-3); white-space: nowrap; transition: color .2s ease; }
.scrub-marks span::before { content: ""; position: absolute; left: 50%; top: -6px; width: 2px; height: 6px; margin-left: -1px; background: var(--line-2); }
.scrub-marks span:first-child { transform: none; }
.scrub-marks span:first-child::before { left: 13px; }
.scrub-marks span:last-child { transform: translateX(-60%); }
.scrub-marks span.on { color: var(--violet-ink); }
.scrub .btn-small { min-width: 72px; padding: 8px 14px; }

@media (max-width: 760px) {
  .tr-grid { grid-template-columns: 1fr; gap: 14px; }
  .tr-left { min-height: 0; }
  .tr-left.is-new .tr-piles { display: none; }
  .tr-new { position: static; display: none; }
  .tr-left.is-new .tr-new { display: block; }
  .tr-wrap { display: flex; flex-direction: column; }
  .tr-wrap .scrub { order: -1; margin: 14px 0 0; position: sticky; top: 0; z-index: 5; box-shadow: 0 0 0 1.5px var(--line), 0 10px 18px -14px rgba(31,42,85,.35); }
  .tr-wrap .stage { margin-top: 14px; }
}
@media (max-width: 600px) {
  .lmain .ib-stage { padding: 12px 10px 10px; }
  .phone { border-radius: 20px; }
  .ib-msg { padding: 8px 12px; gap: 10px; }
  .ib-av { width: 38px; height: 38px; font-size: 16px; }
  .ib-txt b, .ib-txt span { font-size: 15px; }
  .ph-head { padding: 12px 14px 10px; }
  .ib-folder { margin: 2px 6px 6px; }
  .mf-row { gap: 8px; }
  .mf { padding: 10px 10px 12px; }
  .mf li { font-size: 14px; padding: 6px 9px; }
  .mf h4 { font-size: 15px; }
  .choices.stack .choice svg.ico { width: 44px; height: 44px; }
  .lmain .sb-stage, .lmain .tr-stage { padding: 12px; }
  .sb-tray { gap: 8px; }
  .sb-card { font-size: 15px; padding: 8px 11px; border-radius: 10px; }
  .sb-piles { gap: 8px; }
  .sb-pile { padding: 10px 8px; min-height: 200px; gap: 6px; border-radius: 16px; }
  .sb-head { font-size: 19px; }
  .tr-msg { font-size: 14px; padding: 7px 9px; }
  .tr-pile h4 { font-size: 17px; }
  .tr-axis, .tr-row { grid-template-columns: 76px 1fr; }
  .tr-axis { grid-template-columns: 76px 1fr 1fr; }
  .tr-word { font-size: 15px; }
  .tr-row { height: 30px; }
  .tr-new li .tr-msg { font-size: 16px; }
  .scrub { padding: 12px 14px 8px; }
  .scrub-marks { margin-right: 0; }
  .scrub-marks span { font-size: 13px; }
  .scrub .btn-small { display: none; }
  .lfoot .btns { width: 100%; }
  .lfoot .btns .btn { flex: 1; min-width: 0; }
  .lfoot .note { font-size: 16px; }
  .ai1 .lmain { padding-bottom: 300px; }
  .mf li { white-space: normal; }
}
.sb-stage.is-won .sb-tray, .sb-stage.is-checked .sb-tray.is-empty { display: none; }
.sb-stage.is-won .sb-piles, .sb-stage.is-checked .sb-tray.is-empty + .sb-piles { margin-top: 0; }
