:root {
    color-scheme: light;
    --bg: #f4f1ea;
    --surface: #ffffff;
    --surface-2: #f8faf7;
    --ink: #18212f;
    --muted: #687386;
    --line: #d9ded6;
    --navy: #133a5e;
    --blue: #1769aa;
    --blue-dark: #0d4d82;
    --green: #087f5b;
    --amber: #b7791f;
    --red: #b42318;
    --shadow: 0 20px 50px rgba(24, 33, 47, 0.12);
}

/* Administrator document library and prospect CRM */
.crm-page-head,
.admin-document-library .section-head {
    align-items: center;
}

.crm-head-actions,
.admin-document-actions,
.crm-export-actions,
.crm-filter-actions,
.crm-title-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.admin-document-card {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 16px;
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
}

.admin-document-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #e8f3fa;
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 900;
}

.admin-document-card h2 {
    margin-bottom: 8px;
}

.admin-document-card .eyebrow {
    margin-bottom: 6px;
}

.admin-document-meta {
    display: grid;
    gap: 6px;
    margin: 0;
}

.admin-document-meta div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    font-size: 12px;
}

.admin-document-meta dt {
    color: var(--muted);
}

.admin-document-meta dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.admin-document-actions .button {
    flex: 1 1 120px;
}

.admin-document-note {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid #b9dfd2;
    border-radius: 9px;
    background: #effaf6;
    color: #175c48;
    font-size: 13px;
}

.crm-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 24px 0 16px;
}

.crm-metric-card {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--blue);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink);
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.crm-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(19, 58, 94, 0.10);
}

.crm-metric-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.crm-metric-card strong {
    font-size: 24px;
    line-height: 1;
}

.crm-metric-card.is-new { border-top-color: #4388c7; }
.crm-metric-card.is-hot { border-top-color: #dc2626; }
.crm-metric-card.is-due { border-top-color: #d97706; }
.crm-metric-card.is-converted { border-top-color: var(--green); }

.crm-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.crm-action-panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}

.crm-action-panel > summary,
.crm-export-copy {
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}

.crm-action-panel > summary::-webkit-details-marker,
.crm-composer > summary::-webkit-details-marker {
    display: none;
}

.crm-action-panel > summary span:last-child,
.crm-export-copy > span:last-child,
.crm-composer > summary > span:first-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.crm-action-panel summary small,
.crm-export-copy small,
.crm-composer summary small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.crm-summary-icon {
    display: inline-flex;
    width: 32px;
    min-width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #e8f3fa;
    color: var(--blue-dark);
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.crm-action-panel[open] > summary {
    border-bottom: 1px solid var(--line);
}

.crm-action-form {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.crm-action-form label,
.crm-filter-form label,
.crm-profile-form label,
.crm-email-form label,
.crm-danger-zone label {
    gap: 4px;
    font-size: 12px;
}

.crm-action-form input,
.crm-action-form select,
.crm-action-form textarea,
.crm-filter-form input,
.crm-filter-form select,
.crm-profile-form input,
.crm-profile-form select,
.crm-profile-form textarea,
.crm-email-form input,
.crm-email-form textarea,
.crm-danger-zone input {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 13px;
}

.crm-action-panel[open] {
    grid-column: span 2;
}

.crm-action-panel[open] + .crm-action-panel[open] {
    grid-column: span 3;
}

.crm-form-grid {
    gap: 11px;
}

.crm-span-two {
    grid-column: 1 / -1;
}

.crm-import-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.crm-import-heading p {
    margin: 0;
    font-size: 12px;
}

.tiny-link {
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.crm-export-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-right: 12px;
}

.crm-filter-form {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}

.crm-filter-grid {
    display: grid;
    grid-template-columns: minmax(190px, 1.7fr) repeat(6, minmax(100px, 1fr));
    gap: 9px;
}

.crm-filter-actions {
    margin-top: 10px;
}

.crm-filter-actions .muted {
    margin-left: auto;
    font-size: 12px;
}

.crm-lead-table table {
    min-width: 1010px;
    font-size: 12px;
    line-height: 1.35;
}

.crm-lead-table th,
.crm-lead-table td {
    padding: 8px 9px;
}

.crm-lead-table th:first-child { width: 28%; }
.crm-lead-table th:nth-child(2) { width: 12%; }
.crm-lead-table th:nth-child(3) { width: 15%; }
.crm-lead-table th:nth-child(4) { width: 15%; }
.crm-lead-table th:nth-child(5) { width: 20%; }
.crm-lead-table th:last-child { width: 10%; }

.crm-lead-table td > span,
.crm-lead-table td > small,
.crm-contact-link {
    display: block;
}

.crm-lead-table td > small,
.crm-lead-table td span + span {
    margin-top: 2px;
}

.crm-lead-name {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.crm-contact-link {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-status-stack {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
}

.crm-badge {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    align-items: center;
    min-height: 22px;
    padding: 3px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.1;
}

.crm-stage-new { background: #e8f3fa; color: #145d92; border-color: #c9e1f2; }
.crm-stage-contacted { background: #eef2ff; color: #4338ca; border-color: #d8ddff; }
.crm-stage-nurturing { background: #f4edff; color: #7142a7; border-color: #e5d5f8; }
.crm-stage-qualified { background: #ecfdf3; color: #087f5b; border-color: #b7e8d2; }
.crm-stage-proposal { background: #fff6df; color: #9a5c05; border-color: #f1d89a; }
.crm-stage-converted { background: #e5f8ef; color: #08724f; border-color: #addfc9; }
.crm-stage-lost,
.crm-suppressed,
.crm-status-failed { background: #fff0f0; color: #a51d14; border-color: #f2c2bf; }
.crm-temperature-cold { background: #eff6ff; color: #1d5f9b; border-color: #c9def4; }
.crm-temperature-warm { background: #fff7e8; color: #a46007; border-color: #f1d8a7; }
.crm-temperature-hot { background: #ffecec; color: #c1261d; border-color: #efb8b4; }
.crm-status-accepted { background: #e7f7ef; color: #08724f; border-color: #b4dfca; }
.crm-status-opened { background: #e9f8ff; color: #075f8f; border-color: #a9daee; }

.crm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.crm-tags span {
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef2f5;
    color: #425466;
    font-size: 9.5px;
    font-weight: 800;
}

.crm-due-row td {
    background: #fffaf0 !important;
}

.crm-follow-up.is-due,
.crm-error-text {
    color: var(--red);
    font-weight: 900;
}

.crm-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
}

.crm-pagination > div {
    display: flex;
    gap: 6px;
}

.button.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.crm-empty-state {
    display: grid;
    gap: 3px;
}

.crm-lead-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0 16px;
}

.crm-lead-overview > div {
    display: grid;
    align-content: start;
    gap: 3px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}

.crm-lead-overview span,
.crm-lead-overview small {
    color: var(--muted);
    font-size: 10px;
}

.crm-lead-overview strong,
.crm-lead-overview a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(280px, 0.85fr);
    align-items: start;
    gap: 16px;
}

.crm-detail-main,
.crm-detail-sidebar {
    display: grid;
    min-width: 0;
    gap: 16px;
}

.crm-section-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-2);
}

.crm-primary-contact {
    display: grid;
    grid-template-columns: auto minmax(9rem, 1fr) minmax(12rem, 1.4fr) auto;
    gap: .65rem;
    align-items: center;
    padding: .75rem;
    margin: .75rem 0;
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface-soft);
}

.crm-contact-list {
    display: grid;
    gap: .75rem;
}

.crm-contact-form {
    padding: .8rem;
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface);
}

.crm-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
}

.crm-contact-grid label {
    font-size: .78rem;
}

.crm-contact-grid input,
.crm-contact-grid textarea {
    margin-top: .25rem;
}

.crm-contact-actions {
    display: flex;
    gap: .45rem;
    justify-content: flex-end;
    margin-top: .65rem;
}

.crm-add-contact {
    margin-top: .85rem;
}

.crm-add-contact > summary {
    cursor: pointer;
    font-weight: 700;
    margin-bottom: .65rem;
}

@media (max-width: 700px) {
    .crm-primary-contact,
    .crm-contact-grid {
        grid-template-columns: 1fr;
    }

    .crm-contact-grid .crm-span-two {
        grid-column: auto;
    }
}

.crm-section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
}

.crm-section-heading .eyebrow {
    margin-bottom: 5px;
}

.crm-section-heading > span {
    color: var(--muted);
    font-size: 10px;
    text-align: right;
}

.crm-profile-form,
.crm-email-form,
.crm-note-form,
.crm-danger-zone form {
    display: grid;
    gap: 12px;
}

.crm-smtp-state {
    display: grid;
    gap: 2px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 12px;
}

.crm-smtp-state.is-ready {
    border-color: #b4dfca;
    background: #ecf9f3;
    color: #176249;
}

.crm-smtp-state.is-blocked {
    border-color: #f0cf9c;
    background: #fff8e9;
    color: #8a5108;
}

.crm-inline-alert {
    margin-bottom: 12px;
}

.crm-compose-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.crm-template-help {
    margin: 12px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.crm-composer {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
}

.crm-composer[open] {
    grid-column: 1 / -1;
}

.crm-composer > summary {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
}

.crm-template-title {
    display: flex !important;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.crm-template-title em {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid #cce4df;
    border-radius: 999px;
    background: #edf8f5;
    color: #087865;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .35px;
    text-transform: uppercase;
}

body.theme-dark .crm-template-title em {
    border-color: #275b52;
    background: #163d37;
    color: #8fe1d1;
}

.crm-compose-arrow {
    font-size: 24px;
    transform: rotate(0deg);
    transition: transform 150ms ease;
}

.crm-composer[open] .crm-compose-arrow {
    transform: rotate(90deg);
}

.crm-email-form {
    padding: 0 13px 13px;
}

.crm-email-form textarea {
    font-family: inherit;
    line-height: 1.45;
}

.crm-preview-email {
    justify-self: start;
}

.crm-confirm-row {
    display: flex !important;
    align-items: flex-start;
    padding: 10px !important;
    font-weight: 600;
}

.crm-confirm-row input {
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 2px 0 0;
    padding: 0;
}

.crm-send-confirmation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.crm-history-heading,
.crm-history-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.crm-history-heading {
    margin-top: 20px;
}

.crm-history-heading h3 {
    margin: 0;
    font-size: 15px;
}

.crm-history-heading span {
    color: var(--muted);
    font-size: 11px;
}

.crm-communication-list,
.crm-note-list,
.crm-activity-list {
    display: grid;
    gap: 9px;
    margin-top: 10px;
}

.crm-communication-item {
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.crm-communication-status {
    border-radius: 999px;
    background: var(--red);
}

.crm-communication-status.is-accepted {
    background: var(--green);
}

.crm-communication-item p {
    margin: 4px 0 2px;
    color: var(--muted);
    font-size: 11px;
}

.crm-communication-item small {
    display: block;
    overflow-wrap: anywhere;
}

.crm-message-copy {
    margin-top: 7px;
    font-size: 11px;
}

.crm-message-copy summary {
    cursor: pointer;
    color: var(--blue);
    font-weight: 800;
}

.crm-message-copy pre {
    max-height: 220px;
    overflow: auto;
    padding: 9px;
    border-radius: 7px;
    background: var(--surface-2);
    white-space: pre-wrap;
}

.crm-note-form textarea {
    min-height: 92px;
    padding: 8px 9px;
    font-size: 12px;
}

.crm-note-form .button {
    justify-self: start;
}

.crm-note-list article {
    padding-top: 9px;
    border-top: 1px solid var(--line);
}

.crm-note-list p {
    margin-bottom: 4px;
    font-size: 12px;
}

.crm-note-list small,
.crm-activity-list small {
    display: block;
    color: var(--muted);
    font-size: 9.5px;
}

.crm-activity-list article {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 9px;
}

.crm-activity-list article > span {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border: 2px solid var(--surface-2);
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 1px var(--blue);
}

.crm-activity-list strong {
    display: block;
    font-size: 11px;
}

.crm-danger-zone > summary {
    cursor: pointer;
    color: var(--red);
    font-weight: 900;
}

.crm-danger-zone p {
    margin: 10px 0;
    font-size: 11px;
}

.crm-danger-zone input {
    font-size: 12px;
}

button:disabled,
.button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.theme-dark .admin-document-icon,
.theme-dark .crm-summary-icon,
.theme-dark .crm-tags span {
    background: #243244;
    color: #d7ecff;
}

.theme-dark .admin-document-note,
.theme-dark .crm-smtp-state.is-ready {
    border-color: #265d4d;
    background: #142c25;
    color: #a7e7cf;
}

.theme-dark .crm-smtp-state.is-blocked,
.theme-dark .crm-due-row td {
    border-color: #66502d;
    background: #2b2418 !important;
    color: #f0cf91;
}

@media (max-width: 1000px) {
    .admin-document-grid,
    .crm-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-action-panel[open],
    .crm-action-panel[open] + .crm-action-panel[open] {
        grid-column: 1 / -1;
    }

    .crm-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .crm-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .crm-filter-search {
        grid-column: span 2;
    }

    .crm-lead-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-detail-grid {
        grid-template-columns: 1fr;
    }

    .crm-detail-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .crm-page-head,
    .admin-document-library .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-head-actions .button {
        flex: 1 1 140px;
    }

    .admin-document-grid,
    .crm-action-grid,
    .crm-filter-grid,
    .crm-compose-grid,
    .crm-send-confirmation,
    .crm-detail-sidebar {
        grid-template-columns: 1fr;
    }

    .crm-action-panel[open],
    .crm-action-panel[open] + .crm-action-panel[open],
    .crm-filter-search,
    .crm-composer[open] {
        grid-column: auto;
    }

    .crm-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-metric-card:last-child {
        grid-column: 1 / -1;
    }

    .crm-export-panel,
    .crm-import-heading,
    .crm-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-export-panel {
        padding-right: 0;
        padding-bottom: 12px;
    }

    .crm-export-actions {
        padding: 0 12px;
    }

    .crm-export-actions .button {
        flex: 1 1 0;
    }

    .crm-filter-actions .muted {
        width: 100%;
        margin-left: 0;
    }

    .crm-lead-overview {
        grid-template-columns: 1fr;
    }

    .crm-lead-table {
        overflow: visible;
        border: 0;
        background: transparent;
    }

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

    .crm-lead-table thead {
        display: none;
    }

    .crm-lead-table tr {
        margin-bottom: 10px;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--surface);
    }

    .crm-lead-table td,
    .crm-lead-table tr:nth-child(even) td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 10px;
        background: transparent;
        border-bottom: 1px solid var(--line);
    }

    .crm-lead-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .crm-lead-table td:last-child {
        border-bottom: 0;
    }

    .crm-lead-table td:last-child .button {
        justify-self: start;
    }

    .crm-contact-link {
        max-width: 100%;
    }

    .crm-pagination > div {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-pagination .button {
        width: 100%;
    }

    .crm-section-card {
        padding: 14px;
    }

    .crm-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .crm-section-heading > span {
        text-align: left;
    }
}

body.theme-dark {
    color-scheme: dark;
    --bg: #0f141b;
    --surface: #171d26;
    --surface-2: #202734;
    --ink: #edf2f7;
    --muted: #a6b0bf;
    --line: #2d3746;
    --navy: #6bb6ff;
    --blue: #62a8ea;
    --blue-dark: #8ec5ff;
    --green: #6ee7b7;
    --amber: #f4c76b;
    --red: #ff8a80;
    --shadow: 0 20px 54px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 34px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(217, 222, 214, 0.9);
    backdrop-filter: blur(14px);
}

.theme-dark .topbar {
    background: rgba(23, 29, 38, 0.94);
    border-bottom-color: var(--line);
}

.news-ticker {
    position: relative;
    z-index: 19;
    display: flex;
    align-items: center;
    width: 100%;
    height: 25px;
    overflow: hidden;
    color: #ffffff;
    background: #24272b;
    font-size: 12px;
    font-weight: 700;
    line-height: 25px;
    white-space: nowrap;
}

.news-ticker-track {
    display: inline-block;
    min-width: max-content;
    padding: 0 10px;
    white-space: nowrap;
    animation: news-ticker-right-to-left 22s linear infinite;
    will-change: transform;
}

.news-ticker:hover .news-ticker-track {
    animation-play-state: paused;
}

@keyframes news-ticker-right-to-left {
    from {
        transform: translateX(100vw);
    }
    to {
        transform: translateX(-100%);
    }
}

.admin-news-ticker-settings {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding: 18px;
}

.admin-news-ticker-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.admin-news-ticker-header .eyebrow {
    margin: 0 0 3px;
}

.admin-news-ticker-header h2 {
    margin: 0;
    line-height: 1.2;
}

.admin-news-ticker-status {
    flex: 0 0 auto;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef4f8;
    color: var(--blue-dark);
    font-size: 11px;
    font-weight: 900;
}

.theme-dark .admin-news-ticker-status {
    background: #243244;
    color: #d7ecff;
}

.admin-news-ticker-settings form,
.admin-news-ticker-settings label {
    display: grid;
    gap: 7px;
    margin: 0;
}

.admin-news-ticker-settings input {
    margin: 0;
}

.admin-news-ticker-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 4px;
}

.admin-news-ticker-actions button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 12px;
}

.admin-news-ticker-actions .mini-note {
    margin: 0;
    line-height: 1.35;
}

@media (max-width: 720px) {
    .admin-news-ticker-settings {
        padding: 14px;
    }

    .admin-news-ticker-header {
        align-items: center;
    }

    .admin-news-ticker-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-ticker-track {
        animation: none;
        transform: none;
    }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.brand-label {
    display: inline-block;
    max-width: min(42vw, 520px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-mark {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(19, 58, 94, 0.16);
}

.brand-mark img {
    display: block;
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
}

nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 40px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    border-radius: 8px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
    transition: transform 160ms ease, opacity 160ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

nav a,
nav button {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

nav a.active {
    background: #eef4f8;
    color: var(--blue-dark);
}

.theme-dark nav a.active {
    background: #243244;
    color: #d7ecff;
}

nav .nav-cta {
    background: var(--ink);
    color: #ffffff;
}

.theme-dark nav .nav-cta {
    background: #edf2f7;
    color: #111827;
}

nav form,
.actions form {
    margin: 0;
}

.page {
    width: min(1180px, calc(100% - 36px));
    margin: 30px auto 32px;
}

.view-home .page {
    width: 100%;
    margin-top: 0;
}

.panel {
    background: var(--surface);
    border: 1px solid rgba(217, 222, 214, 0.95);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto 18px;
    color: var(--muted);
    font-size: 12px;
}

.site-footer a {
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--blue);
}

.auto-mapper-page {
    overflow: hidden;
}

.auto-mapper-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.auto-mapper-lead {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 18px;
}

.auto-mapper-count {
    display: grid;
    min-width: 174px;
    padding-left: 22px;
    border-left: 4px solid var(--green);
}

.auto-mapper-count strong {
    color: var(--navy);
    font-size: 40px;
    line-height: 1;
}

.auto-mapper-count span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.auto-mapper-principle {
    display: grid;
    grid-template-columns: minmax(180px, 0.38fr) minmax(0, 1fr);
    gap: 24px;
    margin: 24px 0 30px;
    padding: 18px 20px;
    border-left: 4px solid var(--blue);
    background: var(--surface-2);
}

.auto-mapper-principle span {
    color: var(--muted);
}

.mapper-flow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 14px 0 30px;
    padding: 1px;
    list-style: none;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.mapper-flow li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    min-height: 130px;
    padding: 18px;
    background: var(--surface);
}

.mapper-flow li > span {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-weight: 900;
}

.mapper-flow strong,
.mapper-flow small {
    display: block;
}

.mapper-flow small {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
}

.mapper-safety-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 0 -28px 30px;
    padding: 24px 28px;
    background: #12334d;
    color: #fff;
}

.theme-dark .mapper-safety-band {
    background: #0a2639;
}

.mapper-safety-band div {
    padding-left: 14px;
    border-left: 3px solid #45d6ad;
}

.mapper-safety-band strong,
.mapper-safety-band span {
    display: block;
}

.mapper-safety-band span {
    margin-top: 5px;
    color: #c9d8e3;
    font-size: 13px;
}

.auto-mapper-table-title {
    align-items: flex-end;
}

.auto-mapper-table-title h2,
.auto-mapper-table-title p {
    margin-bottom: 0;
}

.auto-mapper-table code,
.mapper-subject-note code {
    color: var(--navy);
    font-weight: 900;
}

.alias-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.alias-list span {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}

.mapper-subject-note {
    margin: 16px 0 0;
    color: var(--muted);
}

.mapping-method,
.confidence-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.method-exact,
.method-official {
    border-color: rgba(8, 127, 91, 0.35);
    background: rgba(8, 127, 91, 0.09);
    color: var(--green);
}

.method-alias {
    border-color: rgba(23, 105, 170, 0.35);
    background: rgba(23, 105, 170, 0.09);
    color: var(--blue-dark);
}

.method-configured,
.method-saved {
    border-color: rgba(183, 121, 31, 0.35);
    background: rgba(183, 121, 31, 0.09);
    color: var(--amber);
}

.method-stale_saved {
    border-color: rgba(180, 35, 24, 0.35);
    color: var(--red);
}

.detection-summary {
    display: grid;
    grid-template-columns: 160px 160px minmax(0, 1fr);
    gap: 1px;
    margin: 22px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.detection-summary > div {
    display: grid;
    gap: 5px;
    padding: 16px;
    background: var(--surface-2);
}

.detection-summary span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.mapping-analysis-band,
.reconciliation-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 22px 0 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.mapping-analysis-band > div,
.reconciliation-metrics > div {
    display: grid;
    align-content: start;
    gap: 4px;
    min-height: 92px;
    padding: 15px;
    background: var(--surface-2);
}

.mapping-analysis-band span,
.reconciliation-metrics span,
.quality-score span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.mapping-analysis-band strong,
.reconciliation-metrics strong {
    color: var(--navy);
    font-size: 22px;
}

.mapping-analysis-band small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.mapping-analysis-band .quality-score {
    background: #12334d;
}

.mapping-analysis-band .quality-score span {
    color: #c9d8e3;
}

.mapping-analysis-band .quality-score strong {
    color: #ffffff;
    font-size: 30px;
}

.mapping-source-title {
    align-items: flex-start;
    margin-top: 22px;
}

.mapping-source-title h2,
.mapping-source-title p {
    margin-bottom: 0;
}

.mapping-source-headers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 7px;
    margin: 10px 0 22px;
}

.mapping-source-profile {
    margin: 14px 0 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    padding: 12px 14px;
}

.mapping-source-profile summary {
    cursor: pointer;
    font-weight: 800;
}

.mapping-source-profile > p {
    margin: 8px 0 10px;
}

.mapping-sample-values {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mapping-sample-values code {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mapping-source-header {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
}

.mapping-header-edit-form {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 5px;
    min-width: 0;
    margin: 0;
}

.mapping-header-edit-form input[type="text"] {
    width: 100%;
    min-width: 0;
    padding: 6px 7px;
    font-size: 12px;
}

.mapping-header-delete-form {
    display: flex;
    margin: 0;
}

.header-action-button {
    min-height: 0;
    padding: 6px 7px;
    font-size: 10px;
    line-height: 1;
}

.quality-components {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 22px;
}

.quality-components span {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
}

.quality-components strong {
    color: var(--ink);
}

.reconciliation-summary {
    margin: 24px -28px;
    padding: 24px 28px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.reconciliation-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.reconciliation-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.reconciliation-details > div {
    padding-left: 14px;
    border-left: 3px solid var(--blue);
}

.reconciliation-details p,
.reconciliation-details ul {
    margin: 6px 0 0;
    color: var(--muted);
}

.integrity-blockers {
    display: grid;
    gap: 10px;
    margin: 22px 0;
}

.integrity-blockers > div {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border-left: 4px solid var(--red);
    background: rgba(180, 35, 24, 0.08);
}

.integrity-blockers strong {
    color: var(--red);
}

.migration-package-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 26px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.migration-package-flow > div {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 5px 10px;
    min-height: 126px;
    padding: 18px;
    background: var(--surface);
}

.migration-package-flow span {
    display: inline-flex;
    grid-row: 1 / 3;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--navy);
    color: #ffffff;
    font-weight: 900;
}

.migration-package-flow small {
    color: var(--muted);
}

.migration-exclusions {
    margin-top: 0;
}

.migration-download-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    background: var(--surface-2);
}

.migration-download-form p {
    margin: 4px 0 0;
}

.migration-download-intro,
.migration-package-mode,
.migration-download-credentials,
.migration-unencrypted-confirm,
.migration-download-submit {
    min-width: 0;
}

.migration-package-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.migration-package-mode legend {
    padding: 0 6px;
    font-size: 13px;
    font-weight: 900;
}

.migration-mode-option,
.migration-unencrypted-confirm {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    cursor: pointer;
}

.migration-mode-option input,
.migration-unencrypted-confirm input {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 2px 0 0;
    padding: 0;
    accent-color: var(--blue);
}

.migration-mode-option small,
.migration-unencrypted-confirm small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.35;
}

.migration-download-credentials {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
    gap: 16px;
    align-items: end;
}

.migration-encryption-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.migration-download-form [hidden] {
    display: none !important;
}

.migration-unencrypted-confirm {
    border-color: #f2b8b5;
    background: #fff8f8;
}

.theme-dark .migration-unencrypted-confirm {
    border-color: #6b2b2b;
    background: #241819;
}

.migration-download-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.migration-upload-section,
.migration-result,
.migration-jobs-section,
.migration-cleanup-section {
    margin-top: 28px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.migration-upload-form {
    max-width: 820px;
}

.migration-action-options {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.migration-action-options legend {
    padding: 0 6px;
    font-weight: 800;
}

.migration-action-options .check-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0;
}

.migration-action-options .check-row input {
    margin-top: 4px;
}

.migration-action-options .check-row span,
.migration-action-options .check-row small {
    display: block;
}

.migration-action-options .check-row small {
    margin-top: 2px;
    color: var(--muted);
}

.migration-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.migration-submit-row p {
    margin: 0;
}

.migration-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin: 18px 0;
    border: 1px solid var(--line);
    background: var(--line);
}

.migration-result-grid > div {
    padding: 14px;
    background: var(--surface);
}

.migration-result-grid dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.migration-result-grid dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.migration-result-log {
    margin: 0;
    padding: 16px 16px 16px 36px;
    border-left: 4px solid var(--green);
    background: var(--surface-2);
}

.warning-log {
    border-left-color: var(--amber);
}

.migration-jobs-table-wrap {
    margin-top: 16px;
}

.migration-jobs-table th,
.migration-jobs-table td {
    vertical-align: top;
}

.migration-jobs-table td {
    min-width: 120px;
}

.migration-jobs-table td:nth-child(2),
.migration-jobs-table td:nth-child(5) {
    min-width: 220px;
    overflow-wrap: anywhere;
}

.migration-cleanup-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin: 16px 0;
    border: 1px solid var(--line);
    background: var(--line);
}

.migration-cleanup-summary > div {
    padding: 14px;
    background: var(--surface);
}

.migration-cleanup-summary span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.migration-cleanup-summary strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
}

.migration-cleanup-form {
    display: grid;
    grid-template-columns: minmax(220px, 360px) max-content;
    gap: 14px;
    align-items: end;
    margin-top: 16px;
}

.error-text {
    color: var(--red);
    font-weight: 700;
}

.section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.section-actions .button {
    min-height: 40px;
    white-space: nowrap;
}

.tour-replay {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(23, 105, 170, 0.32);
    border-radius: 50%;
    background: var(--surface);
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(19, 58, 94, 0.1);
    transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.tour-replay:hover {
    transform: translateY(-1px);
    border-color: var(--blue);
    color: var(--blue-dark);
    box-shadow: 0 10px 22px rgba(19, 58, 94, 0.16);
}

.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: auto;
}

.tour-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 35%, rgba(23, 213, 168, 0.1), transparent 34%),
        rgba(10, 18, 28, 0.52);
    backdrop-filter: blur(3px);
    animation: tourFadeIn 180ms ease-out both;
}

.tour-focus-ring {
    position: fixed;
    z-index: 91;
    pointer-events: none;
    border: 2px solid rgba(23, 213, 168, 0.95);
    border-radius: 10px;
    box-shadow:
        0 0 0 9999px rgba(10, 18, 28, 0.26),
        0 0 0 8px rgba(23, 213, 168, 0.14),
        0 18px 42px rgba(0, 0, 0, 0.22);
    transition: top 220ms ease, left 220ms ease, width 220ms ease, height 220ms ease;
    animation: tourPulse 1800ms ease-in-out infinite;
}

.tour-card {
    position: fixed;
    z-index: 92;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 249, 0.96));
    color: #162033;
    box-shadow: 0 24px 70px rgba(3, 14, 26, 0.28);
    animation: tourCardIn 220ms cubic-bezier(.2, .8, .2, 1) both;
}

.theme-dark .tour-card {
    border-color: rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(145deg, rgba(28, 36, 48, 0.98), rgba(18, 26, 38, 0.97));
    color: var(--ink);
}

.tour-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(104, 115, 134, 0.22);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.theme-dark .tour-close {
    background: rgba(255, 255, 255, 0.08);
}

.tour-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(23, 213, 168, 0.12);
    color: #075f4f;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.theme-dark .tour-kicker {
    color: #a7f3d0;
}

.tour-card h2 {
    margin: 0 32px 8px 0;
    font-size: 20px;
    line-height: 1.2;
}

.tour-card p {
    margin: 0 0 16px;
    color: #536175;
    font-size: 14px;
}

.theme-dark .tour-card p {
    color: var(--muted);
}

.tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tour-actions > div {
    display: flex;
    gap: 8px;
}

.tour-actions button[disabled] {
    cursor: not-allowed;
    opacity: 0.45;
}

@keyframes tourFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes tourCardIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tourPulse {
    0%,
    100% {
        box-shadow:
            0 0 0 9999px rgba(10, 18, 28, 0.26),
            0 0 0 8px rgba(23, 213, 168, 0.12),
            0 18px 42px rgba(0, 0, 0, 0.22);
    }
    50% {
        box-shadow:
            0 0 0 9999px rgba(10, 18, 28, 0.25),
            0 0 0 14px rgba(23, 213, 168, 0.2),
            0 18px 42px rgba(0, 0, 0, 0.22);
    }
}

.legal-page {
    max-width: 930px;
    margin: 0 auto;
}

.legal-page h2 {
    margin-top: 26px;
    margin-bottom: 8px;
    font-size: 18px;
}

.legal-page p {
    color: var(--muted);
}

.contact-card {
    margin-top: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.contact-card h2 {
    margin-bottom: 10px;
}

.contact-lines {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.contact-lines a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--blue-dark);
    font-weight: 800;
    text-decoration: none;
}

.auth-panel {
    max-width: 470px;
    margin: 54px auto;
}

.request-panel {
    max-width: 720px;
}

.support-form {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

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

.compact-toggle {
    min-height: 44px;
    align-self: end;
    padding: 10px 12px;
}

h1,
h2 {
    line-height: 1.1;
}

h1 {
    margin: 0 0 10px;
    font-size: 32px;
}

h2 {
    margin: 0;
    font-size: 19px;
}

p {
    margin-top: 0;
}

.lead {
    max-width: 690px;
    color: #465367;
    font-size: 18px;
}

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

.eyebrow {
    margin: 0 0 10px;
    color: var(--amber);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 520px;
    align-items: center;
    gap: 42px;
    min-height: 580px;
    padding: 34px 0 42px;
}

.marketing-hero {
    position: relative;
    min-height: clamp(620px, 86vh, 820px);
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: #f7faf7;
}

.nad-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(244, 241, 234, 0.98) 0%, rgba(244, 241, 234, 0.9) 38%, rgba(244, 241, 234, 0.36) 72%, rgba(244, 241, 234, 0.14) 100%);
}

.marketing-hero-content {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 78px 0 96px;
}

.marketing-hero-content h1 {
    max-width: 760px;
    font-size: clamp(42px, 6vw, 76px);
    letter-spacing: 0;
}

.marketing-hero-content .lead {
    max-width: 640px;
    color: #415064;
}

.hero-secondary {
    background: rgba(255, 255, 255, 0.82);
}

.hero-proof {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.hero-proof span {
    padding: 8px 11px;
    border: 1px solid rgba(19, 58, 94, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #2f4052;
    font-size: 13px;
    font-weight: 800;
}

.marketing-band,
.process-band,
.cta-band {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

.marketing-band {
    padding: 62px 0 28px;
}

.marketing-intro {
    max-width: 760px;
}

.marketing-intro h2,
.process-band h2,
.cta-band h2 {
    font-size: clamp(28px, 3vw, 42px);
    letter-spacing: 0;
}

.marketing-features {
    margin-top: 28px;
}

.process-band {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    gap: 32px;
    align-items: start;
    padding: 38px 0 62px;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.process-steps article {
    min-height: 150px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(24, 33, 47, 0.07);
}

.process-steps strong,
.process-steps span {
    display: block;
}

.process-steps strong {
    margin-bottom: 10px;
    font-size: 18px;
}

.process-steps span {
    color: var(--muted);
}

.cta-band {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 54px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.theme-dark .marketing-hero {
    background: #111821;
}

.theme-dark .hero-shade {
    background: linear-gradient(90deg, rgba(15, 20, 27, 0.98) 0%, rgba(15, 20, 27, 0.9) 42%, rgba(15, 20, 27, 0.44) 74%, rgba(15, 20, 27, 0.2) 100%);
}

.theme-dark .marketing-hero-content .lead {
    color: var(--muted);
}

.theme-dark .hero-secondary,
.theme-dark .hero-proof span,
.theme-dark .process-steps article,
.theme-dark .cta-band {
    background: var(--surface);
    border-color: var(--line);
}

.theme-dark .hero-proof span {
    color: var(--ink);
}

.view-home {
    background: #ffffff;
}

.view-home .topbar {
    background: rgba(255, 255, 255, 0.92);
}

.view-home .marketing-hero {
    min-height: clamp(680px, 88vh, 880px);
    border-bottom: 0;
    background:
        linear-gradient(120deg, #ffffff 0%, #f6fafb 48%, #eaf3f5 100%);
}

.view-home .hero-shade {
    background:
        radial-gradient(circle at 76% 46%, rgba(23, 213, 168, 0.16), transparent 31%),
        radial-gradient(circle at 91% 72%, rgba(255, 184, 77, 0.14), transparent 28%),
        radial-gradient(circle at 66% 8%, rgba(58, 183, 255, 0.12), transparent 25%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 251, 252, 0.96) 41%, rgba(242, 248, 249, 0.42) 68%, rgba(238, 246, 247, 0.08) 100%);
}

.view-home .marketing-hero-content {
    color: #0b1518;
    pointer-events: none;
}

.view-home .marketing-hero-content .lead {
    color: #50636d;
}

.view-home .eyebrow {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #58656e;
}

.view-home .eyebrow::before {
    content: "";
    width: 34px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #17d5a8, #ffb84d);
    box-shadow: 0 0 22px rgba(23, 213, 168, 0.28);
}

.view-home .eyebrow span {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid rgba(11, 21, 24, 0.12);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(23, 213, 168, 0.12), rgba(255, 184, 77, 0.14));
    color: #0b6f58;
}

.view-home .marketing-hero .eyebrow {
    color: #52646d;
}

.view-home .marketing-hero .eyebrow span {
    border-color: rgba(11, 21, 24, 0.1);
    background: rgba(255, 255, 255, 0.78);
    color: #087f5b;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 28px rgba(23, 39, 48, 0.08);
}

.view-home .hero-secondary {
    border-color: rgba(11, 21, 24, 0.14);
    background: rgba(255, 255, 255, 0.78);
    color: #0b1518;
    backdrop-filter: blur(12px);
    box-shadow: 0 14px 34px rgba(23, 39, 48, 0.08);
}

.view-home .hero-proof span {
    border-color: rgba(11, 21, 24, 0.1);
    background: rgba(255, 255, 255, 0.78);
    color: #50636d;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 28px rgba(23, 39, 48, 0.06);
}

.view-home .marketing-hero-content h1,
.view-home .marketing-hero-content .lead,
.view-home .hero-actions,
.view-home .hero-proof,
.view-home .marketing-hero .eyebrow {
    max-width: 650px;
}

.view-home .hero-actions a {
    pointer-events: auto;
}

.view-home .marketing-band {
    padding-top: 68px;
    background: #ffffff;
}

.view-home .new-capabilities-band {
    padding-top: 36px;
}

.view-home .feature-card {
    border-color: rgba(11, 21, 24, 0.12);
    background: #ffffff;
    box-shadow: 0 16px 42px rgba(11, 21, 24, 0.09);
}

.view-home .feature-icon {
    background: linear-gradient(135deg, #0d8f70, #148fbd);
    color: #ffffff;
}

.view-home .new-capabilities-band .feature-card {
    border-top: 3px solid #17d5a8;
}

.view-home .process-steps article {
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(11, 21, 24, 0.08);
}

.view-home .cta-band {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.98)),
        linear-gradient(90deg, rgba(23, 213, 168, 0.1), rgba(255, 184, 77, 0.12));
}

.hero-copy h1 {
    max-width: 780px;
    font-size: 56px;
    letter-spacing: 0;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 26px;
    flex-wrap: wrap;
}

.product-visual {
    background: var(--surface);
    border: 1px solid rgba(217, 222, 214, 0.95);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 30px 70px rgba(24, 33, 47, 0.17);
}

.theme-dark .product-visual,
.theme-dark .feature-card,
.theme-dark .workflow li,
.theme-dark .visual-stats div,
.theme-dark .visual-table div,
.theme-dark .visual-flow span,
.theme-dark .inline-form,
.theme-dark .upload-drop,
.theme-dark .table-wrap {
    background: var(--surface);
    border-color: var(--line);
}

.visual-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    color: var(--muted);
}

.visual-toolbar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c9d1dc;
}

.visual-toolbar span:nth-child(1) {
    background: #d85d47;
}

.visual-toolbar span:nth-child(2) {
    background: #d8a441;
}

.visual-toolbar span:nth-child(3) {
    background: #2f9e72;
}

.visual-toolbar strong {
    margin-left: auto;
    color: var(--ink);
    font-size: 13px;
}

.visual-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.visual-stats div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface-2);
}

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

.visual-stats strong {
    display: block;
    margin-top: 5px;
    font-size: 22px;
}

.visual-table {
    display: grid;
    grid-template-columns: 1fr 1.45fr 0.8fr;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}

.visual-table div {
    padding: 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #ffffff;
}

.visual-table div:nth-child(-n + 3) {
    background: #edf4f5;
    color: var(--navy);
    font-weight: 800;
}

.theme-dark .visual-table div:nth-child(-n + 3),
.theme-dark th {
    background: #233044;
    color: #d7ecff;
}

.visual-table div:nth-child(3n) {
    border-right: 0;
}

.visual-table div:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.visual-table .ok {
    color: var(--green);
    font-weight: 800;
}

.visual-table .warn {
    color: var(--red);
    font-weight: 800;
}

.visual-flow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.visual-flow span {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-weight: 800;
    background: #fbfaf6;
}

.visual-flow b {
    width: 22px;
    height: 2px;
    background: var(--amber);
}

.feature-band {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 28px 0;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 14px 34px rgba(24, 33, 47, 0.08);
}

.feature-icon {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 8px;
    background: #eef4f8;
    color: var(--blue-dark);
    font-weight: 900;
}

.feature-card p {
    margin-bottom: 0;
    color: var(--muted);
}

.workflow-band {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 26px;
    padding: 28px 0 8px;
}

.workflow {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.workflow li {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.workflow span {
    color: var(--muted);
}

.form {
    display: grid;
    gap: 16px;
}

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin: 22px 0;
    flex-wrap: wrap;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.inline-form label {
    min-width: min(380px, 100%);
    flex: 1;
}

.inline-form button,
.inline-form .button {
    min-height: 44px;
    margin: 0;
}

.mapping-tools-form label {
    min-width: min(520px, 100%);
}

.subject-count-form label {
    flex: 0 1 260px;
    min-width: 220px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cfd7df;
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    box-shadow: 0 1px 0 rgba(24, 33, 47, 0.03);
}

.theme-dark input,
.theme-dark select,
.theme-dark textarea {
    border-color: #3b4656;
    background: #111821;
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(23, 105, 170, 0.18);
    border-color: var(--blue);
}

textarea {
    min-height: 96px;
    resize: vertical;
    font: inherit;
}

input[type="file"] {
    padding: 8px;
}

.upload-drop {
    margin-top: 24px;
    padding: 20px;
    border: 1px dashed #9fb2c5;
    border-radius: 8px;
    background: #f7fbfd;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 15px;
    border: 1px solid #cfd7df;
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    font-weight: 800;
}

button:hover,
.button:hover {
    border-color: #aebdca;
    background: #f8fafc;
}

.theme-dark button,
.theme-dark .button {
    border-color: #3b4656;
    background: #151c26;
    color: var(--ink);
}

.theme-dark button:hover,
.theme-dark .button:hover {
    background: #202a38;
    border-color: #536174;
}

button.primary,
.primary {
    background: var(--blue);
    border-color: var(--blue);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(23, 105, 170, 0.22);
}

button.primary:hover,
.primary:hover {
    background: var(--blue-dark);
}

button.danger,
.button.danger {
    border-color: #f2b8b5;
    background: #fff5f5;
    color: var(--red);
}

button.danger:hover,
.button.danger:hover {
    border-color: var(--red);
    background: #ffe8e8;
}

.theme-dark button.danger,
.theme-dark .button.danger {
    border-color: #6b2b2b;
    background: #2a1717;
    color: #ffb3ad;
}

.large {
    min-height: 48px;
    padding-inline: 18px;
}

.section-head,
.subsection-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.subsection-title {
    margin: 28px 0 12px;
    align-items: center;
}

.subsection-title span {
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4f8;
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 900;
}

.theme-dark .subsection-title span,
.theme-dark .chips span,
.theme-dark .chip-toggle,
.theme-dark .feature-icon {
    background: #243244;
    color: #d7ecff;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chips span,
.chip-toggle {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 8px;
    background: #fbfaf6;
    color: #344054;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.chips.compact {
    overflow: hidden;
}

.output-columns .extra-column {
    display: none;
}

.output-columns.expanded .extra-column {
    display: inline-flex;
}

.chip-toggle {
    min-height: 0;
    cursor: pointer;
    background: #eef4f8;
    color: var(--blue-dark);
    font-weight: 900;
}

.chip-toggle:hover {
    background: #dfeef7;
    border-color: #bdd4e6;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.table-wrap.wide {
    max-height: 460px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 680px;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #edf4f5;
    color: var(--navy);
    font-size: 12px;
    font-weight: 900;
}

td {
    color: #344054;
}

.theme-dark td {
    color: #d6deea;
}

tr:nth-child(even) td {
    background: #fcfcfa;
}

.theme-dark tr:nth-child(even) td {
    background: #151c26;
}

td.abc-missing-cell {
    background: #ffe4e6 !important;
}

.theme-dark td.abc-missing-cell {
    background: rgba(127, 29, 29, 0.42) !important;
}

tr:last-child td {
    border-bottom: 0;
}

.mapping-grid {
    grid-template-columns: 1fr;
}

.mapping-option-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.mapping-option-card h2 {
    margin: 2px 0 4px;
    font-size: 18px;
}

.mapping-option-card .eyebrow,
.mapping-option-card .mini-note {
    margin: 0;
}

.mapping-checkbox-option {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.mapping-checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: var(--blue);
}

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

.result-template-setting {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
    gap: 20px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.result-template-summary .eyebrow,
.result-template-summary p {
    margin: 0;
}

.result-template-summary h3 {
    margin: 4px 0 5px;
    color: var(--navy);
    font-size: 22px;
}

.theme-dark .result-template-summary h3 {
    color: var(--ink);
}

.result-template-summary .mini-note {
    margin-top: 8px;
}

.result-template-field {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.active-template-band {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin: 18px 0;
    padding: 13px 15px;
    border: 1px solid #bdd4e6;
    border-radius: 8px;
    background: #eef7fc;
}

.active-template-band > div {
    display: grid;
    gap: 2px;
}

.active-template-band span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.active-template-band strong {
    color: var(--blue-dark);
    font-size: 18px;
}

.active-template-band p {
    margin: 0;
    color: #344054;
    font-size: 13px;
}

.theme-dark .active-template-band {
    border-color: #35516a;
    background: #172432;
}

.theme-dark .active-template-band p {
    color: #d6deea;
}

.template-download-row,
.active-template-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.template-download-row {
    margin-top: 9px !important;
}

.template-download-link {
    color: var(--blue-dark);
    font-size: 11px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.active-template-actions {
    justify-content: flex-end;
}

.mapping-configuration-lock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mapping-configuration-lock > div {
    display: grid;
    gap: 3px;
}

.mapping-configuration-lock form {
    flex: 0 0 auto;
    margin: 0;
}

.template-column-config {
    margin: 18px 0 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    overflow: hidden;
}

.template-column-config > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 15px;
    color: var(--navy);
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
}

.template-column-config > summary strong {
    padding: 4px 9px;
    border-radius: 999px;
    background: #e5f1fb;
    color: var(--blue-dark);
    font-size: 11px;
}

.template-column-config > p,
.template-column-config > .template-column-group {
    margin-right: 15px;
    margin-left: 15px;
}

.template-column-group {
    margin-top: 13px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.template-column-group:last-child {
    margin-bottom: 15px;
}

.template-column-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.template-column-group-title h3 {
    margin: 0;
    font-size: 14px;
}

.template-column-group-title span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.template-column-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 7px;
}

.template-column-chip {
    display: flex;
    min-width: 0;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding: 5px 6px 5px 9px;
    border: 1px solid #cfe0eb;
    border-radius: 7px;
    background: #f7fbfd;
}

.template-column-chip code {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--navy);
    font-size: 10px;
    font-weight: 800;
}

.template-column-chip form {
    flex: 0 0 auto;
    margin: 0;
}

.template-column-chip button {
    min-height: 24px;
    padding: 2px 6px;
    border: 1px solid #c7d8e4;
    border-radius: 5px;
    background: var(--surface);
    color: var(--blue-dark);
    font-size: 9px;
    font-weight: 900;
}

.template-column-chip.mandatory {
    justify-content: flex-start;
    border-color: #b9d7ca;
    background: #eef8f3;
}

.template-column-chip.mandatory small {
    margin-left: auto;
    color: #087455;
    font-size: 9px;
    font-weight: 900;
}

.template-column-group.removed,
.template-column-chip.removed {
    background: #fff8f7;
}

.template-column-chip.removed {
    border-color: #f0ccc7;
}

.restore-template-columns {
    margin: 11px 0 0;
}

.template-without-subjects {
    align-items: center;
}

.mapping-override-backdrop {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 23, 41, 0.58);
    backdrop-filter: blur(4px);
}

.mapping-override-dialog {
    width: min(980px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    border: 1px solid #c8d9e5;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(7, 23, 41, 0.28);
}

.mapping-override-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.mapping-override-heading h1 {
    margin: 4px 0 6px;
    font-size: 25px;
}

.mapping-override-heading p {
    margin: 0;
}

.mapping-override-rule {
    display: grid;
    gap: 3px;
    margin-top: 16px;
    padding: 12px 14px;
    border-left: 4px solid var(--blue);
    border-radius: 7px;
    background: #eef7fc;
    font-size: 12px;
}

.mapping-override-counts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.mapping-override-counts > div {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.mapping-override-counts span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.mapping-override-counts strong {
    color: var(--navy);
    font-size: 20px;
}

.mapping-override-diff {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.mapping-diff-card {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
}

.mapping-diff-card.additions {
    border-color: #b9d7ca;
    background: #f1faf6;
}

.mapping-diff-card.removals {
    border-color: #efc6c1;
    background: #fff7f6;
}

.mapping-diff-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mapping-diff-title h2 {
    margin: 0;
    font-size: 15px;
}

.mapping-diff-title span {
    min-width: 25px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--surface);
    text-align: center;
    font-size: 10px;
    font-weight: 900;
}

.mapping-diff-card ul,
.mapping-outside-template ul {
    max-height: 190px;
    margin: 10px 0 0;
    padding-left: 19px;
    overflow: auto;
    font-size: 11px;
}

.mapping-diff-card li + li,
.mapping-outside-template li + li {
    margin-top: 4px;
}

.mapping-outside-template {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.mapping-outside-template summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
}

.mapping-override-warning {
    margin-top: 14px;
}

.mapping-override-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.mapping-override-actions button {
    min-width: 150px;
}

.theme-dark .template-column-config > summary strong,
.theme-dark .mapping-override-rule {
    background: #172f42;
}

.theme-dark .template-column-chip,
.theme-dark .template-column-chip.mandatory,
.theme-dark .template-column-group.removed,
.theme-dark .template-column-chip.removed,
.theme-dark .mapping-diff-card.additions,
.theme-dark .mapping-diff-card.removals {
    background: #17202b;
}

.theme-dark .template-column-chip code,
.theme-dark .mapping-override-counts strong {
    color: var(--ink);
}

.compact-table input {
    min-height: 38px;
}

.compact-table th:first-child,
.compact-table td:first-child {
    width: 86px;
}

.full {
    grid-column: 1 / -1;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.mapping-process-steps {
    margin: 10px 0 0;
    padding-left: 22px;
    color: var(--muted);
}

.mapping-process-steps li {
    margin: 8px 0;
    padding-left: 4px;
}

.subject-mapping-heading {
    margin-top: 24px;
}

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    font-weight: 700;
}

.alert.success {
    border-color: #a8dfc8;
    color: var(--green);
    background: #f1fbf6;
}

.theme-dark .alert.success {
    background: #10251f;
    border-color: #255c4c;
}

.alert.error {
    border-color: #f0bbb5;
    color: var(--red);
    background: #fff7f6;
}

.theme-dark .alert.error {
    background: #2a1717;
    border-color: #6b2b2b;
}

.alert.warning {
    border-color: #efd188;
    color: #8a5a12;
    background: #fff9e8;
}

.theme-dark .alert.warning {
    color: #f4c76b;
    background: #2b2415;
    border-color: #69501f;
}

.abc-highlight {
    font-weight: 800;
}

.abc-filled {
    background: #e8fff3 !important;
    color: #087f5b;
}

.abc-mismatch {
    background: #fff0ef !important;
    color: #b42318;
}

.theme-dark .abc-filled {
    background: #123327 !important;
    color: #6ee7b7;
}

.theme-dark .abc-mismatch {
    background: #351b1b !important;
    color: #ff8a80;
}

.import-review-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.import-review-stats div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.import-review-stats strong {
    display: block;
    color: var(--navy);
    font-size: 24px;
    line-height: 1.1;
}

.import-review-stats span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.import-status-conflict td {
    background: #fff0ef;
    color: #8f1d14;
}

.import-status-skipped td {
    background: #fff7e6;
    color: #7a5417;
}

.theme-dark .import-status-conflict td {
    background: #351b1b;
    color: #ffb0a8;
}

.theme-dark .import-status-skipped td {
    background: #2b2415;
    color: #f4c76b;
}

.abc-preview-filled {
    background: #ffeb3b !important;
    color: #211d00 !important;
    font-weight: 900;
    box-shadow: inset 0 0 0 2px #d6b900;
}

.abc-preview-created-cell {
    background: #c8f7dc !important;
    color: #055f43;
    font-weight: 800;
}

.abc-preview-rejected {
    background: #ffe1de !important;
    color: #9f2218;
    font-weight: 900;
}

.theme-dark .abc-preview-filled {
    background: #ffe94a !important;
    color: #171400 !important;
    box-shadow: inset 0 0 0 2px #c9aa00;
}

.abc-preview-legend {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.abc-preview-filled-swatch {
    display: inline-block;
    width: 22px;
    height: 18px;
    flex: 0 0 auto;
    border: 2px solid #d6b900;
    border-radius: 3px;
    background: #ffeb3b;
}

.theme-dark .abc-preview-created-cell {
    background: #174d35 !important;
    color: #b7f7d4;
}

.theme-dark .abc-preview-rejected {
    background: #4b1e1e !important;
    color: #ffb0a8;
}

.abc-preview-heading {
    align-items: end;
}

.abc-preview-limit {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.abc-preview-limit label {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.abc-preview-limit select {
    width: 86px;
    min-height: 32px;
    padding: 5px 26px 5px 8px;
    font-size: 12px;
}

.abc-preview-limit span {
    min-width: 112px;
    text-align: center;
}

.abc-import-preview-table {
    max-height: 620px;
}

.abc-preview-table {
    min-width: 1040px;
    font-size: 11px;
    line-height: 1.25;
}

.abc-preview-table th,
.abc-preview-table td {
    padding: 6px 7px;
}

.abc-preview-table th {
    font-size: 10px;
}

.abc-preview-table td:first-child,
.abc-preview-table th:first-child {
    width: 48px;
}

.abc-preview-table td:nth-child(2),
.abc-preview-table th:nth-child(2) {
    width: 76px;
}

.abc-preview-table td:nth-child(3),
.abc-preview-table th:nth-child(3) {
    width: 92px;
}

.abc-preview-table td:nth-child(9),
.abc-preview-table th:nth-child(9) {
    min-width: 220px;
    max-width: 320px;
}

.abc-preview-table .status-pill {
    padding: 3px 6px;
    font-size: 9px;
}

.account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
    gap: 18px;
    margin-top: 24px;
}

.abc-tools-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
    gap: 18px;
    margin-top: 22px;
}

.abc-search-form {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 12px;
}

.abc-search-form label {
    min-width: 0;
    font-size: 13px;
}

.abc-search-form input {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 8px 10px;
}

.abc-search-form button,
.abc-search-form .button {
    height: 40px;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13px;
    line-height: 1;
}

.compact-title {
    margin-bottom: 12px;
}

.compact-upload-form {
    gap: 12px;
}

.mini-note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.abc-pagination-bar,
.pagination-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.abc-page-size-form {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 8px 10px;
    width: max-content;
}

.abc-page-size-form label {
    min-width: 0;
    gap: 4px;
    font-size: 12px;
}

.abc-page-size-form select,
.abc-page-size-form input[type="number"] {
    width: 122px;
    height: 34px;
    min-height: 34px;
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 7px;
}

.abc-page-size-form button {
    height: 34px;
    min-height: 34px;
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 7px;
    line-height: 1;
}

.abc-control-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
}

.abc-page-size-form .abc-control-row {
    width: auto;
}

.abc-issue-page-size-form input[type="number"] {
    width: 104px;
}

.hidden {
    display: none !important;
}

.abc-edit-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 10px;
    align-items: end;
    padding: 4px 0;
}

.abc-edit-form label {
    gap: 4px;
    font-size: 12px;
}

.abc-edit-form input {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 7px;
}

.abc-edit-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.abc-edit-actions button,
.abc-edit-actions .button {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 12px;
}

.abc-issue-summary {
    margin-top: 18px;
}

.abc-issue-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 22px;
}

.abc-issue-filters .button {
    align-items: center;
    gap: 8px;
}

.abc-issue-filters .button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(8, 38, 70, 0.08);
    font-size: 11px;
    font-weight: 900;
}

.abc-issue-filters .button.primary span {
    background: rgba(255, 255, 255, 0.18);
}

.abc-issues-table table {
    min-width: 1080px;
    font-size: 12px;
    line-height: 1.25;
}

.abc-issues-table th,
.abc-issues-table td {
    padding: 6px 7px;
    vertical-align: top;
}

.abc-issue-bulk-form > .actions {
    justify-content: flex-start;
    margin: 8px 0;
}

.abc-bulk-edit-table input {
    min-width: 130px;
    padding: 7px 8px;
    font-size: 12px;
}

.abc-field-source {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.25;
}

.abc-merge-panel {
    margin-top: 18px;
}

.abc-issues-table th {
    font-size: 10.5px;
}

.abc-issues-table th:first-child,
.abc-issues-table td:first-child {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    padding-inline: 6px;
    text-align: center;
    vertical-align: middle;
}

.abc-issues-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    border-radius: 3px;
    box-shadow: none;
    accent-color: var(--blue);
}

.abc-issues-table th:last-child,
.abc-issues-table td:last-child {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    vertical-align: middle;
}

.abc-issues-table .archive-actions {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 5px;
}

.abc-issues-table .archive-actions .button {
    width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.15;
    white-space: nowrap;
}

.abc-issue-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.abc-issue-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.abc-issue-tag.severity-conflict {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.abc-issue-tag.severity-mismatch {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.abc-issue-tag.severity-invalid,
.abc-issue-tag.severity-missing_required {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.abc-issue-tag.severity-partial {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.abc-issue-row.severity-conflict td {
    background: #fff1f2;
}

.abc-issue-row.severity-mismatch td {
    background: #fff7ed;
}

.abc-issue-row.severity-invalid td,
.abc-issue-row.severity-missing_required td {
    background: #fffbeb;
}

.abc-issue-row.severity-partial td {
    background: #eff6ff;
}

.abc-issue-row:hover td {
    filter: brightness(0.985);
}

.theme-dark .abc-issue-filters .button span {
    background: rgba(255, 255, 255, 0.10);
}

.theme-dark .abc-issue-tag {
    background: rgba(255, 255, 255, 0.06);
}

.theme-dark .abc-issue-row.severity-conflict td {
    background: rgba(127, 29, 29, 0.24);
}

.theme-dark .abc-issue-row.severity-mismatch td {
    background: rgba(154, 52, 18, 0.22);
}

.theme-dark .abc-issue-row.severity-invalid td,
.theme-dark .abc-issue-row.severity-missing_required td {
    background: rgba(146, 64, 14, 0.22);
}

.theme-dark .abc-issue-row.severity-partial td {
    background: rgba(29, 78, 216, 0.18);
}

.pagination-summary {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.pagination-actions {
    justify-content: flex-end;
    margin-top: 14px;
    margin-bottom: 0;
}

.button.disabled {
    opacity: 0.48;
    pointer-events: none;
}

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

.admin-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(420px, 1.2fr);
    gap: 18px;
    margin-top: 24px;
}

.admin-shortcuts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 0 24px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.admin-shortcuts .button {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 13px;
}

.smtp-admin-page {
    max-width: 1120px;
    margin-inline: auto;
}

.smtp-page-head {
    align-items: flex-start;
    gap: 18px;
}

.smtp-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.smtp-status-card {
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
}

.smtp-status-card > span,
.smtp-status-card small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.smtp-status-card strong {
    display: inline-block;
    max-width: 100%;
    margin-top: 6px;
    overflow-wrap: anywhere;
    font-size: 13px;
}

.smtp-status-card small {
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.smtp-status-problem {
    color: var(--red);
}

.smtp-config-section {
    background: var(--surface);
}

.smtp-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.smtp-section-heading h2,
.smtp-test-card h2 {
    margin: 2px 0 0;
}

.smtp-enable-control,
.smtp-check-control {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    cursor: pointer;
}

.smtp-enable-control {
    width: min(100%, 390px);
}

.smtp-enable-control input[type="checkbox"],
.smtp-check-control input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 2px 0 0;
}

.smtp-enable-control span,
.smtp-check-control span {
    min-width: 0;
}

.smtp-enable-control strong,
.smtp-check-control strong,
.smtp-enable-control small,
.smtp-check-control small {
    display: block;
}

.smtp-enable-control strong,
.smtp-check-control strong {
    font-size: 13px;
}

.smtp-enable-control small,
.smtp-check-control small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.smtp-settings-form {
    gap: 18px;
}

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

.smtp-host-field {
    min-width: 0;
}

.smtp-input-suffix {
    display: flex;
    align-items: stretch;
}

.smtp-input-suffix input {
    min-width: 0;
    border-radius: 8px 0 0 8px;
}

.smtp-input-suffix span {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
}

.field-help {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.smtp-auth-block {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
}

.smtp-check-control {
    padding: 0;
    border: 0;
    background: transparent;
}

.smtp-credential-fields {
    transition: opacity 160ms ease;
}

.smtp-credential-fields.is-disabled {
    opacity: 0.5;
}

.smtp-protected-action {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
    gap: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.smtp-protected-action button {
    min-width: 220px;
}

.smtp-test-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.smtp-test-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.smtp-test-card > p.muted {
    min-height: 44px;
}

.smtp-test-card form {
    margin-top: auto;
}

@media (max-width: 820px) {
    .smtp-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .smtp-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .smtp-enable-control {
        width: 100%;
    }

    .smtp-form-grid,
    .smtp-test-grid {
        grid-template-columns: 1fr;
    }

    .smtp-protected-action {
        grid-template-columns: 1fr;
    }

    .smtp-protected-action button {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .smtp-page-head {
        align-items: stretch;
    }

    .smtp-page-head .button {
        width: 100%;
    }

    .smtp-status-grid {
        grid-template-columns: 1fr;
    }
}

.smtp-campaign-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 18px;
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
}

.archive-health-page {
    display: grid;
    gap: 1.25rem;
}

.archive-health-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem;
    border: 1px solid #cbd9df;
    border-left: 5px solid #137c59;
    border-radius: 12px;
    background: #f4fbf8;
}

.archive-health-hero.needs-attention {
    border-left-color: #c77a00;
    background: #fff8e8;
}

.archive-health-hero h2 {
    margin: .55rem 0 .25rem;
}

.archive-health-hero p,
.archive-health-run {
    margin: 0;
}

.archive-health-run {
    display: grid;
    justify-items: end;
    gap: .55rem;
    min-width: 220px;
}

.archive-health-run label,
.backup-notify-options label {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .86rem;
}

.archive-health-run input[type="checkbox"],
.backup-notify-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.archive-health-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: .75rem;
}

.archive-health-summary > div {
    display: grid;
    gap: .25rem;
    padding: .85rem;
    border: 1px solid #d7e1e5;
    border-radius: 10px;
    background: #f7fafb;
}

.archive-health-summary > div span {
    color: #607184;
    font-size: .76rem;
}

.archive-health-summary > div strong {
    color: #10233e;
    font-size: 1.12rem;
}

.archive-health-summary.is-healthy {
    border-color: #aad9ca;
}

.archive-health-summary.needs-attention {
    border-color: #efc879;
}

.backup-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
}

.backup-settings-form {
    display: grid;
    gap: 1rem;
}

.backup-settings-form > .check-row {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .75rem;
}

.backup-settings-form > .check-row input[type="checkbox"] {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin: .15rem 0 0;
}

.backup-settings-form > .check-row span {
    display: grid;
    gap: .15rem;
}

.backup-settings-form > .check-row small {
    color: #66768a;
    font-weight: 400;
}

.backup-settings-footer,
.backup-notify-options,
.backup-schedule-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.backup-settings-footer {
    justify-content: space-between;
    padding-top: .1rem;
}

.backup-settings-footer > button {
    flex: 0 0 auto;
}

.backup-notify-options {
    gap: .65rem 1.25rem;
}

.backup-notify-options label {
    min-height: 36px;
}

.backup-notify-options input[type="checkbox"] {
    flex: 0 0 16px;
    min-height: 16px;
}

.backup-schedule-status {
    padding: .8rem;
    border-radius: 9px;
    background: #f3f7f9;
    font-size: .84rem;
}

.backup-manual-action {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: end;
    gap: 1.25rem;
    padding: 1rem;
    border: 1px solid #d7e1e5;
    border-radius: 10px;
    background: #fbfcfd;
}

.backup-manual-copy {
    display: grid;
    align-self: center;
    gap: .2rem;
}

.backup-manual-copy small {
    color: #66768a;
    font-weight: 400;
}

.backup-run-now {
    display: grid;
    grid-template-columns: minmax(220px, 280px) auto;
    align-items: end;
    gap: .75rem;
    margin: 0;
}

.backup-run-now label {
    min-width: 0;
}

.backup-run-now button {
    white-space: nowrap;
}

.compact-table td small {
    display: block;
    margin-top: .2rem;
    color: #66768a;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .backup-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .backup-manual-action {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .backup-run-now {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

@media (max-width: 620px) {
    .archive-health-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .archive-health-run {
        justify-items: stretch;
        min-width: 0;
    }

    .backup-settings-grid {
        grid-template-columns: 1fr;
    }

    .backup-run-now {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

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

    .backup-settings-footer > button {
        width: 100%;
    }

    .backup-notify-options {
        align-items: flex-start;
        flex-direction: column;
        gap: .35rem;
    }
}

.smtp-campaign-entry h2,
.smtp-campaign-entry p {
    margin-top: 2px;
    margin-bottom: 0;
}

.campaign-admin-page,
.campaign-detail-page {
    width: min(100%, 1260px);
    margin-inline: auto;
}

.campaign-page-head {
    align-items: flex-start;
    gap: 18px;
}

.campaign-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.campaign-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.campaign-detail-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.campaign-metric-grid > div {
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
}

.campaign-metric-grid span,
.campaign-metric-grid strong {
    display: block;
}

.campaign-metric-grid span {
    color: var(--muted);
    font-size: 11px;
}

.campaign-metric-grid strong {
    margin-top: 4px;
    font-size: 21px;
    line-height: 1.2;
}

.campaign-workspace-grid,
.campaign-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    align-items: start;
    gap: 18px;
}

.campaign-side-stack {
    display: grid;
    gap: 18px;
}

.campaign-compose-card textarea,
.campaign-detail-page textarea {
    resize: vertical;
}

.campaign-content-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.campaign-content-actions .field-help {
    flex: 1 1 220px;
}

.campaign-readonly-preview-action {
    margin-top: 10px;
}

.campaign-runner-form {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.campaign-runner-form label {
    font-size: 11px;
}

.campaign-runner-idle {
    margin-top: 13px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.campaign-runner-card .alert {
    margin: 13px 0 0;
}

.campaign-run-status {
    display: grid;
    gap: 0;
    margin: 12px 0 0;
}

.campaign-run-status > div {
    display: grid;
    grid-template-columns: minmax(100px, 0.45fr) minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.campaign-run-status dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.campaign-run-status dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 700;
}

.campaign-settings-card summary {
    cursor: pointer;
    font-weight: 800;
}

.campaign-settings-form {
    margin-top: 16px;
}

.campaign-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.campaign-settings-grid label,
.campaign-suppress-form label,
.campaign-recipient-filter label {
    font-size: 11px;
}

.campaign-list-section,
.campaign-recipient-section,
.campaign-attempt-section {
    margin-top: 24px;
}

.campaign-list-table table,
.campaign-recipient-table table,
.campaign-attempt-table table,
.campaign-suppression-table table {
    font-size: 11px;
}

.campaign-list-table th,
.campaign-list-table td,
.campaign-recipient-table th,
.campaign-recipient-table td,
.campaign-attempt-table th,
.campaign-attempt-table td,
.campaign-suppression-table th,
.campaign-suppression-table td {
    padding: 8px 9px;
    vertical-align: top;
}

.campaign-list-table td:first-child {
    min-width: 190px;
}

.campaign-list-table td:first-child strong,
.campaign-list-table td:first-child small {
    display: block;
}

.email-open-evidence {
    min-width: 118px;
}

.email-open-evidence > span,
.email-open-evidence > small {
    display: block;
}

.email-open-evidence > small {
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.3;
}

.campaign-list-table td:first-child small {
    margin-top: 3px;
    color: var(--muted);
    font-weight: 500;
}

.campaign-status-draft,
.campaign-status-pending {
    background: #edf3f8;
    color: #294f6e;
}

.campaign-status-scheduled,
.campaign-status-retry,
.campaign-status-paused {
    background: #fff4db;
    color: #8a5900;
}

.campaign-status-queued,
.campaign-status-sending {
    background: #e8f3ff;
    color: #075a9c;
}

.campaign-status-completed,
.campaign-status-sent {
    background: #e6f7ef;
    color: #08704f;
}

.campaign-status-failed,
.campaign-status-cancelled,
.campaign-status-suppressed {
    background: #fdebea;
    color: #9d241a;
}

.theme-dark .campaign-status-draft,
.theme-dark .campaign-status-pending,
.theme-dark .campaign-status-scheduled,
.theme-dark .campaign-status-retry,
.theme-dark .campaign-status-paused,
.theme-dark .campaign-status-queued,
.theme-dark .campaign-status-sending,
.theme-dark .campaign-status-completed,
.theme-dark .campaign-status-sent,
.theme-dark .campaign-status-failed,
.theme-dark .campaign-status-cancelled,
.theme-dark .campaign-status-suppressed {
    background: var(--surface-2);
}

.campaign-suppression-section {
    margin-top: 24px;
}

.campaign-suppress-form,
.campaign-recipient-filter {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.25fr) minmax(180px, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.campaign-suppression-table {
    margin-top: 14px;
}

.campaign-import-note {
    margin: -4px 0 18px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
}

.campaign-launch-card,
.campaign-control-card {
    position: sticky;
    top: 84px;
}

.campaign-consent-control {
    display: grid !important;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    cursor: pointer;
}

.campaign-consent-control input[type="checkbox"] {
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
    margin: 2px 0 0;
}

.campaign-consent-control span {
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
}

.campaign-state-form {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.campaign-delete-section {
    margin-top: 18px;
}

.campaign-delete-section .section-head {
    margin-bottom: 8px;
}

.campaign-delete-section .alert {
    margin: 12px 0;
}

.campaign-delete-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
    max-width: 760px;
    margin-top: 12px;
}

.campaign-delete-form.is-locked {
    opacity: 0.72;
}

.campaign-delete-submit {
    grid-column: 1 / -1;
    justify-self: start;
}

.campaign-cancel-draft-form {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    align-items: end;
    gap: 12px;
    max-width: 560px;
}

.campaign-content-readonly h3 {
    margin: 16px 0 7px;
    font-size: 12px;
}

.campaign-content-readonly pre {
    max-height: 360px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--ink);
    font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.campaign-recipient-filter {
    grid-template-columns: minmax(150px, 220px) 110px auto;
    justify-content: start;
    margin-bottom: 12px;
}

.campaign-result-cell {
    max-width: 300px;
    overflow-wrap: anywhere;
    color: var(--muted);
}

.campaign-preview-page {
    width: min(100%, 1120px);
    margin-inline: auto;
}

.campaign-preview-note {
    margin: 16px 0 12px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.campaign-preview-frame {
    display: block;
    width: 100%;
    min-height: 1080px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f3f6f5;
}

.unsubscribe-page {
    width: min(100%, 620px);
    margin: 8vh auto;
    padding: clamp(26px, 6vw, 54px);
    text-align: center;
}

.unsubscribe-mark {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 18px;
    background: #e6f7ef;
    color: var(--green);
    font-size: 28px;
    font-weight: 900;
}

.unsubscribe-page h1 {
    margin-bottom: 9px;
}

.unsubscribe-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
}

@media (max-width: 1000px) {
    .campaign-workspace-grid,
    .campaign-detail-grid {
        grid-template-columns: 1fr;
    }

    .campaign-launch-card,
    .campaign-control-card {
        position: static;
    }

    .campaign-detail-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .campaign-suppress-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .smtp-campaign-entry,
    .campaign-page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .campaign-head-actions {
        justify-content: flex-start;
    }

    .campaign-metric-grid,
    .campaign-detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .campaign-suppress-form,
    .campaign-recipient-filter,
    .campaign-delete-form,
    .campaign-cancel-draft-form {
        grid-template-columns: 1fr;
    }

    .campaign-suppress-form button,
    .campaign-recipient-filter button,
    .campaign-content-actions button,
    .campaign-runner-form button,
    .campaign-delete-form button,
    .campaign-cancel-draft-form button {
        width: 100%;
    }

    .campaign-delete-submit {
        grid-column: auto;
        justify-self: stretch;
    }
}

@media (max-width: 520px) {
    .campaign-head-actions,
    .campaign-head-actions .button,
    .smtp-campaign-entry .button {
        width: 100%;
    }

    .campaign-metric-grid,
    .campaign-detail-metrics,
    .campaign-settings-grid {
        grid-template-columns: 1fr;
    }

    .campaign-run-status > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

.admin-user-filter-form {
    margin: 0 0 14px;
    padding: 12px;
}

.admin-user-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 10px;
}

.admin-user-filter-grid label {
    font-size: 12px;
}

.admin-user-filter-grid select,
.admin-user-filter-grid input {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.filter-actions .button,
.filter-actions button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.admin-users-table table {
    min-width: 0;
    font-size: 12px;
}

.admin-users-table th,
.admin-users-table td {
    padding: 7px 8px;
    line-height: 1.25;
    vertical-align: middle;
}

.admin-users-table .status-pill {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 10px;
    white-space: nowrap;
}

.admin-users-table .subscription-date {
    display: block;
    margin-top: 4px;
    font-size: 11px;
}

.admin-users-table .inline-reset-form input {
    width: 102px;
}

.admin-users-table td:first-child,
.admin-users-table td:nth-child(3) {
    max-width: 180px;
    overflow-wrap: anywhere;
}

.admin-users-table th:nth-child(7),
.admin-users-table td:nth-child(7),
.admin-users-table th:nth-child(8),
.admin-users-table td:nth-child(8) {
    white-space: nowrap;
}

.audit-filter-form {
    margin: 18px 0 26px;
}

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

.audit-table td {
    vertical-align: top;
}

.audit-json {
    max-width: 520px;
    max-height: 220px;
    overflow: auto;
    margin: 10px 0 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.04);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.permission-fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.permission-fieldset legend {
    padding: 0 6px;
    font-weight: 800;
}

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

.compact-toggle {
    font-size: 13px;
    min-height: auto;
}

.permission-details {
    min-width: 220px;
}

.compact-permissions {
    margin-top: 8px;
    grid-template-columns: 1fr;
}

.admin-users-table .employee-permission-details {
    min-width: 150px;
    max-width: 190px;
    font-size: 11px;
}

.admin-users-table .employee-permission-details summary {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 20px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    list-style: none;
    padding-left: 0;
}

.admin-users-table .employee-permission-details summary::-webkit-details-marker {
    display: none;
}

.admin-users-table .employee-permission-details summary::before {
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid var(--ink);
    content: "";
    transform: translateY(-0.5px);
    transition: transform 140ms ease;
}

.admin-users-table .employee-permission-details[open] summary::before {
    transform: rotate(90deg) translateX(-0.5px);
}

.admin-users-table .employee-permission-grid {
    gap: 3px;
    margin-top: 4px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-3px);
    transition:
        max-height 180ms ease,
        opacity 140ms ease,
        transform 180ms ease;
}

.admin-users-table .employee-permission-details[open] .employee-permission-grid {
    max-height: 280px;
    opacity: 1;
    transform: translateY(0);
}

.admin-users-table .employee-permission-details.is-closing .employee-permission-grid {
    max-height: 0;
    opacity: 0;
    transform: translateY(-3px);
}

.admin-users-table .employee-permission-grid .toggle-row {
    gap: 5px;
    min-height: 24px;
    padding: 3px 5px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 1.15;
}

.admin-users-table .employee-permission-grid .toggle-row input {
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    margin: 0;
}

.admin-users-table .employee-permission-grid .toggle-row span {
    overflow-wrap: anywhere;
}

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

.employee-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    margin-bottom: 22px;
    background:
        radial-gradient(circle at 88% 18%, rgba(23, 105, 170, 0.18), transparent 28%),
        linear-gradient(135deg, var(--surface), #eef7f6);
}

.employee-hero::after {
    position: absolute;
    right: -70px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(8, 127, 91, 0.12);
    content: "";
}

.theme-dark .employee-hero {
    background:
        radial-gradient(circle at 88% 18%, rgba(98, 168, 234, 0.18), transparent 30%),
        linear-gradient(135deg, var(--surface), #1b2836);
}

.employee-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.employee-hero-copy h1,
.permission-copy h1 {
    margin: 0 0 8px;
    color: var(--navy);
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.05;
}

.employee-hero-badge {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 128px;
    height: 128px;
    border: 1px solid rgba(23, 105, 170, 0.22);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 38px rgba(19, 58, 94, 0.14);
    text-align: center;
}

.theme-dark .employee-hero-badge {
    background: rgba(255, 255, 255, 0.06);
}

.employee-hero-badge span {
    color: var(--blue);
    font-size: 46px;
    font-weight: 950;
    line-height: 1;
}

.employee-hero-badge small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.employee-card-grid.compact-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.employee-tool-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-height: 138px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(24, 33, 47, 0.08);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.employee-tool-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--card-accent, var(--blue));
    content: "";
}

.employee-tool-card:hover {
    transform: translateY(-2px);
    border-color: rgba(23, 105, 170, 0.35);
    box-shadow: 0 20px 42px rgba(24, 33, 47, 0.14);
}

.employee-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--card-accent, var(--blue)) 13%, white);
    color: var(--card-accent, var(--blue));
    font-size: 14px;
    font-weight: 950;
    letter-spacing: 0.03em;
}

.employee-tool-content {
    display: grid;
    gap: 5px;
}

.employee-tool-content strong {
    color: var(--navy);
    font-size: 18px;
    line-height: 1.2;
}

.employee-tool-content small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.employee-tool-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--card-accent, var(--blue));
    font-size: 28px;
    line-height: 1;
}

.accent-blue { --card-accent: #1769aa; }
.accent-green { --card-accent: #087f5b; }
.accent-amber { --card-accent: #b7791f; }
.accent-teal { --card-accent: #0f766e; }
.accent-indigo { --card-accent: #4f46e5; }
.accent-slate { --card-accent: #475569; }
.accent-rose { --card-accent: #be123c; }
.accent-violet { --card-accent: #7c3aed; }
.accent-navy { --card-accent: #133a5e; }

.permission-empty {
    display: grid;
    gap: 10px;
}

.permission-denied-page {
    position: relative;
    display: grid;
    grid-template-columns: minmax(180px, 0.34fr) minmax(0, 0.66fr);
    gap: 26px;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 22%, rgba(180, 35, 24, 0.16), transparent 30%),
        linear-gradient(135deg, var(--surface), #fff8f6);
}

.theme-dark .permission-denied-page {
    background:
        radial-gradient(circle at 16% 22%, rgba(255, 138, 128, 0.14), transparent 30%),
        linear-gradient(135deg, var(--surface), #261d1d);
}

.permission-visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 220px;
}

.permission-lock {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 116px;
    height: 116px;
    border: 1px solid rgba(180, 35, 24, 0.22);
    border-radius: 30px;
    background: #fff1f2;
    color: var(--red);
    box-shadow: 0 24px 44px rgba(180, 35, 24, 0.16);
    font-size: 54px;
    font-weight: 950;
}

.theme-dark .permission-lock {
    background: rgba(255, 138, 128, 0.12);
}

.permission-orbit {
    position: absolute;
    border: 1px dashed rgba(180, 35, 24, 0.24);
    border-radius: 999px;
}

.orbit-one {
    width: 176px;
    height: 176px;
}

.orbit-two {
    width: 226px;
    height: 226px;
    transform: rotate(18deg);
}

.permission-copy {
    position: relative;
    z-index: 1;
}

.permission-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.permission-allowed-panel {
    margin-top: 22px;
}

.readiness-list {
    display: grid;
    gap: 8px;
}

.readiness-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
}

.readiness-item span {
    min-width: 48px;
    text-align: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
}

.readiness-item.ready span {
    color: #075e38;
    background: #c9f7df;
}

.readiness-item.needs-work span {
    color: #8a4b00;
    background: #ffe5b4;
}

.progress-meter {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.progress-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1261a6, #16a36f);
}

.mini-metrics {
    display: grid;
    gap: 8px;
}

.mini-metrics span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.comparison-panel {
    margin: 18px 0;
}

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

.comparison-grid div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.comparison-grid p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.conflict-editor {
    margin-top: 18px;
}

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

.conflict-columns h3 {
    margin-top: 0;
}

.conflict-columns label {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.database-record-editor {
    padding: 14px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.workbench-filter-bar {
    position: sticky;
    top: 72px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 16px 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(8px);
}

.workbench-filter-bar input {
    min-width: 220px;
    flex: 1;
}

.workbench-section {
    margin: 0;
}

.workbench-section + .workbench-section {
    margin-top: 14px;
}

.workbench-section[hidden],
.workbench-section [hidden] {
    display: none !important;
}

.workbench-section .conflict-editor {
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.workbench-section .conflict-editor summary,
.bulk-correction-panel summary,
.workbench-mapping-notes summary {
    cursor: pointer;
    font-weight: 800;
}

.workbench-mapping-notes {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid #efd188;
    border-radius: 10px;
    background: #fff9e8;
}

.theme-dark .workbench-mapping-notes {
    border-color: #69501f;
    background: #2b2415;
}

.bulk-correction-panel textarea {
    width: 100%;
    margin-top: 10px;
    font-family: Consolas, "Courier New", monospace;
}

.theme-dark .audit-json {
    background: rgba(255, 255, 255, 0.06);
}

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

.match-pairs {
    display: grid;
    gap: 12px;
}

.match-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.account-section {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.danger-section {
    border-color: #f2b8b5;
    background: #fff8f8;
}

.theme-dark .danger-section {
    border-color: #6b2b2b;
    background: #241819;
}

.archive-count {
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4f8;
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 900;
}

.archive-table {
    margin-top: 14px;
}

.archive-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.archive-actions form {
    margin: 0;
}

.archive-file-unavailable {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid #efb4b4;
    border-radius: 7px;
    background: #fff1f1;
    color: #a32222;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
}

.admin-archive-section {
    min-width: 0;
    padding: 14px;
}

.admin-archive-section .eyebrow {
    margin-bottom: 3px;
    font-size: 10px;
}

.admin-archive-section h2 {
    margin: 0 0 8px;
    font-size: 19px;
    line-height: 1.15;
}

.admin-archive-user-form {
    gap: 4px;
}

.admin-archive-user-form label {
    gap: 4px;
    font-size: 11px;
}

.admin-archive-user-form select {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 5px 8px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
}

.admin-archive-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(155px, 0.75fr);
    align-items: end;
    gap: 8px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-2);
}

.admin-archive-search-form,
.admin-archive-page-size-form {
    display: grid;
    min-width: 0;
    gap: 3px;
    margin: 0;
}

.admin-archive-search-form > label,
.admin-archive-page-size-form > label {
    color: var(--navy);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.admin-archive-control-row {
    display: flex;
    min-width: 0;
    align-items: stretch;
    gap: 4px;
}

.admin-archive-control-row input {
    min-width: 0;
    min-height: 30px;
    height: 30px;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 10px;
}

.admin-archive-search-form input[type="search"] {
    width: 100%;
    flex: 1 1 auto;
}

.admin-archive-page-size-form input[type="number"] {
    width: 72px;
    flex: 1 1 72px;
}

.admin-archive-control-row .button.small {
    width: auto;
    min-width: 0;
    min-height: 30px;
    height: 30px;
    padding: 4px 8px;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

.admin-archive-results-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.25;
}

.admin-archive-table {
    margin-top: 8px;
    overflow-x: hidden;
}

.admin-archive-table table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 11px;
}

.admin-archive-table .admin-archive-serial-column {
    width: 6%;
}

.admin-archive-table .admin-archive-date-column {
    width: 14%;
}

.admin-archive-table .admin-archive-sheet-column {
    width: 23%;
}

.admin-archive-table .admin-archive-template-column {
    width: 18%;
}

.admin-archive-table .admin-archive-rows-column {
    width: 6%;
}

.admin-archive-table .admin-archive-downloads-column {
    width: 33%;
}

.admin-archive-table th,
.admin-archive-table td {
    padding: 6px 7px;
    line-height: 1.25;
}

.admin-archive-table th {
    font-size: 10px;
}

.admin-archive-table td {
    overflow-wrap: anywhere;
    vertical-align: top;
}

.admin-archive-table th:nth-child(1),
.admin-archive-table td:nth-child(1),
.admin-archive-table th:nth-child(5),
.admin-archive-table td:nth-child(5) {
    text-align: center;
}

.admin-archive-date,
.admin-archive-time {
    display: block;
    white-space: nowrap;
}

.admin-archive-time {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.admin-archive-sheet-value .mini-note {
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.25;
}

.admin-archive-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 4px;
}

.admin-archive-actions .button.small {
    width: 100%;
    min-width: 0;
    min-height: 26px;
    padding: 3px 5px;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
}

.admin-archive-actions .admin-archive-delete-form {
    display: grid;
    width: 100%;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
}

.admin-archive-delete-form input[type="password"] {
    width: 100%;
    min-width: 0;
    min-height: 28px;
    height: 28px;
    padding: 3px 7px;
    font-size: 10px;
}

.admin-archive-delete-form .button.small {
    width: auto;
    min-height: 28px;
    padding-inline: 8px;
}

.admin-archive-pagination {
    justify-content: center;
    gap: 4px;
    margin-top: 9px;
}

.admin-archive-pagination .button.small {
    min-width: 28px;
    min-height: 28px;
    padding: 4px 7px;
    font-size: 10px;
    line-height: 1;
}

@media (max-width: 720px) {
    .admin-archive-section {
        padding: 12px;
    }

    .admin-archive-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-archive-page-size-form input[type="number"] {
        max-width: 110px;
    }

    .admin-archive-results-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .admin-archive-table {
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .admin-archive-table table,
    .admin-archive-table tbody {
        display: block;
        width: 100%;
    }

    .admin-archive-table colgroup,
    .admin-archive-table thead {
        display: none;
    }

    .admin-archive-table tbody {
        display: grid;
        gap: 8px;
    }

    .admin-archive-table tbody tr {
        display: block;
        padding: 7px 9px;
        border: 1px solid var(--line);
        border-radius: 7px;
        background: var(--surface);
    }

    .admin-archive-table tbody tr td,
    .admin-archive-table tbody tr:nth-child(even) td {
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 7px;
        padding: 4px 0;
        border: 0;
        background: transparent;
        text-align: left;
    }

    .admin-archive-table td::before {
        content: attr(data-label);
        color: var(--navy);
        font-size: 10px;
        font-weight: 900;
    }

    .admin-archive-table td > * {
        min-width: 0;
    }

    .admin-archive-date,
    .admin-archive-time {
        display: inline;
    }

    .admin-archive-time {
        margin: 0 0 0 5px;
    }
}

.button.small {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.button.small.icon-button {
    width: 32px;
    min-width: 32px;
    padding-inline: 0;
    font-size: 21px;
    line-height: 1;
}

.course-options-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.empty-state {
    margin-top: 14px;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: var(--surface-2);
}

.theme-dark .archive-count {
    background: #243244;
    color: #d7ecff;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.toggle-row input {
    width: 18px;
    min-height: 18px;
}

.toggle-row small {
    display: block;
    color: var(--muted);
    font-weight: 600;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.status-open {
    border-color: rgba(8, 127, 91, 0.25);
    background: rgba(8, 127, 91, 0.08);
    color: var(--green);
}

.status-closed {
    border-color: var(--line);
    background: var(--surface-2);
    color: var(--muted);
}

.ticket-list {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.ticket-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.ticket-card.is-closed {
    opacity: 0.72;
}

.ticket-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.ticket-head strong,
.ticket-head span {
    display: block;
}

.ticket-head span,
.ticket-meta {
    color: var(--muted);
    font-size: 13px;
}

.ticket-meta {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.ticket-card p {
    margin: 12px 0;
    color: var(--ink);
}

.attachment-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ticket-action {
    margin: 12px 0 0;
}

.inline-form,
.inline-reset-form {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.inline-form {
    justify-content: center;
}

.inline-form .button.small,
.inline-reset-form .button.small {
    min-height: 24px;
    padding: 2px 5px;
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
}

.status-pill.success {
    color: var(--green);
    background: #e8fff3;
}

.status-pill.warning {
    color: #8a5a12;
    background: #fff3cf;
}

.theme-dark .status-pill.success {
    background: #123327;
}

.theme-dark .status-pill.warning {
    color: #f4c76b;
    background: #2b2415;
}

.student-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.abc-limit-meter {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}

.abc-limit-meter-head,
.abc-limit-meter-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.abc-limit-meter-head span,
.abc-limit-meter-meta span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.abc-limit-meter-head strong {
    color: var(--navy);
    font-size: 18px;
    font-weight: 950;
    white-space: nowrap;
}

.abc-limit-meter-meta {
    flex-wrap: wrap;
}

.abc-limit-meter-meta strong {
    color: var(--ink);
    font-weight: 950;
}

.abc-limit-track {
    height: 12px;
    overflow: hidden;
    border: 1px solid rgba(23, 105, 170, 0.18);
    border-radius: 999px;
    background: rgba(23, 105, 170, 0.08);
}

.abc-limit-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--green));
    transition: width 220ms ease;
}

.abc-limit-meter.is-over-limit .abc-limit-track {
    border-color: rgba(180, 35, 24, 0.26);
    background: rgba(180, 35, 24, 0.10);
}

.abc-limit-meter.is-over-limit .abc-limit-track span {
    background: linear-gradient(90deg, #d97706, var(--red));
}

.inline-form .button.small {
    min-height: 22px;
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 10px;
}

.inline-reset-form input {
    width: 116px;
    min-height: 26px;
    padding: 3px 5px;
    font-size: 11px;
}

.compact-empty {
    margin-top: 12px;
    padding: 16px;
}

.struck-row {
    color: var(--muted);
    opacity: 0.58;
    text-decoration: line-through;
}

.request-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.request-actions form {
    margin: 0;
}

.request-actions .button.small {
    min-height: 24px;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1.1;
}

.mapping-control-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    justify-content: stretch;
    gap: 12px;
    margin: 18px 0 0;
    padding: 14px 16px;
}

.mapping-control-form label {
    min-width: 0;
    width: 100%;
}

.mapping-control-form button {
    min-width: 150px;
    min-height: 44px;
    white-space: nowrap;
}

.subject-count-form .mini-note {
    grid-column: 1 / -1;
    margin: 0;
}

.mapping-tools-form button {
    min-width: 190px;
}

.worksheet-selection-form {
    gap: 20px;
}

.selection-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.selection-mode legend {
    width: 100%;
    margin-bottom: 4px;
    font-weight: 700;
}

.selection-mode label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-2);
    cursor: pointer;
}

.selection-mode input {
    width: auto;
    margin: 0;
}

@media (max-width: 940px) {
    .hero,
    .workflow-band,
    .process-band {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 0;
    }

    .hero-copy h1 {
        font-size: 42px;
    }

    .feature-band {
        grid-template-columns: 1fr;
    }

    .marketing-hero {
        min-height: 680px;
    }

    .hero-shade {
        background: rgba(244, 241, 234, 0.88);
    }

    .view-home .hero-shade {
        background:
            radial-gradient(circle at 76% 42%, rgba(23, 213, 168, 0.14), transparent 34%),
            linear-gradient(90deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 251, 252, 0.96) 68%, rgba(242, 248, 249, 0.76) 100%);
    }

    .view-home .nad-scene {
        opacity: 0.64;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }

    .employee-card-grid,
    .employee-card-grid.compact-dashboard-grid,
    .permission-denied-page {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cta-band {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        padding: 12px 18px;
    }

    .section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-toggle {
        display: inline-flex;
    }

    nav {
        grid-column: 1 / -1;
        display: none;
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--surface);
        box-shadow: 0 18px 34px rgba(24, 33, 47, 0.12);
    }

    .nav-open nav {
        display: flex;
    }

    nav a,
    nav button {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }

    nav form {
        width: 100%;
    }

    .section-actions {
        justify-content: flex-start;
        margin-left: 0;
    }

    .section-actions .button {
        flex: 1 1 220px;
        justify-content: center;
    }

    .brand-label {
        max-width: 100%;
    }

    .site-footer {
        flex-wrap: wrap;
        gap: 8px 12px;
        text-align: center;
    }

    .panel {
        padding: 20px;
    }

    .auto-mapper-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .auto-mapper-count {
        padding-left: 14px;
    }

    .auto-mapper-principle,
    .mapper-flow,
    .mapper-safety-band,
    .detection-summary,
    .mapping-analysis-band,
    .reconciliation-metrics,
    .reconciliation-details {
        grid-template-columns: 1fr;
    }

    .reconciliation-summary {
        margin-right: -20px;
        margin-left: -20px;
        padding-right: 20px;
        padding-left: 20px;
    }

    .migration-package-flow {
        grid-template-columns: 1fr;
    }

    .migration-download-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .migration-package-mode,
    .migration-download-credentials,
    .migration-encryption-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .migration-download-submit {
        align-items: stretch;
        flex-direction: column;
    }

    .migration-result-grid,
    .migration-cleanup-summary {
        grid-template-columns: 1fr;
    }

    .migration-submit-row,
    .migration-cleanup-form {
        align-items: stretch;
        grid-template-columns: minmax(0, 1fr);
        flex-direction: column;
    }

    .student-stats-grid {
        grid-template-columns: 1fr;
    }

    .abc-limit-meter-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .abc-limit-meter-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .employee-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .employee-hero-badge {
        width: 100%;
        height: auto;
        min-height: 92px;
        align-content: center;
        border-radius: 18px;
    }

    .employee-card-grid,
    .employee-card-grid.compact-dashboard-grid,
    .permission-denied-page {
        grid-template-columns: 1fr;
    }

    .employee-tool-card {
        min-height: 118px;
    }

    .permission-visual {
        min-height: 170px;
    }

    .mapper-safety-band {
        margin-right: -20px;
        margin-left: -20px;
        padding-right: 20px;
        padding-left: 20px;
    }

    .hero-copy h1 {
        font-size: 34px;
    }

    .view-home .eyebrow {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .view-home .nad-scene {
        opacity: 0.46;
    }

    .visual-stats,
    .import-review-stats,
    .visual-table,
    .workflow li,
    .settings-grid,
    .result-template-setting,
    .account-grid,
    .abc-tools-grid,
    .dashboard-grid,
    .comparison-grid,
    .conflict-columns,
    .admin-grid,
    .match-file-grid,
    .match-pair,
    .abc-edit-form,
    .mapping-control-form,
    .admin-user-filter-grid,
    .filter-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .active-template-band {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: start;
    }

    .active-template-actions {
        width: 100%;
        justify-content: space-between;
    }

    .mapping-configuration-lock,
    .mapping-override-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .mapping-configuration-lock form,
    .mapping-configuration-lock button {
        width: 100%;
    }

    .template-column-list,
    .mapping-override-counts,
    .mapping-override-diff {
        grid-template-columns: 1fr;
    }

    .mapping-override-backdrop {
        align-items: end;
        padding: 0;
    }

    .mapping-override-dialog {
        width: 100%;
        max-height: 94vh;
        padding: 18px 15px;
        border-radius: 14px 14px 0 0;
    }

    .mapping-override-heading h1 {
        font-size: 21px;
    }

    .mapping-override-actions {
        position: sticky;
        bottom: -18px;
        margin: 15px -15px -18px;
        padding: 12px 15px 18px;
        background: var(--surface);
    }

    .mapping-override-actions button {
        flex: 1 1 100%;
        min-width: 0;
    }

    .mapping-option-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .mapping-checkbox-option {
        width: 100%;
        white-space: normal;
    }

    .visual-table div,
    .visual-table div:nth-child(3n),
    .visual-table div:nth-last-child(-n + 3) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .visual-table div:last-child {
        border-bottom: 0;
    }
}
