:root {
  --ink: #182230; --muted: #657184; --line: #dce3ea; --panel: #fff; --canvas: #f3f6fa;
  --primary: #175cd3; --primary-hover: #1849a9; --green: #067647; --green-bg: #ecfdf3;
  --amber: #b54708; --amber-bg: #fffaeb; --red: #b42318; --red-bg: #fef3f2;
  --shadow: 0 8px 24px rgba(18, 40, 75, .055); font-family: "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; } button:disabled { cursor: not-allowed; opacity: .55; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 24px max(24px, calc((100vw - 1460px) / 2)); }
.brand-mark { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; background: #eaf2ff; color: #175cd3; border: 1px solid #c7d7fe; border-radius: 14px; font-weight: 800; letter-spacing: -.08em; font-size: 17px; }
.brand-copy { min-width: 0; } .eyebrow { margin: 0 0 4px; color: #175cd3; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; } h1 { font-size: clamp(21px, 2vw, 28px); line-height: 1.2; margin-bottom: 5px; letter-spacing: -.025em; }
.subtitle { color: var(--muted); margin-bottom: 0; } .local-badge { margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid #abefc6; background: var(--green-bg); color: var(--green); border-radius: 100px; font-size: 12px; font-weight: 700; }
.dot { width: 7px; height: 7px; background: #12b76a; border-radius: 50%; }
.app-shell { max-width: 1460px; margin: 24px auto 0; padding: 0 24px 30px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.notice { border: 1px solid #b2ddff; border-radius: 10px; background: #eff8ff; color: #1849a9; padding: 12px 15px; margin-bottom: 18px; }
.notice.notice-good { border-color: #abefc6; background: var(--green-bg); color: var(--green); } .notice.notice-bad { border-color: #fecdca; background: var(--red-bg); color: var(--red); }
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; } .step { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #eff4ff; color: #175cd3; font-weight: 800; font-size: 12px; }
.section-heading h2, .activity-heading h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.015em; } .section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .source-card { min-width: 0; display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: #fff; }
.source-icon { width: 35px; height: 35px; flex: 0 0 35px; display: grid; place-items: center; border-radius: 10px; background: #f2f4f7; color: #475467; font-size: 11px; font-weight: 800; }
.source-body { min-width: 0; flex: 1; display: flex; align-items: flex-start; flex-direction: column; } label { font-weight: 700; } .source-body > label { margin: 0 0 4px; }
.required { color: var(--red); } .source-body p { font-size: 12px; line-height: 1.4; color: var(--muted); margin: 0 0 10px; }
.folder-input, #namesFile { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.source-status { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; } .source-status.ready { color: var(--green); font-weight: 700; }
.microcopy { color: var(--muted); font-size: 11px; margin: 12px 0 0; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 36px; padding: 8px 13px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; font-size: 12px; transition: background .15s ease, border-color .15s ease; }
.button-primary { color: #fff; background: var(--primary); border-color: var(--primary); } .button-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.button-secondary { background: #fff; color: #344054; border-color: #d0d5dd; } .button-secondary:hover:not(:disabled) { background: #f9fafb; border-color: #98a2b3; }
.button-quiet { background: transparent; color: #475467; border-color: transparent; } .button-quiet:hover:not(:disabled) { background: #f2f4f7; } .button-small { padding: 5px 8px; min-height: 30px; }
.names-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 20px; } .names-entry label { display: block; margin-bottom: 7px; }
textarea, input[type="search"], input[type="text"], .dialog-search { width: 100%; border: 1px solid #d0d5dd; border-radius: 8px; padding: 11px 12px; color: var(--ink); outline: none; background: #fff; }
textarea { resize: vertical; min-height: 150px; line-height: 1.55; } textarea:focus, input:focus, select:focus { border-color: #84adff; box-shadow: 0 0 0 3px #d1e0ff; }
.inline-actions { display: flex; align-items: center; gap: 8px; margin-top: 9px; } .file-import-label { cursor: pointer; }
.order-card { border: 1px solid var(--line); border-radius: 12px; padding: 17px; background: #f9fafb; } .order-card h3 { font-size: 13px; margin: 0 0 10px; }
.doc-order { margin: 0; padding: 0; display: grid; gap: 7px; list-style: none; } .doc-order li { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.doc-order li span { display: grid; place-items: center; width: 21px; height: 21px; flex: 0 0 21px; border-radius: 6px; background: #e4e7ec; color: #344054; font-size: 10px; font-weight: 800; }
.order-note { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; color: var(--muted); font-size: 11px; } .order-note strong { color: #344054; }
.primary-actions { display: flex; align-items: center; gap: 13px; margin-top: 18px; } .primary-actions .button { min-height: 42px; padding: 10px 17px; font-size: 13px; } .action-hint { color: var(--muted); font-size: 12px; }
.results-panel { padding-bottom: 18px; } .results-heading { margin-bottom: 16px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; } .summary-card { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 15px; background: #fcfcfd; }
.summary-value { font-size: 23px; font-weight: 800; letter-spacing: -.04em; } .summary-label { color: var(--muted); font-size: 11px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.search-box { display: flex; align-items: center; gap: 8px; min-width: 240px; max-width: 390px; flex: 1; border: 1px solid #d0d5dd; border-radius: 8px; padding: 0 10px; color: #667085; background: #fff; }
.search-box input { border: 0; box-shadow: none; padding: 9px 0; min-width: 0; } .search-box input:focus { box-shadow: none; }
.results-count { color: var(--muted); font-size: 11px; white-space: nowrap; } .table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: separate; border-spacing: 0; min-width: 1120px; width: 100%; font-size: 11px; } thead { background: #f9fafb; }
th { color: #475467; text-align: left; font-size: 10px; font-weight: 800; letter-spacing: .035em; white-space: nowrap; } th, td { padding: 10px 9px; border-bottom: 1px solid #eaecf0; vertical-align: top; }
th:first-child, td:first-child { padding-left: 13px; } tbody tr:last-child td { border-bottom: 0; } tbody tr:hover { background: #fbfcff; } .person-column { min-width: 180px; }
.person-name { font-weight: 750; font-size: 12px; overflow-wrap: anywhere; } .person-sub { color: var(--muted); font-size: 10px; margin-top: 3px; }
.doc-cell { min-width: 118px; max-width: 170px; } .doc-state { display: block; margin-bottom: 5px; font-size: 10px; font-weight: 700; }
.doc-state.ok { color: var(--green); } .doc-state.warn { color: var(--amber); } .doc-state.bad { color: var(--red); }
.doc-file-name { display: block; color: #344054; max-width: 150px; overflow-wrap: anywhere; margin-bottom: 5px; } .doc-cell .button { min-height: 27px; padding: 4px 7px; font-size: 10px; }
.status-pill { display: inline-flex; padding: 4px 7px; border-radius: 100px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-pill.complete { color: var(--green); background: var(--green-bg); } .status-pill.incomplete { color: var(--amber); background: var(--amber-bg); } .status-pill.error { color: var(--red); background: var(--red-bg); }
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); font-size: 12px; }
.export-controls { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 17px; }
.checkline { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; cursor: pointer; } .checkline input { accent-color: var(--primary); margin-top: 3px; }
.checkline span { display: flex; flex-direction: column; gap: 3px; } .checkline small { color: var(--muted); font-weight: 400; font-size: 10px; max-width: 480px; }
.export-actions { display: flex; gap: 9px; flex-shrink: 0; } .progress-wrap { margin-top: 17px; padding: 12px; border-radius: 9px; background: #f9fafb; }
.progress-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 11px; color: #475467; } progress { width: 100%; height: 8px; accent-color: var(--primary); }
.activity-panel { padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; } .activity-heading { display: flex; align-items: center; gap: 11px; }
.activity-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border: 1px solid #b2ddff; border-radius: 50%; background: #eff8ff; color: #175cd3; font-weight: 800; }
.activity-heading h2 { font-size: 14px; } .activity-heading p { color: var(--muted); font-size: 11px; margin: 0; } .activity-heading > .button { margin-left: auto; }
.activity-log { list-style: none; padding: 0; margin: 13px 0 0; display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.activity-log li { padding: 7px 9px; border-radius: 7px; color: #475467; font-size: 11px; background: #f9fafb; overflow-wrap: anywhere; }
.activity-log li.log-error { background: var(--red-bg); color: var(--red); } .activity-log li.log-warn { background: var(--amber-bg); color: var(--amber); } .activity-log li.log-success { background: var(--green-bg); color: var(--green); }
.log-time { display: inline-block; min-width: 68px; color: #98a2b3; font-variant-numeric: tabular-nums; margin-right: 8px; }
.footer { display: flex; justify-content: space-between; gap: 16px; color: #98a2b3; font-size: 10px; padding: 20px 2px 0; }
.file-dialog { width: min(720px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 16px; padding: 0; color: var(--ink); box-shadow: 0 20px 60px rgba(16, 24, 40, .2); }
.file-dialog::backdrop { background: rgba(16, 24, 40, .45); } .dialog-close-form { display: flex; justify-content: flex-end; padding: 9px 10px 0; } .dialog-x { border: 0; background: transparent; color: #667085; font-size: 26px; line-height: 1; }
.dialog-content { padding: 0 22px 22px; } .dialog-content h2 { margin: 0 0 5px; font-size: 20px; } .dialog-content .subtitle { margin-bottom: 17px; font-size: 12px; }
.field-label { display: block; margin-bottom: 6px; font-size: 12px; } .dialog-search { margin-bottom: 10px; }
.file-choices { border: 1px solid var(--line); border-radius: 9px; max-height: 310px; overflow: auto; }
.file-choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #eaecf0; cursor: pointer; } .file-choice:last-child { border-bottom: 0; }
.file-choice:hover { background: #f9fafb; } .file-choice input { accent-color: var(--primary); margin-top: 4px; } .file-choice-copy { display: flex; flex-direction: column; min-width: 0; }
.file-choice-copy strong { font-size: 11px; overflow-wrap: anywhere; } .file-choice-copy small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.file-choice-empty { color: var(--muted); padding: 20px; text-align: center; font-size: 12px; } .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.dialog-actions #clearDocumentBtn { margin-right: auto; }
@media (max-width: 850px) {
  .topbar { padding: 18px 16px; align-items: flex-start; } .local-badge { display: none; } .app-shell { padding: 0 12px 20px; margin-top: 12px; }
  .panel { padding: 16px; border-radius: 12px; } .source-grid { grid-template-columns: 1fr; } .names-layout { grid-template-columns: 1fr; }
  .primary-actions, .export-controls { align-items: stretch; flex-direction: column; } .export-actions { flex-wrap: wrap; } .footer { flex-direction: column; gap: 5px; }
}
@media (max-width: 520px) {
  .brand-mark { width: 42px; height: 42px; flex-basis: 42px; } .topbar { gap: 10px; } h1 { font-size: 20px; }
  .section-heading { gap: 10px; } .step { width: 31px; height: 31px; flex-basis: 31px; } .summary-grid { gap: 6px; } .summary-card { padding: 10px 8px; }
  .summary-value { font-size: 20px; } .summary-label { font-size: 9px; } .dialog-actions { flex-wrap: wrap; }
}


/* User-configurable document rules */
.settings-open-btn { margin-left: 10px; flex-shrink: 0; }
.settings-dialog { width: min(1050px, calc(100vw - 24px)); max-height: 92vh; overflow: auto; }
.settings-note { padding: 10px 12px; margin: 10px 0 16px; border: 1px solid #b2ddff; border-radius: 9px; background: #eff8ff; color: #1849a9; font-size: 11px; }
.settings-rows { display: grid; gap: 10px; }
.folder-rules-rows { display: grid; gap: 10px; margin: 10px 0 18px; }
.folder-rule-row { display: grid; grid-template-columns: 82px minmax(150px, .9fr) minmax(140px, .6fr) minmax(220px, 1.4fr); gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.folder-rule-row > strong { padding-top: 9px; color: var(--ink); font-size: 12px; }
.folder-rule-row label { display: flex; flex-direction: column; gap: 5px; color: #475467; font-size: 11px; font-weight: 700; min-width: 0; }
.folder-rule-row input, .folder-rule-row textarea, .matching-rules-grid input[type="number"] { width: 100%; min-width: 0; border: 1px solid #d0d5dd; border-radius: 7px; padding: 8px; color: var(--ink); background: #fff; font-weight: 400; }
.folder-rule-row textarea { min-height: 62px; resize: vertical; }
.matching-rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px 0 18px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.matching-rules-grid > label:not(.settings-check) { display: flex; flex-direction: column; gap: 5px; color: #475467; font-size: 11px; font-weight: 700; }
.matching-rules-grid .settings-check { display: flex; gap: 8px; align-items: center; color: #475467; font-size: 12px; }
.matching-rules-grid .settings-check input { width: 16px; height: 16px; }

.settings-row { display: grid; grid-template-columns: 76px minmax(130px, 1fr) minmax(120px, .7fr) minmax(150px, 1fr) minmax(230px, 1.6fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.settings-row label, .settings-add-grid label { display: flex; flex-direction: column; gap: 5px; color: #475467; font-size: 11px; font-weight: 700; min-width: 0; }
.settings-row input, .settings-row textarea, .settings-row select, .settings-add-grid input, .settings-add-grid select { width: 100%; min-width: 0; border: 1px solid #d0d5dd; border-radius: 7px; padding: 8px; color: var(--ink); background: #fff; font-weight: 400; }
.settings-row textarea { min-height: 56px; resize: vertical; }
.settings-row .settings-source { display: block; color: var(--muted); font-size: 10px; font-weight: 400; margin-top: 3px; }
.settings-row .settings-delete { align-self: center; white-space: nowrap; }
.settings-add { margin-top: 18px; padding: 14px; background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; }
.settings-add h3 { margin: 0 0 10px; font-size: 13px; }
.settings-add-grid { display: grid; grid-template-columns: 1fr .7fr 1fr 1.4fr; gap: 10px; margin-bottom: 10px; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.settings-spacer { flex: 1; }
.settings-import-label { display: inline-flex; align-items: center; }
.settings-dialog .dialog-content { padding-bottom: 20px; }
#resultsTable { min-width: 1050px; }
.doc-order li { overflow-wrap: anywhere; }
@media (max-width: 850px) {
  .settings-open-btn { margin-left: auto; }
  .settings-row { grid-template-columns: 1fr 1fr; }
  .settings-row label:nth-child(5) { grid-column: 1 / -1; }
  .settings-add-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .settings-open-btn { padding: 8px; font-size: 11px; }
  .settings-row { grid-template-columns: 1fr; }
  .settings-row label:nth-child(5) { grid-column: auto; }
  .settings-actions { align-items: stretch; }
  .settings-spacer { display: none; }
}

/* Saved work-session dialog */
.session-dialog { width: min(760px, calc(100vw - 24px)); max-height: 92vh; overflow: auto; }
.session-summary { border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: #f8fafc; font-weight: 700; margin: 12px 0 16px; }
.session-hint { margin-top: 6px; overflow-wrap: anywhere; }
.session-save-actions { justify-content: flex-start; }
.session-divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0 16px; }
.session-dialog h3 { margin: 0 0 12px; font-size: 15px; }
.session-manage-actions { flex-wrap: wrap; }
.session-dialog select { width: 100%; min-width: 0; border: 1px solid #d0d5dd; border-radius: 8px; padding: 11px 12px; color: var(--ink); background: #fff; }
@media (max-width: 560px) { .session-manage-actions .button { flex: 1 1 100%; } }

/* Single-root folder workflow and per-person selection */
.single-source-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.person-select { display: flex; align-items: flex-start; gap: 8px; }
.person-select input, .person-confirm input { flex: 0 0 auto; margin-top: 3px; }
.person-select .person-name { font-weight: 700; }
.person-confirm { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 12px; }

/* Refresh control and dedicated employee selection column */
.root-folder-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.root-folder-actions .button { white-space: nowrap; }
#resultsTable th.select-column, #resultsTable td.select-column { width: 58px; min-width: 58px; text-align: center; vertical-align: middle; }
#resultsTable td.select-column input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
#resultsTable .person-name { font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 520px) { .root-folder-actions { flex-direction: column; align-items: stretch; } }

[hidden] { display: none !important; }
.employee-lists { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.employee-lists ul { padding: 0; list-style: none; max-height: 19rem; overflow: auto; }
.employee-lists li { padding: .3rem; overflow-wrap: anywhere; }
.employee-lists li button, .workspace-counts button { text-align: left; padding: .5rem; }
.workspace-counts, #workspaceLegend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
.workspace-counts button[aria-pressed=true] { outline: 2px solid currentColor; }
.status-icon { border: 1px solid currentColor; border-radius: 50%; width: 2rem; height: 2rem; }
.status-icon.exported { color: #12633b; } .status-icon.ready { color: #175384; } .status-icon.attention { color: #85420d; }
#statusTooltip { position: fixed; z-index: 12; max-width: 17rem; padding: .5rem; color: white; background: #183449; border-radius: .35rem; pointer-events: none; }
#previewPdf iframe { width: 100%; height: 60vh; border: 0; }
#overrideForm label { display: block; margin: 1rem 0; }
.dialog-meta { border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; padding: 10px 12px; margin: 10px 0 14px; font-size: 12px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.dialog-meta code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: #344054; word-break: break-all; }
.dialog-checkline { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0; font-size: 12px; cursor: pointer; }
.dialog-checkline input { accent-color: var(--primary); margin-top: 3px; flex: 0 0 auto; }
.dialog-error { margin: 8px 0 0; padding: 8px 10px; border: 1px solid #fecdca; border-radius: 8px; background: var(--red-bg); color: var(--red); font-size: 12px; font-weight: 600; }
.doc-edit-fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.doc-edit-expiry { margin: 12px 0 4px; }
.doc-edit-expiry input[type="date"] { width: 100%; max-width: 240px; border: 1px solid #d0d5dd; border-radius: 8px; padding: 8px 10px; color: var(--ink); background: #fff; }
.file-choice.is-disabled { opacity: .6; cursor: not-allowed; background: #f9fafb; }
.doc-meta-file { color: #344054; font-weight: 600; }
.doc-meta-expiry { color: #175384; font-weight: 600; }
.doc-meta-confirmed { color: var(--green); font-weight: 600; }
.doc-meta-issue { color: var(--amber); }
.person-uuid-hint { display: block; color: var(--muted); font-size: 10px; }
@media(max-width: 600px) { .employee-lists { grid-template-columns: minmax(0,1fr); } }

/* UI-UNSLOP-01 — restrained operational polish; CSS only, no workflow changes. */
:root {
  --focus-ring: #a8c7fa;
  --control-border: #c5d0dc;
}
body { line-height: 1.55; }
.topbar { gap: 18px; padding-top: 20px; padding-bottom: 20px; }
.brand-copy .eyebrow { letter-spacing: .07em; font-size: 11px; }
.topbar h1 { letter-spacing: -.015em; }
.app-shell { margin-top: 20px; }
.panel { border-radius: 12px; box-shadow: 0 3px 12px rgba(18, 40, 75, .035); margin-bottom: 16px; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { line-height: 1.35; }
.section-heading p, .source-body p { line-height: 1.55; }
.source-card { gap: 14px; padding: 17px; }
.notice { line-height: 1.55; }
.button { min-height: 40px; font-size: 13px; line-height: 1.3; }
.button-small { min-height: 34px; font-size: 12px; }
.doc-cell .button { min-height: 32px; font-size: 11px; }
.button-primary { font-weight: 700; }
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
label.button:focus-within,
.file-choice:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
input[type="search"]:focus,
input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--focus-ring);
}
.table-wrap { background: #fff; }
table, #resultsTable { font-size: 12px; }
th { font-size: 11px; letter-spacing: .015em; }
th, td { padding-top: 12px; padding-bottom: 12px; }
.person-name { font-size: 13px; line-height: 1.4; }
.person-sub, .doc-state, .doc-file-name { font-size: 11px; }
.summary-label, .results-count, .action-hint { font-size: 12px; }
.microcopy { font-size: 12px; line-height: 1.55; }
.file-choices { background: #fff; }
.file-choice { padding: 12px 14px; }
.file-choice-copy strong { font-size: 12px; }
.file-choice-copy small { font-size: 11px; }
.settings-row label, .settings-add-grid label, .folder-rule-row label { font-size: 12px; }
.settings-note { line-height: 1.6; }
.status-pill { font-size: 11px; }
.activity-log li { line-height: 1.5; }
@media (max-width: 850px) {
  .topbar { flex-wrap: wrap; }
  .app-shell { margin-top: 12px; }
  .source-card { padding: 15px; }
}
@media (max-width: 520px) {
  .topbar { gap: 10px; }
  .brand-copy { flex: 1 1 calc(100% - 60px); }
  .settings-open-btn { margin-left: 0; }
  .panel { margin-bottom: 12px; }
  .button { min-height: 42px; }
  .search-box { min-width: 0; }
  .table-toolbar { flex-wrap: wrap; }
  .table-toolbar .search-box { flex: 1 1 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}

/* OV13-UI-SOURCE-01: compact folder setup and readable, wrapping merge sequence. */
.source-setup { padding-bottom: 18px; }
.source-setup .section-heading { margin-bottom: 16px; }
.source-setup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.source-setup-card { padding: 17px 18px; background: #fff; border-radius: 10px; }
.source-setup-card .source-icon {
  width: 32px; height: 32px; flex-basis: 32px; border-radius: 8px;
  color: #175cd3; background: #eff4ff; font-size: 12px;
}
.source-setup-card .source-field-title { font-weight: 700; }
.source-setup-card .source-body > label,
.source-setup-card .source-field-title { margin-bottom: 5px; line-height: 1.4; }
.source-setup-card .source-body p { margin-bottom: 10px; font-size: 12px; line-height: 1.5; }
.source-setup-card .root-folder-actions { margin: 0; }
.source-setup-card .source-status {
  display: block; width: 100%; margin-top: 12px; padding-top: 9px;
  border-top: 1px solid #edf0f4; font-size: 12px; line-height: 1.4;
}
.source-workflow-foot {
  margin-top: 12px; padding: 14px 16px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fafbfd;
}
.source-order-heading {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px;
}
.source-order-heading h3 { font-size: 13px; margin: 0; }
.source-order-heading span { font-size: 12px; color: var(--muted); }
.source-setup .doc-order {
  display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px;
}
.source-setup .doc-order li {
  display: inline-flex; align-items: center; flex: 0 1 auto;
  gap: 8px; min-width: 0; padding: 7px 10px 7px 7px;
  border: 1px solid #e4e9f0; border-radius: 7px;
  background: #fff; color: var(--ink); font-size: 12px; line-height: 1.4;
}
.source-setup .doc-order li span {
  width: 22px; height: 22px; flex: 0 0 22px;
  border-radius: 5px; background: #edf3ff; color: #175cd3; font-size: 11px;
}
.source-help { margin-top: 12px; border-top: 1px solid var(--line); padding: 10px 0 0; }
.source-help summary {
  width: fit-content; color: #344054; cursor: pointer;
  font-size: 12px; font-weight: 650; list-style-position: inside;
}
.source-help summary:hover { color: var(--primary); }
.source-help summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.source-help p { max-width: 100ch; margin: 9px 0 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
@media (max-width: 850px) {
  .source-setup-grid { grid-template-columns: minmax(0, 1fr); }
  .source-setup-card { padding: 15px; }
}
@media (max-width: 520px) {
  .source-workflow-foot { padding: 12px; }
  .source-setup .doc-order { gap: 6px; }
  .source-setup .doc-order li { flex: 1 1 calc(50% - 6px); }
  .source-setup-card .root-folder-actions .button { white-space: normal; }
}

/* OV13-04: Grouped Settings Redesign */
.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;
}
.settings-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.settings-dirty-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}
.settings-help-details,
.settings-advanced {
  margin: 10px 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  background: #f8fafc;
}
.settings-help-details summary,
.settings-advanced summary,
.settings-add summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
}
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 14px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}
.settings-tab {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.settings-tab.is-active,
.settings-tab[aria-selected="true"] {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}
.settings-tab:focus-visible,
.workspace-detail-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.settings-tabpanel {
  min-height: 180px;
}
.settings-panel-toolbar {
  margin-bottom: 10px;
}
.settings-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.settings-unsaved-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
}
.settings-unsaved-actions {
  display: flex;
  gap: 8px;
}

/* OV13-05: Compact Employee Workspace */
.workspace-summary-row td {
  vertical-align: middle;
}
.workspace-count-cell {
  font-size: 13px;
  color: #334155;
  white-space: nowrap;
}
.workspace-status-cell {
  font-weight: 600;
  white-space: nowrap;
}
.workspace-action-cell {
  text-align: right;
  white-space: nowrap;
}
.workspace-detail-row > td {
  background: #f8fafc;
  padding: 12px;
}
.workspace-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.workspace-doc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.workspace-doc-card-head {
  font-size: 14px;
  color: #0f172a;
}
.workspace-doc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}
.workspace-doc-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

@media (max-width: 720px) {
  .workspace-doc-grid {
    grid-template-columns: 1fr;
  }
  .settings-tabs {
    gap: 4px;
  }
  .settings-tab {
    flex: 1 1 auto;
    text-align: center;
    font-size: 12px;
    padding: 6px 8px;
  }
}

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