/* Regenerated.com health tests (HT-1, ENG2-380).
   Ported from the psychology.com engine2.css and re-tokenised to the website tokens in
   resources/css/site.css (cold-white, azure-blue, steel-blue, gun-metal, charcoal-navy,
   cream, mist; Fraunces for display, Work Sans for body). Everything the engine renders is
   scoped under .rg-test; the few page-level helpers the Antlers templates use are scoped
   under .rg-tests-page. No new fonts, no dependencies, mobile first. */

.rg-test, .rg-tests-page{
  --rg-bg:#ffffff; --rg-surface:#f2f7f8; --rg-tint:#e4effd; --rg-cream:#faf7f0;
  --rg-ink:#26364d; --rg-ink-soft:#44628d; --rg-display:#0e1a2b;
  --rg-brand:#1a6dd4; --rg-brand-hover:#155cb4; --rg-brand-soft:#e3ecfd;
  --rg-line:#e3edf0; --rg-line-2:#cdd9de;
  --rg-dark:#0e1a2b; --rg-dark-2:#26364d; --rg-on-dark:#ffffff; --rg-on-dark-soft:#c9d6e8;
  --rg-good:#2f7d4f; --rg-good-bg:#e3f3e8; --rg-good-fg:#1f5a38;
  --rg-warn:#9a6b12; --rg-warn-bg:#fbf0d6; --rg-warn-fg:#6d4a08;
  --rg-high:#b23a2f; --rg-high-bg:#fbe4e1; --rg-high-fg:#7d241c;
  --rg-urgent-bg:#fbe4e1; --rg-urgent-line:#b23a2f;
  --rg-bar-soft:#9aacb3;
  --rg-serif:"Fraunces Variable","Fraunces",Georgia,"Times New Roman",serif;
  --rg-sans:"Work Sans Variable","Work Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --rg-ease:cubic-bezier(0.22,1,0.36,1);
  --rg-shadow:0px 4px 24px -8px rgba(18,105,230,0.60);
}

/* ---------- page helpers (templates) ---------- */
.rg-tests-page .rg-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:0;padding:0;list-style:none}
.rg-tests-page .rg-chip{display:inline-flex;align-items:center;min-height:32px;padding:5px 12px;border-radius:999px;background:var(--rg-tint);color:var(--rg-ink-soft);font-family:var(--rg-sans);font-size:0.8rem;font-weight:600;letter-spacing:0.01em}
.rg-tests-page .rg-chip-type{background:#ffffff;outline:1px solid var(--rg-line-2);outline-offset:-1px;color:var(--rg-brand)}
.rg-tests-page .rg-card-meta{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.rg-tests-page .rg-urgent{display:inline-block;max-width:60ch;margin:0;padding:10px 16px;border-radius:12px;background:var(--rg-urgent-bg);color:var(--rg-urgent-line);font-family:var(--rg-sans);font-size:0.95rem;font-weight:600}
.rg-tests-page .rg-noscript{padding:20px 22px;border:1px solid var(--rg-line-2);border-radius:14px;background:var(--rg-surface);color:var(--rg-ink);font-family:var(--rg-sans)}
.rg-tests-page .rg-measures{list-style:none;margin:0;padding:0;counter-reset:rgm}
.rg-tests-page .rg-measure-n{font-family:var(--rg-serif);font-size:2rem;line-height:1;color:var(--rg-brand);font-weight:400}
.rg-tests-page .rg-table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--rg-line);border-radius:14px}
.rg-tests-page .rg-table-scroll:focus-visible{outline:2px solid var(--rg-brand);outline-offset:2px}
.rg-tests-page .rg-compare{width:100%;min-width:520px;border-collapse:collapse;font-family:var(--rg-sans);font-size:0.95rem;color:var(--rg-ink)}
.rg-tests-page .rg-compare th,.rg-tests-page .rg-compare td{padding:14px 16px;text-align:left;vertical-align:top;border-bottom:1px solid var(--rg-line)}
.rg-tests-page .rg-compare thead th{background:var(--rg-surface);font-size:0.78rem;letter-spacing:0.06em;text-transform:uppercase;color:var(--rg-ink-soft)}
.rg-tests-page .rg-compare tbody th{font-weight:600;color:var(--rg-display)}
.rg-tests-page .rg-compare tr:last-child th,.rg-tests-page .rg-compare tr:last-child td{border-bottom:0}
.rg-tests-page .rg-compare td.rg-us{font-weight:600;color:var(--rg-brand)}
.rg-tests-page .rg-refs{font-size:0.92em;color:var(--rg-ink);overflow-wrap:anywhere}
.rg-tests-page .rg-review{font-size:0.95em;color:var(--rg-ink-soft)}
.rg-tests-page .rg-callout{margin:0;padding:20px 22px;border:1px solid var(--rg-line-2);border-radius:14px;background:var(--rg-surface)}
.rg-tests-page .rg-cta-form{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;max-width:520px}
.rg-tests-page .rg-cta-label{font-family:var(--rg-sans);font-size:0.85rem;font-weight:600;color:var(--rg-ink-soft)}
.rg-tests-page .rg-select,.rg-test .rg-select{width:100%;min-height:48px;padding:10px 40px 10px 16px;border:1px solid var(--rg-line-2);border-radius:12px;background:#fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1.5 6 6.5 11 1.5' stroke='%2344628d' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 16px center/12px 8px;color:var(--rg-ink);font-family:var(--rg-sans);font-size:1rem;appearance:none;-webkit-appearance:none}
.rg-tests-page .rg-select:focus-visible,.rg-test .rg-select:focus-visible{outline:2px solid var(--rg-brand);outline-offset:2px}
@media(min-width:640px){.rg-tests-page .rg-cta-form{flex-direction:row;flex-wrap:wrap;justify-content:center;max-width:none}.rg-tests-page .rg-cta-form .rg-select{width:auto;min-width:220px}}

/* ---------- engine base ---------- */
.rg-test{font-family:var(--rg-sans);color:var(--rg-ink);font-size:1.0625rem;line-height:1.6}
.rg-test *,.rg-test *:before,.rg-test *:after{box-sizing:border-box}
.rg-test h2,.rg-test h3,.rg-test h4{font-family:var(--rg-serif);font-weight:400;letter-spacing:-0.01em;line-height:1.15;text-wrap:balance;margin:0;color:var(--rg-display)}
.rg-test p{margin:0 0 1em;text-wrap:pretty}
.rg-test p:last-child{margin-bottom:0}
.rg-test a{color:var(--rg-brand);text-decoration:underline;text-decoration-color:rgba(26,109,212,0.4);text-underline-offset:2px}
.rg-test a:hover{text-decoration-color:currentColor}
.rg-test :focus-visible{outline:2px solid var(--rg-brand);outline-offset:3px;border-radius:3px}
.rg-test .result-hero :focus-visible,.rg-test .panel-top :focus-visible{outline-color:#ffffff}
.rg-test .muted{color:var(--rg-ink-soft)}
.rg-test .lead{font-size:1.15rem}
.rg-test .rg-h3{font-size:1.35rem;margin:34px 0 6px}
.rg-test .ui2-announcement{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.rg-test img.q-img{max-width:420px;width:100%;height:auto;display:block;margin:0 0 14px;border-radius:12px}

/* ---------- test panel ---------- */
.rg-test .panel{position:relative;border:1px solid var(--rg-line);border-radius:18px;overflow:hidden;background:var(--rg-bg)}
.rg-test .progress{height:3px;background:var(--rg-line);position:relative}
.rg-test .progress span{position:absolute;left:0;top:0;bottom:0;right:0;background:var(--rg-brand);transform:scaleX(0);transform-origin:left center;transition:transform .45s var(--rg-ease)}
.rg-test .panel-top{background:var(--rg-surface);padding:18px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;border-bottom:1px solid var(--rg-line)}
.rg-test .panel-top h2{font-size:1.3rem}
.rg-test .panel-top .step-label{font-size:0.76rem;color:var(--rg-ink-soft);font-weight:700;letter-spacing:0.06em;text-transform:uppercase}
.rg-test .panel-body{padding:26px 20px 30px}
@media(min-width:640px){.rg-test .panel-top{padding:22px 30px}.rg-test .panel-top h2{font-size:1.4rem}.rg-test .panel-body{padding:36px 40px 40px}}
.rg-test .stage{display:none}
.rg-test .stage.active{display:block;animation:rgfade .45s var(--rg-ease)}
@keyframes rgfade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.rg-test .stage.active{animation:none}.rg-test .progress span,.rg-test .bar i{transition:none}}
.rg-test .panel.measuring .stage{display:block;position:absolute;visibility:hidden;pointer-events:none;width:100%}
.rg-test .intro-stage h3,.rg-test .calc-stage h3{font-size:1.6rem;margin-bottom:12px}
.rg-test .section-tag{display:inline-block;font-weight:700;font-size:0.74rem;letter-spacing:0.08em;text-transform:uppercase;color:var(--rg-ink-soft);margin-bottom:18px}
.rg-test .instructions{color:var(--rg-ink-soft);font-size:0.95rem;margin:0 0 16px}
.rg-test .q .qnum{display:block;font-weight:700;color:var(--rg-brand);font-size:0.78rem;letter-spacing:0.04em;text-transform:uppercase}
.rg-test .q .qtext{font-family:var(--rg-serif);font-size:1.35rem;line-height:1.32;margin:10px 0 4px;display:block;font-weight:400;color:var(--rg-display)}
.rg-test .q .qhelp{color:var(--rg-ink-soft);font-size:0.95rem;margin:6px 0 18px}
.rg-test .qblock{padding:12px 0 20px}
.rg-test .opts{display:grid;gap:10px;max-width:560px}
.rg-test .opt{display:flex;align-items:center;gap:12px;min-height:48px;border:1px solid var(--rg-line-2);border-radius:12px;padding:12px 16px;cursor:pointer;font-weight:500;font-size:1rem;transition:border-color .15s,background .15s;background:var(--rg-bg);text-align:left;width:100%;font-family:var(--rg-sans);color:var(--rg-ink)}
.rg-test .opt:hover{border-color:var(--rg-ink-soft);background:var(--rg-surface)}
.rg-test .opt.sel{border-color:var(--rg-brand);background:var(--rg-brand-soft);box-shadow:inset 0 0 0 1px var(--rg-brand)}
.rg-test .opt .option-key{width:26px;height:26px;border-radius:7px;border:1px solid var(--rg-line-2);display:grid;place-items:center;flex:none;font-size:0.78rem;font-weight:700;color:var(--rg-ink-soft);background:#fff}
.rg-test .opt.sel .option-key{border-color:var(--rg-brand);color:var(--rg-brand)}
.rg-test .opt .lbl{flex:1}
.rg-test .opt .selection-mark{width:20px;height:20px;border-radius:50%;background:var(--rg-brand);display:grid;place-items:center;flex:none;opacity:0;transition:opacity .15s}
.rg-test .opt .selection-mark svg{width:12px;height:12px;color:#fff}
.rg-test .opt.sel .selection-mark{opacity:1}
.rg-test .scale-opts{display:grid;grid-template-columns:1fr;gap:8px;max-width:660px}
.rg-test .scale-anchors{display:none}
@media(min-width:640px){
  .rg-test .scale-opts{grid-template-columns:repeat(5,1fr)}
  .rg-test .scale-opts .opt{flex-direction:column;justify-content:center;text-align:center;gap:8px;padding:14px 8px;font-size:0.8rem;font-weight:600}
  .rg-test .scale-opts .opt .selection-mark{display:none}
  .rg-test .scale-anchors{display:flex;justify-content:space-between;max-width:660px;margin-top:8px;font-size:0.78rem;color:var(--rg-ink-soft)}
}
.rg-test .answer-hint{color:var(--rg-ink-soft);font-size:0.88rem;margin:16px 0 0}
.rg-test .privacy-note{display:flex;gap:12px;align-items:flex-start;background:var(--rg-surface);border:1px solid var(--rg-line);border-radius:12px;padding:14px 16px;margin:20px 0;font-size:0.92rem;color:var(--rg-ink-soft)}
.rg-test .privacy-note b{color:var(--rg-ink)}
.rg-test .privacy-note svg{width:21px;height:21px;color:var(--rg-brand);flex:none;margin-top:2px}
.rg-test .nav-btns{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:28px}

/* ---------- buttons ---------- */
.rg-test .btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:48px;font-family:var(--rg-sans);font-weight:600;font-size:1rem;padding:12px 26px;border-radius:999px;border:1px solid transparent;cursor:pointer;transition:background .2s,border-color .2s,box-shadow .2s;text-decoration:none;line-height:1.2}
.rg-test .btn:hover{text-decoration:none}
.rg-test .btn-primary{background:var(--rg-brand);color:#fff;box-shadow:var(--rg-shadow)}
.rg-test .btn-primary:hover{background:var(--rg-brand-hover)}
.rg-test .btn-primary[disabled]{opacity:.45;cursor:not-allowed;box-shadow:none}
.rg-test .btn-line{border-color:var(--rg-line-2);color:var(--rg-ink);background:#fff}
.rg-test .btn-line:hover{border-color:var(--rg-ink-soft)}
.rg-test .btn-ghost{background:none;color:var(--rg-ink-soft);border:0;min-height:44px;padding:8px 10px;font-weight:600;cursor:pointer;font-family:var(--rg-sans);font-size:0.95rem}
.rg-test .btn-ghost:hover{color:var(--rg-ink)}

/* ---------- results ---------- */
.rg-test #results{display:none}
.rg-test .result-hero{background:var(--rg-dark);color:var(--rg-on-dark);border-radius:18px 18px 0 0;padding:32px 20px 28px}
.rg-test .result-hero .lbl,.rg-test .type-result .lbl{display:block;font-weight:700;font-size:0.74rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--rg-on-dark-soft)}
.rg-test .result-hero .hero-urgent{margin:0 0 16px;padding:10px 14px;border-radius:10px;background:rgba(255,255,255,0.1);border:1px solid rgba(255,255,255,0.25);color:#fff;font-size:0.95rem;font-weight:600}
.rg-test .result-hero .hero-lead{color:var(--rg-on-dark-soft);max-width:56ch;margin:16px 0 0}
.rg-test .result-hero .hero-outlabel{color:var(--rg-on-dark-soft);margin:0 0 10px;font-size:0.95rem}
.rg-test .result-hero .hero-dosing{margin:8px 0 14px;color:#fff;font-weight:600;font-size:0.95rem}
.rg-test .score-big{display:flex;align-items:baseline;gap:12px;margin:14px 0 8px;flex-wrap:wrap}
.rg-test .score-big .num{font-family:var(--rg-serif);font-size:3.4rem;line-height:1;color:#fff;font-weight:300}
.rg-test .score-big .den{font-size:1.2rem;color:var(--rg-on-dark-soft)}
.rg-test .band-tag{display:inline-block;font-weight:700;font-size:0.88rem;padding:6px 14px;border-radius:999px;margin-top:4px;border:1px solid currentColor}
.rg-test .result-body{border:1px solid var(--rg-line);border-top:0;border-radius:0 0 18px 18px;padding:28px 20px 32px;background:#fff}
@media(min-width:640px){.rg-test .result-hero{padding:42px 40px 36px}.rg-test .result-body{padding:36px 40px 42px}.rg-test .score-big .num{font-size:4.4rem}}
.rg-test .metrics{display:grid;grid-template-columns:1fr;gap:16px;margin:8px 0}
@media(min-width:680px){.rg-test .metrics{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}}
.rg-test .metric{padding:2px 0}
.rg-test .metric .mlabel{font-size:0.76rem;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;color:var(--rg-ink-soft)}
.rg-test .metric .mval{font-family:var(--rg-serif);font-size:1.8rem;margin:6px 0 0;font-weight:400;color:var(--rg-display)}
.rg-test .metric .munit{font-size:0.9rem;color:var(--rg-ink-soft);font-family:var(--rg-sans)}
.rg-test .metric .mnote{font-size:0.84rem;color:var(--rg-ink-soft);margin-top:6px}
.rg-test .bar{height:6px;border-radius:999px;background:var(--rg-line);overflow:hidden;margin-top:10px}
.rg-test .bar i{display:block;height:100%;border-radius:999px;transition:width .6s var(--rg-ease)}
.rg-test .breakdown{margin:20px 0 30px}
.rg-test .brow{display:grid;grid-template-columns:1fr auto;gap:6px 12px;align-items:center;padding:9px 0;font-size:0.95rem}
.rg-test .brow .bar{grid-column:1 / -1;order:3;margin:0}
@media(min-width:560px){.rg-test .brow{grid-template-columns:190px 1fr 64px;gap:16px}.rg-test .brow .bar{grid-column:auto;order:0}}
.rg-test .brow .blabel{font-weight:600}
.rg-test .brow .bnum{text-align:right;font-weight:600;font-family:var(--rg-serif);color:var(--rg-ink-soft)}
.rg-test .interp{border:1px solid var(--rg-line);border-radius:14px;padding:22px 22px;margin:26px 0;background:var(--rg-surface)}
.rg-test .interp h3{font-size:0.76rem;font-family:var(--rg-sans);font-weight:700;letter-spacing:0.07em;text-transform:uppercase;color:var(--rg-ink-soft);margin-bottom:12px}
.rg-test .interp p{font-size:1.0625rem;line-height:1.6;color:var(--rg-ink);margin:0}
.rg-test .health-grid{display:grid;grid-template-columns:1fr;gap:20px 36px;margin-top:18px}
@media(min-width:600px){.rg-test .health-grid{grid-template-columns:1fr 1fr}}
.rg-test .health-item{font-size:0.95rem;color:var(--rg-ink-soft)}
.rg-test .health-item b{display:block;font-family:var(--rg-serif);font-weight:500;font-size:1.08rem;margin-bottom:4px;color:var(--rg-display)}
.rg-test .resilience-box{border:1px solid var(--rg-line);border-radius:14px;padding:22px;margin:26px 0;background:var(--rg-surface)}
.rg-test .resilience-box h3{font-size:1.2rem;font-weight:500}
.rg-test .resilience-box p{margin:8px 0 0}
.rg-test .steps{counter-reset:s;margin:18px 0;padding:0;list-style:none}
.rg-test .steps li{counter-increment:s;position:relative;padding:12px 0 12px 46px;line-height:1.55}
.rg-test .steps li:before{content:counter(s);position:absolute;left:0;top:14px;font-family:var(--rg-serif);font-weight:400;color:var(--rg-brand);font-size:1.4rem;line-height:1}
.rg-test .type-result{text-align:center;padding:6px 0}
.rg-test .type-result .type-name{font-family:var(--rg-serif);font-size:clamp(1.8rem,5vw,2.8rem);color:#fff;margin:12px 0 0;font-weight:300;line-height:1.15}
.rg-test .type-result .type-code{color:var(--rg-on-dark-soft);font-weight:700;letter-spacing:0.15em;margin:10px 0 0}
.rg-test .dims{margin:22px 0}
.rg-test .dim{display:grid;grid-template-columns:1fr auto;gap:6px 12px;align-items:center;padding:9px 0;font-size:0.96rem}
.rg-test .dim .bar{grid-column:1 / -1;order:3;margin:0}
@media(min-width:560px){.rg-test .dim{grid-template-columns:210px 1fr 52px;gap:16px}.rg-test .dim .bar{grid-column:auto;order:0}}
.rg-test .dim .dname{font-weight:600}
.rg-test .dim.top .dname{color:var(--rg-brand)}
.rg-test .dim .dnum{text-align:right;font-weight:600;font-family:var(--rg-serif);color:var(--rg-ink-soft)}
.rg-test .dl-row{display:flex;gap:12px;flex-wrap:wrap;margin:26px 0}
.rg-test .result-disclaimer{font-size:0.86rem;color:var(--rg-ink-soft);margin:22px 0 0}
.rg-test .urgent,.rg-test .critical-note{display:flex;gap:12px;align-items:flex-start;background:var(--rg-urgent-bg);border:1px solid rgba(178,58,47,0.35);border-radius:12px;padding:16px 18px;margin:24px 0 0;font-size:0.95rem;color:var(--rg-ink)}
.rg-test .urgent svg,.rg-test .critical-note svg{width:22px;height:22px;color:var(--rg-urgent-line);flex:none;margin-top:2px}
.rg-test .urgent{font-weight:600;color:var(--rg-urgent-line)}
.rg-test .critical-note p{margin:0 0 8px}
.rg-test .critical-note p:last-child{margin:0}
.rg-test .intro-stage .urgent,.rg-test .calc-stage .urgent{margin:0 0 22px}

/* ---------- result CTA ---------- */
.rg-test .cta-band{background:var(--rg-tint);border-radius:16px;padding:26px 22px;margin:30px 0 0}
.rg-test .cta-band .cta-eyebrow{display:block;font-weight:700;font-size:0.74rem;letter-spacing:0.1em;text-transform:uppercase;color:var(--rg-ink-soft);margin-bottom:8px}
.rg-test .cta-band h3{font-size:1.45rem;max-width:28ch}
.rg-test .cta-band p{color:var(--rg-ink);margin:10px 0 0;max-width:60ch;font-size:0.98rem}
.rg-test .cta-band .cta-row{display:flex;flex-direction:column;gap:12px;margin-top:18px}
.rg-test .cta-band .cta-label{font-size:0.85rem;font-weight:600;color:var(--rg-ink-soft)}
.rg-test .cta-band .cta-fine{font-size:0.84rem;color:var(--rg-ink-soft);margin-top:14px}
@media(min-width:640px){.rg-test .cta-band{padding:30px 32px}.rg-test .cta-band .cta-row{flex-direction:row;flex-wrap:wrap;align-items:center}.rg-test .cta-band .rg-select{width:auto;min-width:220px}.rg-test .cta-band .cta-label{flex-basis:100%}}

/* ---------- calculator ---------- */
.rg-test .calc-form{display:grid;gap:18px;max-width:560px}
.rg-test .calc-row{display:grid;gap:6px}
.rg-test .calc-label{font-weight:600;font-size:0.95rem;color:var(--rg-ink)}
.rg-test .calc-field{position:relative;display:flex;align-items:center}
.rg-test .calc-in{width:100%;min-height:48px;padding:10px 16px;border:1px solid var(--rg-line-2);border-radius:12px;background:#fff;color:var(--rg-ink);font-family:var(--rg-sans);font-size:1.05rem}
.rg-test .calc-field .calc-in{padding-right:72px}
.rg-test .calc-in:focus-visible{outline:2px solid var(--rg-brand);outline-offset:2px;border-color:var(--rg-brand)}
.rg-test .calc-unit{position:absolute;right:14px;font-size:0.85rem;color:var(--rg-ink-soft);pointer-events:none}
.rg-test .calc-help{font-size:0.86rem;color:var(--rg-ink-soft)}
.rg-test .calc-err{min-height:1.2em;margin:0;font-size:0.9rem;color:var(--rg-high);font-weight:600}
.rg-test .dosing-line{margin:0 0 18px;padding:12px 16px;border-radius:12px;background:var(--rg-cream);border:1px solid #ddd2b8;color:var(--rg-ink);font-weight:600;font-size:0.95rem}
.rg-test .calc-inputs{display:grid;grid-template-columns:1fr;gap:8px 24px;margin:12px 0 0;font-size:0.95rem}
@media(min-width:560px){.rg-test .calc-inputs{grid-template-columns:1fr 1fr}}
.rg-test .calc-inputs div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--rg-line)}
.rg-test .calc-inputs dt{color:var(--rg-ink-soft)}
.rg-test .calc-inputs dd{margin:0;font-weight:600;text-align:right}
.rg-test .calc-notes{margin:12px 0 0;padding-left:1.2em;font-size:0.95rem;color:var(--rg-ink)}
.rg-test .calc-notes li{margin:0 0 8px}
.rg-test .calc-how{margin-top:30px;padding:22px;border:1px solid var(--rg-line);border-radius:14px;background:var(--rg-surface);font-size:0.95rem}
.rg-test .calc-how .rg-h3{margin-top:0}
.rg-test .calc-how .calc-how-title{font-weight:600;color:var(--rg-display)}
.rg-test .calc-how .calc-source,.rg-test .calc-how .calc-example{color:var(--rg-ink-soft);overflow-wrap:anywhere}
.rg-test .calc-how p{margin:0 0 10px}

/* ---------- task runners: appended verbatim from the source engine at build time, see tools/tests-port-task-css.py ---------- */
.rg-test .task-area{margin:6px 0 0}
.rg-test .rt-box{border:1px solid var(--rg-line-2);border-radius:16px;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px;cursor:pointer;user-select:none;-webkit-user-select:none;touch-action:manipulation;transition:background .12s,border-color .12s;background:var(--rg-surface)}
.rg-test .rt-box.wait{background:oklch(0.60 0.16 30);border-color:transparent;color:var(--rg-on-dark)}
.rg-test .rt-box.go{background:oklch(0.60 0.17 150);border-color:transparent;color:var(--rg-on-dark)}
.rg-test .rt-box.early{background:var(--rg-urgent-bg);border-color:var(--rg-urgent-line)}
.rg-test .rt-box.done,.rg-test .rt-box.shown{background:var(--rg-tint)}
.rg-test .rt-big{font-family:var(--rg-serif);font-size:2.2rem;line-height:1.1}
.rg-test .rt-sub{font-size:0.95rem;color:var(--rg-ink-soft);margin-top:10px}
.rg-test .rt-box.wait .rt-sub,.rg-test .rt-box.go .rt-sub{color:rgba(255,255,255,.85)}
.rg-test .ds-stage{min-height:240px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;border:1px solid var(--rg-line-2);border-radius:16px;background:var(--rg-surface);padding:30px;text-align:center}
.rg-test .ds-digit{font-family:var(--rg-serif);font-size:5rem;line-height:1;min-height:5rem;color:var(--rg-ink)}
.rg-test .ds-form{display:flex;flex-direction:column;gap:12px;align-items:center}
.rg-test .ds-in{font-family:var(--rg-serif);font-size:2rem;letter-spacing:0.18em;text-align:center;padding:10px 14px;border:1px solid var(--rg-line-2);border-radius:12px;width:min(100%,320px);background:var(--rg-bg);color:var(--rg-ink)}
.rg-test .ds-msg{font-family:var(--rg-serif);font-size:1.6rem;line-height:1.2}
.rg-test .ds-msg.ok{color:var(--rg-good)}.ds-msg.no{color:var(--rg-high)}
.rg-test .sym-key{display:grid;grid-template-columns:repeat(9,1fr);gap:6px;margin-bottom:16px}
.rg-test .sym-k{display:flex;flex-direction:column;align-items:center;gap:4px;border:1px solid var(--rg-line);border-radius:10px;padding:8px 4px;background:var(--rg-bg);color:var(--rg-ink)}
.rg-test .sym-g svg{width:30px;height:30px;display:block}
.rg-test .sym-d{font-family:var(--rg-sans);font-weight:700;font-size:0.95rem}
.rg-test .sym-stage{min-height:280px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;border:1px solid var(--rg-line-2);border-radius:16px;background:var(--rg-surface);padding:24px;text-align:center}
.rg-test .sym-cur{color:var(--rg-brand)}.sym-cur svg{width:110px;height:110px;display:block}
.rg-test .sym-timer{font-family:var(--rg-sans);font-weight:700;letter-spacing:0.06em;color:var(--rg-ink-soft)}
.rg-test .sym-btns{display:grid;grid-template-columns:repeat(9,1fr);gap:6px;width:100%;max-width:520px}
.rg-test .sym-b{font-family:var(--rg-sans);font-weight:700;font-size:1.1rem;padding:12px 0;border:1px solid var(--rg-line-2);border-radius:10px;background:var(--rg-bg);cursor:pointer;color:var(--rg-ink);touch-action:manipulation}
.rg-test .sym-b:active{background:var(--rg-tint)}
.rg-test .rot-item{text-align:center;border:1px solid var(--rg-line-2);border-radius:16px;background:var(--rg-surface);padding:24px}
.rg-test .rot-target{display:inline-block;padding:12px;border:1px solid var(--rg-line-2);border-radius:14px;background:var(--rg-bg);margin:6px 0 16px}
.rg-test .rot-svg{width:96px;height:96px;display:block;fill:var(--rg-brand)}
.rg-test .rot-opts{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;max-width:520px;margin:0 auto}
.rg-test .rot-opt{border:1px solid var(--rg-line-2);border-radius:14px;background:var(--rg-bg);padding:10px;cursor:pointer}
.rg-test .rot-opt:hover{border-color:var(--rg-ink-soft)}
.rg-test .rot-opt .rot-svg{width:80px;height:80px;margin:0 auto;fill:var(--rg-ink-soft)}
@media(max-width:560px){.rg-test .sym-key{gap:3px}.rg-test .sym-g svg{width:20px;height:20px}.rg-test .sym-btns{gap:4px}.rg-test .sym-b{padding:10px 0;font-size:1rem}.rg-test .rot-opts{grid-template-columns:repeat(2,1fr)}.rg-test .rt-big{font-size:1.6rem}.rg-test .ds-digit{font-size:4rem}}
.rg-test .rot-opt{position:relative}
.rg-test .rot-n{position:absolute;top:6px;left:8px;font-family:var(--rg-sans);font-weight:700;font-size:0.72rem;color:var(--rg-ink-soft)}
.rg-test .rt-box{width:100%;font-family:var(--rg-sans);color:var(--rg-ink);appearance:none}
.rg-test .rt-box .rt-big{font-family:var(--rg-serif);font-size:2.2rem;line-height:1.1;display:block}
.rg-test .rt-box .rt-sub{display:block}
.rg-test .brow-low .blabel{font-weight:700}
@media (prefers-reduced-motion:reduce){.rg-test .rt-box,.rg-test .opt,.rg-test .btn{transition:none}}
/* Stroop task (PSY-1865): the word is the only place color carries meaning; every
   response button names its color in words and shows its keyboard key. */
.rg-test .st-stage{border:1px solid var(--rg-line-2);border-radius:16px;background:var(--rg-surface);min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:26px 20px}
.rg-test .st-word{font-family:var(--rg-sans);font-weight:800;font-size:clamp(2.6rem,9vw,4.2rem);line-height:1.05;letter-spacing:.02em;min-height:1.1em}
.rg-test .st-word.st-fix,.rg-test .st-word.st-blank{color:var(--rg-ink-soft);font-weight:400}
.rg-test .st-keys{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:14px}
.rg-test .st-key{display:flex;flex-direction:column;align-items:center;gap:6px;border:1px solid var(--rg-line-2);border-radius:14px;background:var(--rg-bg);padding:12px 6px;cursor:pointer;font-family:var(--rg-sans);color:var(--rg-ink)}
.rg-test .st-key:disabled{opacity:.5;cursor:default}
.rg-test .st-key:hover:not(:disabled){border-color:var(--rg-ink-soft)}
.rg-test .st-swatch{width:26px;height:26px;border-radius:8px;border:1px solid rgba(0,0,0,.14)}
.rg-test .st-kname{font-weight:600;font-size:.95rem}
.rg-test .st-kkey{font-size:.72rem;font-weight:700;color:var(--rg-ink-soft);letter-spacing:.08em}

/* Grid memory task (PSY-1865): a square grid of buttons, lit for the study phase and
   pressable for the recall phase. Cells carry row and column labels for screen readers. */
.rg-test .gm-stage{border:1px solid var(--rg-line-2);border-radius:16px;background:var(--rg-surface);min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:26px 20px}
.rg-test .gm-grid{display:grid;grid-template-columns:repeat(var(--gm-n,4),1fr);gap:8px;width:min(340px,86vw)}
.rg-test .gm-cell{aspect-ratio:1;border:1px solid var(--rg-line-2);border-radius:10px;background:var(--rg-bg);cursor:pointer;padding:0;transition:background .12s,border-color .12s}
.rg-test .gm-cell:disabled{cursor:default}
.rg-test .gm-cell.on{background:var(--rg-ink);border-color:var(--rg-ink)}
.rg-test .gm-cell.pick{background:var(--honey-deep,oklch(0.72 0.12 75));border-color:var(--honey-deep,oklch(0.72 0.12 75))}
.rg-test .gm-cell:hover:not(:disabled):not(.pick){border-color:var(--rg-ink-soft)}

/* Item illustration (PSY-1865): optional `img` on a scale item. */
.rg-test .q-img{display:block;width:100%;max-width:420px;height:auto;margin:0 0 14px;border:1px solid var(--rg-line);border-radius:14px;background:var(--rg-surface)}

@media(max-width:560px){.rg-test .st-keys{gap:6px}.rg-test .st-key{padding:10px 2px}.rg-test .st-kname{font-size:.82rem}.rg-test .gm-grid{gap:6px}}
@media (prefers-reduced-motion:reduce){.rg-test .gm-cell,.rg-test .st-key{transition:none}}


/* UI 2 sheet: local tokens and focus keep the shared page chrome untouched. */
.rg-test #taskArea .ds-stage,.rg-test #taskArea .sym-stage,.rg-test #taskArea .rot-item{border-radius:0;box-shadow:none;padding:16px}
.rg-test #taskArea .sym-stage{min-height:0;gap:8px}
.rg-test #taskArea .sym-cur svg{width:64px;height:64px}
.rg-test #taskArea .sym-timer{font-size:14px;line-height:1.4}

/* ---------- print: the result only ---------- */
@media print{
  .rg-printing body > *:not(:has(.rg-test)){display:none !important}
  .rg-printing header,.rg-printing footer,.rg-printing nav{display:none !important}
  .rg-printing .rg-tests-page > section:not(#test){display:none !important}
  .rg-test .panel,.rg-test .dl-row,.rg-test .cta-band{display:none !important}
  .rg-test #results{display:block !important}
  .rg-test .result-hero{background:#fff !important;color:#000 !important;border:1px solid #000;border-radius:0}
  .rg-test .result-hero .lbl,.rg-test .result-hero .hero-lead,.rg-test .score-big .num,.rg-test .score-big .den,.rg-test .type-result .type-name,.rg-test .result-hero .hero-outlabel{color:#000 !important}
  .rg-test .result-body{border-radius:0}
}
