:root {
  color-scheme: dark;
  --bg: #050607;
  --panel: #101214;
  --panel-2: #171a1d;
  --panel-3: #0b0d0f;
  --line: #2a2f34;
  --line-hot: rgba(240, 35, 53, .46);
  --text: #f2f4f5;
  --muted: #8e989f;
  --red: #c41222;
  --red-hot: #f02335;
  --silver: #c8d0d6;
  --green: #35b46b;
  --amber: #e0a93a;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, .014) 1px, transparent 1px),
    radial-gradient(circle at 50% -24%, rgba(196, 18, 34, .24), transparent 42%),
    linear-gradient(180deg, #0d0f11 0%, var(--bg) 46%, #030303 100%);
  background-size: 34px 34px, 34px 34px, auto, auto;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 980px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.screen {
  display: none;
  min-height: calc(100dvh - 36px);
}

.screen-active {
  display: block;
}

#screen-setup {
  padding-bottom: 96px;
}

.splash-screen {
  min-height: calc(100dvh - 36px);
  place-items: center;
  position: relative;
  text-align: center;
}

.splash-screen.screen-active {
  display: grid;
}

.splash-content {
  width: 100%;
  display: grid;
  gap: 24px;
  justify-items: center;
}

.product-mark {
  display: grid;
  justify-items: center;
  gap: 14px;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, .65));
}

.product-mark span {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(240, 35, 53, .62);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(240, 35, 53, .34), transparent 42%),
    #0b0d0f;
  color: #fff;
  font-size: 3rem;
  font-weight: 900;
}

.product-mark strong {
  font-size: clamp(2.6rem, 12vw, 5.6rem);
  line-height: .9;
  letter-spacing: 0;
}

.endure-logo {
  position: absolute;
  bottom: 10px;
  width: min(44vw, 210px);
  height: auto;
  opacity: .82;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  margin-bottom: 14px;
}

.screen-header h1 {
  margin: 6px 0 0;
  font-size: clamp(1.75rem, 7vw, 3.2rem);
  line-height: .95;
  text-transform: uppercase;
}

.live-header h1 {
  font-size: clamp(3rem, 16vw, 7rem);
}

.with-back {
  justify-content: flex-start;
}

.eyebrow,
.field-label {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.field-label {
  display: block;
  margin: 12px 0 8px;
  letter-spacing: .08em;
}

.primary-action,
.secondary-action,
.ghost-action,
.back-button,
.stop-action,
.inline-action {
  min-height: 52px;
  border-radius: 7px;
  padding: 0 20px;
  background: linear-gradient(180deg, var(--red-hot), #9f0c18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 14px 34px rgba(196, 18, 34, .3);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
}

.secondary-action,
.ghost-action,
.back-button,
.inline-action {
  background: #191c20;
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--silver);
}

.ghost-action,
.back-button {
  min-width: 82px;
  min-height: 46px;
  padding: 0 14px;
  font-size: .78rem;
}

.stop-action {
  min-width: 98px;
  min-height: 68px;
  background: #e7edf1;
  color: #08090a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2) inset, 0 16px 36px rgba(0, 0, 0, .3);
}

.inline-action {
  min-height: 36px;
  padding: 0 12px;
  font-size: .72rem;
}

.full {
  width: 100%;
}

.setup-grid,
.capture-layout,
.review-grid {
  display: grid;
  gap: 14px;
}

.panel {
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 40%),
    rgba(11, 13, 15, .94);
  box-shadow: 0 0 0 1px var(--line) inset, 0 18px 42px rgba(0, 0, 0, .34);
  padding: 14px;
}

.no-top {
  margin-bottom: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--silver);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-title strong {
  color: var(--red-hot);
  font-size: .88rem;
  text-align: right;
}

.panel-title button {
  margin-left: auto;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #08090a;
  color: var(--text);
}

input {
  min-height: 52px;
}

textarea {
  resize: vertical;
  min-height: 94px;
}

.option-grid,
.category-stack,
.participant-list,
.archive-list,
.protocol-review,
.timeline-list {
  display: grid;
  gap: 10px;
}

.option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.protocol-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-grid button,
.category-pill,
.participant-card,
.archive-card,
.protocol-review-row,
.timeline-event,
.metric {
  min-height: 58px;
  border-radius: 7px;
  background: #111418;
  box-shadow: 0 0 0 1px var(--line) inset;
}

.option-grid button {
  padding: 12px 10px;
  color: var(--silver);
  font-weight: 900;
  text-transform: uppercase;
}

.option-grid button.is-active {
  background: linear-gradient(90deg, rgba(196, 18, 34, .34), #111418 62%);
  box-shadow: 0 0 0 1px var(--line-hot) inset, 0 0 24px rgba(196, 18, 34, .16);
  color: #fff;
}

.participant-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.participant-card,
.archive-card {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-left: 4px solid transparent;
  text-align: left;
}

.participant-card.is-active {
  border-left-color: var(--red-hot);
  background: linear-gradient(90deg, rgba(196, 18, 34, .22), #111418 58%);
}

.participant-card strong,
.archive-card strong,
.timeline-event strong {
  font-size: .95rem;
  text-transform: uppercase;
}

.participant-card span,
.archive-card span,
.timeline-event span,
.metric span,
.summary-row span {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
  text-transform: uppercase;
  font-weight: 800;
}

.category-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.category-pill strong {
  color: var(--silver);
  font-size: .9rem;
  text-transform: uppercase;
}

.dock-actions {
  position: sticky;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 4;
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.dock-actions.static {
  position: static;
  grid-template-columns: 1fr;
}

.live-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 10px;
}

.metric strong {
  font-size: clamp(1rem, 4vw, 1.6rem);
  overflow-wrap: anywhere;
}

.live-participants,
.protocol-rail,
.event-grid,
.first-reaction-grid,
.checklist-grid,
.side-toggle {
  display: grid;
  gap: 8px;
}

.is-hidden {
  display: none !important;
}

.live-participants {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.live-participants button {
  min-height: 76px;
  border-radius: 8px;
  padding: 10px;
  background: #171a1d;
  box-shadow: 0 0 0 1px var(--line) inset;
  text-align: left;
}

.live-participants button strong {
  display: block;
  font-size: 1rem;
  text-transform: uppercase;
}

.live-participants button span {
  color: var(--muted);
  font-size: .8rem;
}

.live-participants button.is-active {
  background: linear-gradient(180deg, #a50e19, #5f070d);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 0 24px rgba(196, 18, 34, .2);
}

.protocol-rail {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.protocol-rail button,
.side-toggle button {
  min-height: 50px;
  border-radius: 7px;
  background: #202429;
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--silver);
  font-weight: 900;
  text-transform: uppercase;
}

.protocol-rail button.is-active,
.side-toggle button.is-active {
  background: var(--red);
  color: #fff;
}

.event-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.first-reaction-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.first-reaction-grid button {
  min-height: 112px;
  border-radius: 8px;
  font-size: 3rem;
  font-weight: 900;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset;
}

.reaction-good {
  background: rgba(53, 180, 107, .22);
  color: #f5fff8;
}

.reaction-bad {
  background: rgba(240, 35, 53, .24);
  color: #fff;
}

.first-reaction-done {
  grid-column: 1 / -1;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #111418;
  box-shadow: 0 0 0 1px var(--line) inset;
}

.first-reaction-done strong {
  font-size: 1.35rem;
  text-transform: uppercase;
}

.first-reaction-done span {
  color: var(--muted);
  font-weight: 900;
}

.checklist-grid {
  gap: 10px;
}

.checklist-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #111418;
  box-shadow: 0 0 0 1px var(--line) inset;
}

.checklist-row > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.checklist-row strong {
  text-transform: uppercase;
}

.checklist-row span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rating-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rating-actions button {
  min-height: 54px;
  border-radius: 7px;
  background: #202429;
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--silver);
  font-weight: 900;
}

.rating-ok.is-active {
  background: rgba(53, 180, 107, .24);
  box-shadow: 0 0 0 1px rgba(53, 180, 107, .82) inset;
  color: #fff;
}

.rating-warn.is-active {
  background: rgba(224, 169, 58, .24);
  box-shadow: 0 0 0 1px rgba(224, 169, 58, .82) inset;
  color: #fff;
}

.rating-fail.is-active {
  background: rgba(240, 35, 53, .25);
  box-shadow: 0 0 0 1px rgba(240, 35, 53, .95) inset;
  color: #fff;
}

.event-grid button {
  min-height: 86px;
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .04), transparent 28%),
    linear-gradient(180deg, #171a1d, #0d0f11);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset;
  text-align: left;
}

.event-grid button:active,
.live-participants button:active,
.protocol-rail button:active {
  transform: translateY(1px);
  filter: brightness(1.12);
}

.event-grid strong {
  display: block;
  font-size: .94rem;
  text-transform: uppercase;
}

.event-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .75rem;
  text-transform: uppercase;
  font-weight: 800;
}

.body-wrap {
  width: min(100%, 380px);
  margin: 0 auto;
  position: relative;
}

#bodyMap,
#setupBodyMap {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #050607;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 18px 48px rgba(0, 0, 0, .38);
  touch-action: manipulation;
}

.marker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.body-marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.body-dot {
  position: absolute;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(240, 35, 53, .78);
  border-radius: 50%;
  background: rgba(196, 18, 34, .22);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(240, 35, 53, .12), 0 0 22px rgba(240, 35, 53, .55);
}

.body-dot.is-setup {
  border-color: rgba(200, 208, 214, .74);
  background: rgba(200, 208, 214, .16);
  box-shadow: 0 0 0 4px rgba(200, 208, 214, .1), 0 0 18px rgba(200, 208, 214, .34);
}

.body-dot::before,
.body-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 255, 255, .86);
  transform: translate(-50%, -50%);
}

.body-dot::before {
  width: 23px;
  height: 1px;
}

.body-dot::after {
  width: 1px;
  height: 23px;
}

.timeline-panel {
  margin-top: 14px;
}

.timeline-event {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  padding: 12px;
  border-left: 4px solid var(--silver);
}

.timeline-event.is-positive {
  border-left-color: var(--green);
}

.timeline-event.is-warn {
  border-left-color: var(--amber);
}

.timeline-event.is-critical {
  border-left-color: var(--red-hot);
}

.timeline-event time {
  color: var(--red-hot);
  font-weight: 900;
}

.timeline-event p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
}

.timeline-list.compact {
  max-height: 270px;
  overflow: auto;
}

.summary-card {
  display: grid;
  gap: 10px;
}

.summary-row,
.protocol-review-row {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
}

.summary-row strong,
.protocol-review-row strong {
  text-align: right;
}

.protocol-review-row meter {
  width: 88px;
  accent-color: var(--red-hot);
}

@media (max-width: 410px) {
  .live-status {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .app-shell {
    padding-inline: 24px;
  }

  .setup-grid,
  .review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wide {
    grid-column: 1 / -1;
  }

  .participant-form {
    grid-template-columns: 1fr 1fr auto;
  }

  .participant-form .primary-action {
    width: 96px;
  }

  .capture-layout {
    grid-template-columns: 1.35fr .95fr;
    align-items: start;
  }

  .live-participants,
  .event-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dock-actions.static {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   TVV "X-Control & Transport" module styles
   ============================================================ */
.tvv-only { display: none; }
body.mode-tvv .hide-in-tvv { display: none !important; }
body.mode-tvv .tvv-only { display: block; }
body.mode-tvv .review-grid.tvv-only { display: grid; }

#tvvBodyMap {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.muted { color: var(--muted); margin: 6px 0; }

/* header form */
.tvv-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (min-width: 720px) {
  .tvv-form-grid { grid-template-columns: 1fr 1fr; }
}
.tvv-form-grid .field-label { display: grid; gap: 6px; }
.tvv-only input[type="text"],
.tvv-only input[type="date"],
.tvv-only textarea,
.tvv-only select {
  width: 100%;
  min-height: 48px;
  border-radius: 7px;
  border: 0;
  background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--text);
  padding: 10px 12px;
}
.tvv-only textarea { min-height: 70px; resize: vertical; }

/* chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 48px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--silver);
}
.chip.is-active {
  background: linear-gradient(180deg, var(--red-hot), #9f0c18);
  color: #fff;
  box-shadow: 0 0 0 1px var(--line-hot) inset;
}
.chip.type-arterial.is-active { background: #e0242b; }
.chip.type-venous.is-active { background: #2563eb; }
.chip.type-other.is-active { background: #d97706; }

/* teams */
.tvv-team-list { display: grid; gap: 8px; margin-bottom: 10px; }
.tvv-team-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.icon-action {
  min-width: 48px;
  min-height: 48px;
  border-radius: 7px;
  background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--muted);
  font-size: 18px;
}

/* participants */
.tvv-participant-form { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .tvv-participant-form { grid-template-columns: 1fr 1fr 1fr auto; }
}
.tvv-participant-list { display: grid; gap: 8px; }
.tvv-participant-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 0.6fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 7px;
  background: #111418;
  box-shadow: 0 0 0 1px var(--line) inset;
}
.tvv-participant-row strong { display: block; }
.tvv-participant-row span { color: var(--muted); font-size: 13px; }

/* default pickers */
.tvv-default-pickers { display: grid; gap: 10px; margin: 10px 0; }
@media (min-width: 560px) { .tvv-default-pickers { grid-template-columns: 1fr 1fr; } }
.picker-block { display: grid; gap: 6px; }

/* findings markers + list */
.finding-dot {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 0 14px rgba(0,0,0,.5);
}
.finding-badge {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
}
.finding-badge.sm { width: 24px; height: 24px; font-size: 12px; }
.tvv-findings-list { display: grid; gap: 10px; margin-top: 12px; }
.tvv-finding {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: 8px;
  background: #111418;
  box-shadow: 0 0 0 1px var(--line) inset;
}
.tvv-finding.is-active { box-shadow: 0 0 0 1px var(--line-hot) inset; }
.finding-fields { display: grid; gap: 8px; }
.finding-selects { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.finding-selects select { min-width: 120px; }
.finding-view { color: var(--muted); font-size: 13px; }

/* live clock / stamps */
.tvv-live { margin-bottom: 14px; }
/* big run clock, sits above the command buttons */
.tvv-clock { text-align: center; margin: 2px 0 12px; }
.tvv-clock strong { font-size: 46px; line-height: 1; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; color: var(--text); }
/* hide the generic header timer in TVV — the clock lives in the panel now */
body.mode-tvv #screen-live .live-header h1 { display: none; }
.tvv-clock-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tvv-clock-actions button { min-height: 54px; border-radius: 8px; }
/* Start/Stop toggle: green when ready to start/resume, red while running */
.tvv-toggle { background: linear-gradient(180deg, var(--green), #1f7a47); color: #04210f; }
.tvv-toggle.is-stop { background: linear-gradient(180deg, var(--red-hot), #9f0c18); color: #fff; }
.tvv-warning {
  display: none;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 7px;
  background: rgba(224, 169, 58, .14);
  box-shadow: 0 0 0 1px rgba(224, 169, 58, .4) inset;
  color: var(--amber);
}
.tvv-warning.is-visible { display: block; }
.tvv-metric-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.tvv-metric-card {
  padding: 12px;
  border-radius: 8px;
  background: var(--panel-3);
  box-shadow: 0 0 0 1px var(--line) inset;
  display: grid;
  gap: 4px;
}
.tvv-metric-card span { color: var(--muted); font-size: 13px; }
.tvv-metric-card strong { font-size: 26px; color: var(--red-hot); }
.tvv-stamp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 560px) { .tvv-stamp-grid { grid-template-columns: repeat(3, 1fr); } }
.tvv-stamp {
  min-height: 72px;
  border-radius: 8px;
  background: #171a1d;
  box-shadow: 0 0 0 1px var(--line) inset;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 10px;
  text-align: center;
}
.tvv-stamp.is-done { box-shadow: 0 0 0 1px var(--line-hot) inset; }
.tvv-stamp strong { font-size: 15px; }
.tvv-stamp span { color: var(--silver); font-variant-numeric: tabular-nums; }
.tvv-stamp-list, .tvv-summary-list { display: grid; gap: 6px; }
.tvv-stamp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #111418;
  box-shadow: 0 0 0 1px var(--line) inset;
}
.tvv-stamp-row time { color: var(--red-hot); font-variant-numeric: tabular-nums; min-width: 52px; }
.tvv-metric-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  background: var(--panel-3);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.tvv-metric-row strong { color: var(--red-hot); font-variant-numeric: tabular-nums; }

/* assessment matrix */
.tvv-assessment-wrap { overflow-x: auto; }
.tvv-matrix { width: 100%; border-collapse: separate; border-spacing: 6px; }
.tvv-matrix th { text-align: left; color: var(--silver); font-size: 13px; padding: 4px; }
.tvv-matrix th.crit { font-weight: 600; max-width: 200px; }
.tvv-matrix td { vertical-align: top; }
.tvv-matrix .rate {
  min-width: 48px;
  min-height: 44px;
  margin: 2px;
  border-radius: 6px;
  background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.tvv-matrix .rate.is-active.rate-ok { background: var(--green); color: #04210f; }
.tvv-matrix .rate.is-active.rate-warn { background: var(--amber); color: #2a1c00; }
.tvv-matrix .rate.is-active.rate-fail { background: var(--red); color: #fff; }
.tvv-legend { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* export buttons */
.tvv-export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tvv-export-grid button, .tvv-export-grid .file-label { min-height: 52px; border-radius: 8px; }
.file-label {
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px var(--line) inset;
  background: var(--panel-2);
  color: var(--silver);
  border-radius: 8px;
}

/* ============================================================
   TVV Stop-the-Bleed — template editor, run capture, export
   (reuses earlier .chip/.finding-dot/.tvv-stamp/.tvv-metric-card/.rate-* tokens)
   ============================================================ */
.tvv-template-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 10px 0; }
@media (min-width: 720px) { .tvv-template-actions { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.tvv-template-actions select, .tvv-template-actions button, .tvv-template-actions .file-label { min-height: 48px; border-radius: 8px; }
.tvv-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tvv-inline-actions button { min-height: 48px; padding: 0 16px; border-radius: 8px; }
.tvv-notice { display: none; margin: 8px 0; padding: 10px 12px; border-radius: 7px; background: rgba(224,169,58,.14); box-shadow: 0 0 0 1px rgba(224,169,58,.4) inset; color: var(--amber); }
.tvv-notice.is-visible { display: block; }
.tvv-resume { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel-3); box-shadow: 0 0 0 1px var(--line-hot) inset; }

/* participants / teams */
.tvv-participant-form { grid-template-columns: 1fr; }
@media (min-width: 720px) { .tvv-participant-form { grid-template-columns: 1fr 1fr auto; } }
.tvv-participant-list { display: grid; gap: 8px; }
.tvv-participant-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.tvv-team-list { display: grid; gap: 8px; }
.tvv-team-row2 { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; align-items: center; }

/* run plan */
.tvv-runplan { display: grid; gap: 8px; }
.tvv-run-row { display: grid; grid-template-columns: auto 1fr 1fr 1.4fr auto; gap: 8px; align-items: center; }
.run-badge { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; border-radius: 7px; background: var(--panel-2); box-shadow: 0 0 0 1px var(--line) inset; font-weight: 700; color: var(--silver); }
.tvv-start { text-align: center; }

/* run navigation */
.tvv-run-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.tvv-run-chip { min-width: 92px; min-height: 64px; border-radius: 8px; background: #171a1d; box-shadow: 0 0 0 1px var(--line) inset; display: grid; gap: 2px; align-content: center; padding: 8px; text-align: center; }
.tvv-run-chip.is-active { box-shadow: 0 0 0 1px var(--line-hot) inset; }
.tvv-run-chip strong { font-size: 15px; }
.tvv-run-chip span { color: var(--muted); font-size: 12px; }

/* briefing */
.tvv-briefing-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tvv-weapon { color: var(--amber); font-weight: 700; font-size: 13px; }
.tvv-briefing-body { display: grid; gap: 12px; }
@media (min-width: 640px) { .tvv-briefing-body { grid-template-columns: 220px 1fr; } }
.tvv-briefing-img { width: 100%; border-radius: 8px; cursor: zoom-in; box-shadow: 0 0 0 1px var(--line) inset; }
.tvv-briefing-fields { display: grid; gap: 6px; }
.tvv-briefing-fields > div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 6px 8px; border-radius: 6px; background: var(--panel-3); box-shadow: 0 0 0 1px var(--line) inset; }
.tvv-briefing-fields span { color: var(--muted); font-size: 13px; }
.tvv-run-meta { margin-top: 10px; color: var(--silver); font-size: 14px; }

/* assessment list (per run) */
.tvv-assess-list { display: grid; gap: 8px; }
.tvv-assess-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #111418; box-shadow: 0 0 0 1px var(--line) inset; }
.rating-actions { display: flex; gap: 6px; }
.rate { min-width: 56px; min-height: 48px; border-radius: 7px; background: var(--panel-2); box-shadow: 0 0 0 1px var(--line) inset; color: var(--muted); font-weight: 700; font-size: 13px; }
.rate.is-active.rate-ok { background: var(--green); color: #04210f; }
.rate.is-active.rate-warn { background: var(--amber); color: #2a1c00; }
.rate.is-active.rate-fail { background: var(--red); color: #fff; }

/* feedback */
.tvv-feedback { display: grid; gap: 8px; margin-bottom: 10px; }
.tvv-feedback-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #111418; box-shadow: 0 0 0 1px var(--line) inset; }
.yn { display: flex; gap: 6px; }
.yn button { min-width: 56px; min-height: 44px; border-radius: 7px; background: var(--panel-2); box-shadow: 0 0 0 1px var(--line) inset; color: var(--silver); font-weight: 700; }
.yn .yn-yes.is-active { background: var(--green); color: #04210f; }
.yn .yn-no.is-active { background: var(--red); color: #fff; }
.tvv-mantra { color: var(--amber); font-weight: 700; margin-top: 10px; }

/* per-participant export list */
.tvv-batch-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tvv-batch-bar button { min-height: 44px; padding: 0 16px; border-radius: 7px; }
.tvv-export-list { display: grid; gap: 8px; }
.tvv-export-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; background: #111418; box-shadow: 0 0 0 1px var(--line) inset; }
.tvv-export-row span { display: block; color: var(--muted); font-size: 13px; }
.tvv-lang-btns { display: flex; gap: 6px; }
.tvv-lang-btns button { min-width: 52px; min-height: 44px; border-radius: 7px; }

/* image modal (tap-to-zoom) */
.tvv-image-modal { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.86); align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.tvv-image-modal.is-open { display: flex; }
.tvv-image-modal img { max-width: 100%; max-height: 100%; border-radius: 8px; }

.finding-note { min-height: 44px; resize: vertical; }

/* ============================================================
   Login gate (per-device email + password, local only)
   ============================================================ */
.auth-screen { min-height: calc(100dvh - 36px); place-items: center; position: relative; text-align: left; }
.auth-screen.screen-active { display: grid; }
.auth-card {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 40%), rgba(11,13,15,.96);
  box-shadow: 0 0 0 1px var(--line) inset, var(--shadow);
  justify-items: stretch;
}
.auth-card .product-mark { justify-items: center; margin-bottom: 4px; }
.auth-sub { color: var(--muted); text-align: center; margin: 0; font-size: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-tabs button {
  min-height: 48px; border-radius: 8px; background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line) inset; color: var(--silver); font-weight: 700;
}
.auth-tabs button.is-active { background: linear-gradient(180deg, var(--red-hot), #9f0c18); color: #fff; }
.auth-form { display: grid; gap: 8px; }
.auth-form .field-label { margin: 6px 0 0; }
.auth-form input[type="email"], .auth-form input[type="password"] {
  width: 100%; min-height: 50px; border-radius: 8px; border: 0;
  background: var(--panel-2); box-shadow: 0 0 0 1px var(--line) inset; color: var(--text); padding: 10px 12px;
}
.auth-form input:focus { outline: none; box-shadow: 0 0 0 1px var(--line-hot) inset; }
.auth-form .primary-action { margin-top: 8px; }
.auth-msg { display: none; padding: 9px 12px; border-radius: 7px; font-size: 14px; }
.auth-msg.is-visible { display: block; }
.auth-msg.is-error { background: rgba(196,18,34,.16); box-shadow: 0 0 0 1px rgba(240,35,53,.45) inset; color: #ff8a93; }
.auth-msg:not(.is-error).is-visible { background: rgba(53,180,107,.14); box-shadow: 0 0 0 1px rgba(53,180,107,.4) inset; color: var(--green); }
.auth-strength { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin: 2px 0; }
.auth-strength span.ok { color: var(--green); }
.auth-strength.is-strong { color: var(--green); }
.auth-consent { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 13px; color: var(--silver); line-height: 1.4; }
.auth-consent input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--red-hot); }
.auth-privacy { font-size: 12px; color: var(--muted); line-height: 1.5; padding: 10px 12px; border-radius: 7px; background: var(--panel-3); box-shadow: 0 0 0 1px var(--line) inset; }
.linklike { background: none; border: 0; padding: 0; color: var(--red-hot); text-decoration: underline; cursor: pointer; font: inherit; }
.auth-remove { justify-self: center; margin-top: 6px; color: var(--muted); font-size: 13px; }
.auth-whoami { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.auth-screen .endure-logo { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); }
