/* iPhone 15 Pro Max: 430 x 932 CSS px, native scale 3. Usable height varies. */
:root {
  color-scheme: dark;
  --ink: #eef3e9; --muted: #c1d0c8; --base: #0b1d1f; --card: #102a2b;
  --edge: #3c5650; --gold: #efd59c; --green: #bde3c4; --danger: #ffc5b3;
  --phone-width: 430px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; min-height: 100svh; background: radial-gradient(ellipse at 85% 0%, #24483f 0, transparent 55%), var(--base); color: var(--ink); }
.shell {
  width: min(100%, var(--phone-width)); min-height: 100vh; min-height: 100svh; min-height: 100dvh; margin: 0 auto;
  padding: calc(14px + var(--safe-top)) max(14px, var(--safe-right)) calc(12px + var(--safe-bottom)) max(14px, var(--safe-left));
  display: flex; flex-direction: column; gap: 12px;
}
.shell > * { flex-shrink: 0; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; font-weight: 650; min-width: 44px; min-height: 46px; border: 1px solid #719188; border-radius: 12px; background: #173c3a; color: var(--ink); padding: 10px 13px; cursor: pointer; }
button:hover { background: #214944; }
button:disabled { opacity: .65; cursor: default; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
button[hidden] { display: none; }
.masthead { display: flex; gap: 12px; align-items: center; }
.brand-mark { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; height: 48px; border: 1px solid #829783; border-radius: 14px; color: var(--gold); font-size: 18px; font-family: Georgia, serif; }
.brand-mark span { font-size: 12px; margin: 0 3px; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-weight: 700; font-size: .625rem; color: var(--gold); margin: 0 0 5px; }
h1 { margin: 0; font-size: 1.4rem; line-height: 1.2; letter-spacing: -.025em; }
h2 { margin: 0; font-size: 1.125rem; line-height: 1.25; letter-spacing: -.02em; }
p { line-height: 1.45; }
.test-banner { font-size: .75rem; color: var(--green); display: flex; align-items: center; gap: 7px; margin: 0; }
.status-dot { width: 6px; height: 6px; flex-shrink: 0; background: var(--green); border-radius: 50%; }
.counter-card { padding: 16px 16px 10px; border: 1px solid var(--edge); border-radius: 20px; background: linear-gradient(140deg, #153532, var(--card)); box-shadow: 0 14px 35px #0002; }
.count-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 14px; }
.counter-value { min-width: 0; flex: 1; }
.count { display: block; color: var(--gold); font-size: clamp(2.5rem, 16vw, 4.25rem); line-height: 1.05; font-weight: 550; font-variant-numeric: tabular-nums; letter-spacing: -.04em; overflow-wrap: anywhere; }
.count-label { color: var(--muted); font-size: .6875rem; margin: 4px 0 0; }
.primary { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; background: var(--gold); border-color: var(--gold); color: #16342c; font-size: 1rem; min-height: 52px; padding-inline: 16px; }
.primary:hover { background: #ffe6b3; }
.primary span { font-size: 25px; font-weight: 400; line-height: 1; }
.status-text { font-size: .75rem; color: var(--muted); margin: 8px 0 0; min-height: 18px; overflow-wrap: anywhere; }
.text-button { flex-shrink: 0; max-width: 110px; background: transparent; border-color: var(--edge); color: var(--muted); font-size: .75rem; min-height: 44px; padding: 8px 10px; }
.text-button:hover { background: #ffffff0a; }
.readiness { padding: 2px 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.section-heading h2 { font-size: .9375rem; }
.connection { border: 1px solid var(--edge); border-radius: 7px; font-size: .6875rem; padding: 3px 6px; color: var(--muted); white-space: nowrap; }
.readiness > p { font-size: .8125rem; color: var(--muted); margin: 8px 0; line-height: 1.4; overflow-wrap: anywhere; }
.readiness > p:empty { display: none; }
.readiness > p[data-state=ready] { color: var(--green); }
[data-state=error] { color: var(--danger) !important; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button { font-size: .8125rem; flex: 1; }
.instructions { border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); }
.instructions summary { min-height: 46px; padding: 12px 2px; font-size: .8125rem; font-weight: 600; cursor: pointer; }
.instructions ol { font-size: .8125rem; color: var(--muted); padding-left: 23px; margin: 0 0 14px; line-height: 1.5; }
.instructions li { padding-left: 3px; margin: 0 0 11px; }
.instructions p { font-size: .8125rem; color: var(--muted); margin: 0 0 15px; }
footer { margin-top: auto; color: var(--muted); font-size: .6875rem; }
footer p { margin: 3px 0; overflow-wrap: anywhere; }
/* Compact spacing for Safari chrome. Keep touch sizes, zoom and normal flow. */
@media (max-height: 850px) {
  .shell { gap: 8px; padding-top: calc(10px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom)); }
  .counter-card { padding: 12px 14px 8px; }
  .count-row { margin: 5px 0 9px; }
  .count { font-size: clamp(2.5rem, 13vw, 3.5rem); }
  .primary { min-height: 48px; }
}
@media (max-width: 359px) {
  .shell { padding-inline: max(10px, var(--safe-left)) max(10px, var(--safe-right)); }
  h1 { font-size: 1.2rem; }
  .counter-card { padding-inline: 12px; }
  .text-button { max-width: 92px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
