:root {
  --page: #f5f6f7;
  --surface: #ffffff;
  --surface-subtle: #f8f9fa;
  --line: #d8dde1;
  --line-soft: #e7eaed;
  --ink: #171b1e;
  --ink-soft: #505960;
  --ink-muted: #7c858b;
  --accent: #176f83;
  --accent-dark: #115765;
  --accent-soft: #edf5f6;
  --good: #24765b;
  --good-soft: #e9f4ef;
  --bad: #a83e38;
  --bad-soft: #f8eae8;
  --warning: #79591e;
  --warning-soft: #f8f0df;
  --sans: "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--page); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.2em; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible, .method-card:has(input:focus-visible) { outline: 2px solid rgba(23, 111, 131, 0.45); outline-offset: 2px; }

.page { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; height: 64px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #273035; background: #20272b; }
.brand-mark::before { content: "SSL"; color: white; font-family: var(--mono); font-size: 0.5rem; font-weight: 700; letter-spacing: -0.05em; }
.brand-mark i { display: none; }
.brand-copy strong { font-size: 0.82rem; font-weight: 680; letter-spacing: -0.015em; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.header-note { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 0.65rem; }
.header-note i, .tool-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.docs-link { color: var(--ink-soft); font-size: 0.65rem; font-weight: 650; text-decoration: none; }
.docs-link::after { content: " \2197"; color: var(--ink-muted); }
.docs-link:hover { color: var(--accent); }

.workspace { padding: 36px 0 28px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 36px; margin-bottom: 24px; }
.kicker { margin: 0 0 10px; color: var(--ink-muted); font-family: var(--mono); font-size: 0.57rem; letter-spacing: 0.03em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0 0 7px; font-size: 2rem; font-weight: 660; letter-spacing: -0.035em; line-height: 1.1; }
.intro-lede { margin: 0; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.55; }
.intro-meta { display: flex; padding-bottom: 2px; color: var(--ink-muted); font-family: var(--mono); font-size: 0.53rem; white-space: nowrap; }
.intro-meta span + span::before { content: "|"; margin: 0 10px; color: #b6bdc1; }

.tool { position: relative; border: 1px solid #cbd1d5; background: var(--surface); box-shadow: 0 14px 34px rgba(25, 34, 39, 0.07); }
.tool::before { content: ""; position: absolute; z-index: 2; top: -1px; right: -1px; left: -1px; height: 3px; background: #26353b; }
.tool-topbar { display: grid; grid-template-columns: 190px minmax(0, 1fr) 190px; align-items: stretch; min-height: 82px; padding: 0 28px; border-bottom: 1px solid var(--line); background: #fafbfb; }
.rail-heading { display: flex; align-items: center; gap: 10px; border-right: 1px solid var(--line); }
.rail-heading > div { display: grid; gap: 4px; }
.rail-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #abb5ba; background: white; }
.rail-mark::before { content: "REQ"; color: #48555b; font-family: var(--mono); font-size: 0.48rem; font-weight: 700; }
.rail-mark i { display: none; }
.eyebrow { color: var(--ink); font-size: 0.66rem; font-weight: 680; }
.tool-status { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-muted); font-size: 0.52rem; text-transform: uppercase; }
.tool-status i { width: 5px; height: 5px; }

.progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 35px; margin: 0; list-style: none; }
.progress li { position: relative; display: flex; align-items: center; gap: 9px; color: var(--ink-muted); }
.progress li:not(:last-child)::after { content: ""; position: absolute; right: 10px; left: 48px; top: 50%; height: 1px; background: var(--line); }
.progress li span { position: relative; z-index: 1; display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #bfc7cc; background: #fafbfb; font-family: var(--mono); font-size: 0.52rem; }
.progress li div { position: relative; z-index: 1; display: grid; gap: 2px; padding-right: 8px; background: #fafbfb; }
.progress li b { color: inherit; font-size: 0.61rem; font-weight: 620; }
.progress li small { display: none; }
.progress li.is-active { color: var(--ink); }
.progress li.is-active span { border-color: #246f80; color: white; background: #246f80; }
.progress li.is-complete { color: var(--ink-soft); }
.progress li.is-complete span { border-color: var(--good); color: var(--good); }

.rail-note { display: flex; align-items: center; gap: 9px; padding-left: 22px; border-left: 1px solid var(--line); }
.rail-note > span { position: relative; width: 23px; height: 23px; border: 1px solid #b7c0c4; }
.rail-note > span::before { content: ""; position: absolute; left: 6px; top: 8px; width: 8px; height: 7px; border: 1px solid #5a6a71; }
.rail-note > span::after { content: ""; position: absolute; left: 8px; top: 5px; width: 4px; height: 4px; border: 1px solid #5a6a71; border-bottom: 0; }
.rail-note p { margin: 0; color: var(--ink-muted); font-size: 0.51rem; line-height: 1.4; }
.rail-note strong { display: block; margin-bottom: 1px; color: var(--ink-soft); font-size: 0.56rem; }

.tool-content { display: grid; grid-template-columns: minmax(0, 1fr) 255px; min-height: 500px; }
.stage-column { min-width: 0; border-right: 1px solid var(--line); }
.stage { padding: 38px 42px 42px; }
.stage-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 28px; }
.stage-number { order: 2; margin: 4px 0 0 auto; color: var(--ink-muted); font-family: var(--mono); font-size: 0.52rem; white-space: nowrap; }
.stage-number::before { content: "["; }
.stage-number::after { content: "]"; }
.stage-heading h2 { margin-bottom: 4px; font-size: 1.25rem; font-weight: 660; letter-spacing: -0.025em; }
.stage-heading p { margin: 0; color: var(--ink-soft); font-size: 0.7rem; }

#certificate-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.field-group { min-width: 0; margin-top: 21px; }
.field-group.first-field { grid-column: 1 / -1; margin-top: 0; }
.field-label, .verification-picker legend { display: block; margin-bottom: 8px; color: #39434a; font-size: 0.59rem; font-weight: 700; letter-spacing: 0.065em; text-transform: uppercase; }
.field-label.optional { display: flex; justify-content: space-between; }
.field-label.optional span { color: var(--ink-muted); font-family: var(--mono); font-size: 0.49rem; font-weight: 500; }
.input-shell { display: flex; align-items: center; width: 100%; height: 46px; overflow: hidden; border: 1px solid #bcc5ca; background: white; transition: border-color 130ms ease, box-shadow 130ms ease; }
.input-shell:hover { border-color: #929ea4; }
.input-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(23, 111, 131, 0.1); }
.input-shell > span { display: grid; place-items: center; align-self: stretch; min-width: 60px; padding: 0 11px; border-right: 1px solid var(--line); color: var(--ink-muted); font-family: var(--mono); font-size: 0.62rem; }
.input-shell input { min-width: 0; flex: 1; height: 100%; padding: 0 13px; border: 0; outline: 0; color: var(--ink); background: transparent; font-family: var(--mono); font-size: 0.7rem; }
.input-shell input::placeholder { color: #9ca5aa; }
.email-input input { font-family: var(--sans); }
.email-input > span { min-width: 42px; font-size: 0.75rem; }
.input-note { margin: 6px 0 0; color: var(--ink-muted); font-size: 0.56rem; line-height: 1.5; }
.input-note code { color: var(--ink-soft); font-family: var(--mono); }
.input-note.is-warning { color: var(--warning); }

.verification-picker { min-width: 0; margin: 21px 0 0; padding: 0; border: 0; }
.method-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.method-card { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) 12px; gap: 9px; align-items: center; min-height: 62px; padding: 9px 10px; border: 1px solid var(--line); color: var(--ink-soft); background: var(--surface-subtle); transition: border-color 130ms ease, background 130ms ease; }
.method-card:hover:not(.is-disabled) { border-color: #9da8ad; background: white; }
.method-card.is-selected { border-color: #6699a5; background: var(--accent-soft); box-shadow: inset 2px 0 var(--accent); }
.method-card.is-disabled { cursor: not-allowed; opacity: 0.45; }
.method-card input { position: absolute; opacity: 0; pointer-events: none; }
.method-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #c7ced2; color: var(--ink-soft); background: white; font-family: var(--mono); font-size: 0.48rem; font-weight: 700; }
.http-icon { font-size: 0.9rem; }
.method-card.is-selected .method-icon { border-color: #a9c7ce; color: var(--accent); }
.method-copy { min-width: 0; }
.method-copy strong { display: block; color: var(--ink); font-size: 0.65rem; font-weight: 670; }
.method-copy small { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-muted); font-size: 0.53rem; text-overflow: ellipsis; white-space: nowrap; }
.method-state { width: 12px; height: 12px; border: 1px solid #afb8bd; border-radius: 50%; background: white; }
.method-card.is-selected .method-state { border: 3px solid var(--accent); }

.consent-line { position: relative; display: grid; grid-column: 1 / -1; grid-template-columns: 15px 1fr; gap: 9px; align-items: start; margin: 23px 0 19px; color: var(--ink-soft); font-size: 0.62rem; line-height: 1.5; cursor: pointer; }
.consent-line input { position: absolute; width: 15px; height: 15px; margin: 0; opacity: 0; }
.checkmark { position: relative; width: 15px; height: 15px; border: 1px solid #aeb8bd; background: white; transition: border-color 130ms ease, background 130ms ease; }
.consent-line:hover .checkmark { border-color: var(--accent); }
.consent-line input:checked + .checkmark { border-color: var(--accent); background: var(--accent); }
.consent-line input:checked + .checkmark::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 7px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.consent-line a { color: var(--ink); font-weight: 620; }

.action-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 43px; padding: 0 17px; border: 1px solid transparent; font-size: 0.64rem; font-weight: 680; transition: background 130ms ease, border-color 130ms ease; }
.action-button:disabled { cursor: wait; opacity: 0.6; }
.primary-action { justify-self: start; min-width: 176px; color: white; background: #202a2f; }
.primary-action:hover:not(:disabled) { background: var(--accent-dark); }
.secondary-action { color: var(--ink); border-color: #aeb8bd; background: white; }
.secondary-action:hover:not(:disabled) { border-color: #7e8b91; background: var(--surface-subtle); }
.button-arrow { font-family: var(--mono); font-size: 0.8rem; }

.context-panel { display: flex; flex-direction: column; min-width: 0; padding: 38px 28px 28px; background: #f6f7f7; }
.context-label { margin-bottom: 8px; color: var(--ink-muted); font-family: var(--mono); font-size: 0.51rem; letter-spacing: 0.05em; text-transform: uppercase; }
.context-panel h3 { margin-bottom: 20px; font-size: 0.82rem; font-weight: 670; }
.bundle-list { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.bundle-list li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.bundle-list li > span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #bdc6ca; color: #526168; background: white; font-family: var(--mono); font-size: 0.46rem; }
.bundle-list li div { display: grid; gap: 2px; }
.bundle-list strong { font-size: 0.61rem; font-weight: 650; }
.bundle-list small { color: var(--ink-muted); font-size: 0.52rem; }
.policy-block { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.policy-block p:last-child { margin: 0; color: var(--ink-muted); font-size: 0.56rem; line-height: 1.55; }

.notice { display: flex; gap: 8px; align-items: baseline; margin: 20px 42px -13px; padding: 10px 12px; border-left: 2px solid var(--accent); color: var(--ink-soft); background: var(--accent-soft); font-size: 0.62rem; line-height: 1.5; }
.notice::before { content: "STATUS"; flex: 0 0 auto; color: var(--accent); font-family: var(--mono); font-size: 0.49rem; font-weight: 700; }
.notice.is-error { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.notice.is-error::before { content: "ERROR"; color: var(--bad); }
.notice.is-success { border-color: var(--good); color: var(--good); background: var(--good-soft); }
.notice.is-success::before { content: "SUCCESS"; color: var(--good); }

.challenge-heading { display: grid; grid-template-columns: 1fr auto auto; }
.text-button { align-self: start; padding: 4px 0; border: 0; color: var(--accent); background: transparent; font-size: 0.6rem; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
.session-strip { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 9px; border: 1px solid var(--line); color: var(--ink-muted); background: var(--surface-subtle); font-family: var(--mono); font-size: 0.5rem; text-transform: uppercase; }
.session-strip code { overflow: hidden; color: var(--ink-soft); font-family: var(--mono); font-size: 0.56rem; text-transform: none; text-overflow: ellipsis; white-space: nowrap; }
.copy-button { flex: 0 0 auto; min-height: 26px; padding: 0 8px; border: 1px solid #aeb8bd; color: var(--ink-soft); background: white; font-family: var(--mono); font-size: 0.49rem; font-weight: 650; text-transform: uppercase; }
.copy-button:hover { border-color: var(--accent); color: var(--accent); }
.copy-button.compact { margin-left: auto; }
.challenge-details { display: grid; gap: 7px; margin-top: 17px; }
.challenge-intro { margin: 0 0 4px; color: var(--ink-soft); font-size: 0.64rem; line-height: 1.5; }
.proof-card { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 47px; padding: 7px 8px 7px 11px; border: 1px solid var(--line); background: var(--surface-subtle); }
.proof-card .proof-label { color: var(--ink-muted); font-family: var(--mono); font-size: 0.49rem; font-weight: 650; text-transform: uppercase; }
.proof-card code { overflow-wrap: anywhere; color: var(--ink); font-family: var(--mono); font-size: 0.57rem; line-height: 1.4; }
.advisory-box { display: grid; grid-template-columns: 18px 1fr; gap: 8px; margin-top: 16px; padding: 10px; border-left: 2px solid #ae8339; color: var(--warning); background: var(--warning-soft); }
.advisory-box p { margin: 0; font-size: 0.6rem; line-height: 1.5; }
.advisory-box > span { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid #b99450; border-radius: 50%; font-size: 0.51rem; }
.action-cluster { display: flex; gap: 8px; margin-top: 18px; }
.action-cluster .action-button { flex: 1; min-width: 0; }
.result-panel, .issuance-panel { margin-top: 14px; padding: 12px; border-left: 2px solid var(--ink-muted); color: var(--ink-soft); background: var(--surface-subtle); }
.result-panel.is-success, .issuance-panel.is-success { border-color: var(--good); color: var(--good); background: var(--good-soft); }
.result-panel.is-error, .issuance-panel.is-error { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.result-panel p, .issuance-panel p { margin: 0; font-size: 0.61rem; line-height: 1.5; }
.result-panel strong, .issuance-panel strong { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--ink); font-size: 0.68rem; font-weight: 700; }
.issuance-panel.is-success strong::before { content: "\2713"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: white; background: var(--good); font-family: var(--mono); }
.download-link { display: inline-flex; margin-top: 10px; padding: 10px 12px; color: white; background: var(--accent); font-size: 0.61rem; font-weight: 650; text-decoration: none; }
.download-link:hover { background: var(--accent-dark); }

footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0 32px; color: var(--ink-muted); font-size: 0.55rem; }
.noscript { margin: 20px; color: var(--ink); }

@media (max-width: 940px) {
  .tool-topbar { grid-template-columns: 170px minmax(0, 1fr); }
  .rail-note { display: none; }
  .tool-content { grid-template-columns: minmax(0, 1fr) 220px; }
  .stage { padding: 32px 30px 36px; }
  .notice { margin-right: 30px; margin-left: 30px; }
  #certificate-form { grid-template-columns: 1fr; }
  .field-group.first-field, .consent-line { grid-column: auto; }
}

@media (max-width: 700px) {
  .page { width: min(100% - 24px, 1180px); }
  .site-header { height: 58px; }
  .header-note { display: none; }
  .workspace { padding-top: 28px; }
  .intro { display: block; margin-bottom: 20px; }
  h1 { font-size: 1.75rem; }
  .intro-meta { display: none; }
  .tool-topbar { display: block; padding: 0 18px; }
  .rail-heading { min-height: 58px; border-right: 0; border-bottom: 1px solid var(--line); }
  .progress { min-height: 50px; padding: 0; }
  .progress li { justify-content: center; }
  .progress li div { display: none; }
  .progress li:not(:last-child)::after { right: -15px; left: 35px; }
  .tool-content { display: block; min-height: 0; }
  .stage-column { border-right: 0; }
  .stage { padding: 27px 20px 30px; }
  .stage-heading { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .stage-heading > div { grid-column: 1; grid-row: 1; }
  .stage-number { grid-column: 2; grid-row: 1; }
  .method-options { grid-template-columns: minmax(0, 1fr); }
  .primary-action { width: 100%; }
  .context-panel { display: none; }
  .notice { margin: 16px 20px -8px; }
  .challenge-heading { grid-template-columns: 1fr auto; }
  .challenge-heading .stage-number { grid-column: 1 / -1; grid-row: auto; }
  .session-strip { flex-wrap: wrap; padding: 6px 8px; }
  .session-strip code { width: calc(100% - 54px); }
  .proof-card { grid-template-columns: 1fr auto; gap: 5px 8px; }
  .proof-card .proof-label { grid-column: 1 / -1; }
  .action-cluster { display: grid; }
  footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
