:root {
  color-scheme: light;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --canvas: #f5f7f1;
  --surface: #ffffff;
  --ink: #18302a;
  --muted: #63766f;
  --line: #dfe8df;
  --green: #c8f04b;
  --green-soft: #f0f8d5;
  --blue-soft: #eaf5ff;
  --blue: #4a9bd6;
  --shadow: 0 24px 70px rgba(48, 76, 62, .12);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

button { font: inherit; }
button:focus-visible { outline: 3px solid rgba(74, 155, 214, .45); outline-offset: 3px; }

main {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}

header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { display: grid; place-items: center; width: 52px; height: 52px; filter: drop-shadow(0 8px 12px rgba(24,48,42,.16)); }
.brand-mark { display: block; width: 52px; height: 52px; object-fit: contain; }

.eyebrow, .kicker { color: var(--blue); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { margin: 0 0 4px; }
h1 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.55rem); letter-spacing: -.035em; }
h2 { margin: 8px 0 20px; font-size: clamp(2.35rem, 5.2vw, 4.5rem); line-height: 1.02; letter-spacing: -.055em; text-wrap: balance; }

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid #d8e9cf;
  border-radius: 999px;
  background: #f4f9e9;
  color: #456153;
  font-size: .78rem;
}
.status span { width: 8px; height: 8px; border-radius: 50%; background: #e6aa43; }
.status.live span { background: #6cab48; }
.status.error { border-color: #f0d3cf; background: #fff4f2; }
.status.error span { background: #dd6d61; }

.stage {
  min-height: 0;
  margin: 4px 0 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel { width: 100%; padding: clamp(36px, 7vw, 78px); }
#pairing { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); align-items: center; gap: clamp(38px, 8vw, 96px); }
.copy { max-width: 610px; }
.copy .kicker { margin: 0; }
.lead { margin: 0; max-width: 35rem; color: var(--muted); font-size: clamp(1.02rem, 1.7vw, 1.2rem); line-height: 1.6; }
.lead strong { color: var(--ink); }
.reassurance { display: grid; gap: 3px; margin-top: 30px; padding: 17px 18px; border-radius: 16px; background: var(--green-soft); font-size: .92rem; }
.reassurance span { color: var(--muted); }
.qr-card { padding: clamp(22px, 3vw, 32px); border-radius: 26px; background: var(--blue-soft); text-align: center; }
.qr-label { margin: 0 0 15px; color: #386782; font-weight: 750; }
.qr-shell { padding: 14px; background: white; border-radius: 20px; box-shadow: 0 14px 35px rgba(42, 86, 109, .14); }
.qr-shell img { display: block; width: 100%; aspect-ratio: 1; }
.expiry { margin: 15px 0 0; color: var(--muted); font-size: .86rem; }
.expiry strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.centered { text-align: center; }
.centered h2 { max-width: 760px; margin-inline: auto; }
.centered p:not(.kicker) { color: var(--muted); font-size: 1.05rem; }
.spinner { width: 46px; height: 46px; margin: 0 auto 28px; border: 4px solid #e4ecdf; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.video-wrap { position: relative; width: 100%; height: 100%; min-height: 50vh; background: #050505; }
video { width: 100%; height: 100%; min-height: 50vh; display: block; object-fit: contain; }
.video-chrome { position: absolute; inset: auto 18px 18px auto; display: flex; gap: 10px; pointer-events: none; }
.video-chrome button { min-height: 44px; padding: 10px 15px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(12,18,16,.7); color: white; cursor: pointer; pointer-events: auto; backdrop-filter: blur(14px); opacity: .72; transition: opacity .16s ease, background .16s ease; }
.video-chrome button:hover, .video-chrome button:focus-visible { opacity: 1; background: rgba(12,18,16,.9); }

.primary { min-height: 50px; margin-top: 20px; padding: 13px 20px; border: 0; border-radius: 14px; background: var(--ink); color: white; font-weight: 750; cursor: pointer; box-shadow: 0 10px 22px rgba(24,48,42,.18); }
.primary:hover { background: #26463d; }
[hidden] { display: none !important; }
noscript { display: block; padding: 20px; background: #fff0ed; color: #723c35; text-align: center; }

a { color: #2f718f; text-underline-offset: .16em; }
a:hover { color: #204e64; }
a:focus-visible { outline: 3px solid rgba(74, 155, 214, .45); outline-offset: 4px; border-radius: 4px; }

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 10px 12px 10px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 34px rgba(48, 76, 62, .08);
  color: var(--muted);
  font-size: .84rem;
  backdrop-filter: blur(12px);
}
.footer-brand { color: var(--ink); font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.site-footer nav { display: flex; gap: 8px; }
.site-footer a {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid #d9eaf5;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #386782;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.site-footer a:hover {
  border-color: #cfe4f1;
  background: var(--blue-soft);
  color: #204e64;
  transform: translateY(-1px);
}
.site-footer a[aria-current="page"] {
  border-color: #d8e9cf;
  background: var(--green-soft);
  color: var(--ink);
}

.document-body { background: var(--canvas); }
.document-shell { grid-template-rows: auto auto auto; align-content: start; }
.brand-link { color: var(--ink); text-decoration: none; }
.document-brand { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -.035em; }
.back-link {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 750;
  text-decoration: none;
}
.back-link:hover { background: var(--green-soft); color: var(--ink); }
.document-card {
  width: min(820px, 100%);
  margin: 10px auto 32px;
  padding: clamp(30px, 6vw, 68px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.document-card > .kicker { margin: 0 0 8px; }
.document-card > h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}
.document-lead { margin: 22px 0 0; color: var(--muted); font-size: clamp(1.08rem, 2vw, 1.25rem); line-height: 1.6; }
.effective-date { margin: 18px 0 0; color: var(--muted); font-size: .88rem; font-weight: 700; }
.document-card section { padding-top: 34px; }
.document-card section + section { margin-top: 34px; border-top: 1px solid var(--line); }
.document-card section h2 { margin: 0 0 12px; font-size: 1.35rem; line-height: 1.25; letter-spacing: -.025em; }
.document-card section p,
.document-card li { color: #435b53; line-height: 1.72; }
.document-card section p { margin: 0; }
.document-card ul,
.document-card ol { margin: 12px 0 0; padding-left: 1.35rem; }
.document-card li + li { margin-top: 8px; }
.support-note { display: grid; gap: 5px; margin-top: 20px; padding: 18px; border-radius: 16px; background: var(--green-soft); }
.support-note span { color: var(--muted); line-height: 1.55; }

body[data-view="live"] { overflow: hidden; background: #050505; }
body[data-view="live"] main { width: 100%; height: 100dvh; min-height: 0; padding: 0; display: block; }
body[data-view="live"] header { display: none; }
body[data-view="live"] .site-footer { display: none; }
body[data-view="live"] .stage { width: 100%; height: 100dvh; min-height: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: #050505; }
body[data-view="live"] .video-wrap,
body[data-view="live"] video { height: 100dvh; min-height: 0; }

body.popout-body { width: 100%; height: 100%; min-height: 100%; overflow: hidden; background: #050505; }
body.popout-body video { width: 100vw; height: 100vh; min-height: 0; object-fit: contain; }

@media (max-width: 720px) {
  main { width: min(100% - 24px, 1120px); padding-top: max(14px, env(safe-area-inset-top)); }
  header { align-items: center; padding-bottom: 14px; }
  .status { padding: 8px; }
  .status b { display: none; }
  .brand-icon, .brand-mark { width: 46px; height: 46px; }
  .eyebrow { display: none; }
  .stage { border-radius: 24px; }
  .panel { padding: 28px 22px; }
  #pairing { grid-template-columns: 1fr; text-align: center; gap: 26px; }
  #pairing .copy { display: contents; }
  #pairing .kicker { order: 1; margin-bottom: -20px; }
  #pairing h2 { order: 2; margin-bottom: 0; font-size: clamp(2.2rem, 11vw, 3.2rem); }
  #pairing .lead { order: 3; margin-inline: auto; }
  .qr-card { order: 4; width: min(100%, 360px); margin: auto; padding: 20px; }
  .reassurance { order: 5; width: min(100%, 420px); margin: 0 auto; }
  .video-chrome { inset: auto 12px max(12px, env(safe-area-inset-bottom)) auto; }
  .site-footer { margin-top: 12px; }
  .document-shell { width: min(100% - 24px, 1120px); }
  .document-shell header { align-items: center; }
  .document-card { margin-top: 4px; border-radius: 24px; }
  .document-card section { padding-top: 28px; }
  .document-card section + section { margin-top: 28px; }
}

@media (max-width: 440px) {
  .site-footer { flex-direction: column; padding: 12px; text-align: center; }
  .site-footer nav { width: 100%; }
  .site-footer a { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.6s; }
  * { scroll-behavior: auto !important; }
}
