/* Mole Unit Practice — styles.
   Palette is color-blind safe: blue = correct, burnt orange = needs work, indigo = hint.
   Every state also carries an icon and a word, never color alone. */
:root {
  --paper: #eef2f5; --card: #ffffff; --ink: #14202b; --muted: #55646f; --line: #d3dbe2; --grid: rgba(20, 32, 43, .07);
  --brand: #0b5c6b; --brand-ink: #ffffff; --brand-soft: #dff0f3;
  --gold: #f6c744; --gold-ink: #3d2f00; --mark-accent: #8a6500;
  --ok: #0a58c2; --ok-bg: #e4eefc; --ok-ink: #082f66;
  --warn: #b34700; --warn-bg: #fff0e1; --warn-ink: #5c2600;
  --hint: #4b3fa8; --hint-bg: #ece9fb; --hint-ink: #261f66;
  --info-bg: #e9eef2;
  --shadow: 0 1px 0 rgba(20, 32, 43, .06), 0 6px 18px -10px rgba(20, 32, 43, .25);
  --r: 12px; --sans: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f161c; --card: #17212a; --ink: #e8eef3; --muted: #9fb0bd; --line: #2b3a46; --grid: rgba(232, 238, 243, .06);
    --brand: #67cbdc; --brand-ink: #062a31; --brand-soft: #123741;
    --gold: #f6c744; --gold-ink: #2b2100; --mark-accent: #f6c744;
    --ok: #86b8ff; --ok-bg: #12294a; --ok-ink: #d6e7ff;
    --warn: #ffb067; --warn-bg: #3a2210; --warn-ink: #ffe2c7;
    --hint: #b4a9ff; --hint-bg: #231f45; --hint-ink: #e4dfff;
    --info-bg: #1f2c36; --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .7);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4rem; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .6rem; } small { font-size: .8em; } code { font-family: var(--mono); background: var(--info-bg); padding: 0 .3em; border-radius: 4px; }
sub, sup { line-height: 0; }
.muted { color: var(--muted); } .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 2rem; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: .6rem 1rem; z-index: 99; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[data-focus]:focus { outline: none; }

/* layout */
.page { max-width: 1080px; margin: 0 auto; padding: 0 1rem calc(2rem + env(safe-area-inset-bottom)); }
.page.narrow { max-width: 560px; }
.top { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: 1rem 0 .75rem; }
.brand { display: flex; align-items: center; gap: .65rem; }
.mark { position: relative; flex: none; display: block; width: 3.5rem; height: 3.5rem; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); box-shadow: 4px 4px 0 var(--ink); }
.mk-n, .mk-w { position: absolute; font-size: .7rem; line-height: 1; color: var(--muted); }
.mk-n { left: .3rem; top: .25rem; } .mk-w { left: 0; right: 0; bottom: .25rem; text-align: center; }
.mk-s { position: absolute; left: 0; right: 0; top: 1rem; text-align: center; font-size: 1.55rem; font-weight: 800; line-height: 1; color: var(--mark-accent); }
.brand { gap: .9rem; } .brand-t { font-size: 1.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; } .brand-t .hab { color: var(--mark-accent); } .brand-s { font-size: .9rem; color: var(--muted); margin-top: .15rem; }
.login-tag { font-size: 1.3rem; font-weight: 700; line-height: 1.3; margin: .5rem 0 1rem; }
.site-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.top-r { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; } .top-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.who { font-family: var(--mono); font-size: .85rem; background: var(--card); border: 1px solid var(--line); padding: .25rem .6rem; border-radius: 999px; }
.who small { color: var(--muted); font-family: var(--sans); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }

/* buttons & inputs */
.btn { font: inherit; font-weight: 600; min-height: 44px; padding: .55rem 1rem; border-radius: 10px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer; touch-action: manipulation; }
.btn:hover { background: var(--info-bg); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); } .btn.primary:hover { filter: brightness(1.08); background: var(--brand); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.btn.small { min-height: 38px; padding: .3rem .75rem; font-size: .9rem; } .btn.lg { min-height: 52px; font-size: 1.05rem; padding: .7rem 1.4rem; }
.btn[disabled] { opacity: .5; cursor: default; } .btn small { font-weight: 500; opacity: .8; }
.linkish { background: none; border: 0; color: var(--brand); text-decoration: underline; font: inherit; cursor: pointer; padding: .8rem 0 0; text-align: left; }
.in { font: inherit; font-size: 16px; width: 100%; min-height: 44px; padding: .4rem .6rem; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--card); color: var(--ink); font-variant-numeric: tabular-nums; }
.in[readonly] { background: var(--info-bg); border-style: dashed; }
.in.big { min-height: 50px; font-size: 1.05rem; } select.in { width: auto; }
.chk { display: inline-flex; gap: .4rem; align-items: center; margin: .4rem 0; font-size: .9rem; }
label { font-weight: 600; }
.err { color: var(--warn-ink); background: var(--warn-bg); border-left: 4px solid var(--warn); padding: .4rem .7rem; margin: .5rem 0; border-radius: 4px; } .err:empty { display: none; }
.notice { background: var(--info-bg); border-radius: 8px; padding: .5rem .8rem; font-size: .9rem; }
.login { display: grid; gap: .35rem; } .login label { margin-top: .5rem; }

/* chips, segmented */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.chip { display: inline-flex; gap: .15rem; align-items: center; background: var(--info-bg); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .7rem; font-size: .9rem; }
.chip.pts { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.segs { display: inline-flex; align-items: center; gap: .25rem; background: var(--info-bg); border-radius: 10px; padding: 3px; }
.segs-l { font-size: .8rem; color: var(--muted); padding: 0 .5rem; }
.seg { font: inherit; font-weight: 600; font-size: .9rem; min-height: 38px; padding: .2rem .8rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.seg.on { background: var(--card); box-shadow: 0 0 0 1.5px var(--ink); } .seg.on::before { content: "✓ "; }

/* home */
.home-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .75rem; margin: .5rem 0 1rem; }
.mix { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .mix { grid-template-columns: 1fr auto; align-items: center; } }
.mix-r { display: grid; gap: .75rem; justify-items: start; }
.picks { display: flex; flex-wrap: wrap; gap: .4rem; }
.pick { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; font-size: .88rem; padding: .25rem .65rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; min-height: 36px; }
.pick:has(input:checked) { border-color: var(--ink); background: var(--brand-soft); }
.sect { margin: 1.6rem 0; }
.sub-grid { display: grid; gap: .9rem 1.2rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin: .6rem 0 1rem; }
.sub h3 { color: var(--muted); font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.tiles { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tiles.two { grid-template-columns: 1fr 1fr; gap: .6rem; }
.tile { position: relative; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; text-align: center; gap: .1rem; min-height: 130px; padding: .5rem .5rem .6rem; background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; cursor: pointer; font: inherit; box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s; touch-action: manipulation; }
.tile:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); } .tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tile.big { min-height: 160px; }
.tile-n { justify-self: start; font-size: .72rem; font-family: var(--mono); color: var(--muted); }
.tile-sym { align-self: center; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.tile.big .tile-sym { font-size: 2.2rem; }
.tile-name { font-weight: 700; font-size: .88rem; line-height: 1.2; }
.tile-stat { font-size: .74rem; color: var(--muted); margin-top: .1rem; }
@media (prefers-reduced-motion: reduce) { .tile, .toast { transition: none; } }

/* practice */
.p-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .4rem 0 .8rem; }
.p-title { margin: 0; font-size: 1.2rem; flex: 1 1 auto; } .p-title small { color: var(--muted); font-weight: 500; }
.prob .kicker { color: var(--muted); font-size: .85rem; margin-bottom: .2rem; }
.stmt { font-size: 1.2rem; line-height: 1.45; margin-bottom: .7rem; } .prob-tools { display: flex; flex-wrap: wrap; gap: .5rem; }
.work { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 22px 22px; background-color: var(--card); }
.work.locked { opacity: .92; }
.ws-head h2 { margin-bottom: .1rem; } .ws-head p { font-size: .9rem; }
.chain-scroll { overflow-x: auto; padding: .4rem .2rem .8rem; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.times { font-size: 1.5rem; font-weight: 700; color: var(--muted); }
.term, .fac, .ans { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; padding: .55rem .6rem .6rem; }
.term.given { padding: 1.4rem .9rem .8rem; } .t-top { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.t-lab, .step-n { position: absolute; top: -.7rem; left: .7rem; background: var(--ink); color: var(--card); font-size: .72rem; font-weight: 700; padding: 0 .5rem; border-radius: 999px; }
.fac { padding-top: .9rem; } .fac .bar { height: 3px; background: var(--ink); margin: .35rem 0; border-radius: 2px; }
.side { display: flex; gap: .35rem; } .side .cell { flex: 0 0 auto; }
.in.n { width: 6.2rem; } .in.u { width: 5.6rem; } .in.s { width: 6.2rem; } .in.el { width: 4.6rem; font-weight: 700; } .in.wide { width: 11rem; }
.fac-tools { position: absolute; right: -2px; top: -1.05rem; display: flex; gap: .2rem; }
.ico { font: inherit; width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer; display: grid; place-items: center; touch-action: manipulation; }
.ico:hover { background: var(--info-bg); }
.ans { border-style: double; border-width: 4px; padding-top: 1rem; } .preview { font-size: .85rem; color: var(--muted); min-height: 1.3em; margin-top: .25rem; }
.add { align-self: center; }
.flag { display: none; font-size: .78rem; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); border: 1.5px solid var(--warn); border-radius: 6px; padding: 0 .45rem; margin-top: .3rem; width: fit-content; }
.flag::before { content: "! "; }
.fac.bad, .ans.bad, .cell.bad, .choices.bad { outline: 3px dashed var(--warn); outline-offset: 2px; border-radius: 10px; } .fac.bad .flag, .ans.bad .flag { display: block; }
.cell { position: relative; display: inline-block; } .cell.bad::after { content: "!"; position: absolute; right: -.4rem; top: -.7rem; width: 1.2rem; height: 1.2rem; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: var(--warn-ink); background: var(--warn-bg); border: 1.5px solid var(--warn); border-radius: 50%; }
.tbl-scroll { overflow-x: auto; margin: .4rem 0; } .work-table { border-collapse: separate; border-spacing: .35rem .5rem; min-width: 480px; }
.work-table th { text-align: left; font-size: .85rem; vertical-align: bottom; } .work-table th small { display: block; font-weight: 500; color: var(--muted); }
.work-table .in { width: 100%; min-width: 4.6rem; } .work-table .cell { display: block; } .work-table .rm { width: 40px; }
.total-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .7rem 0; font-weight: 600; }
.block { background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; padding: .7rem .8rem; margin: .7rem 0; }
.b-head { display: flex; justify-content: space-between; align-items: center; } .b-head h3 { margin: 0; }
.field { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .3rem 0; } .f-l { font-weight: 600; font-family: var(--mono); }
.add-step { margin: .7rem 0; } .final { display: grid; gap: .3rem; margin-top: .9rem; } .final label { font-size: 1.05rem; }
.choices { border: 0; padding: 0; margin: .9rem 0 0; display: grid; gap: .5rem; } .choices legend { font-weight: 700; margin-bottom: .4rem; padding: 0; }
.choice { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .8rem; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--card); cursor: pointer; font-weight: 500; min-height: 48px; }
.choice input { margin-top: .25rem; width: 1.15rem; height: 1.15rem; } .choice:has(input:checked) { background: var(--brand-soft); box-shadow: inset 4px 0 0 var(--brand); font-weight: 700; }
.actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .6rem; padding: .7rem 0 calc(.7rem + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 70%, transparent); }
.fb-wrap:empty, .res:empty { display: none; }
.fb { display: flex; gap: .8rem; padding: .85rem 1rem; border-radius: var(--r); border: 2px solid; margin: .4rem 0 1rem; }
.fb-ic { flex: 0 0 auto; width: 2rem; height: 2rem; display: grid; place-items: center; font-weight: 800; border-radius: 50%; color: #fff; }
.fb-b p { margin: .15rem 0 0; } .fb-b strong { font-size: 1.05rem; } .fb .good { font-size: .88rem; opacity: .9; margin-top: .4rem; }
.fb.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-ink); } .fb.ok .fb-ic { background: var(--ok); color: #fff; }
.fb.warn { background: var(--warn-bg); border-color: var(--warn); color: var(--warn-ink); } .fb.warn .fb-ic { background: var(--warn); color: #fff; }
.fb.hint { background: var(--hint-bg); border-color: var(--hint); color: var(--hint-ink); } .fb.hint .fb-ic { background: var(--hint); color: #fff; }
.fb.info { background: var(--info-bg); border-color: var(--muted); } .fb.info .fb-ic { background: var(--muted); color: var(--card); }
@media (prefers-color-scheme: dark) { .fb.ok .fb-ic, .fb.warn .fb-ic, .fb.hint .fb-ic { color: #0b1117; } }
.fb.big { flex-wrap: wrap; } .fb.big .chips { margin-top: .5rem; }
.res { display: grid; gap: .8rem; justify-items: start; } .res .fb { width: 100%; margin-bottom: 0; }
.how { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; } .how summary { cursor: pointer; font-weight: 600; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .15rem; text-align: center; font-size: .92rem; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 .3rem .1rem; } .frac > span:last-child { padding: .1rem .3rem 0; }
.sol-chain { overflow-x: auto; padding: .3rem 0; line-height: 2.4; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(8, 14, 20, .55); display: grid; place-items: center; padding: 1rem; z-index: 50; }
.modal { background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--r); width: min(720px, 100%); max-height: min(86vh, 800px); display: flex; flex-direction: column; box-shadow: 8px 8px 0 rgba(0, 0, 0, .35); }
.m-head { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); } .m-head h2 { margin: 0; }
.m-body { padding: 1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.el-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .4rem; margin: .6rem 0 1.2rem; }
.el { display: grid; justify-items: center; border: 1.5px solid var(--ink); border-radius: 6px; padding: .3rem; } .el b { font-size: 1.1rem; } .el span { font-family: var(--mono); font-size: .85rem; } .el small { color: var(--muted); font-size: .7rem; }
.ion-t { border-collapse: collapse; width: 100%; margin-bottom: 1rem; font-size: .9rem; } .ion-t th, .ion-t td { text-align: left; padding: .25rem .5rem; border-bottom: 1px solid var(--line); } .ion-t th { color: var(--muted); font-weight: 600; }
.mm-out { margin-top: .8rem; }

/* leaderboards */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.tab { font: inherit; font-weight: 600; min-height: 42px; padding: .3rem .9rem; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; } .tab.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); } .tab.on::before { content: "✓ "; }
.board-body { margin-top: 1rem; } .board-body h2 small { color: var(--muted); font-weight: 500; }
.lb { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .35rem; }
.lb li { display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; gap: .5rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.lb .rk { font-family: var(--mono); font-weight: 700; } .lb .nm { font-family: var(--mono); overflow-wrap: anywhere; } .lb .vl { font-variant-numeric: tabular-nums; font-weight: 600; }
.lb li.me { border: 2px solid var(--ink); box-shadow: inset 5px 0 0 var(--brand); font-weight: 700; }
.you { margin-left: .5rem; font-family: var(--sans); font-size: .72rem; background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 0 .5rem; }
.lb-me { font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--card); padding: .6rem 1rem; border-radius: 10px; z-index: 80; transition: opacity .4s; max-width: 90vw; } .toast.out { opacity: 0; }
@media (max-width: 520px) { h1 { font-size: 1.4rem; } .stmt { font-size: 1.1rem; } .tiles { grid-template-columns: repeat(2, 1fr); } .fac, .ans { width: 100%; } .side { flex-wrap: wrap; } .in.n, .in.u, .in.s { width: 100%; } .side .cell { flex: 1 1 28%; min-width: 6rem; } .term.given { width: 100%; } }

/* ---- reference: periodic table ---- */
.modal.wide { width: min(1120px, 100%); }
.ref-view { margin-top: .6rem; }
.pt-info { min-height: 1.6em; margin: .2rem 0 .5rem; }
.pt-scroll { overflow-x: auto; padding-bottom: .4rem; }
.pt { --pt-metal: #dbe8fb; --pt-nonmetal: #ffeccb; --pt-metalloid: #e9e2f8;
  display: grid; grid-template-columns: repeat(18, minmax(46px, 1fr)); grid-template-rows: repeat(7, auto) 10px repeat(2, auto); gap: 3px; min-width: 880px; }
@media (prefers-color-scheme: dark) { .pt { --pt-metal: #17304f; --pt-nonmetal: #3a2d12; --pt-metalloid: #2c2650; } }
.pe { position: relative; display: grid; align-content: center; justify-items: center; min-height: 54px; padding: 2px; border-radius: 5px; font: inherit; line-height: 1.05; color: var(--ink); cursor: pointer; text-align: center; touch-action: manipulation; }
.pe.metal { background: var(--pt-metal); border: 1.5px solid var(--ink); }
.pe.metalloid { background: var(--pt-metalloid); border: 1.5px dashed var(--ink); }
.pe.nonmetal { background: var(--pt-nonmetal); border: 2px dotted var(--ink); }
.pe.ph { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: .62rem; cursor: default; }
.pz { position: absolute; top: 2px; left: 3px; font-size: .58rem; color: var(--muted); font-family: var(--mono); }
.ps { font-weight: 800; font-size: 1.05rem; } .pm { font-size: .62rem; font-family: var(--mono); }
.pe.dim { opacity: .2; } .pe.hit { outline: 3px solid var(--brand); outline-offset: 1px; z-index: 1; } .pe.sel { outline: 3px solid var(--ink); outline-offset: 1px; z-index: 2; }
.pt-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; margin: .5rem 0 1rem; font-size: .85rem; }
.pt-legend .lg { display: inline-flex; align-items: center; gap: .4rem; }
.pe.sw { display: inline-block; min-height: 0; width: 1.6rem; height: 1.1rem; padding: 0; cursor: default; }
.pt-legend .pe.metal { background: #dbe8fb; } .pt-legend .pe.metalloid { background: #e9e2f8; } .pt-legend .pe.nonmetal { background: #ffeccb; }
@media (prefers-color-scheme: dark) { .pt-legend .pe.metal { background: #17304f; } .pt-legend .pe.metalloid { background: #2c2650; } .pt-legend .pe.nonmetal { background: #3a2d12; } }
.ionf { font-size: 1.05rem; white-space: nowrap; } .ionf sup { font-size: .72em; }
.rules th { width: 11rem; vertical-align: top; }

/* ---- calculator ---- */
.calc { position: fixed; right: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px)); z-index: 60; display: flex; flex-direction: column; max-height: calc(100vh - 24px); background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 6px 6px 0 rgba(0, 0, 0, .3); }
.calc[hidden] { display: none; }
.calc-h { display: flex; align-items: center; justify-content: space-between; padding: .35rem .5rem .35rem .75rem; border-bottom: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; }
.calc-hb { display: flex; gap: .3rem; } .calc-b { padding: .6rem; overflow-y: auto; -webkit-overflow-scrolling: touch; } .calc.min .calc-b { display: none; }
.calc-ex { font-family: var(--mono); font-size: 1rem; }
.calc-res { min-height: 2.6rem; padding: .2rem .1rem; text-align: right; font-size: 1.5rem; font-variant-numeric: tabular-nums; overflow-x: auto; white-space: nowrap; }
.calc-res.live { color: var(--muted); } .calc-res.final { font-weight: 700; }
.calc-res.err { color: var(--warn-ink); background: var(--warn-bg); border-left: 4px solid var(--warn); font-size: 1rem; text-align: left; padding: .4rem .6rem; border-radius: 4px; }
.calc-res.err::before { content: "! "; font-weight: 800; }
.calc-opts { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .2rem 0 .4rem; font-size: .85rem; } .calc-opts select.in { min-height: 38px; font-size: .9rem; }
.calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: .4rem; } .calc-keys[hidden] { display: none; }
.ck { font: inherit; font-weight: 700; min-height: 42px; padding: 0; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; touch-action: manipulation; }
.ck:hover { background: var(--info-bg); } .ck:active { transform: translateY(1px); }
.ck.fn { background: var(--info-bg); } .ck.eq { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.ck.const { background: var(--gold); color: var(--gold-ink); border-color: var(--gold-ink); font-size: .85rem; }
.calc-act { display: flex; gap: .4rem; margin-top: .6rem; } .calc-note { font-size: .8rem; margin: .5rem 0 0; }
.calc-d { margin-top: .4rem; } .calc-d summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.hrow { display: flex; justify-content: space-between; gap: .4rem; border-bottom: 1px solid var(--line); padding: .2rem 0; font-family: var(--mono); font-size: .85rem; }
.hrow button { font: inherit; background: none; border: 0; color: var(--ink); cursor: pointer; padding: .25rem; min-height: 36px; text-align: left; overflow-wrap: anywhere; } .hrow .hres { text-align: right; font-weight: 700; } .hrow button:hover { background: var(--info-bg); }
@media (max-width: 559px) { .calc { left: 0; right: 0; bottom: 0; width: auto; border-radius: 12px 12px 0 0; max-height: 78vh; } .pe { min-height: 50px; } }
@media (prefers-reduced-motion: reduce) { .ck:active, .btn:active { transform: none; } }

/* ---- units, leaderboard controls, sig fig cards, TI-style calculator ---- */
.kicker { color: var(--muted); font-size: .85rem; margin: 0 0 .1rem; }
.ucards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 1rem 0; }
.ucard { position: relative; display: grid; gap: .3rem; text-align: left; padding: 1.1rem 1rem 1rem; min-height: 150px; background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 4px 4px 0 var(--ink); cursor: pointer; font: inherit; touch-action: manipulation; transition: transform .12s, box-shadow .12s; }
.ucard:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); } .ucard:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.u-n { font-family: var(--mono); font-size: .8rem; color: var(--muted); } .u-t { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; } .u-b { color: var(--muted); font-size: .92rem; } .u-s { font-size: .8rem; font-weight: 600; align-self: end; }
.b-ctl { display: grid; gap: .6rem; } .b-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.b-row .segs select.in { width: auto; min-height: 36px; font-size: .9rem; padding: .1rem .4rem; }
.sig-card { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; margin: .6rem 0; background: var(--card); }
.sig-card h3 { margin-bottom: .3rem; } .ex { background: var(--info-bg); border-left: 4px solid var(--brand); border-radius: 4px; padding: .5rem .7rem; margin: .5rem 0; line-height: 1.7; }
.results h3 { margin: 1rem 0 .3rem; }
.calc-keys { gap: 5px; } .calc .ck { min-height: 40px; font-size: .92rem; }
.ck.op { background: var(--info-bg); border-width: 2px; } .ck.clr { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn); font-size: .8rem; }
.calc-hb .btn.small { min-height: 34px; padding: .1rem .55rem; font-size: .8rem; }

/* ---- my problems (history) ---- */
.h-ctl { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; } .h-ctl select.in { width: auto; min-height: 36px; font-size: .9rem; padding: .1rem .4rem; }
.h-list { display: grid; gap: .5rem; margin-top: .6rem; }
.h-row { display: grid; gap: .15rem; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; padding: .6rem .8rem; cursor: pointer; min-height: 56px; touch-action: manipulation; }
.h-row:hover { background: var(--info-bg); } .h-top { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.h-t { font-size: .82rem; color: var(--muted); } .h-s { font-size: .95rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.h-res { display: inline-flex; gap: .25rem; align-items: center; font-weight: 700; font-size: .85rem; padding: 0 .55rem; border-radius: 999px; border: 1.5px solid; }
.h-res.r-f, .h-res.r-s { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok); } .h-res.r-s { border-style: dashed; }
.h-res.r-v { background: var(--info-bg); border-color: var(--muted); border-style: dotted; } .h-res.r-u { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn); border-style: dashed; }
.h-q { font-size: .8rem; font-weight: 700; background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 0 .5rem; }
.h-facts { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin: .5rem 0; font-size: .92rem; }
.actions-inline { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.ask-q { margin: .5rem 0; padding: .5rem .8rem; border-left: 4px solid var(--brand); background: var(--info-bg); border-radius: 4px; font-size: .92rem; }
textarea.in { resize: vertical; margin-top: .4rem; }

/* ---- chemical reactions unit: equations, atom counts, charts ---- */
.eq-show { font-size: 1.35rem; padding: .6rem .85rem; margin: .7rem 0; background: var(--info-bg); border-left: 4px solid var(--brand); border-radius: 6px; overflow-x: auto; white-space: nowrap; line-height: 1.7; }
.eq-scroll { overflow-x: auto; padding: .5rem .2rem .9rem; }
.eq-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .7rem; font-size: 1.25rem; }
.eq-term { display: inline-flex; align-items: center; gap: .35rem; } .eq-f { font-size: 1.25rem; }
.eq-op { font-size: 1.5rem; font-weight: 700; color: var(--muted); }
.in.coef { width: 3.4rem; text-align: center; padding: .3rem; font-weight: 700; }
.in.st { width: 5.4rem; } select.in.st { min-height: 44px; }
.in.eqin { width: 100%; font-size: 1rem; } .cell.block { display: block; width: 100%; }
.atoms { border-collapse: collapse; margin: .6rem 0 0; font-variant-numeric: tabular-nums; background: var(--card); }
.atoms th, .atoms td { border: 1px solid var(--line); padding: .25rem .9rem; text-align: center; font-weight: 600; } .atoms thead th { background: var(--info-bg); font-size: .85rem; color: var(--muted); }
.final-block { border-width: 2.5px; }
.flag-done { font-size: 1.05rem; }
.h-q.done { background: var(--ok-bg); color: var(--ok-ink); border: 1.5px solid var(--ok); }
.act { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.act td:first-child { text-transform: capitalize; }
tr.hot td { background: var(--gold); color: var(--gold-ink); font-weight: 700; } tr.hot { outline: 2px solid var(--ink); }
.chart-img { display: block; width: 100%; max-width: 900px; height: auto; margin: .5rem 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
@media (max-width: 520px) { .eq-row, .eq-f { font-size: 1.1rem; } .in.coef { width: 3rem; } .eq-show { font-size: 1.15rem; } }

/* ---- my stats and unit locks ---- */
.stats h2 { margin-bottom: .4rem; } .stats h3 { margin: 1rem 0 .3rem; } .small { font-size: .82rem; }
.sbar { display: flex; height: 24px; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; margin: .5rem 0 .7rem; background: var(--card); }
.sbar i { display: block; height: 100%; }
.sw0 { background: var(--ok); }
.sw1 { background: repeating-linear-gradient(45deg, var(--ok) 0 5px, var(--ok-bg) 5px 10px); }
.sw2 { background: radial-gradient(circle, var(--ok) 28%, var(--ok-bg) 32%) 0 0 / 8px 8px; }
.sw3 { background: repeating-linear-gradient(-45deg, var(--warn) 0 4px, var(--warn-bg) 4px 8px); }
.swatch { display: inline-block; width: 1.1rem; height: 1.1rem; border: 1.5px solid var(--ink); border-radius: 3px; vertical-align: -.2rem; margin-right: .5rem; }
.stat-t { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .92rem; }
.stat-t th, .stat-t td { border-bottom: 1px solid var(--line); padding: .3rem .5rem; text-align: right; } .stat-t th:first-child, .stat-t td:first-child { text-align: left; } .stat-t thead th { color: var(--muted); font-weight: 600; font-size: .82rem; }
.by-unit { min-width: 420px; }
.ucard.locked { opacity: .78; border-style: dashed; box-shadow: none; cursor: not-allowed; } .ucard.locked:hover { transform: none; box-shadow: none; }
.u-lock { font-weight: 700; font-size: .85rem; background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: .1rem .6rem; width: fit-content; }

/* ---- solubility table (original) ---- */
table.sol { border-collapse: collapse; font-size: .85rem; min-width: 660px; background: var(--card); }
.sol th, .sol td { border: 1px solid var(--line); padding: .3rem .45rem; text-align: center; }
.sol th { background: var(--info-bg); font-weight: 600; } .sol th small { display: block; font-weight: 500; color: var(--muted); font-size: .7rem; }
.sol th[scope=row] { text-align: left; white-space: nowrap; } .sol .corner { font-size: .72rem; color: var(--muted); }
.sol td { font-weight: 800; font-size: 1.05rem; }
.sol-S { background: var(--ok-bg); color: var(--ok-ink); }
.sol-I { background: repeating-linear-gradient(-45deg, var(--warn-bg) 0 5px, transparent 5px 10px); color: var(--warn-ink); border: 1.5px solid var(--warn); }
.sol-x { background: var(--info-bg); color: var(--muted); }

/* week tracker: states differ by fill, a check mark, outline weight and dashes, not by color alone */
.weekbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap; margin: .25rem 0 1rem; padding: .7rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.wk-t { display: flex; flex-direction: column; gap: .1rem; font-size: .95rem; }
.wk-t .muted { font-size: .8rem; }
.wk-days { display: flex; gap: .55rem; list-style: none; margin: 0; padding: 0; }
.wk { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.wk-dot { width: 1.9rem; height: 1.9rem; box-sizing: border-box; display: grid; place-items: center; border: 2px solid var(--muted); border-radius: 50%; }
.wk-dot svg { width: 1rem; height: 1rem; }
.wk.done .wk-dot { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.wk.today .wk-dot { border: 3px solid var(--ink); }
.wk.future .wk-dot { border-style: dashed; opacity: .65; }
.wk-l { font-size: .75rem; font-weight: 700; line-height: 1; color: var(--muted); }
.wk.today .wk-l { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 480px) { .weekbar { padding: .65rem .8rem; } .wk-days { gap: .4rem; width: 100%; justify-content: space-between; } .wk-dot { width: 1.75rem; height: 1.75rem; } }

/* the logo and name are a link to the main page */
a.brand { color: inherit; text-decoration: none; border-radius: 12px; }
a.brand:hover .brand-t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.site-foot div + div { margin-top: .25rem; }

/* ---------- concept checks + vocabulary review ---------- */
.rcards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.rcard { display: flex; flex-direction: column; gap: .35rem; margin: 0; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.rcard h3 { font-size: 1.15rem; } .rcard > .btn { align-self: flex-start; margin-top: auto; }
.rv-pts { font-size: .88rem; font-weight: 600; }
.rv-draft { font-size: .85rem; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); border: 1.5px dashed var(--warn); border-radius: 8px; padding: .2rem .6rem; align-self: flex-start; }
.rv-modes { display: grid; gap: .5rem; margin-top: auto; }
.rv-mode { display: flex; justify-content: space-between; align-items: center; gap: .6rem; text-align: left; flex-wrap: wrap; }
.rv-mode small { font-weight: 500; color: var(--muted); opacity: 1; }
.rv .stmt p { margin: 0 0 .4rem; }
.rv-def { margin: .4rem 0 0; padding: .7rem .9rem; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; font-size: 1.05rem; }
.rv-streak { margin-left: .5rem; }
.fb-p p { margin: .15rem 0 0; }
/* multiple choice */
.mcs { margin-top: 0; }
.choice.mc { align-items: center; flex-wrap: wrap; }
.choice.mc input { margin-top: 0; }
.mc-l { flex: 0 0 auto; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; font-weight: 800; font-size: .9rem; }
.mc-t { flex: 1 1 12rem; }
.choice.mc.out { opacity: .7; border-style: dashed; cursor: default; }
.choice.mc.out .mc-t { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.mc-x { font-size: .85rem; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn); border-radius: 999px; padding: .05rem .55rem; display: inline-block; }
.choice.mc.right { border-width: 2.5px; border-color: var(--ok); background: var(--ok-bg); box-shadow: inset 5px 0 0 var(--ok); opacity: 1; }
.mc-ok { font-size: .85rem; font-weight: 800; color: #fff; background: var(--ok); border-radius: 999px; padding: .05rem .6rem; }
@media (prefers-color-scheme: dark) { .mc-ok { color: var(--ok-bg); } }
/* matching */
.rv-how { margin-bottom: .6rem; }
.m-cols { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 640px) { .m-cols { grid-template-columns: 1fr; } }
.m-col { display: grid; gap: .5rem; align-content: start; } .m-col h2 { font-size: 1rem; color: var(--muted); }
.m-item { font: inherit; color: var(--ink); text-align: left; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; min-height: 48px; padding: .6rem .8rem; background: var(--card); border: 1.5px solid var(--ink); border-radius: 10px; cursor: pointer; touch-action: manipulation; }
.m-t { font-weight: 700; } .m-d { font-size: .93rem; line-height: 1.4; }
.m-item:hover:not([disabled]) { background: var(--info-bg); }
.m-item.on, .m-item.on:hover:not([disabled]) { background: var(--brand-soft); border-width: 2.5px; border-color: var(--brand); box-shadow: inset 5px 0 0 var(--brand); }
.m-item.on .m-text::before { content: "Selected: "; font-weight: 700; color: var(--brand); }
.m-item.done { cursor: default; border-style: dashed; color: var(--muted); }
.m-badge { flex: 0 0 auto; font-size: .78rem; font-weight: 800; color: var(--ok-ink); background: var(--ok-bg); border: 1.5px solid var(--ok); border-radius: 999px; padding: .05rem .55rem; }
.m-badge.shown { color: var(--hint-ink); background: var(--hint-bg); border-color: var(--hint); border-style: dashed; }
.m-left { margin: .8rem 0 0; font-size: .9rem; }
/* flashcards */
.fc-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .6rem; } .fc-top p { margin: 0; }
.fc-stage { max-width: 640px; margin: 0 auto 1rem; }
.fc-count { font-weight: 700; margin: 0 0 .3rem; }
.fc-bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: .8rem; } .fc-bar i { display: block; height: 100%; background: var(--brand); }
.fc { display: block; width: 100%; min-height: 230px; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1200px; font: inherit; color: var(--ink); touch-action: manipulation; border-radius: 14px; }
.fc-in { position: relative; display: grid; min-height: 230px; transition: transform .45s cubic-bezier(.3, .7, .3, 1); transform-style: preserve-3d; }
.fc.on .fc-in { transform: rotateY(180deg); }
.fc-face { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .6rem; padding: 1.4rem 1.2rem; text-align: center; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fc-b { transform: rotateY(180deg); }
.fc-tag { font-size: .8rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .6rem; }
.fc-face.is-term .fc-txt { font-size: 1.8rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.fc-face.is-def .fc-txt { font-size: 1.1rem; line-height: 1.45; max-width: 34rem; }
.fc-face.is-def { border-style: dashed; }
.fc-tip { text-align: center; margin-top: .8rem; }
.fc-acts { justify-content: center; margin-top: 1rem; }
@media (prefers-reduced-motion: reduce) { .fc-in { transition: none; } }
.rv sup, .rv sub { white-space: nowrap; }   /* keep a charge like -2 from breaking at its sign */
/* concept check and quiz sets */
.rv-bar { margin: 0 0 .8rem; }
.rv-sum { display: grid; gap: .5rem; } .rv-sum h2 { font-size: 1rem; margin-top: .4rem; }
.rv-score { font-size: 1.35rem; margin: 0; } .rv-score b { font-size: 1.7rem; }
.rv-round { font-weight: 700; color: var(--ok-ink); background: var(--ok-bg); border: 1.5px solid var(--ok); border-radius: 10px; padding: .5rem .8rem; }
.rv-missed { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; }
.rv-tag { font-size: .78rem; font-weight: 700; border: 1px solid var(--line); border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }

/* ---------- Measurements unit: interactive instruments, magnified views, graph ---------- */
.ms-inst { margin: .6rem 0 1rem; display: grid; gap: .7rem; }
.ms-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; }
.ms-scroll.narrow { width: 140px; flex: none; } .ms-scroll.bad { outline: 3px dashed var(--warn); outline-offset: 2px; }
.ms-svg { display: block; width: 100%; min-width: 560px; height: auto; user-select: none; -webkit-user-select: none; }
.ms-svg.therm, .ms-svg.cyl { min-width: 0; } .ms-svg.block { min-width: 0; width: 220px; } .ms-svg.target { min-width: 0; max-width: 260px; margin: 0 auto; }
.ms-svg.plot { min-width: 320px; max-width: 620px; touch-action: none; }
.ms-svg text, .ms-lens text { font-family: var(--sans); fill: var(--ink); }
.ms-small { font-size: 11px; } .ms-small.on { font-weight: 700; fill: var(--gold-ink); } .ms-small.b { font-weight: 800; font-size: 13px; }
.ms-lab { font-size: 16px; font-weight: 700; } .ms-axis { font-size: 12px; font-weight: 600; }
.ms-tick { stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.ms-scale { fill: #f7e7b4; stroke: var(--ink); stroke-width: 1; } .ms-lens-bg { fill: var(--card); }
.ms-obj { fill: var(--gold); stroke: var(--ink); stroke-width: 1.5; opacity: .92; cursor: grab; }
.ms-index { stroke: var(--hint); stroke-width: 3; } .ms-eye { stroke: var(--hint); stroke-dasharray: 4 3; }
.ms-glass { fill: rgba(150, 190, 220, .18); stroke: var(--ink); stroke-width: 1.5; }
.ms-liquid { fill: rgba(64, 140, 220, .45); } .ms-liquid-edge { stroke: #1d5fa8; stroke-width: 2.5; } .ms-sunk { fill: #8a8f96; stroke: var(--ink); }
.ms-bulb { fill: #c6423a; stroke: var(--ink); } .ms-alc { fill: #c6423a; } .ms-alc-edge { stroke: #8f231c; stroke-width: 2.5; }
.ms-base, .ms-post { fill: #7d8a95; stroke: var(--ink); } .ms-pan { fill: #b9c3cc; stroke: var(--ink); }
.ms-thing { fill: #a77b4f; stroke: var(--ink); stroke-width: 1.5; }
.ms-beam { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; }
.ms-rider { fill: var(--gold); stroke: var(--ink); stroke-width: 1.5; pointer-events: none; }
.ms-hit { fill: transparent; cursor: grab; } .ms-pointer { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.ms-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.ms-status { margin: 0; font-weight: 600; } .ms-wait { align-self: center; max-width: 16rem; }
.ms-lenses { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem; } .ms-lenses.one { grid-template-columns: minmax(220px, 420px); }
.ms-lenses figure, .ms-pair figure { margin: 0; } figcaption { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.ms-lens { display: block; width: 100%; height: auto; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); }
.ms-lens.tall { max-width: 220px; }
.ms-pair { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.ms-ctls { display: grid; gap: .4rem; } .ms-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; } .ms-ctl > span:first-child { min-width: 9.5rem; font-weight: 600; font-size: .92rem; }
.ms-ctl .btn.small { min-width: 44px; }
.ms-cups { display: flex; flex-wrap: wrap; gap: .5rem; }
.ms-cup { font: inherit; display: flex; flex-direction: column; align-items: center; gap: .15rem; min-width: 7.5rem; min-height: 44px; padding: .5rem .6rem; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; }
.ms-cup.on { background: var(--brand-soft); box-shadow: inset 0 -4px 0 var(--brand); font-weight: 700; } .ms-cup small { color: var(--muted); }
.ms-ic { width: 26px; height: 26px; stroke: var(--ink); stroke-width: 1.8; fill: none; } .ms-ic .ms-ic-th { stroke: #c6423a; stroke-width: 2.5; }
.ms-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.ms-block { fill: #d9b98a; stroke: var(--ink); stroke-width: 1.5; } .ms-edge { stroke: var(--ink); stroke-width: 1.5; } .ms-edge-on { stroke: var(--hint); stroke-width: 6; stroke-linecap: round; }
.ms-ring { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; } .ms-ring.alt { fill: var(--info-bg); } .ms-hit-dot { fill: var(--ink); stroke: var(--card); stroke-width: 2; }
.ms-target { padding: .5rem; }
.ms-data { margin: .6rem 0; } .ms-data th, .ms-data td { text-align: center; font-variant-numeric: tabular-nums; }
.ms-big { font-family: var(--mono); font-size: 1.35em; font-weight: 700; white-space: nowrap; }
.ms-field { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin: .45rem 0; } .ms-fl { min-width: 11rem; font-weight: 600; }
.ms-field.final { margin-top: .8rem; padding-top: .7rem; border-top: 1.5px solid var(--line); } .ms-field.final .ms-fl { font-size: 1.05rem; }
.ms-unit { font-weight: 600; color: var(--muted); } .in.wide { width: 12rem; }
.ms-frac { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; margin: 0 .2rem; }
.ms-frac span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .3rem; } .ms-chain-show { line-height: 2.4; }
.ms-plot-bg { fill: var(--card); cursor: crosshair; } .ms-grid { stroke: var(--grid); stroke-width: 1; } .ms-grid.major { stroke: var(--line); }
.ms-fitline { stroke: var(--brand); stroke-width: 2.5; } .ms-regline { stroke: var(--warn); stroke-width: 2.5; stroke-dasharray: 8 5; }
.ms-handle { fill: var(--brand); fill-opacity: .45; stroke: var(--brand); stroke-width: 2; cursor: grab; } .ms-handle.on { stroke: var(--ink); stroke-width: 3; }
.ms-pt { fill: var(--ink); fill-opacity: .4; stroke: var(--ink); stroke-width: 1.5; cursor: grab; } .ms-pt.on { r: 9; fill: var(--hint); fill-opacity: .35; stroke: var(--hint); stroke-width: 2.5; }
.ms-step { margin: 1rem 0 .2rem; } .ms-reg { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.ms-key { display: inline-block; width: 28px; height: 0; border-top: 3px dashed var(--warn); }
.ms-pp { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; } .ms-pp .in.n { width: 5.5rem; }
@media (max-width: 520px) { .ms-fl { min-width: 100%; } .ms-ctl > span:first-child { min-width: 100%; } .ms-scroll.narrow { width: 120px; } }
@media (prefers-color-scheme: dark) { .ms-scale { fill: #4a3f1c; } .ms-block { fill: #7a5f3a; } .ms-thing { fill: #8f6a45; } }
.ms-field .side { align-items: center; flex-wrap: wrap; }
.ms-grid, .ms-svg text { pointer-events: none; }
.ms-note { margin: .4rem 0; padding: .55rem .75rem; border-left: 4px solid var(--hint); background: var(--hint-bg); color: var(--hint-ink); border-radius: 6px; font-size: .95rem; }
.ms-svg text.ms-halo { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; font-weight: 700; }
