:root, [data-theme="midnight"] {
  --bg: #0f1624; --bg2: #162033; --card: #1a2539; --line: #2a3752; --ink: #eef2f8; --muted: #9aa8bf;
  --accent: #5aa9ff; --accent-ink: #06121f; --good: #3ecf8e; --bad: #ff6b6b; --gold: #f2b544; --shadow: 0 6px 24px rgba(0,0,0,.35);
}
[data-theme="lab"] {
  --bg: #f4f6f9; --bg2: #ffffff; --card: #ffffff; --line: #dde3ec; --ink: #172033; --muted: #5f6b80;
  --accent: #1f6fd1; --accent-ink: #ffffff; --good: #138a55; --bad: #c43b3b; --gold: #b07b06; --shadow: 0 4px 16px rgba(20,30,50,.08);
}
[data-theme="neon"] {
  --bg: #07070d; --bg2: #10101c; --card: #141426; --line: #2b2b4d; --ink: #f4f1ff; --muted: #a29fc4;
  --accent: #39f3c8; --accent-ink: #04130f; --good: #39f3c8; --bad: #ff4f8b; --gold: #ffd84d; --shadow: 0 0 24px rgba(57,243,200,.12);
}
[data-theme="gold"] {
  --bg: #15120c; --bg2: #1d1911; --card: #241f15; --line: #3d3424; --ink: #f7f0e1; --muted: #bfae8a;
  --accent: #e0b25a; --accent-ink: #1a1306; --good: #8fd18b; --bad: #ef7d6b; --gold: #e0b25a; --shadow: 0 6px 24px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
body.focus { padding-bottom: 24px; }
body.focus .tabbar { display: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .3em; line-height: 1.2; }
h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: .4em 0; }
.small { font-size: .85rem; } .muted { color: var(--muted); } .big { font-size: 1.15rem; } .center { text-align: center; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
#app { max-width: 760px; margin: 0 auto; }
header.top { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header.top h1 { font-size: 1.05rem; text-align: center; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand b { font-size: .9rem; color: var(--accent); letter-spacing: .02em; }
.icon { background: none; border: 0; font-size: 1.5rem; padding: 4px 8px; cursor: pointer; color: var(--ink); justify-self: start; }
header.top > :last-child { justify-self: end; }
.back { font-size: 2rem; line-height: 1; }
main.body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
main.body.wide { padding: 12px 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.kicker { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 12px 16px; min-height: 46px; cursor: pointer; font-weight: 600; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 2px 4px; margin-left: auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 10px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.answer { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-size: 1.1rem; }
.answer:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.answer { font-size: 1rem; resize: vertical; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); }
.pill.gold { color: var(--gold-ink); border-color: var(--gold); }
.bar { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--good)); border-radius: 99px; transition: width .3s; }
.meter { display: inline-flex; gap: 3px; } .meter b { width: 12px; height: 8px; border-radius: 3px; background: var(--line); } .meter b.on { background: var(--accent); } .meter b.m { background: var(--good); }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 50; transition: .25s; max-width: 90vw; text-align: center; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal .box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; width: min(460px, 100%); display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow: auto; }
.celebrate { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.celebrate .medal { font-size: 4rem; animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.confetti { position: fixed; top: -12px; width: 8px; height: 14px; z-index: 60; border-radius: 2px; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bg2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; color: var(--muted); text-decoration: none; font-size: .72rem; }
.tabbar a .ico { font-size: 1.25rem; line-height: 1.1; }
.tabbar a.on { color: var(--accent); }
/* today */
.hello { display: flex; justify-content: space-between; align-items: center; }
.streak { text-align: right; display: flex; flex-direction: column; } .streak b { font-size: 1.4rem; }
.mission.done { border-color: var(--good); }
.steps2 { margin: 6px 0 12px; padding-left: 22px; } .steps2 li { margin: 4px 0; } .steps2 li.ok { color: var(--good-ink); } .steps2 li.ok::marker { content: '✓  '; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tri { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.tri b { font-size: 1.6rem; } .tri span { font-weight: 600; } .tri small { color: var(--muted); } .tri.warn b { color: var(--gold-ink); }
.hero { text-align: center; } .heroicon { font-size: 3.5rem; }
/* practice */
.sessionbar { display: flex; align-items: center; gap: 10px; } .sessionbar .bar { flex: 1; }
.stage { display: flex; flex-direction: column; gap: 12px; }
.qhead { display: flex; gap: 8px; align-items: center; }
.prompt { font-size: 1.3rem; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .opts.six { grid-template-columns: 1fr 1fr; }
.opt { min-height: 58px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-size: 1.05rem; font-weight: 600; cursor: pointer; padding: 8px; }
.opt.mono { font-size: .92rem; font-weight: 500; }
.opt.right { background: var(--good); color: #04130c; border-color: transparent; }
.opt.wrong { background: transparent; color: var(--muted); text-decoration: line-through; }
.typerow { display: flex; gap: 8px; align-items: center; } .typerow .answer { flex: 1; }
.prefix { font-size: 1.05rem; color: var(--muted); }
.hints .hint { background: var(--bg2); border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 8px; }
.feedback { font-weight: 700; min-height: 1.4em; } .feedback.good { color: var(--good-ink); } .feedback.bad { color: var(--bad); }
.reveal { display: flex; gap: 12px; align-items: center; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats3 > div { background: var(--bg2); border-radius: 12px; padding: 10px 6px; display: flex; flex-direction: column; border: 1px solid var(--line); }
.stats3 b { font-size: 1.4rem; } .stats3 span { font-size: .78rem; color: var(--muted); }
.shake { animation: shake .35s; } @keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
/* tiles and cards */
.tile { width: 64px; height: 72px; flex: none; background: var(--c); color: #10151f; border-radius: 10px; display: grid; grid-template-rows: auto 1fr auto auto; padding: 4px 6px; line-height: 1.05; }
.tile .z { font-size: .7rem; font-weight: 700; } .tile .s { font-size: 1.5rem; font-weight: 800; align-self: center; } .tile .n { font-size: .55rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tile .m { font-size: .55rem; opacity: .8; }
.tile.big { width: 96px; height: 108px; } .tile.big .s { font-size: 2.3rem; } .tile.big .n { font-size: .72rem; } .tile.big .m { font-size: .7rem; } .tile.big .z { font-size: .85rem; }
.ecard { --c: var(--line); background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ehead { display: flex; gap: 14px; align-items: center; }
.etitle { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.facts { margin: 0; display: grid; gap: 6px; } .fact { display: grid; grid-template-columns: 9.5em 1fr; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.fact dt { color: var(--muted); font-size: .85rem; } .fact dd { margin: 0; font-weight: 600; }
.fact.focus { background: color-mix(in srgb, var(--gold) 18%, transparent); outline: 1px solid var(--gold); }
.where { display: flex; gap: 10px; align-items: center; }
.mini { display: grid; grid-template-columns: repeat(18, 6px); grid-auto-rows: 6px; gap: 1px; }
.mini i { background: var(--line); border-radius: 1px; } .mini i.on { background: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.skrow { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); gap: 8px; }
/* the periodic table */
.ptwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.ptable { --gap: 2px; --cell: max(19px, calc((min(100vw, 760px) - 40px - 12px - 18 * var(--gap)) / 18)); display: grid; grid-template-columns: 10px repeat(18, var(--cell)); grid-template-rows: 14px repeat(7, var(--cell)) 8px repeat(2, var(--cell)); gap: var(--gap); width: max-content; margin: 0 auto; }
.ptable.compact { --cell: max(19px, calc((min(100vw, 680px) - 24px - 12px - 18 * var(--gap)) / 18)); }
@media (max-width: 480px) { .ptable { --gap: 1px; } .cell { border-radius: 2px; } .cell .z { display: none; } .gnum { font-size: .5rem; } }
.gnum { font-size: .55rem; color: var(--muted); text-align: center; align-self: end; }
.cell { position: relative; background: var(--c); color: #10151f; border: 0; border-radius: 4px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; cursor: pointer; font-weight: 700; font-size: calc(var(--cell) * .38); min-width: 0; }
.cell .z { position: absolute; top: 2px; left: 3px; font-size: calc(var(--cell) * .2); font-weight: 600; opacity: .75; }
.cell .s { font-size: calc(var(--cell) * .42); }
.cell.dim { opacity: .18; cursor: default; }
.cell.blank { background: var(--bg2); border: 1px solid var(--edge); color: var(--ink); }
.cell.blank.dim { opacity: .35; }
.cell.filled { background: var(--c); color: #10151f; animation: pop .25s; }
.cell.missed { background: transparent; color: var(--bad); outline: 2px solid var(--bad); }
.cell.hl { outline: 3px solid var(--gold); outline-offset: 1px; z-index: 2; }
.cell.righttap { background: var(--good) !important; } .cell.wrongtap { background: var(--bad) !important; }
.cell.hit { background: var(--bad); color: #fff; } .cell.missshot { background: var(--line); color: var(--muted); } .cell.sunk { background: #7a1f2b; color: #fff; }
.cell.hidden-ship { outline: 2px dashed var(--bad); }
.ptwrap.locked .cell { pointer-events: none; }
.cell.tier0 { background: var(--bg2); color: var(--muted); border: 1px solid var(--line); }
.cell.tier1 { background: #b08d57; } .cell.tier2 { background: #c0c7d1; } .cell.tier3 { background: #f2c94c; }
.cell.tier4 { background: linear-gradient(135deg, #ff9a9e, #fad0c4, #a1c4fd, #c2e9fb, #d4fc79); }
.ph { font-size: calc(var(--cell) * .22); color: var(--muted); display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; } .lg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg i.tier1 { background: #b08d57; } .lg i.tier2 { background: #c0c7d1; } .lg i.tier3 { background: #f2c94c; } .lg i.tier4 { background: linear-gradient(135deg, #ff9a9e, #a1c4fd, #d4fc79); }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; align-self: center; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
/* games */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile2 { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.tile2 .ico { font-size: 1.8rem; } .tile2 .lbl { font-weight: 700; }
.gamebar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.3rem; }
.clue { font-size: 1.35rem; font-weight: 800; text-align: center; padding: 10px; background: var(--card); border-radius: 12px; border: 1px solid var(--line); min-height: 2.4em; }
.score { font-size: 2.6rem; font-weight: 800; }
.ehdr, .erow { display: grid; grid-template-columns: 1.2fr repeat(5, 1fr); gap: 4px; text-align: center; font-size: .78rem; }
.ehdr span { color: var(--muted); } .erow span { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 2px; font-weight: 700; font-size: .9rem; }
.erow span.ok { background: var(--good); color: #04130c; border-color: transparent; } .erow span.near { background: var(--gold); color: #1a1306; border-color: transparent; }
.erows { display: flex; flex-direction: column; gap: 4px; }
.word { font-size: 2rem; font-weight: 800; letter-spacing: .12em; text-align: center; }
.spellout { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 54px; align-items: center; }
.spellout.good .stile { outline: 2px solid var(--good); }
.stile { background: var(--c); color: #10151f; border: 0; border-radius: 8px; min-width: 46px; height: 50px; font-size: 1.35rem; font-weight: 800; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; cursor: pointer; padding: 0 6px; }
.stile small { font-size: .55rem; font-weight: 600; }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sortcard { display: flex; justify-content: center; padding: 10px; }
.sortrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .sortbtn { min-height: 64px; }
.memgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mem { min-height: 70px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-weight: 700; font-size: 1rem; cursor: pointer; }
.mem:not(.up)::after { content: '?'; color: var(--muted); font-size: 1.4rem; }
.mem.up { background: var(--card); } .mem.done { background: var(--c); color: #10151f; border-color: transparent; }
/* progress */
.rank { display: flex; gap: 12px; align-items: center; } .rank .big { font-size: 2.6rem; }
.req { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; margin: 8px 0; } .req .bar { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chip { background: var(--bg2); border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; font-size: .85rem; cursor: pointer; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; opacity: .55; }
.badge.got { opacity: 1; border-color: var(--gold); } .badge .bi { font-size: 1.8rem; } .badge .bn { font-weight: 700; }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; gap: 12px; align-items: center; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.li .ico { font-size: 1.4rem; width: 1.6em; text-align: center; }
.days { display: flex; gap: 6px; flex-wrap: wrap; } .day { border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-weight: 600; color: var(--muted); }
.day.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 96px; }
.wd { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; font-size: .75rem; color: var(--muted); height: 100%; }
.wd i { width: 70%; background: var(--line); border-radius: 4px 4px 0 0; min-height: 3px; } .wd.ok i { background: var(--good); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { .opts { grid-template-columns: repeat(4, 1fr); } .opts.six { grid-template-columns: repeat(3, 1fr); } .grid { grid-template-columns: repeat(3, 1fr); } }

/* family colors (last, so they win over component defaults) */
.f-alkali { --c: #ff8a80; } .f-alkaline { --c: #ffb74d; } .f-transition { --c: #81d4fa; } .f-post { --c: #a5d6a7; } .f-metalloid { --c: #80cbc4; }
.f-nonmetal { --c: #fff176; } .f-halogen { --c: #d4e157; } .f-noble { --c: #ce93d8; } .f-lanthanide { --c: #f48fb1; } .f-actinide { --c: #bcaaa4; }
.tile, .cell, .stile, .mem.done { --c: #cfd6e0; }
.f-alkali.f-alkali, .f-alkali .tile { --c: #ff8a80; }
.f-alkaline.f-alkaline, .f-alkaline .tile { --c: #ffb74d; }
.f-transition.f-transition, .f-transition .tile { --c: #81d4fa; }
.f-post.f-post, .f-post .tile { --c: #a5d6a7; }
.f-metalloid.f-metalloid, .f-metalloid .tile { --c: #80cbc4; }
.f-nonmetal.f-nonmetal, .f-nonmetal .tile { --c: #fff176; }
.f-halogen.f-halogen, .f-halogen .tile { --c: #d4e157; }
.f-noble.f-noble, .f-noble .tile { --c: #ce93d8; }
.f-lanthanide.f-lanthanide, .f-lanthanide .tile { --c: #f48fb1; }
.f-actinide.f-actinide, .f-actinide .tile { --c: #bcaaa4; }
.ecard .tile { --c: inherit; }
.cfgnote { display: block; font-family: system-ui, sans-serif; font-weight: 500; font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* ---- explainers ---- */
.xlink { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; text-align: left; border-bottom: 1px dotted currentColor; line-height: 1.25; }
.xlink:hover, .xlink:focus-visible { color: var(--accent); }
.xi { flex: none; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid currentColor; font: italic 700 10px/1 Georgia, serif; display: inline-flex; align-items: center; justify-content: center; opacity: .75; }
.qhead .xlink { font-size: .85rem; }
.lgbtn { background: none; border: 0; padding: 2px 0; font: inherit; color: inherit; cursor: pointer; } .lgbtn:hover { color: var(--accent); }
.xvis { margin: 2px 0; } .xvis svg { width: 100%; height: auto; display: block; }
.xshort { font-weight: 600; margin: 0; }
.xcap { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 0; }
.xbody p { margin: .45em 0; font-size: .95rem; }
.xleg { justify-content: center; margin-top: 4px; }
.xsvg .t { fill: var(--ink); } .xsvg .tm { fill: var(--muted); } .xsvg .tb { fill: var(--ink); font-weight: 700; } .xsvg .dk { fill: #10151f; }
.xsvg .base { fill: var(--line); } .xsvg .band { fill: var(--accent); opacity: .25; } .xsvg .mk { fill: none; stroke: var(--gold); stroke-width: 2.5; }
.xsvg .msym { fill: #10151f; font-weight: 800; } .xsvg .ph { fill: none; stroke: var(--muted); stroke-dasharray: 2 2; } .xsvg .ph.on { stroke: var(--gold); stroke-width: 2; stroke-dasharray: none; }
.xsvg .ln { stroke: var(--muted); fill: none; stroke-width: 1; } .xsvg .shell { fill: none; stroke: var(--line); stroke-width: 1.2; } .xsvg .shellout { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.xsvg .ein { fill: var(--accent); } .xsvg .eout { fill: var(--gold); } .xsvg .nuc { fill: #ff8a80; }
.xstrip { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 6px 0; }
.xarrow { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: .7rem; } .xarrow span { font-size: 1.3rem; line-height: 1; }
.xchips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 6px; }
.xchip { color: #10151f; border-radius: 6px; padding: 2px 6px; font: 700 .85rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
/* ---- how to play ---- */
.howto .howhead { display: flex; align-items: center; gap: 10px; } .hico { font-size: 2rem; }
ol.rules { padding-left: 1.3em; margin: .4em 0 .8em; } ol.rules li { margin: .35em 0; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 600; margin: 4px 0 8px; }
/* ---- Elementle ---- */
.elegend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); } .okc { color: var(--good-ink); } .nearc { color: var(--gold-ink); }
.erow span { font-size: .78rem; line-height: 1.15; padding: 7px 2px; overflow-wrap: anywhere; display: flex; align-items: center; justify-content: center; min-height: 40px; }
.erow span:first-child { font-size: .95rem; }
.eknown { display: flex; flex-direction: column; gap: 4px; } .eknown .chip { cursor: default; background: color-mix(in srgb, var(--accent) 14%, var(--bg2)); }
.eexample { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.cell.neu { background: var(--bg2); color: var(--ink); border: 1px solid var(--line); }
.cell.out { opacity: .18; } .cell.guessed { outline: 2px solid var(--muted); outline-offset: -2px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; font-size: .85rem; color: var(--muted); }
.xstrip { flex-wrap: nowrap; gap: 4px; } .xarrow { width: 46px; text-align: center; } .xme .tile { box-shadow: 0 0 0 3px var(--gold); }
.ehdr, .erow { grid-template-columns: .85fr .85fr .85fr .95fr 1.3fr 1.3fr; }
.erow span { overflow-wrap: normal; } .erow span:nth-child(5), .erow span:nth-child(6) { font-size: .7rem; }
/* ---- lessons and placement ---- */
.medal { font-size: 3rem; line-height: 1.1; }
.lead { font-size: 1.02rem; }
.feedback.info { color: var(--ink); font-weight: 500; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.trybox { background: color-mix(in srgb, var(--accent) 8%, var(--card)); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.trybox .big { margin: 0; font-weight: 600; }
.meet { display: flex; flex-direction: column; gap: 10px; }
.meet .msec { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.meet .msec h3 { font-size: .95rem; margin-bottom: 4px; } .meet .msec p { margin: .3em 0; }
.ehead.small { display: flex; gap: 12px; align-items: center; } .ehead.small h3 { margin: 0; }
.xstrip.two { flex-direction: column; gap: 10px; } .xstrip .pair { display: flex; align-items: center; gap: 4px; }
.hookbox { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.hookbox p { margin: .25em 0; }
.tile2.locked { opacity: .6; } .tile2.locked .ico { filter: grayscale(1); }
.li.done .ico { color: var(--good-ink); } .li.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; } .li.locked { opacity: .5; cursor: default; }
.req b { font-size: 1.05rem; }
.trybox .ptable, .trybox .ptable.compact { --cell: max(12px, calc((min(100vw, 760px) - 62px - 10px - 18 * var(--gap)) / 18)); }
/* ---- story walk and Mendeleev's Puzzle ---- */
.walk { display: flex; flex-direction: column; gap: 10px; }
.wstop { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.wstop.locked { opacity: .55; }
.wnum { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.wbody { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; } .whead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .wico { font-size: 1.3rem; }
.whead .answer { flex: 1; min-width: 140px; padding: 8px 10px; }
.tiles.left { justify-content: flex-start; }
.cell.gap { background: var(--gold); color: #1a1306; border: 0; font-size: calc(var(--cell) * .45); }
.mystery { display: flex; flex-direction: column; gap: 6px; } .clues { margin: 0; padding-left: 1.2em; } .clues li { margin: .2em 0; font-weight: 600; }
.ptable { --cell: max(16px, calc((min(100vw, 760px) - 40px - 12px - 18 * var(--gap)) / 18)); }
.ptable.compact { --cell: max(15px, calc((min(100vw, 680px) - 40px - 12px - 18 * var(--gap)) / 18)); }

/* ---- more themes ---- */
[data-theme="ocean"] {
  --bg: #08161f; --bg2: #0e2230; --card: #112a3a; --line: #1f4256; --ink: #e8f4fa; --muted: #8fb3c4;
  --accent: #2ec4d6; --accent-ink: #032026; --good: #3ecf8e; --bad: #ff6b6b; --gold: #f2b544; --shadow: 0 6px 24px rgba(0,0,0,.35);
}
[data-theme="forest"] {
  --bg: #0d1712; --bg2: #14241b; --card: #182b20; --line: #2a4434; --ink: #eaf5ee; --muted: #93b39f;
  --accent: #7fd88f; --accent-ink: #06170b; --good: #3ecf8e; --bad: #ff7a6b; --gold: #e9c46a; --shadow: 0 6px 24px rgba(0,0,0,.35);
}
[data-theme="berry"] {
  --bg: #170d1a; --bg2: #231428; --card: #2a1830; --line: #44284d; --ink: #f6ecf8; --muted: #b99cc0;
  --accent: #e78adf; --accent-ink: #22061f; --good: #3ecf8e; --bad: #ff6b6b; --gold: #f2b544; --shadow: 0 6px 24px rgba(0,0,0,.4);
}
[data-theme="daylight"] {
  --bg: #fbf7f0; --bg2: #ffffff; --card: #ffffff; --line: #e7dfd2; --ink: #2a2118; --muted: #6f6353;
  --accent: #b9531a; --accent-ink: #ffffff; --good: #2e8b57; --bad: #c43b3b; --gold: #a87306; --shadow: 0 4px 16px rgba(60,40,20,.08);
}
[data-theme="aurora"] {
  --bg: #060b14; --bg2: #0c1424; --card: #0f1a2e; --line: #22335a; --ink: #eef6ff; --muted: #9fb4d6;
  --accent: #7cf5c9; --accent-ink: #04140e; --good: #7cf5c9; --bad: #ff6b9a; --gold: #ffd166; --shadow: 0 0 28px rgba(124,245,201,.12);
}
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.swatch { border: 2px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer; background: var(--bg); color: var(--ink); text-align: left; font: inherit; }
.swatch .sw-top { display: flex; gap: 4px; padding: 8px; background: var(--bg); }
.swatch .sw-top i { flex: 1; height: 18px; border-radius: 4px; background: var(--card); border: 1px solid var(--line); }
.swatch .sw-top i:nth-child(2) { background: var(--accent); border: 0; } .swatch .sw-top i:nth-child(3) { background: var(--gold); border: 0; }
.swatch .sw-name { display: block; padding: 6px 8px 8px; font-size: .8rem; font-weight: 700; background: var(--card); color: var(--ink); }
.swatch .sw-name small { display: block; font-weight: 500; color: var(--muted); }
.swatch.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.swatch.locked { opacity: .55; cursor: default; }
@media (min-width: 700px) { .themes { grid-template-columns: repeat(5, 1fr); } }
/* ranks ladder */
.ranklink { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-align: left; cursor: pointer; margin-top: 2px; }
.ranklink span { color: var(--accent); font-size: .9em; }
.rankstep .rs-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 4px; }
.rankstep .rs-head .big { font-size: 2rem; } .rankstep h3 { margin: 0; }
.rankstep .rs-tag { white-space: nowrap; }
.rankstep.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rankstep.next { border-color: var(--gold); }
.rankstep.later { opacity: .8; }
.rankstep.done .rs-tag, .rankstep.cur .rs-tag { color: var(--good-ink); }
.rankstep .rs-how { grid-column: 1 / -1; line-height: 1.35; }
.rankstep .rs-gift { margin: 8px 0 0; }

/* period numbers down the side and a one-line key to the axes */
.pnum { font-size: .55rem; color: var(--muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 1px; }
@media (max-width: 480px) { .pnum { font-size: .5rem; } }
.ptwrap .axes { display: flex; justify-content: space-between; max-width: 760px; margin: 0 auto 2px; font-size: .62rem; color: var(--muted); letter-spacing: .02em; }

/* the atom picture */
.xsvg .nucbg { fill: rgba(255, 138, 128, .16); stroke: #ff8a80; stroke-width: 1; }
.xsvg .pro { fill: #ff6b6b; stroke: rgba(0, 0, 0, .3); stroke-width: .6; } .xsvg .neu { fill: #b0bec5; stroke: rgba(0, 0, 0, .3); stroke-width: .6; }
.k-pro, .k-neu, .k-e, .k-eo { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.k-pro { background: #ff6b6b; } .k-neu { background: #b0bec5; } .k-e { background: var(--accent); } .k-eo { background: var(--gold); }
.atomkey { justify-content: center; }
.atombox { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin: 12px 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); }
.atombox .atomvis svg { display: block; max-width: 100%; height: auto; }
.atombox h3 { margin: 0 0 6px; font-size: 1rem; }
.atombox ul.counts { list-style: none; padding: 0; margin: 0 0 6px; } .atombox ul.counts li { margin: 3px 0; }
.atombox p { margin: 4px 0; }
@media (max-width: 380px) { .atombox { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.xlink.tiny { font-size: .95em; }
.xvis svg.atomsvg { width: 100%; max-width: 230px; height: auto; display: block; margin: 0 auto; }
/* the full element card stacks the atom picture over its counts; the lesson's compact one sits side by side */
.atombox:not(.compact) { display: flex; flex-direction: column; align-items: center; text-align: center; }
.atombox:not(.compact) .atomvis svg { width: 200px; }
.atombox:not(.compact) ul.counts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.atombox.compact { grid-template-columns: 132px 1fr; }
.atombox.compact .atomvis svg { width: 132px; }

/* properties on the element card */
.propbox { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); }
.propbox h3 { margin: 0 0 6px; font-size: 1rem; }
.propbox ul.props { list-style: none; padding: 0; margin: 0 0 6px; }
.propbox ul.props li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.propbox ul.props li:last-child { border-bottom: 0; }
.propbox ul.props b { text-align: right; font-weight: 600; }
.xrel { color: var(--muted); }
/* ---------- quizzes ---------- */
.grade { display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 84px; border-radius: 50%; font-size: 2.6rem; font-weight: 800; margin: 6px auto; border: 3px solid currentColor; }
.grade.small { width: 40px; height: 40px; font-size: 1.2rem; border-width: 2px; margin: 0; }
.grade.gA { color: var(--good-ink); } .grade.gB { color: #7bd389; } .grade.gC { color: var(--gold-ink); } .grade.gD { color: #ff9f68; } .grade.gF { color: var(--bad); }
.quizrow .qr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.quizrow.locked { opacity: .7; } .quizrow .ico { font-size: 1.5rem; }
ul.missed { list-style: none; padding: 0; margin: 0; } ul.missed li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
table.grades { width: 100%; border-collapse: collapse; font-size: .9rem; } table.grades th, table.grades td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); } table.grades th { color: var(--muted); font-weight: 600; }
ul.hist { padding-left: 18px; margin: 4px 0; }
.card.admin label { display: block; margin-top: 10px; }
.danger { margin-top: 14px; padding: 10px; border: 1px solid var(--bad); border-radius: 12px; }
.btn.dangerbtn { border-color: var(--bad); color: var(--bad); }
.quizready { border-color: var(--gold); }
/* ---------- the atom lab ---------- */
.a3dhost { width: 100%; display: flex; justify-content: center; }
.a3d { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
.a3dcv { display: block; border-radius: 16px; background: radial-gradient(circle at 50% 45%, var(--bg2), var(--bg)); cursor: grab; touch-action: none; }
.a3dcv:active { cursor: grabbing; }
.a3dtip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: .8rem; opacity: 0; transition: opacity .2s; max-width: 150px; }
.a3dtip.on { opacity: 1; }
.a3dnav { align-items: center; gap: 8px; } .a3dnav select { flex: 1; }
.a3dctl { flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--ink); padding: 8px 14px; font: inherit; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.chips.a3dsubs { justify-content: center; } .chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.a3dbtn { margin-top: 6px; }
.buildvis { display: flex; justify-content: center; } .buildvis svg { width: 100%; max-width: 240px; height: auto; }
.ctrs .ctr { display: grid; grid-template-columns: 1fr auto 44px auto; align-items: center; gap: 8px; padding: 6px 0; }
.ctrs .ctr b.cnt { text-align: center; font-size: 1.2rem; }
.buildread .good { color: var(--good-ink); } .buildread .bad { color: var(--bad); } .buildread .warn { color: var(--gold-ink); }
.buildgoal { border-color: var(--gold); }
.labdoor { margin-bottom: 10px; } .labdoor.locked { opacity: .7; } .labbanner { border-color: var(--accent); }
/* ---------- the reaction lab ---------- */
.rxslots { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.rxslot { padding: 8px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.rxslot.on { border-style: solid; border-color: var(--accent); color: var(--ink); font-weight: 600; }
.rxwater { margin-bottom: 8px; }
.rxcard h2 { margin: 6px 0; } .rxeq { font-size: 1.1rem; }
.rxvis { display: flex; justify-content: center; } .rxvis svg { width: 100%; max-width: 340px; height: auto; }
.rxsvg circle.arrived { transition: r .3s; }
ul.counts { list-style: none; padding: 0; margin: 0 0 6px; } ul.counts li { margin: 3px 0; }
.chips.orbs { margin-top: 6px; } .chip.small { font-size: .78rem; padding: 3px 8px; }

/* ---------- accounts and syncing ---------- */
.signincard h3 { margin: 0 0 6px; }
.signincard .or { margin: 14px 0 0; }
input.otp { font-size: 1.7rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.signmsg { min-height: 1.4em; margin-top: 10px; }
.card.setup { margin-top: 28px; }
.card.lapsed { border-color: var(--gold); }
.card.lapsed p { margin-top: 0; }
.btn.busy { opacity: .6; }
.card.account { margin-bottom: 14px; }
.card.account .cloudstatus { margin: 4px 0 10px; }
.card.addperson label, .card.account label { display: block; margin-top: 8px; }
.card.addperson { margin-top: 14px; }
.students .last { white-space: nowrap; }
.studentsbtn { margin: 4px 0 10px; }
.signstep .btn.primary, .card.addperson .btn.primary { margin-top: 12px; }
.signstep .row { margin-top: 10px; }
h3.section { margin: 26px 0 8px; }

/* ---- accessibility (Oct 16 audit) ---- */
html { --edge: color-mix(in srgb, var(--muted) 65%, var(--bg2)); --good-ink: var(--good); --gold-ink: var(--gold); }
[data-theme="lab"], [data-theme="daylight"] { --edge: color-mix(in srgb, var(--muted) 82%, var(--bg2)); --good-ink: #0d7043; --gold-ink: #7d5600; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
::placeholder { color: var(--muted); opacity: 1; }
.kicker.keepcase { text-transform: none; letter-spacing: .02em; }
.phonetip { display: none; }
@media (max-width: 600px) and (orientation: portrait) { p.phonetip { display: block; } span.phonetip { display: inline; } }
button.tri.tap { font: inherit; color: inherit; cursor: pointer; border-color: var(--accent); }
button.tri.tap small { color: var(--accent); }
.erasenote .linkbtn { padding: 0; }

/* ---- how sure (confidence tap) ---- */
.confrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.confrow .btn.conf { flex: 1 1 0; min-width: 84px; padding: 10px 8px; }
.btn.conf.c-sure { border-color: var(--good-ink); } .btn.conf.c-guess { border-style: dashed; }
.opt.sel { outline: 3px solid var(--accent); outline-offset: 1px; }
.cell.seltap { outline: 3px solid var(--accent); outline-offset: 1px; z-index: 1; }
.ownwords { display: flex; flex-direction: column; gap: 8px; } .ownline { margin: .2em 0; }
.calib { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.calib div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; }
.calib b { font-size: 1.35rem; } .calib span { font-size: .8rem; } .calib small { color: var(--muted); }
/* ---- trends, ions and bonds ---- */
.heatkey { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.heatbar { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1px solid var(--edge); } .heatbar i { width: 22px; height: 14px; }
.cell.heatcell { border: 1px solid rgba(0,0,0,.12); }
.seg.wrap { flex-wrap: wrap; justify-content: center; border-radius: 14px; }
.atomrow { display: flex; justify-content: center; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.atomcol { display: flex; flex-direction: column; align-items: center; gap: 2px; } .atomcol small { color: var(--muted); }
.ionchip { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 6px 8px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--edge); font-weight: 800; }
.ionchip.pos { background: #ffd2cb; color: #4a1208; border-color: transparent; } .ionchip.neg { background: #cfe8ff; color: #0a2a4a; border-color: transparent; }
.xsvg .arrow { stroke: var(--accent); stroke-width: 2.5; fill: none; } .xsvg .arrowhead { fill: var(--accent); }
/* ---- habits and what's new ---- */
.planline { font-weight: 600; margin: .2em 0; } .planlink { margin: -4px 0 0; }
.card.repair { border-color: var(--gold); }
.newsentry h3 { margin-top: 2px; } .newslist { margin: 6px 0 4px; padding-left: 1.2em; } .newslist li { margin: .35em 0; }
.modal .box .newsentry + .newsentry { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.card.lessoncard { border-color: var(--accent); }
/* ---- install ---- */
.card.installcard { border-color: var(--accent); }
.installsteps { margin: 8px 0; padding-left: 1.3em; } .installsteps li { margin: .45em 0; }
.installwelcome { margin-top: 18px; text-align: center; } .installwelcome p { margin-bottom: 6px; }
.installset .btn { margin-top: 4px; }
/* ---- people on this device, passwords ---- */
.people { display: grid; gap: 10px; margin: 6px 0 14px; }
.person { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--edge, var(--line)); background: var(--card); color: inherit; font: inherit; cursor: pointer; min-height: 64px; }
.person:hover, .person:focus-visible { border-color: var(--accent); }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 800; flex: none; }
.pmeta { flex: 1; min-width: 0; overflow-wrap: anywhere; } .ptag { flex: none; }
.prow { display: flex; align-items: center; gap: 12px; } .li.prow { cursor: default; }
.switchchip { align-self: flex-start; width: auto; max-width: 100%; display: inline-flex; align-items: center; gap: 8px; margin: -2px 0 10px; padding: 4px 12px 4px 4px; border-radius: 99px; border: 1px solid var(--edge, var(--line)); background: var(--bg2, transparent); color: inherit; font: inherit; font-size: .9em; cursor: pointer; min-height: 32px; }
.backto { margin-bottom: 10px; }
.pinin { font-size: 1.6em; letter-spacing: .4em; text-align: center; max-width: 220px; margin: 6px auto; display: block; }
.pwlabel > span { display: flex; justify-content: space-between; align-items: baseline; } .showpw { font-weight: 600; }
.pwrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.card.pwcard { border-color: var(--accent); }
.brand { display: inline-flex; align-items: center; gap: 6px; } .brandmark { display: inline-flex; line-height: 0; } .brandmark svg { border-radius: 24%; }
.heroicon .brandmark svg { border-radius: 22%; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
/* ---- the logo and name, set like the logo: "Quiz" bold in the text color, "otope" in the logo's teal ---- */
:root { --brand-teal: #4FD6CF; }
[data-theme="lab"], [data-theme="daylight"] { --brand-teal: #0B8A92; }
.wordmark { font-family: 'Avenir Next', 'Montserrat', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; letter-spacing: -.01em; white-space: nowrap; line-height: 1.1; color: var(--ink); }
.wordmark b { font-weight: 800; color: var(--ink); } .wordmark span { font-weight: 500; color: var(--brand-teal); }
header.top h1.brandhead { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 1.5rem; overflow: visible; }
.brandhead .brandmark svg, .brand .brandmark svg { border-radius: 24%; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hero .heroicon { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 1rem; margin: 8px 0 18px; }
.hero .heroicon .wordmark { font-size: 2.6rem; }
.signhero { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 18px; } .signhero .wordmark { font-size: 2.1rem; }
.signhero .brandmark svg { border-radius: 22%; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* ---------- Chemistry 1 ---------- */
.ctable { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 4px 0; }
.ctable th, .ctable td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.ctable th { background: var(--bg2); font-weight: 700; }
.ctable.small { font-size: .78rem; } .ctable.small th, .ctable.small td { padding: 4px 6px; }
.ctable.baltbl { max-width: 320px; margin: 8px auto; } .ctable.baltbl td { text-align: center; }
.ceq { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 4px 0; font-size: .95rem; overflow-wrap: anywhere; line-height: 1.6; }
.ceq s { opacity: .55; text-decoration-thickness: 2px; text-decoration-color: var(--bad); }
.cbox { background: var(--bg2); border-radius: 10px; padding: 8px 10px; }
h3.chemunit { margin: 18px 0 2px; } h3.chemunit .small { font-weight: 500; }
.chemdoor { border-color: var(--accent); margin-bottom: 10px; }
.orbrow { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; padding: 8px 0; }
.orbsub { display: flex; flex-direction: column; align-items: center; gap: 4px; } .orbsub small { color: var(--muted); font-weight: 700; }
.orbboxes { display: flex; }
.orbbox { width: 34px; height: 34px; border: 1.5px solid var(--ink); margin-left: -1.5px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; font-weight: 700; background: var(--card); color: var(--ink); padding: 0; letter-spacing: -2px; }
.orbbox.tap { cursor: pointer; } .orbbox.tap:focus-visible { outline: 2px solid var(--accent); z-index: 1; }
.orbrow.build .orbbox { width: 40px; height: 40px; }
.specbar { display: flex; border-radius: 10px; overflow: hidden; font-size: .68rem; font-weight: 700; }
.specbar span { flex: 1; padding: 10px 2px; text-align: center; }
.mixshelf { margin: 8px 0; } .solchip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; } .solchip.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.soldot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; }
.mixout { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.mixsvg .mixfill { transform-origin: bottom; animation: mixrise .8s ease-out both; transform-box: fill-box; }
.mixsvg .ppt { animation: pptfall 1.6s ease-in both; }
.mixsvg .pptbed { animation: pptbed 2.2s ease-in both; }
.mixsvg .bub { animation: bubup 1.6s ease-in infinite; }
.mixsvg .thermofill { transform-origin: bottom; transform-box: fill-box; animation: warm 2s ease-out both; }
@keyframes mixrise { from { transform: scaleY(.1); } to { transform: scaleY(1); } }
@keyframes pptfall { 0% { opacity: 0; transform: translateY(-30px); } 30% { opacity: 1; } 100% { opacity: 1; transform: translateY(0); } }
@keyframes pptbed { 0%, 50% { opacity: 0; } 100% { opacity: 1; } }
@keyframes bubup { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-80px); } }
@keyframes warm { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
.mixsvg.still *, .mixsvg.still .bub { animation: none !important; }
.mixsvg.still .bub { opacity: .9; }
@media (prefers-reduced-motion: reduce) { .mixsvg * { animation: none !important; } .mixsvg .bub { opacity: .9; } }
.balrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 10px 0; }
.balterm { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.balterm .btn.small { min-height: 30px; padding: 2px 10px; }
.balco { font-size: 1.3rem; color: var(--accent); } .balf { font-size: 1.05rem; font-weight: 700; }
.balarrow, .balplus { font-size: 1.3rem; font-weight: 700; color: var(--muted); }
.coach { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.coachdone.good { border-color: var(--good); }
label.radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; } label.radio input { margin-top: 4px; width: 18px; height: 18px; }
