:root {
  color-scheme: light;
  --navy: #0b1930;
  --navy-soft: #172a48;
  --blue: #356ff1;
  --blue-dark: #2458cb;
  --blue-soft: #eaf1ff;
  --ink: #13213a;
  --muted: #66758d;
  --line: #dce4ef;
  --paper: #fff;
  --canvas: #f2f5f9;
  --success: #147a4b;
  --success-soft: #e8f7ef;
  --warning: #76520b;
  --warning-soft: #fff6d9;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
a { color: var(--blue-dark); }
.topbar { min-height: 68px; padding: 14px max(20px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #fff; background: var(--navy); }
.brand { font-size: 20px; font-weight: 850; letter-spacing: .08em; }
.domain { color: #b9c7dd; font-size: 13px; }
.page { width: min(100%, 820px); margin: 0 auto; padding: 42px 18px 30px; }
.intro { max-width: 710px; }
.eyebrow, .panel-kicker, .certificate-kind { margin: 0; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 8px 0 0; color: var(--navy); font-size: clamp(32px, 7vw, 50px); line-height: 1.04; letter-spacing: -.045em; }
.lead, .panel-lead { margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }

.platform-tabs { margin-top: 28px; padding: 5px; display: flex; gap: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; background: #e8edf4; scrollbar-width: none; }
.platform-tabs::-webkit-scrollbar { display: none; }
.platform-tab { min-height: 44px; flex: 1 0 auto; padding: 10px 15px; border: 0; border-radius: 10px; color: #53627a; background: transparent; font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; }
.platform-tab.is-active { color: var(--navy); background: var(--paper); box-shadow: 0 2px 7px rgba(12, 31, 61, .1); }
.platform-tab:focus-visible, .primary-button:focus-visible, .secondary-button:focus-visible, .download-button:focus-visible { outline: 3px solid #97b6ff; outline-offset: 2px; }
.detection { min-height: 19px; margin: 9px 4px 0; color: #7b8799; font-size: 12px; }

.platform-panel { margin-top: 18px; padding: clamp(20px, 5vw, 34px); border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 16px 45px rgba(22, 45, 78, .07); }
.panel-heading { display: flex; align-items: center; gap: 15px; }
.platform-mark { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--navy); font-size: 20px; font-weight: 850; }
.apple-mark { font-size: 16px; }
.platform-panel h2 { margin: 4px 0 0; color: var(--navy); font-size: clamp(24px, 5vw, 32px); line-height: 1.12; letter-spacing: -.025em; }
.platform-panel h3 { color: var(--navy); }

.primary-button, .secondary-button, .download-button { min-height: 48px; padding: 12px 17px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-weight: 750; text-align: center; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.primary-button { width: 100%; margin-top: 24px; color: #fff; background: var(--blue); font-size: 16px; }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { color: var(--blue-dark); background: var(--blue-soft); font-size: 14px; }
.download-button { min-height: 42px; margin-top: 12px; padding-block: 9px; color: #fff; background: var(--blue); font-size: 14px; }

.steps { margin: 28px 0 0; padding: 0; display: grid; gap: 18px; list-style: none; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 13px; }
.steps li > span, .step-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--navy-soft); font-size: 14px; font-weight: 800; }
.steps strong { display: block; padding-top: 2px; color: var(--navy); }
.steps p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.warning { margin-top: 24px; padding: 15px 17px; border-radius: 13px; color: var(--warning); background: var(--warning-soft); font-size: 14px; line-height: 1.5; }

.progress-panel { margin: 24px 0 14px; padding: 16px; border-radius: 14px; background: #f6f8fb; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 11px; color: var(--muted); font-size: 13px; }
.progress-copy strong { color: var(--ink); }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e2e8f0; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .2s ease; }
.certificate-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.certificate-card { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.certificate-card:last-child { grid-column: 1 / -1; }
.certificate-card h3 { margin: 5px 0 0; font-size: 16px; line-height: 1.3; }
.certificate-kind { font-size: 10px; }
.is-downloaded { border-color: #b8dfcc; background: #fbfefc; }
.is-downloaded .step-number { background: var(--success); }
.is-downloaded .download-button { color: var(--success); background: var(--success-soft); }
.instruction-box { margin-top: 18px; padding: 18px; border-radius: 16px; background: var(--blue-soft); }
.instruction-box h3 { margin: 0; font-size: 18px; }
.instruction-box ol { margin: 13px 0 0; padding-left: 22px; }
.instruction-box li { margin: 8px 0; font-size: 14px; line-height: 1.45; }
.instruction-box > p { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.reset-button { width: 100%; margin-top: 9px; padding: 11px; border: 0; color: var(--muted); background: transparent; font: inherit; font-size: 13px; cursor: pointer; }

.other-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.option-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.option-card h3 { margin: 0; }
.option-card p { min-height: 63px; margin: 9px 0 15px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.fine-print { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.source-note { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.7); }
.source-note strong { color: var(--navy); }
.source-note p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
footer { padding: 0 18px calc(28px + env(safe-area-inset-bottom)); color: #8793a5; font-size: 12px; text-align: center; }

@media (max-width: 640px) {
  .page { padding-top: 32px; }
  .platform-tabs { margin-inline: -3px; }
  .platform-tab { flex-grow: 0; }
  .certificate-list, .other-grid { grid-template-columns: 1fr; }
  .certificate-card:last-child { grid-column: auto; }
  .option-card p { min-height: 0; }
}

@media (max-width: 390px) {
  .platform-panel { padding: 18px 15px; border-radius: 19px; }
  .panel-heading { align-items: flex-start; }
  .platform-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
  .certificate-card { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
