/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Mint Eyewear brand palette ─────────────────────────────────────── */
  --mint:       #1638E1;   /* brand blue */
  --mint-light: #EAEEfd;
  --mint-dark:  #0f2ab0;
  --navy:       #1A1A1A;   /* brand dark grey */
  --navy-soft:  #2A2A2A;
  --ink:        #1A1A1A;
  --body:       #3D3D3D;
  --muted:      #8A8A8A;
  --border:     #E5E5E5;
  --bg:         #FFFFFF;
  --white:      #FFFFFF;
  --amber:      #f59e0b;
  --red:        #ef4444;
  --green:      #10b981;

  /* ── Brand typography ───────────────────────────────────────────────── */
  --serif:      'DM Serif Display', Georgia, serif;   /* display / brand moments */
  --sans:       'DM Sans', -apple-system, sans-serif; /* UI elements */
  --body-font:  'Inter', -apple-system, sans-serif;   /* body text */

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

html { height: 100%; }
body {
  background: var(--bg);
  font-family: var(--sans);
  color: var(--ink);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Screen System ───────────────────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform: translateY(8px);
  background: var(--bg);
}
.screen.active {
  opacity: 1; pointer-events: all; transform: translateY(0);
}

/* ── Shared Layout ───────────────────────────────────────────────────────── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0; flex-shrink: 0;
}
.logo-mark {
  display: flex; align-items: center; gap: 8px;
}
.logo-mark.has-image { gap: 0; }
.logo-icon {
  width: 34px; height: 34px; background: var(--mint);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 18px; height: 18px; }
.logo-text { font-family: var(--sans); font-size: 17px; font-weight: 600; color: var(--navy); }
.logo-text span { color: var(--mint); }
.logo-image {
  display: none;
  height: 34px;
  width: auto;
  max-width: min(46vw, 180px);
  object-fit: contain;
}
.nav .logo-mark .logo-image {
  height: 20px;
  max-width: min(40vw, 120px);
}
.logo-mark.has-image .logo-image { display: block; }
.logo-mark.has-image .logo-icon,
.logo-mark.has-image .logo-text { display: none; }
.logo-on-dark.has-image .logo-image {
  opacity: 1;
  filter: brightness(0) invert(1);
}
.onboard-hero-logo {
  width: 100%;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.onboard-hero-logo .logo-image {
  height: 40px;
  max-width: min(62vw, 220px);
}
.onboard-hero-logo .logo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.onboard-hero-logo .wordmark-main {
  display: block;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 0.95;
  font-weight: 400;
  letter-spacing: -0.03em;
  color: #fff;
}
.onboard-hero-logo .wordmark-sub {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(191,219,254,0.96);
}
.onboard-top-logo {
  justify-content: flex-start;
  min-width: 92px;
}
.onboard-top-logo .logo-image {
  height: 28px;
  max-width: 140px;
}
.onboard-top-logo .logo-text {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  color: #1e3a8a;
}
.terms-top-logo {
  justify-content: center;
}
.terms-top-logo .logo-image {
  height: 32px;
  max-width: 168px;
}
.terms-top-logo .logo-text {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  color: #1e3a8a;
}

.badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; border-radius: 20px; padding: 4px 12px;
}
.badge-outline { border: 1px solid var(--border); color: var(--muted); }
.badge-mint { background: var(--mint-light); color: var(--mint-dark); }
.badge-navy { background: var(--navy); color: #fff; }
.dev-build-badge{
  position: fixed; top: 10px; right: 10px; z-index: 9999;
  background: rgba(26,26,26,0.92); color: #fff; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px; padding: 7px 10px;
  font: 700 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(26,26,26,0.22);
  display: none;
}
.dev-build-badge small{
  display:block; margin-top:3px; opacity:.7; font-weight:600; letter-spacing:.06em; text-transform:none;
}
.mint-debug-panel{
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 10000;
  background: rgba(15,23,42,0.96);
  border: 1px solid rgba(148,163,184,0.28);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(2,6,23,0.36);
  display: none;
  max-height: 46vh;
  overflow: hidden;
}
.mint-debug-panel.show { display:block; }
.mint-debug-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px 8px;
  border-bottom:1px solid rgba(148,163,184,0.24);
}
.mint-debug-title{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-weight:700;
  color:#e2e8f0;
}
.mint-debug-actions{
  display:flex;
  align-items:center;
  gap:6px;
}
.mint-debug-actions button{
  border:1px solid rgba(148,163,184,0.28);
  background:rgba(30,41,59,0.8);
  color:#e2e8f0;
  border-radius:999px;
  padding:6px 10px;
  font:700 11px/1 var(--sans);
  cursor:pointer;
}
.mint-debug-list{
  overflow:auto;
  max-height: calc(46vh - 48px);
  padding:8px 10px 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.mint-debug-item{
  border:1px solid rgba(148,163,184,0.2);
  background:rgba(15,23,42,0.7);
  border-radius:10px;
  padding:8px 9px;
}
.mint-debug-item-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:4px;
}
.mint-debug-item-head strong{
  font:700 11px/1.35 var(--sans);
  color:#e2e8f0;
  word-break:break-word;
}
.mint-debug-item-head span{
  font:600 10px/1 var(--sans);
  color:#94a3b8;
  white-space:nowrap;
}
.mint-debug-item-meta{
  font:600 10px/1.45 var(--sans);
  color:#cbd5e1;
  word-break:break-word;
}
.mint-debug-empty{
  font:600 11px/1.5 var(--sans);
  color:#94a3b8;
}

.page-body {
  flex: 1; display: flex; flex-direction: column;
  padding: 28px 24px 40px; max-width: 480px; width: 100%; margin: 0 auto;
}

h1.display {
  font-family: var(--serif); font-size: clamp(30px, 7vw, 42px);
  font-weight: 400; line-height: 1.15; color: var(--navy);
  margin-bottom: 12px;
}
h1.display em { color: var(--mint); font-style: italic; }
.lead { font-family: var(--body-font); font-size: 15px; color: var(--body); line-height: 1.75; }
p, .disclaimer { font-family: var(--body-font); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
button,
.btn,
.btn-cam,
.desktop-gate-copy,
.pd-secondary-action,
.ishi-btn,
.home-clinic-link {
  border-radius: 999px !important;
}
.btn {
  width: 100%; border: none; border-radius: 999px;
  padding: 17px 24px; font-family: var(--sans); font-size: 15px;
  font-weight: 600; cursor: pointer; transition: all 0.2s; letter-spacing: 0.01em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-mint { background: var(--mint); color: #fff; }
.btn-mint:hover { background: var(--mint-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(22,56,225,0.3); }
.btn-mint:active { transform: translateY(0); }
.btn-pay-brand {
  background: var(--mint) !important;
  box-shadow: none !important;
  transform: none !important;
}
.btn-pay-brand:hover,
.btn-pay-brand:active {
  background: var(--mint) !important;
  box-shadow: none !important;
  transform: none !important;
}
.btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--body); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-soft); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn[aria-busy="true"],
.btn-cam[aria-busy="true"] {
  cursor: wait;
}

/* Consistent keyboard focus visibility across controls */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(22,56,225,0.42);
  outline-offset: 2px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card, .card + .btn, .btn + .card { margin-top: 12px; }

/* ── Step indicator ──────────────────────────────────────────────────────── */
.step-dots {
  display: flex; gap: 6px; align-items: center; margin-bottom: 24px;
}
.step-dot {
  height: 3px; border-radius: 3px; background: var(--border); transition: all 0.3s;
}
.step-dot.active { background: var(--mint); width: 24px; }
.step-dot.done   { background: var(--mint); opacity: 0.4; }
.step-dot.future { width: 8px; }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.prog-track {
  width: 100%; height: 4px; background: var(--border);
  border-radius: 4px; overflow: hidden;
}
.prog-fill {
  height: 100%; background: var(--mint); border-radius: 4px;
  transition: width 0.5s ease;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.field-wrap { position: relative; }
.field-wrap select, .field-wrap input {
  width: 100%; background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 40px 14px 16px;
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  appearance: none; transition: border-color 0.2s;
}
.field-wrap select:focus, .field-wrap input:focus {
  outline: none; border-color: var(--mint);
}
.field-arrow {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}

/* ── Hero illustration ───────────────────────────────────────────────────── */
.hero-icon {
  width: 72px; height: 72px; background: var(--mint-light);
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.hero-icon svg { width: 36px; height: 36px; color: var(--mint); }

/* ── Test suite list ─────────────────────────────────────────────────────── */
.suite-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.suite-item:last-child { border-bottom: none; }
.suite-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.suite-info { flex: 1; }
.suite-name { font-size: 14px; font-weight: 600; color: var(--navy); }
.suite-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.suite-status { font-size: 11px; font-weight: 600; color: var(--muted); }
.suite-status.done { color: var(--green); }

/* ── Camera UI ───────────────────────────────────────────────────────────── */
.cam-wrap {
  position: relative; width: 100%; border-radius: var(--radius);
  overflow: hidden; background: #000; aspect-ratio: 3/4;
  display: none;
}
.cam-wrap.show { display: block; }
.cam-wrap video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform: scaleX(-1);
}
.cam-wrap canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
/* Face/PD cams don't mirror the canvas - landmarks already in mirrored space */
#faceCam, #pdCam { transform: none; }
#camC1, #camC2, #camCIntro { transform: none; }

/* PD calibration locked — green glow */
.cam-wrap.pd-locked {
  box-shadow: 0 0 0 3px #10b981, 0 0 24px rgba(16,185,129,0.35);
  transition: box-shadow 0.4s ease;
}

/* PD Measure button pop-in animation */
@keyframes pdBtnPop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1);    opacity: 1; }
}
.pd-btn-pop {
  animation: pdBtnPop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

.cam-ui {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 16px;
}
.face-oval {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  width: 120px; height: 155px; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.35);
  transition: border-color 0.3s, border-style 0.3s;
}
.face-oval.good { border-color: var(--green); border-style: solid; }
.face-oval.warn { border-color: var(--amber); border-style: solid; }
.face-oval.bad  { border-color: var(--red);   border-style: solid; }
.face-shape-icon svg { width: 54px; height: 54px; display: block; }
.frame-icon svg { width: 28px; height: 16px; display: block; }

.dist-pill {
  background: rgba(26,26,26,0.75); backdrop-filter: blur(12px);
  border-radius: 100px; padding: 10px 24px; text-align: center;
  margin-bottom: 34px; min-width: 160px; transition: background 0.3s;
}
.dist-pill.good { background: rgba(22,56,225,0.9); }
.dist-pill.warn { background: rgba(180,100,0,0.9); }
.dist-pill.bad  { background: rgba(180,20,20,0.9); }
.dist-pill .dn  { font-size: 28px; font-weight: 700; color: #fff; line-height: 1; font-family: var(--sans); }
.dist-pill .dl  { font-size: 10px; color: rgba(255,255,255,0.65); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 2px; }

.lock-ring {
  position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%);
}
.lock-ring svg { transform: rotate(-90deg); }
.lr-bg   { fill:none; stroke:rgba(255,255,255,0.15); stroke-width:3; }
.lr-fill { fill:none; stroke:var(--green); stroke-width:3; stroke-linecap:round;
           stroke-dasharray:113; stroke-dashoffset:113; transition:stroke-dashoffset 0.1s linear; }

.cam-msg {
  position: absolute; bottom: 12px; width: 100%; text-align: center;
  font-size: 11px; color: rgba(255,255,255,0.7); letter-spacing: 0.04em;
}

.btn-cam {
  width: 100%; background: var(--white); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 16px; font-family: var(--sans); font-size: 14px;
  font-weight: 500; color: var(--navy); cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 8px; transition: all 0.2s;
  margin-top: 12px;
}
.btn-cam:hover { border-color: var(--mint); color: var(--mint); }

/* ── PD photo alignment ─────────────────────────────────────────────────── */
.pd-photo-stage {
  position: relative;
  width: 100%;
  border: 2px solid #fff;
  border-radius: 30px;
  overflow: hidden;
  background: #d1d5db;
  min-height: 320px;
  box-shadow: none;
}
.pd-photo-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.pd-card-box {
  position: absolute;
  border: 2px solid var(--mint);
  background: rgba(22,56,225,0.12);
  box-shadow: inset 0 0 0 1px rgba(22,56,225,0.26), 0 0 0 9999px rgba(0,0,0,0.58);
  touch-action: none;
  cursor: move;
  z-index: 4;
}
.pd-card-box::before,
.pd-card-box::after{
  content:'';
  position:absolute;
  background:rgba(22,56,225,0.28);
}
.pd-card-box::before{ left:0; right:0; top:50%; height:1px; transform:translateY(-0.5px); }
.pd-card-box::after{ top:0; bottom:0; left:50%; width:1px; transform:translateX(-0.5px); }
.pd-card-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--mint);
  box-shadow: none;
  touch-action: none;
}
.pd-card-handle::after{
  content:'';
  position:absolute;
  width:5px; height:5px;
  border-radius:50%;
  background:#fff;
  top:50%; left:50%;
  transform:translate(-50%,-50%);
}
.pd-card-handle.nw { left: -11px; top: -11px; cursor: nwse-resize; }
.pd-card-handle.ne { right: -11px; top: -11px; cursor: nesw-resize; }
.pd-card-handle.sw { left: -11px; bottom: -11px; cursor: nesw-resize; }
.pd-card-handle.se { right: -11px; bottom: -11px; cursor: nwse-resize; }

#s-pd { background: #f9fafb; }
#s-pd .page-body {
  max-width: 540px;
  padding-top: 22px;
  padding-bottom: 30px;
}
.pd-topbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.pd-pill-btn{
  border:1px solid #e5e7eb;
  background:#fff;
  color:#6b7280;
  border-radius:999px;
  padding:8px 14px;
  font:700 12px/1 var(--sans);
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:6px;
  box-shadow:none;
}
.pd-step-pill{
  background:var(--mint-light);
  color:var(--mint);
  border:1px solid rgba(22,56,225,0.12);
  border-radius:999px;
  padding:8px 12px;
  font:700 11px/1 var(--sans);
  letter-spacing:.1em;
  text-transform:uppercase;
}
.pd-main-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pd-workflow-card {
  background: #f3f4f6;
  border: 1px solid #d6dbe2;
  border-radius: 34px;
  padding: 22px 18px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pd-workflow-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pd-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--navy);
}
.pd-step-index {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22,56,225,0.12);
  color: var(--mint);
  font: 700 11px/1 var(--sans);
}
.pd-step-index-muted {
  background: #e5e7eb;
  color: #6b7280;
}
.pd-status-row { display:none; }
.pd-status-main {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}
.pd-status-sub {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.pd-capture-actions {
  display: block;
}
.pd-capture-actions .btn {
  width: 100%;
  padding: 15px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: none !important;
  transform: none !important;
}
.pd-capture-actions .btn.btn-mint:hover,
.pd-capture-actions .btn.btn-mint:active {
  background: var(--mint);
  box-shadow: none !important;
  transform: none !important;
}
.pd-warning-callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f2eeea;
  border: 1px solid #ebdccb;
  border-radius: 18px;
  padding: 14px 14px;
}
.pd-warning-icon {
  color: #d35916;
  font-size: 16px;
  line-height: 1;
  margin-top: 1px;
}
.pd-warning-text {
  font-size: 13px;
  color: #925843;
  line-height: 1.55;
}
.pd-workflow-divider {
  height: 1px;
  background: #e3e7ee;
}
.pd-align-step {
  opacity: 0.4;
  filter: grayscale(0.25);
  transition: opacity 0.25s ease, filter 0.25s ease;
}
#pdMainFlow.has-photo .pd-align-step {
  opacity: 1;
  filter: none;
}
.pd-align-copy {
  font-size: 13px;
  color: #a6abb2;
  line-height: 1.6;
}
.pd-stage-note {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17,24,39,0.56);
  backdrop-filter: blur(8px);
  color: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pd-live-readout {
  display: none;
  background: var(--navy);
  border-radius: 14px;
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
}
.pd-bottom-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pd-bottom-actions .btn {
  box-shadow: none !important;
  transform: none !important;
}
.pd-bottom-actions .btn.btn-mint:hover,
.pd-bottom-actions .btn.btn-mint:active,
.pd-bottom-actions .btn.btn-ghost:hover,
.pd-bottom-actions .btn.btn-ghost:active {
  box-shadow: none !important;
  transform: none !important;
}
.pd-primary-action:disabled {
  background: #a5b4fc;
  color: #fff;
  opacity: 1;
}
.pd-secondary-action {
  width: 100%;
  border: none;
  background: transparent;
  color: #6b7280;
  padding: 10px 12px;
  border-radius: 14px;
  font: 600 14px/1.3 var(--sans);
  cursor: pointer;
  transition: color 0.2s;
}
.pd-secondary-action:hover { color: var(--navy); }

/* ── Calibration confirmed list ──────────────────────────────────────────── */
.calib-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.calib-row:last-child { border-bottom: none; }
.calib-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.calib-label { font-size: 12px; color: var(--muted); }
.calib-val   { font-size: 14px; font-weight: 600; color: var(--navy); margin-top: 2px; }
.calib-check { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Eye prep screen ─────────────────────────────────────────────────────── */
.eye-prep-visual {
  background: var(--navy); border-radius: var(--radius);
  padding: 28px; display: flex; align-items: center; justify-content: center;
  margin: 20px 0;
}

/* ── Test screen (white bg for all tests) ─────────────────────────────────── */
#s5, #s7, #s6 { background: #fff; }
#s-test { background: #fff; }
.test-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.test-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
/* force white bg on test content */
.test-score-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.test-score-label span { color: var(--mint); font-weight: 700; }

.test-content {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; padding: 16px 20px 24px;
  min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.stimulus-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 0;
}

.response-area { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.response-hint { font-family: var(--body-font); font-size: 13px; color: var(--muted); text-align: center; }
.test-content p { font-family: var(--body-font); }
.stimulus-area p { font-family: var(--body-font); }
.response-area p { font-family: var(--body-font); }

/* Response ring */
.rring-wrap { position: relative; width: 240px; height: 240px; }
#respRing { width: 100%; height: 100%; }
.rseg { cursor: pointer; fill: var(--bg); stroke: var(--border); stroke-width: 1; transition: fill 0.12s, stroke 0.12s; }
.rseg:hover { fill: var(--mint-light); stroke: var(--mint); }
.rseg.sel   { fill: rgba(22,56,225,0.2); stroke: var(--mint); }

/* ── Flash feedback ──────────────────────────────────────────────────────── */
#flash {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: 0; transition: opacity 0.15s;
}
#flash.correct { background: rgba(16,185,129,0.18); opacity: 1; }
#flash.wrong   { background: rgba(239,68,68,0.18);  opacity: 1; }

/* ── Toast notifications ────────────────────────────────────────────────── */
.mint-toast-root {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 16000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 480px;
  margin: 0 auto;
}
.mint-toast {
  pointer-events: auto;
  border-radius: 14px;
  padding: 12px 14px;
  font-family: var(--body-font);
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid transparent;
  box-shadow: 0 8px 24px rgba(15,23,42,0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.mint-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.mint-toast.info {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}
.mint-toast.success {
  background: #ecfdf5;
  border-color: rgba(16,185,129,0.35);
  color: #065f46;
}
.mint-toast.warn {
  background: #fffbeb;
  border-color: rgba(245,158,11,0.35);
  color: #92400e;
}
.mint-toast.error {
  background: #fef2f2;
  border-color: rgba(239,68,68,0.35);
  color: #991b1b;
}

/* ── Confirm modal ──────────────────────────────────────────────────────── */
.mint-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 15000;
  background: rgba(15,23,42,0.44);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.mint-confirm-backdrop.show {
  display: flex;
}
.mint-confirm-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 24px 56px rgba(15,23,42,0.24);
  padding: 18px 16px 16px;
}
.mint-confirm-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}
.mint-confirm-message {
  font-family: var(--body-font);
  font-size: 13px;
  color: #374151;
  line-height: 1.65;
  margin-bottom: 14px;
}
.mint-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mint-confirm-actions .btn {
  min-height: 44px;
  font-size: 13px;
  padding: 12px 10px;
}
.mint-confirm-ok.is-danger {
  background: #dc2626;
  border: 1px solid #dc2626;
  color: #fff;
}
.mint-confirm-ok.is-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* ── Live distance monitor with mini video ───────────────────────────────── */
#distMon {
  position: fixed; top: 10px; right: 10px; z-index: 500;
  background: rgba(26,26,26,0.92); backdrop-filter: blur(8px);
  border-radius: 14px; padding: 0; display: none;
  align-items: center; gap: 0; overflow: hidden;
  border: 1.5px solid rgba(255,255,255,0.1);
  width: 120px;
}
#distMon.show { display: flex; flex-direction: column; }
#distMonVid {
  width: 100%; height: 80px; object-fit: cover; transform: scaleX(-1);
  display: block; border-radius: 12px 12px 0 0;
}
.dm-info { display: flex; align-items: center; gap: 6px; padding: 6px 10px; }
.dm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); transition: background 0.3s; flex-shrink:0; }
.dm-dot.warn { background: var(--amber); }
.dm-dot.bad  { background: var(--red);   }
.dm-val { font-size: 11px; color: rgba(255,255,255,0.85); font-weight: 600; }

/* ── Color test (Ishihara style) ─────────────────────────────────────────── */
.ishihara-wrap { position: relative; width: 100%; max-width: 280px; aspect-ratio: 1; }
#ishiCanvas { border-radius: 50%; display: block; width: 100%; height: 100%; }
.ishi-choices {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 320px;
}
.ishi-btn {
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; font-family: var(--sans); font-size: 22px; font-weight: 700;
  color: var(--navy); cursor: pointer; text-align: center; transition: all 0.15s;
}
.ishi-btn:hover { border-color: var(--mint); background: var(--mint-light); }

/* ── Amsler grid ─────────────────────────────────────────────────────────── */
#amslerCanvas { display: block; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.amsler-btns { display: flex; gap: 10px; width: 100%; max-width: 320px; }
.amsler-btns .btn { flex: 1; }
.amsler-action-row {
  width: 100%;
  max-width: 420px;
  display: flex;
  gap: 10px;
}
.amsler-action-btn {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  padding: 15px 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}
.amsler-action-btn.primary {
  background: var(--mint);
  border: none;
  color: #fff;
}
.amsler-action-btn.ghost {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  color: #1a1a1a;
}
#s7.mamsler-mode {
  background: #07090d;
}
#s7.mamsler-mode .test-nav {
  background: rgba(10,14,21,0.92);
  border-bottom-color: rgba(148,163,184,0.22);
}
#s7.mamsler-mode .test-tag,
#s7.mamsler-mode .test-score-label {
  color: rgba(226,232,240,0.82);
}
#s7.mamsler-mode .test-score-label span {
  color: #fff;
}
#s7.mamsler-mode .prog-track {
  background: rgba(148,163,184,0.28);
}
#s7.mamsler-mode .prog-fill {
  background: rgba(226,232,240,0.95);
}
.mamsler-wrap {
  width: 100%;
  max-width: 460px;
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.mamsler-head {
  width: 100%;
  text-align: center;
}
.mamsler-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 4px;
}
.mamsler-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}
.mamsler-copy {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(226,232,240,0.86);
}
.mamsler-center {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mamsler-bottom {
  width: 100%;
  margin-top: auto;
  padding: 4px 0 calc(6px + env(safe-area-inset-bottom));
}
.mamsler-footnote {
  margin-top: 8px;
  font-size: 11px;
  text-align: center;
  color: rgba(148,163,184,0.9);
}
#s7.mamsler-mode .amsler-action-btn.primary {
  background: #2563eb;
}
#s7.mamsler-mode .amsler-action-btn.ghost {
  background: transparent;
  border-color: rgba(148,163,184,0.35);
  color: #f8fafc;
}

/* ── Contrast test ───────────────────────────────────────────────────────── */
.contrast-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.contrast-choices { display: flex; gap: 12px; }
.contrast-opt {
  width: 96px; height: 96px; border-radius: var(--radius-sm);
  border: 1.5px solid rgba(0,0,0,0.18); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s;
  background: #fff;
}
#s7.contrast-mode .contrast-opt { border-color: rgba(0,0,0,0.22); }
.contrast-opt:active { border-color: rgba(255,255,255,0.5); }
.contrast-opt.sel    { border-color: rgba(255,255,255,0.5); }

/* ── Contrast mode: full-screen #808080 surround ─────────────────────────── */
#s7.contrast-mode { background: #808080; }
#s7.contrast-mode .test-nav {
  background: rgba(0,0,0,0.18);
  border-bottom-color: rgba(255,255,255,0.1);
}
#s7.contrast-mode .test-tag { color: rgba(255,255,255,0.75); }
#s7.contrast-mode .prog-track { background: rgba(255,255,255,0.2); }
#s7.contrast-mode .prog-fill  { background: rgba(255,255,255,0.55); }
#s7.contrast-mode .test-score-label { color: rgba(255,255,255,0.6); }
#s7.contrast-mode .test-score-label span { color: #fff; }

/* ── Astigmatism (clock dial) ────────────────────────────────────────────── */
#astigCanvas { display: block; }
#s7.astig-mode {
  background: linear-gradient(180deg,#f6f8fc 0%,#ffffff 100%);
}
#s7.astig-mode .test-nav {
  background: rgba(255,255,255,0.92);
  border-bottom-color: rgba(148,163,184,0.24);
}
.astig-wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.astig-wrap.astig-full {
  min-height: 100%;
}
.astig-top-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7c5a0f;
}
.astig-top-title {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}
.astig-head {
  width: 100%;
  text-align: center;
}
.astig-center {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.astig-bottom {
  width: 100%;
  margin-top: auto;
  padding: 10px 0 calc(8px + env(safe-area-inset-bottom));
}
.astig-question {
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: #374151;
  line-height: 1.45;
}
.astig-sub {
  margin: 5px 0 0;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}
.astig-canvas {
  display: block;
  margin: 0 auto;
  width: 280px;
  height: 280px;
  max-width: 100%;
}
.astig-choice-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.astig-btn {
  background: #fff;
  border: 1.5px solid #cfd7e6;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0;
}
.astig-btn:hover {
  border-color: var(--mint);
  color: var(--mint);
}
.astig-btn-wide {
  display: block;
  width: 100%;
  margin-top: 10px;
}

/* ── Results screen ──────────────────────────────────────────────────────── */
.res-header {
  background: var(--navy); padding: 32px 24px 36px; flex-shrink: 0;
}
.result-hero { margin-bottom: 16px; }
.rh-eyepair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.rh-eye {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 18px 16px;
}
.rh-eye-label { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 10px; }
.rh-score { font-family: var(--serif); font-size: 34px; font-weight: 400; color: #fff; line-height: 1; }
.rh-interp { font-family: var(--body-font); font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 6px; }
.rh-interp.good { color: #6ee7b7; }
.rh-interp.ok   { color: #fcd34d; }
.rh-interp.poor { color: #fca5a5; }
#s8 #resRi.rh-interp, #s8 #resLi.rh-interp { color: #6b7280; }
#s8 #resRi.rh-interp.good, #s8 #resLi.rh-interp.good { color: #059669; }
#s8 #resRi.rh-interp.ok, #s8 #resLi.rh-interp.ok { color: #d97706; }
#s8 #resRi.rh-interp.poor, #s8 #resLi.rh-interp.poor { color: #dc2626; }

.test-result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.test-result-row:last-child { border-bottom: none; }
.trr-label { font-size: 13px; color: var(--body); }
.trr-val   { font-size: 13px; font-weight: 600; }
.trr-val.pass  { color: var(--green); }
.trr-val.warn  { color: var(--amber); }
.trr-val.fail  { color: var(--red); }

.rec-card {
  background: var(--navy); border-radius: var(--radius); padding: 24px; margin: 16px 0;
}
.rec-head { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 10px; }
.rec-body { font-family: var(--body-font); font-size: 14px; color: rgba(255,255,255,0.82); line-height: 1.75; }
.disclaimer a { color: var(--mint); font-weight: 600; text-decoration: none; }
.disclaimer a:hover { text-decoration: underline; }

.res-header-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}
.results-page-body {
  max-width: 1080px;
  width: 100%;
}
.results-grid {
  display: grid;
  gap: 12px;
}
.results-stack {
  min-width: 0;
}
.results-cta-card {
  background: linear-gradient(180deg, #f5f7ff 0%, #ffffff 100%);
  border: 1px solid rgba(22,56,225,0.12);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 2px 16px rgba(22,56,225,0.05);
}
.results-cta-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 8px;
}
.results-cta-title {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.results-cta-copy {
  font-family: var(--body-font);
  font-size: 13px;
  color: var(--body);
  line-height: 1.65;
  margin-bottom: 14px;
}
.results-actions {
  display: grid;
  gap: 10px;
}
.results-compact-grid {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}
.results-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}
.results-compact-row:last-child { border-bottom: none; }
.results-compact-label {
  font-size: 11px;
  color: var(--muted);
}
.results-compact-val {
  font-size: 12px;
  color: var(--navy);
  font-weight: 600;
  text-align: right;
}
.assessment-list {
  margin-top: 10px;
  border-top: 1px solid #f3f4f6;
}
.assessment-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.85fr) minmax(0, 1.5fr);
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.assessment-row:last-child { border-bottom: none; }
.assessment-row .trr-label {
  font-size: 13px;
  line-height: 1.35;
}
.assessment-val {
  text-align: left;
  justify-self: start;
  line-height: 1.35;
}
.results-duo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.results-duo-actions .btn {
  padding: 15px 10px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}
.share-tool-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #dbe4ff;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #eff6ff 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.share-tool-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3730a3;
  margin: 0 0 4px;
}
.share-tool-copy {
  margin: 0;
  font-size: 12px;
  color: #374151;
  line-height: 1.45;
}
.share-tool-btn {
  white-space: nowrap;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
}
.ai-toggle-gradient {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: linear-gradient(135deg,#4f46e5,#7c3aed,#ec4899);
  box-shadow: 0 6px 18px rgba(79,70,229,0.28);
}
.ai-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.44);
  z-index: 14000;
  display: none;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  min-height: 100vh;
  min-height: 100dvh;
}
.ai-modal-shell {
  background: #fff;
  border-radius: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
  overscroll-behavior: contain;
}
.ai-modal-head {
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.ai-modal-foot {
  border-top: 1px solid #e5e7eb;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}
.results-footer-line {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}
.ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.ai-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
}
.ai-tag {
  font-size: 10px;
  color: var(--muted);
}
.ai-copy {
  font-family: var(--body-font);
  font-size: 13px;
  color: var(--body);
  line-height: 1.7;
}
.ai-copy + .ai-copy { margin-top: 8px; }
.ai-muted {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}
.ai-qa-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-qa-input {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-family: var(--body-font);
  font-size: 13px;
  color: var(--ink);
}
.ai-qa-input:focus {
  outline: none;
  border-color: var(--mint);
}
.ai-qa-answer {
  display: none;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 12px;
  padding: 12px;
}
.ai-qa-answer.show { display: block; }
.ai-qa-answer p {
  font-family: var(--body-font);
  font-size: 13px;
  color: var(--body);
  line-height: 1.65;
}
.ai-qa-answer p + p { margin-top: 8px; }

/* ── Home: Advanced Screening card ─────────────────────────────────────── */
.home-pro-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 32px;
  padding: 30px 24px 28px;
  position: relative;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.home-pro-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 20px;
}
.home-pro-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
  font-weight: 700;
  margin-bottom: 8px;
}
.home-pro-title {
  font-family: var(--serif);
  font-size: clamp(30px, 9.4vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #111827;
  font-weight: 400;
  margin: 0;
}
.home-pro-sub {
  margin-top: 9px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.6;
  max-width: 30ch;
  padding-right: 10px;
}
.home-pro-price-wrap {
  text-align: right;
  flex-shrink: 0;
  padding-top: 2px;
  min-width: 0;
}
.home-pro-price {
  font-size: clamp(28px, 8.5vw, 34px);
  font-weight: 800;
  line-height: 0.96;
  color: #111827;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.home-pro-price-note {
  margin-top: 2px;
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}
.home-pro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-bottom: 20px;
}
.home-pro-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.35;
}
.home-pro-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #3b82f6;
  flex-shrink: 0;
}
.home-pro-foot {
  margin-bottom: 18px;
}
.home-pro-includes {
  font-size: 10px;
  color: #9ca3af;
}
.home-pro-cta {
  background: #1a1a1a;
  color: #fff;
  border-radius: 999px;
  padding: 17px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}
.home-footer-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 6px 0 26px;
}
.home-footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 16px 0 8px;
  opacity: 0.85;
}
.home-footer-logo {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.home-footer-logo .logo-image {
  height: 24px;
  max-width: 124px;
}
.home-footer-logo .logo-text {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  color: #1e3a8a;
  font-weight: 400;
}
.home-clinic-card {
  background: #dfe5ef;
  border: 1px solid #d1d9e6;
  border-radius: 28px;
  padding: 22px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.home-clinic-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}
.home-clinic-icon {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  background: rgba(255,255,255,0.24);
  color: #23459b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-clinic-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f3f91;
  line-height: 1.25;
}
.home-clinic-copy {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(31,63,145,0.78);
  line-height: 1.55;
  max-width: 32ch;
}
.home-clinic-disclaimer {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.55;
  color: rgba(31,63,145,0.86);
  max-width: 42ch;
}
.home-clinic-link {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(59,86,146,0.35);
  color: #6f82b4;
  background: rgba(255,255,255,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  margin-top: 2px;
}
.session-reset-card {
  margin: 18px 0 8px;
  border: 1px solid #fecaca;
  background: #fff7f7;
  border-radius: 18px;
  padding: 14px;
  text-align: left;
}
.session-reset-title {
  font-size: 14px;
  font-weight: 700;
  color: #7f1d1d;
  line-height: 1.4;
  margin-bottom: 6px;
}
.session-reset-copy {
  font-size: 12px;
  color: #7f1d1d;
  line-height: 1.6;
  margin-bottom: 12px;
}
.session-reset-btn {
  width: 100%;
  border-radius: 999px;
  font-size: 13px;
  padding: 12px 16px;
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.session-reset-btn svg {
  width: 14px;
  height: 14px;
}
.session-reset-btn:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
.desktop-gate {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.desktop-gate-card {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  box-shadow: 0 24px 56px rgba(2, 6, 23, 0.24);
  padding: 24px 22px;
}
.desktop-gate-logo {
  justify-content: center;
  margin-bottom: 12px;
}
.desktop-gate-logo .logo-icon { display: none; }
.desktop-gate-logo .logo-image {
  height: 34px;
  max-width: 180px;
}
.desktop-gate-logo .logo-text {
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1;
  font-weight: 400;
  color: var(--navy);
}
.desktop-gate-card h2 {
  font-size: 28px;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 8px;
}
.desktop-gate-card p {
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
}
.desktop-gate-steps {
  margin: 12px 0 16px;
  padding-left: 19px;
  display: grid;
  gap: 7px;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
}
.desktop-gate-link-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.desktop-gate-link {
  flex: 1;
  min-width: 0;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 11px 12px;
  font-family: var(--body-font);
  font-size: 12px;
  color: #111827;
  background: #f9fafb;
}
.desktop-gate-copy {
  border: none;
  border-radius: 12px;
  background: #1a1a1a;
  color: #fff;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.desktop-gate-msg {
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
}
@media (max-width: 520px) {
  .desktop-gate {
    padding: 14px;
  }
  .desktop-gate-card {
    padding: 18px 16px;
    border-radius: 20px;
  }
  .desktop-gate-card h2 {
    font-size: 24px;
  }
  .desktop-gate-link-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .desktop-gate-copy {
    width: 100%;
  }
  .home-pro-card { padding: 26px 18px 24px; }
  .home-pro-head {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .home-pro-title { font-size: clamp(30px, 10.2vw, 38px); }
  .home-pro-sub {
    max-width: none;
    padding-right: 0;
  }
  .home-pro-price-wrap {
    text-align: left;
    padding-top: 0;
    display: block;
  }
  .home-pro-price { font-size: clamp(28px, 10vw, 34px); }
  .home-pro-price-note { margin: 2px 0 0; }
  .home-pro-grid { grid-template-columns: 1fr; gap: 8px; }
  .home-footer-stack {
    gap: 18px;
    margin: 4px 0 22px;
  }
  .home-clinic-card {
    border-radius: 24px;
    padding: 20px 16px;
  }
  .home-clinic-icon {
    width: 56px;
    height: 56px;
  }
  .home-clinic-title { font-size: 15px; }
  .home-clinic-copy { font-size: 12px; }
  .results-duo-actions .btn {
    font-size: 13px;
    padding: 14px 8px;
  }
  .share-tool-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .share-tool-btn {
    width: 100%;
  }
}

@media (min-width: 700px) {
  .ai-modal-backdrop {
    padding: 16px;
    align-items: center;
    justify-content: center;
  }
  .ai-modal-shell {
    width: 100%;
    max-width: 560px;
    height: min(96vh, 920px);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(15,23,42,0.3);
  }
  .ai-modal-head {
    padding: 14px 14px;
  }
  .ai-modal-body {
    padding: 12px;
  }
  .ai-modal-foot {
    padding: 10px 12px 12px;
  }
}

@media (min-width: 900px) {
  #s8 { background: #f4f5f8; }
  #s8 .res-header { padding: 36px 32px 40px; }
  #s8 .page-body { padding: 28px 32px 42px; }
  #s8 .res-header {
    background: transparent;
    padding-bottom: 18px;
  }
  #s8 .res-header-inner {
    background: linear-gradient(180deg, #fbfcff 0%, #f3f6ff 100%);
    border: 1px solid rgba(22,56,225,0.10);
    border-radius: 20px;
    padding: 28px 28px 22px;
    box-shadow: 0 10px 28px rgba(22,56,225,0.06);
  }
  #s8 .res-header .logo-text { color: var(--navy) !important; }
  #s8 .res-header .logo-text span { color: var(--mint) !important; }
  #s8 .res-header-tag { color: var(--muted) !important; }
  #s8 .res-overline { color: var(--muted) !important; }
  #s8 .res-headline { color: var(--navy) !important; }
  #s8 .res-meta-row { color: var(--muted); }
  #s8 .res-meta-row span { color: inherit !important; }
  #s8 .res-meta-row #resTimer { color: var(--body) !important; }
  #s8 .res-header-caption { color: var(--muted) !important; }
  .rh-eyepair { gap: 14px; }
  .rh-eye {
    padding: 22px 20px;
    background: #fff;
    border-color: rgba(22,56,225,0.10);
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
  }
  .rh-eye-label { color: var(--muted); }
  .rh-score { font-size: 40px; }
  #s8 .rh-score { color: var(--navy); }
  #s8 .rh-interp { color: var(--muted); }
  #s8 .rh-interp.good { color: #059669; }
  #s8 .rh-interp.ok { color: #d97706; }
  #s8 .rh-interp.poor { color: #dc2626; }
  .results-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: 16px;
    align-items: start;
  }
  .results-stack .card:first-child,
  .results-stack .rec-card:first-child {
    margin-top: 0;
  }
  .results-stack .disclaimer {
    margin-top: 4px;
  }
  .results-actions {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

.disclaimer {
  font-size: 11px; color: var(--muted); text-align: center; line-height: 1.8;
  padding: 0 4px; border-top: 1px solid var(--border); padding-top: 16px;
}

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim { animation: fadeUp 0.45s ease both; }
.anim-d1 { animation-delay: 0.06s; }
.anim-d2 { animation-delay: 0.12s; }
.anim-d3 { animation-delay: 0.18s; }
.anim-d4 { animation-delay: 0.24s; }
.anim-d5 { animation-delay: 0.30s; }
.anim-d6 { animation-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
