/* =========================================================
   Brain Training (braintraining.php) — invitation-only early access for Cortexercise.
   Monochrome research-lab look (no colour accent): warm paper, ink, hairlines, serif display.
   Still tuned for older readers / cognitive impairment: 19px+ body, every text colour ≥ 7:1
   on the page, plain Inter for anything you read, 56px inputs/buttons, visible focus.
   Scoped under .btx; px only (site root font ~10px).
   Earlier versions: _backup/brain_training_20261127/ (v1 gym, v2 minimal, v3 readable-blue).
   ========================================================= */
.btx {
  --bg: #f6f5f1;
  --bg-2: #eeece6;
  --paper: #fffefb;
  --ink: #121214;
  --ink-2: #29292e;
  --muted: #4d4d54;
  --rule: rgba(18, 18, 20, .14);
  --rule-strong: rgba(18, 18, 20, .55);
  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  background: var(--bg);
  color: var(--ink);
  font: 400 19px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.btx *, .btx *::before, .btx *::after { box-sizing: border-box; }
.btx h1, .btx h2, .btx h3 { margin: 0; text-transform: none; letter-spacing: -.01em; font-family: var(--serif); font-weight: 400; line-height: 1.08; color: inherit; }
.btx h4 { margin: 0; text-transform: none; letter-spacing: 0; font: 600 19px/1.35 var(--sans); color: inherit; }
.btx h1 em, .btx h2 em { font-style: italic; color: var(--muted); }
.btx p { margin: 0 0 1em; }
.btx a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.btx a:hover { text-decoration-thickness: 2px; }
.btx :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btx ul, .btx ol { margin: 0; padding: 0; list-style: none; }
.btx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btx-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btx-num { font: 400 22px/1 var(--serif); color: var(--muted); font-variant-numeric: tabular-nums; }
.btx-muted { color: var(--muted); }

.btx-wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .btx-wrap { padding: 0 32px; } }
@media (min-width: 1200px) { .btx-wrap { padding: 0 48px; } }

.btx-label { display: flex; align-items: center; gap: 12px; font: 600 14px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 18px !important; }
.btx-label::after { content: ""; flex: 0 0 40px; height: 1px; background: var(--rule-strong); }
.btx-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); flex: none; box-shadow: 0 0 0 4px rgba(18,18,20,.08); }
.btx h2 { font-size: clamp(42px, 4.8vw, 64px); margin-bottom: 18px; }
.btx-intro { color: var(--ink-2); font-size: 19px; max-width: 42em; }

/* Buttons */
.btx-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 30px; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: #fff; font: 500 18px/1 var(--sans); letter-spacing: .01em; cursor: pointer; white-space: nowrap; transition: background .2s, box-shadow .2s; box-shadow: 0 10px 24px -14px rgba(18,18,20,.6); }
.btx-btn:hover { background: #2b2b31; }
.btx-btn:disabled { cursor: default; opacity: .8; }
.btx-btn--light { background: #fff; color: var(--ink); border-color: #fff; box-shadow: none; }
.btx-btn--light:hover { background: #ecebe6; }
.btx-btn--wide { width: 100%; }

/* ---------- HERO ---------- */
.btx-hero { padding: 116px 0 0; border-bottom: 1px solid var(--rule); background: radial-gradient(90% 70% at 80% 30%, #ffffff 0%, rgba(255,255,255,0) 60%), var(--bg); }
@media (min-width: 992px) { .btx-hero { padding-top: 136px; } }
.btx-hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 992px) { .btx-hero-grid { grid-template-columns: 6fr 5fr; gap: 64px; } }
.btx-hero h1 { font-size: clamp(56px, 7.4vw, 108px); line-height: .96; letter-spacing: -.025em; margin-bottom: 26px; }
.btx-lede { font-size: clamp(19px, 1.5vw, 21px); line-height: 1.65; color: var(--ink-2); max-width: 32em; margin-bottom: 30px !important; }
.btx-hero-art { margin: 0; position: relative; aspect-ratio: 1 / 1; max-height: 500px; width: 100%; border: 1px solid var(--rule); background: linear-gradient(180deg, #ffffff, #faf9f6); box-shadow: 0 40px 80px -48px rgba(18,18,20,.35), inset 0 0 0 8px #fff; touch-action: pan-y; cursor: crosshair; }
.btx-hero-art figcaption { position: absolute; left: 16px; bottom: 14px; padding: 2px 0; font: 400 13px var(--mono); color: var(--muted); pointer-events: none; letter-spacing: .02em; }
#btxField { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); display: block; }
@media (max-width: 991px) { .btx-hero-art { aspect-ratio: 16 / 10; } }

/* Forms */
.btx-inline { display: flex; gap: 10px; max-width: 580px; }
.btx-inline input { flex: 1 1 auto; min-width: 0; height: 56px; padding: 0 18px; border: 1px solid var(--rule-strong); border-radius: 2px; background: #fff; color: var(--ink); font: 400 19px var(--sans); outline: none; transition: border-color .2s, box-shadow .2s; }
.btx-inline input::placeholder { color: #66666d; }
.btx-inline input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18,18,20,.12); }
.btx-form-note { font-size: 16px; color: var(--muted); margin: 12px 0 0 !important; }
.btx-form-msg { margin: 12px 0 0 !important; font-size: 18px; font-weight: 600; }
.btx-form-msg:empty { display: none; }
.btx-form-msg.is-ok { color: #1d5a32; }
.btx-form-msg.is-err { color: #a3261b; }
@media (max-width: 559px) { .btx-inline { flex-direction: column; } .btx-inline .btx-btn { width: 100%; } }

/* Specs */
.btx-specs { display: grid; grid-template-columns: repeat(2, 1fr); margin: 48px 0 0; border-top: 1px solid var(--rule); }
@media (min-width: 768px) { .btx-specs { grid-template-columns: repeat(4, 1fr); } }
.btx-specs div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 20px 0 24px; margin: 0; }
@media (min-width: 768px) { .btx-specs div + div { padding-left: 28px; border-left: 1px solid var(--rule); } }
@media (max-width: 767px) { .btx-specs div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); } .btx-specs div:nth-child(n+3) { border-top: 1px solid var(--rule); } .btx-specs dd { font-size: 30px !important; } }
.btx-specs dt { font: 500 16px/1.4 var(--sans); color: var(--muted); }
.btx-specs dd { margin: 0 0 6px; font: 400 40px/1.05 var(--serif); }

/* ---------- SECTIONS ---------- */
.btx-sec { padding: 64px 0; }
@media (min-width: 992px) { .btx-sec { padding: 88px 0; } }
.btx-sec--rule { border-top: 1px solid var(--rule); }
.btx-sec--tint { background: var(--bg-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.btx-head { margin-bottom: 32px; }
.btx-split { display: grid; gap: 24px; }
@media (min-width: 992px) { .btx-split { grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; } .btx-split .btx-head { margin-bottom: 0; } }

.btx-principles { display: grid; border-top: 1px solid var(--rule-strong); counter-reset: p; }
@media (min-width: 768px) { .btx-principles { grid-template-columns: repeat(3, 1fr); } }
.btx-principles li { padding: 26px 0 6px; counter-increment: p; }
@media (min-width: 768px) { .btx-principles li { padding: 28px 32px 6px 0; } .btx-principles li + li { padding-left: 32px; border-left: 1px solid var(--rule); } }
@media (max-width: 767px) { .btx-principles li + li { border-top: 1px solid var(--rule); } }
.btx-principles li::before { content: "0" counter(p); display: block; font: 400 22px var(--serif); color: var(--muted); margin-bottom: 14px; }
.btx-principles h3 { font-size: 34px; margin-bottom: 10px; }
.btx-principles p { color: var(--ink-2); font-size: 18px; }

/* Domains table */
.btx-table { width: 100%; border-collapse: collapse; font-size: 18px; }
.btx-table th { text-align: left; font: 600 13px var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 0 12px 12px 0; border-bottom: 1px solid var(--rule-strong); }
.btx-table td { padding: 16px 12px 16px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.btx-table td:first-child { width: 52px; }
.btx-table td:nth-child(2) { font: 400 24px/1.25 var(--serif); width: 40%; }
.btx-table td:nth-child(3) { font-size: 18px; color: var(--ink-2); }
@media (max-width: 599px) {
  .btx-table thead { display: none; }
  .btx-table tr { display: grid; grid-template-columns: 40px 1fr; border-bottom: 1px solid var(--rule); padding: 14px 0; }
  .btx-table td { border: 0; padding: 0; width: auto !important; }
  .btx-table td:nth-child(3) { grid-column: 2; padding: 4px 0 0; font-size: 17px; }
}

/* Evidence */
.btx-head--wide { max-width: 860px; }
.btx-evidence { display: grid; gap: 20px; }
@media (min-width: 992px) { .btx-evidence { grid-template-columns: 1fr 1fr; gap: 24px; } }
.btx-ev { background: var(--paper); border: 1px solid var(--rule); padding: 28px 28px 8px; box-shadow: 0 24px 48px -40px rgba(18,18,20,.35); }
.btx-ev-h { display: flex; align-items: center; gap: 14px; font-size: 32px !important; padding-bottom: 18px; margin-bottom: 4px !important; border-bottom: 1px solid var(--rule-strong); }
.btx-ev-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 17px/1 var(--sans); flex: none; }
.btx-ev--open .btx-ev-mark { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btx-ev li { padding: 18px 0 4px; border-bottom: 1px solid var(--rule); }
.btx-ev li:last-child { border-bottom: 0; }
.btx-ev h4 { margin-bottom: 6px; }
.btx-ev p { color: var(--ink-2); font-size: 18px; }
.btx-ref { display: inline-block; min-width: 24px; margin-left: 4px; padding: 1px 6px; border: 1px solid var(--rule-strong); border-radius: 2px; font: 500 13px/1.5 var(--sans); text-align: center; text-decoration: none !important; color: var(--ink-2) !important; vertical-align: 2px; }
.btx-ref:hover { background: var(--ink); color: #fff !important; border-color: var(--ink); }
.btx-aside { margin: 28px 0 0 !important; padding: 20px 24px; background: var(--paper); border-left: 2px solid var(--ink); color: var(--ink-2); font-size: 18px; max-width: 64em; }

/* Environments list */
.btx-list { border-top: 1px solid var(--rule-strong); }
.btx-list li { display: grid; grid-template-columns: 52px 1fr auto; align-items: baseline; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--rule); font: 400 28px/1.2 var(--serif); }
.btx-list li .btx-muted { font: 500 15px var(--sans); }
@media (max-width: 479px) { .btx-list li { grid-template-columns: 44px 1fr; } .btx-list li .btx-muted { grid-column: 2; } }

/* Access (dark band) */
.btx-access { background: radial-gradient(80% 120% at 0% 0%, #26262b 0%, rgba(38,38,43,0) 60%), var(--ink); color: #f4f3ef; padding: 72px 0; }
@media (min-width: 992px) { .btx-access { padding: 96px 0; } }
.btx-access h2 em { color: #c9c8c2; }
.btx-access .btx-intro { color: #dddcd6; }
.btx-label--light { color: #e4e3dd; }
.btx-label--light::after { background: rgba(255,255,255,.4); }
.btx-access a { color: #fff; }
.btx-form--full { display: grid; gap: 22px; }
.btx-field label { display: block; font: 600 17px var(--sans); color: #fff; margin-bottom: 8px; }
.btx-field small { font-size: 15px; font-weight: 400; color: #b9b8b2; margin-left: 6px; }
.btx-field input, .btx-field select { width: 100%; height: 56px; padding: 0 16px; border: 1px solid rgba(255,255,255,.35); border-radius: 2px; background: rgba(255,255,255,.04); color: #fff; font: 400 19px var(--sans); outline: none; transition: border-color .2s; }
.btx-field select { appearance: none; -webkit-appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, #dddcd6 50%), linear-gradient(135deg, #dddcd6 50%, transparent 50%); background-position: calc(100% - 22px) 25px, calc(100% - 16px) 25px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }
.btx-field select option { color: var(--ink); background: #fff; }
.btx-field input:focus, .btx-field select:focus { border-color: #fff; }
.btx-field input:disabled, .btx-field select:disabled { opacity: .55; }
.btx-access .btx-form-note { color: #c4c3bd; }
.btx-access .btx-form-msg.is-ok { color: #b9eec8; }
.btx-access .btx-form-msg.is-err { color: #ffb4aa; }
.btx-access :focus-visible { outline-color: #fff; }

/* FAQ */
.btx-faq { border-top: 1px solid var(--rule-strong); }
.btx-faq details { border-bottom: 1px solid var(--rule); }
.btx-faq summary { position: relative; list-style: none; cursor: pointer; padding: 20px 52px 20px 0; font: 600 19px/1.4 var(--sans); }
.btx-faq summary::-webkit-details-marker { display: none; }
.btx-faq summary::after { content: "+"; position: absolute; right: 0; top: 16px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--rule-strong); border-radius: 50%; font: 400 20px/1 var(--sans); transition: transform .2s, background .2s; }
.btx-faq details[open] summary::after { transform: rotate(45deg); background: var(--ink); color: #fff; border-color: var(--ink); }
.btx-faq details p { color: var(--ink-2); font-size: 18px; padding-right: 52px; }

/* Notice */
.btx-notice { border-top: 1px solid var(--rule); padding: 28px 0 44px; }
.btx-notice p { margin: 0 !important; max-width: 64em; font: 400 16px/1.65 var(--sans); color: var(--ink-2); }
.btx-notice b { color: var(--ink); }

/* Evidence as one-line bullets (TL;DR version) */
.btx-bullets { padding: 6px 0 14px !important; }
.btx-bullets li { position: relative; padding: 12px 0 12px 22px; border-bottom: 1px solid var(--rule); font-size: 18px; line-height: 1.5; color: var(--ink-2); }
.btx-bullets li:last-child { border-bottom: 0; }
.btx-bullets li::before { content: ""; position: absolute; left: 2px; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.btx-ev--open .btx-bullets li::before { background: transparent; border: 1.5px solid var(--ink); }
.btx-bullets b { color: var(--ink); font-weight: 600; }
.btx-ev { padding-bottom: 4px; }

/* References: button + modal (2026-11-27) */
.btx-refs-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; min-height: 44px; padding: 0 18px; border: 1px solid var(--rule-strong); border-radius: 2px; background: transparent; color: var(--ink); font: 600 15px var(--sans); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.btx-refs-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btx-ref { cursor: pointer; }
dialog.btx-refs { width: min(760px, calc(100vw - 24px)); max-height: min(80vh, 760px); padding: 0; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--paper); color: var(--ink); box-shadow: 0 40px 100px -30px rgba(0,0,0,.55); font: 400 17px/1.55 var(--sans); }
dialog.btx-refs[open] { display: flex; flex-direction: column; animation: btxIn .18s ease-out; }
dialog.btx-refs::backdrop { background: rgba(18,18,20,.5); }
@keyframes btxIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.btx-refs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--rule-strong); }
.btx-refs-head h3 { font-size: 30px !important; }
.btx-refs-x { width: 44px; height: 44px; border: 1px solid var(--rule-strong); border-radius: 50%; background: transparent; color: var(--ink); font: 400 26px/1 var(--sans); cursor: pointer; flex: none; }
.btx-refs-x:hover { background: var(--ink); color: #fff; }
dialog.btx-refs ol { list-style: decimal; margin: 0; padding: 14px 22px 6px 52px; overflow-y: auto; }
dialog.btx-refs li { padding: 10px 10px 12px 6px; margin: 0 -10px 4px 0; border-radius: 2px; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
dialog.btx-refs li.is-hit { background: #fff; outline: 1px solid var(--ink); }
dialog.btx-refs li a { font-weight: 600; white-space: nowrap; }
.btx-refs-note { margin: 0 !important; padding: 12px 22px 16px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); }
@media (max-width: 559px) { dialog.btx-refs ol { padding-left: 40px; } .btx-refs-head h3 { font-size: 26px !important; } }

/* Evidence comparison panel (v5, 2026-11-27): one panel, aligned rows, superscript refs.
   Replaces the two bullet cards (.btx-ev/.btx-bullets rules above are now unused). */
.btx-compare { display: grid; grid-template-columns: 1fr; background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 30px 60px -50px rgba(18,18,20,.4); }
@media (min-width: 860px) { .btx-compare { grid-template-columns: 1fr 1fr; } }
.btx-compare > * { order: var(--o); }
@media (min-width: 860px) { .btx-compare > * { order: 0; } .btx-cmp--open, .btx-cmp-h--open { border-left: 1px solid var(--rule); } }
.btx-cmp-h { display: flex; align-items: center; gap: 14px; padding: 22px 28px 18px; font-size: 30px !important; border-bottom: 1px solid var(--rule-strong); }
@media (max-width: 859px) { .btx-cmp-h--open { border-top: 1px solid var(--rule-strong); margin-top: 8px; } }
.btx-cmp-h--open .btx-ev-mark { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btx-cmp { display: flex; flex-direction: column; gap: 4px; padding: 16px 28px; border-bottom: 1px solid var(--rule); }
.btx-cmp b { font: 600 18px/1.35 var(--sans); color: var(--ink); }
.btx-cmp span { font-size: 17px; line-height: 1.45; color: var(--muted); }
@media (min-width: 860px) { .btx-compare > :nth-last-child(-n+2) { border-bottom: 0; } }
@media (max-width: 859px) { .btx-cmp-h, .btx-cmp { padding-left: 20px; padding-right: 20px; } .btx-compare > [style*="--o:5"], .btx-compare > [style*="--o:105"] { border-bottom: 0; } }
.btx-sup { margin-left: 3px; font: 500 13px/1 var(--sans); vertical-align: super; white-space: nowrap; color: var(--muted); }
.btx-sup .btx-ref, .btx .btx-ref { display: inline-block; min-width: 0; margin: 0; padding: 2px 2px; border: 0; border-radius: 0; font: inherit; color: var(--muted) !important; text-decoration: underline !important; text-decoration-color: var(--rule-strong) !important; text-underline-offset: 2px; vertical-align: baseline; background: none; }
.btx .btx-ref:hover { color: var(--ink) !important; background: none; text-decoration-color: var(--ink) !important; }
.btx-cmp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule-strong); }
.btx-cmp-foot p { flex: 1 1 520px; margin: 0 !important; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.btx-cmp-foot .btx-refs-btn { margin-top: 0; flex: none; }
.btx-sup { line-height: 0; position: relative; top: -1px; }
.btx .btx-sup .btx-ref { display: inline; padding: 0 1px; line-height: 0; }
.btx .btx-sup > span { line-height: 0; }
