/* bah.css  -  beahand.com look. One file for every page. ASCII only.
   Layout: one 720px reading column, left aligned; the home hero splits words | hard hat at 860px+;
   phones get a thumb tab bar at the bottom, and wizards swap it for a Back / Next bar.
   Idea: everybody starts green. A green hard hat collects real-looking stickers as you learn;
   the must-know points sit on a hi-vis yellow placard like a site sign. */
:root {
  --ground: #E8ECE7;      /* pale gravel, a little green */
  --sheet: #FFFFFF;       /* paper */
  --sheet-2: #F2F5F1;
  --ink: #1B2433;         /* FR navy */
  --ink-2: #47526A;
  --ink-3: #6A7488;
  --rule: #CBD2CA;
  --hat: #2E8540;         /* green hat */
  --hivis: #F7D914;       /* placard yellow */
  --hivis-ink: #1B2433;
  --hot: #D9561A;         /* safety orange */
  --stop: #B3261E;        /* danger */
  --stop-wash: #FBECEA;
  --go: #23773A;          /* right answer, done */
  --go-wash: #E4F1E6;
  --btn: #1B2433;
  --btn-ink: #FFFFFF;
  --focus: #1D5FD1;
  --cal-on: #1B2433;
  --scrim: rgba(12, 17, 24, .55);
  --shadow: 0 1px 0 rgba(27, 36, 51, .06), 0 10px 24px -14px rgba(27, 36, 51, .45);

  --f-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --f-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --t-hero: clamp(3.4rem, 1.9rem + 7vw, 6rem);
  --t-h1: clamp(2.6rem, 2rem + 3vw, 3.6rem);
  --t-h2: clamp(1.9rem, 1.55rem + 1.6vw, 2.5rem);
  --t-body: 1.125rem;
  --t-small: .95rem;
  --t-tiny: .85rem;

  --gut-l: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
  --safe-b: env(safe-area-inset-bottom, 0px);
  --top-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0F151D; --sheet: #17202B; --sheet-2: #1D2733; --ink: #E8ECE5; --ink-2: #B0B9C5; --ink-3: #8A93A3;
    --rule: #2D3947; --hat: #4CB560; --hivis: #F2D31C; --hivis-ink: #141A23; --hot: #FF8A4C;
    --stop: #FF7468; --stop-wash: #35191A; --go: #63C979; --go-wash: #153020; --btn: #F2D31C; --btn-ink: #141A23;
    --focus: #F2D31C; --cal-on: #5B6678; --scrim: rgba(0, 0, 0, .65); --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 26px -14px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0F151D; --sheet: #17202B; --sheet-2: #1D2733; --ink: #E8ECE5; --ink-2: #B0B9C5; --ink-3: #8A93A3;
  --rule: #2D3947; --hat: #4CB560; --hivis: #F2D31C; --hivis-ink: #141A23; --hot: #FF8A4C;
  --stop: #FF7468; --stop-wash: #35191A; --go: #63C979; --go-wash: #153020; --btn: #F2D31C; --btn-ink: #141A23;
  --focus: #F2D31C; --cal-on: #5B6678; --scrim: rgba(0, 0, 0, .65); --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 26px -14px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--ground); color: var(--ink);
  font: 400 var(--t-body)/1.55 var(--f-body); overflow-wrap: break-word;
  padding-bottom: calc(76px + var(--safe-b));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--ground); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ic { width: 22px; height: 22px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 720px; margin: 0 auto; padding-left: var(--gut-l); padding-right: var(--gut-r); }
.wrap-wide { max-width: 1100px; margin: 0 auto; padding-left: var(--gut-l); padding-right: var(--gut-r); }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-end { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-small); }
.tiny { font-size: var(--t-tiny); color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.display { font-family: var(--f-display); font-weight: 800; line-height: .95; letter-spacing: .005em; }
.print-only { display: none; }
.is-preview .no-preview { display: none !important; }

/* ---------------------------------------------------------------- header, nav, footer */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 25; background: var(--ground); border-bottom: 1px solid var(--rule); }
.top-in { max-width: 1100px; margin: 0 auto; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding-left: var(--gut-l); padding-right: var(--gut-r); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 900 1.55rem/1 var(--f-display); letter-spacing: .01em; }
.brand-hat { width: 34px; height: 34px; border-radius: 9px; background: var(--hat); color: #fff; display: grid; place-items: center; }
.brand-hat .ic { width: 24px; height: 24px; stroke-width: 2.2; }
.topnav { display: none; margin-left: auto; gap: 4px; }
.topnav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; text-decoration: none; font-weight: 700; color: var(--ink-2); }
.topnav a:hover { background: var(--sheet); color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--sheet); box-shadow: inset 0 -3px 0 var(--hat); }
.iconbtn { margin-left: auto; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.iconbtn:hover { background: var(--sheet); }
.topnav + .iconbtn { margin-left: 4px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 24; background: var(--sheet); border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--gut-r) var(--safe-b) var(--gut-l);
}
.tabbar a { display: grid; justify-items: center; gap: 3px; padding: 9px 4px 10px; text-decoration: none; font-size: .82rem; font-weight: 700; color: var(--ink-3); border-top: 3px solid transparent; }
.tabbar a .ic { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--ink); border-top-color: var(--hat); }
body.focus .tabbar { display: none; }

.site { margin-top: 56px; padding-block: 28px 32px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: var(--t-small); }
.site .wrap { display: grid; gap: 12px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot-links a { font-weight: 700; color: var(--ink); }
.fine { color: var(--ink-3); font-size: var(--t-tiny); }
body.focus .site { display: none; }

@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .topnav { display: flex; }
  .iconbtn { margin-left: 0; }
  .tabbar { display: none; }
}

/* ---------------------------------------------------------------- buttons, chips, fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 22px;
  border-radius: 12px; border: 2px solid var(--btn); background: var(--btn); color: var(--btn-ink);
  font: 700 1.06rem/1.1 var(--f-body); text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: default; filter: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.go { background: var(--hat); border-color: var(--hat); color: #fff; }
.btn.quiet { background: var(--sheet); color: var(--ink); border-color: var(--rule); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 42px; padding: 0 14px; font-size: .95rem; border-radius: 10px; }
.linkbtn { background: none; border: 0; padding: 6px 0; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--sheet); color: var(--ink); font-weight: 700; font-size: .95rem; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg .chip { border-radius: 10px; min-height: 48px; font-size: 1.05rem; }

.field { display: grid; gap: 6px; }
.field > span, .field > label { font-weight: 700; }
.field .hint { font-weight: 400; font-size: var(--t-small); color: var(--ink-3); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], textarea, select {
  width: 100%; min-height: 54px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--rule);
  background: var(--sheet); color: var(--ink); font: 400 1.08rem/1.3 var(--f-body);
}
textarea { min-height: 130px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.err { color: var(--stop); font-weight: 700; font-size: var(--t-small); }

/* ---------------------------------------------------------------- page blocks */
.page-head { padding-block: 26px 10px; display: grid; gap: 10px; }
.page-title { font: 900 var(--t-h1)/.92 var(--f-display); letter-spacing: .003em; }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 36em; }
.sec-title { font: 800 var(--t-h2)/.95 var(--f-display); margin-bottom: 12px; }
.block { margin-top: 34px; }

/* placard: the must-know points, like a yellow site sign */
.placard { background: var(--hivis); color: var(--hivis-ink); border-radius: 14px; padding: 5px; box-shadow: var(--shadow); }
.placard-in { border: 3px solid var(--hivis-ink); border-radius: 10px; padding: 16px 18px 20px; }
.placard-title { font: 900 clamp(1.7rem, 1.4rem + 1.4vw, 2.2rem)/1 var(--f-display); margin-bottom: 12px; color: var(--hivis-ink); }
.placard ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.placard li { position: relative; padding-left: 26px; font-size: 1.1rem; line-height: 1.4; font-weight: 700; }
.placard li::before { content: ""; position: absolute; left: 2px; top: .42em; width: 11px; height: 11px; background: var(--hivis-ink); }

.note { background: var(--sheet-2); border-radius: 12px; padding: 14px 16px; color: var(--ink-2); border: 1px solid var(--rule); }
.danger { background: var(--stop-wash); border: 2px solid var(--stop); border-radius: 12px; overflow: hidden; }
.danger::before { content: ""; display: block; height: 10px; background: repeating-linear-gradient(-45deg, var(--stop) 0 10px, var(--sheet) 10px 20px); }
.danger-in { padding: 12px 16px 16px; display: grid; gap: 4px; }
.danger-title { font: 900 1.5rem/1 var(--f-display); color: var(--stop); }

.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.list li { position: relative; padding-left: 22px; line-height: 1.5; }
.list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--hat); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 12px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; line-height: 1.45; }
.steps li::before { content: counter(st); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--ground); font: 900 1.35rem/1 var(--f-display); margin-top: -6px; }

.ph { margin: 0; border-radius: 12px; overflow: hidden; background: var(--sheet-2); }
.ph img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.ph figcaption { padding: 8px 12px; font-size: var(--t-small); color: var(--ink-2); }

/* ---------------------------------------------------------------- home */
.hero { display: grid; gap: 8px; padding-block: 18px 6px; }
.hero-words { display: grid; gap: 16px; align-content: center; }
.hero-title { font: 900 var(--t-hero)/.86 var(--f-display); letter-spacing: -.004em; }
.hero-sub { font-size: 1.22rem; line-height: 1.45; color: var(--ink-2); max-width: 30em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hat-card { margin: 0; display: grid; justify-items: center; gap: 4px; }
.hat { width: 100%; max-width: 470px; height: auto; display: block; overflow: visible; }
.hat-ground { fill: var(--ink); opacity: .1; }
.hat-slot { color: #0E3A17; }
.hat-cap { font-size: var(--t-small); color: var(--ink-2); text-align: center; }
.hat-cap strong { color: var(--ink); }
.sticker { display: block; overflow: visible; }
.sticker.is-empty { color: var(--ink-3); }
.st-in { transform-box: fill-box; transform-origin: center; }
.slap { animation: slap .55s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes slap { 0% { transform: scale(1.9) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }

.story { display: grid; gap: 12px; max-width: 36em; }
.story p { font-size: 1.12rem; }
.doors { display: grid; gap: 12px; }
.door { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; padding: 16px 18px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; text-decoration: none; color: inherit; transition: border-color .15s ease, transform .08s ease; }
.door:hover { border-color: var(--ink); }
.door:active { transform: translateY(1px); }
.door-title { font: 800 1.75rem/1 var(--f-display); }
.door p { color: var(--ink-2); font-size: 1rem; margin-top: 3px; }
@media (min-width: 640px) { .doors { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.05fr .95fr; gap: 28px; padding-block: 44px 10px; align-items: center; }
}

/* ---------------------------------------------------------------- learn */
.chaps { display: grid; border-top: 1px dashed var(--rule); }
.chap { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px dashed var(--rule); text-decoration: none; color: inherit; }
.chap:hover .chap-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.chap-title { font: 800 1.75rem/1 var(--f-display); }
.chap p { color: var(--ink-2); font-size: 1rem; margin-top: 4px; }
.chap-state { font-size: var(--t-small); color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.chap-state.done { color: var(--go); display: inline-flex; align-items: center; gap: 4px; }
.chap-state .ic { width: 18px; height: 18px; stroke-width: 3; }

.wiz { padding-block: 14px 24px; display: grid; gap: 18px; }
.wiz-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wiz-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-2); text-decoration: none; padding: 8px 0; }
.wiz-count { font-size: var(--t-small); color: var(--ink-3); font-weight: 700; }
.wiz-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.wiz-bars i { height: 6px; border-radius: 3px; background: var(--rule); }
.wiz-bars i.done { background: var(--hat); }
.wiz-bars i.now { background: var(--ink); }
.wiz-chapter { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 700; }
.screen { display: grid; gap: 16px; }
.screen-title { font: 900 var(--t-h2)/.95 var(--f-display); }
.screen .lead { font-size: 1.15rem; }
.wiz-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 26; background: var(--sheet); border-top: 1px solid var(--rule); padding: 10px var(--gut-r) calc(10px + var(--safe-b)) var(--gut-l); }
.wiz-bar-in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.wiz-bar-in.one { grid-template-columns: 1fr; }
body.focus { padding-bottom: calc(90px + var(--safe-b)); }

.jobs { display: grid; gap: 10px; }
.job { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; }
.job-name { font: 800 1.55rem/1 var(--f-display); }
.job-next { font-size: var(--t-small); color: var(--ink-2); }
.job-next strong { color: var(--ink); }

.check-q { font: 700 1.3rem/1.3 var(--f-body); }
.qwrap { display: grid; gap: 14px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 13px 14px; min-height: 60px; border: 2px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: 14px; font: 400 1.08rem/1.38 var(--f-body); cursor: pointer; }
.opt:hover:not([disabled]) { border-color: var(--ink); }
.opt .key { flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--sheet-2); border: 1px solid var(--rule); font: 900 1.15rem/1 var(--f-display); }
.opt[disabled] { cursor: default; }
.opt.right { border-color: var(--go); background: var(--go-wash); }
.opt.right .key { background: var(--go); border-color: var(--go); color: #fff; }
.opt.wrong { border-color: var(--stop); background: var(--stop-wash); }
.opt.wrong .key { background: var(--stop); border-color: var(--stop); color: #fff; }
.opt.dim { opacity: .55; }
.why { border-radius: 12px; padding: 14px 16px; display: grid; gap: 4px; }
.why.ok { background: var(--go-wash); border: 1px solid var(--go); }
.why.no { background: var(--stop-wash); border: 1px solid var(--stop); }
.why-head { font: 900 1.45rem/1 var(--f-display); }
.why.ok .why-head { color: var(--go); }
.why.no .why-head { color: var(--stop); }

.earned { display: grid; justify-items: center; text-align: center; gap: 12px; padding-block: 18px; }
.earned .sticker { width: 150px; height: 150px; }
.earned-title { font: 900 var(--t-h2)/1 var(--f-display); }

/* hitch calendar */
.hitch { display: grid; gap: 14px; }
.hitch-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hitch-pick .chip { border-radius: 10px; min-height: 46px; padding: 0 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; max-width: 330px; }
.cal i { aspect-ratio: 1; border-radius: 6px; max-width: 100%; }
.cal i.on { background: var(--cal-on); }
.cal i.off { background: var(--go-wash); border: 2px solid var(--hat); }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-small); color: var(--ink-2); }
.cal-key span { display: inline-flex; align-items: center; gap: 8px; }
.cal-key i { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.hitch-sum { font-size: 1.1rem; }
.hitch-sum strong { font-family: var(--f-display); font-size: 1.6rem; font-weight: 900; }

/* pay stub, pay calc, pay table */
.stub { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 6px 16px; font-variant-numeric: tabular-nums; }
.stub-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px dashed var(--rule); align-items: baseline; }
.stub-row:last-child { border-bottom: 0; }
.stub-row .how { grid-column: 1 / -1; font-size: var(--t-small); color: var(--ink-3); margin-top: -4px; order: 3; }
.stub-row .amt { font-weight: 700; }
.stub-row.total .lbl { font-weight: 700; }
.stub-row.total .amt { font: 900 1.9rem/1 var(--f-display); }
.calc { display: grid; gap: 16px; }
.rate { display: grid; grid-template-columns: 54px 1fr 54px; gap: 8px; align-items: stretch; max-width: 360px; }
.rate-in { position: relative; display: block; }
.rate-in::before { content: "$"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font: 900 1.6rem/1 var(--f-display); color: var(--ink-3); pointer-events: none; }
.rate input { text-align: center; font: 900 2rem/1 var(--f-display); padding: 6px 6px 6px 30px; height: 100%; }
.rate .btn { min-height: 58px; padding: 0; font-size: 1.6rem; }
.calc-out { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 6px 16px; }
.calc-big { font: 900 2.6rem/1 var(--f-display); }
.paytable { display: grid; border-top: 1px dashed var(--rule); }
.pay-row { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px dashed var(--rule); }
.pay-job { font-weight: 700; }
.pay-amt { font: 900 1.55rem/1.05 var(--f-display); color: var(--ink); }
.pay-note { font-size: var(--t-small); color: var(--ink-2); }
.sources { font-size: var(--t-small); color: var(--ink-2); display: grid; gap: 4px; }
.sources a { font-weight: 700; color: var(--ink); }

/* bag checklist */
.bag { display: grid; gap: 8px; }
.bag-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--rule); background: var(--sheet); cursor: pointer; text-align: left; width: 100%; font-size: 1.05rem; }
.bag-item .box { flex: none; width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--ink-3); display: grid; place-items: center; color: #fff; }
.bag-item .box .ic { width: 18px; height: 18px; stroke-width: 3.2; opacity: 0; }
.bag-item[aria-pressed="true"] { border-color: var(--hat); }
.bag-item[aria-pressed="true"] .box { background: var(--hat); border-color: var(--hat); }
.bag-item[aria-pressed="true"] .box .ic { opacity: 1; }
.bag-item[aria-pressed="true"] .bag-txt { text-decoration: line-through; color: var(--ink-3); }

/* all-on-one-page reading view */
.allpage .chapter-block { margin-top: 40px; display: grid; gap: 20px; }
.allpage .chapter-block > h2 { font: 900 var(--t-h1)/.92 var(--f-display); display: flex; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------- lingo */
.searchbar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top-h)); z-index: 15; background: var(--ground); padding-block: 10px 6px; display: grid; gap: 10px; }
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 46px; font-size: 1.12rem; }
.words { display: grid; }
.word { padding: 16px 2px; border-bottom: 1px solid var(--rule); display: grid; gap: 6px; }
.word-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.word-t { font: 900 1.85rem/1 var(--f-display); }
.word-say { font-size: var(--t-small); color: var(--ink-3); }
.word-aka { font-size: var(--t-small); color: var(--ink-2); }
.word-cat { font-size: var(--t-tiny); color: var(--ink-3); }
.tag { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--hivis); color: var(--hivis-ink); }
.word .ph { max-width: 460px; margin-top: 4px; }
.count { font-size: var(--t-small); color: var(--ink-3); }
.empty { padding: 26px 0; color: var(--ink-2); display: grid; gap: 10px; }
.quiz-term { font: 900 clamp(2.6rem, 2rem + 4vw, 3.6rem)/.95 var(--f-display); }

/* ---------------------------------------------------------------- test + certificate */
.test-intro { display: grid; gap: 18px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fact { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.fact strong { font: 900 2.1rem/1 var(--f-display); }
.fact span { font-size: var(--t-small); color: var(--ink-2); line-height: 1.25; }
.who { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--sheet-2); border: 1px solid var(--rule); font-size: 1rem; line-height: 1.45; }
.who > span { min-width: 0; flex: 1; }
.who .linkbtn { padding: 0; }
.qbar { height: 8px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--hat); border-radius: 4px; transition: width .25s ease; }
.result { display: grid; gap: 14px; justify-items: start; }
.score { font: 900 clamp(4rem, 3rem + 6vw, 6rem)/.85 var(--f-display); font-variant-numeric: tabular-nums; }
.review { display: grid; gap: 8px; }
.review a { font-weight: 700; }

.cert { background: #FFFFFF; color: #1B2433; border-radius: 14px; padding: 8px; box-shadow: var(--shadow); max-width: 640px; }
.cert-in { border: 3px solid #1B2433; border-radius: 9px; padding: 22px 22px 18px; display: grid; gap: 10px; position: relative; overflow: hidden; }
.cert-in::before { content: ""; position: absolute; inset: 0 0 auto; height: 12px; background: repeating-linear-gradient(-45deg, #F7D914 0 12px, #1B2433 12px 24px); }
.cert-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 10px; }
.cert-site { font: 900 1.5rem/1 "Big Shoulders Display", "Arial Narrow", sans-serif; }
.cert-kind { font-size: .95rem; color: #47526A; }
.cert-name { font: 900 clamp(2.2rem, 1.6rem + 3vw, 3.2rem)/.95 "Big Shoulders Display", "Arial Narrow", sans-serif; border-bottom: 2px solid #1B2433; padding-bottom: 6px; overflow-wrap: anywhere; }
.cert-line { font-size: 1rem; }
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: .95rem; }
.cert-grid b { display: block; font-size: .78rem; color: #47526A; font-weight: 700; }
.cert-code { font: 700 1.05rem/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; white-space: nowrap; }
.cert-grid .full { grid-column: 1 / -1; }
.cert-fine { font-size: .78rem; color: #47526A; line-height: 1.35; }
.cert .sticker { width: 74px; height: 74px; flex: none; }
.wallet { display: none; }

.paper { display: grid; gap: 14px; }
.paper-q { break-inside: avoid; display: grid; gap: 4px; }
.paper-q ol { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 2px; }
.paper-key { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 12px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- board */
.rules { display: grid; gap: 8px; }
.rules ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.rules li::marker { font-family: var(--f-display); font-weight: 900; }
.acct { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 14px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; }
.acct-who { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.badge-cert { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: 999px; background: var(--hivis); color: var(--hivis-ink); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-cert .ic { width: 14px; height: 14px; stroke-width: 3; }
.badge-role { font-size: .8rem; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.threads { display: grid; border-top: 1px solid var(--rule); }
.thread { display: grid; gap: 6px; padding: 14px 2px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; }
.thread:hover .thread-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.thread-title { font: 700 1.15rem/1.3 var(--f-body); display: flex; align-items: flex-start; gap: 8px; }
.thread-title .ic { width: 18px; height: 18px; margin-top: 3px; color: var(--hot); }
.thread-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--t-small); color: var(--ink-3); align-items: center; }
.cat-tag { font-size: .8rem; font-weight: 700; color: var(--ink-2); background: var(--sheet-2); border: 1px solid var(--rule); border-radius: 6px; padding: 1px 7px; }
.post { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.08rem; line-height: 1.55; }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--t-small); color: var(--ink-3); }
.post-head strong { color: var(--ink); font-size: 1rem; }
.post-tools { display: flex; gap: 14px; }
.post-tools button { background: none; border: 0; padding: 4px 0; font-size: var(--t-small); font-weight: 700; color: var(--ink-3); cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.post-tools .ic { width: 16px; height: 16px; }
.post.is-hidden { opacity: .55; }
.op .post-body { font-size: 1.15rem; }
.op-title { font: 900 var(--t-h2)/.98 var(--f-display); }
.offline { display: grid; gap: 10px; }
.cat-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-pick .chip { border-radius: 10px; min-height: 48px; white-space: normal; line-height: 1.15; padding: 6px 10px; display: flex; align-items: center; justify-content: center; text-align: center; }
.role-pick { display: grid; gap: 8px; }
.role-pick .chip { border-radius: 12px; min-height: 56px; text-align: left; padding: 8px 14px; white-space: normal; }

/* ---------------------------------------------------------------- modal, toast */
.modal-back { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; align-items: end; justify-items: center; animation: fadein .15s ease both; }
.modal { width: min(560px, 100%); max-height: 92vh; max-height: 92dvh; overflow: auto; background: var(--sheet); color: var(--ink); border-radius: 18px 18px 0 0; padding: 16px var(--gut-r) calc(20px + var(--safe-b)) var(--gut-l); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); animation: rise .18s ease both; }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.modal-title { font: 900 1.9rem/1 var(--f-display); margin-right: auto; }
.modal-x { margin-left: 0; }
.modal-msg { display: block; font-size: 1.08rem; }
.modal-back.closing { animation: fadeout .14s ease both; }
html.modal-open { overflow: hidden; }
@media (min-width: 640px) {
  .modal-back { align-items: center; }
  .modal { border-radius: 18px; padding: 20px 24px 24px; }
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); } to { transform: none; } }
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 70; background: var(--ink); color: var(--ground); padding: 12px 18px; border-radius: 12px; font-weight: 700; opacity: 0; transition: opacity .2s ease, transform .2s ease; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--stop); color: #fff; }
@media (min-width: 860px) { .toast { bottom: 28px; } }

/* ---------------------------------------------------------------- shots page */
.shots { display: grid; border-top: 1px solid var(--rule); }
.shot { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 2px; border-bottom: 1px solid var(--rule); align-items: start; }
.shot-file { font: 700 1rem/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.shot-what { grid-column: 1 / 2; color: var(--ink-2); font-size: 1rem; }
.shot-state { grid-row: 1 / span 2; grid-column: 2; font-size: var(--t-small); font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--rule); color: var(--ink-3); white-space: nowrap; }
.shot-state.in { border-color: var(--go); color: var(--go); background: var(--go-wash); }

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- print: the paper path */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body { padding: 0 !important; font-size: 11.5pt; }
  body::before, .top, .tabbar, .wiz-bar, .site, .no-print, .btn, .chips, .searchbar, .iconbtn, .modal-back, .toast { display: none !important; }
  .wrap, .wrap-wide { max-width: none; padding: 0; }
  a { text-decoration: none; color: #000 !important; }
  .placard { background: #fff !important; box-shadow: none; }
  .placard-in { border-color: #000; }
  .note, .job, .stub, .calc-out, .fact, .who { background: #fff !important; border-color: #888 !important; }
  .danger { background: #fff !important; }
  .print-only { display: block !important; }
  .ph { display: none; }
  .word, .chap, .pay-row, .job, .paper-q, .screen { break-inside: avoid; }
  body[data-print="cert"] main > *:not(#certView) { display: none !important; }
  body[data-print="cert"] #certView > *:not(.cert-sheet) { display: none !important; }
  body[data-print="cert"] .cert { box-shadow: none; max-width: 7.2in; }
  body[data-print="cert"] .wallet { display: block !important; margin-top: .45in; }
  body[data-print="paper"] main > *:not(#paperView) { display: none !important; }
  body[data-print="paper"] { font-size: 10.5pt; line-height: 1.3; }
  body[data-print="paper"] .paper { gap: 7px; }
  body[data-print="paper"] .page-head { padding-block: 0 4px; gap: 4px; }
  body[data-print="paper"] .page-title { font-size: 22pt; }
  body[data-print="paper"] #paperView .paper-key-wrap { break-before: page; }
}
.wallet-card { width: 3.375in; height: 2.125in; border: 1.5px dashed #000; border-radius: 10px; padding: .14in .16in; display: grid; align-content: space-between; color: #000; background: #fff; }
.wallet-card .w-top { display: flex; justify-content: space-between; align-items: center; font: 900 15pt/1 "Big Shoulders Display", "Arial Narrow", sans-serif; }
.wallet-card .w-name { font: 900 17pt/1 "Big Shoulders Display", "Arial Narrow", sans-serif; overflow-wrap: anywhere; }
.wallet-card .w-meta { font-size: 7.5pt; line-height: 1.3; }
.wallet-cut { font-size: 8pt; margin-bottom: 4px; }
