:root {
  color-scheme: light;
  --ink: #17262b;
  --ink-soft: #536369;
  --ink-faint: #7d898a;
  --paper: #f1f5f3;
  --paper-strong: #fbfdfb;
  --paper-muted: #e5ece8;
  --line: #d9d8d1;
  --line-strong: #bfc3bd;
  --navy: #18282e;
  --navy-soft: #24383e;
  --navy-muted: #8ea1a1;
  --teal: #2f6c65;
  --teal-soft: #dcece6;
  --coral: #d66c4c;
  --coral-soft: #f8e2da;
  --amber: #9d6e1e;
  --amber-soft: #fbefd0;
  --danger: #b54d42;
  --danger-soft: #f9dfdc;
  --shadow: 0 14px 28px rgba(27, 39, 41, 0.09);
  --radius: 14px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body { margin: 0; color: var(--ink); background: var(--paper); }

.auth-root { display: grid; min-height: 100vh; place-items: center; padding: 32px; background: var(--paper); }
.auth-root[hidden], #app[hidden] { display: none !important; }
.auth-screen { display: grid; grid-template-columns: minmax(0, .92fr) minmax(380px, 1.08fr); width: min(940px, 100%); min-height: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-strong); box-shadow: var(--shadow); }
.auth-brand-panel { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; padding: clamp(30px, 5vw, 54px); color: #edf1ec; background: var(--navy); }
.auth-brand-panel .brand-lockup { padding: 0; }
.auth-brand-copy { margin: auto 0; }
.auth-brand-copy h1 { max-width: 11em; margin: 0; color: inherit; font-size: 32px; line-height: 1.3; letter-spacing: -.03em; }
.auth-brand-copy p { max-width: 34ch; margin: 14px 0 0; color: #b9cbc6; font-size: 13px; line-height: 1.7; }
.auth-brand-foot { margin: 0; color: #a0bbb4; font-size: 11px; }
.auth-brand-foot span { margin: 0 5px; }
.auth-form-panel { display: flex; min-width: 0; align-items: center; justify-content: center; padding: clamp(30px, 5vw, 64px); }
.auth-form-content, .auth-service-state { width: min(360px, 100%); }
.auth-form-content h2, .auth-service-state h2 { margin: 0; color: var(--ink); font-size: 23px; line-height: 1.3; letter-spacing: -.025em; }
.auth-form-intro, .auth-service-state p { margin: 8px 0 25px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.auth-form { display: grid; gap: 17px; }
.auth-field { display: grid; gap: 7px; }
.auth-field label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.auth-field input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--paper-strong); font-size: 14px; }
.auth-form .button { width: 100%; min-height: 44px; margin-top: 3px; }
.auth-form-foot { margin: 21px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 11px; line-height: 1.55; }
.auth-feedback { margin: 0 0 17px; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; line-height: 1.55; }
.auth-feedback--error { border-color: #e6bab2; color: #81362e; background: #fff0ed; }
.auth-feedback--info { border-color: #bbd9ce; color: #2b5e56; background: #edf5f1; }
.password-dialog { width: min(470px, calc(100vw - 28px)); max-width: calc(100vw - 28px); max-height: calc(100vh - 28px); overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--paper-strong); box-shadow: var(--shadow); }
.password-dialog::backdrop { background: rgba(18, 32, 36, .5); }
.password-dialog-form { display: grid; overflow: hidden; border-radius: 8px; }
.password-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 23px 25px 19px; border-bottom: 1px solid var(--line); }
.password-dialog-header h2 { margin: 0; color: var(--ink); font-size: 20px; line-height: 1.3; letter-spacing: -.02em; }
.password-dialog-header p { max-width: 38ch; margin: 7px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.password-dialog-close { min-height: 30px; padding: 0 7px; }
.password-dialog-body { display: grid; gap: 15px; padding: 21px 25px 18px; }
.password-dialog-body .auth-feedback { margin: 0; }
.password-dialog-body .auth-field input { min-height: 42px; }
.password-dialog-hint { margin: -3px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.password-dialog-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 25px 20px; border-top: 1px solid var(--line); }
.change-password-trigger { min-height: 32px; padding: 0 8px; white-space: nowrap; }
.auth-service-state h2 { font-size: 19px; }
.auth-service-state p { margin-bottom: 0; }
.auth-service-state .button { margin-top: 18px; }
.auth-progress { height: 5px; margin-top: 20px; overflow: hidden; border-radius: 99px; background: var(--paper-muted); }
.auth-progress span { display: block; width: 35%; height: 100%; margin-inline-start: 32.5%; border-radius: inherit; background: var(--teal); }

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

button { cursor: pointer; }

.icon-svg { display: block; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dropzone-icon .icon-svg { width: 23px; height: 23px; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(214, 108, 76, 0.35);
  outline-offset: 2px;
}

::selection { color: var(--paper-strong); background: var(--teal); }

.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100vh; min-height: 100vh; overflow: hidden; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 252px;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  padding: 30px 18px 22px;
  color: #edf1ec;
  background: var(--navy);
}

.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 10px; }

.brand-mark { display: grid; grid-template-columns: repeat(3, 6px); align-items: end; gap: 3px; width: 24px; height: 24px; padding: 4px; border: 1px solid rgba(226, 241, 231, 0.35); border-radius: 7px; }
.brand-mark span { display: block; background: #d9ede3; border-radius: 2px; }
.brand-mark span:nth-child(1) { height: 7px; opacity: .72; }
.brand-mark span:nth-child(2) { height: 12px; opacity: .9; }
.brand-mark span:nth-child(3) { height: 16px; background: #e67d5b; }
.brand-name { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.brand-subtitle { margin: 5px 0 0; color: #b3c9c2; font-size: 11px; letter-spacing: .1em; }

.sidebar-context { display: flex; align-items: center; gap: 6px; margin: 28px 10px 24px; padding: 8px 10px; border: 1px solid rgba(218, 239, 227, .13); border-radius: 9px; color: #bbcfca; font-size: 11px; }
.context-separator { color: #5d7776; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.status-dot--live { background: #8bd0a9; box-shadow: 0 0 0 3px rgba(139, 208, 169, .14); }

.nav-groups { display: grid; gap: 22px; }
.nav-group { display: grid; gap: 5px; }
.nav-label { margin: 0 11px 3px; color: #9ab7b0; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; min-height: 39px; gap: 10px; padding: 0 11px; border: 0; border-radius: 8px; color: #bdceca; background: transparent; text-align: left; font-size: 13px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .07); transform: translateX(2px); }
.nav-item.is-active { color: #fff; background: var(--navy-soft); box-shadow: inset 3px 0 0 var(--coral); }
.nav-icon { display: inline-grid; place-items: center; width: 18px; color: #a6c1ba; font-size: 16px; line-height: 1; }
.nav-item.is-active .nav-icon { color: #e98464; }
.nav-badge { min-width: 22px; margin-left: auto; padding: 2px 6px; border-radius: 10px; color: #c5d6d0; background: rgba(255, 255, 255, .08); font-size: 10px; text-align: center; }
.nav-badge--alert { color: #ffb298; background: rgba(214, 108, 76, .17); }
.nav-badge[hidden] { display: none; }
.nav-soon { margin-left: auto; color: #91aaa5; font-size: 11px; }
.nav-group--muted .nav-item { color: #7f9593; }

.sidebar-footer { margin-top: auto; padding: 26px 10px 0; color: #a0bbb4; font-size: 11px; line-height: 1.65; }
.sidebar-footer p { margin: 0; }
.footer-rule { height: 1px; margin-bottom: 12px; background: rgba(255, 255, 255, .11); }

.main-content { grid-column: 2; min-width: 0; height: 100vh; min-height: 0; overflow-x: hidden; overflow-y: auto; background: var(--paper); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 0 clamp(22px, 4vw, 58px); border-bottom: 1px solid var(--line); background: rgba(246, 243, 237, .96); }
.breadcrumb { color: var(--ink-soft); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-button { display: inline-grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: var(--paper-strong); font-size: 18px; transition: color .18s ease, border-color .18s ease, transform .18s ease; }
.icon-button:hover { color: var(--teal); border-color: var(--teal); transform: rotate(-18deg); }
.topbar-divider { width: 1px; height: 22px; background: var(--line); }
.logout-button { min-height: 32px; padding: 0 9px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; background: var(--teal); font-size: 11px; font-weight: 700; }

.view-root { width: min(1560px, 100%); margin: 0 auto; padding: 44px clamp(22px, 3vw, 48px) 68px; animation: view-enter .38s ease-out both; }
@keyframes view-enter { from { opacity: 0; transform: translateY(7px); filter: blur(1.5px); } to { opacity: 1; transform: none; filter: none; } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.page-heading h1 { max-width: 680px; margin: 0; color: var(--ink); font-size: clamp(27px, 3vw, 42px); line-height: 1.08; letter-spacing: -.035em; }
.page-heading p { max-width: 600px; margin: 11px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.page-heading--compact { margin-bottom: 23px; }
.page-heading--compact h1 { font-size: clamp(28px, 2.6vw, 36px); }
.page-heading--compact p { max-width: 520px; margin-top: 8px; }
.heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.inline-form { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.inline-form .field { min-width: 220px; }
.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; }

.eyebrow { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 11px; color: var(--coral); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: #fff; background: var(--teal); box-shadow: 0 6px 13px rgba(47, 108, 101, .18); }
.button--primary:hover { background: #245a54; }
.button--secondary { color: var(--ink); border-color: var(--line-strong); background: var(--paper-strong); }
.button--secondary:hover { border-color: var(--teal); color: var(--teal); }
.button--quiet { color: var(--ink-soft); border-color: transparent; background: transparent; }
.button--quiet:hover { color: var(--teal); background: var(--teal-soft); }
.button--danger { color: #fff; background: var(--danger); }
.button[disabled] { cursor: not-allowed; opacity: .52; transform: none; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; min-height: 23px; padding: 0 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill--ready { color: var(--teal); background: var(--teal-soft); }
.status-pill--pending { color: var(--amber); background: var(--amber-soft); }
.status-pill--danger { color: var(--danger); background: var(--danger-soft); }
.status-pill--neutral { color: var(--ink-soft); background: var(--paper-muted); }

.section-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 24px; align-items: start; }
.section-stack { display: grid; gap: 24px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-strong); box-shadow: 0 5px 15px rgba(27, 39, 41, .03); }
.panel--raised { box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 21px 23px 17px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.panel-header p { margin: 6px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.panel-body { min-width: 0; padding: 21px 23px; }

.export-panel { max-width: 1180px; }
.export-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 22px; border-top: 1px solid var(--line); }
.export-fields span { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 650; }
.export-fields small { min-width: 23px; color: var(--ink-faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.export-rule { margin-top: 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.export-rule strong { font-size: 12px; }
.export-rule p, .export-ready-note { margin: 7px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.export-feedback { margin-top: 20px; padding: 15px 17px; border-radius: 9px; }
.export-feedback strong { display: block; font-size: 13px; }
.export-feedback p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; }
.export-feedback--success { border: 1px solid #b9d7ca; color: #235e50; background: #e8f3ee; }
.export-feedback--error { border: 1px solid #e4b6ab; color: #8d342d; background: #fff0ed; }
.export-ready-note { margin-top: 21px; padding-top: 16px; border-top: 1px solid var(--line); }
.export-progress { margin-top: 20px; }
.export-progress-copy { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-soft); font-size: 12px; }
.export-progress-copy strong { color: var(--ink); font-weight: 650; }
.export-progress-track { height: 7px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: var(--paper-muted); }
.export-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--teal); transition: width .2s ease-out; }

.workflow { display: grid; grid-template-columns: 1fr; gap: 0; padding: 20px 23px 23px; }
.workflow-step { position: relative; display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 59px; }
.workflow-step:not(:last-child)::after { content: ""; position: absolute; top: 39px; left: 17px; width: 1px; height: 29px; background: var(--line); }
.step-index { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--ink-soft); background: var(--paper-strong); font-size: 11px; font-weight: 800; }
.workflow-step.is-done .step-index { border-color: var(--teal); color: #fff; background: var(--teal); }
.workflow-step.is-current .step-index { border-color: var(--coral); color: var(--coral); box-shadow: 0 0 0 4px var(--coral-soft); }
.step-copy strong { display: block; font-size: 13px; }
.step-copy span { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 11px; }
.step-state { color: var(--ink-faint); font-size: 11px; }
.workflow-step.is-current .step-state { color: var(--coral); font-weight: 700; }

.queue-list { display: grid; }
.queue-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.queue-item:first-child { padding-top: 1px; }
.queue-item:last-child { padding-bottom: 1px; border-bottom: 0; }
.queue-item strong { display: block; color: var(--ink); font-size: 13px; }
.queue-item p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.queue-count { align-self: center; color: var(--coral); font-size: 23px; font-weight: 750; letter-spacing: -.04em; }

.data-table-wrap { min-width: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 12px 16px; color: var(--ink-faint); background: var(--paper); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 16px; border-top: 1px solid var(--line); color: var(--ink-soft); vertical-align: top; }
.data-table tr:hover td { background: #fffcf7; }
.data-table td:first-child { color: var(--ink); font-weight: 700; }
.data-table a, .text-link { color: var(--teal); font-weight: 700; text-decoration: none; }
.data-table a:hover, .text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.data-table button.text-link { padding: 0; border: 0; color: var(--teal); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.import-assignments { margin: 2px 0 25px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.import-result-subheading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.import-result-subheading h3 { margin: 0; font-size: 14px; }
.import-result-subheading p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.assignment-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.assignment-counts > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 57px; padding: 10px 14px; border-right: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }
.assignment-counts > div:last-child { border-right: 0; }
.assignment-counts strong { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.assignment-counts .is-pending strong { color: var(--amber); }
.assignment-counts .is-unavailable strong { color: var(--danger); }
.assignment-records { margin-top: 16px; }
.assignment-records > summary { color: var(--teal); font-size: 12px; font-weight: 700; cursor: pointer; }
.assignment-table-scroll { max-height: 420px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
.assignment-table-scroll th { position: sticky; top: 0; z-index: 1; }
.assignment-table-scroll .data-table td { padding-top: 10px; padding-bottom: 10px; }
.assignment-queue-table table { min-width: 900px; }
.assignment-queue-table td { vertical-align: middle; }
.assignment-row-id, .assignment-problem { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.assignment-queue-source { display: block; max-width: 360px; overflow-wrap: anywhere; }
.assignment-queue-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; color: var(--ink-soft); font-size: 12px; }
.assignment-queue-error { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border: 1px solid #e6ca87; border-radius: 8px; background: var(--amber-soft); }
.assignment-queue-error strong { display: block; color: var(--ink); font-size: 13px; }
.assignment-queue-error p { margin: 5px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.assignment-queue-error small { color: var(--ink-faint); font-size: 10px; overflow-wrap: anywhere; }
.assignment-row-actions { display: flex; flex-wrap: wrap; gap: 3px; }
.assignment-review-panel { margin: 20px 0 24px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.assignment-source-summary { display: grid; gap: 5px; margin-bottom: 15px; }
.assignment-source-summary strong { color: var(--ink); font-size: 14px; }
.assignment-source-summary span, .assignment-source-summary small { color: var(--ink-soft); font-size: 11px; overflow-wrap: anywhere; }
.assignment-choice-list { display: grid; gap: 9px; }
.assignment-choice { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-strong); cursor: pointer; }
.assignment-choice:has(input:checked) { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.assignment-choice.is-blocked { color: var(--ink-faint); background: var(--paper); cursor: not-allowed; }
.assignment-choice input { flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--teal); }
.assignment-choice-content { display: grid; flex: 1; gap: 5px; min-width: 0; }
.assignment-choice-content > strong { font-size: 13px; }
.assignment-choice-content > small { color: var(--ink-soft); font-size: 11px; overflow-wrap: anywhere; }
.assignment-choice-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 16px; margin-top: 3px; }
.assignment-choice-facts span { display: flex; gap: 6px; color: var(--ink-soft); font-size: 11px; overflow-wrap: anywhere; }
.assignment-choice-facts small { min-width: 34px; color: var(--ink-faint); }
.assignment-choice-source { line-height: 1.5; }
.assignment-reason { display: grid; gap: 7px; margin: 16px 0 12px; }
.assignment-reason label { font-size: 12px; font-weight: 700; }
.assignment-reason label span { color: var(--danger); }
.assignment-reason textarea { min-height: 76px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--paper-strong); resize: vertical; }
.subject-data-row { cursor: pointer; }
.subject-data-row:focus-visible td { outline: 2px solid var(--teal); outline-offset: -2px; }
.subject-table { min-width: 1200px; font-size: 14px; }
.subject-table th { font-size: 12px; }
.subject-table td { padding: 17px 18px; }
.subject-table th:nth-child(1) { min-width: 250px; }
.subject-table th:nth-child(2) { min-width: 145px; }
.subject-table th:nth-child(3) { min-width: 140px; }
.subject-table th:nth-child(4), .subject-table th:nth-child(5) { min-width: 145px; }
.subject-table th:nth-child(6) { min-width: 260px; }
.subject-table th:nth-child(7) { min-width: 150px; }
.subject-table th:nth-child(8) { min-width: 220px; }
.comment-entry { max-width: 320px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.comment-entry + .comment-entry { margin-top: 6px; }
.comment-entry > span { color: var(--ink-soft); font-weight: 700; }
.subject-history-table th:nth-child(13) { min-width: 220px; }
.related-subjects { flex: 0 0 auto; }
.related-subjects summary { color: var(--teal); font-size: 13px; font-weight: 700; cursor: pointer; }
.related-subjects-content { max-height: 180px; overflow: auto; padding: 8px 0; }
.subject-table .table-filter-trigger { min-height: 44px; color: var(--ink-soft); font-size: 12px; }
.subject-table .table-filter { min-height: 34px; font-size: 12px; }
.subject-table .table-filter-clear { min-height: 34px; font-size: 12px; }
.subject-history-table { min-width: 1760px; font-size: 13px; }
.subject-history-table th { font-size: 11px; }
.subject-history-table td { padding: 16px 17px; }
.subject-history-table th:nth-child(1) { min-width: 115px; }
.subject-history-table th:nth-child(2) { min-width: 125px; }
.subject-history-table td:nth-child(1), .subject-history-table td:nth-child(2) { white-space: nowrap; }
.subject-history-table th:nth-child(3) { min-width: 230px; }
.subject-history-table th:nth-child(4) { min-width: 250px; }
.subject-history-table th:nth-child(5) { min-width: 120px; }
.subject-history-table th:nth-child(6), .subject-history-table th:nth-child(7) { min-width: 135px; }
.subject-history-table th:nth-child(8) { min-width: 180px; }
.subject-history-table th:nth-child(9) { min-width: 70px; }
.subject-history-table th:nth-child(10) { min-width: 125px; }
.subject-history-table th:nth-child(11) { min-width: 125px; }
.subject-history-table th:nth-child(12) { min-width: 85px; }
.subject-address { max-width: 260px; white-space: normal; }
.subject-amount { color: var(--ink); font-weight: 700; white-space: nowrap; }
.subject-detail-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.related-subject-entry { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12px; }
.related-subject-entry p { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
.related-subject-link { justify-self: start; padding: 0; border: 0; color: var(--teal); background: transparent; font: inherit; font-weight: 700; text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; cursor: pointer; }
.related-subject-link:hover, .related-subject-link:focus-visible { text-decoration-color: currentColor; outline: none; }
.subject-edit-panel { display: grid; gap: 7px; padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.subject-edit-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; color: var(--ink); font-size: 12px; }
.subject-edit-heading span, .subject-edit-panel > .form-hint { color: var(--ink-soft); font-size: 11px; }
.subject-edit-panel > label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.subject-edit-reason { width: 100%; min-height: 58px; padding: 9px 11px; resize: vertical; font: inherit; line-height: 1.45; }
.subject-edit-panel > .form-hint { margin: 0; }
.subject-editable-value { display: block; width: 100%; min-height: 24px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; line-height: inherit; text-align: left; overflow-wrap: anywhere; text-decoration: underline dotted transparent; text-underline-offset: 3px; cursor: text; }
.subject-editable-value:hover, .subject-editable-value:focus-visible { color: var(--teal); outline: 2px solid rgba(47, 108, 101, .22); outline-offset: 2px; text-decoration-color: currentColor; }
.subject-inline-editor { display: grid; gap: 5px; min-width: 135px; }
.subject-inline-editor > .field { width: 100%; min-width: 115px; min-height: 32px; padding: 4px 7px; font: inherit; }
.subject-inline-actions { display: flex; align-items: center; gap: 4px; }
.subject-inline-actions .button { min-height: 27px; padding: 0 8px; font-size: 10px; }
.subject-comment-cell { min-width: 220px; }
.subject-history-table .subject-comment-cell .comment-entry { max-width: 320px; }
.subject-header-cell { padding: 0 !important; vertical-align: top; }
.table-filter-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 38px; padding: 12px 16px; border: 0; color: var(--ink-faint); background: transparent; font: inherit; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; cursor: pointer; }
.table-filter-trigger:hover, .table-filter-trigger:focus-visible { color: var(--teal); background: var(--teal-soft); outline: none; }
.table-filter-trigger.is-filtered { color: var(--teal); }
.table-header-tools { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.filter-marker { display: inline-grid; place-items: center; flex: 0 0 auto; color: currentColor; opacity: .64; }
.table-filter-trigger.is-filtered .filter-marker { opacity: 1; }
.table-filter-editor { padding: 0 12px 8px; background: var(--paper); }
.table-filter-controls { display: flex; align-items: center; gap: 6px; min-width: 0; }
.table-filter { flex: 1 1 auto; width: auto; min-width: 0; min-height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--paper-strong); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.table-filter-clear { flex: 0 0 auto; min-height: 30px; padding: 0 8px; font-size: 11px; }
.table-filter::placeholder { color: var(--ink-faint); }
.table-filter:focus { outline: 2px solid rgba(47, 111, 105, .22); outline-offset: 1px; border-color: var(--teal); }
.subject-filter-empty { padding: 30px 16px !important; color: var(--ink-faint) !important; text-align: center; }
.mono { font-variant-numeric: tabular-nums; }

body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: auto; padding: 16px 32px; background: rgba(18, 32, 36, .48); }
.modal-dialog { display: flex; flex-direction: column; width: min(1180px, 100%); min-height: 0; max-height: min(900px, calc(100vh - 32px)); overflow: hidden; }
.modal-header { flex: 0 0 auto; }
.modal-header .detail-heading h2 { font-size: 22px; }
.modal-header .detail-heading p { font-size: 12px; }
.modal-header > .subject-detail-actions { margin-left: auto; }
.modal-body { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.manual-record-dialog { width: min(900px, 100%); max-height: min(860px, calc(100vh - 32px)); }
.manual-record-dialog > form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.manual-record-dialog .modal-header > div { min-width: 0; }
.manual-record-dialog .modal-header h2 { margin: 0; font-size: 21px; }
.manual-record-dialog .modal-header p { margin: 6px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.manual-record-body { display: block; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 24px 28px; background: var(--paper-strong); }
.manual-record-body .form-grid { gap: 18px 20px; }
.manual-record-body .form-field label { color: var(--ink); font-size: 12px; }
.manual-record-body .form-field .field { min-height: 42px; font-size: 13px; }
.required-mark { margin-left: 4px; color: var(--danger); font-size: 10px; font-weight: 600; }
.manual-company-autocomplete { position: relative; }
.manual-company-autocomplete > .field { width: 100%; }
.manual-company-status { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.manual-company-suggestions { position: absolute; z-index: 15; top: calc(100% + 6px); right: 0; left: 0; max-height: 250px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper-strong); box-shadow: var(--shadow); }
.manual-company-suggestions[hidden] { display: none; }
.manual-company-option { display: grid; width: 100%; gap: 4px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
.manual-company-option:last-child { border-bottom: 0; }
.manual-company-option:hover, .manual-company-option.is-active, .manual-company-option.is-selected { background: var(--teal-soft); }
.manual-company-option-name { overflow: hidden; color: var(--teal); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.manual-company-option-meta { overflow: hidden; color: var(--ink-soft); font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.manual-company-empty { padding: 12px; color: var(--ink-soft); font-size: 12px; }
.form-error { color: var(--danger); font-size: 11px; line-height: 1.45; }
.manual-record-error { margin-top: 14px; padding: 11px 13px; border: 1px solid #edb6b0; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-size: 12px; line-height: 1.5; }
.manual-source-hint { margin: 18px 0 0; color: var(--ink-soft); font-size: 11px; }
.manual-record-footer { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 8px; padding: 14px 28px; border-top: 1px solid var(--line); background: var(--paper-strong); }
.manual-record-dialog input::placeholder { color: var(--ink-soft); opacity: 1; }
.modal-body > .evidence-grid { flex: 0 0 auto; min-width: 0; margin-top: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modal-body .evidence-cell { padding: 16px; }
.modal-body .evidence-cell dt { font-size: 11px; }
.modal-body .evidence-cell dd { font-size: 14px; }
.modal-body .evidence-cell dd > .subject-editable-value { min-height: 25px; font-size: 14px; }
.modal-body .evidence-cell .subject-inline-editor { min-width: 0; }
.modal-body .evidence-cell .subject-inline-editor > .field { min-width: 0; }
.modal-body > .detail-sections { flex: 1 1 auto; min-width: 0; min-height: 0; margin-top: 16px; }
.subject-history-section { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; }
.subject-history-section > h3 { flex: 0 0 auto; font-size: 15px; }
.subject-history-scroll { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.subject-history-scroll:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.subject-history-scroll thead th { position: sticky; top: 0; z-index: 1; }
.source-trace-section { flex: 0 0 auto; min-width: 0; }
.history-field { position: relative; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.history-trigger { min-width: 27px; min-height: 21px; padding: 0 6px; border: 1px solid var(--teal); border-radius: 999px; color: var(--teal); background: var(--teal-soft); font-size: 10px; font-weight: 800; cursor: pointer; }
.history-trigger:hover, .history-trigger:focus-visible { color: #fff; background: var(--teal); outline: none; }
.history-popover { position: absolute; top: calc(100% + 8px); left: 0; z-index: 12; display: none; width: min(410px, calc(100vw - 72px)); padding: 10px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: var(--paper-strong); box-shadow: var(--shadow); font-size: 11px; }
.history-trigger:hover + .history-popover, .history-trigger:focus-visible + .history-popover, .history-popover:hover, .history-popover.is-open { display: block; }
.history-popover > strong { display: block; margin-bottom: 7px; font-size: 11px; }
.history-popover-hint { margin: -2px 0 3px; color: var(--ink-faint); font-size: 10px; line-height: 1.4; }
.history-popover-record { padding: 8px 0; border-top: 1px solid var(--line); }
.history-popover-record:first-of-type { padding-top: 0; border-top: 0; }
.history-popover-date { color: var(--ink-faint); font-size: 10px; }
.history-record-badge { display: inline-flex; margin-left: 4px; padding: 2px 5px; border-radius: 999px; color: var(--teal); background: var(--teal-soft); font-size: 9px; font-weight: 800; }
.history-popover-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.history-popover-grid span { min-width: 0; overflow-wrap: anywhere; }
.history-popover-grid small { display: block; margin-bottom: 2px; color: var(--ink-faint); font-size: 9px; }

.notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: var(--paper); font-size: 12px; line-height: 1.55; }
.notice strong { color: var(--ink); }
.notice--warning { border-color: #e6ca87; background: var(--amber-soft); }
.notice--danger { border-color: #edb6b0; background: var(--danger-soft); }
.notice--info { border-color: #b6d8d0; background: var(--teal-soft); }

.empty-state { display: grid; justify-items: start; gap: 11px; padding: 38px 23px 42px; }
.empty-glyph { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--teal); background: var(--teal-soft); font-size: 18px; }
.empty-state h3 { margin: 0; font-size: 16px; }
.empty-state p { max-width: 500px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 13px; padding: 14px 0; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.page-size-control { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.page-size-control .select { min-height: 36px; padding-right: 26px; }
.page-size-input { width: 68px; padding-right: 9px !important; }
.field, .select { min-height: 38px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--paper-strong); font-size: 12px; }
.field::placeholder { color: var(--ink-faint); }
.select { padding-right: 30px; }
.field--wide { min-width: 230px; }
.label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }

.form-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr); gap: 16px; }
.form-field { display: grid; gap: 7px; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.form-field input, .form-field textarea, .form-field select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--paper-strong); font-size: 12px; }
.form-field textarea { min-height: 92px; resize: vertical; }
.form-hint { color: var(--ink-faint); font-size: 11px; line-height: 1.5; }

.dropzone { display: grid; justify-items: center; gap: 9px; padding: 32px 20px; border: 1px dashed #a9b5b1; border-radius: 11px; background: #fbfaf5; text-align: center; transition: border-color .18s ease, background .18s ease; }
.dropzone.is-dragover { border-color: var(--teal); background: var(--teal-soft); }
.dropzone-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: var(--teal); background: var(--teal-soft); font-size: 21px; }
.dropzone strong { font-size: 14px; }
.dropzone p { margin: 0; color: var(--ink-faint); font-size: 11px; }
.dropzone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.import-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.import-column { display: grid; gap: 24px; }
.import-page { display: grid; gap: 20px; align-items: start; }
.import-upload { width: 100%; }
.import-upload-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 28px; align-items: stretch; }
.import-upload-body .dropzone { min-width: 0; min-height: 210px; align-content: center; }
.import-upload-body .dropzone strong { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.import-upload-controls { display: flex; min-width: 0; flex-direction: column; justify-content: center; }
.import-name { margin-top: 0; }
.import-actions { margin-top: 18px; padding-bottom: 0; }
.import-next-step { margin: 14px 0 0; line-height: 1.5; }
.import-preview-sheet { margin-top: 18px; }
.import-preview-sheet > summary { padding: 9px 0; color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.import-preview-sheet > summary span { margin-left: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 400; }
.import-preview-table { min-width: 1450px; }
.import-preview-table th, .import-preview-table td { white-space: nowrap; }
.import-management { width: 100%; }
.import-management > summary { width: fit-content; padding: 8px 0; color: var(--teal); font-size: 13px; font-weight: 700; cursor: pointer; }
.import-management-content { display: grid; gap: 20px; margin-top: 12px; }
.sheet-list { display: grid; gap: 9px; }
.sheet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-strong); }
.sheet-row strong { display: block; font-size: 12px; }
.sheet-row span { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 10px; }
.sheet-state { color: var(--teal); font-size: 11px; font-weight: 700; }
.batch-list { display: grid; gap: 8px; }
.batch-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px 8px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--paper-strong); text-align: left; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.batch-row:hover { border-color: var(--teal); background: #f7fbf8; transform: translateX(2px); }
.batch-row.is-selected { border-color: var(--coral); background: #fff8ef; box-shadow: inset 3px 0 0 var(--coral); }
.batch-row-select { display: grid; grid-template-columns: 25px minmax(0, 1fr) 17px; align-items: center; gap: 10px; min-width: 0; padding: 3px 0; border: 0; color: inherit; background: transparent; text-align: left; }
.batch-row-select:hover { color: var(--teal); }
.batch-row-mark { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; color: var(--teal); background: var(--teal-soft); }
.batch-row-copy { min-width: 0; }
.batch-row-copy strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.batch-row-copy small { display: block; margin-top: 4px; overflow: hidden; color: var(--ink-faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.batch-row-arrow { color: var(--ink-faint); }
.batch-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.batch-action { min-height: 27px; padding: 0 7px; font-size: 11px; }
.batch-action--danger { color: var(--danger); }
.batch-action--danger:hover { color: #fff; background: var(--danger-soft); }
.sheet-switcher { display: grid; gap: 8px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.sheet-switcher-list { display: flex; flex-wrap: wrap; gap: 7px; }
.sheet-switcher-item { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: var(--paper-strong); font-size: 12px; }
.sheet-switcher-item small { color: var(--ink-faint); font-size: 11px; }
.sheet-switcher-item:hover, .sheet-switcher-item.is-selected { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.mapping-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 0; }
.mapping-toolbar .label { min-width: 140px; }
.mapping-toolbar .label .field { margin-top: 2px; }
.mapping-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mapping-warning { margin-bottom: 18px; }
.mapping-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.mapping-field { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 9px; align-items: center; min-width: 0; padding: 11px 12px; background: var(--paper-strong); }
.mapping-field span { min-width: 0; }
.mapping-field strong, .mapping-field small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-field strong { font-size: 11px; }
.mapping-field small { margin-top: 4px; color: var(--ink-faint); font-size: 10px; }
.mapping-field select { width: 100%; min-height: 32px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--paper); font-size: 11px; }
.mapping-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 18px 0 21px; border: 1px solid var(--line); background: var(--line); }
.mapping-summary > div { min-height: 66px; padding: 12px; background: var(--paper); }
.mapping-summary span, .mapping-summary strong { display: block; }
.mapping-summary span { color: var(--ink-faint); font-size: 10px; }
.mapping-summary strong { margin-top: 8px; color: var(--ink); font-size: 20px; letter-spacing: -.03em; }
.mapping-summary .mapping-good { color: var(--teal); }
.mapping-summary .mapping-pending { color: var(--amber); }
.subsection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.subsection-heading h3 { margin: 0; font-size: 13px; }
.subsection-heading p { margin: 5px 0 0; color: var(--ink-faint); font-size: 11px; }
.mapping-table td { min-width: 110px; }
.mapping-table td:first-child { min-width: 65px; }
.mapping-table small { color: var(--ink-faint); font-size: 10px; }
.issue-line, .quality-ok { display: flex; align-items: flex-start; gap: 4px; margin: 2px 0; font-size: 10px; line-height: 1.35; }
.issue-line { color: var(--danger); }
.quality-ok { color: var(--teal); }
.mapping-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 14px; border: 1px solid var(--line); background: var(--line); }
.mapping-cell { padding: 11px 12px; background: var(--paper-strong); }
.mapping-cell strong { display: block; font-size: 11px; }
.mapping-cell span { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 11px; }

.split-layout { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.list-panel { overflow: hidden; }
.list-panel .panel-body { padding: 0; }
.list-row { display: grid; gap: 7px; padding: 17px 20px; border: 0; border-bottom: 1px solid var(--line); background: var(--paper-strong); text-align: left; transition: background .18s ease, box-shadow .18s ease; }
.list-row:hover { background: #fffaf2; }
.review-queue-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.group-member, .group-pair { padding: 14px 0; border-bottom: 1px solid var(--line); }
.group-member > label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.group-member > p, .group-source, .group-pair p { margin: 6px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.group-source { padding-left: 20px; }
.group-source-location { color: var(--ink-faint); font-size: 11px; }
.group-source p { margin: 3px 0 0; }
.group-pair-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.group-pair-heading > span { color: var(--ink-soft); font-size: 11px; }
.group-pair-actions, .direct-compare-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.group-previous-decision { padding: 8px 10px; border-radius: 6px; color: var(--ink-soft); background: var(--paper-muted); }
.review-evidence-wrap { margin: 8px 0; }
.review-evidence-table th, .review-evidence-table td { min-width: 110px; padding: 8px 10px; vertical-align: top; }
.review-evidence-source { display: block; min-width: 140px; margin-bottom: 5px; }
.review-evidence-source:last-child { margin-bottom: 0; }
.review-evidence-source strong, .review-evidence-source small { display: block; overflow-wrap: anywhere; }
.review-evidence-source small { margin-top: 3px; color: var(--ink-faint); font-size: 10px; line-height: 1.4; }
.review-tool { margin-top: 14px; }
.review-tool > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; padding: 15px 18px; color: var(--ink); cursor: pointer; font-size: 14px; font-weight: 700; }
.review-tool > summary small { color: var(--ink-faint); font-size: 11px; font-weight: 400; }
.direct-compare-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.direct-compare-form label, .review-tool .field-label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 11px; }
.direct-compare-form .field, .review-tool select.field { width: 100%; }
.direct-compare-result { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.direct-compare-match { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.direct-compare-match span { color: var(--ink-soft); overflow-wrap: anywhere; }
.direct-compare-result .reason-block { margin-top: 15px; }
.direct-compare-result .field-label { margin-top: 12px; }
.history-review-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.history-review-layout { display: grid; grid-template-columns: minmax(230px, .75fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
.history-review-list { min-width: 0; }
.history-list-item { display: grid; width: 100%; gap: 5px; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.history-list-item:hover { color: var(--teal); }
.history-list-item strong { font-size: 12px; }
.history-list-item span, .history-list-item small { color: var(--ink-faint); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.history-review-detail { min-width: 0; padding-left: 16px; border-left: 1px solid var(--line); }
.history-detail-heading h3 { margin: 0; font-size: 14px; }
.history-detail-heading p { color: var(--ink-soft); font-size: 11px; }
.history-evidence-json { max-height: 420px; margin: 12px 0 0; padding: 12px; overflow: auto; color: var(--ink); background: var(--paper-muted); font-size: 10px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.group-retained { display: grid; gap: 8px; margin-top: 10px; }
.group-retained label { color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.group-merge { margin: 16px 0 24px; }
.detail-panel .panel-body > h3 { margin: 24px 0 10px; font-size: 14px; }
.list-row.is-selected { box-shadow: inset 3px 0 0 var(--coral); background: #fff8ef; }
.list-row-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.list-row strong { min-width: 0; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.list-row p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.detail-panel { min-width: 0; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.detail-heading p { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 21px; border: 1px solid var(--line); background: var(--line); }
.evidence-cell { min-width: 0; padding: 13px; background: var(--paper); }
.evidence-cell dt { color: var(--ink-faint); font-size: 10px; }
.evidence-cell dd { overflow-wrap: anywhere; margin: 6px 0 0; color: var(--ink); font-size: 12px; line-height: 1.45; }
.evidence-cell dd small { color: var(--ink-faint); font-size: 10px; }
.reason-block { display: grid; gap: 8px; margin-top: 20px; }
.reason-block label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.reason-block textarea { width: 100%; min-height: 86px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper-strong); resize: vertical; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0 0; color: var(--ink-faint); font-size: 11px; }
.pagination-actions { display: flex; align-items: center; gap: 6px; }
.pagination .button { min-height: 30px; padding: 0 10px; font-size: 11px; }
.pagination-actions .page-size-control { margin-right: 2px; }
.pagination-actions .page-size-control .select { min-height: 30px; }

.source-trace { display: inline-flex; flex-wrap: wrap; gap: 5px; color: var(--ink-faint); font-size: 10px; }
.source-trace span { padding: 3px 6px; border-radius: 4px; background: var(--paper-muted); }
.detail-sections { display: flex; flex-direction: column; gap: 18px; margin-top: 25px; overflow: hidden; }
.subsection h3 { margin: 0 0 10px; font-size: 13px; }
.metric-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.metric-line:last-child { border-bottom: 0; }
.metric-line span { color: var(--ink-soft); font-size: 11px; }
.metric-line strong { color: var(--ink); font-size: 14px; }

.roadmap-list { display: grid; gap: 12px; }
.roadmap-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.roadmap-item:last-child { border-bottom: 0; }
.roadmap-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--ink-soft); background: var(--paper-muted); font-weight: 800; }
.roadmap-item strong { display: block; font-size: 13px; }
.roadmap-item p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }

.loading-state { display: grid; gap: 12px; padding: 28px 0; color: var(--ink-faint); font-size: 12px; }
.loading-line { width: min(280px, 100%); height: 8px; border-radius: 3px; background: var(--paper-muted); animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .42; } }

.toast-region { position: fixed; z-index: 20; right: 24px; bottom: 24px; display: grid; gap: 8px; width: min(360px, calc(100vw - 48px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--paper-strong); box-shadow: var(--shadow); animation: toast-enter .24s ease-out both; font-size: 12px; line-height: 1.45; }
.toast--success { border-color: #b6d8d0; }
.toast--error { border-color: #edb6b0; }
.toast strong { display: block; margin-bottom: 2px; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 215px minmax(0, 1fr); }
  .sidebar { width: 215px; }
  .section-grid, .import-layout, .split-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { position: relative; inset: auto; z-index: 20; width: auto; height: auto; max-height: 190px; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 18px 16px 13px; }
  .main-content { grid-column: 1; height: auto; min-height: 0; }
  .brand-lockup { padding: 0 4px; }
  .sidebar-context { margin: 16px 4px 13px; }
  .nav-groups { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 5px; }
  .nav-group { display: flex; flex: 0 0 auto; gap: 4px; }
  .nav-label, .nav-group--muted, .sidebar-footer { display: none; }
  .nav-item { min-height: 35px; padding: 0 9px; white-space: nowrap; }
  .nav-badge, .nav-soon { display: none; }
  .topbar { min-height: 58px; padding: 0 18px; }
  .user-chip span:last-child { display: none; }
  .view-root { padding: 31px 18px 55px; }
  .page-heading { display: block; margin-bottom: 25px; }
  .page-heading h1 { font-size: 30px; }
  .heading-actions { justify-content: flex-start; margin-top: 18px; }
  .inline-form { justify-content: flex-start; margin-top: 18px; }
  .panel-header, .panel-body { padding-left: 17px; padding-right: 17px; }
  .assignment-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment-counts > div:nth-child(2) { border-right: 0; }
  .assignment-counts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .assignment-review-panel { padding: 14px; }
  .assignment-choice-facts { grid-template-columns: 1fr; }
  .assignment-queue-error { align-items: flex-start; flex-direction: column; }
  .export-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
  .page-heading--export > .button { margin-top: 16px; }
  .workflow { padding-left: 17px; padding-right: 17px; }
  .form-grid, .evidence-grid { grid-template-columns: 1fr; }
  .mapping-editor, .mapping-summary { grid-template-columns: 1fr; }
  .mapping-toolbar { align-items: stretch; }
  .mapping-toolbar-actions { width: 100%; justify-content: flex-start; }
  .mapping-toolbar-actions .button { flex: 1 1 0; }
  .batch-row { grid-template-columns: 1fr; }
  .batch-row-actions { justify-content: flex-start; padding-left: 35px; }
  .form-field--full { grid-column: auto; }
  .data-table th, .data-table td { padding-right: 12px; padding-left: 12px; }
  .detail-heading { display: block; }
  .detail-actions { margin-top: 15px; }
  .history-popover { width: min(350px, calc(100vw - 36px)); }
  .history-popover-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; }
  .modal-dialog { max-height: calc(100vh - 20px); }
  .modal-header { align-items: flex-start; }
  .subject-detail-actions { gap: 3px; }
  .subject-detail-actions .button { min-height: 33px; padding: 0 9px; }
  .manual-record-dialog { max-height: calc(100vh - 20px); }
  .manual-record-body { padding: 18px; }
  .manual-record-footer { padding: 12px 18px; }
  .modal-body > .evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .direct-compare-form, .history-review-layout { grid-template-columns: 1fr; }
  .history-review-detail { padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .direct-compare-match { grid-template-columns: 1fr; gap: 3px; }
}

@media (max-width: 440px) {
  .topbar-actions { gap: 8px; }
  .topbar-divider { display: none; }
  .breadcrumb { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .change-password-trigger { padding: 0 5px; font-size: 11px; }
  .modal-body > .evidence-grid { grid-template-columns: 1fr; }
  .subject-detail-actions { flex-wrap: wrap; justify-content: flex-end; }
  .password-dialog-header { padding: 19px 18px 16px; }
  .password-dialog-body { padding: 18px; }
  .password-dialog-footer { padding: 13px 18px 17px; }
}

@media (max-width: 760px) {
  .auth-root { padding: 18px; }
  .auth-screen { grid-template-columns: minmax(0, 1fr); width: min(520px, 100%); min-height: 0; }
  .auth-brand-panel { min-height: 235px; padding: 25px; }
  .auth-brand-copy { margin: 34px 0; }
  .auth-brand-copy h1 { font-size: 27px; }
  .auth-form-panel { padding: 30px 24px; }
}

@media (max-width: 440px) {
  .auth-root { padding: 10px; }
  .auth-brand-panel { min-height: 205px; padding: 22px; }
  .auth-brand-copy { margin: 26px 0; }
  .auth-brand-copy h1 { font-size: 25px; }
  .auth-form-panel { padding: 25px 20px; }
  .logout-button { padding: 0 7px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Duplicate review: keep the queue scannable and the decision path explicit. */
.review-page-heading { margin-bottom: 19px; }
.review-page-heading p { margin-top: 6px; font-size: 13px; }
.review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.review-queue-tabs { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-muted); }
.review-queue-tab { min-height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: 7px; color: var(--ink-soft); background: transparent; font-size: 12px; font-weight: 650; }
.review-queue-tab:hover { color: var(--ink); background: rgba(255, 255, 255, .55); }
.review-queue-tab.is-active { border-color: var(--line); color: var(--ink); background: var(--paper-strong); box-shadow: 0 1px 2px rgba(23, 38, 43, .06); }
.review-queue-summary { display: flex; flex-wrap: wrap; gap: 17px; color: var(--ink-soft); font-size: 12px; }
.review-queue-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.review-workspace { display: grid; grid-template-columns: minmax(320px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.review-queue-panel { position: sticky; top: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); min-height: 380px; overflow: hidden; }
.review-queue-header { flex: 0 0 auto; align-items: center; padding: 16px 18px 14px; }
.review-queue-header h2 { font-size: 15px; }
.review-queue-header p { font-size: 11px; }
.review-queue-total { display: inline-grid; min-width: 34px; height: 30px; place-items: center; padding: 0 8px; border-radius: 7px; color: var(--ink-soft); background: var(--paper-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.review-group-list { flex: 1 1 auto; min-height: 180px; overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.review-group-row { display: grid; width: 100%; gap: 6px; padding: 13px 17px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: var(--paper-strong); text-align: left; transition: background .16s ease; }
.review-group-row:hover:not(:disabled) { background: #f3f8f5; }
.review-group-row:focus-visible { position: relative; z-index: 1; outline-offset: -3px; }
.review-group-row:disabled { cursor: wait; opacity: .7; }
.review-group-row.is-selected { background: #edf5f1; box-shadow: inset 0 0 0 1px var(--teal); }
.review-group-row > strong { display: grid; gap: 2px; min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.review-group-row > strong small { color: var(--ink-faint); font-size: 10px; font-weight: 500; }
.review-group-meta { display: flex; flex-wrap: wrap; gap: 11px; color: var(--ink-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.review-group-fields { color: var(--ink-faint); font-size: 11px; line-height: 1.4; }
.review-queue-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 13px; border-top: 1px solid var(--line); color: var(--ink-faint); background: var(--paper-strong); font-size: 10px; font-variant-numeric: tabular-nums; }
.review-queue-footer .pagination-actions { gap: 5px; }
.review-queue-footer .button { min-height: 29px; padding: 0 8px; font-size: 10px; }
.review-detail-panel { min-width: 0; overflow: visible; }
.review-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 19px 21px 16px; border-bottom: 1px solid var(--line); }
.review-detail-header h2 { margin: 0; font-size: 19px; line-height: 1.35; letter-spacing: -.025em; overflow-wrap: anywhere; }
.review-detail-header p { margin: 6px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.review-detail-header p span { margin: 0 3px; color: var(--ink-faint); }
.review-detail-body { min-width: 0; padding: 18px 21px 22px; }
.review-empty-detail { padding: 20px; }
.review-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.review-section-heading h3 { margin: 0; font-size: 14px; }
.review-section-heading p { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.review-selection-count { flex: 0 0 auto; padding: 5px 8px; border-radius: 6px; color: var(--teal); background: var(--teal-soft); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.review-members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
.review-member { min-width: 0; padding: 13px 0; border-top: 1px solid var(--line); }
.review-member.is-selected { padding-right: 8px; padding-left: 8px; border-radius: 8px; background: #edf5f1; }
.review-member-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.review-member-choice { display: flex; min-width: 0; align-items: flex-start; gap: 9px; cursor: pointer; }
.review-member-choice input { width: 16px; height: 16px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--teal); }
.review-member-choice > span { display: grid; min-width: 0; gap: 3px; }
.review-member-choice strong { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.review-member-choice small { color: var(--ink-faint); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.review-member-status { flex: 0 0 auto; padding: 4px 6px; border-radius: 5px; color: #725118; background: var(--amber-soft); font-size: 10px; line-height: 1.3; }
.review-member-status.is-blocked { color: #725118; background: var(--amber-soft); }
.review-member-records { min-width: 0; margin: 8px 0 0 25px; }
.review-source-record { min-width: 0; padding: 8px 0 0; border-top: 1px solid #e8e9e3; }
.review-source-record + .review-source-record { margin-top: 8px; }
.review-source-location { display: flex; gap: 6px; margin: 0 0 7px; color: var(--ink-faint); font-size: 10px; line-height: 1.4; }
.review-source-location > span:first-child { flex: 0 0 auto; color: var(--ink-soft); font-weight: 700; }
.review-source-location > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.review-source-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px 10px; margin: 0; }
.review-source-fact { min-width: 0; }
.review-source-fact dt { color: var(--ink-faint); font-size: 10px; }
.review-source-fact dd { margin: 2px 0 0; color: var(--ink); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.review-source-warning { margin: 6px 0 0; color: var(--danger); font-size: 10px; }
.review-inline-pagination { position: sticky; top: 8px; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-faint); background: rgba(251, 253, 251, .97); box-shadow: 0 4px 12px rgba(27, 39, 41, .08); backdrop-filter: blur(8px); font-size: 10px; font-variant-numeric: tabular-nums; }
.review-inline-pagination .button { min-height: 29px; padding: 0 9px; font-size: 10px; }
.review-decision-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.review-match-evidence { margin: 17px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.review-match-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.review-match-heading h3 { margin: 0; color: var(--ink); font-size: 14px; }
.review-match-heading p { margin: 3px 0 0; color: var(--ink-faint); font-size: 10px; line-height: 1.45; }
.review-match-pairs { display: grid; max-height: 300px; overflow: auto; overscroll-behavior: auto; }
.review-match-pair { padding: 10px 0; border-bottom: 1px solid var(--line); }
.review-match-pair:first-child { padding-top: 3px; }
.review-match-pair:last-child { padding-bottom: 3px; border-bottom: 0; }
.review-match-pair-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.review-match-pair-heading > strong { min-width: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.review-match-pair-heading > strong span { margin: 0 4px; color: var(--ink-faint); }
.review-match-pagination { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
.review-match-pagination .button { min-height: 29px; padding: 0 9px; font-size: 10px; }
.review-retained-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.review-retained-option { display: flex; min-width: 0; align-items: flex-start; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper-strong); cursor: pointer; }
.review-retained-option:has(input:checked) { border-color: var(--teal); background: #edf5f1; }
.review-retained-option input { flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--teal); }
.review-retained-option > span { display: grid; min-width: 0; gap: 3px; }
.review-retained-option strong { font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.review-retained-option small { color: var(--ink-faint); font-size: 9px; overflow-wrap: anywhere; }
.review-reason { margin-top: 15px; }
.review-reason label span { color: var(--danger); }
.review-reason textarea { min-height: 76px; font-size: 12px; line-height: 1.5; }
.review-reason .form-hint { margin: -2px 0 0; font-size: 10px; }
.review-merge-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.review-merge-row > span { color: var(--ink-soft); font-size: 11px; }
.review-merge-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
.review-reject-pending { margin: 7px 0 0; color: var(--ink-faint); font-size: 10px; text-align: right; }
.review-pair-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-pair-heading > strong { min-width: 0; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.review-pair-status { flex: 0 0 auto; padding: 4px 7px; border-radius: 5px; color: var(--amber); background: var(--amber-soft); font-size: 10px; }
.review-pair-status[data-status="accepted"] { color: var(--teal); background: var(--teal-soft); }
.review-pair-status[data-status="rejected"], .review-pair-status[data-status="skipped"] { color: var(--ink-soft); background: var(--paper-muted); }
.review-pair-evidence-list { display: grid; gap: 5px; margin-top: 9px; }
.review-pair-evidence { display: grid; grid-template-columns: 74px minmax(0, 1fr) 18px minmax(0, 1fr); align-items: start; gap: 8px; padding: 8px 9px; border-radius: 7px; background: var(--paper); }
.review-pair-evidence > strong { color: var(--ink-soft); font-size: 11px; }
.review-pair-evidence > span { color: var(--ink-faint); text-align: center; }
.review-pair-value { min-width: 0; color: var(--ink); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.review-pair-sources { margin-top: 3px; color: var(--ink-faint); font-size: 10px; }
.review-pair-sources summary { cursor: pointer; }
.review-pair-sources ul { display: grid; gap: 5px; margin: 5px 0 0; padding: 0; list-style: none; }
.review-pair-sources li strong, .review-pair-sources li small { display: block; overflow-wrap: anywhere; }
.review-pair-sources li strong { color: var(--ink-soft); font-weight: 500; }
.review-pair-sources li small { margin-top: 2px; color: var(--ink-faint); }
.review-pair-previous { margin: 8px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .review-workspace { grid-template-columns: minmax(0, 1fr); }
  .review-queue-panel { position: static; max-height: 430px; min-height: 300px; }
  .review-group-list { max-height: 320px; }
}

@media (max-width: 760px) {
  .review-page-heading { display: flex; gap: 10px; }
  .review-page-heading .heading-actions { margin-top: 14px; }
  .review-toolbar { align-items: stretch; flex-direction: column; gap: 9px; }
  .review-queue-tabs { display: flex; width: 100%; }
  .review-queue-tab { flex: 1 1 0; padding: 0 8px; }
  .review-queue-summary { justify-content: space-between; }
  .review-workspace { gap: 12px; }
  .review-queue-panel { max-height: 390px; min-height: 270px; }
  .review-group-list { max-height: 280px; }
  .review-detail-header { padding: 16px; }
  .review-detail-header h2 { font-size: 17px; }
  .review-detail-body { padding: 16px; }
  .review-members { grid-template-columns: minmax(0, 1fr); }
  .review-source-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-pair-evidence { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .review-pair-evidence > span { text-align: left; }
  .review-match-heading { align-items: flex-start; }
  .review-match-pairs { max-height: 250px; }
  .review-inline-pagination { align-items: flex-start; flex-direction: column; }
  .review-merge-row { align-items: flex-start; flex-direction: column; }
  .review-merge-actions { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .review-merge-actions .button { width: 100%; padding-inline: 8px; }
  .review-reject-pending { text-align: left; }
}
