/* myonlineworksheet.com: site design system.
   Font: Nunito (SIL Open Font License), self-hosted in /assets/fonts, no outside requests. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("../fonts/nunito-latin-variable.woff2") format("woff2-variations"), url("../fonts/nunito-latin-variable.woff2") format("woff2");
}

:root {
  /* Brand */
  --brand: #2B59D9; --brand-dark: #1C3FA8; --brand-deep: #132C73; --brand-tint: #EBF1FF; --brand-line: #C9D7FB;
  --sun: #FFC93C; --sun-tint: #FFF6DA; --sun-line: #FBE29A;
  --coral: #FF6F59; --mint: #18B67A; --mint-tint: #E5F8EF; --violet: #7B61FF;

  /* Text and surfaces */
  --ink: #17223B; --ink-2: #3A4560; --muted: #5E6880; --line: #E1E6F0; --line-2: #CDD5E3;
  --bg: #F5F7FB; --card: #FFFFFF; --navy: #0F1B38;

  /* Older names still used by admin pages */
  --read: var(--brand); --math: var(--brand); --math-tint: var(--brand-tint); --math-line: var(--brand-line);
  --star: #F5A800; --calm: #EEF1FF; --calm-line: #CBD3FA;

  --radius: 18px; --radius-sm: 12px; --wrap: 1180px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 56, .06);
  --shadow: 0 1px 2px rgba(15, 27, 56, .05), 0 8px 24px rgba(15, 27, 56, .07);
  --shadow-lg: 0 2px 6px rgba(15, 27, 56, .06), 0 20px 48px rgba(15, 27, 56, .12);
  --font: "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  /* Default grade color (overridden by .g-*) */
  --g: var(--brand); --g-ink: var(--brand-dark); --g-tint: var(--brand-tint); --g-line: var(--brand-line);
}

/* Grade colors */
.g-kindergarten { --g: #E8553F; --g-ink: #B03A26; --g-tint: #FFF0EC; --g-line: #FFCFC4; }
.g-grade-1      { --g: #E08300; --g-ink: #9A5A00; --g-tint: #FFF5E0; --g-line: #FFDDA3; }
.g-grade-2      { --g: #0E9F6E; --g-ink: #08744F; --g-tint: #E6F7F0; --g-line: #AEE6CF; }
.g-grade-3      { --g: #2B6CDE; --g-ink: #1E4FAE; --g-tint: #EAF1FF; --g-line: #BDD2FA; }
.g-grade-4      { --g: #7048E8; --g-ink: #5531C9; --g-tint: #F1ECFF; --g-line: #D3C6FB; }
.g-grade-5      { --g: #D6336C; --g-ink: #A61E4D; --g-tint: #FDEBF2; --g-line: #F6C2D6; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: clamp(30px, 4.2vw, 48px); }
h2 { font-size: clamp(24px, 2.8vw, 34px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.i { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }
.section { padding: 56px 0; }
.section-sm { padding: 36px 0; }
.wrap.section, .wrap.section-sm { padding-left: 24px; padding-right: 24px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin-bottom: 12px; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 50; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.env-banner { background: var(--brand-deep); color: #fff; text-align: center; font-size: 14px; font-weight: 700; padding: 6px 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; font: inherit; font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: background .15s, border-color .15s, transform .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 58px; padding: 0 30px; font-size: 18px; border-radius: 14px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-deep); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-primary:active { box-shadow: 0 2px 0 var(--brand-deep); }
.btn-sun { background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 #D9A200; }
.btn-sun:hover { background: #FFD45F; color: var(--ink); }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost-light:hover { background: rgba(255,255,255,.2); color: #fff; }
.btn[disabled] { opacity: .65; cursor: wait; }
.btn-row, .cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn-row form { margin: 0; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 8px 0; text-decoration: underline; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; text-decoration: none; }
.link-arrow .i { transition: transform .15s; }
.link-arrow:hover .i { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header { background: var(--card); position: sticky; top: 0; z-index: 30; box-shadow: var(--shadow-sm); }
.header-row { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.logo-mark { width: 40px; height: 40px; }
.logo-word { font-size: 21px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.logo-word b { color: var(--brand); font-weight: 900; }
.main-nav { display: flex; gap: 2px; flex: 1; }
.main-nav a { color: var(--ink-2); text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 10px; white-space: nowrap; }
.main-nav a:hover { background: var(--bg); color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-tint); }
.header-cta { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.header-cta a { white-space: nowrap; }
.link-quiet { color: var(--ink-2); font-weight: 700; text-decoration: none; }
.link-quiet:hover, .link-quiet.is-on { color: var(--brand); }
.m-nav { display: none; margin-left: auto; }
.m-nav summary { list-style: none; cursor: pointer; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); }
.m-nav summary::-webkit-details-marker { display: none; }
.m-nav .i { width: 26px; height: 26px; }
.m-nav .m-close, .m-nav[open] .m-open { display: none; }
.m-nav[open] .m-close { display: block; }
.m-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-top: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 12px 20px 20px; display: grid; gap: 4px; }
.m-panel a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; padding: 12px 8px; border-radius: 10px; }
.m-panel a[aria-current="page"] { color: var(--brand); background: var(--brand-tint); }
.m-panel .btn { margin-top: 8px; }

/* Subject tabs and grade chips */
.subject-bar { background: linear-gradient(180deg, #F8FAFF, #F1F5FF); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.subject-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; overflow-x: auto; scrollbar-width: none; }
.subject-row::-webkit-scrollbar { display: none; }
.subject-tabs { display: flex; align-self: stretch; gap: 4px; }
.subject-tab { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; font-weight: 800; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.subject-tab:hover { color: var(--ink); }
.subject-tab.is-math { color: var(--ink-2); }
.subject-tab.is-math .i { color: var(--brand); }
.subject-tab.is-on { color: var(--brand); border-bottom-color: var(--brand); }
.subject-tab.is-reading .i { color: var(--mint); }
.tag-soon { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--mint-tint); color: #0B7A51; border-radius: 999px; padding: 2px 8px; }
.grade-chips { display: flex; align-items: center; gap: 6px; }
.grade-chips-label { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.grade-chip { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; text-decoration: none; color: var(--g-ink); background: var(--card); border: 2px solid var(--g-line); transition: transform .12s, background .12s; }
.grade-chip:hover { background: var(--g); color: #fff; border-color: var(--g); transform: translateY(-1px); }
.grade-chip.is-on { background: var(--g); border-color: var(--g); color: #fff; }

@media (max-width: 980px) {
  .main-nav, .header-cta { display: none; }
  .m-nav { display: block; }
  .header-row { min-height: 64px; position: relative; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .wrap.section, .wrap.section-sm { padding-left: 16px; padding-right: 16px; }
  .logo-word { font-size: 18px; }
  .logo-mark { width: 34px; height: 34px; }
  .grade-chips-label { display: none; }
  .grade-chip { width: 34px; height: 34px; }
  .subject-tab { padding: 0 10px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #B9C2D9; margin-top: 72px; padding: 56px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.footer-about p { max-width: 36ch; margin-top: 14px; }
.logo-light { color: #fff; }
.logo-light .logo-word b { color: #8FB0FF; }
.site-footer h2 { color: #fff; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer nav { display: grid; align-content: start; gap: 8px; }
.site-footer nav a { color: #B9C2D9; text-decoration: none; }
.site-footer nav a:hover { color: #fff; text-decoration: underline; }
.footer-promises { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; font-weight: 700; color: #DCE3F5; }
.footer-promises li { display: flex; align-items: center; gap: 10px; }
.footer-promises .i { color: var(--sun); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 14px; margin-top: 40px; }
.footer-bottom::before { content: ""; flex-basis: 100%; border-top: 1px solid rgba(255,255,255,.1); margin-bottom: 12px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ---------- Page headers ---------- */
.page-head { background: linear-gradient(135deg, var(--g-tint), #fff 70%); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-head::after { content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: var(--g); opacity: .08; }
.page-head .wrap { position: relative; z-index: 1; padding-top: 36px; padding-bottom: 36px; }
.page-head h1 { margin-bottom: 8px; }
.page-head .lead { margin: 0; max-width: 60ch; }
.crumbs { font-size: 15px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); font-weight: 700; text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.crumbs .sep { color: var(--line-2); }
.head-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; padding: 5px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.chip .i { color: var(--g); }
.chip-g { background: var(--g); border-color: var(--g); color: #fff; }

/* ---------- Home: hero ---------- */
.hero { background: radial-gradient(1200px 500px at 85% -10%, #DCE7FF 0%, transparent 60%), radial-gradient(800px 400px at -10% 110%, #FFF1CC 0%, transparent 60%), #F8FAFF; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); letter-spacing: -.025em; }
.hero h1 .hl { color: var(--brand); background: linear-gradient(transparent 70%, rgba(255, 201, 60, .55) 70%); padding: 0 .08em; }
.hero .lead { max-width: 34em; margin-bottom: 28px; }
.hero-ticks { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 0; margin: 26px 0 0; font-weight: 700; color: var(--ink-2); font-size: 16px; }
.hero-ticks li { display: flex; align-items: center; gap: 8px; }
.hero-ticks .i { color: #fff; background: var(--mint); border-radius: 50%; padding: 3px; width: 22px; height: 22px; }

.hero-visual { position: relative; min-height: 500px; }
.hv-blob { position: absolute; border-radius: 50%; }
.hv-blob.b1 { width: 340px; height: 340px; background: var(--brand); opacity: .1; right: 0; top: 10px; }
.hv-blob.b2 { width: 120px; height: 120px; background: var(--sun); opacity: .5; left: 20px; bottom: 30px; }
.hv-blob.b3 { width: 18px; height: 18px; background: var(--coral); right: 40%; top: 6px; }
.hv-blob.b4 { width: 12px; height: 12px; background: var(--mint); left: 8%; top: 30%; }
.hv-card { position: absolute; background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); }
.hv-practice { width: min(360px, 88%); left: 6%; top: 40px; padding: 20px 22px 18px; z-index: 2; }
.hv-skill { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 12px; }
.hv-code { background: var(--brand-tint); color: var(--brand-dark); border-radius: 6px; padding: 2px 8px; }
.hv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 28px; font-weight: 900; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.hv-row .ans { min-width: 64px; text-align: center; border: 3px solid var(--line-2); border-radius: 10px; padding: 0 8px; }
.hv-row.ok { border-color: #FFD566; background: var(--sun-tint); }
.hv-row.ok .ans { border-color: #F5B400; background: #fff; }
.hv-row.typing .ans { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.hv-row .mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: #fff; }
.hv-row .mark .i { width: 18px; height: 18px; }
.hv-row .mark.empty { background: transparent; }
.hv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; font-weight: 800; font-size: 15px; }
.hv-stars { color: #F5A800; display: flex; gap: 2px; }
.hv-stars .i { width: 20px; height: 20px; }
.hv-check { background: var(--brand); color: #fff; border-radius: 10px; padding: 8px 14px; font-size: 14px; }
.hv-badge { right: 4%; top: 6px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-weight: 900; z-index: 3; transform: rotate(4deg); }
.hv-badge .burst { width: 38px; height: 38px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; color: #B37A00; }
.hv-badge small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.hv-sheet { width: 190px; right: -3%; bottom: -24px; padding: 16px; z-index: 3; transform: rotate(-5deg); }
.hv-sheet .ttl { height: 10px; width: 60%; background: var(--ink); border-radius: 4px; margin-bottom: 12px; opacity: .85; }
.hv-sheet .ln { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.hv-sheet .ln span { height: 18px; border-bottom: 2px solid var(--line-2); font-size: 11px; font-weight: 800; color: var(--muted); }
.hv-sheet .tag { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--brand-dark); background: var(--brand-tint); padding: 4px 8px; border-radius: 6px; }
.hv-ring { left: -2%; bottom: -6px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; z-index: 3; }
.hv-ring svg { width: 54px; height: 54px; }
.hv-ring b { display: block; font-size: 15px; }
.hv-ring small { color: var(--muted); font-weight: 700; font-size: 12px; }
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 40px; gap: 24px; }
  .hero-visual { min-height: 380px; max-width: 520px; width: 100%; margin: 0 auto; }
}
@media (max-width: 560px) {
  .hero-visual { min-height: 0; padding: 26px 0 40px; }
  .hv-practice { position: relative; left: 0; top: 0; width: 100%; padding: 16px; }
  .hv-row { font-size: 22px; padding: 8px 10px; }
  .hv-sheet, .hv-ring, .hv-blob.b2 { display: none; }
  .hv-badge { top: 0; right: -4px; }
  .subject-tab.is-reading { display: none; }
}

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: -36px; position: relative; z-index: 2; }
.stat { padding: 22px 24px; display: flex; align-items: center; gap: 14px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.stat .ic .i { width: 24px; height: 24px; }
.stat b { display: block; font-size: 22px; line-height: 1.1; font-weight: 900; }
.stat span { color: var(--muted); font-size: 15px; font-weight: 600; }
.ic-blue { background: var(--brand-tint); color: var(--brand); }
.ic-sun { background: var(--sun-tint); color: #C98A00; }
.ic-mint { background: var(--mint-tint); color: #0E8F5F; }
.ic-coral { background: #FFEDEA; color: #D9472F; }
.ic-violet { background: #F0ECFF; color: #6347E0; }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 480px) { .stat { padding: 16px; gap: 10px; } .stat b { font-size: 18px; } .stat span { font-size: 13px; } .stat .ic { width: 38px; height: 38px; } }

/* Section headings */
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }

/* ---------- Grade cards (home and worksheets index) ---------- */
.grade-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.gcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.gcard-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--g-tint); border-bottom: 1px solid var(--g-line); text-decoration: none; color: var(--ink); }
.gcard-badge { width: 52px; height: 52px; border-radius: 16px; background: var(--g); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 900; flex: none; box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.gcard-title { font-size: 21px; font-weight: 900; line-height: 1.1; }
.gcard-sub { color: var(--g-ink); font-weight: 700; font-size: 14px; }
.gcard-skills { list-style: none; margin: 0; padding: 14px 20px 6px; display: grid; gap: 4px; flex: 1; align-content: start; }
.gcard-skills li { display: flex; gap: 10px; align-items: baseline; font-size: 16px; }
.gcard-skills a { color: var(--ink); text-decoration: none; font-weight: 600; }
.gcard-skills a:hover { color: var(--g-ink); text-decoration: underline; }
.gcard-skills .soon { color: var(--muted); }
.code { font-size: 13px; font-weight: 800; color: var(--g-ink); min-width: 2.4em; font-variant-numeric: tabular-nums; }
.gcard-foot { padding: 12px 20px 18px; }
.gcard-foot a { color: var(--g-ink); }
.gcard-empty { padding: 16px 20px; color: var(--muted); flex: 1; }
@media (max-width: 980px) { .grade-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grade-cards { grid-template-columns: 1fr; } }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.feature .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 16px; }
.feature .ic .i { width: 26px; height: 26px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 16px; }
@media (max-width: 980px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* Steps */
.steps-row { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; position: relative; }
.steps-row li { position: relative; padding-top: 70px; }
.steps-row li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 900; font-size: 22px; display: grid; place-items: center; box-shadow: 0 0 0 8px var(--brand-tint); }
.steps-row li:not(:last-child)::after { content: ""; position: absolute; top: 26px; left: 72px; right: -10px; border-top: 3px dashed var(--brand-line); }
.steps-row h3 { margin-bottom: 6px; }
.steps-row p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .steps-row { grid-template-columns: 1fr; } .steps-row li:not(:last-child)::after { display: none; } }

/* Printables band */
.band { background: linear-gradient(120deg, var(--brand-deep), var(--brand) 70%); color: #E7EDFF; border-radius: 28px; padding: 48px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; position: relative; overflow: hidden; }
.band::before { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: rgba(255,255,255,.06); right: -100px; top: -140px; }
.band h2 { color: #fff; }
.band .lead { color: #D6E0FF; }
.band-list { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; font-weight: 700; }
.band-list li { display: flex; gap: 10px; align-items: center; }
.band-list .i { color: var(--sun); }
.paper-stack { position: relative; height: 260px; }
.paper { position: absolute; width: 190px; height: 240px; background: #fff; border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.25); padding: 18px; color: var(--ink); }
.paper:nth-child(1) { left: 8%; top: 18px; transform: rotate(-8deg); }
.paper:nth-child(2) { left: 30%; top: 4px; transform: rotate(3deg); }
.paper:nth-child(3) { left: 52%; top: 22px; transform: rotate(10deg); }
.paper .ttl { font-size: 12px; font-weight: 900; margin-bottom: 4px; }
.paper .nm { font-size: 9px; color: var(--muted); border-bottom: 1px solid var(--line-2); padding-bottom: 6px; margin-bottom: 10px; }
.paper .pr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.paper .pr span { border-bottom: 1.5px solid var(--line-2); padding-bottom: 2px; }
.paper .key { position: absolute; right: 12px; top: 12px; font-size: 9px; font-weight: 900; color: #fff; background: var(--coral); border-radius: 6px; padding: 2px 6px; }
@media (max-width: 860px) { .band { grid-template-columns: 1fr; padding: 32px 24px; } .paper-stack { height: 230px; } }

/* Article cards */
.post-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-art { height: 120px; display: grid; place-items: center; font-size: 44px; font-weight: 900; color: #fff; text-decoration: none; }
.post-art:hover { color: #fff; }
.post-art.a0 { background: linear-gradient(135deg, #2B59D9, #6C8CFF); }
.post-art.a1 { background: linear-gradient(135deg, #0E9F6E, #4FD3A2); }
.post-art.a2 { background: linear-gradient(135deg, #E8553F, #FF9E7A); }
.post-art.a3 { background: linear-gradient(135deg, #7048E8, #A893FF); }
.post-art.a4 { background: linear-gradient(135deg, #E08300, #FFC24D); }
.post-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-body h3 { margin: 0; font-size: 20px; }
.post-body h3 a { color: var(--ink); text-decoration: none; }
.post-body h3 a:hover { color: var(--brand); }
.post-body p { color: var(--muted); margin: 0; font-size: 16px; flex: 1; }
.post-date { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 900px) { .post-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .post-cards { grid-template-columns: 1fr; } }

/* Coming soon strip */
.soon-strip { background: var(--sun-tint); border: 1px solid var(--sun-line); border-radius: var(--radius); padding: 24px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.soon-strip h2 { font-size: 22px; margin: 0 0 4px; }
.soon-strip p { margin: 0; color: var(--ink-2); }

/* ---------- Grade page: skill lists ---------- */
.grade-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.grade-switch a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-weight: 800; font-size: 15px; text-decoration: none; }
.grade-switch a:hover { border-color: var(--g); color: var(--g-ink); }
.grade-switch a.is-on { background: var(--g); border-color: var(--g); color: #fff; }
.subject-head { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; }
.subject-head .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.subject-head h2 { margin: 0; font-size: 28px; }
.subject-head .count { margin-left: auto; color: var(--muted); font-weight: 700; }
.skill-columns { columns: 2 340px; column-gap: 28px; }
.skill-group { break-inside: avoid; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 18px 10px; margin: 0 0 22px; }
.skill-group h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 0 0 8px; }
.skill-group .letter { width: 32px; height: 32px; border-radius: 10px; background: var(--g); color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 900; flex: none; }
.skill-list { list-style: none; margin: 0; padding: 0; }
.skill { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
a.skill:hover { background: var(--g-tint); color: var(--ink); }
a.skill:hover .skill-title { color: var(--g-ink); text-decoration: underline; }
.skill .code { flex: none; }
.skill-title { font-weight: 700; flex: 1; }
.skill-kind { display: flex; gap: 6px; color: var(--muted); }
.skill-kind .i { width: 18px; height: 18px; }
.skill.is-soon { color: var(--muted); }
.skill.is-soon .code { color: var(--muted); }
.tag { font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; background: #EEF0F5; color: var(--muted); white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; font-weight: 700; margin: -6px 0 22px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .i { width: 18px; height: 18px; }
.soon-box, .open-box { background: var(--card); border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 24px 26px; margin: 18px 0; }
.open-box { border: 1px solid var(--g-line); background: var(--g-tint); }
.subject-block + .subject-block { margin-top: 44px; }
.grade-overview + .grade-overview { margin-top: 48px; }
.grade-overview-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 18px; }
.grade-overview-head h2 { margin: 0; }
.grade-overview-head h2 a { color: var(--ink); text-decoration: none; }
.grade-overview-head h2 a:hover { color: var(--g-ink); }
.grade-overview-head .gcard-badge { width: 46px; height: 46px; font-size: 22px; border-radius: 14px; }
.grade-overview-head .link-arrow { margin-left: auto; color: var(--g-ink); }

/* ---------- Skill (topic) page ---------- */
.skill-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.skill-code { font-size: .5em; background: var(--g); color: #fff; border-radius: 12px; padding: 4px 12px; letter-spacing: 0; }
.skill-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.practice-panel { padding: 24px; }
.side { display: grid; gap: 18px; position: sticky; top: 150px; }
.side-card { padding: 20px; }
.side-card h2 { font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.side-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 15px; color: var(--ink-2); }
.side-card li { display: flex; gap: 10px; align-items: flex-start; }
.side-card li .i { color: var(--g); margin-top: 2px; }
.score-big { display: flex; align-items: baseline; gap: 8px; }
.score-big b { font-size: 44px; line-height: 1; font-weight: 900; color: var(--ink); }
.score-big span { color: var(--muted); font-weight: 700; }
.score-bar { height: 12px; background: #EEF1F7; border-radius: 999px; overflow: hidden; margin: 12px 0 10px; }
.score-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #FFC93C, #F5A800); border-radius: 999px; transition: width .4s; }
.score-msg { font-size: 15px; color: var(--muted); margin: 0; font-weight: 600; }
.related-list { display: grid; gap: 2px; margin: 0 -8px; }
.related-list .skill { padding: 8px; }
.related-list .skill-title { font-size: 15px; }
.about-skill { margin-top: 28px; padding: 26px 28px; }
.about-skill h2 { font-size: 22px; }
.about-skill p:last-child { margin-bottom: 0; }
@media (max-width: 980px) { .skill-layout { grid-template-columns: 1fr; } .side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }

/* ---------- Worksheet: practice online ---------- */
.ws-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-end; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ws-name { display: grid; gap: 4px; font-weight: 800; font-size: 14px; color: var(--muted); }
.ws-name input { font: inherit; font-size: 17px; font-weight: 700; color: var(--ink); padding: 10px 14px; border: 2px solid var(--line-2); border-radius: 12px; min-height: 48px; width: 14em; max-width: 100%; }
.ws-name input:focus { border-color: var(--g); outline: none; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ws-actions .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
.ws-count { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--muted); }
.ws-count select { font: inherit; font-size: 16px; font-weight: 800; color: var(--ink); min-height: 44px; padding: 0 30px 0 12px; border: 2px solid var(--line-2); border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23596579' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 10px center; -webkit-appearance: none; appearance: none; cursor: pointer; }
.ws-count select:focus { border-color: var(--g); outline: none; }
.ws-seed { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.ws-practice { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 14px; margin: 20px 0; }
.ws-practice.is-vertical { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); }
.ws-item { background: #FBFCFE; border: 2px solid var(--line); border-radius: 16px; padding: 18px 14px 16px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 30px; font-weight: 900; position: relative; min-height: 100px; flex-wrap: wrap; font-variant-numeric: tabular-nums; transition: border-color .15s, background .15s; }
.ws-num { position: absolute; top: 6px; left: 10px; font-size: 12px; color: var(--muted); font-weight: 800; }
.ws-item input { width: 3.3em; min-height: 56px; font: inherit; font-size: 30px; font-weight: 900; text-align: center; border: 3px solid var(--line-2); border-radius: 12px; background: #fff; color: var(--ink); padding: 0 4px; }
.ws-item input:focus { border-color: var(--g); background: var(--g-tint); outline: none; }
.ws-stack { display: grid; justify-items: end; line-height: 1.15; }
.ws-stack .ws-rule { border-top: 4px solid var(--ink); width: 100%; margin: 4px 0 8px; }
.ws-item.is-ok { border-color: #FFD566; background: var(--sun-tint); }
.ws-item.is-ok input { border-color: #F5B400; background: #fff; }
.ws-item.is-ok::after { content: "★"; position: absolute; top: 4px; right: 10px; color: #F5A800; font-size: 22px; }
.ws-item.is-again { border-color: var(--calm-line); background: var(--calm); }
.ws-item.is-again::after { content: "try again"; position: absolute; bottom: 4px; right: 10px; color: #3F4DB8; font-size: 12px; font-weight: 800; }
.ws-check-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.ws-result { margin: 0; font-size: 19px; font-weight: 800; }
.ws-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.print-sheet { display: none; }

/* ---------- Articles and simple pages ---------- */
.content-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: clamp(22px, 4vw, 44px); }
.article-body { font-size: 18px; line-height: 1.75; color: var(--ink-2); }
.article-body h2 { font-size: 26px; margin-top: 1.6em; color: var(--ink); }
.article-body h3 { margin-top: 1.4em; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin-bottom: .4em; }
.article-body a { font-weight: 700; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-weight: 700; font-size: 15px; }
.page-head .lead + .article-meta { margin-top: 14px; }
/* Article pictures, contents box, callouts, tables and FAQ */
.article-body > :first-child { margin-top: 0; }
.article-body figure { margin: 30px 0; }
.article-body figure img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.article-body figcaption { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--muted); text-align: center; }
.article-body .article-hero { margin: 0 0 26px; }
.article-body .article-hero img { border: 0; }
.article-body h2[id], .article-body h3[id] { scroll-margin-top: 90px; }
.toc { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px 10px; margin: 24px 0 8px; font-size: 16px; line-height: 1.5; }
.toc-title { margin: 0 0 6px; font-weight: 900; color: var(--ink); font-size: 15px; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; list-style-position: inside; }
.toc details:not([open]) .toc-title { margin-bottom: 6px; }
.toc-count { font-weight: 800; color: var(--muted); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.toc ol { margin: 8px 0 0; padding-left: 1.4em; columns: 2; column-gap: 28px; }
.toc li { margin-bottom: 6px; break-inside: avoid; }
.toc a { font-weight: 700; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
.tip-box { background: var(--sun-tint); border: 1px solid var(--sun-line); border-left: 6px solid var(--sun); border-radius: 12px; padding: 16px 20px; margin: 26px 0; }
.tip-box.mint { background: var(--mint-tint); border-color: #B5E9D2; border-left-color: var(--mint); }
.tip-box.blue { background: var(--brand-tint); border-color: var(--brand-line); border-left-color: var(--brand); }
.tip-box > :first-child { margin-top: 0; }
.tip-box > :last-child { margin-bottom: 0; }
.tip-box-title { font-weight: 900; color: var(--ink); margin-bottom: 6px; }
.article-body .ws-links { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; }
.ws-links li { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; line-height: 1.35; font-size: 16px; }
.ws-links li span { display: block; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }
.article-table-wrap { overflow-x: auto; margin: 22px 0; -webkit-overflow-scrolling: touch; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; min-width: 520px; }
.article-body th, .article-body td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.article-body thead th { background: var(--bg); color: var(--ink); font-weight: 900; border-bottom: 2px solid var(--line-2); }
.article-body .faq h3 { font-size: 19px; color: var(--ink); margin: 1.2em 0 .3em; }
.article-body .faq p { margin-top: 0; }
.article-body .sources { font-size: 15px; line-height: 1.55; color: var(--muted); }
.article-body .sources li { margin-bottom: 6px; }
.related-tips { margin-top: 40px; }
.related-tips h2 { font-size: 24px; margin-bottom: 16px; }
.post-art.has-img { height: auto; display: block; background: var(--brand-tint); }
.post-art.has-img img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.cta-card { margin-top: 36px; background: var(--brand-tint); border: 1px solid var(--brand-line); border-radius: var(--radius); padding: 24px 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta-card h2 { font-size: 21px; margin: 0 0 4px; }
.cta-card p { margin: 0; color: var(--ink-2); }
.draft-note { background: var(--sun-tint); border: 1px solid var(--sun-line); border-radius: 12px; padding: 10px 14px; font-size: 15px; margin-bottom: 18px; }
.roadmap { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.roadmap li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.roadmap-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.roadmap-head h2 { font-size: 20px; margin: 0; }
.roadmap p { margin: 0; color: var(--muted); }
.stage { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.stage-testing { background: var(--mint-tint); color: #0B7A51; }
.stage-progress { background: var(--brand-tint); color: var(--brand-dark); }
.stage-planned { background: var(--sun-tint); color: #8A5D00; }
.stage-later { background: #EEF0F5; color: var(--muted); }
@media (max-width: 760px) { .roadmap { grid-template-columns: 1fr; } }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }
.notfound { text-align: center; padding: 72px 0; }
.notfound .big { font-size: clamp(80px, 14vw, 140px); font-weight: 900; line-height: 1; color: var(--brand); letter-spacing: -.04em; }

/* Kept for admin pages and simple lists */
.badge { display: inline-block; align-self: flex-start; font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--calm); color: #3730A3; border: 1px solid var(--calm-line); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-weight: 700; }
.pill.is-on { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.steps { padding-left: 24px; }
.steps li { margin-bottom: 8px; }
.topic-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.topic-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.topic-card .topic-title { font-weight: 800; font-size: 18px; text-decoration: none; color: var(--ink); }
.topic-summary { color: var(--muted); font-size: 15px; }

/* ---------- Forms and messages ---------- */
.form { display: grid; gap: 18px; max-width: 640px; }
.form label { display: grid; gap: 6px; font-weight: 800; }
.form input, .form select, .form textarea { font: inherit; font-weight: 500; padding: 12px 14px; border: 2px solid var(--line-2); border-radius: 12px; background: #fff; color: var(--ink); min-height: 50px; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-tint); }
.form .muted { font-weight: 600; }
.flash { border-radius: 12px; padding: 12px 16px; margin: 12px 0; font-weight: 600; }
.flash ul { margin: 0; padding-left: 20px; }
.flash-ok { background: var(--mint-tint); border: 1px solid #A9E5CB; }
.flash-warn { background: var(--sun-tint); border: 1px solid var(--sun-line); }

/* Contact form: hidden box for spam robots, and the quick check */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.check-input { max-width: 9rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }


/* ---------- Worksheet: printed sheet (US Letter, 8.5 × 11 in) ---------- */
@page { size: letter portrait; margin: 0.4in 0.5in; }
@media print {
  body { background: #fff; font-size: 12pt; }
  body.printing-ws > *:not(main),
  body.printing-ws main .page-head,
  body.printing-ws .skill-wrap > *:not(.skill-layout),
  body.printing-ws .skill-layout > *:not(.skill-main),
  body.printing-ws .skill-main > *:not(.practice-panel),
  body.printing-ws .practice-panel > *:not(#ws):not(#fl),
  body.printing-ws #ws > *:not(.print-sheet),
  body.printing-ws #fl > *:not(.print-sheet) { display: none !important; }
  body.printing-ws .wrap, body.printing-ws .section { padding: 0; max-width: none; margin: 0; }
  body.printing-ws .skill-layout { display: block; }
  body.printing-ws .practice-panel { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  body.printing-ws .print-sheet { display: flex; }
  .site-header, .site-footer, .env-banner { display: none; }
}
.ps-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2pt solid #222; padding-bottom: 6pt; margin-bottom: 12pt; gap: 12pt; }
.ps-brand { font-size: 8pt; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #555; }
.ps-title { font-size: 18pt; font-weight: 700; margin: 2pt 0 0; }
.ps-sub { font-size: 9pt; color: #555; }
.ps-lines { font-size: 10pt; display: grid; gap: 6pt; min-width: 2.6in; }
.ps-lines span { border-bottom: 1pt solid #999; padding-bottom: 1pt; }
.ps-key { font-size: 9pt; font-weight: 700; border: 1pt solid #222; padding: 1pt 6pt; border-radius: 8pt; margin-left: 6pt; vertical-align: middle; }
.ps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22pt 14pt; }
.ps-grid.is-vertical { grid-template-columns: repeat(5, 1fr); gap: 26pt 14pt; }
.ps-item { position: relative; font-size: 16pt; padding: 14pt 6pt 6pt 18pt; break-inside: avoid; white-space: nowrap; }
.ps-item .ps-n { position: absolute; left: 0; top: 10pt; font-size: 8pt; color: #666; font-weight: 700; }
.ps-blank { display: inline-block; min-width: 0.6in; border-bottom: 1pt solid #222; text-align: center; }
.ps-stack { display: inline-grid; justify-items: end; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ps-stack .ps-rule { border-top: 1.5pt solid #222; width: 100%; margin: 2pt 0 4pt; }
.ps-stack .ps-blank { display: block; border: 0; min-width: 0.8in; height: 0.45in; text-align: right; }
.ps-foot { margin-top: 18pt; border-top: 1pt solid #bbb; padding-top: 6pt; font-size: 8.5pt; color: #444; display: flex; justify-content: space-between; gap: 12pt; }

/* Contact form: hidden box for spam robots, and the quick check */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.check-input { max-width: 9rem; }

/* Anchors land below the sticky header */
[id] { scroll-margin-top: 140px; }
.open-panel { border-color: var(--g-line); background: linear-gradient(135deg, var(--g-tint), #fff 75%); }
.open-panel .btn { margin-top: 4px; }
.mt-0 { margin-top: 0; }
.i.flip { transform: scaleX(-1); }
.notfound .big .i { width: 96px; height: 96px; color: #fff; background: var(--mint); border-radius: 50%; padding: 18px; }
.contact-layout .content-card .form { max-width: none; }

/* Home: learning center vs at home */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.compare-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-sm); }
.compare-col h3 { display: flex; align-items: center; gap: 10px; font-size: 21px; margin-bottom: 14px; color: var(--muted); }
.compare-col.is-us { border: 2px solid var(--brand); box-shadow: var(--shadow); background: linear-gradient(160deg, var(--brand-tint), #fff 60%); }
.compare-col.is-us h3 { color: var(--ink); }
.compare-col .logo-mark { width: 32px; height: 32px; }
.compare-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.compare-col li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.compare-col .x, .compare-col .ok { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 900; margin-top: 1px; }
.compare-col .x { background: #EEF0F5; color: var(--muted); }
.compare-col .ok { background: var(--mint); color: #fff; }
.compare-col .ok .i { width: 16px; height: 16px; }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }

/* ---------- More problem types (online) ---------- */
.ws-item.is-parts { gap: 8px 10px; font-size: 26px; }
.ws-practice.gen-round { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.ws-practice.gen-place { grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
.ws-practice.gen-place .ws-item, .ws-practice.gen-round .ws-item { font-size: 20px; justify-content: flex-start; text-align: left; }
.ws-practice.gen-order, .ws-practice.gen-decimal { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.ws-practice.gen-sequence { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.ws-practice.gen-lcm { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.ws-practice.gen-lcm .ws-item { font-size: 24px; gap: 8px 10px; }
.ws-practice.gen-lcm .ws-item input { font-size: 26px; min-height: 52px; }
.ws-practice.gen-place .ws-item input, .ws-practice.gen-round .ws-item input { font-size: 24px; min-height: 50px; }
.ws-practice.is-wide { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }
.ws-item.is-word { display: block; text-align: left; font-size: 19px; font-weight: 600; line-height: 1.5; padding: 24px 20px 18px; }
.ws-story { margin: 0 0 14px; color: var(--ink); }
.ws-answer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 800; color: var(--ink-2); }
.ws-answer-row input { font-size: 24px; min-height: 50px; }
.ws-choice { display: inline-flex; gap: 6px; }
.ws-sign { width: 52px; height: 52px; border-radius: 12px; border: 3px solid var(--line-2); background: #fff; font: inherit; font-size: 26px; font-weight: 900; color: var(--ink); cursor: pointer; line-height: 1; }
.ws-sign:hover { border-color: var(--g); }
.ws-sign[aria-pressed="true"] { background: var(--g); border-color: var(--g); color: #fff; }
.ws-item.is-ok .ws-sign[aria-pressed="true"] { background: #F5B400; border-color: #F5B400; }
.ws-frac { display: inline-grid; justify-items: center; line-height: 1.05; font-size: .9em; }
.ws-frac-bar { width: 100%; min-width: 1.1em; border-top: 3px solid var(--ink); margin: 3px 0; }
.ws-frac input { width: 2.4em; min-height: 46px; font-size: 24px; }
.ws-tip { grid-column: 1 / -1; margin: 0; font-size: 15px; color: var(--muted); font-weight: 700; }
.ws-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 16px 0 0; padding: 14px 16px; background: var(--g-tint); border: 1px solid var(--g-line); border-radius: 14px; }
.ws-picker-label { font-weight: 800; color: var(--g-ink); }
.ws-picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-chip { min-width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--g-line); background: #fff; font: inherit; font-weight: 900; color: var(--g-ink); cursor: pointer; }
.ws-chip[aria-pressed="true"] { background: var(--g); border-color: var(--g); color: #fff; }
.pack-picker { margin: 18px 0 20px; }
.pack-picker .ws-picker { margin: 0; }

/* ---------- More problem types (printed) ---------- */
.ps-grid.is-parts { grid-template-columns: repeat(3, 1fr); }
.ps-grid.gen-place, .ps-grid.gen-round, .ps-grid.gen-sequence { grid-template-columns: repeat(2, 1fr); }
.ps-grid.gen-place .ps-item, .ps-grid.gen-round .ps-item { font-size: 13pt; white-space: normal; }
.ps-grid.is-wide { grid-template-columns: 1fr; gap: 16pt; }
.ps-grid.is-wide .ps-item { white-space: normal; font-size: 13pt; padding-bottom: 40pt; border-bottom: 1px solid #ddd; }
.ps-story { margin: 0 0 8pt; line-height: 1.45; }
.ps-word-ans { text-align: right; }
.ps-circle { display: inline-block; width: 22pt; height: 22pt; border: 1.2pt solid #222; border-radius: 50%; text-align: center; line-height: 22pt; vertical-align: middle; }
.ps-frac { display: inline-grid; justify-items: center; vertical-align: middle; line-height: 1.05; font-size: 14pt; }
.ps-frac-bar { width: 100%; min-width: 14pt; border-top: 1.2pt solid #222; margin: 2pt 0; }
.ps-fblank { display: inline-block; min-width: 26pt; height: 18pt; border: 1pt solid #888; border-radius: 3pt; text-align: center; }

/* Comparing: keep "6 < = > 10" on one line */
.ws-practice.gen-compare { grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }
.ws-practice.gen-compare .ws-item { flex-wrap: nowrap; gap: 10px; }
.ws-practice.gen-compare .ws-item:has(.ws-help), .ws-practice.gen-compare .ws-item:has(.ws-offer) { flex-wrap: wrap; }
.ws-practice.gen-compare .ws-sign { width: 46px; height: 46px; }
/* Sentences with a box in the middle read as one line of text */
.ws-practice.gen-place .ws-item, .ws-practice.gen-round .ws-item { display: block; line-height: 2.4; padding: 24px 18px 14px; }
.ws-practice.gen-place .ws-item > span:not(.ws-num), .ws-practice.gen-round .ws-item > span:not(.ws-num) { margin-right: 8px; }
.ws-practice.gen-place .ws-item input, .ws-practice.gen-round .ws-item input { vertical-align: middle; margin-right: 8px; width: 3.6em; }

/* ---------- Hints and "Show me how" ---------- */
.ws-item { padding-top: 26px; }
.ws-hint-btn { position: absolute; z-index: 2; top: 6px; right: 6px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: #B08A00; display: grid; place-items: center; cursor: pointer; }
.ws-hint-btn:hover, .ws-hint-btn:focus-visible { background: var(--sun-tint); color: #8A6A00; }
.ws-item.is-ok::after { right: 44px; }
.ws-item.is-again::after { content: none; }
.ws-item.is-word .ws-story, .ws-practice.gen-place .ws-item, .ws-practice.gen-round .ws-item, .ws-practice.gen-volume .ws-item { padding-right: 40px; }
.ws-item.is-learned { border-color: #A9E5CB; background: var(--mint-tint); }
.ws-item.is-learned::after { content: "✓ learned"; position: absolute; top: 9px; right: 46px; color: #0B7A51; font-size: 12px; font-weight: 900; }
.ws-help { flex-basis: 100%; width: 100%; margin-top: 10px; background: #FFFBEA; border: 1px solid var(--sun-line); border-radius: 12px; padding: 12px 14px; font-size: 16px; font-weight: 600; line-height: 1.45; text-align: left; color: var(--ink); }
.ws-help p { margin: 0 0 6px; }
.ws-help-title { font-weight: 900; color: #8A5D00; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.ws-help-note { color: #0B7A51; font-weight: 800; }
.ws-help-foot { color: var(--muted); font-size: 14px; margin: 6px 0 0 !important; }
.ws-steps { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.ws-steps li.is-answer { font-weight: 900; color: var(--brand-dark); }
.ws-how-btn { font: inherit; font-size: 14px; font-weight: 800; color: var(--brand-dark); background: #fff; border: 2px solid var(--brand-line); border-radius: 999px; padding: 6px 14px; cursor: pointer; min-height: 38px; }
.ws-how-btn:hover { border-color: var(--brand); }
.ws-offer { flex-basis: auto; margin-top: 8px; }
.ws-item.is-again .ws-offer { background: var(--calm); border-color: var(--calm-line); color: #3F4DB8; }

/* Clocks, rectangles, word choices */
.ws-figure { flex-basis: 100%; display: flex; justify-content: center; }
.ws-item.is-clock, .ws-item.is-rect { gap: 10px 8px; }
.ws-clock { width: 150px; height: 150px; }
.ws-time { display: inline-flex; align-items: center; gap: 6px; }
.ws-time input { width: 2.4em; }
.ws-practice.gen-clock { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.ws-item.is-rect { font-size: 22px; }
.ws-rect { max-width: 100%; height: auto; }
.ws-practice.gen-rect { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.ws-choice.is-words .ws-sign { width: auto; min-width: 64px; padding: 0 14px; font-size: 18px; }
.ws-practice.gen-choiceq { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.ws-practice.gen-choiceq .ws-item, .ws-practice.gen-neighbors .ws-item, .ws-practice.gen-volume .ws-item { font-size: 22px; }
.ws-practice.gen-volume { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }
.ws-practice.gen-volume .ws-item { display: block; text-align: left; line-height: 2.2; font-size: 19px; }
.ws-practice.gen-volume .ws-item input { vertical-align: middle; margin: 0 8px; }
.ws-practice.gen-neighbors { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }

/* Printed */
.ps-clock { width: 78pt; height: 78pt; display: block; margin: 0 auto 4pt; }
.ps-time { display: block; text-align: center; font-size: 13pt; }
.ps-rect { max-width: 100%; height: auto; display: block; }
.ps-choices { display: inline-flex; gap: 12pt; margin-left: 6pt; }
.ps-choices span { padding: 1pt 6pt; border: 1pt solid #999; border-radius: 10pt; font-size: 11pt; }
.ps-choices span.is-key { border: 2pt solid #222; font-weight: 800; }

/* ---------- Reading: picture cards, read-aloud button, picture choices ---------- */
.ws-item.is-read { flex-direction: column; align-items: center; text-align: center; gap: 10px; font-size: 20px; }
.ws-wordq { display: inline-flex; align-items: center; gap: 12px; }
.ws-pic { font-size: 64px; line-height: 1.1; cursor: pointer; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.ws-wtext { font-size: 34px; font-weight: 900; letter-spacing: 2px; color: var(--ink); }
.ws-say { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--line-2); background: #fff; font-size: 24px; cursor: pointer; line-height: 1; }
.ws-say:hover, .ws-say:focus-visible { border-color: var(--g); outline: none; }
.ws-item.is-read .ws-choice { flex-wrap: wrap; justify-content: center; }
.ws-item.is-read .ws-choice { gap: 8px; }
.ws-item.is-read .ws-choice.is-words .ws-sign { font-size: 22px; min-width: 56px; height: 52px; padding: 0 12px; }
.ws-item.is-read .ws-choice.is-pics .ws-sign { height: auto; min-height: 80px; padding: 6px 8px 8px; }
.ws-choice.is-pics .ws-sign { width: auto; height: auto; min-width: 84px; padding: 6px 10px; display: inline-flex; flex-direction: column; align-items: center; }
.ws-pic-sm { font-size: 40px; line-height: 1.1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.ws-pic-word { font-size: 14px; font-weight: 800; }
.ps-grid.is-read .ps-item { white-space: normal; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4pt; }
.ps-wordq { display: inline-flex; flex-direction: column; align-items: center; }
.ps-pic { font-size: 34pt; line-height: 1.15; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.ps-wtext { font-size: 20pt; font-weight: 900; letter-spacing: 2pt; }
.ps-wtext.is-sight { border: 1.5pt solid #444; border-radius: 6pt; padding: 0 10pt; }
.ps-wkey { font-size: 9pt; color: #555; }
.ps-grid.is-read .ps-choices { margin-left: 0; flex-wrap: wrap; justify-content: center; }
.ps-grid.is-read .ps-choices span { font-size: 15pt; padding: 1pt 9pt; }
.ps-choices.is-pics span { display: inline-flex; flex-direction: column; align-items: center; border-radius: 8pt; }
.ps-pic-sm { font-size: 22pt; line-height: 1.15; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.ps-pic-word { font-size: 8pt; }
/* Text-heavy problems (sentences with choices) wrap in two columns on paper. */
.print-sheet .ps-grid.gen-writeexpr, .print-sheet .ps-grid.gen-mistake, .print-sheet .ps-grid.gen-estimate,
.print-sheet .ps-grid.gen-compound, .print-sheet .ps-grid.gen-contraction, .print-sheet .ps-grid.gen-plural { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24pt; }
.print-sheet .ps-grid.gen-writeexpr .ps-item, .print-sheet .ps-grid.gen-mistake .ps-item, .print-sheet .ps-grid.gen-estimate .ps-item,
.print-sheet .ps-grid.gen-compound .ps-item, .print-sheet .ps-grid.gen-contraction .ps-item, .print-sheet .ps-grid.gen-plural .ps-item { white-space: normal; font-size: 13pt; }
.print-sheet .ps-grid.gen-writeexpr .ps-choices, .print-sheet .ps-grid.gen-mistake .ps-choices, .print-sheet .ps-grid.gen-estimate .ps-choices { display: flex; flex-wrap: wrap; margin: 4pt 0 0; gap: 8pt; }
.ws-practice.gen-writeexpr .ws-item, .ws-practice.gen-mistake .ws-item, .ws-practice.gen-estimate .ws-item { font-size: 20px; }
.ps-grid.gen-clock { grid-template-columns: repeat(4, 1fr); }
.ps-grid.gen-clock .ps-item { text-align: center; }
.ps-grid.gen-rect { grid-template-columns: repeat(3, 1fr); }
.ps-grid.gen-choiceq, .ps-grid.gen-volume { grid-template-columns: repeat(2, 1fr); }
.ps-grid.gen-choiceq { gap: 8pt 14pt; }
.ps-grid.gen-choiceq .ps-item { padding-top: 8pt; font-size: 14pt; }
.ps-grid.gen-volume .ps-item { white-space: normal; font-size: 12pt; }

/* ---------- Plus page ---------- */
.form label.check-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; }
.form label.check-row input { width: 20px; height: 20px; min-height: 0; padding: 0; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--brand); box-shadow: none; }
.plus-features { margin-bottom: 8px; }
.site-footer .tag-soon { margin-left: 6px; vertical-align: 1px; }
.roadmap-more { margin-top: 24px; font-weight: 700; }

/* ---------- Picture problems (ten frames, coins, graphs, shapes…) ---------- */
.ws-item.is-fig { gap: 10px 8px; align-content: flex-start; }
.ws-fig { max-width: 100%; height: auto; display: block; }
.ws-practice.gen-tenframe, .ws-practice.gen-shapename, .ws-practice.gen-picadd, .ws-practice.gen-bond, .ws-practice.gen-coins,
.ws-practice.gen-eqparts, .ws-practice.gen-array, .ws-practice.gen-fracshape, .ws-practice.gen-quad, .ws-practice.gen-angle { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.ws-practice.gen-bargraph, .ws-practice.gen-coord, .ws-practice.gen-numline, .ws-practice.gen-ruler, .ws-practice.gen-fracline,
.ws-practice.gen-pattern { grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); }
.ws-practice.gen-numword, .ws-practice.gen-roman, .ws-practice.gen-missfactor { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.ws-practice.gen-convert, .ws-practice.gen-rounddec, .ws-practice.gen-expanded, .ws-practice.gen-qr { grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }
.ws-practice.gen-numword .ws-item > span:not(.ws-num) { font-weight: 800; }
.ws-choice.is-icons { gap: 8px; }
.ws-choice.is-icons .ws-sign { min-width: 54px; padding: 6px 10px; display: inline-flex; align-items: center; justify-content: center; }
.ws-choice.is-icons .ws-sign svg { display: block; }
.ps-figure { display: block; width: 100%; text-align: center; margin: 2pt 0 4pt; }
.ps-fig { max-width: 100%; height: auto; }
.ps-item.has-fig { white-space: normal; text-align: center; break-inside: avoid; }
.ps-grid.gen-tenframe, .ps-grid.gen-shapename, .ps-grid.gen-picadd, .ps-grid.gen-bond, .ps-grid.gen-coins, .ps-grid.gen-eqparts,
.ps-grid.gen-array, .ps-grid.gen-fracshape, .ps-grid.gen-quad, .ps-grid.gen-angle { grid-template-columns: repeat(3, 1fr); gap: 10pt 14pt; }
.ps-grid.gen-bargraph, .ps-grid.gen-coord, .ps-grid.gen-numline, .ps-grid.gen-ruler, .ps-grid.gen-fracline, .ps-grid.gen-pattern { grid-template-columns: repeat(2, 1fr); gap: 12pt 18pt; }
.ps-grid.gen-convert, .ps-grid.gen-rounddec, .ps-grid.gen-qr, .ps-grid.gen-expanded { grid-template-columns: repeat(2, 1fr); }
/* Least common multiple: room to list multiples or prime factors under each problem */
.ps-grid.gen-lcm { grid-template-columns: repeat(2, 1fr); gap: 8pt 22pt; }
.ps-grid.gen-lcm .ps-item { white-space: normal; font-size: 13.5pt; padding-top: 6pt; }
.ps-grid.gen-lcm .ps-item .ps-n { top: 3pt; }
.ps-grid.gen-lcm .ps-work { gap: 6pt; }
.ps-work { margin-top: 6pt; display: grid; gap: 7pt; font-size: 10pt; }
.ps-work-row { display: flex; align-items: flex-end; gap: 6pt; }
.ps-work-label { white-space: nowrap; color: #333; font-weight: 700; }
.ps-work-line { flex: 1; min-height: 14pt; border-bottom: 1pt solid #999; font-size: 9.5pt; line-height: 1.25; padding-bottom: 1pt; }
.ps-grid.gen-lcmword .ps-item { padding-bottom: 12pt; }
.ps-grid.gen-lcmword .ps-work { margin: 0 0 8pt; font-size: 10.5pt; max-width: 5.6in; }
/* The ladder (LCM): drawn as a table with an L-shaped line; the numbers on the L are highlighted */
.ladder { border-collapse: collapse; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--ink); }
.ladder td { padding: 3px 12px; text-align: center; }
.ladder td.lad-d { border-right: 3px solid var(--ink); padding: 3px 10px 3px 4px; text-align: right; min-width: 1.7em; }
.ladder tr:not(.lad-last) td.lad-n { border-bottom: 3px solid var(--ink); }
.ladder tr.lad-last td.lad-d { border-right: 0; }
.lad-hl { display: inline-block; min-width: 1.5em; padding: 0 .15em; border-radius: 8px; background: var(--mint-tint); color: #0B7A51; box-shadow: inset 0 0 0 2px #9FDDC2; }
.lad-mult { margin-top: 6px; font-weight: 800; font-size: .8em; color: var(--ink-2); }
.lad-mult-eq { white-space: nowrap; }
.ps-ladder-how .lad-mult-label, .ws-ladder-how .lad-mult-label { display: block; }
.ws-practice.gen-ladder { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.ws-practice.gen-ladder .ws-item { font-size: 24px; align-content: flex-start; }
.ws-practice.gen-ladder .ws-figure .ladder { font-size: 28px; }
.ws-help .ladder-wrap { margin: 10px 0 4px; font-size: 20px; }
.ws-ladder-how { grid-column: 1 / -1; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 14px 24px; align-items: start; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.ws-ladder-how .lad-how-steps ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--ink-2); }
.lad-how-title { margin: 0 0 6px; font-weight: 900; color: var(--ink); font-size: 18px; }
.lad-how-cap { margin: 0 0 6px; font-weight: 900; color: var(--brand-dark); font-size: 15px; }
.ws-ladder-how .ladder { font-size: 22px; }
@media (max-width: 760px) { .ws-ladder-how { grid-template-columns: 1fr 1fr; } .ws-ladder-how .lad-how-steps { grid-column: 1 / -1; } }
@media (max-width: 480px) { .ws-ladder-how { gap: 12px 10px; padding: 14px 12px; } .ws-ladder-how .ladder { font-size: 17px; } .ws-ladder-how .ladder td { padding: 2px 7px; } .ws-ladder-how .lad-how-cap { font-size: 13px; } .ws-ladder-how .lad-how-steps ol { font-size: 15px; } }
/* Printed ladders */
.print-sheet .ladder { color: #000; }
.print-sheet .ladder td.lad-d { border-right: 1.6pt solid #000; }
.print-sheet .ladder tr:not(.lad-last) td.lad-n { border-bottom: 1.6pt solid #000; }
.print-sheet .lad-hl { -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 4pt; box-shadow: inset 0 0 0 1pt #6CC9A0; }
.print-sheet .is-start .ladder td.lad-d { min-width: .42in; }
.ps-ladder-how { display: grid; grid-template-columns: 3.05in 1fr 1fr; gap: 4pt 12pt; align-items: start; border: 1pt solid #999; border-radius: 8pt; padding: 6pt 10pt; margin: 0 0 6pt; font-size: 9.5pt; line-height: 1.3; }
.ps-ladder-how .lad-how-steps ol { margin: 0; padding-left: 14pt; display: grid; gap: 2pt; }
.ps-ladder-how .lad-how-title { font-size: 11pt; margin-bottom: 3pt; }
.ps-ladder-how .lad-how-cap { font-size: 9.5pt; margin-bottom: 3pt; color: #1C3FA8; white-space: nowrap; }
.ps-ladder-how .ladder { font-size: 12pt; }
.ps-ladder-how .ladder td { padding: .5pt 7pt; }
.ps-ladder-how .lad-mult { font-size: 9pt; margin-top: 3pt; }
.ps-instr { margin: 0 0 6pt; font-size: 10.5pt; font-weight: 700; }
.ps-grid.gen-ladder { grid-template-columns: repeat(3, 1fr); gap: 8pt 10pt; }
.ps-grid.gen-ladder .ps-item { white-space: normal; font-size: 12.5pt; padding: 6pt 8pt 6pt 18pt; border: 1pt solid #bbb; border-radius: 8pt; }
.ps-grid.gen-ladder .ps-item .ps-n { top: 5pt; left: 6pt; }
.ps-ladder-fig { display: block; min-height: 1.3in; padding-top: 2pt; }
.ps-ladder-fig .ladder { font-size: 13.5pt; }
.ps-ladder-fig .ladder td { padding: 1pt 9pt; }
.ps-ladder-fig .lad-mult { font-size: 9pt; margin-top: 2pt; white-space: nowrap; }
.ps-work-ladder { display: block; }
.ps-work-ladder .ps-work-label { display: block; margin-bottom: 3pt; }
.ps-work-ladder .ladder-wrap.is-start { min-height: .9in; }
.ps-work-ladder .ladder { font-size: 12pt; }
.ps-work-ladder .ladder td { padding: 1pt 8pt; }
.ps-work-ladder .lad-mult { font-size: 9pt; }
.ps-choices.is-icons span { display: inline-flex; align-items: center; padding: 2pt 5pt; }
.ws-item.is-fig { font-size: 21px; }
.ws-practice.gen-convert .ws-item, .ws-practice.gen-rounddec .ws-item, .ws-practice.gen-expanded .ws-item { font-size: 24px; }
.ps-item.has-fig { font-size: 12pt; }
.ps-grid.gen-convert .ps-item, .ps-grid.gen-rounddec .ps-item { font-size: 13pt; white-space: normal; }
.ws-practice.gen-numword, .ws-practice.gen-roman { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.ws-practice.gen-missfactor, .ws-practice.gen-mixed, .ws-practice.gen-fracshape, .ws-practice.gen-fracdec, .ws-practice.gen-fracdiv { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.ws-practice.gen-quad, .ws-practice.gen-angle { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.ws-practice.gen-qr, .ws-practice.gen-convert { grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
.ws-practice.gen-convert .ws-item, .ws-practice.gen-rounddec .ws-item { font-size: 22px; }
.ws-practice.gen-qr .ws-item input { width: 96px; }
.ps-item.has-fig .ps-choices { flex-wrap: wrap; justify-content: center; gap: 4pt 6pt; margin: 2pt 0 0; }
.ps-item.has-fig .ps-choices span { font-size: 10pt; padding: 1pt 5pt; }

/* ---------- Family accounts ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-danger { background: #C2341F; color: #fff; border-color: #C2341F; }
.btn-danger:hover { background: #A12A18; }
.link-btn.danger { color: #C2341F; }
.inline-form { display: inline; margin: 0; }
.narrow-card { max-width: 460px; margin: 0 auto; }
.pin-input { max-width: 140px; letter-spacing: .5em; font-size: 22px; text-align: center; }
.family-cta { justify-content: center; margin-top: 26px; }
.family-note { text-align: center; max-width: 620px; margin: 16px auto 0; }
.family-picker { text-align: center; }
.picker-title { font-size: clamp(30px, 5vw, 44px); margin: 10px 0 26px; }
.kid-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 210px)); gap: 18px; justify-content: center; }
.kid-tile { width: 100%; display: grid; justify-items: center; gap: 6px; padding: 22px 12px 18px; border-radius: 22px; border: 3px solid var(--line); background: #fff; cursor: pointer; font: inherit; transition: transform .12s, border-color .12s, box-shadow .12s; }
.kid-tile:hover, .kid-tile:focus-visible { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 10px 24px rgba(43, 89, 217, .14); }
.kid-face { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: #EAF1FF; font-size: 50px; line-height: 1; }
.kid-face.big { width: 104px; height: 104px; font-size: 64px; flex: 0 0 auto; }
.kid-name { font-size: 22px; font-weight: 900; color: var(--ink); }
.kid-meta { font-size: 14px; color: var(--muted); font-weight: 700; }
.picker-foot { margin-top: 34px; display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; }
.kid-home .kid-hello { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.kid-hello h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); }
.kid-stars { margin: 4px 0 0; font-size: 20px; font-weight: 800; }
.star-big { color: #F5B400; font-size: 26px; }
.kid-switch { margin-left: auto; }
.kid-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 14px; margin-bottom: 26px; }
.kid-card { display: grid; gap: 4px; padding: 18px 20px; border-radius: 18px; background: var(--brand); color: #fff; text-decoration: none; box-shadow: 0 8px 20px rgba(43, 89, 217, .2); }
.kid-card.is-new { background: #18A86E; box-shadow: 0 8px 20px rgba(24, 168, 110, .2); }
.kid-card-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.kid-card-title { font-size: 21px; font-weight: 900; }
.kid-group h2 { font-size: 19px; margin: 22px 0 10px; }
.kid-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.kid-skill { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-weight: 800; }
.kid-skill:hover { border-color: var(--brand); }
.kid-skill-score { font-size: 13px; color: var(--muted); white-space: nowrap; }
.kid-skill.is-done .kid-skill-score { color: #B07D00; }
.grownups-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.grownups-head h1 { margin: 0; }
.grownups-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.kid-report { padding: 20px 22px; margin-bottom: 18px; }
.kid-report-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.kid-report-head h2 { margin: 0; font-size: 22px; }
.kid-report-head p { margin: 2px 0 0; }
.kid-report-head .link-quiet { margin-left: auto; }
.kid-report .kid-face { width: 60px; height: 60px; font-size: 36px; }
.kid-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kid-kpis .kpi { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #FBFCFE; display: grid; gap: 2px; }
.kid-kpis .kpi b { font-size: 26px; }
.kid-kpis .kpi span { font-size: 13px; color: var(--muted); font-weight: 700; }
.report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 10px 26px; }
.report-cols h3 { font-size: 16px; margin: 0 0 6px; }
.report-list { margin: 0; padding-left: 18px; }
.report-list li { margin-bottom: 4px; }
.report-recent { margin-top: 12px; }
.report-recent summary { cursor: pointer; font-weight: 800; color: var(--brand); }
.report-recent table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.report-recent th, .report-recent td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.report-recent .num { text-align: right; }
.avatar-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-pick legend { font-weight: 800; margin-bottom: 8px; }
.avatar-opt { position: relative; display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--line); background: #fff; font-size: 32px; cursor: pointer; }
.avatar-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.avatar-opt:has(input:checked) { border-color: var(--brand); background: #EAF1FF; }
.avatar-opt:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.danger-zone { margin-top: 18px; }
.settings-page .content-card { margin-bottom: 18px; }
.settings-page h2 { font-size: 20px; margin-top: 0; }
.danger-card { border-color: #F3C3BA; }
.kid-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #EAF1FF; border: 1px solid #C9D8FB; border-radius: 14px; padding: 8px 14px; margin-bottom: 12px; font-weight: 800; }
.kid-banner .kid-face { width: 36px; height: 36px; font-size: 22px; background: #fff; }
.kid-banner a { margin-left: auto; font-size: 14px; }
.header-family { font-weight: 800; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
@media print { .kid-banner { display: none !important; } }
button.link-quiet { background: none; border: 0; font: inherit; cursor: pointer; padding: 8px 0; }
.stage-done { background: #DCFCE7; color: #166534; }
/* Admin preview of a Parent Tips article */
.preview-bar { background: #FFF6DA; border-bottom: 1px solid #F3DB8A; color: var(--ink); font-size: 15px; padding: 10px 0; }
.preview-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.preview-bar strong { background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.preview-bar a { font-weight: 800; }

/* ---------- Printed sheets fill one whole Letter page ----------
   The page area is 7.5 × 10.2 in (Letter minus margins). The sheet is just under that tall, and the
   problem rows share whatever room is left, so the extra space becomes room to work. Before printing,
   worksheet.js measures the sheet off screen at this size (.is-measuring) and, when problems don't fit,
   uses fewer columns or shrinks them a little, so every sheet and key is exactly one page. */
.print-sheet { flex-direction: column; font-size: 12pt; line-height: 1.6; }
.print-sheet.is-measuring { display: flex; position: absolute; left: -10000px; top: 0; width: 7.5in; visibility: hidden; }
.print-sheet .ps-head { margin-bottom: 8pt; }
.print-sheet .ps-grid { flex: 1 0 auto; row-gap: 6pt; align-content: stretch; }
.print-sheet .ps-foot { margin-top: 8pt; }
/* Word problems: two columns; the story at the top, the answer line at the bottom, room to work between. */
.print-sheet .ps-grid.is-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24pt; }
.print-sheet .ps-grid.is-wide .ps-item { display: flex; padding-bottom: 8pt; }
.print-sheet .ps-word { flex: 1; display: flex; flex-direction: column; }
.print-sheet .ps-word-ans { margin-top: auto; padding-top: 6pt; }
.print-sheet .ps-grid.gen-rect .ps-item { white-space: normal; text-align: center; }
.print-sheet .ps-grid.gen-neighbors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.print-sheet .ps-grid.gen-neighbors .ps-item { font-size: 14pt; }
@media print {
  body.printing-ws .print-sheet { min-height: 10.1in; }
}

/* ---------- Multiplication flowers ---------- */
.fl-pick { margin: 0 0 16px; }
.fl-pick-title { font-weight: 900; font-size: 17px; margin: 0 0 8px; }
.fl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-chip { min-width: 48px; height: 48px; padding: 0 10px; border-radius: 14px; border: 2px solid var(--line-2); background: #fff; font: inherit; font-size: 20px; font-weight: 900; color: var(--ink); cursor: pointer; }
.fl-chip:hover, .fl-chip:focus-visible { border-color: var(--g); outline: none; }
.fl-chip.is-on { background: var(--g); border-color: var(--g); color: #fff; }
.fl-mix { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; cursor: pointer; }
.fl-mix input { width: 20px; height: 20px; }
.fl-garden { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; margin: 16px 0 8px; }
.fl-flower { text-align: center; }
.fl-flower-title { font-size: 18px; margin: 0 0 4px; }
.fl-pad { position: relative; width: 100%; max-width: 380px; aspect-ratio: 1 / 1; margin: 0 auto; }
.fl-svg { display: block; width: 100%; height: 100%; }
.fl-out { fill: #FDECF3; stroke: #D9709B; stroke-width: 1.4; }
.fl-in { fill: #FFF6D6; stroke: #D7A72C; stroke-width: 1.2; }
.fl-mid { fill: #FFD966; stroke: #C99400; stroke-width: 1.4; }
.fl-out.is-right { fill: #DDF5E6; stroke: #2E9E5B; }
.fl-out.is-wrong { fill: #FDE2E2; stroke: #D9534F; }
.fl-in-n { font-size: 11px; font-weight: 800; text-anchor: middle; fill: #3B3F4A; font-family: inherit; }
.fl-mid-n { font-size: 20px; font-weight: 900; text-anchor: middle; fill: #2B2F3A; font-family: inherit; }
.fl-ans-n { font-size: 12px; font-weight: 900; text-anchor: middle; fill: #222; font-family: inherit; }
.fl-input { position: absolute; transform: translate(-50%, -50%); width: 11.5%; height: 9.5%; min-width: 34px; min-height: 30px; padding: 0; border: 1.5px solid #E7A9C3; border-radius: 10px;
  background: rgba(255, 255, 255, .9); text-align: center; font: inherit; font-size: 17px; font-weight: 900; color: var(--ink); }
.fl-input:focus { outline: 3px solid var(--g); outline-offset: 1px; background: #fff; }
.fl-input.is-right { color: #1E7A45; border-color: #2E9E5B; background: #fff; }
.fl-input.is-wrong { color: #B3261E; border-color: #D9534F; background: #fff; }
.skill-figure { margin: 14px 0 0; }
.skill-figure img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); }
@media (max-width: 420px) { .fl-garden { grid-template-columns: 1fr; } .fl-input { font-size: 16px; } }
/* Printed flowers: 4 to a Letter page, black lines on white. */
.print-sheet.fl-print { font-size: 12pt; }
.fl-page { display: flex; flex-direction: column; }
.fl-print-grid { display: grid; grid-template-columns: 1fr 1fr; justify-items: center; align-items: center; flex: 1 0 auto; gap: .1in; }
.fl-print-cell svg { width: 3.65in; height: 3.65in; display: block; }
.fl-print .fl-out, .fl-print .fl-in, .fl-print .fl-mid { fill: #fff; stroke: #222; stroke-width: 1.1; }
.fl-print .fl-in-n { font-size: 11.5px; fill: #111; }
.fl-print .fl-mid-n { font-size: 21px; fill: #111; }
.fl-print .fl-ans-n { font-size: 13px; fill: #111; }
@media print {
  body.printing-ws .print-sheet.fl-print { display: block; min-height: 0; }
  body.printing-ws .fl-page { min-height: 10.1in; break-after: page; page-break-after: always; }
  body.printing-ws .fl-page:last-child { break-after: auto; page-break-after: auto; }
}
