.card-page {
    width: min(calc(100% - 32px), 600px);
    margin: 0 auto;
    padding: 48px 0 30px;
}

.title-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 20px;
    row-gap: 8px;
    align-items: baseline;
    margin-bottom: 26px;
}

.title-block h1 {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 720;
    line-height: 1.32;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.title-block p {
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.queue-status {
    display: inline-flex;
    min-width: 0;
    align-items: baseline;
    justify-content: flex-end;
    gap: 5px;
    color: #657588;
    line-height: 1.35;
    white-space: nowrap;
}

.queue-status span,
.queue-status small {
    font-size: 12px;
}

.queue-status strong {
    color: #3977c5;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    font-weight: 720;
}

.mode-switch {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 22px;
    padding: 4px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: #eaf3fc;
}

.refresh-warning {
    color: #9a5d1d;
}

.mode-button {
    min-width: 0;
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    color: #657588;
    background: transparent;
    font-size: 14px;
    font-weight: 630;
    cursor: pointer;
    transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.mode-button:hover:not(.is-active) {
    color: #334b63;
}

.mode-button.is-active {
    color: var(--text-primary);
    background: #fff;
    box-shadow: 0 1px 3px rgba(31, 82, 135, 0.08);
}

.stepper {
    margin: 0 0 17px;
    padding: 0 8px;
}

.stepper ol {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.stepper li {
    position: relative;
    display: grid;
    min-width: 0;
    justify-items: center;
    gap: 7px;
    color: #7d8b9b;
    text-align: center;
}

.stepper li:not(:last-child)::after {
    position: absolute;
    z-index: 0;
    top: 13px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 1px;
    background: #d7e6f4;
    content: "";
}

.stepper li.is-complete:not(:last-child)::after {
    background: #8fc8ff;
}

.stepper li > span {
    z-index: 1;
    display: inline-grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid #cadceb;
    border-radius: 50%;
    background: var(--page);
    font-size: 12px;
    font-weight: 700;
}

.stepper li > strong {
    max-width: 100%;
    font-size: 12px;
    font-weight: 620;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.stepper li.is-current,
.stepper li.is-complete {
    color: var(--accent);
}

.stepper li.is-current > span {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

.stepper li.is-complete > span {
    border-color: #a9d4ff;
    color: #3977c5;
    background: var(--brand-soft);
}

.exchange-surface {
    min-height: 352px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(31, 42, 55, 0.04);
}

.flow-view {
    width: 100%;
    min-width: 0;
}

.section-heading {
    margin-bottom: 23px;
}

.section-heading.centered {
    text-align: center;
}

.section-kicker {
    display: block;
    margin-bottom: 6px;
    color: #3977c5;
    font-size: 12px;
    font-weight: 700;
}

.section-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 690;
    line-height: 1.42;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.section-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.field-group {
    display: block;
    margin-bottom: 18px;
}

.field-group > span {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 650;
}

.field-group input,
.field-group textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--text-primary);
    background: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field-group input {
    min-height: 52px;
    padding: 0 14px;
}

.field-group textarea {
    min-height: 190px;
    padding: 13px 14px;
    line-height: 1.55;
    resize: vertical;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
    color: #91a0b0;
}

.field-group input:hover,
.field-group textarea:hover {
    border-color: #aacceb;
}

.field-group input:focus,
.field-group textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--focus);
}

.field-group small {
    display: block;
    margin-top: 8px;
    color: #718096;
    font-size: 12px;
    line-height: 1.55;
}

.inline-help {
    margin: 11px 0 0;
    color: #8492a4;
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-width: 0;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 680;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 120ms ease;
}

.primary-button {
    width: 100%;
    border: 1px solid var(--primary);
    color: #fff;
    background: var(--primary);
}

.primary-button:hover:not(:disabled) {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
}

.secondary-button {
    border: 1px solid var(--line-strong);
    color: #334b63;
    background: #fff;
}

.secondary-button:hover:not(:disabled) {
    border-color: var(--brand-primary);
    background: #f5faff;
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled) {
    transform: translateY(1px);
}

.primary-button:disabled,
.secondary-button:disabled {
    cursor: not-allowed;
    opacity: 1;
}

.primary-button:disabled {
    border-color: #dce7f2;
    color: #8b9aad;
    background: #eaf1f8;
}

.secondary-button:disabled {
    border-color: #e0e9f2;
    color: #96a3b2;
    background: #f5f7fa;
}

.mode-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.feedback-action:focus-visible,
.session-source:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.button-row {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    gap: 10px;
}

.step-navigation {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.step-navigation .primary-button,
.step-navigation .secondary-button {
    width: 100%;
}

.button-row .primary-button,
.button-row .secondary-button {
    width: 100%;
}

.exchange-surface[aria-busy="true"] .primary-button:disabled::before,
.exchange-surface[aria-busy="true"] .secondary-button:disabled::before {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    content: "";
    animation: loading-spin 720ms linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.feedback {
    margin: 0 0 18px;
    padding: 13px 14px;
    border: 1px solid var(--error-line);
    border-radius: 7px;
    color: var(--error);
    background: var(--error-bg);
}

.feedback strong,
.feedback p {
    display: block;
    overflow-wrap: anywhere;
}

.feedback strong {
    font-size: 14px;
    line-height: 1.45;
}

.feedback p {
    margin: 5px 0 0;
    color: #625250;
    font-size: 13px;
    line-height: 1.58;
}

.feedback.info {
    border-color: var(--info-line);
    color: var(--info);
    background: var(--info-bg);
}

.feedback.warning {
    border-color: var(--warning-line);
    color: var(--warning);
    background: var(--warning-bg);
}

.feedback.neutral {
    border-color: var(--line);
    color: #5e6f82;
    background: var(--surface-muted);
}

.feedback-action {
    min-height: 40px;
    margin-top: 11px;
    padding: 0 14px;
    border: 1px solid currentColor;
    border-radius: 6px;
    color: inherit;
    background: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 680;
    cursor: pointer;
}

.feedback-action + .feedback-action {
    margin-left: 8px;
}

.service-announcement {
    margin: -8px 0 20px;
    padding: 13px 15px;
    border: 1px solid #cddff0;
    border-radius: 10px;
    color: #36536f;
    background: #f3f8fd;
}

.service-announcement strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.service-announcement p,
.region-notice,
.subscription-inline p {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.region-notice {
    margin: -9px 0 19px;
    padding: 10px 12px;
    border-left: 3px solid var(--warning);
    color: #6d5627;
    background: var(--warning-bg);
}

.subscription-inline {
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-muted);
}

.subscription-inline > strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 14px;
}

.subscription-inline > .secondary-button {
    margin-top: 11px;
}

.subscription-inline .feedback {
    margin: 12px 0 0;
}

.refresh-code {
    display: block;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed currentColor;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.82);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    user-select: all;
}

.challenge-panel {
    margin-top: 17px;
    padding: 15px;
    border: 1px solid var(--warning-line);
    border-radius: 9px;
    color: #6d5627;
    background: var(--warning-bg);
}

.challenge-panel strong,
.challenge-panel p {
    display: block;
}

.challenge-panel p {
    margin: 5px 0 12px;
    font-size: 13px;
    line-height: 1.6;
}

.batch-lookup {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.batch-lookup summary {
    color: var(--accent);
    font-size: 14px;
    font-weight: 680;
    cursor: pointer;
}

.batch-lookup form {
    margin-top: 17px;
}

.batch-results,
.subscription-result {
    margin-top: 20px;
}

.batch-result-card {
    margin-top: 10px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.batch-result-card strong,
.batch-result-card span {
    display: block;
    overflow-wrap: anywhere;
}

.batch-result-card span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.verified-strip {
    display: flex;
    min-width: 0;
    min-height: 43px;
    align-items: center;
    gap: 9px;
    margin: -3px 0 20px;
    padding: 9px 12px;
    border: 1px solid var(--success-line);
    border-radius: 7px;
    color: var(--success);
    background: var(--success-bg);
    font-size: 13px;
}

.verified-strip strong {
    min-width: 0;
    margin-left: auto;
    color: #285e47;
    text-align: right;
    overflow-wrap: anywhere;
}

.verified-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #3b8b68;
}

.session-guide {
    margin: 0 0 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.session-guide > strong {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.45;
}

.session-guide > p {
    margin: 5px 0 12px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.55;
}

.session-guide-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.session-guide-links a {
    display: flex;
    min-width: 0;
    min-height: 46px;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: #334155;
    background: #fff;
    font-size: 13px;
    font-weight: 680;
    line-height: 1.35;
    text-decoration: none;
    transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.session-guide-links a:hover {
    border-color: var(--brand-primary);
    color: var(--primary-hover);
    background: #fbfdff;
}

.session-guide-links a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.session-guide-number {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--text-primary);
    font-size: 12px;
    font-weight: 720;
}

.session-guide-external {
    margin-left: auto;
    color: #7b8b9d;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
}

.common-errors {
    margin: -2px 0 20px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.common-errors summary {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #536273;
    font-size: 13px;
    font-weight: 680;
    cursor: pointer;
    list-style: none;
}

.common-errors summary::-webkit-details-marker {
    display: none;
}

.common-errors summary::after {
    color: #7b8b9d;
    content: "+";
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
}

.common-errors[open] summary::after {
    content: "\2212";
}

.common-errors-content {
    padding: 0 0 14px;
}

.common-errors-content p {
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.65;
}

.common-errors-content p:last-child {
    margin: 10px 0 0;
}

.common-errors-content code {
    display: block;
    max-width: 100%;
    padding: 11px 12px;
    border-left: 3px solid var(--warning-line);
    color: #5f4a22;
    background: var(--warning-bg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.common-errors-content a {
    border-radius: 3px;
    color: var(--primary-hover);
    font-weight: 650;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.common-errors summary:focus-visible,
.common-errors-content a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.confirm-list,
.result-details {
    margin: 0;
}

.confirm-list > div,
.result-details > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.confirm-list > div:first-child,
.result-details > div:first-child {
    padding-top: 0;
}

.confirm-list > div:last-child {
    margin-bottom: 22px;
}

.confirm-list dt,
.result-details dt {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.confirm-list dd,
.result-details dd {
    min-width: 0;
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 630;
    line-height: 1.5;
    text-align: right;
    overflow-wrap: anywhere;
}

.breakable,
.failure-text,
.code-text,
.task-reference {
    overflow-wrap: anywhere;
}

.code-text,
.task-reference {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.success-view {
    padding-top: 4px;
    text-align: center;
}

.status-symbol {
    display: inline-grid;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--info-line);
    border-radius: 50%;
    color: var(--info);
    background: #fff;
    font-size: 20px;
    font-weight: 730;
}

.status-symbol.success {
    border-color: var(--success-line);
    color: var(--success);
    background: var(--success-bg);
}

.success-view > .status-symbol {
    margin-bottom: 17px;
}

.success-view .section-heading {
    margin-bottom: 11px;
}

.success-note {
    margin: 0 0 10px;
    color: #536273;
    font-size: 13px;
    line-height: 1.6;
}

.task-reference {
    display: block;
    color: #718096;
    font-size: 11px;
    line-height: 1.5;
}

.success-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
}

.query-surface {
    min-height: 332px;
}

.query-result {
    margin-top: 27px;
    padding-top: 25px;
    border-top: 1px solid var(--line);
}

.result-hero {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--info-line);
    border-radius: 7px;
    background: var(--info-bg);
}

.result-hero > div {
    min-width: 0;
}

.result-hero .status-symbol {
    width: 42px;
    height: 42px;
    font-size: 15px;
}

.result-hero.success {
    border-color: var(--success-line);
    background: var(--success-bg);
}

.result-hero.success .status-symbol {
    border-color: var(--success-line);
    color: var(--success);
}

.result-hero.warning {
    border-color: var(--warning-line);
    background: var(--warning-bg);
}

.result-hero.warning .status-symbol {
    border-color: var(--warning-line);
    color: var(--warning);
}

.result-hero.error {
    border-color: var(--error-line);
    background: var(--error-bg);
}

.result-hero.error .status-symbol {
    border-color: var(--error-line);
    color: var(--error);
}

.result-hero h2 {
    margin: 0 0 5px;
    color: var(--ink);
    font-size: 17px;
    line-height: 1.38;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.status-label {
    display: inline-block;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 4px;
    color: #536273;
    background: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.result-plan {
    margin: 21px 0 17px;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.42;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.result-details > div:last-child {
    border-bottom: 0;
}

.failure-text {
    color: var(--error) !important;
    font-weight: 620 !important;
}

.processing-note {
    margin: 17px 0 0;
    padding: 13px 14px;
    border-left: 3px solid var(--brand-primary);
    color: #49647e;
    background: var(--brand-soft);
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
}

.compact-button {
    min-height: 42px;
    flex: 0 0 auto;
    padding: 0 14px;
}

.result-footer .task-reference {
    min-width: 0;
    text-align: right;
}

.account-summary {
    margin: 0 0 20px;
}

.result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.result-actions > * {
    width: 100%;
}

.page-footer {
    padding-top: 24px;
}

.noscript {
    padding: 16px;
    color: var(--error);
    text-align: center;
}

@media (max-width: 480px) {
    .card-page {
        padding-top: 34px;
    }

    .title-block {
        column-gap: 10px;
        margin-bottom: 23px;
    }

    .title-block h1 {
        font-size: 24px;
    }

    .exchange-surface {
        min-height: 320px;
        padding: 20px;
    }

    .mode-button {
        min-height: 42px;
        padding: 0 7px;
        font-size: 13px;
    }

    .feedback-action + .feedback-action {
        margin-left: 0;
    }

    .feedback-action {
        width: 100%;
    }

    .section-heading {
        margin-bottom: 20px;
    }

    .button-row,
    .success-actions,
    .result-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .button-row .secondary-button {
        order: 2;
    }

    .confirm-list > div,
    .result-details > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
    }

    .confirm-list dd,
    .result-details dd {
        text-align: left;
    }

    .verified-strip {
        flex-wrap: wrap;
    }

    .verified-strip strong {
        width: 100%;
        margin-left: 17px;
        text-align: left;
    }

    .session-guide-links {
        grid-template-columns: minmax(0, 1fr);
    }

    .result-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .result-footer .task-reference {
        text-align: left;
    }
}

@media (max-width: 360px) {
    .stepper {
        padding: 0;
    }

    .stepper li > strong {
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .exchange-surface[aria-busy="true"] button:disabled::before {
        animation: none;
    }
}
