:root {
    --navy: #132033;
    --muted: #667085;
    --line: #e5e7eb;
    --surface: #ffffff;
    --background: #f4f6f2;
    --lime: #dfff45;
    --lime-dark: #74a900;
    --danger: #b42318;
    --warning: #b54708;
    --ease-out: cubic-bezier(.23, 1, .32, 1);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--navy); font: 15px/1.5 Inter, "Segoe UI", Arial, sans-serif; }
a { color: #245fa8; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { min-height: 68px; display: flex; align-items: center; gap: 32px; padding: 0 32px; background: var(--navy); color: white; }
.brand { color: var(--lime); font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 22px; flex: 1; }
.topbar nav a { color: #e6ebf2; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 18px; color: #d3d9e3; }
.topbar-actions form { margin: 0; }
.link-button, .organization-menu button { border: 0; background: none; color: inherit; cursor: pointer; font: inherit; padding: 0; }
.organization-menu { position: relative; }
.organization-menu summary { cursor: pointer; }
.organization-menu[open] { background: #23334a; padding: 10px; border-radius: 8px; }
.organization-menu form { padding-top: 8px; }
.container { max-width: 1380px; margin: 0 auto; padding: 36px 32px 72px; }
.auth-container { max-width: 520px; min-height: 100vh; display: grid; place-items: center; }
.auth-card, .panel, .metric { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(19,32,51,.05); }
.auth-card { width: 100%; padding: 42px; }
h1 { margin: 4px 0 8px; font-size: 34px; line-height: 1.15; letter-spacing: -.8px; }
h2 { margin: 0; font-size: 20px; }
p { color: var(--muted); }
.eyebrow { color: var(--lime-dark); font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.page-heading p { margin: 4px 0 0; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.compact-grid { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.metric { padding: 22px; }
.metric span { display: block; color: var(--muted); font-weight: 600; }
.metric strong { display: block; margin-top: 6px; font-size: 32px; }
.metric strong.small { font-size: 16px; margin-top: 12px; }
.metric.warning { border-color: #fedf89; }
.panel { padding: 24px; margin-bottom: 22px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.search-mode-form { display: grid; gap: 18px; }
.search-mode-form fieldset { margin: 0; padding: 0; border: 0; }
.mode-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mode-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; cursor: pointer; }
.mode-choice:has(input:checked) { border-color: #a6d332; background: #fbffe9; box-shadow: inset 0 0 0 1px #a6d332; }
.mode-choice input { margin-top: 4px; }
.mode-choice span, .mode-choice strong, .mode-choice small { display: block; min-width: 0; }
.mode-choice small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.search-mode-options { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.search-mode-options label { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.actions, .form-actions { display: flex; gap: 10px; }
.button.disabled { opacity: .45; pointer-events: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; letter-spacing: .4px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 750; cursor: pointer; font: inherit; transition: transform 140ms var(--ease-out), background-color 140ms ease, border-color 140ms ease; }
.button:hover { text-decoration: none; }
.button:active { transform: scale(.98); }
.button:disabled { cursor: wait; opacity: .65; }
.button.compact { min-height: 36px; padding: 7px 12px; }
.button.primary { background: var(--lime); color: var(--navy); }
.button.secondary { background: white; border-color: #cfd5dd; color: var(--navy); }
.button.danger { background: white; border-color: #fda29b; color: var(--danger); }
.button.is-loading, .link-button.is-loading { cursor: wait; pointer-events: none; }
.button.is-loading::before, .link-button.is-loading::before { content: ""; flex: 0 0 auto; width: 16px; height: 16px; margin-right: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: loader-spin .65s linear infinite; }
.global-loader { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: rgba(244, 246, 242, .42); cursor: wait; backdrop-filter: blur(1px); }
.global-loader[hidden] { display: none; }
.global-loader-card { display: inline-flex; align-items: center; gap: 11px; min-height: 48px; padding: 11px 17px; border: 1px solid rgba(19, 32, 51, .12); border-radius: 13px; background: white; box-shadow: 0 16px 42px rgba(19, 32, 51, .16); color: var(--navy); font-weight: 750; }
.loading-spinner { width: 19px; height: 19px; border: 2px solid #d8dee7; border-top-color: var(--lime-dark); border-radius: 50%; animation: loader-spin .65s linear infinite; }
@keyframes loader-spin { to { transform: rotate(360deg); } }
.badge { display: inline-block; padding: 4px 9px; border-radius: 999px; background: #eef2f6; color: #475467; font-size: 12px; font-weight: 750; white-space: nowrap; }
.badge.completed, .badge.active, .badge.matched, .badge.succeeded, .badge.pass { background: #dcfae6; color: #067647; }
.badge.running, .badge.queued, .badge.submitted { background: #dbeafe; color: #175cd3; }
.badge.review_required, .badge.ambiguous, .badge.retry_wait, .badge.not_found, .badge.warning { background: #fef0c7; color: var(--warning); }
.badge.failed, .badge.error, .badge.rejected, .badge.cancelled, .badge.blocking { background: #fee4e2; color: var(--danger); }
.empty-state { padding: 54px 24px; text-align: center; color: var(--muted); }
.empty-state.compact { padding: 24px; }
.form-panel { max-width: 820px; }
.catalog-search-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.catalog-search-tabs .button { min-height: 36px; padding: 7px 13px; }
.catalog-search-form { padding-top: 2px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 18px; }
.settings-card { position: relative; min-height: 190px; padding: 24px; color: var(--navy); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(19,32,51,.05); }
.settings-card:hover { border-color: #a6d332; text-decoration: none; transform: translateY(-1px); }
.settings-card > span { color: var(--lime-dark); font-weight: 800; font-size: 12px; }
.settings-card h2 { margin-top: 18px; }
.settings-card p { margin: 8px 42px 0 0; }
.settings-card strong { position: absolute; right: 24px; bottom: 18px; font-size: 28px; }
.model-form hr { margin: 30px 0; border: 0; border-top: 1px solid var(--line); }
.model-form h2 { margin-bottom: 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 18px; }
.detail-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.detail-grid strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.readiness-list { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 12px; }
.readiness-item { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.readiness-item p { margin: 3px 0; }
.readiness-item small { display: block; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.readiness-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #eef2f6; font-weight: 900; }
.readiness-mark.pass { background: #dcfae6; color: #067647; }
.readiness-mark.warning { background: #fef0c7; color: var(--warning); }
.readiness-mark.blocking { background: #fee4e2; color: var(--danger); }
.timeline { display: grid; gap: 0; margin-top: 20px; }
.timeline-item { display: grid; grid-template-columns: 145px 1fr; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); }
.timeline-item time { color: var(--muted); font-size: 13px; }
.timeline-item p { margin: 3px 0 0; }
.timeline-item.error { color: var(--danger); }
.model-form p, .stacked-form label { display: grid; gap: 7px; margin: 0 0 19px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cfd5dd; border-radius: 9px; background: white; color: var(--navy); font: inherit; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.helptext { color: var(--muted); font-size: 13px; font-weight: 400; }
.errorlist { margin: 0 0 6px; padding-left: 20px; color: var(--danger); }
.messages { margin-bottom: 18px; }
.message { padding: 13px 16px; border-radius: 10px; background: #eaf8cc; border: 1px solid #b9df54; }
.message.error { color: var(--danger); background: #fee4e2; border-color: #fda29b; }
.review-list, .candidate-list { display: grid; gap: 18px; }
.review-item { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.review-product { padding: 18px 20px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.review-product h3 { margin: 10px 0 4px; font-size: 17px; }
.review-product p { margin: 0; }
.selected-document { margin-top: 10px; color: #067647; font-weight: 700; }
.compact-candidates { padding: 16px; }
.candidate-card { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.candidate-rank { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eef2f6; font-weight: 800; }
.candidate-title { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; font-weight: 800; }
.candidate-meta { margin-top: 7px; color: var(--muted); }
.candidate-main p { margin: 10px 0; line-height: 1.45; }
.evidence { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.evidence span { padding: 4px 8px; border-radius: 7px; font-size: 12px; background: #eef2f6; color: #475467; }
.evidence.positive span { background: #ecfdf3; color: #067647; }
.evidence.risks span { background: #fff7ed; color: #b54708; }
.candidate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.candidate-actions form { margin: 0; }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #102000; font-size: 12px; font-weight: 800; }
.recent-jobs-table { table-layout: fixed; }
.recent-jobs-table th:nth-child(1) { width: 22%; }
.recent-jobs-table th:nth-child(2) { width: 48%; }
.recent-jobs-table th:nth-child(3) { width: 30%; }
.recent-jobs-table td { overflow-wrap: anywhere; }
.notifications-panel { padding: 0; overflow: hidden; }
.notification-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.notification-toolbar form { margin: 0; }
.notification-tabs { display: flex; align-items: center; gap: 8px; }
.notification-list { display: block; }
.notification-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; min-width: 0; padding: 20px 24px; border: 0; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; background: white; }
.notification-item:last-child { border-bottom: 0; }
.notification-item.unread { border-left-color: var(--lime-dark); background: #fdfff8; }
.notification-item.error { border-left-color: #dc2626; }
.notification-item.error.unread { background: #fffafa; }
.notification-content { min-width: 0; }
.notification-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.notification-item h2 { margin: 8px 0 3px; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.notification-item p { margin: 0; color: #475467; line-height: 1.45; overflow-wrap: anywhere; }
.notification-delivery { display: block; margin-top: 7px; color: var(--muted); }
.notification-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.notification-actions form { margin: 0; }
.notification-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.badge.status-1 { background: #dcfae6; color: #067647; }
.badge.status-2, .badge.status-3, .badge.status-4, .badge.status-5, .badge.status-6 { background: #fef0c7; color: #b54708; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.review-panel { padding: 0; overflow: hidden; }
.review-section-heading { padding: 22px 24px 0; margin-bottom: 0; }
.review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; }
.review-toolbar form { margin: 0; }
.review-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.review-tabs .button { min-height: 36px; padding: 7px 13px; }
.review-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review-table { min-width: 980px; }
.review-table th { position: sticky; top: 0; z-index: 1; padding: 11px 16px; background: #f8fafc; }
.review-table td { padding: 15px 16px; vertical-align: middle; }
.review-table tbody tr { transition: background-color 140ms ease; }
.review-table tbody tr:hover { background: #fbfcf8; }
.review-article { width: 15%; overflow-wrap: anywhere; }
.review-product-name { width: 38%; min-width: 310px; font-weight: 650; }
.review-manufacturer { width: 20%; min-width: 170px; color: var(--muted); }
.review-result { width: 17%; white-space: nowrap; color: var(--muted); }
.review-result a { font-weight: 700; }
.review-no-results { color: var(--warning); }
.review-row-action { width: 10%; text-align: right; white-space: nowrap; }
.button-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: #eef2f6; color: #475467; font-size: 12px; font-weight: 800; }
.candidate-dialog, .confirmation-dialog { padding: 0; color: var(--navy); background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 28px 80px rgba(19, 32, 51, .24); opacity: 0; transform: scale(.98); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
.candidate-dialog[open], .confirmation-dialog[open] { opacity: 1; transform: scale(1); }
.candidate-dialog::backdrop, .confirmation-dialog::backdrop { background: rgba(19, 32, 51, .52); backdrop-filter: blur(2px); }
.candidate-dialog { width: min(960px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: hidden; text-align: left; }
.candidate-dialog[open] { display: flex; flex-direction: column; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; min-width: 0; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.dialog-product { flex: 1 1 auto; min-width: 0; max-width: 100%; }
.dialog-header h2 { max-width: 100%; margin-top: 4px; font-size: 21px; line-height: 1.3; white-space: normal; word-break: normal; overflow-wrap: anywhere; hyphens: auto; }
.dialog-header p { max-width: 100%; margin: 5px 0 0; white-space: normal; word-break: normal; overflow-wrap: anywhere; hyphens: auto; }
.dialog-header p span { color: var(--muted); }
.dialog-kicker { display: block; max-width: 100%; color: var(--muted); font-size: 13px; font-weight: 800; white-space: normal; word-break: normal; overflow-wrap: anywhere; }
.dialog-close { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); cursor: pointer; font: 25px/1 Arial, sans-serif; transition: color 140ms ease, background-color 140ms ease, transform 140ms var(--ease-out); }
.dialog-close:hover { color: var(--navy); background: #f8fafc; }
.dialog-close:active { transform: scale(.96); }
.candidate-options { display: grid; flex: 1 1 auto; min-width: 0; min-height: 0; gap: 11px; padding: 16px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; background: #f8fafc; }
.candidate-option { min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.candidate-option-header { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; min-width: 0; }
.candidate-option-header > * { min-width: 0; }
.candidate-document { min-width: 0; }
.candidate-option .candidate-title { display: block; max-width: 100%; line-height: 1.35; white-space: normal; word-break: normal; overflow-wrap: anywhere; hyphens: auto; }
.candidate-option .candidate-title a { display: inline; max-width: 100%; white-space: normal; word-break: normal; overflow-wrap: anywhere; }
.candidate-option .candidate-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; margin-top: 5px; color: var(--muted); font-size: 13px; }
.candidate-option-body { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr); align-items: start; gap: 20px; min-width: 0; margin: 13px 0 0 44px; }
.candidate-option-body > *, .candidate-field { min-width: 0; max-width: 100%; }
.candidate-field-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .45px; text-transform: uppercase; }
.candidate-field strong, .candidate-field p { display: block; max-width: 100%; white-space: normal; word-break: normal; overflow-wrap: anywhere; hyphens: auto; }
.candidate-field p { margin: 0; color: #475467; line-height: 1.45; }
.candidate-preview { overflow: visible; }
.candidate-select { align-self: start; }
.candidate-select form, .dialog-footer form { margin: 0; }
.candidate-details { min-width: 0; margin: 13px 0 0 44px; padding-top: 11px; border-top: 1px solid #eef0f3; }
.candidate-details summary { width: fit-content; color: #245fa8; cursor: pointer; font-size: 13px; font-weight: 750; }
.candidate-details-content { display: grid; gap: 13px; min-width: 0; padding-top: 12px; }
.candidate-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; color: var(--muted); font-size: 12px; }
.candidate-codes span { min-width: 0; padding: 9px 10px; border-radius: 9px; background: #f8fafc; overflow-wrap: anywhere; }
.candidate-codes strong { display: block; margin-bottom: 2px; color: #475467; }
.dialog-footer { display: flex; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--line); background: #f8fafc; }
.confirmation-dialog { width: min(460px, calc(100vw - 32px)); padding: 28px; text-align: center; }
.confirmation-dialog p { margin: 10px 0 22px; overflow-wrap: anywhere; }
.confirmation-mark { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 15px; border-radius: 50%; background: var(--lime); font-size: 22px; font-weight: 900; }
.confirmation-actions { display: flex; justify-content: center; gap: 10px; }
.review-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; min-height: 74px; padding: 16px 24px; }
.pagination-summary { color: var(--muted); font-size: 13px; }
.page-numbers { display: flex; align-items: center; justify-content: center; gap: 5px; }
.page-link { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; color: var(--navy); font-weight: 700; }
.page-link:hover { background: #f3f6ef; text-decoration: none; }
.page-link.current { background: var(--lime); }
.page-link.disabled { color: #98a2b3; pointer-events: none; }
.page-direction { border-color: var(--line); }
.page-ellipsis { min-width: 24px; text-align: center; color: var(--muted); }
.page-size-form { display: flex; align-items: center; justify-content: flex-end; gap: 9px; color: var(--muted); font-size: 13px; }
.page-size-form select { width: auto; min-width: 70px; padding: 7px 28px 7px 9px; }
@starting-style {
    .candidate-dialog[open], .confirmation-dialog[open] { opacity: 0; transform: scale(.98); }
}
@media (max-width: 1050px) { .metric-grid, .settings-grid { grid-template-columns: repeat(3, 1fr); } .topbar { align-items: flex-start; flex-wrap: wrap; padding: 18px 24px; } .topbar nav { order: 3; flex-basis: 100%; overflow-x: auto; } }
@media (max-width: 820px) { .candidate-option-body { grid-template-columns: 1fr; gap: 12px; } .candidate-codes { grid-template-columns: 1fr; } .review-pagination { grid-template-columns: 1fr; justify-items: center; } .pagination-summary { order: 2; } .page-size-form { order: 3; justify-content: center; } }
@media (max-width: 760px) { .notification-toolbar { align-items: stretch; flex-direction: column; } .notification-tabs { display: grid; grid-template-columns: 1fr 1fr; } .notification-tabs .button, .notification-toolbar form .button { width: 100%; } .notification-item { grid-template-columns: 1fr; gap: 14px; padding: 18px; } .notification-actions { justify-content: flex-start; } .notification-pagination { align-items: stretch; flex-direction: column; } }
@media (max-width: 680px) { .container { padding: 24px 16px 48px; } .page-heading { align-items: flex-start; flex-direction: column; } .metric-grid, .settings-grid, .detail-grid, .readiness-list, .mode-choice-grid { grid-template-columns: 1fr; } .topbar-actions { margin-left: auto; } .timeline-item { grid-template-columns: 1fr; gap: 4px; } .review-toolbar { align-items: stretch; flex-direction: column; padding: 14px 16px; } .review-tabs { display: grid; grid-template-columns: 1fr; } .review-tabs .button { width: 100%; } .dialog-header { padding: 18px; } .candidate-options { padding: 10px; } .candidate-option { padding: 13px; } .candidate-option-header { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; } .candidate-select { grid-column: 2; justify-self: start; } .candidate-option-body, .candidate-details { margin-left: 40px; } .dialog-footer { padding: 12px 18px; } .confirmation-actions { display: grid; grid-template-columns: 1fr; } }
@media (max-width: 430px) { .candidate-option-body, .candidate-details { margin-left: 0; } .candidate-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); } }
@media (prefers-reduced-motion: reduce) { .button, .dialog-close, .candidate-dialog, .confirmation-dialog { transition-duration: 0ms; } .loading-spinner, .button.is-loading::before, .link-button.is-loading::before { animation: none; } }

/* Email proxy routes */
.route-table { min-width: 980px; }
.route-table th:first-child { width: 23%; }
.route-table th:nth-child(2), .route-table th:nth-child(3) { width: 29%; }
.route-table td { overflow-wrap: anywhere; }
.route-primary-pair { display: block; margin-top: 5px; color: #245fa8; font-size: 13px; font-weight: 700; }
.route-table-secondary { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.route-address-list { display: grid; gap: 4px; }
.route-address-list span { min-width: 0; overflow-wrap: anywhere; }
.route-address-list b { display: inline-block; min-width: 35px; color: var(--muted); font-size: 11px; letter-spacing: .35px; }
.route-table-empty { color: var(--muted); }
.route-table-action { width: 1%; text-align: right; white-space: nowrap; }
.route-editor { max-width: 1120px; }
.route-editor-section { padding: 26px; }
.route-editor-section .panel-heading p { margin: 3px 0 0; }
.route-recipient-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.route-sender-grid, .route-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.route-form-field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.route-form-field > label { font-weight: 750; }
.route-form-field textarea { min-height: 104px; resize: vertical; }
.route-form-field.has-error input, .route-form-field.has-error select, .route-form-field.has-error textarea { border-color: #f04438; }
.route-form-field .errorlist { order: 3; margin: 0; }
.route-form-field-wide { grid-column: 1 / -1; }
.route-active-field { width: fit-content; margin-top: 20px; }
.route-editor-actions { position: sticky; bottom: 14px; z-index: 4; display: flex; gap: 10px; width: fit-content; margin-left: auto; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .94); box-shadow: 0 12px 32px rgba(19, 32, 51, .12); backdrop-filter: blur(6px); }

@media (max-width: 880px) {
    .route-recipient-grid, .route-sender-grid, .route-form-grid { grid-template-columns: 1fr; }
    .route-form-field-wide { grid-column: 1; }
}
@media (max-width: 680px) {
    .route-editor-section { padding: 20px 16px; }
    .route-editor-actions { position: static; display: grid; width: 100%; margin: 0; }
    .route-editor-actions .button { width: 100%; }
}

/* Brand mapping workspace */
.brand-page-heading { align-items: center; }
.brand-heading-actions { display: flex; align-items: center; gap: 10px; }
.workspace-menu { position: relative; }
.workspace-menu > summary { list-style: none; cursor: pointer; }
.workspace-menu > summary::-webkit-details-marker { display: none; }
.workspace-menu[open] > summary { transform: scale(.97); }
.workspace-menu-card { position: absolute; top: calc(100% + 10px); right: 0; z-index: 12; display: grid; width: min(390px, calc(100vw - 32px)); gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 20px 55px rgba(19, 32, 51, .18); }
.workspace-menu-card label, .brand-settings-form > label:not(.checkbox-row), .brand-manual-form > label, .brand-candidate-actions label { color: #475467; font-size: 13px; font-weight: 700; }
.workspace-menu-card textarea { resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 0; color: #475467; font-weight: 650; }
.checkbox-row input { width: auto; }
.brand-batch-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 66px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.brand-batch-bar > div:first-child { display: grid; gap: 2px; }
.brand-batch-bar span { color: var(--muted); font-size: 13px; }
.brand-run-progress { flex: 1 1 280px; max-width: 460px; height: 8px; overflow: hidden; border-radius: 999px; background: #e8edf2; }
.brand-run-progress span { display: block; height: 100%; border-radius: inherit; background: var(--lime-dark); transition: width 220ms var(--ease-out); }
.brand-workspace { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); min-height: 720px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 10px 30px rgba(19, 32, 51, .05); }
.brand-sidebar { display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--line); background: #f8fafc; }
.brand-list-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.brand-list-search input { min-width: 0; }
.brand-status-filters { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.brand-status-filters a { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 6px 9px; border-radius: 8px; color: #475467; font-size: 12px; font-weight: 700; }
.brand-status-filters a:hover { background: #eef2e9; text-decoration: none; }
.brand-status-filters a.current { background: var(--lime); color: var(--navy); }
.brand-status-filters span { color: inherit; opacity: .72; }
.brand-list { flex: 1 1 auto; min-height: 0; max-height: 710px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.brand-list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 11px 14px; border-bottom: 1px solid #e9edf1; color: var(--navy); }
.brand-list-item:hover { background: #f2f6ed; text-decoration: none; }
.brand-list-item.selected { box-shadow: inset 4px 0 0 var(--lime-dark); background: white; }
.brand-list-item strong { min-width: 0; overflow-wrap: anywhere; }
.brand-state { display: inline-flex; align-items: center; width: fit-content; padding: 3px 7px; border-radius: 999px; background: #eef2f6; color: #667085; font-size: 11px; font-weight: 750; white-space: nowrap; }
.brand-state.linked { background: #dcfae6; color: #067647; }
.brand-state.candidates { background: #fef0c7; color: #b54708; }
.brand-state.not-required { background: #e8efff; color: #315aa9; }
.brand-list-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.brand-list-pagination > :last-child { justify-self: end; }
.brand-list-pagination .button { min-height: 32px; padding: 5px 9px; }
.brand-detail { min-width: 0; padding: 24px 26px 34px; }
.brand-detail-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.brand-detail-header h2 { margin: 2px 0 0; font-size: 26px; overflow-wrap: anywhere; }
.brand-detail-header p { margin: 4px 0 0; overflow-wrap: anywhere; }
.brand-detail-kicker { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.brand-settings-details { margin-left: auto; }
.brand-delete-form { margin: 0; }
.brand-settings-details > summary { list-style: none; cursor: pointer; }
.brand-settings-details > summary::-webkit-details-marker { display: none; }
.brand-settings-details[open] { flex: 1 0 100%; margin-left: 0; }
.brand-settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; margin-top: 14px; padding: 16px; border-radius: 12px; background: #f8fafc; }
.brand-settings-form > label:not(.checkbox-row), .brand-settings-form > input, .brand-settings-form > textarea { grid-column: span 1; }
.brand-settings-form textarea { min-height: 80px; resize: vertical; }
.brand-settings-form .checkbox-row, .brand-settings-form .button { align-self: end; }
.brand-section-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.brand-section-heading h3 { margin: 0; font-size: 17px; }
.brand-section-heading > span { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #eef2f6; color: #475467; font-size: 12px; font-weight: 800; }
.brand-certification-section { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.brand-certification-section > div { display: grid; gap: 3px; }
.brand-certification-section > div > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.brand-certification-section form { margin: 0; }
.brand-attached-section, .brand-document-search { padding: 20px 0; border-bottom: 1px solid var(--line); }
.brand-attached-list { display: grid; gap: 8px; }
.brand-attached-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; border: 1px solid #d9e6d2; border-radius: 11px; background: #f8fff4; }
.brand-attached-item > div { display: grid; min-width: 0; gap: 3px; }
.brand-attached-item a, .brand-attached-item span { overflow-wrap: anywhere; }
.brand-attached-item span { color: var(--muted); font-size: 12px; }
.danger-text { color: var(--danger); }
.brand-document-search-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; }
.brand-document-search-form > label:not(.checkbox-row) { display: grid; gap: 5px; color: #475467; font-size: 12px; font-weight: 750; }
.brand-document-search-form .search-current-only { align-self: center; }
.brand-document-search-form > .button { justify-self: end; align-self: end; }
.brand-candidate-list { display: grid; gap: 12px; padding-top: 20px; }
.brand-candidate-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.brand-candidate-card.is-attached { border-color: #b7d7aa; background: #fbfff8; }
.brand-candidate-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.brand-candidate-topline > div { display: grid; min-width: 0; gap: 3px; }
.brand-candidate-topline a { overflow-wrap: anywhere; }
.brand-candidate-topline div > span { color: var(--muted); font-size: 13px; }
.brand-candidate-content { display: grid; gap: 5px; min-width: 0; margin-top: 12px; }
.brand-candidate-content strong { overflow-wrap: anywhere; }
.brand-candidate-content p { max-height: 10.5em; margin: 0; overflow: auto; color: #475467; white-space: normal; overflow-wrap: anywhere; scrollbar-gutter: stable; }
.brand-candidate-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef0f3; }
.brand-candidate-actions label { display: grid; min-width: 0; gap: 5px; }
.brand-candidate-actions > div { display: flex; gap: 8px; }
.brand-no-candidates { margin-top: 18px; }
.brand-manual-link { margin-top: 20px; padding: 15px 16px; border: 1px dashed #cfd7df; border-radius: 12px; }
.brand-manual-link > summary { color: #245fa8; cursor: pointer; font-weight: 750; }
.brand-manual-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; padding-top: 15px; }
.brand-manual-form > label, .brand-manual-form > input, .brand-manual-form > textarea { grid-column: span 1; }
.brand-manual-form textarea, .brand-manual-form .form-actions { grid-column: 1 / -1; }
.brand-manual-form textarea { resize: vertical; }
.brand-workspace-empty { display: grid; place-content: center; min-height: 620px; text-align: center; }
.brand-workspace-empty p { margin: 6px 0 0; }
.brand-history-note { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 20px 24px 0; padding: 14px 16px; border: 1px solid #f2d49d; border-radius: 12px; background: #fff8ea; color: #6f4a08; }

@media (max-width: 1020px) {
    .brand-workspace { grid-template-columns: 290px minmax(0, 1fr); }
    .brand-document-search-form, .brand-settings-form, .brand-manual-form { grid-template-columns: 1fr; }
    .brand-manual-form > label, .brand-manual-form > input, .brand-manual-form > textarea { grid-column: 1; }
    .brand-candidate-actions { grid-template-columns: 1fr; }
    .brand-candidate-actions > div { justify-content: flex-end; }
}
@media (max-width: 760px) {
    .brand-page-heading { align-items: stretch; }
    .brand-heading-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .brand-heading-actions .button { width: 100%; }
    .workspace-menu-card { right: auto; left: 0; }
    .brand-heading-actions .workspace-menu:last-child .workspace-menu-card { right: 0; left: auto; }
    .brand-batch-bar { align-items: stretch; flex-direction: column; }
    .brand-run-progress { flex-basis: 8px; width: 100%; max-width: none; }
    .brand-workspace { grid-template-columns: 1fr; }
    .brand-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .brand-list { max-height: 360px; }
    .brand-certification-section { align-items: stretch; flex-direction: column; }
    .brand-certification-section .button { width: 100%; }
    .brand-detail { padding: 20px 16px 28px; }
    .brand-candidate-actions > div { display: grid; grid-template-columns: 1fr; }
    .brand-candidate-actions .button { width: 100%; }
    .brand-attached-item, .brand-candidate-topline { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    .brand-run-progress span { transition-duration: 0ms; }
}
