/* Cellwise public site. Tokens first; every colour pair below meets WCAG AA in both themes. */
:root {
  --bg: #F3F7F5; --ink: #12201A; --ink2: #4A5C54; --ink3: #5E6F68;
  --card: #FFFFFF; --hair: rgba(18, 32, 26, .12); --green: #12A150; --green2: #0B7A3B; --btn: #0D8040; --on-green: #fff;
  --tint: color-mix(in srgb, var(--green) 9%, var(--card));
  --blue: #1A58C0; --link: #0A7037; --link-hover: #06552A; --bad: #C9302C; --gold: #7A5600;
  --cell: #FFFFFF; --cellh: #F2F5F4; --cell-line: #DCE3E0;
  --hue-l: 27%; --hue-bg: .14;
  --radius: 16px; --radius-s: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 8px 24px -12px rgba(16, 40, 30, .16);
  --shadow-hover: 0 2px 4px rgba(16, 40, 30, .08), 0 14px 30px -12px rgba(16, 40, 30, .24);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1512; --ink: #E9F3EE; --ink2: #B0C2BA; --ink3: #8A9C94;
    --card: #142019; --hair: rgba(255, 255, 255, .11); --green: #2FC874; --green2: #4ED68A; --btn: #2FC874; --on-green: #0B1A12;
    --blue: #7AAEFF; --link: #4ED68A; --link-hover: #7FE5AB; --bad: #FF6B70; --gold: #F2C14E; --cell: #16211D; --cellh: #1D2A25; --cell-line: #2A3833;
    --hue-l: 72%; --hue-bg: .2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -12px rgba(0, 0, 0, .5);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 32px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1512; --ink: #E9F3EE; --ink2: #B0C2BA; --ink3: #8A9C94;
  --card: #142019; --hair: rgba(255, 255, 255, .11); --green: #2FC874; --green2: #4ED68A; --btn: #2FC874; --on-green: #0B1A12;
  --blue: #7AAEFF; --link: #4ED68A; --link-hover: #7FE5AB; --bad: #FF6B70; --gold: #F2C14E; --cell: #16211D; --cellh: #1D2A25; --cell-line: #2A3833;
  --hue-l: 72%; --hue-bg: .2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -12px rgba(0, 0, 0, .5);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 32px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 120px; }
html, body { margin: 0; }
body { font: 17px/1.6 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--round); line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 5vw, 2.75rem); margin: .3em 0 .25em; }
h2 { font-size: 1.5rem; margin: 1.8em 0 .55em; }
h3 { font-size: 1.125rem; margin: 0 0 .35em; }
p { text-wrap: pretty; }
a { color: var(--link); text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color .15s ease, text-decoration-color .15s ease; }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
code { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; } /* long formulas wrap instead of pushing the page sideways */
p code, .steps li code, .links li code, dd code, .answer code, summary code, h3 code { padding: .05em .3em; border-radius: 6px; background: color-mix(in srgb, var(--ink) 6%, transparent); overflow-wrap: anywhere; }
.wrap { width: min(1000px, 100% - 32px); margin: 0 auto; }
.muted { color: var(--ink2); } .small { font-size: .875rem; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--card); color: var(--ink); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 650; }
.skip:focus { left: 16px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--hair); padding-top: env(safe-area-inset-top, 0px); }
.top-in { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 750 1.25rem var(--round); color: var(--ink); text-decoration: none; }
.logo { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 26px; height: 26px; padding: 3px; border-radius: 8px; background: var(--green); }
.logo i { background: rgba(255, 255, 255, .92); border-radius: 2px; }
.logo i:nth-child(4) { background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .92); }
.topnav { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.topnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink2); text-decoration: none; font-weight: 600; font-size: .9375rem; white-space: nowrap; }
.topnav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.topnav a[aria-current] { color: var(--green2); background: color-mix(in srgb, var(--green) 10%, transparent); }
.crumbs { font-size: .875rem; color: var(--ink3); padding-top: 14px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--ink3); }
.crumbs a { color: var(--ink2); }
.crumbs [aria-current] { color: var(--ink3); }
.crumbs li:last-child { min-width: 0; flex: 1 1 7em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--link); text-decoration: underline; }

/* ---------- buttons, cards ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 44px; padding: .55em 1.3em; border-radius: 999px; font-weight: 650; text-decoration: none; text-align: center; background: var(--btn); color: var(--on-green); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px -8px var(--btn); }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.small { min-height: 40px; padding: .3em 1.05em; font-size: .9375rem; }
.btn.big { min-height: 52px; padding: .7em 1.7em; font-size: 1.0625rem; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
a.card { color: var(--ink); text-decoration: none; }
a.card:hover { box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--green) 45%, var(--hair)); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 50%, var(--hair)); filter: none; }
.pill { display: inline-block; font-size: .75rem; font-weight: 650; line-height: 1.5; color: var(--ink2); background: color-mix(in srgb, var(--ink) 8%, transparent); padding: .1em .6em; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.pill.free { color: var(--green2); background: color-mix(in srgb, var(--green) 14%, transparent); }
.pill.plus { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }

/* ---------- article ---------- */
.lede { font-size: 1.1875rem; color: var(--ink2); margin: .2em 0 1.2em; max-width: 40em; }
.kicker { margin: 1.4em 0 0; font-weight: 650; font-size: .9375rem; color: hsl(var(--h, 152) 65% var(--hue-l)); }
.doc { max-width: 800px; }
.doc > p, .doc section > p, .links li, .steps li { max-width: 44em; }
.updated { margin-top: 2.5em; }
.answer { font-size: 1.125rem; background: var(--tint); border-color: color-mix(in srgb, var(--green) 25%, var(--hair)); }
.answer .label { display: block; font: 700 .75rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--green2); margin-bottom: 4px; }
.sig { display: flex; gap: 12px; align-items: flex-start; font-size: 1.0625rem; }
.sig code { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.fxl { flex: none; font: italic 600 .9375rem/1.7 Georgia, serif; color: var(--ink3); }
.args { display: grid; gap: 0; margin: 0; border: 1px solid var(--hair); border-radius: 14px; overflow: hidden; background: var(--card); }
.args div { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 12px; padding: 10px 16px; }
.args div + div { border-top: 1px solid var(--hair); }
.args dt code { font-weight: 650; overflow-wrap: anywhere; } .args dd { margin: 0; color: var(--ink2); }

/* ---------- mini spreadsheet ---------- */
.sheet { overflow-x: auto; border: 1px solid var(--cell-line); border-radius: 12px; background: var(--cell); margin: 12px 0; -webkit-overflow-scrolling: touch; }
.xl { border-collapse: separate; border-spacing: 0; font-size: .9375rem; min-width: 100%; }
/* each cell draws its right and bottom line: a collapsed (shared) border left a gap beside the sticky row numbers */
.xl th, .xl td { border-style: solid; border-color: var(--cell-line); border-width: 0 1px 1px 0; }
.xl tr > :first-child { border-left-width: 1px; }
.xl > :first-child > tr:first-child > * { border-top-width: 1px; }
.xl th { background: var(--cellh); color: var(--ink3); font: 600 .75rem var(--sans); padding: 4px 8px; }
.xl thead th:first-child, .xl tbody th { width: 36px; }
/* row numbers stay put when a wide sheet scrolls sideways, like Excel's frozen headings */
.xl tbody th { position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--cell-line); }
.xl thead th:first-child { position: sticky; left: 0; z-index: 2; }
.xl td { padding: 6px 10px; white-space: nowrap; min-width: 64px; height: 34px; }
.xl td.n { text-align: right; font-variant-numeric: tabular-nums; }
.xl td.hd { font-weight: 650; background: var(--cellh); }
.xl td.tgt { box-shadow: inset 0 0 0 2px var(--green); font-weight: 650; color: var(--green2); }
.xl td.err, .err { color: var(--bad); }
.sheet + .scroll-hint { display: none; }
/* Scroll shadows: a soft edge appears on whichever side has more columns, and fades as you reach the end. */
.sheet { background:
  linear-gradient(to right, var(--cell) 40%, transparent) left / 32px 100% no-repeat local,
  linear-gradient(to left, var(--cell) 40%, transparent) right / 32px 100% no-repeat local,
  linear-gradient(to right, color-mix(in srgb, var(--ink) 16%, transparent), transparent) left / 14px 100% no-repeat scroll,
  linear-gradient(to left, color-mix(in srgb, var(--ink) 16%, transparent), transparent) right / 14px 100% no-repeat scroll,
  var(--cell); }
@media (max-width: 600px) { .xl td:not(.n) { white-space: normal; overflow-wrap: break-word; max-width: 140px; } }
.fbar { display: flex; align-items: flex-start; gap: 10px; padding: 7px 12px; border-radius: var(--radius-s); background: var(--cell); border: 1px solid var(--cell-line); }
.fbar code { font-size: 1rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.fbar a { color: var(--green2); text-decoration: none; font-weight: 650; }
.fbar a:hover { text-decoration: underline; }
.nb { flex: none; font: 650 .875rem/1.85 var(--mono); color: var(--ink2); padding-right: 10px; border-right: 1px solid var(--cell-line); }
.result { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.result .lbl { color: var(--ink2); }
.result b { font-variant-numeric: tabular-nums; }
.result .shown { color: var(--ink2); font-size: .9375rem; }
.result .shown b { color: var(--ink); }
.result .blank { color: var(--ink2); font-style: italic; }
.ex, .examples > li { display: grid; gap: 0; }
.ex > p:last-child, .examples > li > p:last-child { margin-bottom: 0; }
.ex .sheet, .examples .sheet { margin-bottom: 0; }

/* ---------- lists of things ---------- */
.examples, .exlist, .steps { padding-left: 0; list-style: none; display: grid; gap: 12px; counter-reset: s var(--start, 0); }
.ex { margin: 14px 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: baseline; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green2); font: 700 .875rem var(--round); transform: translateY(-1px); }
.steps li > span { min-width: 0; }
.mistakes, .guide { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.mistakes p, .guide p { margin: 0; color: var(--ink2); }
.guide .f { display: block; margin: 6px 0 10px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--green) 10%, transparent); color: var(--green2); font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.guide .f a { color: inherit; }
.faq { display: grid; gap: 10px; }
.faq details { padding: 0; }
.faq summary, .exlist summary { cursor: pointer; font-weight: 650; }
.faq summary { padding: 14px 20px; min-height: 44px; list-style: none; display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 6%, transparent); font: 600 1.25rem/1 var(--sans); color: var(--ink2); }
.faq summary:hover::after { color: var(--link); background: color-mix(in srgb, var(--green) 12%, transparent); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0; padding: 0 20px 16px; color: var(--ink2); }
.exlist summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--green2); }
.exlist .q { font-weight: 650; margin: 0 0 8px; }
.exlist details { margin-top: 4px; color: var(--ink2); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.opts li { padding: 4px 12px; border-radius: 10px; border: 1px solid var(--hair); font-size: .9375rem; }
.pairs { display: grid; gap: 6px; margin: 0; }
.pairs div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
.pairs dt { font-weight: 650; } .pairs dd { margin: 0; color: var(--ink2); }
.links { padding-left: 1.2em; }
.links li { margin: 2px 0; }
.chips { list-style: none; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.chips a { display: flex; flex-direction: column; gap: 2px; min-height: 44px; height: 100%; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--hair); text-decoration: none; color: var(--ink); }
.chips a:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--hair)); }
.chips code { font-weight: 700; color: var(--green2); }
.chips span { font-size: .875rem; color: var(--ink2); }
.chips b { font-weight: 650; }

/* ---------- calls to action ---------- */
.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin: 2.2em 0; background: linear-gradient(135deg, color-mix(in srgb, var(--green) 13%, var(--card)), var(--card)); border-color: color-mix(in srgb, var(--green) 25%, var(--hair)); }
.cta > div { min-width: 0; max-width: 44em; }
.cta h2 { margin: 0; font-size: 1.25rem; } .cta p { margin: 6px 0 0; color: var(--ink2); }
.cta .row { flex: none; }
.plus-note { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; margin: .5em 0 1.5em; border-style: dashed; box-shadow: none; }
.plus-note p { margin: 0; color: var(--ink2); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 2em 0; }
.pager a { display: grid; gap: 2px; padding: 12px 16px; text-decoration: none; }
.pager a span { font-size: .8125rem; color: var(--ink3); font-weight: 600; }
.pager a b { color: var(--ink); }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- indexes ---------- */
.search { width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--hair); background: var(--card); color: var(--ink); font: inherit; box-shadow: var(--shadow); }
.search::placeholder { color: var(--ink3); }
.noresults { margin: 16px 0; } .noresults p { margin: 0; }
.fngrid { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.fngrid a { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; }
.fngrid code { font-weight: 700; color: var(--green2); }
.fngrid span { font-size: .875rem; color: var(--ink2); }
.units { list-style: none; padding: 0; display: grid; gap: 10px; }
.units.two { grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
.units a { display: flex; gap: 14px; align-items: center; height: 100%; }
.units a > span:last-child { display: grid; gap: 2px; min-width: 0; }
.units .muted { font-size: .9375rem; }
.units .t { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.badge { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font: 800 1rem var(--round); color: hsl(var(--h) 70% var(--hue-l)); background: hsl(var(--h) 80% 55% / var(--hue-bg)); }
.glist { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.glist > li { min-width: 0; }
.glist a { display: grid; align-content: start; gap: 4px; height: 100%; }
.glist .muted { font-size: .9375rem; }
.more { font-weight: 650; }
.more a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; padding: 40px 0 8px; }
.hero h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); letter-spacing: -.03em; margin-top: 0; }
.hero .fine { margin: 12px 0 0; font-size: .9375rem; color: var(--ink2); }
.hero > div > .kicker:first-child { margin-top: 0; }
.hero-art { padding: 14px; border-radius: 22px; background: var(--glass); border: 1px solid var(--stroke); box-shadow: var(--spec), var(--shadow); transform: rotate(1.5deg); }
.hero-art .glimpse { height: auto; min-height: 230px; }
@media (max-width: 760px) { .hero-art { transform: none; max-width: 420px; } }
.demo { transform: rotate(-1.5deg); }
.demo .xl td { min-width: 0; }
.feat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 32px; }
/* home: see the HOME block at the end */
.feat3 h2 { font-size: 1.125rem; margin: 0 0 .3em; } .feat3 p { margin: 0; color: var(--ink2); }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plans h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 1.25rem; }
.plans .price { font: 650 1rem var(--sans); color: var(--ink2); }
.plans ul { margin: .4em 0 1em; padding-left: 1.2em; color: var(--ink2); }
.plans li { margin: 4px 0; }
.plans .card { display: flex; flex-direction: column; }
.plans .card .btn { margin-top: auto; align-self: flex-start; }
.plans .best { border-color: color-mix(in srgb, var(--green) 45%, var(--hair)); }

/* ---------- 404 ---------- */
.nf { padding: 32px 0 8px; }

/* ---------- footer ---------- */
.foot { margin-top: 72px; border-top: 1px solid var(--hair); padding: 36px 0 24px; }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 20px; }
.foot-in > div:first-child p { margin: 10px 0 14px; max-width: 26em; }
.foot h2 { font: 700 .8125rem var(--sans); margin: 0 0 6px; color: var(--ink3); text-transform: uppercase; letter-spacing: .06em; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot ul a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink2); text-decoration: none; font-size: .9375rem; }
.foot ul a:hover { color: var(--ink); text-decoration: underline; }
.foot .legal { margin-top: 24px; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a.card, .chips a, .btn, .topnav a, .dir-chips a, .fngrid a, .glist a { transition: box-shadow .18s ease, border-color .18s ease, filter .18s ease, background-color .18s ease, color .18s ease, transform .18s ease; }
  a.card:hover, .chips a:hover { transform: translateY(-2px); }
  a.card:active, .chips a:active, .dir-chips a:active { transform: translateY(0) scale(.99); transition-duration: .08s; }
  .btn:active { transform: scale(.97); transition-duration: .08s; }
  .faq summary::after { transition: transform .2s ease; }
  .faq details[open] > p { animation: faqIn .22s ease both; }
  @keyframes faqIn { from { opacity: 0; transform: translateY(-4px); } }
}
@media (prefers-reduced-motion: reduce) {
  .demo { transform: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- phones ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero, .feat3, .plans { grid-template-columns: 1fr; }
  .hero { gap: 28px; padding-top: 24px; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-in > div:first-child { grid-column: 1 / -1; }
  .foot ul a { min-height: 44px; }
  .args div, .pairs div { grid-template-columns: 1fr; gap: 2px; }
  .demo { transform: none; }
  .links a { display: inline-block; padding: 9px 0; }
  .cta .row, .cta .row .btn { width: 100%; }
  h2 { font-size: 1.375rem; }
  .lede { font-size: 1.125rem; }
  .card { padding: 16px; }
  .faq summary { padding: 12px 16px; } .faq p { padding: 0 16px 14px; }
  .xl { font-size: .875rem; }
  .xl td { padding: 6px 8px; min-width: 48px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
@media (max-width: 640px) {
  .top-in { grid-template-columns: 1fr auto; grid-template-areas: "brand cta" "nav nav"; min-height: 0; padding-top: 6px; gap: 0 12px; }
  .top-in .brand { grid-area: brand; }
  .top-in > .btn { grid-area: cta; }
  .topnav { grid-area: nav; justify-content: space-between; margin: 0 -12px; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { font-size: .9375rem; }
}
@media (max-width: 360px) {
  .wrap { width: calc(100% - 24px); }
  .topnav a { padding: 0 8px; font-size: .875rem; }
}
@media (max-width: 300px) {
  .topnav { margin: 0 -6px; }
  .topnav a { padding: 0 5px; font-size: .8125rem; letter-spacing: -.01em; }
  .brand { font-size: 1.125rem; }
  .btn.big { width: 100%; }
}

/* Long content never pushes the page sideways. */
.doc, main > *, .examples > li, .exlist > li, .mistakes > *, .guide > *, .units > li, .fngrid > li, .hero > *, .feat3 > *, .plans > * { min-width: 0; }
.opts li, .pairs dd, .exlist p, .examples p, .doc p, .doc li, .doc h2, .doc h3, .doc summary, .glist b, .glist span { overflow-wrap: anywhere; }

/* ---------- print (people print the cheat sheets) ---------- */
@media print {
  :root { --bg: #fff; --card: #fff; --shadow: none; --ink2: #333; --ink3: #555; --blue: #000; --link: #000; }
  body { font-size: 11.5pt; background: #fff; }
  .top, .foot, .crumbs, .cta, .search, .noresults, .skip, .plus-note .btn, .pager { display: none !important; }
  .wrap { width: 100%; }
  .card { box-shadow: none; break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .sheet, .fbar { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .demo { transform: none; }
  .xl td { white-space: normal; }
  .faq summary::after { display: none; }
}

/* Hide the badge Netlify injects at serve time; it overlapped the lesson Check button. */
#nl-badge, .nl-badge, #nl-card { display: none !important; }

/* keyboard shortcut tables */
.kbwrap { overflow-x: auto; }
table.kb { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: .95rem; }
table.kb th, table.kb td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.kb th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink2); }
table.kb td:first-child { width: 44%; }
table.kb .combo { white-space: nowrap; }
table.kb .combo i { font-style: normal; margin: 0 3px; color: var(--ink2); }
table.kb kbd { display: inline-block; min-width: 1.6em; padding: 2px 7px; border: 1px solid var(--hair); border-bottom-width: 2px; border-radius: 6px; background: var(--card); font: 600 .82rem/1.4 var(--mono); text-align: center; white-space: nowrap; }
@media (max-width: 520px) { table.kb .combo { white-space: normal; } table.kb { font-size: .88rem; } table.kb th, table.kb td { padding: 8px 4px; } table.kb kbd { padding: 1px 5px; font-size: .76rem; } }

/* "Try it live" box: the sample sheet below becomes an editable mini spreadsheet */
.tryit { margin: 14px 0 6px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--green) 35%, var(--hair)); background: color-mix(in srgb, var(--green) 5%, var(--card)); }
.try-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.try-head strong { color: var(--green2); }
.try-head .muted { font-size: .875rem; }
.try-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--cell-line); border-radius: 10px; background: var(--cell); }
.try-f { flex: 1 1 220px; min-width: 0; min-height: 40px; border: 0; background: transparent; color: var(--ink); font: 600 .95rem var(--mono); }
.try-f:focus { outline: none; }
.try-bar:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 45%, transparent); }
.try-out { flex: none; max-width: 100%; overflow-wrap: anywhere; padding: 4px 12px; border-radius: 999px; font: 700 .95rem var(--mono); color: var(--green2); background: color-mix(in srgb, var(--green) 12%, transparent); }
.try-out.err { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.try-msg { margin: 8px 2px 0; font-size: .875rem; }
.try-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.try-chip { min-height: 36px; max-width: 100%; overflow-wrap: break-word; padding: 4px 10px; border: 1px solid var(--hair); border-radius: 8px; background: var(--card); color: var(--ink); font: 600 .8125rem var(--mono); text-align: left; cursor: pointer; }
.try-chip:hover { border-color: var(--green); }
.try-chip.ghost { font-family: var(--sans); color: var(--ink2); }
.xl td.edit { cursor: text; }
.xl td.edit:hover { background: var(--cellh); }
.xl td.edit:focus { outline: 2px solid var(--blue); outline-offset: -2px; background: var(--card); }
.xl td.ref { background: color-mix(in srgb, var(--blue) 12%, var(--cell)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 45%, transparent); }
@media (prefers-reduced-motion: no-preference) { .try-out.pop { animation: trypop .35s ease; } @keyframes trypop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } } }
@media print { .tryit { display: none; } }

/* ---------- templates gallery ---------- */
.tgrid { list-style: none; padding: 0; margin: 8px 0 28px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
a.card.tpl { display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; height: 100%; color: var(--ink); text-decoration: none; }
a.card.tpl:hover { border-color: color-mix(in srgb, var(--green) 50%, var(--hair)); }
.tpl b { font-size: 1.0625rem; line-height: 1.3; }
.tpl .muted { font-size: .9rem; }
.tpl-ico { display: grid; grid-template-columns: repeat(3, 14px); grid-auto-rows: 9px; gap: 2px; margin-bottom: 4px; }
.tpl-ico i { border-radius: 2px; background: color-mix(in srgb, hsl(var(--h, 152) 60% 45%) 22%, var(--cell)); border: 1px solid color-mix(in srgb, hsl(var(--h, 152) 60% 45%) 35%, transparent); }
.tpl-ico i:nth-child(-n+3) { background: color-mix(in srgb, hsl(var(--h, 152) 60% 45%) 55%, var(--cell)); }
.tpl-get { justify-self: start; margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 650; color: var(--green2); background: color-mix(in srgb, var(--green) 12%, transparent); }
.dl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0 24px; border-color: color-mix(in srgb, var(--green) 35%, var(--hair)); }
.dl > div { display: grid; gap: 2px; min-width: 0; }
.dl b { font-family: var(--mono); font-size: .9375rem; overflow-wrap: anywhere; }
.dl .muted { font-size: .875rem; }
.tips { padding-left: 1.2em; }
.tips li { margin: .4em 0; }

/* ---------- Excel for <field> ---------- */
.fields { list-style: none; padding: 0; margin: 8px 0 28px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.fields a.card { display: grid; align-content: start; gap: 4px; height: 100%; padding: 14px 16px; color: var(--ink); text-decoration: none; border-top: 4px solid hsl(var(--h) 60% 45%); }
.fields a.card:hover { border-color: hsl(var(--h) 60% 45%); }
.fields.big { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.fields.big a.card { padding: 18px 20px; }
.fields.big b { font-size: 1.1875rem; }
.fields .muted { font-size: .9rem; }
@media (max-width: 600px) { .home-fields .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .home-fields .fields .muted { display: none; } .home-fields .fields a.card { padding: 12px; } }
.fcount { margin-top: 6px; font-size: .8125rem; font-weight: 600; color: hsl(var(--h) 65% var(--hue-l)); }
.hub .kicker a { color: inherit; }
.hub h1 { text-wrap: balance; }
.who { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.who li { padding: 4px 12px; border-radius: 999px; font-size: .875rem; font-weight: 600; color: hsl(var(--h) 65% var(--hue-l)); background: hsl(var(--h) 60% 50% / var(--hue-bg)); }
.careful { margin: 0 0 18px; padding: 10px 14px; border-radius: var(--radius-s); border: 1px solid var(--hair); background: var(--cellh); color: var(--ink2); font-size: .9375rem; }
.hub-toc { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 16px; margin-bottom: 8px; }
.hub-toc a { font-weight: 600; }
.job { margin: 0 0 26px; }
.job h3 { margin-bottom: .3em; }
.proj-teaser { display: grid; gap: 4px; justify-items: start; }

/* practice exercises graded on the page */
.pxs { list-style: none; padding: 0; margin: 10px 0 28px; display: grid; gap: 12px; counter-reset: none; }
.px .q { display: flex; gap: 10px; align-items: baseline; margin: 0 0 10px; }
.px-n { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 700; font-size: .875rem; color: var(--ink2); background: var(--cellh); }
.px.solved .px-n { color: var(--on-green); background: var(--btn); }
.px-row { display: flex; gap: 8px; flex-wrap: wrap; }
.px-f { flex: 1 1 220px; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--cell-line); border-radius: var(--radius-s); background: var(--cell); color: var(--ink); font: 600 .95rem var(--mono); }
.px-f:disabled { opacity: .6; }
.px-f:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.px-out { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--radius-s); font-size: .9375rem; }
.px-out.yes { color: var(--green2); background: color-mix(in srgb, var(--green) 10%, transparent); }
.px-out.no { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); }
.px details { margin-top: 10px; font-size: .9375rem; }
.px:not(.live) .px-row { display: none; }
.px-score { margin-left: 6px; font-weight: 650; color: var(--green2); }
.dlrow { margin: 6px 0 10px; }
/* /clash/ sample questions */
.cq { list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.cq > li { min-width: 0; }
.cq > li { padding: 18px 20px; }
.cq h3 { margin: 4px 0 10px; font-size: 1.125rem; }
.cq-opts { margin: 10px 0; padding-left: 1.6em; display: grid; gap: 4px; font-family: var(--mono); }
/* shared-result challenge banner and how-to steps (Daily Fix, Cell Clash, team game pages) */
.chal { margin: 8px 0 20px; border: 2px solid var(--green); background: color-mix(in srgb, var(--green) 9%, var(--card)); }
.chal h2 { margin: 4px 0 10px; font-size: clamp(1.25rem, 3.2vw, 1.6rem); }
.steps-list { list-style: none; padding: 0; display: grid; gap: 10px; margin: 8px 0 24px; }
.steps-list li { display: grid; gap: 4px; padding: 14px 16px; } .steps-list li span { color: var(--ink2); }

/* ---------- returning visitors (CTA_STATE in gen/build.js) ---------- */
html[data-cw]:not([data-cw-ok]) [data-cta="start"], html[data-cw]:not([data-cw-ok]) [data-back], html[data-cw-plus]:not([data-cw-ok]) [data-plus-alt] { visibility: hidden; }
html[data-cw-plus] [data-cta="plus"] { display: none !important; }
/* Plus members: no Free-vs-Plus wording, no plan pills (everything is theirs) */
[data-plus-show] { display: none; }
html[data-cw-plus] [data-plus-show] { display: revert; }
html[data-cw-plus] [data-plus-hide], html[data-cw-plus] .pill.free, html[data-cw-plus] .pill.plus { display: none !important; }

/* ========== HOME: the app's own look (tokens, glass, lesson parts and mascots ported from app.html) ========== */
:root { --glass: rgba(255, 255, 255, .6); --glass2: rgba(255, 255, 255, .86); --stroke: rgba(255, 255, 255, .9); --spec: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(18, 32, 26, .04);
  --ok: #0D8040; --ok2: #0A7037; --flame: #FF8A1F; --flame-ink: #9A4A00; --ref0: #1F64D8; --ref1: #8A3FD1; --bg-line: rgba(20, 60, 40, .055); --blob1: #BFEBD2; --blob2: #C9DDF8; --blob3: #F3DCEB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glass: rgba(30, 44, 39, .55); --glass2: rgba(34, 49, 44, .9); --stroke: rgba(255, 255, 255, .12); --spec: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(0, 0, 0, .2);
  --ok: #2FC874; --ok2: #4ED68A; --flame-ink: #FFB46B; --ref0: #7AAEFF; --ref1: #C79BFF; --bg-line: rgba(160, 230, 200, .045); --blob1: #0F4A30; --blob2: #13305C; --blob3: #3E1A3A; } }
:root[data-theme="dark"] { --glass: rgba(30, 44, 39, .55); --glass2: rgba(34, 49, 44, .9); --stroke: rgba(255, 255, 255, .12); --spec: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(0, 0, 0, .2);
  --ok: #2FC874; --ok2: #4ED68A; --flame-ink: #FFB46B; --ref0: #7AAEFF; --ref1: #C79BFF; --bg-line: rgba(160, 230, 200, .045); --blob1: #0F4A30; --blob2: #13305C; --blob3: #3E1A3A; }
body.home::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(40vmax 40vmax at 8% 12%, var(--blob1), transparent 70%), radial-gradient(38vmax 38vmax at 92% 30%, var(--blob2), transparent 70%),
  radial-gradient(34vmax 34vmax at 55% 105%, var(--blob3), transparent 70%),
  repeating-linear-gradient(0deg, var(--bg-line) 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, var(--bg-line) 0 1px, transparent 1px 96px), var(--bg); }
.glass { background: var(--glass); border: 1px solid var(--stroke); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: var(--spec), var(--shadow); }
.cel { display: block; overflow: visible; }
.cel .eyes { transform-box: fill-box; transform-origin: center; }
.cel .face-cheer { display: none; }
@keyframes celPop { 0% { transform: scale(.4) translateY(30px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes celBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-2deg); } }
@keyframes celBlink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.12); } }
@keyframes hxIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes hxFill { from { background: color-mix(in srgb, var(--ok) 40%, var(--cell)); } }

/* hero: one lesson moment */
.hx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-areas: "head sheet" "play sheet"; gap: 18px 56px; align-items: start; padding: 52px 0 16px; scroll-margin-top: 96px; }
.hx-head { grid-area: head; align-self: end; } .hx-sheet { grid-area: sheet; align-self: center; } .hx-play { grid-area: play; }
.hx-eyebrow { margin: 0 0 8px; font: 700 .9375rem var(--round); color: var(--green2); }
.hx h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); line-height: 1.04; letter-spacing: -.03em; margin: 0; }
.hx-sheet { position: relative; border-radius: 22px; padding: 14px; }
.hx-prog { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); margin: 2px 62px 12px 2px; overflow: hidden; }
.hx-prog i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 65%, #fff)); transition: width .7s cubic-bezier(.2, 1.2, .4, 1); }
.hx.live:not(.won) .hx-prog i { width: 6%; }
.hx-fbar { align-items: center; min-height: 44px; margin-bottom: 10px; padding-top: 4px; padding-bottom: 4px; }
.hx-f { font-size: .9375rem; font-weight: 600; }
.hx.typing .hx-f::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: text-bottom; background: var(--green); }
.hx-grid { margin: 0; }
.hx-t td { height: 32px; padding: 4px 10px; min-width: 0; transition: background-color .2s, color .2s; }
.hx-t td.tot { font-weight: 650; }
.hx-t td.tgt { color: var(--green2); font-weight: 700; }
.hx-t td.hx-q { color: var(--ink3); text-align: center; }
.hx-t td.filled { color: var(--ok2); background: color-mix(in srgb, var(--ok) 13%, var(--cell)); animation: hxFill .6s ease both; }
.hx-t td.filled.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--cell)); box-shadow: inset 0 0 0 2px var(--bad); animation: none; }
.hx-t td.r0 { background: color-mix(in srgb, var(--ref0) 11%, var(--cell)); box-shadow: inset 2px 0 0 var(--ref0), inset -2px 0 0 var(--ref0); }
.hx-t td.r1 { background: color-mix(in srgb, var(--ref1) 11%, var(--cell)); box-shadow: inset 2px 0 0 var(--ref1), inset -2px 0 0 var(--ref1); }
.hx-t tr:nth-child(2) td.r0 { box-shadow: inset 2px 2px 0 var(--ref0), inset -2px 0 0 var(--ref0); }
.hx-t tr:nth-child(2) td.r1 { box-shadow: inset 2px 2px 0 var(--ref1), inset -2px 0 0 var(--ref1); }
.hx-t tr:nth-child(6) td.r0 { box-shadow: inset 2px -2px 0 var(--ref0), inset -2px 0 0 var(--ref0); }
.hx-t tr:nth-child(6) td.r1 { box-shadow: inset 2px -2px 0 var(--ref1), inset -2px 0 0 var(--ref1); }
.hx-t td.hit { font-weight: 750; }
.hx-t td.miss { color: var(--ink3); text-decoration: line-through; }
.hx-cel { position: absolute; top: -24px; right: -8px; width: 64px; height: 64px; filter: drop-shadow(0 10px 14px rgba(18, 100, 60, .25)); }
.hx-cel .cel-body { transform-origin: 60px 104px; }
.hx.won .hx-cel .face-happy { display: none; } .hx.won .hx-cel .face-cheer { display: inline; }
.hx-ask { display: flex; gap: 10px; align-items: flex-start; }
.hx-buddy { flex: none; width: 52px; height: 52px; margin-top: 2px; }
.bubble { position: relative; flex: 1; min-width: 0; padding: 10px 14px 12px; border-radius: 18px; background: var(--glass2); border: 1px solid var(--stroke); box-shadow: var(--spec), 0 6px 18px -10px rgba(0, 0, 0, .25); }
.bubble::before { content: ""; position: absolute; left: -7px; top: 20px; width: 14px; height: 14px; background: inherit; border-left: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); transform: rotate(45deg); }
.bubble .kicker { margin: 0; font: 650 .875rem var(--sans); color: hsl(var(--h) 65% var(--hue-l)); }
.bubble .prompt { margin: 2px 0 0; font: 700 1.1875rem/1.3 var(--round); }
.hx-choices { display: grid; gap: 10px; margin-top: 14px; }
.hx-choice { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--hair); background: var(--glass2); color: var(--ink); cursor: pointer; text-align: left; font: inherit; box-shadow: var(--spec), 0 3px 0 -1px var(--hair); transition: transform .1s, border-color .12s; }
.hx-choice code { font-size: 1rem; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.hx-choice kbd { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--hair); font: 600 .8125rem var(--sans); color: var(--ink3); }
.hx-choice:hover:not(:disabled) { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.hx-choice:active:not(:disabled) { transform: translateY(2px); }
.hx-choice:disabled { cursor: default; color: var(--ink); }
.hx-choice.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--glass2)); box-shadow: inset 0 0 0 1px var(--ok); }
.hx-choice.right kbd { background: var(--ok); border-color: var(--ok); color: var(--on-green); }
.hx-choice.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--glass2)); box-shadow: inset 0 0 0 1px var(--bad); }
.hx-choice.wrong code { text-decoration: line-through; }
.hx-choice.gone { display: none; }
.hx-msg { margin: 4px 0 0; color: var(--bad); font-weight: 650; font-size: .9375rem; line-height: 1.35; }
.hx-win { margin-top: 14px; padding: 14px 16px 16px; border-radius: 18px; background: color-mix(in srgb, var(--ok) 13%, var(--glass2)); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.hx-win[hidden] { display: none; }
.hx-wtop { display: flex; gap: 12px; align-items: flex-start; }
.hx-wcel { flex: none; width: 48px; height: 48px; }
.hx-wt { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: 750 1.1875rem var(--round); color: var(--ok2); }
.hx-done { display: inline-flex; align-items: center; gap: 4px; padding: .2em .65em .2em .45em; border-radius: 99px; background: var(--ok); color: var(--on-green); font: 700 .8125rem var(--sans); }
.hx-done svg { width: 14px; height: 14px; }
.hx-why { margin: 4px 0 0; color: var(--ink2); }
.hx-go { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 0; }
.hx-go .fine { font-size: .875rem; color: var(--ink2); }
.hx:not(.live) .hx-choices, .hx:not(.live) .hx-wt { display: none; }
.hx-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }
@media (prefers-reduced-motion: no-preference) {
  .hx-cel .cel-body { animation: celBob 3.2s ease-in-out infinite; }
  .cel .eyes { animation: celBlink 5.5s infinite; }
  .hx.won .hx-cel .cel-body, .hx-win .hx-wcel .cel-body { animation: celPop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
  .hx.live .hx-win:not([hidden]) { animation: hxIn .35s ease both; }
}

/* glimpses of the real thing */
.peek-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.peek { display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 16px; border-radius: 22px; background: var(--glass); border-color: var(--stroke); box-shadow: var(--spec), var(--shadow); }
.peek h3 { margin: 12px 4px 0; font-size: 1.125rem; }
.peek p { margin: 0 4px; color: var(--ink2); }
.peek-more { margin: 16px 0 0; color: var(--ink2); }
/* each card is one tap target: the heading link stretches over it; "How it works" sits above as a quiet second link */
.peek { position: relative; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.peek h3 a.peek-a { color: var(--ink); text-decoration: none; }
.peek-a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.peek-a:focus-visible { outline: none; }
.peek:has(.peek-a:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; }
.peek p a { position: relative; z-index: 2; color: var(--ink2); font-weight: 600; }
.peek p a:hover { color: var(--link); }
.peek .peek-go { margin: auto 4px 0; padding-top: 10px; font-weight: 700; color: var(--link); }
.peek-go span, .peek-more a span { display: inline-block; transition: transform .18s ease; }
.peek:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--stroke)); box-shadow: var(--spec), var(--shadow-hover); }
.peek:hover .peek-go span, .peek-more a:hover span { transform: translateX(3px); }
.peek-more a { font-weight: 650; text-decoration: none; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) { .peek:hover { transform: translateY(-2px); } .peek:active { transform: translateY(0) scale(.99); transition-duration: .08s; } }
.glimpse { position: relative; height: 248px; overflow: hidden; border-radius: 16px; border: 1px solid var(--hair); background: color-mix(in srgb, var(--cell) 72%, transparent); }
/* Path */
.pg ol { list-style: none; margin: 0 auto; padding: 12px 0 0; width: 272px; display: grid; gap: 10px; }
.pg-stop.open { margin: 18px 0 4px; }
.pg-stop { position: relative; display: flex; align-items: center; gap: 12px; padding-left: calc(56px + var(--x)); }
.pg-node { flex: none; width: 46px; height: 42px; border-radius: 15px; display: grid; place-items: center; font: 800 1rem var(--round); border: 1px solid var(--stroke); background: var(--glass2); box-shadow: var(--spec), 0 4px 0 -1px hsl(var(--h) 40% 50% / .35); }
.pg-node svg { width: 20px; height: 20px; }
.pg-stop.done .pg-node { background: linear-gradient(180deg, hsl(var(--h) 60% 92%), hsl(var(--h) 55% 84%)); color: hsl(var(--h) 70% 28%); }
.pg-stop.open .pg-node { width: 54px; height: 48px; background: linear-gradient(180deg, hsl(var(--h) 72% 34%), hsl(var(--h) 70% 27%)); color: #fff; border-color: rgba(255, 255, 255, .4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 0 -1px hsl(var(--h) 70% 22%), 0 10px 20px -8px hsl(var(--h) 70% 40% / .6); outline: 4px solid hsl(var(--h) 75% 55% / .3); outline-offset: 4px; }
.pg-stop.locked .pg-node { color: var(--ink3); box-shadow: var(--spec), 0 4px 0 -1px var(--hair); }
.pg-l { display: grid; min-width: 0; line-height: 1.25; }
.pg-l b { font: 700 .875rem var(--round); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-l span { font-size: .75rem; color: var(--ink3); font-weight: 600; }
.pg-stop.open .pg-l span { color: var(--green2); }
.pg-tag { position: absolute; left: calc(52px + var(--x)); top: -26px; padding: .15em .6em; border-radius: 9px; background: var(--glass2); box-shadow: var(--spec), var(--shadow); font: 750 .75rem var(--round); color: var(--ink); }
.pg-cel { position: absolute; left: calc(var(--x) + 2px); top: 4px; width: 40px; height: 40px; }
:root[data-theme="dark"] .pg-stop.done .pg-node { background: hsl(var(--h) 40% 22%); color: hsl(var(--h) 70% 72%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pg-stop.done .pg-node { background: hsl(var(--h) 40% 22%); color: hsl(var(--h) 70% 72%); } }
/* Cell Clash */
.cg { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.cg-q { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--glass2); box-shadow: var(--spec); font: 700 .9375rem/1.3 var(--round); }
.cg-t { flex: none; width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--green) 0 70%, color-mix(in srgb, var(--ink) 12%, transparent) 70% 100%); display: grid; place-items: center; }
.cg-t i { width: 18px; height: 18px; border-radius: 50%; background: var(--card); }
.cg-a { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cg-a li { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; color: #fff; background: var(--c); box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000); min-width: 0; }
.cg-a code { font-size: .875rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.cg-a svg { flex: none; width: 18px; height: 18px; fill: currentColor; opacity: .9; }
.cg-a .c0 { --c: #C8333A; } .cg-a .c1 { --c: #2459C9; } .cg-a .c2 { --c: #E0A100; color: #1D1600; } .cg-a .c3 { --c: #0D7D45; }
/* Daily Fix and streak */
.fg { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.fg-top { display: flex; align-items: center; gap: 10px; }
.fg-flame { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 8px; border-radius: 99px; background: color-mix(in srgb, var(--flame) 16%, var(--cell)); color: var(--flame-ink); font: 800 1.25rem var(--round); }
.fg-flame svg { width: 22px; height: 22px; color: var(--flame); }
.fg-k { font-weight: 650; color: var(--ink2); }
.fg-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; font: 650 .75rem var(--sans); color: var(--ink3); }
.fg-week i { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 3px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--flame); }
.fg-week i svg { width: 16px; height: 16px; }
.fg-week .on i { background: color-mix(in srgb, var(--flame) 18%, var(--cell)); }
.fg-week .now i { box-shadow: inset 0 0 0 2px var(--flame); }
.fg-card { margin-top: auto; display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--flame) 12%, var(--glass2)); border: 1px solid color-mix(in srgb, var(--flame) 30%, transparent); }
.fg-badge { font: 700 .75rem var(--sans); color: var(--flame-ink); text-transform: uppercase; letter-spacing: .06em; }
.fg-card b { font: 750 1.0625rem var(--round); }
.fg-time { font-size: .8125rem; color: var(--ink2); }

/* directory: every course, function, guide and field link, compact */
.dir-grid { columns: 2; column-gap: 14px; }
.dir-grid nav { break-inside: avoid; margin-bottom: 14px; display: inline-block; width: 100%; background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.dir-grid h3 { margin: 0 0 8px; font-size: 1.0625rem; }
.dir-units { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.dir-units a { display: flex; align-items: center; gap: 8px; min-height: 40px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9375rem; line-height: 1.25; }
.dir-units a:hover, .dir-links a:hover { color: var(--green2); text-decoration: underline; }
.dir-n { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font: 750 .75rem var(--round); background: hsl(var(--h) 60% 50% / var(--hue-bg)); color: hsl(var(--h) 65% var(--hue-l)); }
.dir-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dir-chips a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--hair); background: var(--cell); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.dir-chips li[style] a { border-left: 4px solid hsl(var(--h) 60% 45%); }
.dir-chips a:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--hair)); }
.dir-chips code { color: var(--green2); font-weight: 700; }
.dir-links { list-style: none; padding: 0; margin: 0; }
.dir-links a { display: block; padding: 8px 0; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9375rem; line-height: 1.35; }
.dir-links li + li { border-top: 1px solid var(--hair); }
.dir .more { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 0 18px; }

@media (max-width: 760px) {
  .hx { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "sheet" "play"; gap: 14px; padding: 16px 0 8px; }
  .hx h1 { font-size: clamp(1.75rem, 8.2vw, 2.5rem); }
  .hx-eyebrow { margin-bottom: 4px; font-size: .875rem; }
  .hx-sheet { padding: 10px; border-radius: 18px; }
  .hx-prog { height: 8px; margin: 2px 52px 10px 2px; }
  .hx-cel { width: 52px; height: 52px; top: -20px; right: -6px; }
  .hx-fbar { min-height: 40px; margin-bottom: 8px; }
  .hx-t td { height: 30px; padding: 3px 8px; }
  .hx-buddy { width: 44px; height: 44px; }
  .bubble { padding: 8px 12px 10px; } .bubble::before { top: 16px; }
  .bubble .prompt { font-size: 1.0625rem; }
  .hx-choices { gap: 8px; margin-top: 10px; }
  .hx-choice { min-height: 48px; padding: 8px 12px; }
  .hx-go .btn { flex: 1 1 100%; }
  .peek-list { grid-template-columns: minmax(0, 1fr); } .dir-grid { columns: 1; }
}
@media (max-width: 979px) { .peek-list { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 600px) and (max-width: 979px) { .peek { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr; column-gap: 22px; } .peek .glimpse { grid-row: 1 / 6; } .peek h3 { grid-row: 2; margin-top: 0; } .peek p { grid-row: 3; align-self: start; margin-top: 4px; } .peek .peek-go { grid-row: 4; margin-top: 0; } }
@media (max-width: 400px) { .dir-units { grid-template-columns: minmax(0, 1fr); } }
html[data-cw] .hx-go .fine { display: none; }
@media (max-width: 340px) { .top-in > .btn { padding-left: .8em; padding-right: .8em; font-size: .875rem; } }
