:root {
  --tmrp-linen: var(--paper, #f9f2ea);
  --tmrp-card: var(--card, #fff9f4);
  --tmrp-deep: var(--paper-deep, #efe3da);
  --tmrp-ink: var(--ink, #181314);
  --tmrp-muted: var(--muted, #3b3639);
  --tmrp-rule: var(--faint, #d8c9c4);
  --tmrp-red: var(--accent-hot, #f41326);
  --tmrp-red-text: var(--accent-readable, #891f24);
}

@media (prefers-color-scheme: dark) {
  :root {
    --tmrp-linen: var(--paper, #080808);
    --tmrp-card: var(--card, #181314);
    --tmrp-deep: var(--paper-deep, #130a07);
    --tmrp-ink: var(--ink, #f9f2ea);
    --tmrp-muted: var(--muted, #c9b8b3);
    --tmrp-rule: var(--faint, #3b3639);
    --tmrp-red: var(--accent-hot, #f41326);
    --tmrp-red-text: var(--accent-readable, #f04a57);
  }
}

:root[data-theme='light'] {
  --tmrp-linen: var(--paper, #f9f2ea);
  --tmrp-card: var(--card, #fff9f4);
  --tmrp-deep: var(--paper-deep, #efe3da);
  --tmrp-ink: var(--ink, #181314);
  --tmrp-muted: var(--muted, #3b3639);
  --tmrp-rule: var(--faint, #d8c9c4);
  --tmrp-red: var(--accent-hot, #f41326);
  --tmrp-red-text: var(--accent-readable, #891f24);
}

:root[data-theme='dark'] {
  --tmrp-linen: var(--paper, #080808);
  --tmrp-card: var(--card, #181314);
  --tmrp-deep: var(--paper-deep, #130a07);
  --tmrp-ink: var(--ink, #f9f2ea);
  --tmrp-muted: var(--muted, #c9b8b3);
  --tmrp-rule: var(--faint, #3b3639);
  --tmrp-red: var(--accent-hot, #f41326);
  --tmrp-red-text: var(--accent-readable, #f04a57);
}

.tmrp-page,
.tmrp-archive {
  color: var(--tmrp-ink);
  margin: 0 auto;
  max-width: 1440px;
  padding: clamp(54px, 7vw, 106px) clamp(20px, 4.5vw, 64px) clamp(80px, 10vw, 140px);
}

.tmrp-page-hero,
.tmrp-archive-hero {
  border-bottom: 1px solid var(--tmrp-rule);
  display: grid;
  gap: clamp(22px, 4vw, 70px);
  grid-template-columns: minmax(0, 1fr) minmax(270px, .55fr);
  margin-bottom: clamp(34px, 5vw, 72px);
  padding-bottom: clamp(28px, 4vw, 52px);
}

.tmrp-eyebrow {
  color: var(--tmrp-red-text);
  display: block;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .1em;
  line-height: 1.4;
}

.tmrp-page-hero h1,
.tmrp-archive-hero h1 {
  font-size: clamp(48px, 7vw, 92px);
  font-weight: 790;
  letter-spacing: -.055em;
  line-height: .96;
  margin: 14px 0 0;
}

.tmrp-page-hero p,
.tmrp-archive-hero p {
  align-self: end;
  color: var(--tmrp-muted);
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.55;
  margin: 0;
  max-width: 580px;
}

.tmrp-pulse {
  background: var(--tmrp-card);
  border: 1px solid var(--tmrp-rule);
  color: var(--tmrp-ink);
  margin: 0 auto;
  max-width: 1040px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  position: relative;
}

.tmrp-pulse::before {
  background-image: linear-gradient(color-mix(in srgb, var(--tmrp-red) 5%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--tmrp-red) 5%, transparent) 1px, transparent 1px);
  background-size: 34px 34px;
  content: '';
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.tmrp-pulse > * { position: relative; }
.tmrp-pulse-line { background: color-mix(in srgb, var(--tmrp-red) 18%, transparent); height: 4px; inset: 0 0 auto; position: absolute; }
.tmrp-pulse-line span { background: var(--tmrp-red); display: block; height: 100%; width: clamp(76px, 15%, 160px); }

.tmrp-pulse-header {
  align-items: start;
  border-bottom: 1px solid var(--tmrp-rule);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-bottom: clamp(24px, 3vw, 34px);
}

.tmrp-pulse-header h2 {
  font-size: clamp(31px, 4.1vw, 58px);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: 1.03;
  margin: 13px 0 0;
  max-width: 820px;
  text-wrap: balance;
}

.tmrp-state {
  border: 1px solid var(--tmrp-rule);
  color: var(--tmrp-red-text);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .08em;
  padding: 8px 11px;
  text-transform: uppercase;
}

.tmrp-intro { color: var(--tmrp-muted); font-size: clamp(16px, 1.4vw, 20px); line-height: 1.65; margin: clamp(22px, 3vw, 34px) 0 0; max-width: 760px; }
.tmrp-live { color: var(--tmrp-red-text); font-size: 13px; font-weight: 650; min-height: 1.5em; padding-top: 18px; }
.tmrp-form fieldset { border: 0; margin: 0; padding: 0; }
.tmrp-choices { border-top: 1px solid var(--tmrp-rule); margin-top: 6px; }

.tmrp-choice {
  align-items: center;
  border-bottom: 1px solid var(--tmrp-rule);
  cursor: pointer;
  display: grid;
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 590;
  gap: 16px;
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 66px;
  padding: 11px 10px;
  transition: background-color 130ms ease, color 130ms ease;
}

.tmrp-choice:hover { background: var(--tmrp-deep); }
.tmrp-choice input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.tmrp-radio { border: 1px solid var(--tmrp-muted); border-radius: 50%; display: block; height: 18px; position: relative; width: 18px; }
.tmrp-choice input:checked + .tmrp-radio { border-color: var(--tmrp-red); }
.tmrp-choice input:checked + .tmrp-radio::after { background: var(--tmrp-red); border-radius: 50%; content: ''; inset: 4px; position: absolute; }
.tmrp-choice:has(input:checked) { background: color-mix(in srgb, var(--tmrp-red) 8%, var(--tmrp-card)); color: var(--tmrp-ink); }
.tmrp-choice:has(input:focus-visible) { outline: 3px solid var(--tmrp-red); outline-offset: -3px; }

.tmrp-other { border-bottom: 1px solid var(--tmrp-rule); display: grid; grid-template-columns: minmax(180px, .45fr) minmax(220px, 1fr); }
.tmrp-other .tmrp-choice { border-bottom: 0; }
.tmrp-other-field { align-self: center; display: grid; margin: 0 16px; min-width: 0; }
.tmrp-other-input { background: transparent; border: 0; border-bottom: 1px solid var(--tmrp-muted); color: var(--tmrp-ink); font: inherit; font-size: 15px; min-width: 0; padding: 12px 2px; }
.tmrp-other-field small { color: var(--tmrp-muted); font-size: 9px; margin-top: 5px; }
.tmrp-other-input:disabled { cursor: not-allowed; opacity: .4; }
.tmrp-other-input:focus { border-color: var(--tmrp-red); outline: 0; }

.tmrp-submit-row { align-items: center; display: grid; gap: 28px; grid-template-columns: auto minmax(0, 1fr); margin-top: 30px; }
.tmrp-submit-row button { background: var(--tmrp-ink); border: 1px solid var(--tmrp-ink); color: var(--tmrp-linen); cursor: pointer; font: inherit; font-size: 12px; font-weight: 740; letter-spacing: .04em; min-height: 48px; padding: 0 18px; text-transform: uppercase; }
.tmrp-submit-row button:hover { background: var(--tmrp-red); border-color: var(--tmrp-red); color: #fff; }
.tmrp-submit-row button:focus-visible,
.tmrp-other-input:focus-visible { outline: 3px solid var(--tmrp-red); outline-offset: 3px; }
.tmrp-submit-row button:disabled { cursor: wait; opacity: .6; }
.tmrp-submit-row p { color: var(--tmrp-muted); font-size: 11px; line-height: 1.55; margin: 0; max-width: 560px; }

.tmrp-complete { border-left: 4px solid var(--tmrp-red); margin-top: 24px; padding: 10px 0 10px 20px; }
.tmrp-complete strong { display: block; font-size: 18px; }
.tmrp-complete p { color: var(--tmrp-muted); font-size: 13px; line-height: 1.6; margin: 6px 0 0; }
.tmrp-participation { border-top: 1px solid var(--tmrp-rule); margin-top: 34px; padding-top: 22px; }
.tmrp-participation > div:first-child { align-items: baseline; display: flex; gap: 18px; justify-content: space-between; }
.tmrp-participation span { color: var(--tmrp-muted); font-size: 10px; font-weight: 720; letter-spacing: .08em; text-transform: uppercase; }
.tmrp-participation strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.tmrp-meter { background: color-mix(in srgb, var(--tmrp-red) 15%, transparent); height: 5px; margin-top: 15px; overflow: hidden; }
.tmrp-meter span { background: var(--tmrp-red); display: block; height: 100%; transition: width 300ms ease; width: var(--tmrp-progress); }
.tmrp-participation small { color: var(--tmrp-muted); display: block; font-size: 10px; margin-top: 8px; text-align: right; }
.tmrp-trap { height: 1px; left: -10000px; overflow: hidden; position: absolute; top: auto; width: 1px; }
.tmrp-pulse [hidden] { display: none !important; }
.tmrp-pulse .screen-reader-text { clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute !important; width: 1px; word-wrap: normal !important; }

.tmrp-history { border-top: 1px solid var(--tmrp-rule); margin: clamp(50px, 7vw, 92px) auto 0; max-width: 1040px; }
.tmrp-history > header { align-items: baseline; display: flex; justify-content: space-between; padding: 22px 0; }
.tmrp-history h2 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -.035em; margin: 0; }
.tmrp-history > header span { color: var(--tmrp-muted); font-size: 11px; }
.tmrp-history-list { list-style: none; margin: 0; padding: 0; }
.tmrp-history-list li { align-items: center; border-top: 1px solid var(--tmrp-rule); display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) auto; padding: 22px 0; }
.tmrp-history-list a { font-size: clamp(16px, 1.6vw, 21px); font-weight: 650; }
.tmrp-history-list a:hover { color: var(--tmrp-red-text); text-decoration: underline; text-underline-offset: 4px; }
.tmrp-history-list span { color: var(--tmrp-muted); font-size: 11px; }
.tmrp-empty { border-left: 4px solid var(--tmrp-red); font-size: 18px; margin: 0 auto; max-width: 1040px; padding: 20px 24px; }

@media (max-width: 720px) {
  .tmrp-page-hero,
  .tmrp-archive-hero { grid-template-columns: 1fr; }
  .tmrp-pulse { padding: 30px 20px; }
  .tmrp-pulse-header { grid-template-columns: 1fr; }
  .tmrp-state { justify-self: start; }
  .tmrp-other { grid-template-columns: 1fr; padding-bottom: 16px; }
  .tmrp-other-field { margin: 0 10px; }
  .tmrp-submit-row { align-items: start; grid-template-columns: 1fr; }
  .tmrp-submit-row button { width: 100%; }
  .tmrp-participation > div:first-child { align-items: start; flex-direction: column; gap: 6px; }
  .tmrp-history-list li { align-items: start; grid-template-columns: 1fr; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .tmrp-choice,
  .tmrp-meter span { transition: none; }
}

@media (forced-colors: active) {
  .tmrp-pulse-line span,
  .tmrp-meter span,
  .tmrp-choice input:checked + .tmrp-radio::after { background: Highlight; }
  .tmrp-choice:has(input:focus-visible) { outline-color: Highlight; }
}
