/* MathsPath — exercise-book clarity, mastery squares as the signature */
:root {
  --paper: #F6F8FB; --card: #FFFFFF; --ink: #1D2B4F; --ink-2: #4E5B78; --ink-3: #7D88A1; --line: #DDE3EC;
  --blue: #2B59C3; --blue-2: #1E44A0; --blue-soft: #E8EEFB; --green: #2E8B6A; --red: #C8433A; --red-soft: #FBEAE8;
  --amber: #E8A93A; --l0: #E3E8EC; --l1: #F6C9A8; --l2: #F2D16B; --l3: #7CC4A0; --l4: #2E8B6A;
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.55 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid #F2B640; outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: .88rem; }
.err { background: var(--red-soft); color: #8E241D; border-left: 4px solid var(--red); padding: .6em .9em; border-radius: 6px; }
.ok-msg { background: #E7F4EE; border-left: 4px solid var(--green); padding: .6em .9em; border-radius: 6px; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: grid; gap: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
label { display: grid; gap: .3rem; font-weight: 500; font-size: .93rem; }
label.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: .3em; width: 1.05em; height: 1.05em; accent-color: var(--blue); }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1.5px solid #C9D2DF; border-radius: 9px; padding: .55em .7em; min-width: 0; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,89,195,.18); }
textarea { resize: vertical; }

.btn { --b: #fff; --t: var(--ink); --bd: #C9D2DF; display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font: 600 .95rem var(--font); padding: .55em 1.05em; border-radius: 10px; border: 1.5px solid var(--bd); background: var(--b);
  color: var(--t); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { --bd: var(--ink-3); }
.btn.primary { --b: var(--blue); --t: #fff; --bd: var(--blue); }
.btn.primary:hover { --b: var(--blue-2); --bd: var(--blue-2); }
.btn.go { --b: var(--green); --t: #fff; --bd: var(--green); }
.btn.danger { --b: transparent; --t: var(--red); --bd: transparent; }
.btn.danger:hover { --b: var(--red-soft); }
.btn.ghost { --b: transparent; --bd: transparent; --t: var(--blue); }
.btn.ghost:hover { --b: var(--blue-soft); }
.btn.big { padding: .75em 1.4em; font-size: 1.05rem; }
.btn.small { padding: .3em .7em; font-size: .84rem; }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }

/* top bar */
.top { background: var(--ink); color: #fff; }
.top-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 1.6rem; padding: .7rem clamp(16px, 3vw, 28px); flex-wrap: wrap; }
.brand { display: flex; gap: .55rem; align-items: center; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand i { display: grid; grid-template-columns: repeat(2, 9px); gap: 3px; }
.brand i b { width: 9px; height: 9px; border-radius: 2.5px; }
.top nav { display: flex; gap: 1.2rem; flex: 1; flex-wrap: wrap; }
.top nav a, .top .linkbtn { color: #C3CCE0; text-decoration: none; font-weight: 500; }
.top nav a:hover, .top nav a[aria-current] { color: #fff; }
.top nav a[aria-current] { box-shadow: inset 0 -2px 0 #F2B640; }
.top .me { display: flex; gap: 1rem; align-items: center; color: #C3CCE0; font-size: .9rem; }
.pill { display: inline-flex; gap: .35em; align-items: center; font-size: .82rem; font-weight: 600; padding: .15em .65em; border-radius: 99px; background: var(--blue-soft); color: var(--blue-2); white-space: nowrap; }
.top .pill { background: rgba(255,255,255,.12); color: #fff; }
.pill.warn { background: #FCF1DC; color: #8A5B00; } .pill.bad { background: var(--red-soft); color: #8E241D; } .pill.good { background: #E1F2EA; color: #1F6B50; }
.flash { max-width: 1200px; margin: 1rem auto 0; padding: 0 clamp(16px, 3vw, 28px); }
.flash div { padding: .7rem 1rem; border-radius: 10px; background: #E7F4EE; border-left: 4px solid var(--green); }
.flash .err { background: var(--red-soft); border-left-color: var(--red); }

.wrap { max-width: 1200px; margin: 0 auto; padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 28px) 64px; }
.narrow { max-width: 480px; margin: 0 auto; padding: clamp(28px, 6vw, 64px) 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem 1.3rem; }
.card + .card { margin-top: 1rem; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.head h1 { margin: 0; }
.crumbs { font-size: .88rem; color: var(--ink-3); margin-bottom: .4rem; }
.crumbs a { color: var(--ink-2); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.6rem; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: .3rem; border-bottom: 1.5px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--ink-2); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--blue); }
table.t { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.t th, .t td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { font-size: .82rem; font-weight: 600; color: var(--ink-2); background: #FAFBFD; }
.t tr:last-child td { border-bottom: 0; }
.empty { padding: 1.4rem; color: var(--ink-2); background: #fff; border: 1.5px dashed var(--line); border-radius: var(--r); }

/* mastery squares (the signature) */
.sq { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--l0); vertical-align: middle; flex: none; }
.sq.l1 { background: var(--l1); } .sq.l2 { background: var(--l2); } .sq.l3 { background: var(--l3); } .sq.l4 { background: var(--l4); }
.sq.l4 { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.squares { display: flex; flex-wrap: wrap; gap: 4px; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); }
.legend span { display: inline-flex; gap: .4rem; align-items: center; }
.bar { height: 10px; border-radius: 99px; background: var(--l0); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }

/* landing */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; max-width: 1200px; margin: 0 auto; padding: clamp(32px, 7vw, 88px) clamp(16px, 3vw, 28px); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; }
.hero .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 34rem; }
.hero-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; }
.hero-grid b { aspect-ratio: 1; border-radius: 7px; background: var(--l0); animation: fillin .5s ease-out both; }
@keyframes fillin { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-grid b { animation: none; } }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }

/* courses & skills */
.course-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.course-tile { display: grid; gap: .5rem; padding: 1.1rem 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.course-tile:hover { border-color: var(--blue); }
.course-tile b { font-size: 1.05rem; }
.unit { background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 1rem; }
.unit-h { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.unit-h h2 { margin: 0; font-size: 1.15rem; }
.skills { list-style: none; margin: 0; padding: .4rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.skills a { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 1.2rem; text-decoration: none; color: var(--ink); border-radius: 8px; }
.skills a .sq { margin-top: .3rem; }
.skills .sk { display: grid; line-height: 1.3; }
.skills a:hover { background: var(--blue-soft); }
.skills small { color: var(--ink-3); font-size: .78rem; }
.level-badge { display: inline-flex; gap: .5rem; align-items: center; font-weight: 600; }

/* worksheet cards & question cards */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.ws-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: var(--ink); display: grid; }
.ws-card:hover { border-color: var(--blue); }
.ws-card .thumb { aspect-ratio: 4/3; background: #EEF1F5 center top / cover no-repeat; border-bottom: 1px solid var(--line); }
.ws-card .meta { padding: .7rem .85rem; display: grid; gap: .3rem; }
.ws-card .meta b { font-size: .97rem; }
.qimg { max-width: 100%; display: block; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qlist { display: grid; gap: 1rem; }
.qcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2rem; }
.qcard.published { border-left: 5px solid var(--green); }
.qcard.lowconf { border-left: 5px solid var(--amber); }
@media (max-width: 900px) { .qcard { grid-template-columns: 1fr; } }
.qcard .fields { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .8rem; align-content: start; }
.qcard .fields .full { grid-column: 1 / -1; }
.qcard textarea { font-size: .9rem; }
.math-prev { font-size: .92rem; background: #FAFBFD; border: 1px dashed var(--line); border-radius: 8px; padding: .5rem .7rem; min-height: 2rem; overflow-x: auto; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.tagline { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .8rem; }
.tagline span { background: #F0F3F8; color: var(--ink-2); padding: .1em .55em; border-radius: 6px; }
.progress-box { text-align: center; padding: 3rem 1rem; }
.spinner { width: 46px; height: 46px; margin: 0 auto 1rem; border-radius: 10px; background: var(--l2); animation: spin 1.6s infinite ease-in-out; }
@keyframes spin { 0% { transform: rotate(0); background: var(--l1); } 50% { transform: rotate(180deg); background: var(--l3); } 100% { transform: rotate(360deg); background: var(--l1); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* crop editor */
.crop-dlg { border: 0; border-radius: 14px; padding: 0; width: min(960px, 96vw); max-height: 94vh; }
.crop-dlg::backdrop { background: rgba(20,28,48,.55); }
.crop-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.crop-body { overflow: auto; max-height: calc(94vh - 120px); background: #EEF1F5; padding: 12px; }
.crop-page { position: relative; margin: 0 auto 12px; width: 100%; max-width: 860px; user-select: none; }
.crop-page img { width: 100%; display: block; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.crop-page .pn { position: absolute; left: -2px; top: -2px; background: var(--ink); color: #fff; font-size: .75rem; padding: 2px 7px; border-radius: 0 0 6px 0; }
.box { position: absolute; border: 2.5px solid var(--blue); background: rgba(43,89,195,.10); cursor: move; touch-action: none; }
.box .h { position: absolute; width: 16px; height: 16px; background: var(--blue); border: 2px solid #fff; border-radius: 4px; touch-action: none; }
.box .h.tl { left: -9px; top: -9px; cursor: nwse-resize; } .box .h.br { right: -9px; bottom: -9px; cursor: nwse-resize; }
.box .h.tr { right: -9px; top: -9px; cursor: nesw-resize; } .box .h.bl { left: -9px; bottom: -9px; cursor: nesw-resize; }
.box .x { position: absolute; right: 4px; top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: .8rem; padding: 0 .4rem; }
.box .n { position: absolute; left: 4px; top: 4px; background: var(--blue); color: #fff; font-size: .75rem; padding: 0 .4rem; border-radius: 4px; }

/* runner */
.runner { max-width: 860px; margin: 0 auto; }
.run-top { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots button { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid #C9D2DF; background: #fff; font: 600 .8rem var(--font); color: var(--ink-2); cursor: pointer; }
.dots button.cur { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 2px rgba(43,89,195,.2); }
.dots button.ok { background: var(--l3); border-color: var(--l3); color: #0E3D2C; }
.dots button.no { background: var(--red-soft); border-color: #EBB3AE; color: #8E241D; }
.dots button.saved { background: var(--blue-soft); border-color: #B9C9F0; color: var(--blue-2); }
.dots button.pending { background: #FCF1DC; border-color: #F1D49B; }
.qbox { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.6rem); }
.qmeta { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.qtext { font-size: 1.05rem; overflow-x: auto; padding: .35em 0; }
.qtext img { max-width: 100%; }
.answer-row { display: flex; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; align-items: stretch; }
.answer-row input { flex: 1 1 220px; font-size: 1.15rem; padding: .65em .8em; }
.mkeys { display: flex; gap: 4px; flex-wrap: wrap; margin-top: .5rem; }
.mkeys button { min-width: 38px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #F7F9FC; font: 500 1rem var(--font); cursor: pointer; }
.choices { display: grid; gap: .5rem; margin-top: 1rem; }
.choices button { text-align: left; display: flex; gap: .8rem; align-items: center; padding: .7rem .9rem; border-radius: 10px; border: 1.5px solid #C9D2DF; background: #fff; font: inherit; cursor: pointer; }
.choices button b { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: #EEF2F8; flex: none; }
.choices button.sel { border-color: var(--blue); background: var(--blue-soft); }
.result { margin-top: 1rem; padding: .8rem 1rem; border-radius: 10px; font-weight: 600; display: flex; gap: .6rem; align-items: center; }
.result.ok { background: #E1F2EA; color: #1F6B50; } .result.no { background: var(--red-soft); color: #8E241D; } .result.info { background: var(--blue-soft); color: var(--blue-2); }
.helpbox { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; background: #FAFBFD; border: 1px solid var(--line); }
.helpbox h3 { font-size: .9rem; color: var(--ink-2); margin-bottom: .3rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1rem; }
.timer.low { color: var(--red); }
.summary { text-align: center; padding: 2rem 1rem; }
.summary .big { font-size: 3rem; font-weight: 700; letter-spacing: -0.03em; }
.lvl-change { display: inline-flex; gap: .7rem; align-items: center; font-size: 1.1rem; font-weight: 600; margin: .6rem 0; }
.steps { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .3rem; }
.steps li { display: flex; gap: .5rem; } .steps li::before { content: "✓"; color: var(--green); font-weight: 700; } .steps li.bad::before { content: "✗"; color: var(--red); }
.photos { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; } .photos img { height: 90px; border-radius: 6px; border: 1px solid var(--line); }

/* class grid */
.mgrid { overflow-x: auto; }
.mgrid table { border-collapse: separate; border-spacing: 3px; }
.mgrid th { font-size: .75rem; font-weight: 500; color: var(--ink-2); text-align: left; max-width: 120px; vertical-align: bottom; padding: 4px; }
.mgrid th.rot { height: 140px; white-space: nowrap; }
.mgrid th.rot div { transform: rotate(-55deg); transform-origin: left bottom; width: 26px; translate: 14px -6px; }
.mgrid td.name { white-space: nowrap; padding-right: .8rem; font-size: .9rem; }
.mgrid td.c { width: 30px; height: 26px; border-radius: 5px; background: var(--l0); }
.cell-ok { background: #E1F2EA !important; } .cell-no { background: var(--red-soft) !important; } .cell-part { background: #FCF1DC !important; } .cell-wait { background: var(--blue-soft) !important; }
.logins { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.slip { border: 1.5px dashed #A9B4C7; border-radius: 10px; padding: .8rem 1rem; background: #fff; break-inside: avoid; }
.slip b { display: block; font-size: 1.05rem; } .slip code { font-size: 1rem; }
@media print { .top, .noprint, .flash { display: none !important; } body { background: #fff; } .wrap { padding: 0; } }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #F0F3F8; padding: .05em .35em; border-radius: 5px; }
.katex { font-size: 1.05em; }

/* revision */
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.grade-tile { --c: var(--blue); position: relative; display: grid; gap: .15rem; padding: 1.1rem 1.1rem 1rem; min-height: 132px; align-content: end;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); overflow: hidden; }
.grade-tile::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 6px; background: var(--c); }
.grade-tile.g-dp { --c: var(--green); }
.grade-tile:hover { border-color: var(--c); box-shadow: 0 6px 18px rgba(29,43,79,.08); }
.grade-tile .gname { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.grade-tile .gsub { font-size: .8rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.grade-tile .gcount { font-size: .85rem; color: var(--ink-2); margin-top: .35rem; }
.seg { display: flex; gap: .3rem; flex-wrap: wrap; }
.seg a { padding: .35em .85em; border-radius: 99px; border: 1.5px solid #C9D2DF; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .9rem; background: #fff; }
.seg.small a { font-size: .8rem; padding: .2em .7em; }
.seg a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .8rem; }
.rgrid.pad { padding: 1rem 1.2rem; }
.rcard { display: flex; gap: .8rem; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); overflow: hidden; position: relative; }
.rcard:hover { border-color: var(--blue); }
.rcard.draft { opacity: .7; border-style: dashed; }
.rcard-k { width: 6px; flex: none; background: var(--ink-3); }
.k-builder { background: var(--blue); } .k-html { background: #8A55C9; } .k-file { background: var(--amber); } .k-video { background: var(--red); } .k-link { background: var(--ink-3); }
.rcard-b { display: grid; gap: .3rem; padding: .8rem .9rem .85rem 0; flex: 1; min-width: 0; }
.rcard-b b { font-size: .98rem; line-height: 1.3; }
.rcard-b small { color: var(--ink-3); font-size: .8rem; line-height: 1.35; }
.rcard .tick { position: absolute; right: .6rem; top: .55rem; width: 24px; height: 24px; border-radius: 7px; background: var(--l3); color: #0E3D2C; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.rcard.done { background: #F6FBF8; }
.rk { font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .12em .5em; border-radius: 5px; background: #EEF1F5; color: var(--ink-2); }
.rk-builder { background: var(--blue-soft); color: var(--blue-2); } .rk-html { background: #F1E9FA; color: #5E2F99; } .rk-file { background: #FCF1DC; color: #8A5B00; } .rk-video { background: var(--red-soft); color: #8E241D; }
.lv { font-size: .72rem; font-weight: 600; padding: .12em .55em; border-radius: 5px; }
.lv1 { background: #E1F2EA; color: #1F6B50; } .lv2 { background: #FCF1DC; color: #8A5B00; } .lv3 { background: var(--red-soft); color: #8E241D; }
.lvh { margin: 1.6rem 0 .7rem; font-size: 1rem; } .lvh .lv { font-size: .9rem; padding: .25em .8em; }
.rdot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C9D2DF; flex: none; margin-top: .3rem; }
.rdot.some { border-color: var(--blue); } .rdot.full { border-color: var(--green); background: var(--green); }
.wrap.wide { max-width: 1500px; }
.viewer-bar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; padding: .6rem .9rem; background: #fff; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; }
.docframe, .htmlframe { width: 100%; height: 80vh; min-height: 480px; border: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); background: #fff; display: block; resize: vertical; }
.htmlwrap:fullscreen { background: #fff; display: flex; flex-direction: column; }
.htmlwrap:fullscreen .htmlframe { flex: 1; height: auto; border-radius: 0; }
.vid { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--r); overflow: hidden; }
.vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rs-bar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; position: sticky; top: 0; z-index: 2; background: var(--paper); padding: .6rem 0; }
.rs-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.rs-q { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 2.5vw, 1.4rem); }
.rs-q[data-status=ok] { border-left: 5px solid var(--l3); } .rs-q[data-status=again] { border-left: 5px solid var(--amber); }
.rs-h { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.rs-num { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.rs-st { margin-left: auto; }
.rs-btns { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1rem; }
.rs-btns .btn.on { --b: var(--blue-soft); --bd: var(--blue); --t: var(--blue-2); }
.helpbox.sol { background: #FFFDF6; border-color: #F1E2B5; }
.rs-check { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.rs-check .btn.warn-on { --b: #FCF1DC; --bd: var(--amber); --t: #8A5B00; }
.kinds { border: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.kinds legend { font-weight: 600; padding: 0 .3rem; }
.kind { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .85rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400; }
.kind:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.kind:has(input:disabled) { opacity: .45; cursor: default; }
.kind input { margin-top: .3em; }
.kind span { display: grid; gap: .2rem; } .kind small { color: var(--ink-2); font-size: .8rem; line-height: 1.35; }
.lbl { display: block; font-weight: 500; font-size: .93rem; margin-bottom: .4rem; }
.chipbox { padding: .35em .75em; border: 1.5px solid #C9D2DF; border-radius: 99px; background: #fff; align-items: center !important; }
.chipbox:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.chipbox input { margin-top: 0 !important; }
.bq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.bq { display: grid; gap: .7rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #FAFBFD; }
.bq-img img { max-height: 160px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.home-rev { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.home-rev a { display: grid; place-items: center; padding: .8rem .3rem; border-radius: 10px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; text-align: center; border-top: 4px solid var(--blue); }
.home-rev a.dp { border-top-color: var(--green); }
.home-rev a:hover { border-color: var(--blue); }
@media (max-width: 640px) { .home-rev { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pastezone { border: 2px dashed #B9C9F0; background: var(--blue-soft); border-radius: 12px; padding: 1rem 1.1rem; }
.pastezone.over { border-color: var(--blue); background: #DCE6FB; }
kbd { font: 600 .8em var(--font); background: #fff; border: 1px solid #C9D2DF; border-bottom-width: 2px; border-radius: 5px; padding: .05em .4em; }
.bq-status { color: var(--blue-2); font-weight: 500; } .bq-status.err { padding: .4em .7em; }
.qdots { display: flex; gap: 3px; flex-wrap: wrap; max-width: 260px; }
.qdots i, .qd { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--l0); }
.qdots i.ok, .qd.ok { background: var(--l3); } .qdots i.again, .qd.again { background: var(--amber); }
.importbox { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; background: #fff; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.plan { display: grid; gap: .4rem; align-content: start; margin: 0 !important; }
.plan.best { border: 2px solid var(--green); }
.plan .pill { justify-self: start; }
.plan .price { font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.plan .price span { font-size: 1rem; font-weight: 500; color: var(--ink-2); }
.ppbox { margin-top: .6rem; min-height: 48px; }
.lockcard { text-align: center; padding: 2.5rem 1.2rem; }
.lock { font-size: .8rem; }
.marked { margin: .8rem 0; } .marked h3 { margin: 0 0 .4rem; font-size: .95rem; color: #B3262E; }
.marked > a img { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .5rem; background: #fff; }
.shots { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; text-align: left; }
.shot { display: grid; gap: .35rem; justify-items: start; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; }
.shot img { width: 100%; height: 120px; object-fit: contain; background: #F4F6F9; border-radius: 6px; }
.shot .small { word-break: break-all; }
.kind .pill { justify-self: start; }
.work-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .8rem 0; }
.skills small .qn { color: var(--green); font-weight: 600; }
/* ranks & leaderboard */
.rankpill { text-decoration: none; color: #fff; background: color-mix(in srgb, var(--rc) 55%, #1D2B4F); border: 1px solid color-mix(in srgb, var(--rc) 70%, #fff); }
.rankup { position: fixed; z-index: 50; left: 50%; top: 76px; transform: translateX(-50%); display: flex; gap: .9rem; align-items: center;
  background: #fff; border: 2px solid var(--rc); border-radius: 16px; padding: .8rem 1rem; box-shadow: 0 14px 40px rgba(29,43,79,.22);
  animation: rankpop .5s cubic-bezier(.2,1.6,.4,1); max-width: calc(100vw - 32px); }
.rankup .ri { font-size: 2.2rem; } .rankup b { display: block; } .rankup span { font-size: .9rem; color: var(--ink-2); }
.rankup button { border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: var(--ink-3); }
@keyframes rankpop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
.rankcard { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 1rem 1.2rem; border-left: 6px solid var(--rc); }
.rankcard .ri { font-size: 2.6rem; line-height: 1; }
.rankbar { height: 10px; border-radius: 6px; background: var(--l0); overflow: hidden; margin: .45rem 0 .25rem; }
.rankbar i { display: block; height: 100%; background: var(--rc); border-radius: 6px; }
.lb { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.lb td, .lb th { padding: .6rem .8rem; border-bottom: 1px solid var(--line); text-align: left; }
.lb th { font-size: .82rem; color: var(--ink-2); font-weight: 500; background: #FAFBFD; }
.lb td.pl { width: 3.2rem; font-weight: 700; text-align: center; font-size: 1.05rem; }
.lb td.pts { text-align: right; font-weight: 700; white-space: nowrap; }
.lb tr.me td { background: #FFF6DC; }
.lb .rk { display: inline-flex; gap: .3rem; align-items: center; font-size: .85rem; color: var(--rc); font-weight: 600; white-space: nowrap; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: .8rem; align-items: end; margin: 1.2rem 0 1.4rem; max-width: 620px; }
.podium div { background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 6px 6px; text-align: center; padding: .9rem .5rem; }
.podium .p1 { padding-top: 1.6rem; border-color: #E8C35A; background: #FFF9E6; } .podium .medal { font-size: 2rem; display: block; }
.podium b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .podium small { color: var(--ink-2); }
.ranklist { display: flex; flex-wrap: wrap; gap: .4rem; }
.ranklist span { font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .6rem; background: #fff; }
.ranklist span.on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 14%, #fff); font-weight: 600; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tscroll .t { min-width: 860px; }
.addteacher { margin-bottom: 1.2rem; } .addteacher h2 { margin: 0 0 .6rem; font-size: 1.15rem; }
.addteacher label:not(.check) { flex: 1 1 200px; margin: 0; } .addteacher .check { margin: 0 0 .6rem; }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn.no { background: #fff; border-color: var(--red); color: var(--red); }
.selfmark .row { gap: .5rem; }
/* guest practice */
.guest-note { background: var(--blue-soft, #EAF1FF); border-radius: 12px; padding: .7rem 1rem; margin: 0 0 1rem; font-size: .92rem; }
.guest-prompt { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); z-index: 70;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.18); padding: .9rem 1rem;
  display: flex; gap: .8rem 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.guest-prompt > div:first-child { display: grid; gap: .2rem; flex: 1 1 260px; } .guest-prompt span { font-size: .88rem; color: var(--ink-2); }

/* help on a question: teacher's answers, ask the teacher, AI helper (v18) */
.help-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.teacher-ans { background: #F3FBF6; border-color: #CBE9D6; }
.ask-ans { padding: .5rem 0; border-top: 1px dashed var(--line); }
.ask-ans:first-of-type { border-top: 0; padding-top: .2rem; }
.aichat .chat { display: flex; flex-direction: column; gap: .5rem; max-height: 420px; overflow-y: auto; margin: .4rem 0; }
.aichat .msg { padding: .55rem .8rem; border-radius: 12px; max-width: 88%; line-height: 1.5; overflow-wrap: anywhere; }
.aichat .msg.user { align-self: flex-end; background: var(--blue-soft); color: var(--ink); }
.aichat .msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.aichat .msg .katex-display { overflow-x: auto; overflow-y: hidden; }
.chat-in { display: flex; gap: .5rem; }
.chat-in input { flex: 1; min-width: 0; }
.navbadge { display: inline-block; min-width: 1.3em; padding: 0 .35em; margin-left: .2em; border-radius: 99px; background: #E5484D; color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.4; }
.ask-card .ask-q { padding: .7rem .9rem; background: #FAFBFD; border: 1px solid var(--line); border-radius: 10px; margin-top: .5rem; }
.ask-card .ask-q img { max-width: 100%; max-height: 260px; display: block; margin-bottom: .5rem; }
.answered-card { border-color: #CBE9D6; background: #F3FBF6; }
@media (max-width: 700px) { .aichat .msg { max-width: 100%; } .aichat .chat { max-height: 55vh; } }

/* v19: animated AI helper */
.aichat { position: relative; overflow: hidden; }
.ai-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.ai-pick { display: inline-flex; gap: .2rem; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 2px; }
.ai-pick button { border: 0; background: none; font-size: 1.15rem; width: 2rem; height: 2rem; border-radius: 99px; cursor: pointer; line-height: 1; }
.ai-pick button.on { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue, #2F5BD3); }
.ai-stage { display: grid; grid-template-columns: 150px 1fr; gap: .8rem; align-items: end; }
.ai-av-slot { height: 300px; position: relative; z-index: 2; }
.ai-av { width: 100%; height: 100%; }
.ai-main { min-width: 0; }
.aichat .msg .say { border: 0; background: none; cursor: pointer; font-size: .9rem; padding: 0 0 0 .2rem; opacity: .55; vertical-align: baseline; }
.aichat .msg .say:hover { opacity: 1; }
@media (max-width: 700px) { .ai-stage { grid-template-columns: 78px 1fr; gap: .5rem; } .ai-av-slot { height: 160px; } .ai-head .small { flex-basis: 100%; order: 3; } }

/* v19: welcome guide on the landing page */
.guide { position: fixed; right: 24px; bottom: 0; z-index: 50; display: flex; align-items: flex-end; gap: .4rem; pointer-events: none; }
.guide > * { pointer-events: auto; }
.guide-av { width: 150px; height: 300px; }
.guide-bubble { position: relative; margin-bottom: 230px; max-width: 300px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 18px 18px 4px 18px; padding: .9rem 1rem; box-shadow: 0 12px 34px rgba(20,30,60,.18); font-size: .98rem; line-height: 1.45; opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .35s, transform .35s; }
.guide-bubble.show { opacity: 1; transform: none; }
.guide-bubble .row { margin-top: .7rem; gap: .4rem; }
.guide-x { position: absolute; top: .35rem; right: .45rem; border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--muted, #667); line-height: 1; }
@media (max-width: 700px) { .guide { right: 8px; } .guide-av { width: 92px; height: 184px; } .guide-bubble { margin-bottom: 140px; max-width: min(250px, calc(100vw - 120px)); font-size: .92rem; padding: .75rem .85rem; } }
.chat-in .mic { padding-left: .7rem; padding-right: .7rem; font-size: 1.1rem; }
.chat-in .mic.on { background: #E5484D; border-color: #E5484D; color: #fff; animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229,72,77,.45); } 50% { box-shadow: 0 0 0 8px rgba(229,72,77,0); } }

/* v22: visitor stats */
.vstats > .card { margin: 0; }
.vstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.vbig { font-size: 2.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vlist { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .3rem; font-size: .95rem; }
.vchart { width: 100%; height: auto; max-height: 260px; display: block; }
.vchart rect { fill: #9FB4EA; } .vchart rect.today { fill: #2F5BD3; } .vchart rect:hover { fill: #2F5BD3; }
.vchart .vaxis { stroke: #C9D1E3; } .vchart .vlab { font-size: 11px; font-weight: 700; fill: #1D2233; } .vchart .vday { font-size: 10px; fill: #667; }
.counter-line { margin-top: 1rem; font-size: 1.05rem; } .counter-line b { font-variant-numeric: tabular-nums; }

/* ===================== RiyaziYol: welcome, topics, lesson ===================== */
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--blue); margin: 0 0 .4rem; }
.welcome { overflow-x: clip; }
.w-hero { max-width: 1200px; margin: 0 auto; padding: clamp(28px, 6vw, 80px) clamp(16px, 3vw, 28px) clamp(20px, 4vw, 48px); display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; }
.w-hero h1 { font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; margin-bottom: .35em; }
.w-hero .grad { background: linear-gradient(100deg, #2B59C3 0%, #7B4DD8 55%, #E0567A 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.w-hero .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 32rem; }
.w-art { position: relative; aspect-ratio: 1 / .9; }
.w-art .tile { position: absolute; display: grid; place-items: center; padding: .9rem 1.2rem; border-radius: 18px; background: #fff; font-weight: 700; font-size: clamp(1rem, 2.2vw, 1.5rem);
  box-shadow: 0 14px 40px rgba(29,43,79,.12), 0 2px 6px rgba(29,43,79,.06); animation: floaty 6s ease-in-out infinite; }
.w-art .t1 { left: 4%; top: 6%; color: #2B59C3; } .w-art .t2 { left: 52%; top: 0; background: #2B59C3; color: #fff; animation-delay: -1s; }
.w-art .t3 { left: 30%; top: 30%; color: #C8433A; animation-delay: -2s; font-size: clamp(1.2rem, 3vw, 2rem); } .w-art .t4 { left: 74%; top: 28%; color: #7B4DD8; animation-delay: -3s; }
.w-art .t5 { left: 0; top: 52%; background: #F2D16B; animation-delay: -4s; } .w-art .t6 { left: 46%; top: 60%; color: #2E8B6A; animation-delay: -2.5s; }
.w-art .t7 { left: 18%; top: 78%; color: #E0567A; animation-delay: -1.5s; } .w-art .t8 { left: 70%; top: 82%; background: #2E8B6A; color: #fff; animation-delay: -3.5s; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }
@media (prefers-reduced-motion: reduce) { .w-art .tile { animation: none; } }
.w-path, .w-topics, .w-acc { max-width: 1200px; margin: 0 auto; padding: 1.5rem clamp(16px, 3vw, 28px); }
.path4 { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: s; }
.path4 li { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; position: relative; }
.path4 li b { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 1.05rem; margin-bottom: .6rem; }
.path4 li:nth-child(2) b { background: #F1EBFC; color: #7B4DD8; } .path4 li:nth-child(3) b { background: #FDEBF0; color: #D0456B; } .path4 li:nth-child(4) b { background: #E7F4EE; color: var(--green); }
.path4 h3 { margin: 0 0 .3rem; } .path4 p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.chapters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; margin-top: 1rem; }
.chapter { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.2rem 1.2rem .6rem; border-top: 6px solid var(--cc, var(--blue)); }
.chapter.c1 { --cc: #2B59C3; } .chapter.c2 { --cc: #7B4DD8; } .chapter.c3 { --cc: #E0567A; } .chapter.c4 { --cc: #2E8B6A; }
.chapter h2, .chapter h3 { display: flex; align-items: center; gap: .6rem; }
.chnum { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; border-radius: 10px; background: var(--cc); color: #fff; font-size: 1rem; }
.tlist { list-style: none; padding: 0; margin: .4rem 0 0; }
.tlist a { display: flex; align-items: center; gap: .7rem; padding: .6rem .4rem; border-radius: 10px; color: var(--ink); text-decoration: none; border-bottom: 1px solid #F0F3F8; }
.tlist li:last-child a { border-bottom: 0; }
.tlist a:hover { background: var(--paper); }
.tnum { font-weight: 700; color: var(--cc); min-width: 2.2rem; font-variant-numeric: tabular-nums; }
.tname { flex: 1; } .tgo { color: var(--ink-3); transition: transform .15s; } .tlist a:hover .tgo { transform: translateX(3px); color: var(--cc); }
.tlist .lvl { width: .9rem; height: .9rem; border-radius: 4px; }
.w-cta { max-width: 1152px; margin: 1.5rem auto; padding: clamp(1.4rem, 4vw, 2.4rem); border-radius: 24px; color: #fff; display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(120deg, #2B59C3, #7B4DD8 60%, #E0567A); box-shadow: 0 18px 50px rgba(43,89,195,.25); }
.w-cta h2 { color: #fff; margin-bottom: .3rem; } .w-cta p { margin: 0; max-width: 40rem; opacity: .95; }
@media (max-width: 1240px) { .w-cta { margin-left: clamp(16px, 3vw, 28px); margin-right: clamp(16px, 3vw, 28px); } }
.btn.light { background: #fff; color: #2B59C3; border-color: #fff; }
@media (max-width: 860px) { .w-hero { grid-template-columns: 1fr; } .w-art { max-width: 420px; width: 100%; margin: 0 auto; aspect-ratio: 1 / .7; } .path4 { grid-template-columns: 1fr 1fr; } .chapters { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .path4 { grid-template-columns: 1fr; } }

.lesson .lhead { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.lesson .lede { font-size: 1.08rem; color: var(--ink-2); max-width: 46rem; }
.lvlbox { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; white-space: nowrap; font-size: .9rem; }
.lvlbox i { width: .9rem; height: .9rem; border-radius: 4px; }
.lsteps { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; scroll-margin-top: 80px; }
.lsteps a { display: flex; align-items: center; gap: .55rem; padding: .7rem .8rem; border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; height: 100%; }
.lsteps a b { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--paper); flex: none; }
.lsteps a.on { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 8px 24px rgba(43,89,195,.25); } .lsteps a.on b { background: rgba(255,255,255,.2); }
.lsteps a.done b { background: #E7F4EE; color: var(--green); }
@media (max-width: 760px) { .lsteps { grid-template-columns: 1fr 1fr; } .lesson .lhead { flex-direction: column; } }
.rules { margin: 0; padding-left: 1.2rem; display: grid; gap: .55rem; } .rules li::marker { color: var(--blue); }
.formulas .fml { background: var(--paper); border-radius: 10px; padding: .3rem .8rem; margin-bottom: .6rem; overflow-x: auto; }
.lgrid .card h2 { margin-bottom: .7rem; }
.videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.videos iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; margin-top: .4rem; }
.example { margin-bottom: 1rem; } .exq { font-size: 1.05rem; } .exn { display: inline-block; background: #FDEBF0; color: #D0456B; font-weight: 700; font-size: .8rem; padding: .15rem .55rem; border-radius: 999px; margin-right: .3rem; }
.exsteps { margin: .3rem 0 .8rem; padding-left: 1.4rem; display: grid; gap: .35rem; } .exsteps li { animation: fadein .3s ease-out; }
.exa { background: #E7F4EE; border-left: 4px solid var(--green); padding: .5rem .8rem; border-radius: 8px; animation: fadein .3s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sina { text-align: left; border-top: 6px solid var(--green); } .pnext { margin-top: 1.2rem; }
.ok-card { border-left: 6px solid var(--green); }
fieldset.who { border: 0; padding: 0; margin: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; } fieldset.who legend { font-weight: 600; margin-bottom: .4rem; }
.req.isnew { border-left: 5px solid var(--amber); }
.pill.good { background: #E7F4EE; color: var(--green); }

/* welcome v2: headline + start cards + stats strip */
.w-hero { grid-template-columns: 1.15fr .85fr; align-items: start; }
.w-hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); line-height: 1.05; }
.w-hero h1 em { font-style: italic; background: linear-gradient(100deg, #2B59C3, #7B4DD8 60%, #E0567A); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
.w-art { position: relative; height: clamp(300px, 34vw, 420px); aspect-ratio: auto; margin-top: .5rem; }
.w-teacher { position: absolute; left: 50%; bottom: 0; height: 100%; transform: translateX(-50%); filter: drop-shadow(0 14px 18px rgba(29,43,79,.18)); animation: imgIdle2 3.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes imgIdle2 { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-6px); } }
.w-art .tile { z-index: 2; } .w-art .t1 { left: 2%; top: 10%; } .w-art .t2 { left: auto; right: 4%; top: 4%; } .w-art .t3 { left: 6%; top: 58%; } .w-art .t5 { left: auto; right: 2%; top: 48%; } .w-art .t6 { left: auto; right: 14%; top: 80%; }
.w-art .sh { position: absolute; border-radius: 6px; } .w-art .s1 { width: 22px; height: 22px; background: #F08A4B; left: 26%; top: 2%; transform: rotate(18deg); }
.w-art .s2 { width: 18px; height: 18px; background: #E05AA8; right: 30%; bottom: 8%; } .w-art .s3 { width: 26px; height: 26px; border-radius: 50%; background: #F2D16B; left: 20%; bottom: 4%; }
.w-start { padding-top: .5rem; } .w-start h2 { font-size: 1.25rem; }
.startcard { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; margin-bottom: .9rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; box-shadow: 0 2px 0 rgba(29,43,79,.06); transition: border-color .15s, box-shadow .15s, transform .15s; }
.startcard:hover { border-color: #7B4DD8; box-shadow: 0 10px 24px rgba(43,89,195,.12); transform: translateY(-1px); }
.startcard b { display: block; font-weight: 600; } .startcard small { color: var(--ink-2); font-size: .9rem; } .startcard i { font-style: normal; font-size: 1.6rem; color: #7B4DD8; line-height: 1; }
.w-stats { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; background: #EEF1F6; padding: 1.6rem clamp(16px, 3vw, 28px); margin: 1rem 0 0; }
.w-stats b { display: block; font-size: clamp(1.3rem, 2.6vw, 1.7rem); } .w-stats span { color: var(--ink-2); }
@media (max-width: 860px) { .w-hero { grid-template-columns: 1fr; } .w-stats { grid-template-columns: 1fr 1fr; gap: 1rem; } }

/* phones: one compact header row, nav scrolls sideways instead of stacking */
@media (max-width: 760px) {
  .top-in { gap: .4rem .9rem; padding-top: .55rem; padding-bottom: .55rem; }
  .top .brand { font-size: 1.05rem; }
  .top nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; gap: 1rem; padding-bottom: .2rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { white-space: nowrap; font-size: .92rem; }
  .top .me { margin-left: auto; gap: .5rem; font-size: .82rem; }
  .top .me > a[href="/account"] { max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 760px) { .w-art { display: none; } }   /* on phones the walking Mərcan guide is enough */
