:root{font-family:Inter,"Segoe UI",system-ui,sans-serif;color:#15233d;background:#f4f7fb;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer}a{color:#1555a3;text-decoration:none}a:hover{text-decoration:underline}h1,h2,h3,p{margin-top:0}h1{font-size:1.65rem;letter-spacing:-.035em;margin-bottom:.3rem;font-weight:740}h2{font-size:1.05rem;letter-spacing:-.015em;margin-bottom:1rem}p{line-height:1.5}small,.small{font-size:.78rem}.muted{color:#738099}.app-shell{min-height:100vh;display:grid;grid-template-columns:205px minmax(0,1fr);grid-template-rows:52px minmax(0,1fr)}.topbar{grid-row:1;grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;background:#10345d;color:#fff;min-width:0;padding:0 18px 0 23px;box-shadow:0 1px 5px #082c531b;z-index:2}.brand{display:flex;align-items:center;gap:10px;color:white;font-weight:690;font-size:.94rem;letter-spacing:-.01em}.brand:hover{text-decoration:none}.brand-symbol{font-size:1.5rem;font-family:Georgia,serif}.topbar-right{display:flex;align-items:center;gap:12px;font-size:.84rem}.firm-caption{opacity:.78;padding-right:16px;border-right:1px solid #ffffff40}.user-circle{width:29px;height:29px;border-radius:50%;background:#dfeeff;color:#144571;font-size:.75rem;font-weight:800;display:grid;place-items:center}.signout-button{color:#eef3fb;background:transparent;border:0;border-left:1px solid #ffffff35;padding:4px 0 4px 14px}.signout-button:hover{color:white;text-decoration:underline}.sidebar{grid-row:2;background:#113057;color:#e4edf7;display:flex;flex-direction:column;padding:17px 10px 14px}.sidebar nav{display:flex;flex-direction:column;gap:4px}.sidebar nav a{padding:11px 13px;color:#e6edf8;font-weight:560;font-size:.86rem;border-radius:8px}.sidebar nav a:hover{background:#254e79;text-decoration:none}.sidebar nav a.active{background:#356baa;color:white;box-shadow:inset 3px 0 #a9d8ff}.sidebar-footer{margin-top:auto;border-top:1px solid #ffffff25;padding:17px 9px 3px;font-size:.63rem;letter-spacing:.12em;color:#95aac5}.workspace{grid-row:2;padding:27px 30px 54px;overflow:hidden;min-width:0}.page-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}.page-heading p{color:#68778e;font-size:.9rem;margin:0}.btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;border:1px solid #cbd8e5;border-radius:7px;background:#fff;color:#1f456f;padding:10px 15px;min-height:40px;font-size:.86rem;font-weight:650;text-decoration:none;white-space:nowrap}.btn:hover{text-decoration:none;background:#f1f6fc}.btn.primary{color:white;border-color:#0c4d90;background:#0b4e91}.btn.primary:hover{background:#0c4279}.btn:disabled{cursor:not-allowed;opacity:.47}.btn.full{width:100%}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:19px}.metrics.two-metrics{grid-template-columns:repeat(2,minmax(0,1fr));max-width:750px}.metric{min-height:125px;background:#fff;border:1px solid #e2eaf1;border-radius:11px;padding:19px 20px;box-shadow:0 3px 12px #18385808;position:relative}.metric::before{content:"";position:absolute;height:4px;left:0;right:0;top:0;background:#3675be;border-radius:11px 11px 0 0}.metric.amber::before{background:#e9a31b}.metric.green::before{background:#22a874}.metric.rose::before{background:#df7585}.metric-label{font-size:.84rem;font-weight:640;color:#4a5a73}.metric strong{font-size:2.2rem;letter-spacing:-.055em;color:#122d4d;display:block;margin:5px 0 4px;line-height:1.2}.metric small{color:#75849a}.two-columns{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(280px,1fr);gap:18px;align-items:start}.panel{background:#fff;border:1px solid #e1e8f1;border-radius:11px;padding:19px 20px;box-shadow:0 3px 12px #18385808;margin-bottom:18px;min-width:0}.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.panel-heading h2{margin:0}.panel-heading a{font-size:.82rem;font-weight:610}.panel-heading .muted{font-size:.77rem}.panel > h2{margin-bottom:18px}.action{display:flex;justify-content:space-between;align-items:center;padding:13px 14px;border:1px solid #d5e0eb;border-radius:8px;margin-bottom:9px;background:#fff;color:#1b385a;font-size:.84rem;font-weight:600}.action span{font-size:1.35rem;font-weight:400;line-height:1;color:#6c809c}.action:hover{background:#f3f8fc;text-decoration:none}.table-scroll{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:.84rem}thead{background:#f0f4f9;color:#41536e}th{text-align:left;font-weight:700;padding:11px 12px;white-space:nowrap}td{border-bottom:1px solid #e8eef4;padding:13px 12px;vertical-align:middle}tbody tr:hover{background:#f9fbfe}tbody tr:last-child td{border-bottom:0}.pill{display:inline-flex;align-items:center;border-radius:99px;font-size:.74rem;font-weight:650;padding:4px 10px;background:#edf3fc;color:#315f95;white-space:nowrap}.pill.uploaded{background:#e7f1ff;color:#145a9c}.pill.confirmed,.pill.complete{background:#def5e9;color:#187b48}.pill.superseded{background:#edf0f5;color:#637083}.pill.invalid,.pill.incomplete{background:#fee8e9;color:#a5303f}.empty-state{color:#7b8899;background:#f8fafc;border:1px dashed #dae3ee;border-radius:8px;padding:24px;text-align:center;font-size:.84rem}.form-panel{max-width:1050px}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px}.field-grid.one-column{grid-template-columns:1fr}.field-grid label,.stack-form label,.upload-row>label,.invalid-reason{display:flex;flex-direction:column;gap:6px;font-size:.82rem;color:#42536d;font-weight:650;min-width:0}.field-grid label em{font-style:normal;color:#cd3742}.field-grid input,.field-grid select,.field-grid textarea,.stack-form input,.upload-row select,.invalid-reason input,.search,.choice{border:1px solid #cbd8e6;border-radius:7px;background:white;outline:none;padding:10px 11px;min-height:41px;color:#1c304c;font-weight:430;width:100%}.field-grid input:focus,.field-grid select:focus,.field-grid textarea:focus,.stack-form input:focus,.upload-row select:focus,.invalid-reason input:focus,.search:focus,.choice:focus{border-color:#2e75be;box-shadow:0 0 0 3px #2e75be1c}.field-grid textarea{resize:vertical}.field-grid input[type=file]{border:0;padding-left:0}.form-actions{display:flex;align-items:center;gap:10px;margin-top:24px}.subheading{margin-top:27px;border-top:1px solid #e8edf5;padding-top:22px}.checkline{display:flex;flex-wrap:wrap;gap:10px 21px}.checkline label{display:flex;align-items:center;gap:6px;font-size:.85rem}.tabs{display:flex;align-items:center;gap:10px;border-bottom:1px solid #dce5ef;margin-bottom:17px}.tab{border:0;border-bottom:3px solid transparent;padding:11px 13px;background:transparent;color:#50617b;font-weight:650;font-size:.87rem}.tab.selected{color:#0b5196;border-bottom-color:#1f6db9}.tab:disabled{opacity:.45}.breadcrumb{display:inline-block;font-size:.77rem;margin-bottom:6px}.alert{border-radius:7px;padding:12px 14px;margin-bottom:15px;font-size:.85rem;line-height:1.45}.alert.success{background:#e7f6ed;color:#166641;border:1px solid #bae2ca}.alert.danger{background:#ffedf0;color:#943448;border:1px solid #f5cbd2}.alert.warn{background:#fff8e9;color:#76520e;border:1px solid #f5e3ba}.list-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:15px}.search{max-width:420px}.upload-row{display:grid;grid-template-columns:230px minmax(0,1fr);gap:20px;align-items:start}.drop-zone{position:relative;border:2px dashed #a7bed7;border-radius:9px;min-height:111px;display:flex;align-items:center;justify-content:center;text-align:center;background:#f5f9ff;padding:15px;overflow:hidden}.drop-zone strong{font-size:.88rem;color:#275781}.drop-zone p{color:#7c90aa;font-size:.78rem;margin:6px 0 0}.drop-zone .file-cover{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.inline-actions{display:flex;gap:10px;align-items:center;white-space:nowrap;font-size:.81rem}.link-button{padding:0;border:0;background:none;color:#145ba6;font-weight:650;font-size:.81rem}.link-button.warning{color:#ab3d4b}.invalid-reason{margin-top:19px;max-width:440px}.choice{min-width:240px;font-size:.82rem}.profile-photo-row{display:flex;gap:18px;align-items:center;border-bottom:1px solid #e9eef5;padding-bottom:20px;margin-bottom:22px}.profile-photo{width:83px;height:83px;object-fit:cover;border-radius:50%}.profile-photo.placeholder{background:#e0eefa;color:#205b93;display:grid;place-items:center;font-weight:780;font-size:1.3rem}.profile-photo-row p{margin:6px 0}.profile-photo-row input{max-width:270px;font-size:.78rem}.login-surface{min-height:100vh;background:radial-gradient(circle at 15% 15%,#e5f3ff 0%,transparent 35%),linear-gradient(140deg,#f2f7ff 0%,#e3edfa 70%,#d7e8fa 100%);display:grid;place-items:center;padding:22px}.login-card{width:min(410px,100%);background:#ffffffeb;border:1px solid #e1e9f4;border-radius:15px;box-shadow:0 14px 45px #183e6d24;padding:34px 33px 28px;text-align:center}.login-emblem{font-family:Georgia,serif;font-size:2.6rem;color:#164575;margin-bottom:8px}.login-card h1{font-family:Georgia,serif;letter-spacing:-.03em;font-size:1.55rem}.login-subtitle{margin:8px 0 26px;color:#647691;font-size:.91rem}.stack-form{display:flex;flex-direction:column;gap:16px;text-align:left}.stack-form .btn{margin-top:6px}.login-notice{font-size:.74rem;margin:23px 0 0}.unauthorised{margin:auto;max-width:480px;text-align:center;padding:90px 20px}
@media(max-width:1040px){.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.two-columns{grid-template-columns:1fr}.workspace{padding:23px 20px}}@media(max-width:680px){.app-shell{grid-template-columns:1fr;grid-template-rows:52px auto minmax(0,1fr)}.topbar{padding:0 12px}.brand{font-size:.82rem}.firm-caption,.signed-in-name{display:none}.sidebar{grid-column:1;grid-row:2;padding:7px 12px}.sidebar nav{flex-direction:row;overflow-x:auto;gap:3px}.sidebar nav a{white-space:nowrap;padding:8px 9px}.sidebar-footer{display:none}.workspace{grid-column:1;grid-row:3;padding:18px 13px}.field-grid,.upload-row{grid-template-columns:1fr}.page-heading{flex-direction:column}.metric{padding:15px}.metrics{gap:9px}.metric strong{font-size:1.8rem}.panel{padding:15px}.login-card{padding:28px 22px}}
.app-shell.feedback-enabled { height: calc(100dvh - 40px); }
.client-fields { display: grid; gap: 16px; }
.workspace { background: #eaf0f7; }
.panel, .metric { border-color: #c3d1e1; box-shadow: 0 2px 4px #17385b0d, 0 6px 18px #17385b14; }
.metric-link:hover { border-color: #2e75be; background: #f1f6fc; text-decoration: none; }
.metric-link:focus-visible { outline: 2px solid #2e75be; outline-offset: 2px; }
.workspace .document-upload-card { border-color: #bdcede; box-shadow: 0 2px 6px #17385b12; }
.sidebar .sidebar-quick-actions { border-color: #ffffff40; box-shadow: 0 4px 12px #071d3633; }
.client-contact-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.client-overview-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.client-overview-metrics .metric { min-width: 0; overflow-wrap: anywhere; }
.client-overview-metrics .metric-label { margin-bottom: 8px; }
.contact-metric p { margin-bottom: 5px; font-size: .83rem; line-height: 1.4; }
.contact-metric strong { font-size: 1.3rem; line-height: 1.3; letter-spacing: -.02em; }
@media (max-width: 1040px) { .client-overview-metrics { grid-template-columns: 1fr; } }
.client-contact-cards .panel { overflow-wrap: anywhere; }
@media (max-width: 680px) {
    .client-contact-cards { grid-template-columns: 1fr; }
}
.profile-photo-row > div:last-child { min-width: 0; flex: 1; }
.profile-photo-row .profile-photo { flex-shrink: 0; }
.profile-photo-row input[type=file] { width: 100%; max-width: 100%; color: #42536d; font-size: .82rem; cursor: pointer; }
.profile-photo-row input[type=file]::file-selector-button { margin-right: 10px; padding: 7px 14px; min-height: 34px; border: 1px solid #0c4d90; border-radius: 7px; background: #0b4e91; color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
.profile-photo-row input[type=file]::file-selector-button:hover { background: #0c4279; }
.profile-photo-row input[type=file]:focus-visible { outline: 2px solid #2e75be; outline-offset: 3px; border-radius: 7px; }
.header-profile-button { display: flex; align-items: center; gap: 12px; padding: 4px 6px; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.header-profile-button:hover { background: #ffffff18; }
.header-profile-button:focus-visible { outline: 2px solid #a9d8ff; outline-offset: 2px; }
.solicitor-edit-row { position: relative; cursor: pointer; }
.solicitor-edit-link { padding: 0; border: 0; background: transparent; color: #1555a3; font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.solicitor-edit-link::after { content: ""; position: absolute; inset: 0; }
.solicitor-edit-link:focus-visible { outline: none; }
.solicitor-edit-link:focus-visible::after { outline: 2px solid #2e75be; outline-offset: -2px; }
.document-action-row, .client-details-row { position: relative; cursor: pointer; }
.document-action-link::after, .client-details-link::after { content: ""; position: absolute; inset: 0; }
.client-email-link { position: relative; z-index: 1; }
.client-details-row .lock-box-button { position: relative; z-index: 1; }
.lock-box-button.lock-box-with-count { width: auto; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.client-document-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; gap: 18px; }
.client-document-checklist li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.client-documents-link { position: relative; z-index: 1; display: inline-block; }
.client-documents-link:hover { text-decoration: none; }
.client-document-checklist .pill { white-space: nowrap; max-width: none; }
.pill.not-supplied { background: #fee8e9; color: #a5303f; }
.document-action-link:focus-visible, .client-details-link:focus-visible { outline: none; }
.document-action-link:focus-visible::after, .client-details-link:focus-visible::after { outline: 2px solid #2e75be; outline-offset: -2px; }
.document-history tr.highlighted-document, .document-history tr.highlighted-document:hover { background: #e7f1ff; box-shadow: inset 3px 0 #2e75be; }
.document-history tr:focus-visible { outline: 2px solid #2e75be; outline-offset: -2px; }
.app-shell { height: 100dvh; min-height: 0; overflow: hidden; grid-template-columns: 270px minmax(0, 1fr); }
.workspace { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.workspace:focus-visible { outline: 2px solid #2e75be; outline-offset: -2px; }
.workspace h1[tabindex="-1"]:focus { outline: none; }
.sidebar { position: static; height: 100%; min-height: 0; overflow: hidden; align-self: stretch; gap: 24px; }
.sidebar nav { flex-shrink: 0; max-height: 50%; overflow-y: auto; overscroll-behavior: contain; }
.sidebar-quick-actions { display: flex; flex-direction: column; min-height: 0; margin-top: auto; border: 1px solid #ffffff24; border-radius: 10px; padding: 14px 12px; background: #173d69; }
.sidebar-quick-actions h2 { color: #fff; font-size: .95rem; margin-bottom: 12px; }
.quick-actions-list { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: 8px; }
.quick-action { display: flex; flex-shrink: 0; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid #ffffff25; border-radius: 7px; background: #ffffff09; color: #edf4ff; font-size: .83rem; font-weight: 600; line-height: 1.4; text-align: left; cursor: pointer; }
.quick-action svg { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quick-action:hover { background: #356baa; text-decoration: none; }
.quick-action.primary { color: #133e70; background: #e5effb; border-color: #e5effb; }
.quick-action.primary:hover { background: #fff; }
.quick-action:disabled { opacity: .45; cursor: not-allowed; }
.quick-action:focus-visible { outline: 2px solid #a9d8ff; outline-offset: 2px; }
.sidebar .sidebar-footer { flex-shrink: 0; margin-top: 0; text-align: center; }
.sidebar-toggle { display: inline-flex; flex-shrink: 0; align-self: flex-end; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 7px; border: 1px solid #ffffff40; border-radius: 7px; background: #ffffff09; color: #edf4ff; cursor: pointer; }
.sidebar-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-toggle:hover { background: #356baa; }
.sidebar-toggle:focus-visible { outline: 2px solid #a9d8ff; outline-offset: 2px; }
.sidebar-brand[hidden], .sidebar nav[hidden], .sidebar-quick-actions[hidden], .sidebar-footer[hidden] { display: none; }
.app-shell.sidebar-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
.sidebar-collapsed .sidebar { gap: 0; }
.sidebar-collapsed .sidebar-toggle { align-self: center; }
@media (min-width: 681px) and (max-height: 800px) {
    .sidebar { gap: 12px; padding: 12px 10px; }
    .sidebar nav a { padding: 7px 11px; }
    .sidebar .sidebar-footer { display: none; }
    .sidebar-quick-actions { padding: 10px; }
}
@media (max-width: 680px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
    .sidebar .sidebar-toggle { align-self: flex-start; }
    .sidebar { height: auto; max-height: min(44dvh, 320px); overflow: hidden; gap: 12px; }
    .sidebar nav { max-height: none; overflow-y: hidden; }
    .sidebar-quick-actions { margin-top: 0; padding: 12px; }
    .quick-actions-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-action { min-width: 0; }
}
.app-shell { grid-template-rows: 62px minmax(0, 1fr); }
.topbar { grid-column: 2; min-height: 0; }
.sidebar { grid-column: 1; grid-row: 1 / -1; }
.sidebar-brand { flex-shrink: 0; align-self: center; padding: 4px 0; border-radius: 8px; }
.sidebar-brand:focus-visible { outline: 2px solid #a9d8ff; outline-offset: 3px; }
.topbar-left { display: flex; align-items: center; min-width: 0; flex: 1; margin-right: 24px; }
.header-firm-name { font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; font-size: clamp(1.3rem, 1.9vw, 1.75rem); font-weight: 500; line-height: 1.5; padding-block: .1em; max-width: 100%; letter-spacing: .025em; color: #f0dfb5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { flex-shrink: 0; }
@media (max-width: 900px) {
    .topbar-left { margin-right: 12px; }
    .header-firm-name { font-size: 1.25rem; }
}
@media (max-width: 680px) {
    .topbar-left { margin-right: 6px; }
    .header-firm-name { font-size: 1.05rem; }
    .topbar-right, .topbar-right .header-profile-button { gap: 6px; }
}
@media (max-width: 680px) {
    .app-shell { grid-template-rows: 62px auto minmax(0, 1fr); }
    .topbar { grid-column: 1 / -1; }
    .sidebar { grid-row: 2; }
}
.login-card.login-branded { width: min(460px, 100%); }
.login-card .login-logo { margin: 0 auto 20px; }
.login-card h1:focus { outline: none; }
.bulk-edit-dialog input[aria-invalid=true], .bulk-edit-dialog select[aria-invalid=true] { border: 2px solid #b52d43; background: #fff3f5; }
.bulk-edit-dialog input[aria-invalid=true]:focus, .bulk-edit-dialog select[aria-invalid=true]:focus { box-shadow: 0 0 0 3px #b52d4326; }
.field-error-message { color: #943448; font-size: .78rem; font-weight: 500; line-height: 1.4; }
.review-error, .review-errors { color: #943448; }
.review-errors { margin: 8px 0 12px; padding-left: 18px; line-height: 1.5; }
.review-match { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: .82rem; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-actions .btn { min-height: 34px; padding: 7px 12px; }
.review-decision { margin-bottom: 8px; font-weight: 650; }
.bulk-edit-dialog { width: min(900px, calc(100% - 32px)); }
.bulk-edit-document { margin-top: 16px; }
.bulk-upload .panel > p, .bulk-upload .drop-zone-caption, .bulk-upload .upload-field > strong { font-family: inherit; font-size: .9rem; }
.bulk-upload .drop-zone-caption p, .bulk-upload .drop-zone-caption strong { font-size: inherit; }
.bulk-upload .template-instructions { margin: 0 0 14px; color: #738099; }
.bulk-upload .template-instructions p { margin: 0; font-size: .9rem; }
.bulk-upload .template-instructions p + p { margin-top: 4px; }
.bulk-upload .upload-limits { margin: 20px 0 0; padding: 12px 14px; border: 1px solid #bfd4ed; border-left: 4px solid #3675be; border-radius: 7px; background: #edf4ff; color: #234b76; font-size: .9rem; line-height: 1.5; }
.upload-limits strong { display: block; margin-bottom: 4px; }
.upload-progress { display: flex; align-items: center; gap: 8px; width: 100%; color: #275781; font-size: .82rem; }
.upload-progress progress { flex: 1; min-width: 0; height: 10px; accent-color: #0b4e91; }
.document-history table { font-size: 1rem; }
.client-summary, .document-history-panel { padding: 12px 14px; }
.client-summary table, .document-history table { width: auto; }
.client-summary th, .client-summary td, .document-history th, .document-history td { padding: 9px 10px; }
.client-documents table { font-size: 1rem; }
.client-documents td { line-height: 1.5; padding: 15px 12px; }
.document-history .small, .document-history .pill, .document-history .link-button { font-size: .9rem; }
.document-history td { line-height: 1.5; }
.document-upload-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.document-upload-card { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid #d5e0eb; border-radius: 9px; background: #fff; }
.document-upload-card h3 { display: flex; align-items: center; min-height: 2.6em; margin: 0 0 12px; font-size: .94rem; color: #1b385a; }
.document-upload-card .drop-zone { flex: 1; padding: 14px 10px; }
@media (max-width: 1100px) {
    .document-upload-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 6px; border: 0; border-radius: 6px; color: #145ba6; background: transparent; cursor: pointer; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { background: #e7f1ff; text-decoration: none; }
.icon-button:focus-visible { outline: 2px solid #2e75be; outline-offset: 2px; }
.icon-button.warning { color: #ab3d4b; }
.icon-button.warning:hover { background: #ffedf0; }
.document-action { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--action-color); cursor: pointer; }
.action-download { --action-color: #0b4e91; --action-background: #c8dfff; --action-border: #7da8db; }
.action-confirm { --action-color: #187b48; --action-background: #def5e9; --action-border: #85c6a0; }
.action-invalidate { --action-color: #8a5700; --action-background: #fff2d5; --action-border: #d7b260; }
.action-delete { --action-color: #ab3d4b; --action-background: #ffedf0; --action-border: #df9aa4; }
.action-ocr { --action-color: #6841a0; --action-background: #efe5ff; --action-border: #b49ad6; }
.action-results { --action-color: #0b4e91; --action-background: #c8dfff; --action-border: #7da8db; }
.document-action:disabled { opacity: .5; cursor: wait; }
.document-history-actions { flex-wrap: nowrap; }
.document-history-actions > .document-action { flex-shrink: 0; }
.document-action.document-action-label { width: auto; height: auto; gap: 6px; white-space: nowrap; font-size: .9rem; }
.document-action-label svg { flex-shrink: 0; }
.document-ocr-information { display: flex; flex-direction: column; gap: 6px; min-width: 170px; max-width: 300px; overflow-wrap: anywhere; }
.ocr-result-summary { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ocr-attention { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; color: #8a5700; background: #fff2d5; }
.ocr-attention svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ocr-attention:hover { color: #8a5700; box-shadow: inset 0 0 0 1px #d7b260; }
.ocr-attention:focus-visible { outline: 2px solid #8a5700; outline-offset: 2px; }
.ocr-error { color: #a12d3b; }
.ocr-review { color: #8a5700; }
.pill.processing { background: #efe5ff; color: #6841a0; }
.pill.awaiting-validation { background: #fff2d5; color: #8a5700; }
.pill.validated { background: #def5e9; color: #187b48; }
.pill.document-workflow-status { white-space: normal; max-width: 235px; line-height: 1.35; }
.document-history .pill { white-space: nowrap; max-width: none; }
.panel.ocr-summary, .panel.ocr-checks, .panel.ocr-extracted, .panel.ocr-json { padding: 12px 14px; margin-bottom: 12px; }
.ocr-summary > h2, .ocr-checks > h2, .ocr-extracted > h2 { margin-bottom: 8px; }
.ocr-summary > p, .ocr-checks > p, .ocr-review-issues > p { margin: 6px 0 10px; }
.ocr-summary > p:last-child { margin-bottom: 0; }
.ocr-review-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ocr-review-issues, .ocr-review-document { min-width: 0; }
.ocr-review-layout h3 { margin: 0; font-size: 1rem; }
.ocr-issues-scroll { max-height: 72vh; overflow-y: auto; padding: 2px 4px 4px 2px; }
.ocr-check-actions { display: flex; justify-content: flex-end; margin-top: 2px; }
.ocr-check-actions .btn { min-height: 32px; padding: 5px 14px; }
.ocr-accepted { margin-top: 12px; }
.ocr-accepted summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.ocr-check.accepted { background: #f3f8f5; border-color: #a8cbb4; }
.ocr-issue-comparison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 6px 0 0; }
.ocr-issue-comparison > div { min-width: 0; padding: 7px 9px; border: 1px solid #d5e0eb; border-radius: 5px; background: #ffffffb3; color: #15233d; }
.ocr-issue-comparison dt { font-size: .8rem; font-weight: 650; color: #52647b; margin-bottom: 3px; }
.ocr-issue-comparison dd { margin: 0; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 600px) { .ocr-issue-comparison { grid-template-columns: minmax(0, 1fr); } }
.ocr-preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.ocr-pdf-preview { display: block; width: 100%; height: 72vh; min-height: 450px; border: 1px solid #cbd8e5; border-radius: 6px; background: #f0f4f9; margin-bottom: 10px; }
@media (max-width: 1050px) {
    .ocr-review-layout { grid-template-columns: minmax(0, 1fr); }
    .ocr-issues-scroll { max-height: none; }
}
.ocr-check-list { padding: 0; margin: 0; list-style: none; display: grid; gap: 6px; }
.ocr-check { padding: 8px 10px; border: 1px solid #d5e0eb; border-left-width: 4px; border-radius: 5px; display: grid; gap: 3px; overflow-wrap: anywhere; }
.ocr-check.error, .ocr-details .ocr-missing { background: #fff1f3; color: #8f2937; border-color: #d98e9a; }
.ocr-check.review, .ocr-details .ocr-uncertain { background: #fff8e8; color: #785000; border-color: #d7b260; }
.ocr-check.match { background: #eefaf2; border-color: #85c6a0; }
.ocr-details table { font-size: 1rem; }
.ocr-details th, .ocr-details td { padding: 8px 10px; }
.ocr-details td, .ocr-details tbody th { white-space: normal; vertical-align: top; line-height: 1.5; overflow-wrap: anywhere; min-width: 160px; }
.ocr-details tbody th { width: 27%; }
.ocr-page-link { display: inline-block; margin: 0 10px 5px 0; }
.ocr-json { margin-top: 12px; }
.ocr-json summary { cursor: pointer; font-weight: 600; }
.ocr-json pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 600px; overflow: auto; font-size: .9rem; }
.document-action:hover, .document-action:focus-visible, .document-action:active { background: var(--action-background); color: var(--action-color); box-shadow: inset 0 0 0 1px var(--action-border); text-decoration: none; }
.document-action:focus-visible { outline: 2px solid var(--action-color); outline-offset: 2px; }
.document-dialog { position: fixed; inset: 0; margin: auto; width: min(500px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border: 1px solid #e1e8f1; border-radius: 11px; background: white; color: #15233d; box-shadow: 0 20px 60px #102c5540; }
.document-dialog.solicitor-dialog { width: min(600px, calc(100% - 32px)); }
.document-dialog.profile-dialog { width: min(760px, calc(100% - 32px)); }
.document-dialog.client-delete-dialog { width: min(760px, calc(100% - 32px)); }
.client-delete-selection { max-height: 45vh; overflow-y: auto; }
.client-delete-option { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid #e8eef4; cursor: pointer; }
.client-delete-option input { width: 18px; height: 18px; flex-shrink: 0; }
.client-delete-option span span { display: block; margin-top: 3px; }
.lock-box-preview { display: block; width: 100%; height: 70vh; border: 1px solid #d5e0eb; border-radius: 6px; }
.lock-box-image { display: block; max-width: 100%; max-height: 75vh; margin: auto; object-fit: contain; }
.lock-box-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.page-heading.client-record-heading { justify-content: space-between; align-items: center; gap: 24px; }
.client-record-heading > div { min-width: 0; }
.lock-box-button.lock-box-card { flex-shrink: 0; min-width: 108px; min-height: 51px; gap: 8px; padding: 10px 13px; border-color: #b6c9de; border-radius: 8px; color: #174c83; font-size: .85rem; box-shadow: 0 2px 4px #17385b0d, 0 6px 18px #17385b14; }
.lock-box-button.lock-box-card svg { width: 24px; height: 24px; }
.lock-box-button.lock-box-card:hover { border-color: #5685b5; background: #edf5ff; }
@media (max-width: 680px) {
    .page-heading.client-record-heading { align-items: flex-start; gap: 14px; }
    .client-record-heading .lock-box-card { align-self: flex-end; }
}
.lock-box-list { margin-top: 18px; }
.lock-box-list td:first-child { overflow-wrap: anywhere; min-width: 160px; }
.lock-box-dialog .panel-heading h2 { overflow-wrap: anywhere; }
.document-dialog.client-edit-dialog { width: min(1050px, calc(100% - 32px)); }
.solicitor-fields { display: grid; gap: 16px; }
.document-dialog::backdrop { background: #10233d66; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.document-dialog > p { overflow-wrap: anywhere; }
.document-dialog .form-actions { justify-content: flex-end; }
.btn.danger { color: white; background: #ab3d4b; border-color: #ab3d4b; }
.btn.danger:hover { background: #8e2e3b; border-color: #8e2e3b; }
:root input:not([type="file"], [type="checkbox"], [type="radio"], [type="hidden"], [type="range"], [type="color"], [type="button"], [type="submit"], [type="reset"]),
:root select {
    height: 31px;
    min-height: 31px;
    padding: 5px 11px;
}
.client-fields .three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.upload-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.upload-field > strong { font-size: .82rem; color: #42536d; }
.upload-field .drop-zone { flex: 1; }
.drop-zone { flex-direction: column; gap: 12px; }
.drop-zone .drop-zone-input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; clip-path: inset(50%); overflow: hidden; }
.drop-zone .choose-file { min-height: 34px; padding: 7px 14px; }
.drop-zone .choose-file:focus-visible { outline: 2px solid #2e75be; outline-offset: 3px; }
.drop-zone .upload-status { margin: 0; max-width: 100%; overflow-wrap: anywhere; color: #42536d; }
.drop-zone .upload-status:empty { display: none; }
.drop-zone-caption { pointer-events: none; }
.drop-zone.drag-active, .drop-zone:focus-within { border-color: #2e75be; background: #e7f1ff; }
.drop-zone[aria-busy=true] { opacity: .65; }
@media (max-width: 680px) {
    .client-fields .three-columns { grid-template-columns: 1fr; }
    .document-upload-cards { grid-template-columns: 1fr; }
}
.workspace:has(> .estate-page) { overflow: hidden; padding-bottom: 18px; }
.estate-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.estate-page > :not(.estate-workspace) { flex-shrink: 0; }
.estate-workspace { display: grid; grid-template-columns: clamp(260px, var(--estate-menu-width, 310px), calc(100% - 418px)) 18px minmax(400px, 1fr); gap: 0; align-items: stretch; flex: 1; min-height: 0; }
.estate-divider { display: flex; align-items: center; justify-content: center; min-height: 0; margin: 0 4px; border-radius: 4px; background: #e4ecf5; cursor: col-resize; touch-action: none; user-select: none; }
.estate-divider::after { content: ""; width: 3px; height: 44px; border-radius: 3px; background: #7b94af; }
.estate-divider:hover, .estate-divider:focus-visible { background: #cbdcf0; outline: 2px solid #2e75be; outline-offset: -2px; }
.estate-workspace > .estate-menu { min-height: 0; overflow-y: auto; padding: 14px; margin-bottom: 0; }
.estate-section-content { min-width: 0; min-height: 0; overflow-y: auto; padding: 0 4px 4px 0; }
.estate-workspace > .estate-menu, .estate-section-content { overscroll-behavior-y: contain; scrollbar-gutter: stable; }
.estate-workspace > :focus-visible { outline: 2px solid #2e75be; outline-offset: -2px; }
.estate-editor-title { font-size: 1.2rem; margin: 0 0 16px; }
.estate-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.estate-editor-heading .estate-editor-title { margin: 0; }
.estate-groups { display: grid; grid-template-columns: 1fr; gap: 12px; }
.estate-introduction { margin: -6px 0 12px; color: #52647b; font-size: .9rem; max-height: 20vh; overflow-y: auto; }
.estate-introduction p { margin-bottom: 3px; line-height: 1.35; }
.estate-menu-group > summary { font-size: .95rem; font-weight: 650; color: #1f456f; cursor: pointer; padding: 6px 0; }
.estate-menu-group > summary::marker { color: #53789f; }
.estate-group-label { display: inline-flex; align-items: center; gap: 8px; width: calc(100% - 18px); vertical-align: middle; }
.estate-group-label > span:first-child { flex: 1; min-width: 0; }
.estate-group-label > .pill { flex-shrink: 0; margin-left: auto; font-size: .7rem; padding: 3px 7px; }
.estate-page .pill.incomplete, .estate-entry .pill.incomplete { color: #315f95; background: #edf3fc; }
.estate-group-label > .pill.incomplete { color: #8a5700; background: #fff2d5; }
.estate-menu-group > summary:focus-visible { outline: 2px solid #2e75be; outline-offset: 2px; border-radius: 4px; }
.estate-tree-children { border-left: 1px solid #cbd8e5; margin: 4px 0 0 5px; padding: 4px 0 0 12px; }
.estate-tree-children > .muted { font-size: .8rem; margin-bottom: 10px; }
.estate-menu-link.quick-action { margin-bottom: 7px; border-color: #cbd8e5; background: #f2f6fc; color: #1f456f; }
.estate-menu-link.quick-action:hover { background: #e0edfc; border-color: #8eadd0; }
.estate-menu-link.quick-action:focus-visible { outline-color: #2e75be; }
.estate-menu-link.quick-action.active { background: #dcecff; border-color: #76a2d0; box-shadow: inset 3px 0 #2e75be; }
.estate-menu-link { flex-wrap: nowrap; }
.estate-menu-link > span:not(.estate-menu-status) { flex: 1; min-width: 0; }
.estate-menu-status { margin-left: auto; flex-shrink: 0; }
.estate-menu-status .pill { font-size: .7rem; padding: 3px 7px; }
.estate-progress, .estate-add, .estate-alias { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.estate-add { align-items: end; }
.estate-add label { display: grid; gap: 6px; min-width: 240px; font-size: .85rem; }
.estate-add select { min-height: 32px; border: 1px solid #cbd8e5; border-radius: 7px; padding: 5px 9px; background: white; font-weight: 430; }
.estate-page .field-grid label, .estate-add label { font-weight: 700; }
.estate-fields label > .muted { font-weight: 400; }
.estate-entry { margin-top: 12px; border: 1px solid #c3d1e1; border-radius: 8px; padding: 12px; }
.estate-entry summary { cursor: pointer; color: #174c83; font-weight: 650; overflow-wrap: anywhere; }
.estate-entry[open] summary { margin-bottom: 16px; }
.estate-entry > .btn { margin-top: 14px; }
.estate-form-group { margin-top: 16px; padding: 14px 16px; border: 1px solid #c3d1e1; border-radius: 9px; background: #f5f8fc; box-shadow: 0 2px 6px #17385b0d; }
.estate-form-group h3 { font-size: 1rem; margin: 0; }
.estate-group-heading.panel-heading { justify-content: flex-start; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid #dce5ef; }
.estate-form-group .estate-entry { border: 0; padding: 0 0 16px; }
.estate-form-group .estate-entry + .estate-entry { padding-top: 16px; border-top: 1px dashed #c3d1e1; }
.estate-form-group .estate-entry:last-child { padding-bottom: 0; }
.estate-wide { grid-column: 1/-1; }
.estate-profile { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.estate-profile dt { color: #52647b; font-size: .8rem; font-weight: 700; }
.estate-profile dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.estate-alias { flex-wrap: nowrap; margin: 0; }
.estate-contact-editor { margin-top: 15px; }
.pill.reviewed { background: #def5e9; color: #187b48; }
.pill.completed { background: #def5e9; color: #187b48; }
@media(max-width: 900px) { .estate-groups { grid-template-columns: 1fr; } .estate-profile { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 680px) { .estate-profile { grid-template-columns: 1fr; } }
@media(max-width: 1100px) {
    .estate-workspace { grid-template-columns: 1fr; grid-template-rows: minmax(0,.4fr) minmax(0,1fr); row-gap: 18px; }
    .estate-divider { display: none; }
}
.estate-leave-actions { flex-wrap: wrap; }
.estate-section-save { margin: 0 0 18px; }
.estate-stored-document { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; margin-bottom: 16px; border: 1px solid #bdd8c9; border-radius: 7px; background: #edf7f1; }
.estate-stored-document > div { flex: 1; min-width: 150px; overflow-wrap: anywhere; }
.estate-stored-document p { margin: 4px 0 0; }
.estate-document-missing { padding: 12px; border-left: 3px solid #d7b260; background: #fff8e9; border-radius: 4px; color: #76520e; }
.contact-list-toolbar { flex-wrap: wrap; }
.contact-list-toolbar label { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.estate-contacts-table td { vertical-align: top; }
.contact-access-flags { display: flex; gap: 5px; flex-wrap: wrap; min-width: 125px; }
.contact-permission-options { display: grid; gap: 14px; margin: 20px 0; }
.contact-permission-options label { display: flex; align-items: center; gap: 10px; }
.contact-permission-options input { width: 18px; height: 18px; margin: 0; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.pill.unreferenced { color: #637083; background: #edf0f5; }
.pill.practice-contact { color: #1f456f; background: #e2edfa; }
