/* Electrical Calc Trainer: black and white like the book (Barlow Condensed / Barlow, black boxes, J/M chips), one accent. */
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/Barlow-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/BarlowCondensed-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/BarlowCondensed-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/BarlowCondensed-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --ink: #111111; --paper: #ffffff; --soft: #f4f4f2; --line: #d6d6d2; --muted: #5a5a57; --acc: #ffc400; --bad: #8a1c1c;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif; --body: "Barlow", "Segoe UI", Arial, sans-serif; --r: 4px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.05rem/1.5 var(--body); }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.05; letter-spacing: .01em; margin: 0 0 .5em; text-transform: uppercase; }
h1 { font-size: clamp(2rem, 7vw, 3.2rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
cite { font-style: italic; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 8px; top: 8px; background: var(--acc); padding: 8px 12px; z-index: 50; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: .9rem; }
.lead { font-size: 1.15rem; max-width: 46em; }
.kicker { font: 700 .85rem/1 var(--head); letter-spacing: .14em; text-transform: uppercase; margin-bottom: .6em; }

/* header and footer */
.top { background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--acc); }
.top .in { max-width: 1000px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { color: var(--paper); text-decoration: none; display: flex; align-items: center; gap: 10px; font: 800 1.35rem/1 var(--head); letter-spacing: .04em; text-transform: uppercase; }
.logo img { width: 34px; height: 34px; }
.top nav { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { color: var(--paper); font: 600 .95rem var(--head); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.top nav a:hover { color: var(--acc); }
body > footer { border-top: 2px solid var(--ink); margin-top: 40px; padding: 22px 16px 34px; font-size: .9rem; }
body > footer p { max-width: 1000px; margin: 0 auto .6em; }
.foot-links a { color: var(--muted); }

/* layout */
#app { display: block; outline: none; }
.screen { max-width: 1000px; margin: 0 auto; padding: 26px 16px 10px; }
.screen.narrow { max-width: 760px; }
.crumbs { margin-bottom: 10px; font-size: .95rem; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.two { display: grid; gap: 16px; }
@media (min-width: 760px) { .two { grid-template-columns: 1fr 1fr; } }
.box { border: 2px solid var(--ink); border-radius: var(--r); padding: 18px; margin: 0 0 18px; background: var(--paper); }
.box.warn { border-style: dashed; }
.hero { border-bottom: 2px solid var(--ink); padding-bottom: 18px; margin-bottom: 20px; }
.ed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 0; }

/* buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--paper); color: var(--ink); font: 700 1.05rem/1 var(--head); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #2b2b2b; }
.btn.ghost:hover { background: var(--soft); }
.btn.big { min-height: 58px; font-size: 1.2rem; width: 100%; }
.btn.mini { min-height: 38px; padding: 6px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .4; cursor: default; }
.label { display: block; font: 700 1rem var(--head); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.big-input { width: 100%; min-height: 60px; font: 700 1.6rem var(--head); letter-spacing: .2em; text-align: center; text-transform: uppercase; border: 2px solid var(--ink); border-radius: var(--r); padding: 6px 10px; }
.mid-input { flex: 1; min-width: 0; min-height: 48px; font: 600 1.2rem var(--body); border: 2px solid var(--ink); border-radius: var(--r); padding: 6px 12px; }
.code-msg { min-height: 1.4em; margin: 10px 0; font-weight: 600; color: var(--bad); }
.code-msg.show { border-left: 4px solid var(--bad); padding-left: 10px; }
.unlock .btn { margin: 4px 0 12px; }
.ticks { list-style: none; padding: 0; margin: 18px 0; } .ticks li { padding: 6px 0 6px 26px; position: relative; border-bottom: 1px solid var(--line); }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 14px; width: 10px; height: 10px; background: var(--ink); }
.check, .radio { display: flex; gap: 10px; align-items: center; min-height: 40px; cursor: pointer; }
.check input, .radio input { width: 20px; height: 20px; accent-color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; } legend { font: 700 1rem var(--head); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
fieldset[disabled] { opacity: .45; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.seg-b { min-height: 38px; padding: 4px 14px; border: 0; background: var(--paper); font: 700 .95rem var(--head); letter-spacing: .06em; cursor: pointer; }
.seg-b + .seg-b { border-left: 2px solid var(--ink); }
.seg-b.on { background: var(--ink); color: var(--paper); }

/* chips */
.chip { display: inline-block; font: 700 .78rem/1 var(--head); letter-spacing: .1em; text-transform: uppercase; padding: 4px 7px; border: 1.5px solid var(--ink); border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chip.lvl { background: var(--ink); color: var(--paper); min-width: 24px; text-align: center; }
.chip.ed { background: var(--paper); }

/* home tiles */
.tiles { display: grid; gap: 14px; margin: 18px 0 24px; }
@media (min-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .tiles { grid-template-columns: 1fr 1fr 1fr; } }
.tile { display: flex; flex-direction: column; gap: 6px; background: var(--ink); color: var(--paper); text-decoration: none; padding: 18px; border-radius: var(--r); min-height: 140px; border-left: 6px solid var(--acc); }
.tile strong { font: 800 1.6rem/1 var(--head); text-transform: uppercase; }
.tile span { color: #dcdcdc; }
.tile .t-k { color: var(--acc); font: 700 .8rem var(--head); letter-spacing: .16em; text-transform: uppercase; }
.tile:hover { background: #262626; }
.resume { display: block; border: 2px dashed var(--ink); padding: 12px 16px; margin-bottom: 14px; text-decoration: none; }

/* practice list */
.chap { margin: 22px 0; }
.chap h2 { display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.ch-n { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; background: var(--ink); color: var(--paper); font-size: 1.2rem; }
.gens { list-style: none; padding: 0; margin: 0; }
.gens a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 52px; }
.gens a:hover { background: var(--soft); }
.g-t { font-weight: 600; }
.g-m { display: flex; align-items: center; flex-shrink: 0; }
.score { font: 700 .95rem var(--head); margin-left: 4px; }

/* question */
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .9rem; margin-bottom: 8px; }
.ch-tag { font: 700 .9rem var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q-title { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.stem { font-size: 1.12rem; font-weight: 500; }
.opts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 12px; text-align: left; font: 600 1.12rem var(--body); color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); cursor: pointer; }
.opt .L { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border: 2px solid var(--ink); font: 800 1.05rem var(--head); }
.opt:hover:not([disabled]) { background: var(--soft); }
.opt.right, .opt.chosen { background: var(--ink); color: var(--paper); }
.opt.right .L, .opt.chosen .L { background: var(--acc); color: var(--ink); border-color: var(--acc); }
.opt.right::after { content: "✓"; margin-left: auto; font-size: 1.3rem; }
.opt.wrong { border-style: dashed; text-decoration: line-through; color: var(--bad); }
.opt.wrong::after { content: "✗"; margin-left: auto; font-size: 1.3rem; text-decoration: none; }
.opt[disabled] { cursor: default; }
.verdict { font: 800 1.5rem var(--head); text-transform: uppercase; padding: 10px 14px; margin: 18px 0 10px; }
.verdict.ok { background: var(--ink); color: var(--paper); border-left: 8px solid var(--acc); }
.verdict.no { border: 2px dashed var(--ink); font-size: 1.25rem; text-transform: none; }
.sol { border: 2px solid var(--ink); padding: 16px; border-radius: var(--r); background: var(--soft); }
.sol .lookup { border-left: 4px solid var(--ink); padding-left: 10px; font-size: .95rem; }
.steps { padding-left: 1.4em; } .steps li { margin: 4px 0; }
.answer-line { background: var(--ink); color: var(--paper); padding: 8px 12px; display: inline-block; }
.why ul { padding-left: 1.2em; } .why li { margin: 4px 0; } .why li.mine { font-weight: 600; }
.nec, .alt, .trap { font-size: .95rem; }
.lookup strong, .nec strong, .alt strong, .trap strong { font: 700 .8rem var(--head); letter-spacing: .12em; text-transform: uppercase; margin-right: 6px; background: var(--ink); color: var(--paper); padding: 2px 6px; }

/* exams */
.exam-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between; background: var(--ink); color: var(--paper); padding: 10px 14px; margin: 0 -16px 14px; }
.clock { font: 800 1.9rem/1 var(--head); color: var(--acc); letter-spacing: .04em; }
.clock.low { color: var(--paper); background: var(--bad); padding: 2px 8px; }
.qn, .ans { font: 700 1rem var(--head); letter-spacing: .08em; text-transform: uppercase; }
.mark { margin-top: 12px; }
.qgrid { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.qgrid button { width: 100%; min-height: 44px; border: 2px solid var(--ink); background: var(--paper); font: 700 1rem var(--head); cursor: pointer; }
.qgrid button.done { background: var(--ink); color: var(--paper); }
.qgrid button.flag { box-shadow: inset 0 -6px 0 var(--acc); }
.qgrid button.cur { outline: 3px solid var(--acc); }
.tx-note { border-left: 6px solid var(--acc); padding: 6px 12px; background: var(--soft); }
.big-num { font: 800 2rem/1.1 var(--head); }
.areas { list-style: none; padding: 0; } .areas li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; }
.score.pass { background: var(--ink); color: var(--paper); border-left: 8px solid var(--acc); }
.rev { padding-left: 0; list-style: none; } .rev > li { border: 2px solid var(--ink); margin: 8px 0; padding: 0; }
.rev summary { cursor: pointer; padding: 10px 12px; font-weight: 600; } .rev details[open] { padding: 0 12px 12px; } .rev details[open] summary { margin: 0 -12px 8px; border-bottom: 1px solid var(--line); }
.rev .mk { display: inline-block; width: 24px; font-weight: 800; } .rev li.no .mk { color: var(--bad); }
.opts.static li { border: 1px solid var(--line); padding: 6px 10px; } .opts.static li.right { background: var(--ink); color: var(--paper); } .opts.static li.wrong { text-decoration: line-through; border-style: dashed; }
.tbl { width: 100%; border-collapse: collapse; } .tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl thead th { font: 700 .85rem var(--head); letter-spacing: .1em; text-transform: uppercase; border-bottom: 2px solid var(--ink); }
.bar { display: inline-block; width: 80px; height: 10px; border: 1.5px solid var(--ink); vertical-align: middle; margin-right: 6px; }
.fill { display: block; height: 100%; background: var(--ink); }
.w0 { width: 0; } .w1 { width: 10%; } .w2 { width: 20%; } .w3 { width: 30%; } .w4 { width: 40%; } .w5 { width: 50%; } .w6 { width: 60%; } .w7 { width: 70%; } .w8 { width: 80%; } .w9 { width: 90%; } .w10 { width: 100%; }

/* worksheet */
.ws-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .ws-grid { grid-template-columns: 1fr 1.1fr; align-items: start; } .ws-panel { position: sticky; top: 10px; } }
.ws-sec { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.ws-sec label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; }
.num { width: 110px; min-height: 40px; font: 600 1rem var(--body); border: 2px solid var(--ink); border-radius: var(--r); padding: 4px 8px; }
.txt { width: 100%; min-width: 90px; min-height: 40px; font: 500 1rem var(--body); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 4px 8px; }
select { min-height: 40px; font: 600 1rem var(--body); border: 2px solid var(--ink); border-radius: var(--r); background: var(--paper); padding: 2px 6px; max-width: 100%; }
.ws-list { width: 100%; border-collapse: collapse; margin-bottom: 8px; } .ws-list td, .ws-list th { padding: 3px; text-align: left; font-size: .85rem; }
.ws-list .num { width: 84px; }
.x { width: 36px; height: 36px; border: 2px solid var(--ink); background: var(--paper); font-size: 1.2rem; cursor: pointer; }
.ws-out { width: 100%; border-collapse: collapse; } .ws-out td, .ws-out th { border-bottom: 1px solid var(--line); padding: 8px 4px; vertical-align: top; text-align: left; }
.ws-out .n { font: 800 1.1rem var(--head); width: 28px; } .ws-out .va { text-align: right; font: 700 1.1rem var(--head); white-space: nowrap; }
.ws-out .sec { display: block; font-size: .8rem; color: var(--muted); } .how { display: block; font-size: .85rem; color: var(--muted); }
.ws-out tr.tot td { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.ws-res { display: grid; gap: 10px; margin-top: 12px; } .ws-res > div { background: var(--ink); color: var(--paper); padding: 12px; }
.ws-res .k { display: block; font: 700 .8rem var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--acc); }
.ws-res strong { font: 800 1.6rem var(--head); } .ws-res .how { color: #d0d0d0; }
.compare { border-left: 4px solid var(--acc); padding-left: 10px; margin-top: 12px; font-size: .95rem; }

/* finder */
.hit .map { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 800 1.6rem/1.1 var(--head); }
.hit .to { background: var(--ink); color: var(--paper); padding: 2px 10px; } .hit .arrow { color: var(--muted); }

/* formula sheet */
.fs-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .fs-grid { grid-template-columns: 1fr 1fr; } }
.fs-block { border: 2px solid var(--ink); }
.fs-block h2 { background: var(--ink); color: var(--paper); font-size: 1.05rem; padding: 6px 10px; margin: 0; }
.fs-block table { width: 100%; border-collapse: collapse; }
.fs-block td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .92rem; }
.fs-block td.f { font-weight: 600; } .fs-block td.n { color: var(--muted); font-size: .82rem; width: 38%; }
.fs-intro { max-width: 60em; } .fs-foot { margin-top: 14px; }

/* during a timed exam: no review pop-up and no band (the clock is running) */
body.exam-on .bkcta-sheet, body.exam-on .bkcta-band { display: none !important; }
.loading { padding: 40px 16px; text-align: center; }

@media print {
  @page { size: letter; margin: 0.45in; }
  body { font-size: 10pt; }
  .top, body > footer, .no-print, .bkcta-band, .bkcta-sheet, .skip { display: none !important; }
  .screen { padding: 0; max-width: none; }
  .fs-head h1 { font-size: 22pt; margin-bottom: 4pt; } .fs-intro { font-size: 8.5pt; }
  .fs-grid { grid-template-columns: 1fr 1fr; gap: 8pt; }
  .fs-block { break-inside: avoid; } .fs-block h2 { font-size: 10pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fs-block td { font-size: 8.4pt; padding: 2.5pt 5pt; } .fs-block td.n { font-size: 7.4pt; }
}

/* phones */
.ws-grid > * { min-width: 0; }
.ws-list { table-layout: fixed; }
.ws-list th:nth-child(2), .ws-list td:nth-child(2) { width: 78px; }
.ws-list th:nth-child(3), .ws-list td:nth-child(3) { width: 64px; }
.ws-list th:nth-child(4), .ws-list td:nth-child(4) { width: 44px; text-align: center; }
.ws-list th:nth-child(5), .ws-list td:nth-child(5) { width: 42px; }
.ws-list .txt { min-width: 0; }
.ws-list .num { width: 100%; }
.ws-list select { width: 100%; }
.logo span { white-space: nowrap; }
@media (max-width: 520px) {
  .top .in { padding: 8px 12px; }
  .logo { font-size: 1.1rem; gap: 8px; } .logo img { width: 28px; height: 28px; }
  .top nav { gap: 10px; } .top nav a { font-size: .82rem; letter-spacing: .05em; }
  .ws-sec label { flex-wrap: wrap; }
}
.ws-sum { position: sticky; top: 0; z-index: 4; background: var(--ink); color: var(--paper); margin: 0 -16px 14px; padding: 10px 16px; font: 700 1rem/1.3 var(--head); letter-spacing: .04em; border-bottom: 3px solid var(--acc); }
.ws-sum a { color: var(--paper); text-decoration: none; display: block; } .ws-sum a span { color: var(--acc); margin-left: 6px; white-space: nowrap; }
@media (min-width: 900px) { .ws-sum { display: none; } }
