/* Standalone VA — futuristic violet / cyan setup UI */
#setup-screen {
  --home-ink: #14213d;
  --home-muted: #71809b;
  --home-violet: #7c3aed;
  --home-blue: #2867f6;
  --home-cyan: #14c8c4;
  --home-border: rgba(211, 222, 240, .82);
  --home-bg: #f7f8ff;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 4% 3%, rgba(124,58,237,.11), transparent 28%),
    radial-gradient(ellipse at 98% 18%, rgba(20,200,196,.12), transparent 27%),
    radial-gradient(ellipse at 18% 85%, rgba(77,120,255,.08), transparent 30%),
    linear-gradient(155deg, #fbfaff 0%, #f2f6ff 52%, #f4fcff 100%);
  color: var(--home-ink);
  width: 100%;
  max-width: 620px;
  min-height: 100dvh;
  gap: 0;
  padding: max(22px, env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom)) !important;
}
#setup-screen .setup-header {
  align-items: center;
  margin: 0 0 24px !important;
  padding: 0 0 2px !important;
  text-align: center;
}
#setup-screen .logo-container { margin-bottom: 13px !important; }
#setup-screen .logo {
  display: block;
  width: auto;
  height: 42px !important;
  max-width: 175px !important;
  object-fit: contain;
}
#setup-screen .setup-header h2 {
  color: var(--home-ink);
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1.12;
  text-wrap: balance;
}
#setup-screen .setup-header h2::after {
  content: "";
  display: block;
  width: 54px;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--home-violet), #3d75ff, var(--home-cyan));
}
#setup-screen .calibration-status-container {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px !important;
  margin-bottom: 28px !important;
}
#setup-screen #open-calibration-btn,
#setup-screen #open-checklist-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 112px;
  height: auto;
  padding: 15px 13px !important;
  border: 1px solid rgba(255,255,255,.9) !important;
  border-radius: 22px;
  background: rgba(255,255,255,.78) !important;
  box-shadow: 0 10px 26px rgba(55,76,130,.07), inset 0 1px 0 rgba(255,255,255,.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--home-ink) !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
#setup-screen #open-calibration-btn > span:first-child {
  flex: 0 1 auto;
  line-height: 1.35;
}
#setup-screen #calibration-status-text {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  white-space: normal;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 750;
  padding: 6px 8px;
  border-radius: 999px;
}
#setup-screen #open-checklist-btn { text-align: left; }
#setup-screen #open-calibration-btn::before,
#setup-screen #open-checklist-btn::before {
  content: "";
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: 0 0 42px;
  background: linear-gradient(135deg, rgba(124,58,237,.14), rgba(66,116,255,.08));
  box-shadow: inset 0 0 0 1px rgba(124,58,237,.06);
}
#setup-screen #open-checklist-btn::before {
  background: linear-gradient(135deg, rgba(20,200,196,.18), rgba(58,132,255,.1));
  box-shadow: inset 0 0 0 1px rgba(20,200,196,.08);
}
#setup-screen #open-calibration-btn:active,
#setup-screen #open-checklist-btn:active {
  transform: translateY(1px) scale(.99);
  box-shadow: 0 5px 15px rgba(55,76,130,.07);
}
#setup-screen .selection-section {
  margin-bottom: 24px !important;
  text-align: left;
}
#setup-screen .selection-section h3 {
  margin: 0 0 11px !important;
  color: #75839d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-align: center;
}
#setup-screen #distance-picker {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  box-shadow: inset 0 0 0 1px rgba(213,224,241,.65), 0 8px 22px rgba(55,76,130,.045);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#setup-screen #distance-picker .segment {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 9px 3px;
  border-radius: 999px;
  color: #465673;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  box-shadow: none;
}
#setup-screen #distance-picker .segment.active {
  background: linear-gradient(115deg, var(--home-violet) 0%, #4567ff 54%, var(--home-cyan) 150%) !important;
  color: #fff !important;
  box-shadow: 0 5px 15px rgba(91,85,235,.28), inset 0 1px 0 rgba(255,255,255,.22);
}
#setup-screen #optotype-picker {
  gap: 9px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#setup-screen #optotype-picker .card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: auto;
  min-width: 0;
  min-height: 108px;
  padding: 14px 4px 12px;
  gap: 9px;
  border: 1px solid rgba(218,226,241,.9) !important;
  border-radius: 21px;
  background: rgba(255,255,255,.82) !important;
  box-shadow: 0 8px 20px rgba(55,76,130,.055), inset 0 1px 0 rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
#setup-screen #optotype-picker .card:active { transform: scale(.98); }
#setup-screen #optotype-picker .card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0 !important;
  color: #172541;
  font-size: 27px !important;
  line-height: 1;
  letter-spacing: -.035em;
}
#setup-screen #optotype-picker .card-label {
  margin: 0 !important;
  color: #72809a;
  font-size: 12px !important;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
}
#setup-screen #optotype-picker .card.active {
  border: 1.5px solid #7d5aff !important;
  background: linear-gradient(145deg, rgba(244,238,255,.98), rgba(232,246,255,.98)) !important;
  box-shadow: 0 0 0 2px rgba(124,58,237,.08), 0 9px 22px rgba(111,83,245,.14);
}
#setup-screen #optotype-picker .card.active .card-icon,
#setup-screen #optotype-picker .card.active .card-label { color: #6435e8 !important; }
#setup-screen #start-test-btn {
  position: sticky;
  bottom: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  visibility: visible !important;
  z-index: 6;
  flex: 0 0 auto;
  width: 100%;
  min-height: 70px;
  margin: 4px 0 max(5px, env(safe-area-inset-bottom)) !important;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 999px;
  background: linear-gradient(105deg, #873bfa 0%, #4d5bfa 42%, #237cf6 72%, #12cfc4 135%);
  box-shadow: 0 13px 28px rgba(83,91,239,.25), inset 0 1px 0 rgba(255,255,255,.35);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .11em;
  text-shadow: 0 1px 2px rgba(24,39,100,.12);
  transition: transform .16s ease, box-shadow .16s ease;
}
#setup-screen #start-test-btn::before {
  content: "▶";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: 13px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24);
  font-size: 13px;
  letter-spacing: 0;
}
#setup-screen #start-test-btn:active {
  transform: translateY(1px) scale(.995);
  box-shadow: 0 6px 15px rgba(83,91,239,.2), inset 0 1px 0 rgba(255,255,255,.3);
}
@media (min-width: 520px) {
  #setup-screen { padding-left: 28px !important; padding-right: 28px !important; }
  #setup-screen .calibration-status-container { margin-bottom: 30px !important; }
  #setup-screen .selection-section { margin-bottom: 28px !important; }
  #setup-screen #optotype-picker .card { min-height: 124px; }
}
@media (max-width: 360px) {
  #setup-screen { padding-left: 13px !important; padding-right: 13px !important; }
  #setup-screen .calibration-status-container { gap: 8px !important; }
  #setup-screen #open-calibration-btn, #setup-screen #open-checklist-btn { padding: 12px 10px !important; font-size: 12px; }
  #setup-screen #calibration-status-text { font-size: 9px; }
  #setup-screen #distance-picker .segment { font-size: 12px; }
  #setup-screen #optotype-picker { gap: 7px; }
  #setup-screen #optotype-picker .card { border-radius: 17px; }
}
@media (max-height: 760px) {
  #setup-screen .setup-header { margin-bottom: 16px !important; }
  #setup-screen .logo-container { margin-bottom: 9px !important; }
  #setup-screen .logo { height: 34px !important; }
  #setup-screen .calibration-status-container { margin-bottom: 16px !important; }
  #setup-screen .selection-section { margin-bottom: 16px !important; }
  #setup-screen #optotype-picker .card { min-height: 92px; }
  #setup-screen #start-test-btn { min-height: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  #setup-screen * { transition: none !important; }
}


/* Clinical Precision refresh — navy, white and teal */
#setup-screen {
  --home-ink: #172b45;
  --home-muted: #667b91;
  --home-teal: #087f8c;
  --home-teal-dark: #086875;
  --home-border: #dce7ed;
  --home-bg: #f5f9fb;
  background: radial-gradient(ellipse at 100% 0%, rgba(8,127,140,.07), transparent 30%), linear-gradient(180deg, #fbfdfe 0%, #f5f9fb 100%);
  color: var(--home-ink);
  padding: max(20px, env(safe-area-inset-top)) 18px calc(22px + env(safe-area-inset-bottom)) !important;
}
#setup-screen .setup-header { margin-bottom: 20px !important; }
#setup-screen .logo-container { margin-bottom: 10px !important; }
#setup-screen .logo { height: 40px !important; }
#setup-screen .setup-header h2 { color: var(--home-ink); font-size: clamp(23px, 5.8vw, 29px); letter-spacing: -.045em; }
#setup-screen .setup-header h2::after { width: 42px; height: 3px; margin-top: 11px; background: var(--home-teal); }
#setup-screen .calibration-status-container { gap: 10px !important; margin-bottom: 25px !important; }
#setup-screen #open-calibration-btn,
#setup-screen #open-checklist-btn {
  min-height: 82px; padding: 13px 14px !important; gap: 7px;
  border: 1px solid var(--home-border) !important; border-radius: 16px;
  background: #fff !important; box-shadow: 0 3px 10px rgba(30,62,83,.035);
  color: var(--home-ink) !important; font-size: 13px;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
#setup-screen #open-calibration-btn::before,
#setup-screen #open-checklist-btn::before { display: none; }
#setup-screen #calibration-status-text { font-size: 10px; padding: 5px 8px; }
#setup-screen #open-calibration-btn:active,
#setup-screen #open-checklist-btn:active { transform: translateY(1px); border-color: #8bcbd0 !important; }
#setup-screen .selection-section { margin-bottom: 21px !important; }
#setup-screen .selection-section h3 { color: var(--home-muted); font-size: 11px; letter-spacing: .15em; margin-bottom: 10px !important; }
#setup-screen #distance-picker {
  gap: 4px; padding: 4px; border: 1px solid var(--home-border); border-radius: 14px;
  background: #edf3f6; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
#setup-screen #distance-picker .segment {
  min-height: 46px; border-radius: 10px; color: #52677c; font-size: 13px; font-weight: 700;
}
#setup-screen #distance-picker .segment.active {
  background: var(--home-teal) !important; border-color: var(--home-teal-dark) !important;
  color: #fff !important; box-shadow: 0 3px 8px rgba(8,127,140,.17);
}
#setup-screen #optotype-picker .card {
  min-height: 104px; padding: 13px 4px 11px; gap: 8px;
  border: 1px solid var(--home-border) !important; border-radius: 16px;
  background: #fff !important; box-shadow: 0 3px 10px rgba(30,62,83,.035);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
#setup-screen #optotype-picker .card-icon { color: var(--home-ink); }
#setup-screen #optotype-picker .card-label { color: var(--home-muted); }
#setup-screen #optotype-picker .card.active {
  border: 1.5px solid var(--home-teal) !important; background: #e8f7f6 !important;
  box-shadow: 0 0 0 2px rgba(8,127,140,.06), 0 4px 12px rgba(8,127,140,.08);
}
#setup-screen #optotype-picker .card.active .card-icon,
#setup-screen #optotype-picker .card.active .card-label { color: var(--home-teal-dark) !important; }
#setup-screen #start-test-btn {
  min-height: 62px; border-radius: 16px;
  background: linear-gradient(110deg, #087f8c 0%, #0c9299 100%);
  box-shadow: 0 7px 16px rgba(8,127,140,.17); letter-spacing: .09em;
}
#setup-screen #start-test-btn::before { width: 30px; height: 30px; margin-right: 11px; background: rgba(255,255,255,.17); font-size: 11px; }
#setup-screen #start-test-btn:active { transform: translateY(1px); box-shadow: 0 3px 9px rgba(8,127,140,.15); }
@media (max-width: 360px) {
  #setup-screen #open-calibration-btn, #setup-screen #open-checklist-btn { padding: 11px 10px !important; font-size: 12px; }
  #setup-screen #distance-picker .segment { font-size: 12px; }
  #setup-screen #optotype-picker .card { border-radius: 14px; }
}
@media (max-height: 760px) {
  #setup-screen .setup-header { margin-bottom: 15px !important; }
  #setup-screen .logo-container { margin-bottom: 8px !important; }
  #setup-screen .logo { height: 34px !important; }
  #setup-screen .calibration-status-container { margin-bottom: 16px !important; }
  #setup-screen .selection-section { margin-bottom: 15px !important; }
  #setup-screen #optotype-picker .card { min-height: 90px; }
  #setup-screen #start-test-btn { min-height: 56px; }
}


/* Fit the complete setup screen inside the phone viewport without page scrolling */
#setup-screen {
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  min-height: 0 !important;
  overflow: hidden;
  justify-content: center;
  gap: 0;
  padding-top: max(8px, env(safe-area-inset-top)) !important;
  padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
}
#setup-screen .setup-header {
  flex: 0 0 auto;
  margin-bottom: clamp(12px, 2.1dvh, 22px) !important;
}
#setup-screen .logo-container { margin-bottom: 7px !important; }
#setup-screen .logo { height: clamp(30px, 4.4dvh, 40px) !important; }
#setup-screen .setup-header h2 {
  font-size: clamp(21px, 5.6vw, 28px);
  line-height: 1.08;
}
#setup-screen .setup-header h2::after {
  margin-top: 8px;
  height: 3px;
}
#setup-screen .calibration-status-container {
  flex: 0 0 auto;
  margin-bottom: clamp(14px, 2.4dvh, 24px) !important;
  gap: 9px !important;
}
#setup-screen #open-calibration-btn,
#setup-screen #open-checklist-btn {
  min-height: clamp(68px, 10dvh, 88px);
  padding: 11px 12px !important;
  gap: 6px;
  border-radius: 15px;
  font-size: clamp(11px, 3.2vw, 13px);
}
#setup-screen #calibration-status-text {
  font-size: clamp(9px, 2.6vw, 10px);
  padding: 4px 7px;
}
#setup-screen .selection-section {
  flex: 0 0 auto;
  margin-bottom: clamp(13px, 2.3dvh, 21px) !important;
}
#setup-screen .selection-section h3 {
  margin-bottom: 8px !important;
  font-size: 10px;
}
#setup-screen #distance-picker { padding: 3px; }
#setup-screen #distance-picker .segment {
  min-height: clamp(40px, 6.5dvh, 48px);
  padding: 7px 2px;
  font-size: clamp(11px, 3.2vw, 13px);
}
#setup-screen #optotype-picker { gap: 8px; }
#setup-screen #optotype-picker .card {
  min-height: clamp(82px, 13dvh, 104px);
  padding: 9px 3px 8px;
  gap: 5px;
  border-radius: 14px;
}
#setup-screen #optotype-picker .card-icon {
  min-height: 28px;
  font-size: clamp(22px, 6.8vw, 27px) !important;
}
#setup-screen #optotype-picker .card-label {
  font-size: clamp(10px, 3vw, 12px) !important;
}
#setup-screen #start-test-btn {
  position: static;
  flex: 0 0 auto;
  min-height: clamp(52px, 8.2dvh, 62px);
  margin: 0 0 2px !important;
  border-radius: 15px;
  font-size: clamp(12px, 3.6vw, 14px);
}
#setup-screen #start-test-btn::before {
  width: 27px;
  height: 27px;
  margin-right: 9px;
}
@media (max-height: 740px) {
  #setup-screen { padding-top: 6px !important; padding-bottom: 6px !important; }
  #setup-screen .setup-header { margin-bottom: 10px !important; }
  #setup-screen .logo { height: 28px !important; }
  #setup-screen .setup-header h2 { font-size: 21px; }
  #setup-screen .setup-header h2::after { margin-top: 6px; }
  #setup-screen .calibration-status-container { margin-bottom: 11px !important; }
  #setup-screen #open-calibration-btn,
  #setup-screen #open-checklist-btn { min-height: 60px; padding: 8px 10px !important; }
  #setup-screen .selection-section { margin-bottom: 10px !important; }
  #setup-screen #distance-picker .segment { min-height: 36px; }
  #setup-screen #optotype-picker .card { min-height: 70px; padding: 6px 2px; }
  #setup-screen #optotype-picker .card-icon { min-height: 23px; font-size: 22px !important; }
  #setup-screen #start-test-btn { min-height: 48px; }
  #setup-screen #start-test-btn::before { width: 23px; height: 23px; }
}


/* Compact control sizing: reclaim vertical space while preserving touch usability */
#setup-screen .setup-header {
  margin-bottom: 16px !important;
}
#setup-screen .logo-container { margin-bottom: 6px !important; }
#setup-screen .logo { height: 34px !important; max-width: 150px !important; }
#setup-screen .setup-header h2 { font-size: clamp(21px, 5.4vw, 26px); }
#setup-screen .setup-header h2::after { margin-top: 7px; }
#setup-screen .calibration-status-container {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 18px !important;
}
#setup-screen #open-calibration-btn,
#setup-screen #open-checklist-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  height: 84px !important;
  min-height: 84px !important;
  max-height: 84px !important;
  padding: 10px 12px !important;
  gap: 6px !important;
  border-radius: 15px !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}
#setup-screen #open-calibration-btn > span:first-child {
  display: block;
  flex: 0 0 auto !important;
}
#setup-screen #calibration-status-text {
  display: inline-flex !important;
  align-self: flex-start;
  padding: 4px 7px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
}
#setup-screen .selection-section {
  margin-bottom: 15px !important;
}
#setup-screen .selection-section h3 {
  margin-bottom: 7px !important;
  font-size: 10px !important;
}
#setup-screen #distance-picker {
  min-height: 0 !important;
  padding: 3px !important;
  border-radius: 13px !important;
}
#setup-screen #distance-picker .segment {
  height: 48px !important;
  min-height: 48px !important;
  padding: 6px 2px !important;
  font-size: 12px !important;
}
#setup-screen #optotype-picker {
  gap: 8px !important;
}
#setup-screen #optotype-picker .card {
  height: 98px !important;
  min-height: 98px !important;
  max-height: 98px !important;
  padding: 8px 3px !important;
  gap: 4px !important;
  border-radius: 15px !important;
}
#setup-screen #optotype-picker .card-icon {
  min-height: 26px !important;
  font-size: 25px !important;
  line-height: 1 !important;
}
#setup-screen #optotype-picker .card-label {
  margin-top: 0 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}
#setup-screen #start-test-btn {
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  margin-top: 1px !important;
  border-radius: 15px !important;
  font-size: 13px !important;
}
#setup-screen #start-test-btn::before {
  width: 25px !important;
  height: 25px !important;
  font-size: 10px !important;
}
@media (max-height: 760px) {
  #setup-screen .setup-header { margin-bottom: 10px !important; }
  #setup-screen .logo { height: 29px !important; }
  #setup-screen .calibration-status-container { margin-bottom: 12px !important; }
  #setup-screen #open-calibration-btn,
  #setup-screen #open-checklist-btn { height: 70px !important; min-height: 70px !important; max-height: 70px !important; }
  #setup-screen .selection-section { margin-bottom: 10px !important; }
  #setup-screen #distance-picker .segment { height: 42px !important; min-height: 42px !important; }
  #setup-screen #optotype-picker .card { height: 82px !important; min-height: 82px !important; max-height: 82px !important; }
  #setup-screen #start-test-btn { height: 50px !important; min-height: 50px !important; max-height: 50px !important; }
}


/* Spacing refinement — restore visual breathing room without reintroducing scrolling */
#setup-screen .calibration-status-container {
  margin-bottom: 22px !important;
}

#setup-screen .selection-section {
  margin-bottom: 19px !important;
}

#setup-screen .selection-section h3 {
  margin-bottom: 9px !important;
}

#setup-screen #optotype-picker {
  margin-top: 2px;
  margin-bottom: 2px;
}

#setup-screen #optotype-picker .card {
  margin-bottom: 0 !important;
}

#setup-screen #start-test-btn {
  margin-top: 5px !important;
}

@media (max-height: 760px) {
  #setup-screen .calibration-status-container {
    margin-bottom: 18px !important;
  }

  #setup-screen .selection-section {
    margin-bottom: 15px !important;
  }

  #setup-screen .selection-section h3 {
    margin-bottom: 8px !important;
  }

  #setup-screen #start-test-btn {
    margin-top: 4px !important;
  }
}

@media (max-height: 700px) {
  #setup-screen .calibration-status-container {
    margin-bottom: 15px !important;
  }

  #setup-screen .selection-section {
    margin-bottom: 13px !important;
  }
}


/* Final vertical rhythm pass — clearer separation between setup sections */
#setup-screen .calibration-status-container {
  margin-bottom: 28px !important;
}

#setup-screen .selection-section {
  margin-bottom: 25px !important;
}

#setup-screen .selection-section h3 {
  margin-bottom: 11px !important;
}

#setup-screen #optotype-picker {
  margin-top: 3px;
  margin-bottom: 3px;
}

#setup-screen #start-test-btn {
  margin-top: 7px !important;
}

@media (max-height: 760px) {
  #setup-screen .calibration-status-container {
    margin-bottom: 22px !important;
  }

  #setup-screen .selection-section {
    margin-bottom: 19px !important;
  }

  #setup-screen .selection-section h3 {
    margin-bottom: 10px !important;
  }

  #setup-screen #start-test-btn {
    margin-top: 6px !important;
  }
}

@media (max-height: 700px) {
  #setup-screen .calibration-status-container {
    margin-bottom: 18px !important;
  }

  #setup-screen .selection-section {
    margin-bottom: 16px !important;
  }
}


/* Brand hierarchy fix: larger USEC logo and clear separation from the title */
#setup-screen .setup-header {
  margin-bottom: clamp(20px, 3.2dvh, 30px) !important;
}
#setup-screen .logo-container {
  margin-bottom: clamp(14px, 2.2dvh, 20px) !important;
}
#setup-screen .logo {
  height: clamp(48px, 6.5dvh, 58px) !important;
  max-width: 210px !important;
}
#setup-screen .setup-header h2 {
  font-size: clamp(23px, 5.7vw, 29px) !important;
  line-height: 1.12 !important;
}
#setup-screen .setup-header h2::after {
  margin-top: 12px !important;
}
@media (max-height: 760px) {
  #setup-screen .setup-header { margin-bottom: 18px !important; }
  #setup-screen .logo-container { margin-bottom: 12px !important; }
  #setup-screen .logo { height: 44px !important; }
  #setup-screen .setup-header h2::after { margin-top: 9px !important; }
}


/* Compact control sizing: reclaim vertical space while preserving touch usability */
#setup-screen .setup-header { margin-bottom: 16px !important; }
#setup-screen .logo-container { margin-bottom: 6px !important; }
#setup-screen .logo { height: 34px !important; max-width: 150px !important; }
#setup-screen .setup-header h2 { font-size: clamp(21px, 5.4vw, 26px) !important; }
#setup-screen .setup-header h2::after { margin-top: 7px !important; }
#setup-screen .calibration-status-container {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 18px !important;
}
#setup-screen #open-calibration-btn,
#setup-screen #open-checklist-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  width: 100% !important;
  height: 84px !important;
  min-height: 84px !important;
  max-height: 84px !important;
  padding: 10px 12px !important;
  gap: 6px !important;
  border-radius: 15px !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}
#setup-screen #open-calibration-btn > span:first-child { flex: 0 0 auto !important; }
#setup-screen #calibration-status-text {
  display: inline-flex !important;
  align-self: flex-start;
  padding: 4px 7px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
}
#setup-screen .selection-section { margin-bottom: 15px !important; }
#setup-screen .selection-section h3 { margin-bottom: 7px !important; font-size: 10px !important; }
#setup-screen #distance-picker { min-height: 0 !important; padding: 3px !important; border-radius: 13px !important; }
#setup-screen #distance-picker .segment {
  height: 48px !important; min-height: 48px !important; padding: 6px 2px !important; font-size: 12px !important;
}
#setup-screen #optotype-picker { gap: 8px !important; }
#setup-screen #optotype-picker .card {
  height: 98px !important; min-height: 98px !important; max-height: 98px !important;
  padding: 8px 3px !important; gap: 4px !important; border-radius: 15px !important;
}
#setup-screen #optotype-picker .card-icon { min-height: 26px !important; font-size: 25px !important; line-height: 1 !important; }
#setup-screen #optotype-picker .card-label { margin-top: 0 !important; font-size: 11px !important; line-height: 1.2 !important; }
#setup-screen #start-test-btn {
  position: static !important; height: 56px !important; min-height: 56px !important; max-height: 56px !important;
  margin-top: 1px !important; border-radius: 15px !important; font-size: 13px !important;
}
#setup-screen #start-test-btn::before { width: 25px !important; height: 25px !important; font-size: 10px !important; }
@media (max-height: 760px) {
  #setup-screen .setup-header { margin-bottom: 10px !important; }
  #setup-screen .logo { height: 29px !important; }
  #setup-screen .calibration-status-container { margin-bottom: 12px !important; }
  #setup-screen #open-calibration-btn, #setup-screen #open-checklist-btn {
    height: 70px !important; min-height: 70px !important; max-height: 70px !important;
  }
  #setup-screen .selection-section { margin-bottom: 10px !important; }
  #setup-screen #distance-picker .segment { height: 42px !important; min-height: 42px !important; }
  #setup-screen #optotype-picker .card { height: 82px !important; min-height: 82px !important; max-height: 82px !important; }
  #setup-screen #start-test-btn { height: 50px !important; min-height: 50px !important; max-height: 50px !important; }
}


/* Final logo hierarchy — larger brand mark with clear vertical separation */
#setup-screen .setup-header .logo-container {
  margin-bottom: 18px !important;
}
#setup-screen .setup-header .logo {
  height: 44px !important;
  max-width: 210px !important;
}
#setup-screen .setup-header {
  margin-bottom: 20px !important;
}
@media (max-height: 760px) {
  #setup-screen .setup-header .logo-container {
    margin-bottom: 14px !important;
  }
  #setup-screen .setup-header .logo {
    height: 38px !important;
  }
  #setup-screen .setup-header {
    margin-bottom: 14px !important;
  }
}
