:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --canvas: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-blue: #eff6ff;
  --divider: #e2e8f0;
  --control: #cbd5e1;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: #dbeafe;
  --gold: #d97706;
  --gold-text: #92400e;
  --gold-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --success: #047857;
  --success-soft: #ecfdf5;
  --radius: 9px;
  --card-radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 4%), 0 10px 30px rgb(15 23 42 / 5%);
  --shadow-raised: 0 16px 40px rgb(15 23 42 / 10%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }
img, svg { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(26px, 3vw, 32px); font-weight: 600; line-height: 1.14; letter-spacing: -.025em; }
h2 { margin-bottom: 8px; font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; }
h3 { margin-bottom: 5px; font-size: 15px; font-weight: 600; line-height: 1.3; }
p { color: var(--muted); }
small { color: var(--muted); }

:focus-visible { outline: 3px solid rgb(29 78 216 / 24%); outline-offset: 2px; }
.skip-link { position: fixed; z-index: 9999; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-150%); border-radius: 6px; background: var(--ink); color: #fff; }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute !important; top: 0 !important; left: 0 !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .105em; text-transform: uppercase; }
.back-link { display: inline-flex; margin-bottom: 16px; font-size: 13px; font-weight: 600; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.checksum { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px !important; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; background: var(--gold); color: var(--ink); font-size: 16px; font-weight: 800; box-shadow: inset 0 0 0 1px rgb(17 24 39 / 8%); }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 17px; letter-spacing: .12em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .015em; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; font-size: 13px; font-weight: 650; line-height: 1.2; transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease; }
.button:hover { text-decoration: none; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.button-primary:hover { border-color: #253044; background: #253044; color: #fff; }
.button-secondary { border-color: var(--control); background: #fff; color: var(--ink); }
.button-secondary:hover { border-color: #94a3b8; background: var(--surface-subtle); color: var(--ink); }
.button-context { border-color: var(--blue); background: var(--blue); color: #fff; }
.button-context:hover { border-color: var(--blue-hover); background: var(--blue-hover); color: #fff; }
.button-quiet { min-height: 36px; padding: 7px 11px; border-color: transparent; background: transparent; color: var(--ink-soft); }
.button-quiet:hover { background: var(--surface-subtle); color: var(--ink); }
.button-full { width: 100%; min-height: 44px; }
.button:disabled, .button[aria-disabled="true"] { cursor: not-allowed; opacity: .48; transform: none; }
.button[aria-disabled="true"] { pointer-events: none; }
.text-button { padding: 3px; border: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 600; }

input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--control); border-radius: var(--radius); background: #fff; color: var(--ink); }
textarea { min-height: 86px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgb(29 78 216 / 13%); }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--blue); }
.field { display: grid; align-content: start; gap: 6px; }
.field label { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.required { margin-left: 2px; color: var(--danger); }
.help-text, .error-text { display: block; font-size: 11px; }
.error-text { color: var(--danger); }
.field-error input, .field-error select, .field-error textarea { border-color: var(--danger); }
.checkbox-field { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--divider); border-radius: var(--radius); }
.checkbox-field input { flex: 0 0 auto; }
.checkbox-field label { font-size: 13px; font-weight: 600; }

.message-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 11px 13px; border: 1px solid var(--divider); border-left-width: 3px; border-radius: 6px; background: #fff; font-size: 13px; }
.message-success { border-left-color: var(--success); background: var(--success-soft); color: #0d5534; }
.message-error { border-left-color: var(--danger); background: var(--danger-soft); color: #7e2f2b; }
.message-info { border-left-color: var(--blue); background: var(--surface-blue); color: #173d9d; }

/* Authentication */
.auth-app { display: grid; min-height: 100vh; place-items: center; padding: 28px; background: #f4f4f2; }
.auth-shell { width: min(1010px, 100%); }
.auth-card { display: grid; min-height: 600px; grid-template-columns: .95fr 1.05fr; overflow: hidden; border: 1px solid var(--divider); border-radius: 16px; background: #fff; box-shadow: 0 24px 72px rgb(17 24 39 / 12%); }
.auth-brand-pane { display: flex; flex-direction: column; justify-content: space-between; padding: 42px; background: var(--ink); color: #fff; }
.auth-brand-pane .brand { color: #fff; }
.auth-brand-pane .brand small { color: #c9ced8; }
.auth-brand-pane .brand-mark { color: var(--ink); }
.auth-brand-pane h1 { max-width: 430px; margin-bottom: 18px; font-size: clamp(30px, 4vw, 40px); }
.auth-brand-pane p { max-width: 410px; color: #c9ced8; font-size: 15px; }
.auth-brand-pane .eyebrow { color: #e4b55f; }
.auth-trust { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px !important; }
.auth-trust span { color: #e4b55f; }
.auth-form-pane { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 6vw, 72px); }
.auth-form-pane > h2 { font-size: 26px; }
.auth-form-pane > .muted { margin-bottom: 28px; }
.auth-form { display: grid; gap: 20px; }
.auth-form input { min-height: 46px; }
.auth-form input[name="code"] { font-size: 22px; font-weight: 700; letter-spacing: .28em; text-align: center; }
.auth-footnote { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--divider); font-size: 12px; }
.resend-form { margin-top: 18px; text-align: center; }

/* Adel admin shell */
.admin-app { min-width: 1180px; background: #fff; }
.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 240px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 24px 16px 16px; border-right: 1px solid var(--divider); background: #fff; }
.brand-admin { padding: 0 8px 26px; }
.admin-nav { display: grid; gap: 4px; }
.admin-nav a { position: relative; display: flex; min-height: 44px; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 6px; color: #667085; font-size: 14px; font-weight: 600; }
.admin-nav a:hover { background: var(--surface-subtle); color: var(--ink); }
.admin-nav a.active { background: var(--gold-soft); color: var(--gold-text); }
.admin-nav a.active::before { position: absolute; top: 9px; bottom: 9px; left: 0; width: 3px; border-radius: 0 2px 2px 0; background: var(--gold); content: ""; }
.admin-nav svg, .nav-logout svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer { display: grid; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--divider); }
.signed-in-user { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 4px 6px; }
.signed-in-user > span:last-child { display: grid; min-width: 0; }
.signed-in-user strong, .signed-in-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signed-in-user strong { font-size: 12px; }
.signed-in-user small { font-size: 10px; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #eceef1; color: var(--ink); font-size: 12px; font-weight: 700; }
.nav-logout { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; }
.nav-logout:hover { background: var(--surface-subtle); color: var(--ink); }
.admin-main { width: 100%; max-width: 1500px; margin: 0 auto; padding: 40px 44px 48px; }
.page-header { margin-bottom: 30px; }
.page-header > p:last-child { margin-bottom: 0; }
.page-header-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.page-header-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.metric { display: grid; gap: 8px; padding: 18px 20px; border: 1px solid var(--divider); border-radius: var(--card-radius); box-shadow: var(--shadow); }
.metric span { color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.metric strong { font-size: 26px; font-weight: 600; }
.operational-surface { border: 1px solid var(--divider); background: #fff; }
.table-toolbar { display: flex; min-height: 68px; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--divider); }
.search-field { width: min(480px, 45vw); }
.table-toolbar input, .table-toolbar select { height: 42px; }
.table-toolbar select { width: 190px; margin-left: auto; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.data-table th { height: 48px; padding: 10px 14px; border-bottom: 1px solid var(--divider); background: var(--surface-subtle); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .075em; text-align: left; text-transform: uppercase; }
.data-table td { height: 56px; padding: 10px 14px; border-bottom: 1px solid #ececec; color: var(--ink-soft); font-size: 13px; vertical-align: middle; }
.data-table tbody th { height: 56px; padding: 10px 14px; border-bottom: 1px solid #ececec; color: var(--ink-soft); font-size: 13px; font-weight: 400; text-align: left; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:last-child th { border-bottom: 0; }
.data-table tbody tr:hover td, .data-table tbody tr:hover th { background: #fdfdfd; }
.data-table td > strong, .data-table td > small { display: block; }
.data-table td > strong { color: var(--ink); font-weight: 600; }
.data-table td > small { margin-top: 3px; font-size: 11px; }
.unit-cell > strong, .unit-cell > small { display: block; }
.unit-cell > strong { color: var(--ink); font-size: 15px; font-weight: 700; }
.unit-cell > small { max-width: 220px; margin-top: 4px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.assigned-party-list { display: grid; gap: 8px; min-width: 300px; margin: 0; padding: 0; list-style: none; }
.assigned-party-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.assigned-party-copy { display: grid; min-width: 0; }
.assigned-party-list strong, .assigned-party-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assigned-party-list strong { color: var(--ink); font-size: 12px; font-weight: 600; }
.assigned-party-list small { margin-top: 2px; font-size: 10px; }
.party-process-icon { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid var(--divider); border-radius: 50%; }
.party-process-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.party-process-icon.is-complete { border-color: #acd6be; background: var(--success-soft); color: var(--success); }
.party-process-icon.is-in-progress { border-color: #cdd9f6; background: var(--surface-blue); color: var(--blue); }
.party-role-hint { position: relative; display: inline-grid; justify-self: end; }
.party-role-icon { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--divider); border-radius: 50%; cursor: help; transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease; }
.party-role-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.party-role-icon.is-owner { border-color: #efd6a9; background: var(--gold-soft); color: var(--gold-text); }
.party-role-icon.is-co-owner { border-color: #d9dde3; background: #f5f6f7; color: #4b5563; }
.party-role-hint:hover .party-role-icon, .party-role-hint:focus-within .party-role-icon { transform: translateY(-1px); }
.party-role-tooltip { position: absolute; z-index: 30; top: 50%; right: calc(100% + 8px); padding: 6px 8px; transform: translate(4px, -50%); border-radius: 5px; visibility: hidden; background: var(--ink); box-shadow: var(--shadow); color: #fff; font-size: 10px; font-weight: 650; line-height: 1.2; opacity: 0; pointer-events: none; white-space: nowrap; transition: opacity .12s ease, transform .12s ease, visibility .12s ease; }
.party-role-hint:hover .party-role-tooltip, .party-role-hint:focus-within .party-role-tooltip { transform: translate(0, -50%); visibility: visible; opacity: 1; }
.assigned-party-list li.assigned-party-empty { display: block; min-height: 22px; padding-left: 33px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.action-cell { text-align: right; }
.action-cell a { font-weight: 650; }
.action-links { display: inline-flex; align-items: center; gap: 10px; }
.action-links a + a { padding-left: 10px; border-left: 1px solid var(--divider); }
.progress-inline { display: flex; align-items: center; gap: 9px; }
.progress-inline > span { display: block; width: 90px; height: 5px; overflow: hidden; border-radius: 4px; background: #e8e9eb; }
.progress-inline i { display: block; height: 100%; background: var(--blue); }
.progress-inline small { min-width: 32px; }
.status { display: inline-flex; min-height: 24px; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid #dfe3e8; border-radius: 999px; background: #f6f7f8; color: #4b5563; font-size: 10px; font-weight: 700; line-height: 1; white-space: nowrap; }
.status::before { width: 6px; height: 6px; border-radius: 50%; background: #9aa1ac; content: ""; }
.status-in_progress, .status-ready_for_attestation { border-color: #cdd9f6; background: #f4f7ff; color: #23469b; }
.status-in_progress::before, .status-ready_for_attestation::before { background: var(--blue); }
.status-awaiting_signatures { border-color: #efd6a9; background: var(--gold-soft); color: var(--gold-text); }
.status-awaiting_signatures::before { background: var(--gold); }
.status-received, .status-complete { border-color: #bcdcca; background: var(--success-soft); color: var(--success); }
.status-received::before, .status-complete::before { background: var(--success); }
.status-large { min-height: 30px; padding: 6px 10px; font-size: 11px; }
.empty-state { padding: 50px 20px; text-align: center; }
.empty-state strong { font-size: 15px; }
.empty-state p { margin: 5px 0 0; }
.admin-form { padding-bottom: 70px; }
.form-section { margin-bottom: 18px; border: 1px solid var(--divider); }
.form-section > header { display: flex; align-items: flex-start; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--divider); background: var(--surface-subtle); }
.form-section > header > span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--control); border-radius: 50%; background: #fff; color: var(--muted); font-size: 10px; font-weight: 700; }
.form-section > header h2 { margin: 0 0 2px; font-size: 15px; }
.form-section > header p { margin: 0; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; padding: 22px; }
.form-grid-three { grid-template-columns: repeat(3, 1fr); }
.sticky-form-actions { position: sticky; z-index: 5; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; border-top: 1px solid var(--divider); background: rgb(255 255 255 / 94%); backdrop-filter: blur(8px); }
.unit-edit-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); gap: 22px; align-items: start; }
.unit-settings-form { padding-bottom: 0; }
.unit-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 2px 0 18px; }
.unit-owner-management { position: sticky; top: 22px; display: grid; gap: 18px; }
.edit-party-list { display: grid; }
.edit-party-list article { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; min-height: 66px; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #ececec; }
.edit-party-list article:last-child { border-bottom: 0; }
.edit-party-list article > span:nth-child(2) { display: grid; min-width: 0; }
.edit-party-list strong, .edit-party-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-party-list strong { font-size: 11px; font-weight: 650; }
.edit-party-list small { margin-top: 2px; font-size: 9px; }
.edit-party-meta { display: grid; justify-items: end; gap: 5px; }
.owner-panel-actions { display: flex; align-items: center; gap: 10px; }
.owner-count { min-width: 20px; color: var(--muted); font-size: 12px; text-align: center; }
.owner-add-button { min-height: 32px; padding: 6px 10px; color: var(--blue); font-size: 11px; }
.owner-add-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.owner-add-button[aria-expanded="true"] { border-color: #cdd9f6; background: #f4f7ff; }
.add-co-owner-panel form { padding: 16px; }
.compact-form-fields { display: grid; gap: 14px; }
.form-impact-note { margin: 16px 0; padding: 11px 12px; border-left: 3px solid var(--gold); background: var(--gold-soft); color: #66512b; font-size: 10px; }
.locked-unit-notice { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 18px; margin-bottom: 22px; padding: 24px; border: 1px solid #bcdcca; border-radius: var(--card-radius); background: var(--success-soft); }
.locked-unit-notice > span:first-child { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: var(--success); color: #fff; }
.locked-unit-notice svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.locked-unit-notice h2 { margin-bottom: 4px; font-size: 18px; }
.locked-unit-notice p:last-child { max-width: 760px; margin: 0; color: #47775f; font-size: 12px; }
.protected-settings-panel { overflow: hidden; }
.protected-settings-panel .fact-grid { border-top: 0; border-left: 0; }
.protected-settings-note { margin: 0; padding: 14px 16px; border-top: 1px solid var(--divider); color: var(--muted); font-size: 11px; }
.facts-band { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 24px; border: 1px solid var(--divider); }
.facts-band > div { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--divider); }
.facts-band > div:last-child { border-right: 0; }
.facts-band span, .facts-band strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.facts-band span { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.facts-band strong { font-size: 13px; white-space: nowrap; }
.admin-detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.panel { border: 1px solid var(--divider); }
.panel-header, .surface-header { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--divider); background: var(--surface-subtle); }
.panel-header h2, .surface-header h2 { margin: 0; font-size: 15px; }
.panel-header .eyebrow, .surface-header .eyebrow { margin-bottom: 3px; }
.party-list { display: grid; }
.party-row { display: flex; min-height: 72px; align-items: center; gap: 11px; padding: 13px 16px; border-bottom: 1px solid #ececec; }
.party-row:last-child { border-bottom: 0; }
.party-row > div:nth-child(2) { display: grid; min-width: 180px; }
.party-row small { font-size: 11px; }
.party-statuses { display: flex; gap: 5px; margin-left: auto; }
.mini-status { display: inline-flex; min-height: 23px; align-items: center; padding: 3px 7px; border: 1px solid var(--divider); border-radius: 999px; background: #f7f7f7; color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.mini-status.done { border-color: #bcdcca; background: var(--success-soft); color: var(--success); }
.audit-list { display: grid; margin: 0; padding: 12px 18px 18px; list-style: none; }
.audit-list li { position: relative; display: flex; gap: 11px; min-height: 46px; padding: 7px 0; }
.audit-list li > span { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 5px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px #aab9df; }
.audit-list li:not(:last-child)::before { position: absolute; top: 20px; bottom: -4px; left: 3px; width: 1px; background: var(--divider); content: ""; }
.audit-list li > div { display: grid; }
.audit-list strong { font-size: 11px; font-weight: 650; }
.audit-list small { font-size: 10px; }
.section-spaced { margin-top: 20px; }

/* Adel dossier document workspace */
.document-workspace { overflow: hidden; border-radius: var(--card-radius); box-shadow: var(--shadow); }
.document-workspace-header { min-height: 88px; align-items: flex-start; padding: 18px 20px; }
.document-workspace-header h2 { font-size: 18px; }
.document-workspace-header p:last-child { margin: 4px 0 0; font-size: 12px; }
.workspace-progress { display: grid; min-width: 210px; justify-items: end; padding-top: 2px; }
.workspace-progress strong { color: var(--blue); font-size: 24px; font-weight: 650; letter-spacing: -.025em; }
.workspace-progress small { margin-top: 2px; font-size: 10px; }
.document-tabs-wrap { overflow-x: auto; border-bottom: 1px solid var(--divider); background: #f3f4f6; }
.document-tabs { display: flex; min-width: max-content; padding: 10px 12px 0; }
.document-tab { display: flex; min-width: 245px; flex: 1 0 245px; align-items: center; gap: 10px; padding: 12px 16px 13px; border: 1px solid transparent; border-bottom: 2px solid transparent; border-radius: 7px 7px 0 0; color: var(--ink-soft); }
.document-tab:hover { border-color: #d8dce3; border-bottom-color: var(--blue); background: rgb(255 255 255 / 70%); color: var(--ink); }
.document-tab.is-active, .document-tab[aria-selected="true"] { border-color: var(--divider); border-bottom-color: var(--blue); background: #fff; color: var(--blue); }
.document-tab > span:last-child { display: grid; min-width: 0; }
.document-tab strong, .document-tab small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-tab strong { font-size: 12px; font-weight: 650; }
.document-tab small { margin-top: 3px; font-size: 9px; }
.document-tab-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #e4e7ec; color: var(--ink); font-size: 10px; font-weight: 750; }
.document-tab.is-active .document-tab-icon, .document-tab[aria-selected="true"] .document-tab-icon { background: #e9efff; color: var(--blue); }
.document-panel { scroll-margin-top: 18px; background: #fff; }
.document-panel + .document-panel { border-top: 12px solid #f3f4f6; }
.tabs-enhanced .document-panel { border-top: 0; }
.document-panel-header { display: flex; min-height: 88px; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--divider); }
.document-panel-header h3 { margin: 0; font-size: 17px; }
.document-panel-header p:last-child { max-width: 700px; margin: 5px 0 0; font-size: 11px; }
.document-panel-count { padding: 6px 9px; border-radius: 999px; background: var(--surface-subtle); color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.participant-panel-header { background: var(--surface-subtle); }
.participant-panel-title { display: flex; align-items: center; gap: 12px; }
.participant-panel-title > span:last-child { display: grid; }
.participant-panel-title .avatar { width: 40px; height: 40px; background: #e9efff; color: var(--blue); }
.participant-panel-title .eyebrow { margin-bottom: 2px; }
.participant-panel-title small { margin-top: 2px; font-size: 10px; }
.participant-readiness { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.document-subsection-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px 12px; }
.document-subsection-header h4 { margin: 0; font-size: 13px; }
.document-subsection-header p { margin: 3px 0 0; font-size: 10px; }
.owner-document-table { width: 100%; min-width: 960px; table-layout: fixed; }
.owner-document-col-document { width: 26%; }
.owner-document-col-scope { width: 13%; }
.owner-document-col-file { width: 33%; }
.owner-document-col-review { width: 28%; }
.owner-document-table td { vertical-align: top; }
.owner-document-table .requirement-file-continuation td { border-top-color: #edf2f7; }
.admin-file-entry { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 2px 0; }
.admin-file-entry + .admin-file-entry { margin-top: 8px; padding-top: 8px; border-top: 1px solid #ececec; }
.admin-file-entry > span:first-child { display: grid; min-width: 0; }
.admin-file-entry a { overflow-wrap: anywhere; font-weight: 650; }
.admin-file-entry small { margin-top: 2px; font-size: 9px; }
.document-review-cell { min-width: 0; }
.document-review-summary { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 10px; }
.document-review-summary .document-review-status { justify-self: start; }
.button.document-review-trigger { width: max-content; min-height: 24px; flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: 10px; line-height: 1.4; white-space: nowrap; }
.document-review-updated { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.document-review-dialog { width: min(520px, calc(100vw - 32px)); max-width: none; padding: 0; overflow: hidden; border: 1px solid var(--divider); border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgb(15 23 42 / 24%); }
.document-review-dialog::backdrop { background: rgb(15 23 42 / 48%); backdrop-filter: blur(2px); }
.document-review-modal-form { display: grid; }
.document-review-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--divider); }
.document-review-modal-header h2 { margin: 0; font-size: 20px; }
.document-review-modal-header p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.document-review-modal-close { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.document-review-modal-close:hover { background: var(--surface-subtle); color: var(--ink); }
.document-review-modal-close svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.document-review-modal-fields { display: grid; gap: 8px; padding: 22px; }
.document-review-current-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; padding: 10px 12px; border: 1px solid var(--divider); border-radius: 8px; background: var(--surface-subtle); }
.document-review-current-status > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.document-review-modal-fields label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.document-review-modal-fields label:not(:first-child) { margin-top: 7px; }
.document-review-modal-fields select,
.document-review-modal-fields textarea { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; }
.document-review-modal-fields textarea { min-height: 112px; max-height: 240px; resize: vertical; }
.document-review-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--divider); background: var(--surface-subtle); }
.agreement-admin-section { overflow: hidden; }
.page-actions.admin-workflow-actions { justify-content: flex-end; }
.agreement-facts { grid-template-columns: repeat(4, 1fr); }
.agreement-admin-header { align-items: center; }
.agreement-admin-header h2 { margin-bottom: 4px; }
.agreement-admin-header p:last-child { margin: 0; }
.agreement-admin-body { display: grid; gap: 16px; padding: 22px; }
.agreement-readiness-note { padding: 16px 18px; border-left: 3px solid var(--gold); background: var(--gold-soft); color: var(--gold-text); }
.agreement-readiness-note p { margin: 4px 0 0; font-size: 12px; }
.agreement-file-row, .agreement-empty-state { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--divider); border-radius: 9px; background: var(--surface-subtle); }
.agreement-file-row > div, .agreement-empty-state > div { display: grid; min-width: 0; }
.agreement-file-row strong, .agreement-empty-state strong { overflow-wrap: anywhere; }
.agreement-file-row small, .agreement-empty-state p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.signed-agreement-row { border-color: #a7f3d0; background: var(--success-soft); }
.agreement-upload-form { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid var(--divider); border-radius: 9px; }
.agreement-upload-form > div { display: grid; min-width: 0; gap: 7px; }
.agreement-upload-form label { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.agreement-upload-form input[type="file"] { max-width: 100%; color: var(--ink-soft); font-size: 12px; }
.agreement-upload-form small { color: var(--muted); font-size: 10px; }
.agreement-workflow { display: grid; gap: 18px; }
.agreement-workflow > header { margin-bottom: 0; }
.agreement-empty-state { grid-template-columns: 42px minmax(0, 1fr) auto; }
.agreement-status-group { display: grid; gap: 5px; justify-items: start; }
.agreement-status-group > span:first-child { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.agreement-complete { margin-top: 0; }
.empty-table-cell { height: 88px !important; color: var(--muted) !important; text-align: center; }
.status-rejected { border-color: #efc5c2; background: var(--danger-soft); color: var(--danger); }
.status-rejected::before { background: var(--danger); }
.history-panel { overflow: hidden; border: 1px solid var(--divider); border-radius: 8px; background: #fff; }
.history-panel summary { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; cursor: pointer; list-style: none; background: var(--surface-subtle); }
.history-panel summary::-webkit-details-marker { display: none; }
.history-panel summary:hover { background: #f4f4f4; }
.history-summary-copy { display: grid; }
.history-summary-copy .eyebrow { margin-bottom: 2px; }
.history-summary-copy > strong { font-size: 14px; font-weight: 650; }
.history-summary-copy > small { margin-top: 2px; font-size: 10px; }
.history-summary-action { display: flex; align-items: center; gap: 10px; color: var(--blue); font-size: 10px; font-weight: 650; }
.history-count { padding: 5px 8px; border-radius: 999px; background: #e9eaec; color: var(--muted); }
.history-hide { display: none; }
.history-chevron { display: inline-block; color: var(--muted); font-size: 16px; transition: transform .15s ease; }
.history-panel[open] .history-show { display: none; }
.history-panel[open] .history-hide { display: inline; }
.history-panel[open] .history-chevron { transform: rotate(180deg); }
.history-content { border-top: 1px solid var(--divider); }
.history-content .audit-list { padding: 14px 20px 10px; }
.history-limit-note { margin: 0; padding: 0 20px 16px 39px; font-size: 10px; }

/* Private participant messaging */
.document-tab-item { position: relative; min-width: 245px; flex: 1 0 245px; }
.document-tab-item .document-tab { width: 100%; min-width: 0; height: 100%; padding-right: 58px; }
.participant-message-trigger { position: absolute; z-index: 2; top: 50%; right: 11px; display: grid; width: 34px; height: 34px; place-items: center; margin: 0; padding: 0; transform: translateY(-50%); border: 1px solid #ccd4e2; border-radius: 9px; background: #fff; color: #52647c; box-shadow: 0 1px 2px rgb(17 24 39 / 5%); }
.participant-message-trigger:hover { border-color: #9eb2d8; background: var(--surface-blue); color: var(--blue); }
.participant-message-trigger:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.participant-message-trigger svg, .buyer-message-trigger svg, .allotment-message-count svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.message-unread-badge { display: inline-flex; min-width: 19px; height: 19px; align-items: center; justify-content: center; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 9px; font-weight: 800; line-height: 1; }
.message-unread-badge[hidden] { display: none; }
.participant-message-trigger .message-unread-badge { position: absolute; top: -7px; right: -7px; box-shadow: 0 0 0 2px #f3f4f6; }
.message-drawer-open { overflow: hidden; }

.message-drawer { width: min(448px, 100vw); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; padding: 0; overflow: hidden; border: 0; border-left: 1px solid var(--divider); background: #fff; box-shadow: -16px 0 44px rgb(17 24 39 / 16%); color: var(--ink); }
.message-drawer[open] { animation: message-drawer-in .18s ease-out; }
.message-drawer::backdrop { background: rgb(17 24 39 / 42%); }
.message-drawer-layout { display: grid; height: 100%; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.message-drawer-header { display: flex; min-height: 84px; grid-row: 1; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--divider); background: #fff; }
.message-drawer-person { display: flex; min-width: 0; align-items: center; gap: 11px; }
.message-drawer-person > span:last-child { display: grid; min-width: 0; }
.message-drawer-person .avatar { background: #e9efff; color: var(--blue); }
.message-drawer-person h2 { margin: 0; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.message-drawer-person h2:focus { outline: 0; }
.message-drawer-person .eyebrow { margin-bottom: 2px; }
.message-drawer-person p:last-child { margin: 3px 0 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-drawer-close { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.message-drawer-close:hover { background: var(--surface-subtle); color: var(--ink); }
.message-drawer-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.message-drawer-status { grid-row: 2; padding: 10px 18px; border-bottom: 1px solid #e9e9e9; background: var(--surface-blue); color: #38518e; font-size: 10px; }
.message-drawer-status[hidden] { display: none; }
.message-thread { min-height: 0; overflow-y: auto; padding: 18px; background: var(--surface-subtle); scroll-behavior: smooth; }
.message-drawer .message-thread { grid-row: 3; }
.message-row { display: flex; justify-content: flex-start; margin-bottom: 12px; }
.message-row:last-child { margin-bottom: 0; }
.message-row.is-outgoing { justify-content: flex-end; }
.message-bubble { max-width: 82%; padding: 10px 12px; border: 1px solid var(--divider); border-radius: 4px 12px 12px; background: #fff; color: var(--ink-soft); box-shadow: 0 1px 2px rgb(17 24 39 / 3%); }
.message-row.is-outgoing .message-bubble { border-color: var(--blue); border-radius: 12px 4px 12px 12px; background: var(--blue); color: #fff; }
.message-bubble-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 5px; }
.message-bubble-meta strong { font-size: 10px; font-weight: 750; }
.message-bubble-meta time { color: var(--muted); font-size: 8px; white-space: nowrap; }
.message-row.is-outgoing .message-bubble-meta time { color: rgb(255 255 255 / 72%); }
.message-bubble p { margin: 0; color: inherit; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-empty-state { display: grid; min-height: 100%; place-content: center; justify-items: center; padding: 40px 22px; text-align: center; }
.message-empty-state svg { width: 38px; height: 38px; margin-bottom: 14px; fill: none; stroke: #9aa6bb; stroke-width: 1.4; }
.message-empty-state strong { font-size: 14px; }
.message-empty-state p { max-width: 290px; margin: 5px 0 0; font-size: 11px; }
.message-composer { display: grid; gap: 9px; padding: 14px 16px 16px; border-top: 1px solid var(--divider); background: #fff; }
.message-drawer .message-composer { grid-row: 4; }
.message-composer textarea { min-height: 76px; max-height: 180px; resize: vertical; }
.message-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.message-composer-hint { color: var(--muted); font-size: 9px; }
.message-composer .button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.message-form-error { margin: 0; color: var(--danger); font-size: 10px; }

.message-page-header { max-width: 860px; }
.message-page-card { width: min(860px, 100%); overflow: hidden; border: 1px solid var(--divider); border-radius: var(--card-radius); background: #fff; box-shadow: var(--shadow); }
.message-page-thread { min-height: 380px; max-height: 58vh; }
.message-page-composer { padding: 18px; }
.message-page-composer > label { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.message-history-note { margin: 0; padding: 8px 18px; border-top: 1px solid var(--divider); color: var(--muted); font-size: 9px; text-align: center; }

@keyframes message-drawer-in {
  from { transform: translateX(28px); opacity: .6; }
  to { transform: translateX(0); opacity: 1; }
}

/* Buyer shell */
.buyer-app { background: #f6f6f4; }
.buyer-header { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid var(--divider); background: rgb(255 255 255 / 96%); backdrop-filter: blur(8px); }
.buyer-header-inner { display: flex; max-width: 1160px; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto; padding: 0 28px; }
.buyer-account { display: flex; align-items: center; gap: 12px; }
.buyer-name { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.buyer-main { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 64px; }
.buyer-page-header { max-width: 760px; margin-bottom: 28px; }
.buyer-page-header > p:last-child { margin-bottom: 0; font-size: 15px; }
.buyer-page-header.compact { max-width: none; margin-bottom: 22px; }
.buyer-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.buyer-heading-row p { margin-bottom: 0; }
.buyer-heading-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.buyer-message-trigger { position: relative; min-height: 36px; padding: 7px 11px; }
.buyer-message-trigger .message-unread-badge { margin-left: 2px; }
.allotment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.allotment-card { display: grid; min-height: 270px; padding: 24px; border: 1px solid var(--divider); border-radius: var(--card-radius); background: #fff; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.allotment-card:hover { transform: translateY(-2px); border-color: #b9c2d0; color: var(--ink); box-shadow: 0 12px 34px rgb(17 24 39 / 9%); }
.allotment-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.allotment-card-meta { display: grid; justify-items: end; gap: 6px; }
.allotment-message-count { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-size: 9px; font-weight: 750; }
.allotment-card h2 { margin-bottom: 6px; }
.progress-block { align-self: end; margin-top: 20px; }
.progress-block > div { height: 7px; overflow: hidden; margin-bottom: 7px; border-radius: 6px; background: #eaebed; }
.progress-block > div span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.card-link { align-self: end; margin-top: 20px; color: var(--blue); font-size: 13px; }
.card-link span { margin-left: 4px; }
.card { border: 1px solid var(--divider); border-radius: var(--card-radius); background: #fff; }
.journey-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; border: 1px solid var(--divider); border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgb(17 24 39 / 3%); }
.journey-steps > a, .journey-steps > span { position: relative; display: flex; min-height: 66px; align-items: center; gap: 10px; padding: 12px 14px; color: var(--muted); }
.journey-steps > *:not(:last-child)::after { position: absolute; top: 18px; right: 0; bottom: 18px; width: 1px; background: var(--divider); content: ""; }
.journey-steps > * > span { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 1px solid var(--control); border-radius: 50%; background: #fff; font-size: 11px; font-weight: 700; }
.journey-steps strong { font-size: 12px; }
.journey-steps .active { background: var(--gold-soft); color: var(--gold-text); }
.journey-steps .active::before { position: absolute; right: 14px; bottom: 0; left: 14px; height: 2px; background: var(--gold); content: ""; }
.journey-steps .active > span { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.journey-steps .complete { color: var(--success); }
.journey-steps .complete > span { border-color: var(--success); background: var(--success-soft); }
.journey-steps .future { cursor: default; }
.buyer-hero-card { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 30px; align-items: center; margin-bottom: 22px; padding: 30px 32px; border-radius: var(--card-radius); background: var(--ink); color: #fff; }
.buyer-hero-card h2 { font-size: 24px; }
.buyer-hero-card p { max-width: 650px; color: #cbd1db; }
.buyer-hero-card .button-primary { border-color: #fff; background: #fff; color: var(--ink); }
.hero-progress { display: grid; place-items: center; padding: 22px; border: 1px solid #394457; border-radius: 10px; text-align: center; }
.hero-progress strong { color: #e4b55f; font-size: 36px; line-height: 1; }
.hero-progress span { margin-top: 7px; color: #cbd1db; font-size: 10px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.buyer-section { margin-bottom: 20px; padding: 26px 28px; border: 1px solid var(--divider); border-radius: var(--card-radius); background: #fff; box-shadow: 0 1px 2px rgb(17 24 39 / 3%); }
.buyer-section > header { margin-bottom: 22px; }
.buyer-section > header > p:last-child { margin-bottom: 0; }
.buyer-section > header .collaboration-note { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--gold-soft); color: #66512b; font-size: 12px; }
.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--divider); border-left: 1px solid var(--divider); }
.fact-grid.two-column { grid-template-columns: repeat(2, 1fr); }
.fact-grid > div { min-height: 84px; padding: 16px; border-right: 1px solid var(--divider); border-bottom: 1px solid var(--divider); background: #fff; }
.fact-grid dt { margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fact-grid dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.party-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.party-cards article { padding: 18px; border: 1px solid var(--divider); border-radius: 9px; }
.party-card-title { display: flex; align-items: center; gap: 10px; }
.party-card-title > div { display: grid; }
.party-cards ul { display: grid; gap: 8px; margin: 17px 0 0; padding: 15px 0 0; border-top: 1px solid var(--divider); list-style: none; }
.party-cards li { position: relative; padding-left: 20px; color: var(--muted); font-size: 11px; }
.party-cards li::before { position: absolute; top: 3px; left: 0; display: grid; width: 13px; height: 13px; place-items: center; border: 1px solid var(--control); border-radius: 50%; content: ""; }
.party-cards li.done { color: var(--success); }
.party-cards li.done::before { border-color: var(--success); background: var(--success); color: #fff; content: "✓"; font-size: 8px; }
.buyer-form-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.buyer-form-layout .buyer-section { margin: 0; }
.buyer-form { display: grid; gap: 18px; }
.buyer-form header { margin-bottom: 2px; }
.form-divider { position: relative; margin: 5px 0; text-align: center; }
.form-divider::before { position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: var(--divider); content: ""; }
.form-divider span { position: relative; padding: 0 9px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 5px; }
.document-summary { display: grid; grid-template-columns: 140px 140px 1fr; align-items: center; margin-bottom: 18px; padding: 18px 22px; border: 1px solid var(--divider); border-radius: 10px; background: #fff; }
.document-summary > div:not(.document-summary-progress) { display: flex; align-items: baseline; gap: 7px; }
.document-summary > div:not(.document-summary-progress) strong { font-size: 24px; }
.document-summary > div:not(.document-summary-progress) span { color: var(--muted); font-size: 11px; }
.document-summary-progress { display: flex; align-items: center; gap: 12px; }
.document-summary-progress > span { height: 7px; flex: 1; overflow: hidden; border-radius: 5px; background: #eaebed; }
.document-summary-progress i { display: block; height: 100%; background: var(--blue); }
.document-summary-progress strong { min-width: 38px; font-size: 12px; }
.document-section { padding-right: 0; padding-left: 0; }
.document-section > header { padding: 0 28px; }
.document-list { border-top: 1px solid var(--divider); }
.document-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 108px; padding: 16px 22px; border-bottom: 1px solid #e9e9e9; }
.document-item:last-child { border-bottom: 0; }
.document-item.complete { background: #fcfffd; }
.document-icon { display: grid; width: 38px; height: 44px; place-items: center; border: 1px solid var(--divider); border-radius: 6px; background: var(--surface-subtle); color: var(--muted); }
.document-item.complete .document-icon { border-color: #bcdcca; background: var(--success-soft); color: var(--success); }
.document-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.document-copy { min-width: 0; }
.document-copy > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.document-copy h3 { margin: 0; }
.document-copy p { margin: 5px 0 0; font-size: 11px; }
.scope-label { color: var(--muted); font-size: 10px; }
.uploaded-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 7px 9px; border-radius: 5px; background: var(--success-soft); color: var(--success); font-size: 11px; }
.uploaded-file > span { display: flex; min-width: 0; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-file svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.uploaded-file small { color: #47775f; }
.uploaded-file-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; white-space: nowrap; }
.uploaded-file-actions form { margin: 0; }
.uploaded-file-actions button { padding: 0; border: 0; background: transparent; color: #8b3d36; cursor: pointer; font: inherit; font-weight: 700; }
.document-copy > .uploaded-file-card { display: block; }
.uploaded-file-card + .uploaded-file-card { margin-top: 9px; }
.document-file-review { display: inline-flex; align-items: center; gap: 7px; padding-right: 10px; border-right: 1px solid rgb(5 122 85 / 20%); white-space: nowrap; }
.document-review-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.document-review-status { display: inline-flex; min-height: 24px; align-items: center; padding: 4px 8px; border: 1px solid var(--divider); border-radius: 999px; background: #f8fafc; color: #475569; font-size: 10px; font-weight: 700; }
.review-status-under_review { border-color: #bfdbfe; background: var(--surface-blue); color: #1d4ed8; }
.review-status-approved { border-color: #a7f3d0; background: var(--success-soft); color: var(--success); }
.review-status-changes_requested { border-color: #fde68a; background: var(--gold-soft); color: var(--gold-text); }
.review-status-rejected { border-color: #fecaca; background: var(--danger-soft); color: var(--danger); }
.uploaded-file-actions .document-review-remarks-trigger { color: var(--blue); font-size: 10px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.uploaded-file-actions .document-review-remarks-trigger:hover { color: var(--blue-hover); }
.buyer-review-dialog { width: min(460px, calc(100vw - 32px)); }
.buyer-review-dialog-content { display: grid; }
.buyer-review-remarks-copy { min-height: 120px; padding: 22px; }
.buyer-review-remarks-copy p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.upload-control input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-control:focus-within label { outline: 3px solid rgb(29 78 216 / 24%); outline-offset: 2px; }
.optional-documents { padding: 0; }
.optional-documents summary { display: flex; min-height: 72px; align-items: center; justify-content: space-between; padding: 16px 22px; cursor: pointer; list-style: none; }
.optional-documents summary::-webkit-details-marker { display: none; }
.optional-documents summary > span:first-child { display: grid; }
.optional-documents summary > span:last-child { font-size: 22px; }
.optional-documents[open] summary > span:last-child { transform: rotate(45deg); }
.page-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.readiness-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; padding: 22px 26px; border: 1px solid var(--divider); border-radius: 10px; background: #fff; }
.readiness-card h2 { margin-bottom: 5px; }
.readiness-card p { margin: 0; }
.readiness-meter { display: flex; width: min(340px, 40%); align-items: center; gap: 12px; }
.readiness-meter > span { height: 8px; flex: 1; overflow: hidden; border-radius: 6px; background: #e9eaec; }
.readiness-meter i { display: block; height: 100%; background: var(--blue); }
.attestation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.attestation-card { display: flex; min-height: 390px; flex-direction: column; }
.attestation-card > header { display: flex; align-items: center; gap: 12px; }
.step-number { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }
.attestation-card blockquote { margin: 0 0 20px; padding: 16px; border-left: 3px solid var(--gold); background: var(--gold-soft); color: var(--ink-soft); font-size: 12px; }
.consent-form { display: grid; gap: 16px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--divider); }
.consent-form label { display: flex; align-items: flex-start; gap: 9px; color: var(--ink-soft); font-size: 11px; }
.consent-form input { margin-top: 1px; flex: 0 0 auto; }
.completed-state { display: flex; align-items: flex-start; gap: 13px; margin-top: auto; padding: 17px; border: 1px solid #bcdcca; border-radius: 8px; background: var(--success-soft); color: var(--success); }
.completed-state svg { width: 24px; height: 24px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; }
.completed-state p { margin: 4px 0 0; color: #47775f; font-size: 11px; }
.owner-status-section { margin-top: 20px; }
.owner-status-list { display: grid; border: 1px solid var(--divider); }
.owner-status-list > div { display: grid; grid-template-columns: 36px minmax(180px, 1fr) auto auto; gap: 11px; align-items: center; min-height: 68px; padding: 12px 14px; border-bottom: 1px solid var(--divider); }
.owner-status-list > div:last-child { border-bottom: 0; }
.owner-status-list > div > div { display: grid; }
.completion-banner { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 28px; border: 1px solid #bcdcca; border-radius: 12px; background: var(--success-soft); }
.completion-icon, .receipt-seal { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; background: var(--success); color: #fff; }
.completion-icon svg, .receipt-seal svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; }
.completion-banner h2 { margin-bottom: 4px; }
.completion-banner p { margin: 0; color: #47775f; }
.receipt-card { overflow: hidden; border: 1px solid var(--divider); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.receipt-card > header { display: flex; align-items: center; gap: 18px; padding: 28px 30px; border-bottom: 1px solid var(--divider); }
.receipt-card > header h2 { margin-bottom: 3px; font-size: 24px; }
.receipt-card > header p:last-child { margin: 0; }
.receipt-notice { margin: 24px 30px; padding: 16px 18px; border-left: 3px solid var(--gold); background: var(--gold-soft); }
.receipt-notice p { margin: 5px 0 0; color: #66512b; font-size: 12px; }
.receipt-card > .fact-grid { margin: 0 30px; }
.receipt-section { margin: 26px 30px 30px; }
.receipt-section h3 { padding-bottom: 9px; border-bottom: 1px solid var(--divider); }
.receipt-row { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid #ececec; font-size: 12px; }
.receipt-row > span { display: grid; }
.receipt-row strong { color: var(--success); font-size: 11px; }
.receipt-row code { font-size: 10px; }
.provider-simulator { width: min(560px, 100%); margin: 40px auto; padding: 32px; border: 1px solid var(--divider); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.simulator-badge { display: inline-flex; margin-bottom: 22px; padding: 5px 8px; border-radius: 4px; background: #fff1c9; color: #6d4d0d; font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.provider-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.provider-logo span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 8px; background: #5647d7; color: #fff; font-weight: 800; }
.provider-simulator > p { margin-bottom: 24px; }
.provider-simulator dl { display: grid; margin-bottom: 24px; border-top: 1px solid var(--divider); }
.provider-simulator dl div { display: grid; grid-template-columns: 120px 1fr; padding: 11px 0; border-bottom: 1px solid var(--divider); }
.provider-simulator dt { color: var(--muted); font-size: 11px; }
.provider-simulator dd { margin: 0; font-size: 12px; font-weight: 600; }
.provider-simulator form { display: grid; gap: 10px; }

/* Refined application design system */
body { background: var(--canvas); }
h1 { margin-bottom: 10px; font-size: clamp(28px, 3vw, 36px); font-weight: 720; line-height: 1.12; letter-spacing: -.032em; }
h2 { font-weight: 680; letter-spacing: -.02em; }
h3 { font-weight: 660; }
p { line-height: 1.6; }
:focus-visible { outline-color: rgb(37 99 235 / 34%); }
.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .09em; }
.back-link { align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
.back-link:hover { color: var(--blue); }
.icon, .button svg, .back-link svg, .card-link svg, .optional-documents summary svg, .history-chevron svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }

.brand { gap: 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgb(15 23 42 / 16%); }
.brand strong { font-size: 16px; font-weight: 800; letter-spacing: .14em; }
.brand small { margin-top: 5px; font-size: 11px; }

.button { min-height: 42px; padding: 10px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 680; box-shadow: 0 1px 2px rgb(15 23 42 / 5%); }
.button-primary, .button-context { border-color: var(--blue); background: var(--blue); color: #fff; }
.button-primary:hover, .button-context:hover { border-color: var(--blue-hover); background: var(--blue-hover); color: #fff; box-shadow: 0 4px 12px rgb(37 99 235 / 18%); }
.button-secondary { border-color: var(--control); background: #fff; color: var(--ink-soft); }
.button-secondary:hover { border-color: #94a3b8; background: var(--surface-subtle); color: var(--ink); }
.button-quiet { min-height: 40px; box-shadow: none; }
.text-button { color: var(--blue); text-underline-offset: 3px; }
.text-button:hover { text-decoration: underline; }

input, select, textarea { min-height: 44px; padding: 10px 12px; border-color: var(--control); background: #fff; box-shadow: inset 0 1px 1px rgb(15 23 42 / 2%); }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline-color: rgb(37 99 235 / 14%); box-shadow: 0 0 0 1px var(--blue); }
.field { gap: 7px; }
.field label { color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.help-text, .error-text { font-size: 12px; }
.checkbox-field { min-height: 46px; border-color: var(--divider); background: var(--surface); }
.message { padding: 12px 14px; border-radius: var(--radius); }

/* Authentication */
.auth-app { padding: 32px; background: #eaf0f7; }
.auth-shell { width: min(1080px, 100%); }
.auth-card { min-height: 640px; grid-template-columns: .92fr 1.08fr; border-color: #d8e0ea; border-radius: 22px; box-shadow: 0 28px 70px rgb(15 23 42 / 16%); }
.auth-brand-pane { position: relative; isolation: isolate; overflow: hidden; padding: 48px; background: #0f172a; }
.auth-brand-pane::before { position: absolute; z-index: -1; right: -120px; bottom: -160px; width: 420px; height: 420px; border: 1px solid rgb(148 163 184 / 14%); border-radius: 50%; box-shadow: 0 0 0 74px rgb(148 163 184 / 5%), 0 0 0 150px rgb(148 163 184 / 3%); content: ""; }
.auth-brand-pane .brand small { color: #94a3b8; }
.auth-brand-pane .brand-mark { color: #fff; }
.auth-brand-pane h1 { font-size: clamp(34px, 4vw, 44px); font-weight: 700; }
.auth-brand-pane p { color: #cbd5e1; }
.auth-brand-pane .eyebrow { color: #93c5fd; }
.auth-trust { gap: 9px; color: #cbd5e1; font-size: 13px !important; }
.auth-trust svg { width: 18px; height: 18px; color: #60a5fa; }
.auth-form-pane { padding: clamp(42px, 7vw, 82px); }
.auth-form-pane > h2 { font-size: 30px; }
.auth-form-pane > .muted { margin-bottom: 30px; }
.auth-form { gap: 22px; }

/* Administration */
.admin-app { min-width: 0; background: var(--canvas); }
.admin-shell { grid-template-columns: 252px minmax(0, 1fr); }
.admin-sidebar { z-index: 40; height: 100dvh; overflow-y: auto; padding: 26px 16px 18px; border-right: 0; background: #0f172a; box-shadow: 4px 0 18px rgb(15 23 42 / 7%); }
.admin-sidebar .brand { color: #fff; }
.admin-sidebar .brand:hover { color: #fff; }
.admin-sidebar .brand small { color: #94a3b8; }
.brand-admin { padding: 0 10px 28px; }
.admin-nav { gap: 6px; }
.admin-nav a { min-height: 46px; padding: 11px 13px; border-radius: 9px; color: #94a3b8; font-size: 13px; }
.admin-nav a:hover { background: rgb(255 255 255 / 6%); color: #f8fafc; }
.admin-nav a.active { background: rgb(37 99 235 / 18%); color: #bfdbfe; }
.admin-nav a.active::before { top: 10px; bottom: 10px; left: -2px; width: 3px; background: #60a5fa; }
.sidebar-footer { gap: 12px; border-color: rgb(148 163 184 / 20%); }
.signed-in-user { padding: 6px; }
.signed-in-user strong { color: #f8fafc; font-size: 13px; }
.signed-in-user small { color: #94a3b8; font-size: 11px; }
.avatar { width: 38px; height: 38px; background: var(--surface-subtle); color: var(--ink); font-size: 12px; }
.admin-sidebar .avatar { background: rgb(255 255 255 / 10%); color: #e2e8f0; }
.nav-logout { min-height: 42px; border-radius: 8px; color: #94a3b8; font-size: 13px; }
.nav-logout:hover { background: rgb(255 255 255 / 6%); color: #f8fafc; }
.admin-main { max-width: 1540px; padding: 38px 42px 56px; }
.page-header { margin-bottom: 28px; }
.page-header > p:last-child, .page-header-actions > div > p:last-child { max-width: 720px; }
.page-header-controls { gap: 12px; }
.metrics { gap: 16px; margin-bottom: 22px; }
.metric { min-height: 126px; align-content: space-between; gap: 12px; padding: 20px 22px; border-color: var(--divider); border-radius: var(--card-radius); background: #fff; box-shadow: var(--shadow); }
.metric span { font-size: 11px; letter-spacing: .075em; }
.metric strong { color: var(--ink); font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.operational-surface, .panel, .form-section { overflow: hidden; border-color: var(--divider); border-radius: var(--card-radius); background: #fff; box-shadow: var(--shadow); }
.table-toolbar { min-height: 72px; padding: 14px 16px; background: #fff; }
.search-field { position: relative; width: min(520px, 48vw); }
.search-field svg { position: absolute; z-index: 1; top: 50%; left: 13px; width: 18px; height: 18px; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.search-field input:has(+ svg), .search-field:has(svg) input { padding-left: 40px; }
.data-table { min-width: 900px; }
.data-table th { height: 48px; padding: 11px 16px; border-color: var(--divider); background: #f8fafc; color: #64748b; font-size: 11px; letter-spacing: .065em; }
.data-table td, .data-table tbody th { height: 62px; padding: 12px 16px; border-color: #edf2f7; background: #fff; font-size: 13px; }
.data-table tbody tr:hover td, .data-table tbody tr:hover th { background: #f8fafc; }
.unit-overview-table { min-width: 860px; table-layout: fixed; }
.unit-overview-table th:nth-child(1) { width: 17%; }
.unit-overview-table th:nth-child(2) { width: 27%; }
.unit-overview-table th:nth-child(3) { width: 13%; }
.unit-overview-table th:nth-child(4) { width: 15%; }
.unit-overview-table th:nth-child(5) { width: 16%; }
.unit-overview-table th:nth-child(6) { width: 12%; }
.unit-overview-table th:last-child, .unit-overview-table td:last-child { padding-right: 8px; padding-left: 8px; }
.unit-cell > strong { font-size: 15px; }
.unit-cell > small, .data-table td > small { font-size: 12px; }
.assigned-party-list { min-width: 235px; gap: 10px; }
.assigned-party-list strong { font-size: 13px; }
.assigned-party-list small { font-size: 11px; }
.assigned-party-list li.assigned-party-empty { font-size: 11px; }
.party-process-icon { width: 26px; height: 26px; }
.party-role-icon { width: 32px; height: 32px; }
.party-role-icon.is-owner { border-color: #bfdbfe; background: var(--surface-blue); color: var(--blue); }
.party-role-icon.is-co-owner { border-color: var(--divider); background: var(--surface-subtle); color: var(--ink-soft); }
.action-links { gap: 6px; }
.action-links a { display: inline-flex; min-height: 34px; align-items: center; padding: 6px 9px; border-radius: 7px; color: var(--ink-soft); }
.action-links a:hover { background: var(--surface-blue); color: var(--blue); }
.action-links a + a { padding-left: 9px; border-left: 0; }
.progress-inline > span { height: 7px; background: #e2e8f0; }
.progress-inline i, .progress-block > div span, .document-summary-progress i, .readiness-meter i { background: var(--blue); }

.data-table .empty-state-row > td { height: auto; padding: 0; }
.data-table tbody .empty-state-row:hover > td { background: #fff; }
.empty-state { display: grid; min-height: 240px; place-content: center; justify-items: center; gap: 8px; padding: 36px 24px; text-align: center; }
.empty-state-table { min-height: 292px; }
.empty-state-icon { display: grid; width: 52px; height: 52px; place-items: center; margin-bottom: 4px; border: 1px solid #bfdbfe; border-radius: 50%; background: var(--surface-blue); color: var(--blue); }
.empty-state-icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h2 { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.3; }
.empty-state p { max-width: 360px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty-state .button { margin-top: 8px; }

.status { min-height: 26px; padding: 5px 9px; border-color: var(--divider); background: #f8fafc; color: #475569; font-size: 11px; }
.status-in_progress, .status-ready_for_attestation { border-color: #bfdbfe; background: var(--surface-blue); color: #1d4ed8; }
.status-awaiting_signatures { border-color: #fde68a; background: var(--gold-soft); color: var(--gold-text); }
.status-received, .status-complete { border-color: #a7f3d0; background: var(--success-soft); color: var(--success); }
.status-rejected { border-color: #fecaca; background: var(--danger-soft); color: var(--danger); }
.status-large { min-height: 32px; padding: 7px 11px; font-size: 12px; }

.form-section { margin-bottom: 20px; }
.form-section > header { padding: 19px 22px; background: #f8fafc; }
.form-section > header > span { width: 32px; height: 32px; border-color: #bfdbfe; background: var(--surface-blue); color: var(--blue); font-size: 11px; }
.form-section > header h2 { font-size: 16px; }
.form-section > header p { font-size: 13px; }
.form-grid { gap: 22px 26px; padding: 24px; }
.sticky-form-actions { padding: 16px 0; background: rgb(248 250 252 / 92%); }
.facts-band { overflow: hidden; border-radius: var(--card-radius); background: #fff; box-shadow: var(--shadow); }
.facts-band > div { padding: 18px 20px; }
.facts-band span { font-size: 11px; }
.facts-band strong { font-size: 14px; }
.panel-header, .surface-header { min-height: 72px; padding: 15px 20px; background: #f8fafc; }
.panel-header h2, .surface-header h2 { font-size: 16px; }
.mini-status { min-height: 25px; padding: 4px 8px; background: #f8fafc; font-size: 10px; }
.mini-status.done { border-color: #a7f3d0; }
.edit-party-list strong { font-size: 12px; }
.edit-party-list small { font-size: 11px; }
.form-impact-note, .buyer-section > header .collaboration-note, .receipt-notice, .attestation-card blockquote { border-left-color: #f59e0b; background: var(--gold-soft); color: #78350f; }

.document-workspace { border-radius: var(--card-radius); box-shadow: var(--shadow); }
.document-workspace-header { min-height: 96px; padding: 20px 22px; }
.document-workspace-header h2 { font-size: 20px; }
.document-workspace-header p:last-child { font-size: 13px; }
.workspace-progress strong { font-size: 26px; }
.workspace-progress small { font-size: 11px; }
.document-tabs-wrap { background: #f1f5f9; }
.document-tabs { padding: 10px 14px 0; }
.document-tab { min-width: 260px; flex-basis: 260px; padding: 13px 16px 14px; border-radius: 9px 9px 0 0; }
.document-tab:hover { border-color: #cbd5e1; border-bottom-color: var(--blue); }
.document-tab.is-active, .document-tab[aria-selected="true"] { border-color: var(--divider); border-bottom-color: var(--blue); }
.document-tab strong { font-size: 13px; }
.document-tab small { font-size: 11px; }
.document-tab-icon { width: 34px; height: 34px; background: #e2e8f0; font-size: 11px; }
.document-tab.is-active .document-tab-icon, .document-tab[aria-selected="true"] .document-tab-icon { background: var(--blue-soft); }
.document-panel-header { min-height: 94px; padding: 20px 22px; }
.participant-panel-header { background: #f8fafc; }
.participant-panel-title small, .document-subsection-header p, .admin-file-entry small { font-size: 11px; }
.document-subsection-header { padding: 20px 22px 14px; }
.document-subsection-header h4 { font-size: 14px; }
.history-panel { border-radius: var(--card-radius); box-shadow: var(--shadow); }
.history-panel summary { min-height: 80px; padding: 16px 20px; background: #fff; }
.history-panel summary:hover { background: #f8fafc; }
.history-summary-copy > strong { font-size: 15px; }
.history-summary-copy > small, .history-summary-action { font-size: 11px; }
.history-chevron { display: inline-flex; }

/* Buyer workspace */
.buyer-app { background: var(--canvas); }
.buyer-header { border-color: var(--divider); background: rgb(255 255 255 / 92%); box-shadow: 0 1px 2px rgb(15 23 42 / 3%); }
.buyer-header-inner { max-width: 1200px; min-height: 76px; }
.buyer-name { font-size: 13px; }
.buyer-main { width: min(1140px, calc(100% - 40px)); padding: 44px 0 72px; }
.buyer-page-header { margin-bottom: 30px; }
.buyer-page-header > p:last-child { font-size: 15px; }
.allotment-grid { gap: 20px; }
.allotment-card { min-height: 280px; padding: 26px; border-radius: var(--card-radius); box-shadow: var(--shadow); }
.allotment-card:hover { border-color: #93c5fd; box-shadow: var(--shadow-raised); }
.allotment-card h2 { font-size: 22px; }
.allotment-message-count { font-size: 11px; }
.card-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.card-link span { display: inline-flex; margin-left: 0; }
.journey-steps { overflow: hidden; border-radius: 12px; box-shadow: var(--shadow); }
.journey-steps > a, .journey-steps > span { min-height: 70px; padding: 13px 16px; }
.journey-steps > * > span { width: 30px; height: 30px; }
.journey-steps > * > span svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.journey-steps strong { font-size: 13px; }
.journey-steps .active { background: var(--surface-blue); color: var(--blue); }
.journey-steps .active::before { background: var(--blue); }
.journey-steps .active > span { border-color: var(--blue); background: var(--blue); color: #fff; }
.journey-steps .complete > span { border-color: #6ee7b7; background: var(--success-soft); }
.buyer-hero-card { padding: 34px 36px; border: 1px solid #1e293b; background: #0f172a; box-shadow: var(--shadow-raised); }
.buyer-hero-card h2 { font-size: 26px; }
.buyer-hero-card p { color: #cbd5e1; }
.buyer-hero-card .eyebrow { color: #93c5fd; }
.buyer-hero-card .button-primary { border-color: #fff; background: #fff; color: #0f172a; }
.buyer-hero-card .button-primary:hover { border-color: #dbeafe; background: #dbeafe; color: #0f172a; }
.hero-progress { border-color: #334155; background: rgb(255 255 255 / 4%); }
.hero-progress strong { color: #93c5fd; }
.buyer-section, .card, .document-summary, .readiness-card, .receipt-card { border-color: var(--divider); border-radius: var(--card-radius); box-shadow: var(--shadow); }
.buyer-section { padding: 28px 30px; }
.fact-grid { border-color: var(--divider); }
.fact-grid > div { min-height: 88px; padding: 17px; border-color: var(--divider); }
.fact-grid dt { font-size: 11px; }
.fact-grid dd { font-size: 14px; }
.party-cards article { padding: 20px; border-radius: 11px; }
.party-cards li { font-size: 12px; }
.document-item { min-height: 112px; border-color: #edf2f7; }
.document-item.complete { background: #fafffd; }
.document-copy p, .scope-label, .uploaded-file, .completed-state p, .consent-form label { font-size: 12px; }
.uploaded-file { padding: 9px 11px; border-radius: 7px; }
.optional-documents summary > span:last-child { display: inline-flex; font-size: 0; transition: transform .15s ease; }
.optional-documents[open] summary > span:last-child { transform: rotate(180deg); }
.step-number { background: var(--blue); }
.completion-banner { border-color: #a7f3d0; }
.receipt-card { box-shadow: var(--shadow-raised); }

/* Messaging */
.participant-message-trigger { width: 38px; height: 38px; border-color: var(--control); border-radius: 9px; color: var(--muted); }
.participant-message-trigger:hover { border-color: #93c5fd; }
.message-drawer { border-color: var(--divider); box-shadow: -20px 0 54px rgb(15 23 42 / 18%); }
.message-drawer::backdrop { background: rgb(15 23 42 / 48%); backdrop-filter: blur(2px); }
.message-thread { background: #f1f5f9; }
.message-bubble { border-color: #dbe3ed; border-radius: 6px 14px 14px; }
.message-row.is-outgoing .message-bubble { border-radius: 14px 6px 14px 14px; }
.message-bubble p { font-size: 13px; }
.message-bubble-meta strong { font-size: 11px; }
.message-bubble-meta time { font-size: 10px; }

@media (max-width: 840px) {
  .auth-app { padding: 0; background: #fff; }
  .auth-card { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; box-shadow: none; }
  .auth-brand-pane { min-height: 250px; padding: 28px; }
  .auth-brand-pane > div { margin-top: 36px; }
  .auth-brand-pane h1 { max-width: 520px; font-size: 28px; }
  .auth-brand-pane p { font-size: 13px; }
  .auth-trust { display: none; }
  .auth-form-pane { padding: 34px 28px 48px; }
  .buyer-main { width: min(100% - 28px, 700px); padding-top: 26px; }
  .buyer-header-inner { min-height: 64px; padding: 0 16px; }
  .buyer-name { display: none; }
  .brand small { display: none; }
  .allotment-grid, .buyer-form-layout, .attestation-grid { grid-template-columns: 1fr; }
  .journey-steps { overflow-x: auto; grid-template-columns: repeat(4, minmax(126px, 1fr)); }
  .buyer-hero-card { grid-template-columns: 1fr; padding: 24px; }
  .hero-progress { display: none; }
  .fact-grid { grid-template-columns: repeat(2, 1fr); }
  .document-item { grid-template-columns: 38px minmax(0, 1fr); }
  .upload-control { grid-column: 2; }
  .readiness-card { align-items: flex-start; flex-direction: column; }
  .readiness-meter { width: 100%; }
  .attestation-card { min-height: 0; }
  .completion-banner { grid-template-columns: 48px 1fr; }
  .completion-banner .button { grid-column: 1 / -1; }
  .agreement-file-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .agreement-file-row > .button { grid-column: 2 / -1; justify-self: start; }
  .agreement-upload-form { align-items: stretch; flex-direction: column; }
  .agreement-upload-form .button { align-self: flex-start; }
  .unit-edit-layout { grid-template-columns: 1fr; }
  .unit-owner-management { position: static; }
  .locked-unit-notice { grid-template-columns: 44px 1fr; }
  .locked-unit-notice .button { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  h1 { font-size: 26px; }
  .buyer-main { width: calc(100% - 24px); padding-bottom: 40px; }
  .buyer-header .brand strong { font-size: 14px; }
  .brand-mark { width: 32px; height: 32px; }
  .buyer-page-header { margin-bottom: 20px; }
  .buyer-heading-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .buyer-heading-actions { width: 100%; justify-content: space-between; }
  .allotment-card { min-height: 235px; padding: 20px; }
  .message-drawer { width: 100vw; border-left: 0; }
  .message-drawer-header { padding-top: max(16px, env(safe-area-inset-top)); }
  .message-composer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .message-drawer .message-composer-footer { justify-content: flex-end; }
  .message-bubble { max-width: 88%; }
  .message-composer-hint { display: none; }
  .journey-steps { margin-right: -12px; margin-left: -12px; border-right: 0; border-left: 0; border-radius: 0; }
  .journey-steps > a, .journey-steps > span { min-height: 58px; padding: 10px 11px; }
  .journey-steps > * > span { width: 24px; height: 24px; }
  .buyer-section { padding: 21px 18px; border-radius: 9px; }
  .fact-grid, .fact-grid.two-column { grid-template-columns: 1fr; }
  .fact-grid > div { min-height: 72px; }
  .party-cards { grid-template-columns: 1fr; }
  .document-summary { grid-template-columns: 1fr 1fr; gap: 14px; }
  .document-summary-progress { grid-column: 1 / -1; }
  .document-section > header { padding: 0 18px; }
  .document-item { gap: 11px; padding: 15px 14px; }
  .uploaded-file { align-items: flex-start; flex-direction: column; }
  .uploaded-file > span { display: grid; white-space: normal; }
  .agreement-file-row, .agreement-empty-state { grid-template-columns: 38px minmax(0, 1fr); padding: 13px; }
  .agreement-file-row > .agreement-status-group, .agreement-empty-state > .agreement-status-group { grid-column: 2; justify-self: start; }
  .agreement-file-row > .button { grid-column: 1 / -1; width: 100%; }
  .agreement-upload-form .button { width: 100%; }
  .uploaded-file-actions { width: 100%; justify-content: flex-start; }
  .page-actions { align-items: stretch; flex-direction: column-reverse; }
  .page-actions .button { width: 100%; }
  .owner-status-list > div { grid-template-columns: 34px minmax(0, 1fr); }
  .owner-status-list .mini-status { grid-column: 2; justify-self: start; }
  .receipt-card > header, .receipt-notice, .receipt-section { margin-right: 18px; margin-left: 18px; }
  .receipt-card > header { margin: 0; padding: 22px 18px; }
  .receipt-card > .fact-grid { margin: 0 18px; }
  .receipt-row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .provider-simulator { margin: 10px auto; padding: 22px 18px; }
}

/* Responsive administration and compact workflow refinements */
@media (max-width: 1200px) {
  .admin-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .admin-main { padding: 32px 28px 48px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-detail-grid { grid-template-columns: 1fr; }
  .facts-band { grid-template-columns: repeat(3, 1fr); }
  .facts-band > div:nth-child(3n) { border-right: 0; }
  .facts-band > div:nth-child(-n + 3) { border-bottom: 1px solid var(--divider); }
  .form-grid-three { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .admin-shell { display: block; }
  .admin-sidebar { position: sticky; top: 0; display: grid; width: 100%; height: auto; min-height: 66px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 10px 18px; overflow: visible; box-shadow: 0 4px 16px rgb(15 23 42 / 12%); }
  .brand-admin { padding: 0; }
  .admin-sidebar .brand small { display: none; }
  .admin-nav { display: flex; justify-content: flex-end; gap: 4px; }
  .admin-nav a { min-height: 42px; padding: 9px 11px; }
  .admin-nav a.active::before { top: auto; right: 10px; bottom: -10px; left: 10px; width: auto; height: 2px; }
  .sidebar-footer { display: flex; margin: 0; padding: 0; border: 0; }
  .signed-in-user { display: none; }
  .nav-logout { width: 42px; height: 42px; justify-content: center; padding: 0; font-size: 0; }
  .nav-logout svg { width: 20px; height: 20px; }
  .admin-main { padding: 28px 22px 46px; }
  .page-header-actions { flex-wrap: wrap; }
  .unit-edit-layout { grid-template-columns: 1fr; }
  .unit-owner-management { position: static; }
  .document-workspace-header, .document-panel-header { align-items: flex-start; flex-direction: column; }
  .workspace-progress { min-width: 0; justify-items: start; }
  .participant-readiness { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .admin-sidebar { gap: 10px; padding: 9px 12px; }
  .admin-sidebar .brand > span:last-child { display: none; }
  .admin-nav a { gap: 7px; padding: 9px; font-size: 12px; }
  .admin-nav svg { width: 18px; height: 18px; }
  .admin-main { padding: 24px 14px 40px; }
  .page-header { margin-bottom: 22px; }
  .page-header-actions { align-items: stretch; flex-direction: column; gap: 18px; }
  .page-header-controls { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .metrics { gap: 10px; }
  .metric { min-height: 108px; padding: 17px 18px; }
  .metric strong { font-size: 27px; }
  .table-toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-field { width: 100%; }
  .table-toolbar select { width: calc(100% - 98px); margin-left: 0; }
  .facts-band { grid-template-columns: repeat(2, 1fr); }
  .facts-band > div, .facts-band > div:nth-child(3n) { border-right: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
  .facts-band > div:nth-child(2n) { border-right: 0; }
  .facts-band > div:last-child { border-bottom: 0; }
  .form-grid, .form-grid-three { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .sticky-form-actions { position: static; flex-direction: column-reverse; }
  .sticky-form-actions .button { width: 100%; }
  .document-tab-item { min-width: 230px; flex-basis: 230px; }
  .document-subsection-header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .agreement-admin-header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .auth-brand-pane { min-height: 225px; }
  .auth-brand-pane h1 { font-size: 28px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 98px; }
  .metric span { font-size: 10px; }
  .facts-band { grid-template-columns: 1fr; }
  .facts-band > div, .facts-band > div:nth-child(2n), .facts-band > div:nth-child(3n) { border-right: 0; border-bottom: 1px solid var(--divider); }
  .facts-band > div:last-child { border-bottom: 0; }
  .journey-steps { overflow: hidden; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-right: 0; margin-left: 0; border-right: 1px solid var(--divider); border-left: 1px solid var(--divider); border-radius: 11px; }
  .journey-steps > a, .journey-steps > span { min-width: 0; min-height: 72px; flex-direction: column; justify-content: center; gap: 6px; padding: 9px 4px; text-align: center; }
  .journey-steps > * > span { width: 25px; height: 25px; }
  .journey-steps strong { font-size: 10px; line-height: 1.15; }
  .journey-steps > *:not(:last-child)::after { top: 12px; bottom: 12px; }
  .journey-steps .active::before { right: 7px; left: 7px; }
  .buyer-section { padding: 22px 18px; }
}

@media print {
  .buyer-header, .journey-steps, .back-link, .message-stack, .participant-message-trigger, .buyer-message-trigger, .message-drawer, .message-composer { display: none !important; }
  .buyer-app, .buyer-main { width: 100%; margin: 0; padding: 0; background: #fff; }
  .receipt-card { border: 0; box-shadow: none; }
}

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