:root {
    --ink: #17201b;
    --muted: #66736b;
    --surface: #ffffff;
    --canvas: #f3f6f4;
    --line: #dce4df;
    --sidebar: #18211d;
    --accent: #16805a;
    --accent-dark: #106947;
    --warning: #a85d00;
    --warning-bg: #fff3dc;
    --success: #166b46;
    --success-bg: #e6f5ed;
    --danger: #b42318;
    --danger-bg: #feebe9;
    --radius: 8px;
    --shadow: 0 8px 24px rgba(23, 32, 27, 0.08);
}

/* Public recharge workspace */
.public-app {
    background: #f4f6f5;
}

.public-header {
    position: sticky;
    z-index: 50;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.public-header-inner {
    display: flex;
    width: min(100%, 1120px);
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin: 0 auto;
    padding: 0 20px;
}

.public-brand {
    flex: 0 0 auto;
    color: var(--ink);
    font-size: 19px;
    font-weight: 800;
    text-decoration: none;
}

.public-tabs.tab-navigation {
    min-width: 0;
    margin: 0;
    border-bottom: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.public-tabs .tab-btn {
    min-height: 64px;
    padding: 12px 14px;
    white-space: nowrap;
}

.public-main {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 28px 20px 56px;
}

.public-notice {
    width: 100%;
    margin-bottom: 16px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 6px;
    overflow-wrap: anywhere;
}

.notice-info {
    background: #edf5fa;
    border-color: #bed9e8;
    border-left-color: #27749b;
    color: #205f7e;
}

.submit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    align-items: start;
}

.workflow-panel,
.query-workspace,
.tutorial-workspace {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.workflow-panel {
    overflow: hidden;
}

.workflow-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px 18px;
}

.workflow-heading-row h1,
.query-workspace h1,
.tutorial-workspace h1 {
    margin-top: 3px;
    font-size: 25px;
    line-height: 1.25;
}

.manual-badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    background: var(--warning-bg);
    border: 1px solid #f0d9ae;
    border-radius: 6px;
    color: var(--warning);
    font-size: 12px;
    font-weight: 750;
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 14px 18px;
    background: #f7f9f8;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    list-style: none;
}

.workflow-step {
    display: grid;
    min-width: 0;
    min-height: 62px;
    align-content: start;
    justify-items: center;
    gap: 6px;
    color: var(--muted);
    text-align: center;
}

.workflow-step .step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.workflow-step .step-text {
    max-width: 100%;
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.workflow-step.active,
.workflow-step.completed {
    color: var(--accent);
}

.workflow-step.active .step-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.workflow-step.completed .step-circle {
    background: var(--success-bg);
    border-color: #b9dfca;
    color: var(--success);
}

.public-app .form-section {
    min-height: 330px;
    padding: 26px;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.public-app .section-header {
    margin-bottom: 20px;
}

.public-app .section-header h2 {
    margin-top: 3px;
    font-size: 19px;
}

.step-label {
    color: var(--accent);
    font-size: 12px;
    font-weight: 750;
}

.public-app .form-group {
    margin-bottom: 10px;
}

.public-app .form-group label {
    margin-bottom: 7px;
}

.public-app .form-input {
    min-height: 44px;
    padding: 10px 12px;
}

.public-app textarea.form-input {
    min-height: 176px;
    max-height: 360px;
    resize: vertical;
}

.field-help {
    margin: 8px 0 20px;
    color: var(--muted);
    font-size: 13px;
}

.public-app .btn-primary,
.public-app .btn-secondary,
.public-app .get-token-btn {
    min-height: 44px;
    padding: 10px 16px;
}

.public-app .btn-primary {
    background: var(--accent);
}

.public-app .btn-primary:hover {
    background: var(--accent-dark);
}

.full-width {
    width: 100%;
}

.token-action-row {
    margin-bottom: 12px;
}

.token-action-row .get-token-btn {
    width: 100%;
    margin: 0;
    background: #edf3f0;
    border: 1px solid #b9c9c0;
    color: var(--ink);
}

.token-action-row .get-token-btn:hover {
    background: #e3ece7;
}

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

.confirm-list {
    margin-bottom: 20px;
    border-top: 1px solid var(--line);
}

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

.confirm-list dt,
.result-list dt,
.service-facts dt {
    color: var(--muted);
}

.confirm-list dd,
.result-list dd,
.service-facts dd {
    min-width: 0;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.submission-result {
    margin-bottom: 16px;
    padding: 18px;
    background: var(--success-bg);
    border: 1px solid #b9dfca;
    border-radius: 8px;
}

.submission-result > p:first-child {
    color: var(--muted);
    font-size: 12px;
}

.submission-result > strong {
    display: block;
    margin: 3px 0 12px;
    color: var(--ink);
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: 20px;
    overflow-wrap: anywhere;
}

.submission-result b {
    color: var(--warning);
}

.service-panel {
    padding: 20px 0 20px 20px;
    border-left: 3px solid var(--accent);
}

.service-panel h2 {
    margin-top: 4px;
    font-size: 19px;
}

.service-facts {
    margin-top: 18px;
}

.service-facts > div {
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.service-facts dt {
    margin-bottom: 3px;
    font-size: 12px;
}

.service-facts dd {
    font-size: 13px;
}

.query-workspace,
.tutorial-workspace {
    padding: 26px;
}

.query-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    max-width: 760px;
    margin-top: 22px;
}

.query-form .form-group {
    margin: 0;
}

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

.query-result h2 {
    margin-bottom: 10px;
    font-size: 17px;
}

.bill-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.bill-summary h2 {
    margin: 0;
}

.bill-summary p {
    color: var(--muted);
    font-size: 13px;
}

.bill-order-row {
    padding: 6px 0;
    border-top: 1px solid var(--line);
}

.bill-order-row:first-child {
    border-top: 0;
}

.bill-order-row .result-list > div:last-child {
    border-bottom: 0;
}

.tutorial-steps {
    max-width: 820px;
    margin: 20px 0 26px;
    padding-left: 22px;
}

.tutorial-steps li + li {
    margin-top: 8px;
}

.tutorial-gallery {
    display: grid;
    gap: 24px;
}

.tutorial-figure {
    margin: 0;
}

.tutorial-figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.tutorial-figure:first-child img {
    aspect-ratio: 1485 / 1191;
}

.tutorial-figure img.tutorial-card-entry {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
}

.tutorial-figure figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 840px) {
    .submit-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .service-panel {
        padding: 18px 0 0;
        border-top: 3px solid var(--accent);
        border-left: 0;
    }

    .service-facts {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 620px) {
    .public-header-inner {
        display: block;
        padding: 12px 0 0;
    }

    .public-brand {
        display: block;
        padding: 0 16px 10px;
    }

    .public-tabs.tab-navigation {
        width: 100%;
        padding: 0 8px;
    }

    .public-tabs .tab-btn {
        min-height: 44px;
        padding: 9px 12px;
    }

    .public-main {
        padding: 18px 12px 40px;
    }

    .workflow-heading-row,
    .public-app .form-section,
    .query-workspace,
    .tutorial-workspace {
        padding-right: 16px;
        padding-left: 16px;
    }

    .workflow-heading-row h1,
    .query-workspace h1,
    .tutorial-workspace h1 {
        font-size: 22px;
    }

    .workflow-steps {
        padding: 12px 6px;
    }

    .workflow-step {
        min-height: 72px;
    }

    .workflow-step .step-text {
        font-size: 11px;
    }

    .public-app .form-section {
        min-height: 0;
    }

    .public-app .form-buttons,
    .query-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .public-app .form-buttons {
        display: grid;
    }

    .query-form .btn-primary,
    .public-app .form-buttons > * {
        width: 100%;
    }

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

    .service-facts {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .bill-summary {
        display: block;
    }

    .bill-summary p {
        margin-top: 5px;
    }
}

@media (max-width: 390px) {
    .public-main {
        padding-right: 10px;
        padding-left: 10px;
    }

    .workflow-heading-row {
        gap: 10px;
    }

    .manual-badge {
        max-width: 92px;
        text-align: center;
    }

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

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    letter-spacing: 0;
}

html {
    color-scheme: light;
}

body {
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    max-width: 100%;
    border: 0;
    cursor: pointer;
    overflow-wrap: anywhere;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

a {
    color: var(--accent);
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid rgba(22, 128, 90, 0.28);
    outline-offset: 2px;
}

/* Public-page compatibility */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 14px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.header-left .logo {
    color: var(--ink);
    font-size: 20px;
    font-weight: 750;
}

.header-right .status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: var(--accent);
    border-radius: 50%;
}

.status-text {
    color: var(--muted);
    font-size: 13px;
}

.main-container {
    display: flex;
    justify-content: center;
    padding: 36px 20px 56px;
}

.content-card {
    width: min(100%, 900px);
    padding: 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.title-section {
    margin-bottom: 28px;
    text-align: center;
}

.title-section h1 {
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 28px;
    line-height: 1.25;
}

.title-section .description,
.section-description,
.hint-text {
    color: var(--muted);
}

.title-section .description {
    margin-bottom: 18px;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.tag {
    padding: 6px 10px;
    background: #eef3f0;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #455149;
    font-size: 13px;
}

.processing-time {
    display: inline-block;
    padding: 9px 14px;
    background: var(--warning-bg);
    border: 1px solid #f0d9ae;
    border-radius: 6px;
    color: var(--warning);
    font-size: 13px;
}

.tab-navigation {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 12px 14px;
    background: transparent;
    border-bottom: 2px solid transparent;
    color: var(--muted);
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--accent);
}

.tab-btn.active {
    border-bottom-color: var(--accent);
    font-weight: 700;
}

.step-indicator {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 28px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--muted);
}

.step-circle {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    background: #edf1ef;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-weight: 700;
}

.step-text {
    font-size: 12px;
    text-align: center;
}

.step.active {
    color: var(--accent);
}

.step.active .step-circle {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.form-section,
.tutorial-section {
    padding: 26px;
    background: #f8faf9;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 18px;
    line-height: 1.3;
}

.step-badge {
    flex: 0 0 auto;
    padding: 3px 9px;
    background: var(--accent);
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
}

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

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 650;
}

.form-input,
.form-group input,
.field-inline input,
.field-inline select {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    background: var(--surface);
    border: 1px solid #bdc9c1;
    border-radius: 6px;
}

textarea.form-input {
    min-height: 150px;
    resize: vertical;
}

.form-input:focus,
.form-group input:focus,
.field-inline input:focus,
.field-inline select:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(22, 128, 90, 0.13);
}

.hint-text {
    margin: -7px 0 18px;
    font-size: 13px;
}

.btn-primary,
.btn-secondary,
.btn-success,
.get-token-btn,
.btn-logout {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    border-radius: 6px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.btn-primary,
.get-token-btn {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover,
.get-token-btn:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid #bdc9c1;
    color: var(--ink);
}

.btn-secondary:hover {
    background: #eef3f0;
    border-color: #9eafa4;
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: #10583a;
}

.form-buttons {
    display: flex;
    gap: 10px;
}

.form-buttons > * {
    flex: 1 1 0;
}

.confirm-info,
.order-info,
.code-preview {
    margin: 18px 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.info-row {
    display: grid;
    grid-template-columns: minmax(100px, 0.35fr) 1fr;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
}

.info-row:last-child {
    border-bottom: 0;
}

.info-label {
    color: var(--muted);
}

.info-value {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.success-message {
    text-align: center;
}

.success-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    place-items: center;
    background: var(--success-bg);
    border-radius: 50%;
    color: var(--success);
    font-size: 24px;
}

.success-message h3 {
    margin-bottom: 7px;
    font-size: 20px;
}

.success-message p {
    color: var(--muted);
}

.order-info {
    padding: 12px;
}

.order-info p + p {
    margin-top: 5px;
}

.tutorial-block + .tutorial-block {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.tutorial-block h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.tutorial-list {
    padding-left: 22px;
    color: #455149;
}

.tutorial-list li + li {
    margin-top: 7px;
}

.get-token-btn {
    width: 100%;
    margin-top: 14px;
}

.code-preview {
    overflow-x: auto;
}

.code-preview pre {
    padding: 14px;
    color: #2d3932;
    font: 13px/1.6 Consolas, "SFMono-Regular", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.note-item {
    display: flex;
    gap: 10px;
    margin-top: 9px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.note-item.success {
    background: var(--success-bg);
    border-color: #b9dfca;
    color: var(--success);
}

.note-item.error {
    background: var(--danger-bg);
    border-color: #f2c2be;
    color: var(--danger);
}

.note-item.warning {
    background: var(--warning-bg);
    border-color: #f0d9ae;
    color: var(--warning);
}

/* Admin authentication */
.admin-app {
    background: var(--canvas);
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

.login-container {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
}

.login-card {
    width: min(100%, 410px);
    padding: 30px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-brand,
.workspace-kicker {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
}

.login-card h1 {
    margin-top: 7px;
    font-size: 25px;
    line-height: 1.25;
}

.login-subtitle {
    margin: 6px 0 24px;
    color: var(--muted);
}

.form-error {
    min-height: 21px;
    margin: -5px 0 10px;
    color: var(--danger);
    font-size: 13px;
}

.login-submit {
    width: 100%;
}

.login-back-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
}

.login-back-link:hover {
    color: var(--accent);
}

/* Admin shell */
.admin-shell {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 24px 16px;
    background: var(--sidebar);
    color: #ffffff;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    padding: 0 10px 22px;
    border-bottom: 1px solid #35413b;
}

.sidebar-brand strong {
    font-size: 18px;
}

.sidebar-brand span {
    margin-top: 2px;
    color: #aebbb4;
    font-size: 12px;
}

.sidebar-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    padding-top: 20px;
}

.nav-item {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #c7d1cc;
    font-weight: 650;
    text-align: left;
}

.nav-item:hover {
    background: #25312b;
    color: #ffffff;
}

.nav-item.active {
    background: #ffffff;
    color: var(--sidebar);
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid #35413b;
}

.sidebar-link,
.btn-logout {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
}

.sidebar-link {
    display: grid;
    place-items: center;
    color: #c7d1cc;
}

.sidebar-link:hover {
    background: #25312b;
    color: #ffffff;
}

.btn-logout {
    background: transparent;
    border: 1px solid #536159;
    color: #ffffff;
}

.btn-logout:hover {
    background: #25312b;
}

.admin-workspace {
    min-width: 0;
    padding: 28px 32px 48px;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.workspace-header h1 {
    margin-top: 3px;
    font-size: 24px;
    line-height: 1.25;
}

.admin-view {
    display: none;
}

.admin-view.active {
    display: block;
}

.view-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.view-intro h2 {
    font-size: 18px;
    line-height: 1.3;
}

.view-intro p {
    margin-top: 5px;
    color: var(--muted);
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.metric {
    min-width: 0;
    padding: 16px 18px;
}

.metric + .metric {
    border-left: 1px solid var(--line);
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.metric strong {
    display: block;
    margin-top: 3px;
    font-size: 24px;
    line-height: 1.2;
}

.table-toolbar,
.cdk-actions,
.generate-controls,
.action-group,
.field-inline {
    display: flex;
    align-items: center;
}

.table-toolbar,
.cdk-actions {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.generate-controls,
.action-group {
    gap: 8px;
}

.field-inline {
    gap: 8px;
    min-width: 0;
}

.field-inline label {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.field-inline select {
    width: auto;
    min-width: 120px;
}

.field-inline input {
    width: 88px;
}

.table-container {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background: #f7f9f8;
    color: #4f5c54;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.data-table td {
    max-width: 300px;
    overflow-wrap: anywhere;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover td {
    background: #fafcfb;
}

.account-cell strong,
.account-cell span {
    display: block;
}

.account-cell strong {
    font-size: 13px;
}

.account-cell span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.mono-cell,
.generated-result,
.token-preview {
    font-family: Consolas, "SFMono-Regular", monospace;
}

.cdk-code-cell {
    min-width: 210px;
}

.status-badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}

.status-unfinished {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-completed,
.status-unused {
    background: var(--success-bg);
    color: var(--success);
}

.status-used {
    background: #edf1ef;
    color: #536159;
}

.action-cell {
    white-space: nowrap;
}

.btn-link {
    min-width: 44px;
    min-height: 32px;
    padding: 5px 8px;
    background: transparent;
    border-radius: 5px;
    color: var(--accent);
    font-weight: 700;
}

.btn-link:hover {
    background: #e9f4ef;
}

.loading-state,
.empty-state {
    height: 96px;
    color: var(--muted);
    text-align: center !important;
}

.generated-result {
    max-height: 220px;
    margin-bottom: 16px;
    padding: 14px;
    background: #f8faf9;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: #26332c;
    line-height: 1.65;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: text;
}

.cdk-filter-toolbar {
    justify-content: flex-start;
}

/* Modal and notices */
.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    padding: 20px;
    background: rgba(23, 32, 27, 0.58);
    place-items: center;
}

.modal-panel {
    width: min(100%, 660px);
    max-height: calc(100vh - 40px);
    background: var(--surface);
    border: 1px solid #ccd6d0;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(14, 22, 17, 0.22);
    overflow-y: auto;
}

.modal-header,
.modal-footer,
.token-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-header h2 {
    margin-top: 2px;
    font-size: 19px;
}

.modal-close {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    background: transparent;
    border-radius: 6px;
    color: var(--muted);
    font-size: 26px;
    line-height: 1;
    place-items: center;
}

.modal-close:hover {
    background: #edf1ef;
    color: var(--ink);
}

.modal-body {
    padding: 20px;
}

.detail-list {
    border-top: 1px solid var(--line);
}

.detail-list > div {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr);
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.detail-list dt {
    color: var(--muted);
}

.detail-list dd {
    min-width: 0;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.token-section {
    margin-top: 20px;
}

.token-heading {
    margin-bottom: 8px;
    font-weight: 750;
}

.btn-small {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 12px;
}

.token-preview {
    min-height: 70px;
    max-height: 170px;
    padding: 12px;
    background: #f7f9f8;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #455149;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: text;
}

.modal-footer {
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
}

.session-modal-panel {
    width: min(100%, 860px);
}

.session-modal-order {
    margin-top: 4px;
    color: var(--muted);
    font: 700 12px/1.5 Consolas, monospace;
    overflow-wrap: anywhere;
}

.session-json-value {
    min-height: 260px;
    max-height: min(58vh, 620px);
    margin: 0;
    padding: 16px;
    background: #111815;
    border: 1px solid #2f3d35;
    border-radius: 6px;
    color: #d9e9df;
    font: 12px/1.65 Consolas, "SFMono-Regular", monospace;
    overflow: auto;
    overflow-wrap: anywhere;
    tab-size: 2;
    user-select: text;
    white-space: pre-wrap;
}

.admin-notice {
    position: fixed;
    z-index: 1100;
    top: 18px;
    right: 18px;
    width: min(380px, calc(100% - 36px));
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 6px;
    box-shadow: var(--shadow);
    overflow-wrap: anywhere;
}

.notice-success {
    background: var(--success-bg);
    border-color: #b9dfca;
    border-left-color: var(--success);
    color: var(--success);
}

.notice-warning {
    background: var(--warning-bg);
    border-color: #f0d9ae;
    border-left-color: var(--warning);
    color: var(--warning);
}

.notice-danger {
    background: var(--danger-bg);
    border-color: #f2c2be;
    border-left-color: var(--danger);
    color: var(--danger);
}

@media (max-width: 760px) {
    .header {
        align-items: flex-start;
        gap: 10px;
        padding: 13px 16px;
    }

    .main-container {
        padding: 18px 12px 36px;
    }

    .content-card {
        padding: 20px 16px;
    }

    .title-section h1 {
        font-size: 23px;
    }

    .form-section,
    .tutorial-section {
        padding: 18px 14px;
    }

    .form-buttons {
        flex-direction: column;
    }

    .info-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .login-container {
        padding: 16px;
    }

    .login-card {
        padding: 24px 20px;
    }

    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        padding: 14px 16px;
    }

    .sidebar-brand {
        padding: 0 0 12px;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 8px;
        padding-top: 12px;
    }

    .nav-item {
        flex: 1 1 0;
        min-width: 0;
        text-align: center;
    }

    .sidebar-footer {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
    }

    .admin-workspace {
        padding: 20px 16px 36px;
    }

    .workspace-header {
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    .workspace-header h1 {
        font-size: 21px;
    }

    .view-intro {
        display: block;
    }

    .metric {
        padding: 13px 12px;
    }

    .metric strong {
        font-size: 20px;
    }

    .table-toolbar,
    .cdk-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .generate-controls,
    .action-group {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .generate-controls .field-inline {
        grid-column: 1 / -1;
    }

    .field-inline {
        justify-content: space-between;
    }

    .field-inline select {
        min-width: 0;
        flex: 1 1 auto;
    }

    .table-container {
        overflow-x: auto;
    }

    .modal {
        align-items: end;
        padding: 10px;
    }

    .modal-panel {
        max-height: calc(100vh - 20px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-right: 16px;
        padding-left: 16px;
    }

    .detail-list > div {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 10px;
    }

    .admin-notice {
        top: 12px;
        right: 12px;
        width: calc(100% - 24px);
    }
}

/* Recharge workflow additions */
.signed-in-user {
    display: grid;
    gap: 1px;
    padding: 8px 10px;
    color: #ffffff;
}

.signed-in-user span {
    color: #aebbb4;
    font-size: 12px;
}

.status-neutral {
    background: #edf1ef;
    color: #536159;
}

.status-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.orders-workbench-layout {
    display: grid;
    grid-template-columns: minmax(620px, 1.25fr) minmax(360px, 0.75fr);
    gap: 20px;
    align-items: start;
}

.order-list-pane,
.recharge-workbench {
    min-width: 0;
}

.order-table {
    min-width: 660px;
}

.order-table th:first-child,
.order-table td:first-child {
    min-width: 220px;
}

.order-table th,
.order-table td {
    padding-right: 10px;
    padding-left: 10px;
}

.order-identity-cell strong,
.order-identity-cell span {
    display: block;
}

.order-identity-cell span {
    max-width: 280px;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.recharge-workbench {
    position: sticky;
    top: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.workbench-empty {
    min-height: 280px;
    padding: 24px;
}

.workbench-empty h2 {
    font-size: 18px;
}

.workbench-empty p,
.workbench-header p {
    margin-top: 5px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.workbench-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.workbench-header h2 {
    margin-top: 2px;
    font: 700 16px/1.35 Consolas, "SFMono-Regular", monospace;
    overflow-wrap: anywhere;
}

.icon-button {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 25px;
    line-height: 1;
    place-items: center;
}

.icon-button:hover {
    background: #edf1ef;
    color: var(--ink);
}

.order-context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
}

.order-context-grid > div {
    min-width: 0;
    padding: 11px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.order-context-grid > div:nth-child(2n) {
    border-right: 0;
}

.order-context-grid > div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.order-context-grid dt,
.checkout-summary dt {
    color: var(--muted);
    font-size: 11px;
}

.order-context-grid dd,
.checkout-summary dd {
    margin-top: 2px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.operator-steps {
    margin: 0;
    padding: 0 18px;
    list-style: none;
}

.operator-step {
    display: grid;
    min-width: 0;
    gap: 10px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.operator-step-copy {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.operator-step-copy > span {
    color: var(--accent);
    font: 700 12px/1.6 Consolas, monospace;
}

.operator-step h3 {
    font-size: 14px;
    line-height: 1.35;
}

.operator-step p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.workflow-action,
.workbench-utility-actions button,
.step-actions button {
    width: 100%;
    min-height: 40px;
}

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

.checkout-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.checkout-summary > div {
    min-width: 0;
    padding: 9px 10px;
}

.checkout-summary > div + div {
    border-left: 1px solid var(--line);
}

.workbench-utility-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 16px 18px 8px;
}

.btn-danger {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    border: 1px solid #e0aaa5;
    border-radius: 6px;
    background: var(--surface);
    color: var(--danger);
    font-weight: 700;
}

.btn-danger:hover {
    background: var(--danger-bg);
}

.workbench-error {
    min-height: 31px;
    padding: 0 18px 12px;
    color: var(--danger);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.browser-worker-status {
    margin: 12px 0 0;
    padding-left: 10px;
    border-left: 3px solid var(--accent, #2563eb);
    color: var(--text-secondary, #4b5563);
    font-size: 0.875rem;
    line-height: 1.5;
}

.admin-notice {
    top: 76px;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(240px, 520px) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.inline-form .form-group {
    margin: 0;
}

.management-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.management-panel {
    min-width: 0;
    padding: 18px 0;
    border-top: 2px solid var(--ink);
}

.management-panel h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.toggle-row {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.toggle-row span,
.toggle-row strong,
.toggle-row small {
    display: block;
}

.toggle-row small {
    margin-top: 2px;
    color: var(--muted);
}

.toggle-row input {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    accent-color: var(--accent);
}

#save-feature-flags-btn {
    margin-top: 14px;
}

#bill-tab .query-form {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
    max-width: none;
}

.query-form-stacked {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 840px;
}

.query-form-wide {
    grid-column: 1 / -1;
}

.query-form-stacked > button {
    grid-column: 1 / -1;
}

@media (max-width: 1180px) {
    .orders-workbench-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .recharge-workbench {
        position: static;
    }

    #bill-tab .query-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .nav-item {
        min-height: 40px;
        padding: 8px 4px;
    }

    .order-table-container {
        overflow: visible;
    }

    .order-table,
    .order-table tbody,
    .order-table tr,
    .order-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .order-table thead {
        display: none;
    }

    .order-table tbody tr {
        padding: 6px 12px;
        border-bottom: 1px solid var(--line);
    }

    .order-table tbody tr:last-child {
        border-bottom: 0;
    }

    .order-table td,
    .order-table .order-identity-cell {
        display: grid;
        max-width: none;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 10px;
        padding: 9px 0;
        border: 0;
        align-items: start;
    }

    .order-table td:first-child {
        min-width: 0;
    }

    .order-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 650;
    }

    .order-table .order-identity-cell strong,
    .order-table .order-identity-cell span {
        grid-column: 2;
    }

    .order-table .order-identity-cell::before {
        grid-row: 1 / span 2;
    }

    .order-table .action-cell,
    .order-table td:last-child {
        align-items: center;
    }

    .order-table td:last-child .btn-link {
        width: 100%;
        border: 1px solid #b9c9c0;
    }

    .order-table .loading-state,
    .order-table .empty-state {
        display: block;
        height: auto;
        padding: 28px 12px;
    }

    .order-table .loading-state::before,
    .order-table .empty-state::before {
        content: none;
    }

    .sidebar-footer {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .signed-in-user {
        grid-column: 1 / -1;
    }

    .orders-workbench-layout,
    .management-layout,
    .inline-form,
    #bill-tab .query-form,
    .query-form-stacked {
        grid-template-columns: minmax(0, 1fr);
    }

    .query-form-wide,
    .query-form-stacked > button {
        grid-column: auto;
    }

    .order-context-grid,
    .step-actions,
    .workbench-utility-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .order-context-grid > div,
    .order-context-grid > div:nth-child(2n),
    .order-context-grid > div:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .order-context-grid > div:last-child {
        border-bottom: 0;
    }

    .workbench-header,
    .operator-steps,
    .workbench-utility-actions {
        padding-right: 14px;
        padding-left: 14px;
    }

    .public-header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
        padding-top: 10px;
    }

    .public-tabs.tab-navigation {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow: visible;
    }

    .public-tabs .tab-btn {
        width: 100%;
        min-height: 44px;
        padding: 8px 10px;
        white-space: normal;
    }

    .admin-notice {
        top: auto;
        bottom: 12px;
    }
}

/* Public workspace refresh, 2026-07-28 */
.public-app {
    --public-canvas: #f7f7f3;
    --public-surface: #ffffff;
    --public-ink: #202522;
    --public-muted: #69716c;
    --public-line: #d9ded9;
    --public-line-strong: #b8c1bb;
    --public-accent: #176b57;
    --public-accent-dark: #115443;
    --public-coral: #c65f43;
    min-height: 100vh;
    margin: 0;
    background: var(--public-canvas);
    color: var(--public-ink);
    font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    letter-spacing: 0;
}

.public-app *,
.public-app *::before,
.public-app *::after {
    box-sizing: border-box;
    letter-spacing: 0;
}

.public-app button,
.public-app input,
.public-app textarea {
    font: inherit;
}

.public-app .public-header {
    position: sticky;
    z-index: 50;
    top: 0;
    background: rgba(247, 247, 243, 0.96);
    border-bottom: 1px solid var(--public-line);
    backdrop-filter: blur(12px);
}

.public-app .public-header-inner {
    display: flex;
    width: min(100%, 1160px);
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin: 0 auto;
    padding: 0 24px;
}

.public-app .public-brand {
    display: inline-flex;
    min-width: 0;
    flex: 0 0 auto;
    align-items: center;
    gap: 11px;
    color: var(--public-ink);
    text-decoration: none;
}

.public-app .brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    background: var(--public-ink);
    border-radius: 6px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
}

.public-app .brand-copy {
    display: grid;
    gap: 2px;
}

.public-app .brand-copy strong {
    font-size: 17px;
    line-height: 1.2;
}

.public-app .brand-copy small {
    color: var(--public-muted);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
}

.public-app .public-tabs {
    display: flex;
    min-width: 0;
    align-self: stretch;
    align-items: stretch;
    gap: 6px;
    margin: 0;
    border: 0;
}

.public-app .public-tabs .tab-btn {
    position: relative;
    min-width: 104px;
    min-height: 76px;
    padding: 0 15px;
    background: transparent;
    border: 0;
    color: var(--public-muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
}

.public-app .public-tabs .tab-btn::after {
    position: absolute;
    right: 15px;
    bottom: -1px;
    left: 15px;
    height: 3px;
    background: transparent;
    content: "";
}

.public-app .public-tabs .tab-btn:hover,
.public-app .public-tabs .tab-btn.active {
    color: var(--public-ink);
}

.public-app .public-tabs .tab-btn.active::after {
    background: var(--public-coral);
}

.public-app .public-tabs .tab-btn:focus-visible,
.public-app .public-brand:focus-visible,
.public-app .text-link:focus-visible,
.public-app button:focus-visible,
.public-app input:focus-visible,
.public-app textarea:focus-visible {
    outline: 3px solid rgba(23, 107, 87, 0.22);
    outline-offset: 2px;
}

.public-app .public-main {
    width: min(100%, 1160px);
    margin: 0 auto;
    padding: 52px 24px 88px;
}

.public-app .tab-pane[hidden] {
    display: none !important;
}

.public-app .public-notice {
    position: fixed;
    z-index: 80;
    top: 92px;
    right: max(20px, calc((100vw - 1160px) / 2 + 24px));
    width: min(420px, calc(100vw - 40px));
    margin: 0;
    padding: 13px 15px;
    border: 1px solid var(--public-line-strong);
    border-left-width: 4px;
    border-radius: 6px;
    box-shadow: 0 12px 32px rgba(32, 37, 34, 0.13);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.public-app .notice-info {
    background: #eef5f6;
    border-color: #a9cdd0;
    border-left-color: #357d82;
    color: #245e62;
}

.public-app .notice-success {
    background: #edf7f1;
    border-color: #a9d0bb;
    border-left-color: var(--public-accent);
    color: var(--public-accent-dark);
}

.public-app .notice-warning {
    background: #fff7e8;
    border-color: #e7cb91;
    border-left-color: #b27413;
    color: #78500f;
}

.public-app .notice-danger {
    background: #fff0ed;
    border-color: #e6b4a8;
    border-left-color: #b84c34;
    color: #8d3827;
}

.public-app .workspace-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--public-line);
}

.public-app .workspace-kicker {
    margin: 0 0 9px;
    color: var(--public-coral);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
}

.public-app .workspace-heading h1 {
    margin: 0;
    color: var(--public-ink);
    font-size: 38px;
    font-weight: 760;
    line-height: 1.14;
}

.public-app .workspace-summary {
    max-width: 620px;
    margin: 12px 0 0;
    color: var(--public-muted);
    font-size: 15px;
    line-height: 1.7;
}

.public-app .workspace-state {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--public-line);
    border-radius: 6px;
    color: var(--public-muted);
    font-size: 12px;
    font-weight: 650;
}

.public-app .workspace-state span {
    width: 7px;
    height: 7px;
    background: #2d9168;
    border-radius: 50%;
}

.public-app .submit-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 56px;
    align-items: start;
    padding-top: 34px;
}

.public-app .public-form {
    display: grid;
    min-width: 0;
    gap: 24px;
}

.public-app .form-group {
    display: grid;
    min-width: 0;
    gap: 9px;
}

.public-app .form-group > label,
.public-app .field-label-row label,
.public-app .query-type-group legend {
    color: var(--public-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.public-app .field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.public-app .text-link {
    color: var(--public-accent);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.public-app .text-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.public-app .form-input {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    background: var(--public-surface);
    border: 1px solid var(--public-line-strong);
    border-radius: 6px;
    color: var(--public-ink);
    font-size: 14px;
    line-height: 1.5;
    box-shadow: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.public-app .form-input::placeholder {
    color: #969d98;
}

.public-app .form-input:hover {
    border-color: #8f9a93;
}

.public-app .form-input:focus {
    border-color: var(--public-accent);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(23, 107, 87, 0.12);
}

.public-app textarea.form-input,
.public-app .session-input {
    height: auto;
    min-height: 220px;
    padding: 14px;
    resize: vertical;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 13px;
    line-height: 1.65;
}

.public-app .field-help {
    margin: 0;
    color: var(--public-muted);
    font-size: 12px;
    line-height: 1.6;
}

.public-app .btn-primary,
.public-app .btn-secondary {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0 19px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 720;
    line-height: 1.2;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.public-app .btn-primary {
    background: var(--public-accent);
    border: 1px solid var(--public-accent);
    color: #ffffff;
}

.public-app .btn-primary:hover:not(:disabled) {
    background: var(--public-accent-dark);
    border-color: var(--public-accent-dark);
}

.public-app .btn-secondary {
    background: transparent;
    border: 1px solid var(--public-line-strong);
    color: var(--public-ink);
}

.public-app .btn-secondary:hover:not(:disabled) {
    background: #eff1ed;
    border-color: #929c95;
}

.public-app button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.public-app .submit-button {
    width: 100%;
    min-height: 50px;
}

.public-app .session-guide {
    min-width: 0;
    padding: 3px 0 3px 32px;
    border-left: 1px solid var(--public-line);
}

.public-app .session-guide h2 {
    margin: 0;
    color: var(--public-ink);
    font-size: 20px;
    line-height: 1.3;
}

.public-app .session-guide ol {
    display: grid;
    gap: 0;
    margin: 25px 0 0;
    padding: 0;
    list-style: none;
}

.public-app .session-guide li {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 13px;
    min-height: 70px;
}

.public-app .session-guide li:not(:last-child) span::after {
    position: absolute;
    top: 26px;
    bottom: -44px;
    left: 11px;
    width: 1px;
    background: var(--public-line);
    content: "";
}

.public-app .session-guide li span {
    position: relative;
    width: 24px;
    height: 24px;
    border: 1px solid var(--public-line-strong);
    border-radius: 50%;
    color: var(--public-accent);
    font-size: 9px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
}

.public-app .session-guide li p {
    margin: 1px 0 0;
    color: #444b47;
    font-size: 13px;
    line-height: 1.6;
}

.public-app .guide-note {
    margin: 10px 0 0;
    padding-top: 17px;
    border-top: 1px solid var(--public-line);
    color: var(--public-muted);
    font-size: 12px;
    line-height: 1.6;
}

.public-app .submission-result,
.public-app .inline-result {
    margin-top: 40px;
    padding: 26px 0;
    border-top: 1px solid var(--public-line);
    border-bottom: 1px solid var(--public-line);
}

.public-app .result-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.public-app .result-heading h2,
.public-app .inline-result h2,
.public-app .search-result-heading h2 {
    margin: 0;
    color: var(--public-ink);
    font-size: 20px;
    line-height: 1.35;
}

.public-app .success-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    background: #e7f3eb;
    border-radius: 50%;
    color: var(--public-accent);
    font-size: 17px;
    font-weight: 800;
}

.public-app .result-list {
    display: grid;
    min-width: 0;
    gap: 0;
    margin: 20px 0 0;
}

.public-app .result-list > div {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid #e8ebe8;
}

.public-app .result-list dt {
    color: var(--public-muted);
    font-size: 12px;
}

.public-app .result-list dd {
    min-width: 0;
    margin: 0;
    color: var(--public-ink);
    font-size: 13px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.public-app .result-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.public-app .query-panel {
    display: grid;
    gap: 27px;
    padding: 32px 0;
    border-bottom: 1px solid var(--public-line);
}

.public-app .query-type-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.public-app .query-type-group legend {
    margin-bottom: 10px;
}

.public-app .segmented-control {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    padding: 3px;
    background: #e9ece8;
    border-radius: 6px;
}

.public-app .segmented-control label {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.public-app .segmented-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.public-app .segmented-control span {
    display: grid;
    min-height: 38px;
    place-items: center;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--public-muted);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.public-app .segmented-control input:checked + span {
    background: var(--public-surface);
    border-color: var(--public-line);
    color: var(--public-ink);
    box-shadow: 0 1px 3px rgba(32, 37, 34, 0.08);
}

.public-app .segmented-control input:focus-visible + span {
    outline: 3px solid rgba(23, 107, 87, 0.22);
    outline-offset: 1px;
}

.public-app .query-entry-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 12px;
    align-items: end;
}

.public-app .query-entry-row .btn-primary {
    height: 48px;
}

.public-app .order-search-result {
    padding-top: 30px;
}

.public-app .search-result-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.public-app .search-result-heading p {
    margin: 0;
    color: var(--public-muted);
    font-size: 12px;
}

.public-app .order-result-list {
    display: grid;
    gap: 10px;
}

.public-app .order-result-row {
    position: relative;
    min-width: 0;
    padding: 17px 18px;
    background: var(--public-surface);
    border: 1px solid var(--public-line);
    border-radius: 6px;
}

.public-app .order-result-row .result-list {
    margin-top: 30px;
}

.public-app .order-status-chip {
    position: absolute;
    top: 16px;
    right: 18px;
    max-width: calc(100% - 36px);
    padding: 4px 8px;
    background: #fff1ed;
    border: 1px solid #e8b8aa;
    border-radius: 4px;
    color: #9a442f;
    font-size: 11px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.public-app .update-form {
    padding-top: 34px;
}

.public-app .update-credentials {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.public-app .inline-result {
    margin-top: 34px;
}

.public-app .public-footer {
    display: flex;
    width: min(100%, 1160px);
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 auto;
    padding: 24px;
    border-top: 1px solid var(--public-line);
    color: var(--public-muted);
    font-size: 11px;
}

.public-app .public-footer p {
    margin: 0;
    color: var(--public-ink);
    font-weight: 700;
}

@media (max-width: 780px) {
    .public-app .public-header-inner {
        min-height: auto;
        align-items: stretch;
        flex-direction: column;
        gap: 13px;
        padding: 14px 18px 0;
    }

    .public-app .public-tabs {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
    }

    .public-app .public-tabs .tab-btn {
        min-width: 0;
        min-height: 46px;
        padding: 0 6px;
        font-size: 13px;
        white-space: normal;
    }

    .public-app .public-tabs .tab-btn::after {
        right: 6px;
        left: 6px;
    }

    .public-app .public-main {
        padding: 34px 18px 64px;
    }

    .public-app .public-notice {
        top: 126px;
        right: 18px;
        width: calc(100vw - 36px);
    }

    .public-app .workspace-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .public-app .workspace-heading h1 {
        font-size: 31px;
    }

    .public-app .submit-workspace {
        grid-template-columns: minmax(0, 1fr);
        gap: 38px;
    }

    .public-app .session-guide {
        padding: 27px 0 0;
        border-top: 1px solid var(--public-line);
        border-left: 0;
    }

    .public-app .update-credentials {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .public-app .brand-mark {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .public-app .brand-copy strong {
        font-size: 15px;
    }

    .public-app .workspace-heading h1 {
        font-size: 28px;
    }

    .public-app .field-label-row,
    .public-app .search-result-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .public-app .segmented-control {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .public-app .segmented-control span {
        min-height: 40px;
        padding: 0 5px;
        font-size: 12px;
        white-space: normal;
        text-align: center;
    }

    .public-app .query-entry-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .public-app .query-entry-row .btn-primary {
        width: 100%;
    }

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

    .public-app .result-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-app .result-actions > button {
        min-width: 0;
        padding: 0 10px;
    }

    .public-app .public-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        padding: 20px 18px;
    }
}

/* Cosmic public portal, 2026-07-28 */
body.public-app.public-portal-theme {
    --portal-bg: #050a0e;
    --portal-surface: #0a131c;
    --portal-surface-strong: #0d1924;
    --portal-line: #223544;
    --portal-line-strong: #365063;
    --portal-ink: #f1f7f5;
    --portal-muted: #9aabb7;
    --portal-teal: #22d0ad;
    --portal-teal-dark: #11896f;
    --portal-coral: #e1755d;
    --portal-amber: #e7ba56;
    min-height: 100vh;
    background: var(--portal-bg);
    color: var(--portal-ink);
    font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

body.public-portal-theme .portal-hero {
    position: relative;
    height: min(760px, 82svh);
    min-height: 680px;
    overflow: hidden;
    background: #04090d;
    border-bottom: 1px solid #172936;
    isolation: isolate;
}

body.public-portal-theme .portal-hero::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: rgba(1, 6, 10, 0.1);
    content: "";
    pointer-events: none;
}

body.public-portal-theme .portal-hero-image {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

body.public-portal-theme .public-header.portal-header {
    position: relative;
    z-index: 5;
    top: auto;
    background: rgba(2, 8, 13, 0.55);
    border-bottom: 1px solid rgba(129, 187, 190, 0.16);
    backdrop-filter: blur(12px);
}

body.public-portal-theme .portal-header .public-header-inner {
    width: min(100%, 1200px);
    min-height: 76px;
    padding: 0 26px;
}

body.public-portal-theme .portal-header .public-brand {
    color: var(--portal-ink);
}

body.public-portal-theme .portal-header .brand-mark {
    background: rgba(34, 208, 173, 0.12);
    border: 1px solid rgba(34, 208, 173, 0.62);
    color: var(--portal-teal);
    box-shadow: 0 0 24px rgba(34, 208, 173, 0.16);
}

body.public-portal-theme .portal-header .brand-copy strong {
    color: var(--portal-ink);
}

body.public-portal-theme .portal-header .brand-copy small,
body.public-portal-theme .header-language {
    color: var(--portal-muted);
}

body.public-portal-theme .header-language {
    font-size: 13px;
}

body.public-portal-theme .portal-hero-inner {
    display: flex;
    width: min(100%, 1200px);
    height: calc(100% - 76px);
    flex-direction: column;
    justify-content: space-between;
    margin: 0 auto;
    padding: 76px 26px 34px;
}

body.public-portal-theme .portal-hero-copy {
    max-width: 660px;
}

body.public-portal-theme .portal-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 22px;
    padding: 8px 13px;
    background: rgba(4, 20, 25, 0.72);
    border: 1px solid rgba(34, 208, 173, 0.44);
    border-radius: 6px;
    color: var(--portal-teal);
    font-size: 13px;
    font-weight: 700;
}

body.public-portal-theme .portal-status i,
body.public-portal-theme .portal-action-heading > span i {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    background: var(--portal-teal);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(34, 208, 173, 0.85);
}

body.public-portal-theme .portal-hero-copy h1 {
    margin: 0;
    color: #eafbf8;
    font-size: 56px;
    font-weight: 800;
    line-height: 1.13;
    text-shadow: 0 3px 26px rgba(0, 0, 0, 0.45);
}

body.public-portal-theme .portal-hero-copy p {
    max-width: 610px;
    margin: 20px 0 0;
    color: #c0cdd5;
    font-size: 17px;
    font-weight: 560;
    line-height: 1.7;
}

body.public-portal-theme .portal-action-dock.public-tabs {
    display: block;
    width: 100%;
    align-self: auto;
    margin: 0;
    padding: 22px 24px 24px;
    background: rgba(5, 15, 25, 0.91);
    border: 1px solid rgba(83, 132, 157, 0.38);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(16px);
}

body.public-portal-theme .portal-action-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 18px;
}

body.public-portal-theme .portal-action-heading p {
    margin: 0 0 4px;
    color: var(--portal-teal);
    font-size: 11px;
    font-weight: 750;
}

body.public-portal-theme .portal-action-heading h2 {
    margin: 0;
    color: var(--portal-ink);
    font-size: 21px;
    line-height: 1.35;
}

body.public-portal-theme .portal-action-heading > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid rgba(231, 186, 86, 0.54);
    border-radius: 6px;
    color: var(--portal-amber);
    font-size: 11px;
    font-weight: 700;
}

body.public-portal-theme .portal-action-heading > span i {
    background: var(--portal-amber);
    box-shadow: 0 0 10px rgba(231, 186, 86, 0.65);
}

body.public-portal-theme .portal-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

body.public-portal-theme .portal-action-grid .tab-btn {
    display: grid;
    min-width: 0;
    min-height: 70px;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: border-color 160ms ease, filter 160ms ease, transform 160ms ease;
}

body.public-portal-theme .portal-action-grid .tab-btn::after {
    content: none;
}

body.public-portal-theme .portal-action-grid .tab-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

body.public-portal-theme .portal-action-grid .tab-btn.active {
    border-color: rgba(255, 255, 255, 0.72);
    box-shadow: 0 0 0 2px rgba(34, 208, 173, 0.13);
}

body.public-portal-theme .portal-action-grid .tab-btn small {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 50%;
    color: inherit;
    font-size: 9px;
    font-weight: 800;
}

body.public-portal-theme .portal-action-grid .tab-btn strong {
    min-width: 0;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body.public-portal-theme .portal-action-grid .action-submit {
    background: #14583f;
}

body.public-portal-theme .portal-action-grid .action-query {
    background: #0ca884;
}

body.public-portal-theme .portal-action-grid .action-update {
    background: #cbd7df;
    color: #162635;
}

body.public-portal-theme .portal-action-grid .action-update small {
    border-color: rgba(22, 38, 53, 0.38);
}

body.public-portal-theme .portal-action-grid .action-tutorial {
    background: #78399c;
}

body.public-portal-theme .portal-workspace.public-main {
    scroll-margin-top: 0;
    width: min(100%, 1200px);
    min-height: 560px;
    margin: 0 auto;
    padding: 60px 26px 90px;
    background: transparent;
}

body.public-portal-theme .portal-workspace .tab-pane {
    min-width: 0;
}

body.public-portal-theme .workspace-heading {
    border-bottom-color: var(--portal-line);
}

body.public-portal-theme .workspace-kicker {
    color: var(--portal-teal);
}

body.public-portal-theme .workspace-heading h1,
body.public-portal-theme .session-guide h2,
body.public-portal-theme .result-heading h2,
body.public-portal-theme .inline-result h2,
body.public-portal-theme .search-result-heading h2,
body.public-portal-theme .tutorial-steps h2 {
    color: var(--portal-ink);
}

body.public-portal-theme .workspace-summary,
body.public-portal-theme .field-help,
body.public-portal-theme .session-guide li p,
body.public-portal-theme .search-result-heading p,
body.public-portal-theme .tutorial-steps p,
body.public-portal-theme .tutorial-figure figcaption {
    color: var(--portal-muted);
}

body.public-portal-theme .workspace-state {
    border-color: var(--portal-line-strong);
    color: #b5c3cc;
}

body.public-portal-theme .workspace-state span {
    background: var(--portal-teal);
    box-shadow: 0 0 10px rgba(34, 208, 173, 0.65);
}

body.public-portal-theme .submit-workspace {
    gap: 50px;
}

body.public-portal-theme .form-group > label,
body.public-portal-theme .field-label-row label,
body.public-portal-theme .query-type-group legend {
    color: #dfe9ec;
}

body.public-portal-theme .form-input {
    background: var(--portal-surface);
    border-color: var(--portal-line-strong);
    color: var(--portal-ink);
}

body.public-portal-theme .form-input::placeholder {
    color: #677b89;
}

body.public-portal-theme .form-input:hover {
    border-color: #4f7185;
}

body.public-portal-theme .form-input:focus {
    border-color: var(--portal-teal);
    box-shadow: 0 0 0 3px rgba(34, 208, 173, 0.12);
}

body.public-portal-theme .text-link {
    color: var(--portal-teal);
}

body.public-portal-theme .btn-primary {
    background: var(--portal-teal-dark);
    border-color: var(--portal-teal-dark);
}

body.public-portal-theme .btn-primary:hover:not(:disabled) {
    background: #15a082;
    border-color: #15a082;
}

body.public-portal-theme .btn-secondary {
    background: transparent;
    border-color: var(--portal-line-strong);
    color: #dce7eb;
}

body.public-portal-theme .btn-secondary:hover:not(:disabled) {
    background: var(--portal-surface-strong);
    border-color: #54768a;
}

body.public-portal-theme .session-guide {
    border-left-color: var(--portal-line);
}

body.public-portal-theme .session-guide li:not(:last-child) span::after {
    background: var(--portal-line);
}

body.public-portal-theme .session-guide li span {
    border-color: var(--portal-line-strong);
    color: var(--portal-teal);
}

body.public-portal-theme .guide-tutorial-btn {
    width: 100%;
    margin-top: 14px;
}

body.public-portal-theme .submission-result,
body.public-portal-theme .inline-result,
body.public-portal-theme .query-panel {
    border-color: var(--portal-line);
}

body.public-portal-theme .submission-result {
    background: #0a241e;
    border-color: #227d67;
}

body.public-portal-theme .success-mark {
    background: rgba(34, 208, 173, 0.12);
    color: var(--portal-teal);
}

body.public-portal-theme .result-list > div {
    border-bottom-color: #1a2b37;
}

body.public-portal-theme .result-list dt {
    color: var(--portal-muted);
}

body.public-portal-theme .result-list dd {
    color: #e6eff1;
}

body.public-portal-theme .segmented-control {
    background: #101d27;
    border: 1px solid var(--portal-line);
}

body.public-portal-theme .segmented-control span {
    color: var(--portal-muted);
}

body.public-portal-theme .segmented-control input:checked + span {
    background: #1a2a35;
    border-color: #405b6d;
    color: var(--portal-ink);
    box-shadow: none;
}

body.public-portal-theme .order-result-row {
    background: var(--portal-surface);
    border-color: var(--portal-line);
}

body.public-portal-theme .order-status-chip {
    background: rgba(225, 117, 93, 0.12);
    border-color: rgba(225, 117, 93, 0.45);
    color: #f2a28e;
}

body.public-portal-theme .public-notice {
    top: 22px;
    background: #0c1a23;
    border-color: #3a5868;
    color: #dce8ec;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}

body.public-portal-theme .notice-success {
    background: #0a241e;
    border-color: #227d67;
    border-left-color: var(--portal-teal);
    color: #a5ead9;
}

body.public-portal-theme .notice-warning {
    background: #2a2110;
    border-color: #8c6b2a;
    border-left-color: var(--portal-amber);
    color: #efd797;
}

body.public-portal-theme .notice-danger {
    background: #2a1514;
    border-color: #8e493d;
    border-left-color: var(--portal-coral);
    color: #f2b0a2;
}

body.public-portal-theme .tutorial-session-link {
    flex: 0 0 auto;
    text-decoration: none;
}

body.public-portal-theme .tutorial-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 34px 0 42px;
    padding: 0;
    border-top: 1px solid var(--portal-line);
    border-bottom: 1px solid var(--portal-line);
    list-style: none;
}

body.public-portal-theme .tutorial-steps li {
    display: grid;
    min-width: 0;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    padding: 24px 20px;
    border-right: 1px solid var(--portal-line);
}

body.public-portal-theme .tutorial-steps li:first-child {
    padding-left: 0;
}

body.public-portal-theme .tutorial-steps li:last-child {
    padding-right: 0;
    border-right: 0;
}

body.public-portal-theme .tutorial-steps > li > span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(34, 208, 173, 0.46);
    border-radius: 50%;
    color: var(--portal-teal);
    font-size: 9px;
    font-weight: 800;
}

body.public-portal-theme .tutorial-steps h2 {
    margin: 2px 0 7px;
    font-size: 14px;
    line-height: 1.4;
}

body.public-portal-theme .tutorial-steps p {
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
}

body.public-portal-theme .tutorial-figure {
    margin: 0;
    padding: 14px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-line);
    border-radius: 8px;
}

body.public-portal-theme .tutorial-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 5px;
}

body.public-portal-theme .tutorial-figure figcaption {
    padding: 12px 2px 1px;
    font-size: 11px;
}

body.public-portal-theme .portal-footer.public-footer {
    width: min(100%, 1200px);
    border-top-color: var(--portal-line);
    color: #70828e;
}

body.public-portal-theme .portal-footer p {
    color: #b9c6cc;
}

@media (max-width: 900px) {
    body.public-portal-theme .portal-hero {
        height: min(760px, 86svh);
        min-height: 700px;
    }

    body.public-portal-theme .portal-hero-image {
        object-position: 62% center;
    }

    body.public-portal-theme .portal-hero-inner {
        padding-top: 58px;
    }

    body.public-portal-theme .portal-hero-copy h1 {
        font-size: 48px;
    }

    body.public-portal-theme .portal-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.public-portal-theme .portal-action-grid .tab-btn {
        min-height: 58px;
    }

    body.public-portal-theme .tutorial-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.public-portal-theme .tutorial-steps li:nth-child(2) {
        border-right: 0;
    }

    body.public-portal-theme .tutorial-steps li:nth-child(-n + 2) {
        border-bottom: 1px solid var(--portal-line);
    }

    body.public-portal-theme .tutorial-steps li:first-child,
    body.public-portal-theme .tutorial-steps li:last-child {
        padding: 24px 20px;
    }
}

@media (max-width: 600px) {
    body.public-portal-theme .portal-hero {
        height: 720px;
        min-height: 720px;
    }

    body.public-portal-theme .portal-hero-image {
        object-position: 67% center;
        opacity: 0.74;
    }

    body.public-portal-theme .portal-header .public-header-inner {
        min-height: 68px;
        align-items: center;
        flex-direction: row;
        padding: 0 18px;
    }

    body.public-portal-theme .portal-header .brand-mark {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    body.public-portal-theme .portal-header .brand-copy strong {
        max-width: 210px;
        font-size: 14px;
    }

    body.public-portal-theme .portal-header .brand-copy small,
    body.public-portal-theme .header-language {
        display: none;
    }

    body.public-portal-theme .portal-hero-inner {
        height: calc(100% - 68px);
        padding: 46px 18px 18px;
    }

    body.public-portal-theme .portal-status {
        margin-bottom: 16px;
        font-size: 12px;
    }

    body.public-portal-theme .portal-hero-copy h1 {
        font-size: 38px;
    }

    body.public-portal-theme .portal-hero-copy p {
        max-width: 330px;
        margin-top: 14px;
        font-size: 14px;
    }

    body.public-portal-theme .portal-action-dock.public-tabs {
        padding: 16px;
    }

    body.public-portal-theme .portal-action-heading {
        align-items: flex-start;
        margin-bottom: 13px;
    }

    body.public-portal-theme .portal-action-heading h2 {
        font-size: 16px;
    }

    body.public-portal-theme .portal-action-heading > span {
        padding: 5px 7px;
        font-size: 9px;
    }

    body.public-portal-theme .portal-action-grid {
        gap: 8px;
    }

    body.public-portal-theme .portal-action-grid .tab-btn {
        min-height: 54px;
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 7px;
        padding: 0 9px;
    }

    body.public-portal-theme .portal-action-grid .tab-btn small {
        width: 23px;
        height: 23px;
        font-size: 8px;
    }

    body.public-portal-theme .portal-action-grid .tab-btn strong {
        font-size: 12px;
    }

    body.public-portal-theme .portal-workspace.public-main {
        padding: 42px 18px 68px;
    }

    body.public-portal-theme .session-guide {
        border-top-color: var(--portal-line);
    }

    body.public-portal-theme .workspace-heading {
        gap: 14px;
    }

    body.public-portal-theme .workspace-heading h1 {
        font-size: 28px;
    }

    body.public-portal-theme .tutorial-session-link {
        width: 100%;
    }

    body.public-portal-theme .tutorial-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    body.public-portal-theme .tutorial-steps li,
    body.public-portal-theme .tutorial-steps li:first-child,
    body.public-portal-theme .tutorial-steps li:last-child {
        padding: 18px 0;
        border-right: 0;
        border-bottom: 1px solid var(--portal-line);
    }

    body.public-portal-theme .tutorial-steps li:last-child {
        border-bottom: 0;
    }

    body.public-portal-theme .tutorial-figure {
        padding: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.public-portal-theme *,
    body.public-portal-theme *::before,
    body.public-portal-theme *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* CDK-first public submission, 2026-07-29 */
body.public-portal-theme .submit-stage {
    display: grid;
    min-width: 0;
    gap: 20px;
}

body.public-portal-theme .submit-stage[hidden],
body.public-portal-theme .cdk-verify-status[hidden] {
    display: none;
}

body.public-portal-theme .session-submit-stage {
    padding-top: 28px;
    border-top: 1px solid var(--portal-line);
}

body.public-portal-theme .submit-stage-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

body.public-portal-theme .submit-stage-number {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border: 1px solid var(--portal-line-strong);
    border-radius: 50%;
    color: var(--portal-teal);
    font-size: 10px;
    font-weight: 800;
}

body.public-portal-theme .submit-stage-heading p {
    margin: 0 0 2px;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 700;
}

body.public-portal-theme .submit-stage-heading h2 {
    margin: 0;
    color: var(--portal-ink);
    font-size: 20px;
    line-height: 1.25;
}

body.public-portal-theme .cdk-verify-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    min-width: 0;
    align-items: end;
    gap: 12px;
}

body.public-portal-theme .cdk-verify-row #verify-cdk-btn {
    width: 100%;
    min-height: 50px;
}

body.public-portal-theme .cdk-verify-status {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    min-width: 0;
    align-items: center;
    gap: 11px;
    padding: 13px 15px;
    border: 1px solid rgba(34, 208, 173, 0.38);
    background: rgba(34, 208, 173, 0.07);
}

body.public-portal-theme .cdk-verify-status > span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: rgba(34, 208, 173, 0.16);
    color: var(--portal-teal);
    font-weight: 800;
}

body.public-portal-theme .cdk-verify-status div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

body.public-portal-theme .cdk-verify-status strong {
    color: var(--portal-ink);
    font-size: 13px;
}

body.public-portal-theme .cdk-verify-status small {
    color: var(--portal-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    body.public-portal-theme .cdk-verify-row {
        grid-template-columns: minmax(0, 1fr);
    }

    body.public-portal-theme .cdk-verify-row #verify-cdk-btn {
        min-height: 48px;
    }

    body.public-portal-theme .session-submit-stage {
        padding-top: 24px;
    }
}
/* Plus card pool and loopback payment workspace */
.payment-desktop-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-top: 12px;
    text-decoration: none;
}

.payment-instruments-table-container {
    width: 100%;
    overflow-x: auto;
}

.payment-instruments-table {
    min-width: 980px;
}

.instrument-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 156px;
}

.payment-instrument-modal-panel {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.payment-instrument-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.payment-instrument-form-grid .form-group {
    min-width: 0;
    margin: 0;
}

.payment-instrument-form-grid .form-span-2 {
    grid-column: 1 / -1;
}

@media (max-width: 680px) {
    .payment-instrument-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .payment-instrument-form-grid .form-span-2 {
        grid-column: auto;
    }
}
