/* Nanonetes battery — instrument-panel design, dashboard-grade execution.
   Extends /assets/brand/style.css tokens. Mobile-first. */

.battery-hero, .battery-brief, .battery-run, .battery-results {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 28px 72px;
}

.battery-hero h1, .battery-results h2 {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin-bottom: 18px;
}

.battery-lede { font-size: 18px; line-height: 1.6; color: var(--soft); max-width: 62ch; }

.battery-note {
  font-size: 13.5px;
  color: var(--soft);
  border-left: 3px solid var(--rule);
  padding-left: 14px;
  max-width: 68ch;
  margin: 22px 0 40px;
}
.battery-note strong { color: var(--ink); }

/* ---------- chooser ---------- */

.test-index { list-style: none; display: grid; gap: 2px; }

.test-index .group-row {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding: 26px 4px 8px;
  border-bottom: 1px solid var(--mark);
  margin-bottom: 6px;
}

.test-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 18px;
  align-items: baseline;
  padding: 13px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: background-color 100ms ease;
}
.test-card:hover { background: rgba(29,29,27,.055); }
.test-card:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.test-name { font-size: 17px; font-weight: 600; grid-row: span 2; align-self: center; }
.test-measures { font-size: 14.5px; color: var(--soft); }
.test-meta { font-size: 12px; color: var(--soft); grid-column: 2; text-align: right; }
.mono { font-family: var(--mono); }

/* ---------- brief ---------- */

.crumb { margin-bottom: 18px; }
.crumb a { color: var(--soft); text-decoration: none; font-size: 14.5px; }
.crumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.brief-facts, .result-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 28px;
  border-block: 1px solid var(--rule);
  padding: 18px 0;
  margin: 22px 0 26px;
}
.brief-facts dt, .metric dt { font-size: 12px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; }
.brief-facts dd, .metric dd { font-size: 15px; margin-top: 3px; }

.brief-body { display: grid; gap: 12px; max-width: 66ch; font-size: 16px; line-height: 1.65; }
.brief-body p { color: var(--ink); }
.safety-note {
  background: var(--note-bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
}

.brief-regions-label {
  font-size: 12px; font-weight: 600; color: var(--soft);
  text-transform: uppercase; letter-spacing: .05em;
  margin: 26px 0 10px;
}
.region-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; }
.region-chip {
  display: inline-block;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 5px 13px;
  transition: background-color 100ms ease, color 100ms ease;
}
.region-chip strong { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.region-chip:hover { background: var(--ink); color: var(--paper); }

.brief-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- run ---------- */

.battery-run { padding-left: 0; padding-right: 0; }
.run-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 20px 12px;
  max-width: 820px;
  margin: 0 auto;
}
.run-name { font-weight: 600; font-size: 15.5px; }
.run-progress { font-size: 12.5px; color: var(--soft); }

.run-stage {
  width: min(820px, 100%);
  margin: 0 auto;
  min-height: 460px;
  background:
    radial-gradient(90% 60% at 50% 30%, rgba(255,255,255,.07), transparent 70%),
    linear-gradient(180deg, #232327 0%, #1B1B1E 100%);
  border: 1px solid #0E0E10;
  border-radius: 14px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px 20px;
  position: relative;
  overflow: hidden;
  user-select: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 18px 44px -20px rgba(29,29,27,.45);
}

.run-foot {
  max-width: 820px;
  margin: 10px auto 0;
  padding: 0 20px;
  min-height: 22px;
  font-size: 13px;
  color: var(--soft);
  text-align: center;
}

/* stimulus text (word, letters, arrows, digits) */
.stim {
  font-size: clamp(46px, 9vw, 72px);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.15;
  color: var(--white);
}
.stim.ink-red { color: var(--stim-red); }
.stim.ink-green { color: var(--stim-green); }
.stim.ink-blue { color: var(--stim-blue); }
.stim.ink-yellow { color: var(--stim-yellow); }
.fixation { font-size: 46px; color: rgba(245,245,241,.85); }

.cue {
  font-family: var(--mono);
  font-size: 15px;
  color: rgba(245,245,241,.85);
  border: 1px solid rgba(245,245,241,.4);
  border-radius: 6px;
  padding: 4px 14px;
  margin-bottom: 20px;
}
.cue-color-letter { color: #FFD75E; }
.cue-color-digit { color: #7FD7FF; }

/* choice rows inside the stage */
.choice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-top: 26px;
}
.choice-btn {
  flex: 1 1 120px;
  max-width: 190px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(245,245,241,.5);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 100ms ease, border-color 100ms ease;
  touch-action: manipulation;
}
.choice-btn:hover { background: rgba(255,255,255,.14); border-color: var(--white); }
.choice-btn kbd { border-color: rgba(245,245,241,.4); }
.choice-btn.hot { background: var(--stim-red); border-color: var(--stim-red); color: var(--white); }
.choice-btn.cold { background: var(--stim-blue); border-color: var(--stim-blue); }
.choice-btn.kbd-btn { font-family: var(--mono); }

/* generic stage text */
.stage-note { font-size: 17px; line-height: 1.55; color: rgba(245,245,241,.92); max-width: 40ch; }
.stage-sub { font-size: 14px; color: rgba(245,245,241,.65); margin-top: 14px; }

/* grids for corsi / sdmt */
.block-grid {
  display: grid;
  grid-template-columns: repeat(3, 84px);
  gap: 12px;
  justify-content: center;
}
.block {
  aspect-ratio: 1;
  border-radius: 10px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(245,245,241,.3);
  cursor: pointer;
  transition: background-color 80ms ease, transform 80ms ease;
}
.block.lit { background: var(--white); transform: scale(1.06); }
.block:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }

.sdmt-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
}
.sdmt-cell {
  width: 44px;
  text-align: center;
  border: 1px solid rgba(245,245,241,.35);
  border-radius: 6px;
  padding: 4px 0;
  font-size: 18px;
}
.sdmt-cell small { display: block; font-size: 11px; color: rgba(245,245,241,.6); }
.sdmt-rows { display: grid; gap: 8px; }
.sdmt-row { display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap; }
.sdmt-item {
  width: 44px;
  text-align: center;
  background: rgba(255,255,255,.08);
  border-radius: 6px;
  padding: 6px 0;
  font-size: 19px;
}
.sdmt-item input {
  width: 100%;
  text-align: center;
  background: transparent;
  border: 0;
  color: var(--white);
  font-family: var(--mono);
  font-size: 16px;
  outline: none;
}
.sdmt-item input:focus { background: rgba(255,255,255,.12); }

/* decks (IGT) */
.deck-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }
.deck {
  flex: 1 1 120px;
  max-width: 170px;
  aspect-ratio: 3/4.2;
  border-radius: 12px;
  border: 1px solid rgba(245,245,241,.45);
  background:
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(255,255,255,.045) 10px 11px),
    rgba(255,255,255,.06);
  color: var(--white);
  font-family: var(--mono);
  font-size: 15px;
  cursor: pointer;
  transition: transform 90ms ease, background-color 90ms ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
}
.deck:hover { transform: translateY(-6px); background-color: rgba(255,255,255,.12); }
.deck:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* balloon (BART) */
.balloon {
  width: min(180px, 40vw);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 auto;
  background: radial-gradient(circle at 35% 30%, #7ED0A5, var(--stim-green) 75%);
  border: 1px solid rgba(245,245,241,.5);
  transition: transform 90ms ease;
  box-shadow: 0 14px 34px -12px rgba(0,0,0,.5);
}
.balloon.pop { background: radial-gradient(circle at 40% 35%, #F1A08F, var(--stim-red) 80%); }

/* IAT pairing columns */
.pair-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  margin-top: 22px;
}
.pair-cols p {
  border: 2px solid rgba(245,245,241,.45);
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(245,245,241,.9);
}
.pair-cols .left { text-align: left; padding-left: 14px; }
.pair-cols .right { text-align: right; padding-right: 14px; }
.pair-cols strong { display: block; font-size: 16px; color: var(--white); }

/* questionnaire (scales) */
.scale-progress {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.14);
  margin-bottom: 26px;
}
.scale-progress i { display: block; height: 100%; background: var(--white); border-radius: 2px; transition: width 150ms ease; }
.scale-item { font-size: clamp(19px, 4.6vw, 24px); line-height: 1.45; max-width: 24ch; color: var(--white); }
.scale-options { display: grid; gap: 9px; width: min(430px, 100%); margin-top: 26px; }
.scale-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 16px;
  font-size: 15px;
  text-align: left;
  color: var(--white);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(245,245,241,.35);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 100ms ease, border-color 100ms ease;
}
.scale-opt:hover { background: rgba(255,255,255,.13); border-color: var(--white); }
.scale-opt small { font-family: var(--mono); font-size: 12px; color: rgba(245,245,241,.55); }

/* digit span keypad */
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; justify-content: center; margin-top: 22px; }
.keypad button {
  min-height: 54px;
  font-family: var(--mono);
  font-size: 19px;
  color: var(--white);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(245,245,241,.4);
  border-radius: 8px;
  cursor: pointer;
}
.keypad button:hover { background: rgba(255,255,255,.15); }
.digit-echo {
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: .3em;
  min-height: 34px;
  margin-top: 16px;
}

/* N-back */
.nback-stim { font-size: clamp(64px, 14vw, 96px); font-weight: 700; }
.nback-actions { display: flex; gap: 12px; margin-top: 30px; }

/* ---------- results ---------- */

.result-metrics { border-top: 1px solid var(--rule); }
.metric { border-left: 2px solid var(--rule); padding-left: 14px; }
.metric.primary { border-left-color: var(--ink); }
.metric dd { font-family: var(--mono); font-size: 22px; margin-top: 4px; }
.metric dd small, .metric small { display: block; font-size: 12px; color: var(--soft); margin-top: 3px; font-family: var(--sans); }

.result-note { color: var(--soft); font-size: 15px; max-width: 62ch; margin: 4px 0 26px; }

.result-data { margin: 8px 0 26px; }
.result-data summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--soft);
  padding: 8px 0;
}
.result-data summary:hover { color: var(--ink); }
.table-scroll { overflow-x: auto; }
#trial-table { min-width: 480px; width: 100%; }
#trial-table td, #trial-table th { font-size: 13px; padding: 6px 16px 6px 0; font-family: var(--mono); color: var(--soft); text-align: left; }
#trial-table thead th { color: var(--ink); border-bottom: 1px solid var(--ink); }

.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  .battery-hero, .battery-brief, .battery-results { padding-inline: 20px; }
  .run-head { padding-inline: 14px; }
  .run-stage { min-height: 420px; }
  .test-card { grid-template-columns: 1fr; padding-inline: 6px; }
  .test-name { grid-row: auto; }
  .test-meta { grid-column: 1; text-align: left; }
  .block-grid { grid-template-columns: repeat(3, min(84px, 24vw)); }
  .choice-btn { flex-basis: 100px; }
  .deck { max-width: 46%; }
}

@media (prefers-reduced-motion: reduce) {
  .run-stage * { transition: none !important; }
}
