:root {
    color-scheme: light;
    --stage-1: #4FA6F8;
    --stage-2: #3F9BF5;
    --stage-3: #3290F1;
    --stage-4: #2585EC;
    /* Shared brand colours: console/src/tokens.css must match (tokens.test.ts). */
    --blue-900: #0D4FA0;
    --blue-800: #1565C0;
    --blue-700: #186BCF;
    --blue-600: #1C72DA;
    --blue-100: #E7EEF9;
    --panel-top: var(--blue-600);
    --panel-mid: var(--blue-700);
    --panel-bottom: var(--blue-800);
    --blue: var(--blue-800);
    --blue-hover: var(--blue-900);
    --text: #1C2434;
    --muted: #5B6474;
    --line: #767676;
    --input-fill: #F7F9FC;
    --paper: #FFFFFF;
    --error: #8E1B16;
    --error-bg: #FDF3F2;
    --focus: #0B3A82;
    --focus-on-blue: #FFFFFF;
    --card-radius: 30px;
    --card-shadow: 0 34px 80px rgb(25 55 105 / 18%), 0 8px 24px rgb(25 55 105 / 10%);

    /* Fixed light onboarding theme. These do not follow the signed-in Console theme. */
    --auth-page: #eef4fc;
    --auth-paper: #ffffff;
    --auth-ink: #111a2e;
    --auth-text: #17213a;
    --auth-muted: #687188;
    --auth-muted-soft: #7b8498;
    --auth-line: #d5dce8;
    --auth-line-soft: #e3e7ef;
    --auth-blue-deep: #064b9a;
    --auth-blue: #0b68c8;
    --auth-blue-light: #4195e8;
    --auth-violet: #6559e8;
    --accent: #1067bf;
    --accent-strong: #0b5bab;
    --accent-soft: rgb(16 103 191 / 10%);
    --accent-ring: rgb(16 103 191 / 28%);
    --danger: var(--error);
    --danger-soft: var(--error-bg);
    --radius: 12px;
    --ink: var(--auth-ink);
    --ink-soft: var(--auth-text);
    --ink-muted: var(--auth-muted);
    --edge: var(--auth-line-soft);
    --edge-strong: var(--auth-line);
    --surface: var(--auth-paper);
    --surface-raised: #f7f9fc;
    --page: var(--auth-page);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    overflow: hidden;
    --scene-deep: #16386a;
    --scene-mid: #2a6cb8;
    --scene-light: #7eb0ea;
    --scene-ink: #1a5eab;
    color: #16213b;
    background:
        radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--scene-mid) 22%, transparent), transparent 32%),
        radial-gradient(circle at 88% 86%, color-mix(in srgb, var(--scene-light) 28%, transparent), transparent 28%),
        var(--auth-page);
    font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
}
body:has([data-scene="verify"]) { --scene-deep: #0e555c; --scene-mid: #178f98; --scene-light: #7ed0d4; --scene-ink: #0f7480; }
body:has([data-scene="path"]) { --scene-deep: #2a357f; --scene-mid: #4d62c5; --scene-light: #a9b7f2; --scene-ink: #3d4eae; }
body:has([data-scene="profile"]) { --scene-deep: #3b3278; --scene-mid: #6a56c4; --scene-light: #c0b4f4; --scene-ink: #5a45b0; }
body:has([data-scene="company"]) { --scene-deep: #1a4668; --scene-mid: #2f7eab; --scene-light: #8ec8ea; --scene-ink: #1f6790; }
body:has([data-scene="assistant"]) { --scene-deep: #3a2a72; --scene-mid: #7a4eb8; --scene-light: #d2b6ef; --scene-ink: #6a3ea3; }
body:has([data-scene="plan"]) { --scene-deep: #0e4c86; --scene-mid: #1f86d6; --scene-light: #8ec8f8; --scene-ink: #146fb4; }
body:has([data-scene="security"]) { --scene-deep: #1b314f; --scene-mid: #3d5d86; --scene-light: #a9bdd4; --scene-ink: #2d4c72; }
body:has([data-scene="ready"]) { --scene-deep: #1d4d62; --scene-mid: #3d8b78; --scene-light: #e2c98a; --scene-ink: #2d7a68; }
body:has([data-scene="neutral"]) { --scene-deep: #2a3848; --scene-mid: #4d6278; --scene-light: #b3c2d1; --scene-ink: #3d5166; }

.stage {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    padding: 16px 24px;
}
.card {
    position: relative;
    display: grid;
    width: min(1040px, 100%);
    height: min(860px, calc(100dvh - 32px));
    grid-template-columns: minmax(340px, 0.9fr) minmax(430px, 1.1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
        "art panel"
        "art social"
        "art foot";
    overflow: hidden;
    border: 1px solid rgb(22 72 147 / 10%);
    border-radius: var(--card-radius);
    background: var(--auth-paper);
    box-shadow: var(--card-shadow);
}

.brand-art {
    grid-area: art;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(165deg, rgb(255 255 255 / 16%), transparent 42%),
        linear-gradient(155deg, var(--scene-deep) 0%, var(--scene-mid) 58%, var(--scene-light) 100%);
}
.brand-art::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    content: "";
    opacity: 0.14;
    background-image:
        radial-gradient(circle at 1px 1px, #fff 1px, transparent 1.5px),
        linear-gradient(120deg, transparent 20%, rgb(255 255 255 / 18%) 50%, transparent 80%);
    background-size: 34px 34px, 100% 100%;
    mask-image: linear-gradient(to bottom right, black, transparent 72%);
}
.brand-orbit { display: none; }
.brand-orbit-one {
    top: -150px;
    left: -115px;
    width: 430px;
    height: 430px;
}
.brand-orbit-two {
    right: -20px;
    bottom: -160px;
    width: 390px;
    height: 390px;
    border-width: 48px;
    border-color: rgb(255 255 255 / 8%);
}
.wave {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}
.brand-seam {
    position: absolute;
    top: 0;
    right: -1px;
    bottom: 0;
    z-index: 3;
    width: 56px;
    pointer-events: none;
    background: linear-gradient(to right, transparent, #fff);
}
.brand-seam::before { content: none; }
.brand-copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 56px 84px 42px 48px;
}
.brand-lockup {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding-top: 0;
}
.brand-words {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: max-content;
    min-width: 7.4em;
    height: 40px;
}
.brand-endorsement {
    position: static;
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 11px;
    color: rgb(255 255 255 / 88%);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 11px;
    text-transform: none;
    white-space: nowrap;
}
.brand-name {
    color: #fff;
    height: 26px;
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 26px;
}
.console-mark {
    display: block;
    width: 40px;
    height: 40px;
    flex: none;
}
.brand-message {
    max-width: 280px;
    margin: 28px 0 0;
    color: rgb(255 255 255 / 82%);
    font-size: 15px;
    line-height: 1.65;
}
.brand-footnote {
    margin-top: auto;
    padding-top: 24px;
    color: rgb(255 255 255 / 62%);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.brand-lockup-compact { align-items: center; padding-top: 0; }
.brand-lockup-compact .brand-words { height: 28px; }
.brand-lockup-compact .brand-endorsement { position: static; height: 8px; color: #166dc3; font-size: 8px; line-height: 8px; }
.brand-lockup-compact .brand-name { height: 18px; color: var(--auth-ink); font-size: 18px; line-height: 18px; }
.brand-lockup-compact .console-mark { width: 28px; height: 28px; }

.panel-area {
    grid-area: panel;
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    padding: 20px 56px 16px;
    background: #fff;
    color: var(--auth-text);
}
.panel {
    width: min(400px, 100%);
    margin-inline: auto;
}
.panel.wide { width: min(480px, 100%); }
.eyebrow {
    display: block;
    margin: 0 0 8px;
    color: var(--scene-ink);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.panel h1 {
    margin: 0 0 8px;
    color: var(--auth-ink);
    font-size: clamp(28px, 3.5vw, 38px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
}
.panel p { margin: 0 0 8px; font-size: 15px; color: var(--auth-muted); line-height: 1.55; }
.panel .lead { margin-bottom: 18px; color: var(--auth-muted); }
.panel .lead strong { color: var(--auth-ink); font-weight: 650; word-break: break-all; }
.byline { margin: 0 0 18px; color: var(--auth-muted); }

.steps {
    display: flex;
    gap: 8px;
    width: min(480px, 100%);
    margin: 0 auto 18px;
    padding: 0;
    list-style: none;
}
.steps li {
    flex: 1;
    padding-top: 8px;
    border-top: 3px solid var(--auth-line-soft);
    color: var(--auth-muted-soft);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.steps li.done { border-top-color: rgb(16 103 191 / 45%); color: var(--auth-muted); }
.steps li[aria-current="step"] { border-top-color: #1067bf; color: var(--auth-ink); }

.card-foot {
    grid-area: foot;
    position: relative;
    z-index: 1;
    padding: 8px 56px 16px;
    background: #fff;
    color: var(--auth-muted-soft);
    font-size: 12px;
}
.card-foot p { margin: 0; text-align: center; }
.card-foot a { color: var(--auth-muted); }
.social {
    grid-area: social;
    padding: 4px 56px 0;
    background: #fff;
    text-align: center;
    color: var(--auth-text);
}
.social h2 { margin: 0 0 8px; color: var(--auth-muted); font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }
.social-row { display: flex; justify-content: center; gap: 12px; }
.social-row form { margin: 0; }
.signup-line { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--auth-muted); }
.signup-line a { color: var(--auth-ink); }

.flow-loader {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 4;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 28px;
    background: #fff;
    text-align: center;
}
.card.is-loading .flow-loader { display: flex; }
.card.is-loading .steps,
.card.is-loading .panel {
    opacity: 0;
    pointer-events: none;
}
.flow-spinner {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    border: 3px solid rgb(16 103 191 / 16%);
    border-top-color: #1067bf;
    border-radius: 50%;
    animation: flow-spin 0.9s linear infinite;
}
.flow-loader-title,
.flow-loader-status { margin: 0; }
.flow-loader-title {
    min-height: 1.2em;
    color: var(--auth-ink);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.flow-loader-title:empty { display: none; }
.flow-loader-status { max-width: 320px; color: var(--auth-muted); font-size: 15px; line-height: 1.5; }
@keyframes flow-spin { to { transform: rotate(360deg); } }

label, legend {
    display: block;
    padding: 0;
    margin: 14px 0 6px;
    color: var(--auth-text);
    font-size: 12.5px;
    font-weight: 600;
}
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--auth-line);
    border-radius: var(--radius);
    background: var(--surface-raised);
    color: var(--auth-ink);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { height: auto; padding: 10px 12px; }
input::placeholder { color: #8b93a6; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    outline: none;
    border-color: #1067bf;
    box-shadow: 0 0 0 3px var(--accent-ring);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[readonly] { color: var(--auth-muted); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0 8px 0 0; accent-color: #1067bf; vertical-align: -3px; }
input.code-input {
    height: 52px;
    font-size: 24px;
    font-weight: 650;
    letter-spacing: 0.4em;
    text-align: center;
    font-family: ui-monospace, Consolas, monospace;
}
button { font: inherit; background: none; border: 0; color: inherit; padding: 0; cursor: pointer; }
.btn-primary, a.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    margin-top: 18px;
    border: 1px solid #1067bf;
    border-radius: 13px;
    background: linear-gradient(135deg, #0b5bab, #1580db);
    color: #fff;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    box-shadow: 0 12px 26px -14px rgb(7 78 158 / 75%);
    transition: filter 0.15s ease, transform 0.15s ease;
}
.btn-primary:hover, a.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active, a.btn-primary:active { transform: translateY(1px); }
.btn-primary[aria-disabled="true"], a.btn-primary[aria-disabled="true"] { opacity: 0.72; cursor: progress; }
.btn-secondary, .btn-link, .text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    color: #166dc3;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.btn-link:hover, .text:hover { text-decoration: underline; }
.btn-social, .btn-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    border: 1px solid var(--auth-line);
    border-radius: 13px;
    background: #f6f8fb;
    color: var(--auth-ink);
    font-size: 14px;
    font-weight: 650;
}
.btn-social { width: 100%; margin-top: 8px; }
.btn-round { width: 100%; }
.btn-round:hover, .btn-social:hover { border-color: #1067bf; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    border-radius: 8px;
    color: inherit;
}
.panel input[type="password"] + .btn-icon,
.panel input[type="text"] + .btn-icon {
    min-height: 26px;
    margin-top: 4px;
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 600;
}
.provider-row { display: flex; margin: 0 0 4px; }
.provider-row form { width: 100%; margin: 0; }
.divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 14px 0 0;
    color: #9aa2b3;
    font-size: 11px;
}
.divider::before, .divider::after { content: ""; height: 1px; background: var(--auth-line-soft); }
.forgot { margin: 12px 0 0; text-align: center; }
.forgot a { color: var(--auth-muted); font-size: 13px; text-decoration: none; }
.forgot a:hover { color: var(--auth-ink); text-decoration: underline; }
.hint { margin: 8px 0 0; color: var(--auth-muted-soft); font-size: 12.5px; text-align: left; }
.panel[data-scene="signin"] h1 { font-size: 30px; margin-bottom: 4px; }
.panel[data-scene="signin"] .byline { margin-bottom: 10px; }
.panel[data-scene="signin"] .btn-primary { margin-top: 12px; }
/* A short window still has to show the fields, guidance, Continue, and footer without covering each other. */
@media (max-height: 760px) {
    .panel-area:has(.panel[data-scene="signin"]) {
        justify-content: flex-start;
        padding-top: 12px;
        padding-bottom: 8px;
    }
    .panel[data-scene="signin"] .eyebrow { margin-bottom: 2px; }
    .panel[data-scene="signin"] h1 { font-size: 24px; line-height: 1.1; margin-bottom: 2px; }
    .panel[data-scene="signin"] .byline { margin-bottom: 6px; font-size: 13px; }
    .panel[data-scene="signin"] .provider-row { margin-bottom: 0; }
    .panel[data-scene="signin"] .btn-round { height: 38px; }
    .panel[data-scene="signin"] .divider { margin: 6px 0 0; }
    .panel[data-scene="signin"] label { margin: 6px 0 3px; }
    .panel[data-scene="signin"] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { height: 36px; }
    .panel[data-scene="signin"] input[type="password"] + .btn-icon,
    .panel[data-scene="signin"] input[type="text"] + .btn-icon { min-height: 18px; margin-top: 2px; }
    .panel[data-scene="signin"] p { margin-bottom: 0; }
    .panel[data-scene="signin"] .hint { margin-top: 4px; line-height: 1.3; }
    .panel[data-scene="signin"] .btn-primary { height: 38px; margin-top: 4px; }
    .panel[data-scene="signin"] .forgot { margin: 4px 0 0; }
}
.links-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 10px; }
.links-row form { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgb(16 103 191 / 5%), transparent 42%),
        #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tile svg { width: 26px; height: 26px; color: #166dc3; }
.tile-title { color: var(--auth-ink); font-size: 14px; font-weight: 650; }
.tile-hint { color: var(--auth-muted); font-size: 12px; font-weight: 400; }
.tile:hover { border-color: #9eb6d6; }
.tile-input:checked + .tile {
    border-color: #1067bf;
    background: linear-gradient(180deg, rgb(16 103 191 / 12%), rgb(16 103 191 / 4%));
    box-shadow: 0 0 0 1px #1067bf inset;
}
.tile-input:focus-visible + .tile { box-shadow: 0 0 0 3px var(--accent-ring); }
.plan-tiles { grid-template-columns: 1fr; }
.transcript {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    max-height: 280px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bubble {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}
.bubble.theirs { align-self: flex-start; background: #eef4fc; color: var(--auth-ink); }
.bubble.mine { align-self: flex-end; background: linear-gradient(135deg, #0b5bab, #1580db); color: #fff; }
.summary { margin: 0 0 16px; display: grid; gap: 10px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--auth-line-soft); }
.summary dt { color: var(--auth-muted); }
.summary dd { margin: 0; color: var(--auth-ink); font-weight: 650; }
.offline {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff6e8;
    color: #8a5a00;
}
@media (prefers-reduced-motion: no-preference) {
    .tile, .bubble { animation: rise 0.35s ease both; }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.check {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    margin: 16px 0 0;
    color: var(--auth-text);
    font-size: 13px;
}
.check input { margin-top: 2px; }
.check a { color: #166dc3; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.grid-2 .span-2 { grid-column: 1 / -1; }
.setup-grid { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-top: 6px; }
.qr { display: block; width: 156px; height: 156px; padding: 6px; border: 1px solid var(--auth-line-soft); border-radius: 12px; background: #fff; }
.codes {
    margin: 6px 0 0;
    padding: 8px 10px;
    border: 1px dashed var(--auth-line);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--auth-ink);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}
.code-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin: 12px 0 0;
    padding: 14px 18px 14px 34px;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    background: var(--surface-raised);
    color: var(--auth-muted);
    font-size: 12px;
}
.panel code { color: var(--auth-ink); font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.plan-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.plan-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    background: #fff;
}
.plan-name, .plan-price { color: var(--auth-ink); font-weight: 650; }
.plan-summary { display: block; color: var(--auth-muted); font-size: 12px; }
.plan-price { white-space: nowrap; }
.identifier-row, .account-tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.identifier-row p, .account-tile span { margin: 0; color: var(--auth-ink); font-size: 14px; font-weight: 650; word-break: break-all; }
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0b5bab, #1580db);
    color: #fff;
    font-weight: 650;
}
.helper, .muted { color: var(--auth-muted); }
.helper { margin: 6px 0 0; font-size: 12px; line-height: 1.4; }
.field-error { margin: 6px 0 0; color: var(--danger); font-size: 12.5px; font-weight: 600; }
.error-summary {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid rgb(142 27 22 / 28%);
    border-left-width: 3px;
    border-radius: 8px;
    background: var(--error-bg);
    color: var(--danger);
    font-size: 13px;
}
.error-summary p { margin: 0; color: var(--danger); font-size: 13px; font-weight: 650; }
.error-summary p + ul { margin-top: 4px; }
.error-summary ul { margin: 0; padding-left: 18px; }
.error-summary a { color: var(--danger); }
.notice-ok {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--auth-text);
    font-size: 13px;
}
a { color: #166dc3; }
summary { color: var(--auth-text); font-size: 13px; cursor: pointer; }
details { margin-top: 12px; }
.panel ol:not(.code-list) {
    margin: 8px 0 0;
    padding: 10px 12px 10px 28px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--auth-text);
    font-size: 12px;
}
.offscreen { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
:focus-visible { outline: 2px solid #1067bf; outline-offset: 2px; }
.brand-top { display: none; }

@media (max-height: 720px) {
    .panel-area { padding-top: 18px; }
    .panel h1 { font-size: 26px; }
    .byline { margin-bottom: 12px; }
    label, legend { margin-top: 10px; }
    .btn-primary, a.btn-primary, .btn-social, .btn-round { height: 44px; margin-top: 14px; }
    .steps { margin-bottom: 12px; }
    .brand-message { margin-top: 16px; }
}
@media (max-height: 620px) {
    .qr { width: 128px; height: 128px; }
    .steps li { font-size: 0; padding-top: 0; }
    .card-foot { padding-bottom: 10px; }
}

@media (max-width: 820px) {
    .stage { padding: clamp(12px, 3vh, 24px) 18px; }
    .card {
        width: min(560px, 100%);
        height: min(100%, calc(100dvh - 36px));
        border-radius: 24px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(180px, 34%) minmax(0, 1fr) auto auto;
        grid-template-areas: "art" "panel" "social" "foot";
    }
    .brand-copy { padding: 28px 28px 36px; }
    .brand-message { max-width: 360px; margin-top: 16px; }
    .brand-words { height: 36px; }
    .brand-endorsement { height: 10px; font-size: 9px; line-height: 10px; }
    .brand-name { height: 24px; font-size: 24px; line-height: 24px; }
    .console-mark { width: 36px; height: 36px; }
    .brand-seam {
        top: auto;
        right: -1px;
        bottom: -1px;
        left: -1px;
        width: auto;
        height: 42px;
        background: linear-gradient(to bottom, transparent, #fff);
    }
    .panel-area, .social, .card-foot { padding-left: 28px; padding-right: 28px; }
}
@media (max-width: 480px) {
    .stage { padding: 0; }
    .card {
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        grid-template-rows: minmax(168px, 32%) minmax(0, 1fr) auto auto;
    }
    .brand-copy { padding: 22px 22px 34px; }
    .brand-message { font-size: 13px; }
    .panel-area { padding: 18px 22px 8px; }
    .social, .card-foot { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 820px) and (max-height: 720px) {
    .card { grid-template-rows: minmax(132px, 26%) minmax(0, 1fr) auto auto; }
    .brand-copy { padding: 16px 22px 28px; }
    .brand-words { height: 32px; }
    .brand-name { height: 22px; font-size: 22px; line-height: 22px; }
    .brand-endorsement { height: 8px; font-size: 8px; line-height: 8px; }
    .console-mark { width: 32px; height: 32px; }
    .brand-message, .brand-footnote { display: none; }
    .panel h1 { font-size: 24px; }
    .panel p, .eyebrow { font-size: 13px; }
}
@media (max-width: 440px) {
    .grid-2 { grid-template-columns: 1fr; }
    .setup-grid { grid-template-columns: 1fr; justify-items: center; }
    .code-list { grid-template-columns: 1fr; }
}

body.popup .stage { padding: 0; }
body.popup .card {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "top" "panel" "social" "foot";
}
body.popup .brand-top {
    grid-area: top;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 10px 16px;
    border-bottom: 1px solid var(--auth-line-soft);
    background: #fff;
    color: var(--auth-ink);
}
body.popup .panel-area { padding: 16px 20px 8px; }
body.popup .panel h1 { font-size: 26px; }
body.popup .social, body.popup .card-foot { padding-left: 20px; padding-right: 20px; }
body.popup .card-foot { padding-bottom: 12px; font-size: 11px; }
body.popup .popup-fallback { margin: 0; color: var(--auth-muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto; transition: none !important; animation: none !important; }
    .flow-spinner { border-top-color: #1067bf; }
}
@media (forced-colors: active) {
    .brand-art { background: Canvas; color: CanvasText; }
    .brand-name, .brand-endorsement, .brand-message, .brand-footnote { color: CanvasText; }
    .wave, .brand-orbit, .brand-seam, .brand-art::before { display: none; }
    button, input, select, textarea, .btn-primary, .btn-social, .btn-round, .btn-icon, a.btn-primary, .tile, .card {
        border: 1px solid ButtonText;
    }
    .tile-input:checked + .tile { border: 3px solid Highlight; }
    .btn-primary, a.btn-primary { background: ButtonFace; color: ButtonText; }
    :focus-visible { outline: 3px solid Highlight; }
}
