@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/vendor/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/vendor/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/vendor/fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/vendor/fonts/source-serif-4-latin-ext-opsz-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* A private bank's calm: deep navy, cool greys, white panels, crisp lines. Always light. */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --soft: #f3f5f8;
  --ink: #0b1526;
  --muted: #4b5565;
  --line: #e2e6ec;
  --field: #c9d1dc;
  --brand: #0c2a4d;
  --brand-hover: #163d6b;
  --brand-ink: #ffffff;
  --brand-soft: #edf2f8;
  --link: #1d4f91;
  --accent: #0b7a53;
  --accent-bg: #e9f7f0;
  --danger: #b42318;
  --danger-bg: #fdf1f0;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(11, 21, 38, .05);
  --shadow-lg: 0 1px 2px rgba(11, 21, 38, .04), 0 8px 24px rgba(11, 21, 38, .06);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Headings: a book serif that sits with the wordmark; UI, forms and figures stay in Inter. */
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01"; /* Inter: straight-sided digits and single-storey a, as in financial UIs */
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; /* no surprise text enlargement when a phone turns sideways */
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font); font-weight: 600; letter-spacing: -.022em; line-height: 1.25; margin: 0; color: var(--ink); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; font-optical-sizing: auto; }
h1 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.brand { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; color: var(--muted); }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; align-content: center; }
.hero { max-width: 560px; display: grid; gap: 18px; justify-items: start; }
.hero h1 { font-size: clamp(2rem, 5vw, 2.9rem); letter-spacing: -.018em; line-height: 1.12; }
.lede { color: var(--muted); font-size: 1.075rem; }

.card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-lg); }
.stack { display: grid; gap: 14px; }

label { font-weight: 550; font-size: .95rem; }
input:not([type=checkbox]):not([type=radio]), select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--field); border-radius: 8px; padding: 11px 14px; min-height: 48px; width: 100%;
  box-shadow: inset 0 1px 1px rgba(11, 21, 38, .03); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #8a94a6; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(29, 79, 145, .16); }
button:focus-visible, a:focus-visible, .select-cell:has(:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }

.btn {
  font: inherit; font-weight: 600; letter-spacing: -.005em; cursor: pointer; min-height: 44px; padding: 0 18px;
  border-radius: 8px; border: 1px solid var(--field); background: var(--surface); color: var(--ink);
  transition: background-color .15s, border-color .15s, color .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn:hover { background: var(--soft); border-color: #b6c0cd; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(11, 21, 38, .12); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-quiet:hover { color: var(--ink); background: transparent; border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: .875rem; }

.notice { padding: 12px 14px; border-radius: 8px; font-size: .95rem; background: var(--brand-soft); border: 1px solid #d7e1ee; }
.notice ul { margin: 6px 0; padding-left: 20px; }
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }
.terms-notice { margin: 0; }
.notice p + ul, .notice ul + p { margin-top: 6px; }
.notice-error { background: var(--danger-bg); color: var(--danger); border-color: #f6d2ce; white-space: pre-line; }

.shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 0 28px; min-height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar select { width: auto; min-height: 36px; padding: 4px 10px; }
.org-name { font-weight: 600; }
.tabs { display: flex; gap: 8px; align-self: stretch; }
.tab { font: inherit; font-weight: 500; background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 12px; color: var(--muted); cursor: pointer; min-height: 64px; }
.tab .icon { display: none; }
.org-name-phone { display: none; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

.content { width: min(1040px, 100%); margin: 0 auto; padding: 40px 24px 72px; display: grid; gap: 20px; align-content: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); min-height: 56px; }
.list-row:first-child { border-top: 0; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--muted, #5b6472); white-space: nowrap; cursor: pointer; }
.check-inline input { width: 16px; height: 16px; min-height: 16px; margin: 0; accent-color: var(--brand); }
.badge { font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge-ready { color: var(--accent); background: var(--accent-bg); }
.badge-failed, .badge-interrupted { color: var(--danger); background: var(--danger-bg); }

.empty { text-align: center; padding: 56px 24px; background: var(--surface); border: 1px dashed var(--field); border-radius: var(--radius); display: grid; gap: 10px; justify-items: center; }
.empty > .btn { width: auto; min-width: 200px; }
.inline-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.inline-form > div { grid-column: 1 / -1; }
.inline-form > .inline-error { grid-column: 1 / -1; order: 99; margin: 0; }
.inline-error { margin: 4px 0 0; }

@media (max-width: 640px) {
  .topbar { padding: 0 16px; min-height: 56px; }
  .tab { min-height: 48px; }
  .content { padding: 24px 16px 56px; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form > .inline-error { order: 0; margin-top: -4px; }
  .card { padding: 22px; }
}

/* M1: agreements, upload, detected fields */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.btn { display: inline-flex; align-items: center; }
.block { display: block; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list-button { width: 100%; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.list-button:hover { background: #f8fafc; }
.row-main { display: grid; gap: 2px; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.badge-analyzing, .badge-uploaded { color: var(--link); background: var(--brand-soft); }
.badge-sensitive { color: #8a4b00; background: #fff6e6; }

.upload-card { width: 100%; display: grid; gap: 12px; }

.back { justify-self: start; padding-left: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.stat-n { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; line-height: 1; }
.group { display: grid; gap: 10px; }
.q-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.q-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.q-row:first-child { border-top: 0; }
.q-main { display: grid; gap: 4px; min-width: 0; }
.q-label { font-weight: 600; overflow-wrap: anywhere; }
.q-meta { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 45%; }
.q-cond { color: var(--link); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .82rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); }
.chip.long { border-radius: 8px; padding: 6px 10px; display: block; line-height: 1.4; } /* a sentence-long option: a box, not a pill */
.chips.quick { margin-top: 8px; }
.chips.quick .chip { font: inherit; font-size: .85rem; padding: 4px 12px; cursor: pointer; color: inherit; }
.chips.quick .chip:hover { border-color: var(--brand); }
.chips.quick .chip.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-weight: 400; cursor: pointer; }
.switch-row input { width: 20px; min-height: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
@media (max-width: 640px) {
  .q-row { flex-direction: column; gap: 8px; }
  .q-meta { max-width: none; justify-content: flex-start; }
  .section-head { flex-wrap: wrap; }
}

/* Send flow and customer wizard */
.card.wide { width: 100%; }
.fields-details { display: grid; gap: 14px; }
.fields-details > summary { cursor: pointer; padding: 12px 0; list-style-position: inside; }
.fields-details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.badge-req-completed { color: var(--accent); }
.badge-req-revoked { color: var(--muted); }
.link-card { width: 100%; }
.link-row { grid-template-columns: 1fr auto auto; }
.link-row input:not([type=checkbox]):not([type=radio]) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.send-form { max-width: 640px; }

.field { display: grid; gap: 8px; }
.field-label { font-weight: 600; font-size: 1rem; color: var(--ink); }
.field textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--field); border-radius: 8px; padding: 11px 14px; width: 100%; resize: vertical; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.field.has-error input, .field.has-error textarea, .field.has-error .options { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: .9rem; }
.options { display: grid; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border: 1px solid var(--field); border-radius: 8px; transition: border-color .15s, background-color .15s; background: var(--surface); cursor: pointer; font-weight: 450; min-height: 50px; color: var(--ink); }
.option:hover { border-color: #9aa6b6; background: #fafbfc; }
.option.selected, .option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.option input { width: 18px; height: 18px; min-height: 18px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.option.single { max-width: 220px; }
.with-prefix { position: relative; }
.with-prefix .prefix { position: absolute; left: 14px; pointer-events: none; top: 50%; transform: translateY(-50%); color: var(--muted); }
/* Beats the general text-box padding (that rule is more specific), so "$" never overlaps the amount. */
.with-prefix input:not([type=checkbox]):not([type=radio]) { padding-left: 30px; }
.context summary { color: var(--link); font-size: .88rem; cursor: pointer; }
.context p { margin-top: 6px; font-size: .9rem; color: var(--muted); background: var(--soft); border-radius: 8px; padding: 10px 12px; font-family: var(--serif); }
.context mark { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--ink); padding: 0 4px; border-radius: 4px; font-family: var(--font); font-size: .82rem; }
.lock { font-size: .85rem; }

.wiz { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.wiz-head { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  padding: 12px 20px 10px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
/* One line for the agreement's name: a long name ends with "…" (the full name is its tooltip). */
.wiz-head .wiz-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.3; margin: 0; }
.wiz-title { font-weight: 600; font-size: .95rem; }
.progress { flex-basis: 100%; height: 4px; background: #e6eaf0; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); transition: width .3s ease; }
.wiz-body { width: min(640px, 100%); margin: 0 auto; padding: 36px 20px 96px; display: grid; gap: 20px; align-content: start; }
.wiz-body > form { gap: 26px; }
.wiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.facts { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: #2d3748; }
.review-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: grid; gap: 8px; }
.review-group dl { margin: 0; display: grid; grid-template-columns: minmax(140px, 40%) 1fr; gap: 6px 16px; }
.review-group dt { color: var(--muted); font-size: .95rem; }
.review-group dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
[hidden] { display: none !important; }
.sig-pad { display: grid; gap: 6px; }
.sig-box { position: relative; border: 1px solid var(--field); border-radius: 8px; background: #fff; height: 170px; overflow: hidden; }
.sig-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sig-uploaded { display: block; max-width: 92%; max-height: 120px; margin: 18px auto 0; }
.sig-hint { position: absolute; left: 0; right: 0; top: 42%; text-align: center; pointer-events: none; margin: 0; }
.sig-line { position: absolute; left: 6%; right: 6%; bottom: 34px; border-bottom: 1px solid #8a90a2; pointer-events: none; }
.sig-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.consent input { width: 20px; height: 20px; min-height: 20px; flex: none; margin-top: 2px; accent-color: var(--brand); }
@media (max-width: 640px) {
  .review-group dl { grid-template-columns: 1fr; }
  .review-group dd { margin-bottom: 8px; }
  .link-row { grid-template-columns: 1fr; }
  .wiz-head { padding: 10px 16px; }
}
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ctx-btn { font: inherit; font-size: .82rem; color: var(--link); background: none; border: 0; padding: 2px 0; cursor: pointer; white-space: nowrap; flex: none; }
.ctx-btn:hover { text-decoration: underline; }
.ctx-btn[aria-expanded="true"] { font-weight: 600; }
p.context { margin: 0; font-size: .9rem; color: var(--muted); background: var(--soft); border-radius: 8px; padding: 10px 12px; font-family: var(--serif); }
p.context mark { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--ink); padding: 0 4px; border-radius: 4px; font-family: var(--font); font-size: .82rem; }
.ask-toggle { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ask-toggle input { width: 16px; height: 16px; min-height: 16px; accent-color: var(--brand); }
.is-asked { opacity: .45; }

.step-part + .step-part { border-top: 1px solid var(--line); padding-top: 18px; }
.part-title { font-size: 1.05rem; margin: 0; }

.ready { margin: 4px 0 20px; }
.ready .facts { margin-top: 6px; }

.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 12px; }
.part { display: flex; flex-direction: column; gap: 4px; }
.part-label { font-size: .85rem; color: var(--muted); }
.part select, .multi select { width: 100%; }
.multi { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.multi-row { display: flex; gap: 8px; width: 100%; align-items: center; }
.multi-row input { flex: 1; }
.add-another { padding-left: 0; }

.checklist { margin: 4px 0 8px; padding-left: 20px; color: var(--muted); }
.checklist li { margin: 2px 0; }

details.prefill > summary { cursor: pointer; list-style-position: outside; }
details.prefill:not([open]) { padding-top: 14px; padding-bottom: 14px; }
.template-actions { flex-wrap: wrap; margin: 4px 0 16px; }
.list-item { display: flex; align-items: center; }
.list-item.row-new { animation: row-new 2.4s ease-out; }
@keyframes row-new { 0%, 35% { background: var(--accent-bg); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .list-item.row-new { animation: none; } }
.list-item > .list-button { flex: 1; min-width: 0; }
.row-remove { margin-right: 10px; flex: none; }
.input-short { max-width: 140px; }
/* Step overview and a Next button that stays in reach on phones. */
.step-list { margin: 0 0 6px; }
.step-list summary { cursor: pointer; list-style: none; }
.step-list summary::-webkit-details-marker { display: none; }
.step-list summary::after { content: " ▾"; }
.step-list[open] summary::after { content: " ▴"; }
.step-list ol { list-style: none; margin: 8px 0 12px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: 50vh; overflow: auto; }
.step-list li .link-button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 6px 8px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.step-list li .link-button:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.step-list li.current .link-button { font-weight: 600; background: color-mix(in srgb, var(--brand) 12%, transparent); }
.step-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-size: 12px; flex: none; }
.step-list li.done .step-mark { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 640px) {
  .wiz-body form > .wiz-nav { position: sticky; bottom: 0; background: rgba(255, 255, 255, .97); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 2; }
  .wiz-body { padding: 24px 16px 40px; gap: 16px; }
  .wiz-head { padding: 10px 16px 8px; }
  .wiz-nav .btn { flex: 1; }
  .wiz-nav > span:not(:empty) { display: none; }
  .btn-lg { width: 100%; }
  .row-actions { flex-wrap: wrap; }
  h1 { font-size: 1.45rem; }
}
.options.inline { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.file-field { display: grid; gap: 8px; justify-items: start; }
.file-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.file-list .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row { flex-wrap: wrap; } .row-files { flex-basis: 100%; } .row-files:empty { display: none; }
.link-box code { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); word-break: break-all; font-size: 13px; }
.countersign-form { flex-basis: 100%; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
/* Gmail-style selection and removal in the agreements list. */
.list-toolbar { display: flex; align-items: center; gap: 12px; padding: 6px 4px 8px; min-height: 40px; }
.select-cell { display: inline-grid; place-items: center; width: 44px; min-height: 44px; flex: none; cursor: pointer; }
.select-box { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.list-item .row-remove { opacity: .55; font-size: 16px; }
.list-item:hover .row-remove, .list-item .row-remove:focus-visible { opacity: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 16px;
  width: max-content; max-width: min(560px, calc(100vw - 32px)); font-size: .9375rem; padding: 12px 16px; border-radius: 8px; background: var(--brand); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 50; }
.toast .toast-action { color: #b9d3f5; font-weight: 600; }
.icon { display: inline-flex; vertical-align: -3px; }
.list-item:has(.select-cell .select-box:checked) { background: var(--brand-soft); }
.wiz-head > div:first-child { flex: 1; min-width: 0; }
.wiz-head .wiz-title { max-width: 100%; }
.wiz-head > div:first-child { min-width: 0; flex: 1; }
.wiz-head-right { flex: none; }
@media (max-width: 480px) { .wiz-head .wide-only { display: none; } }
@media (max-width: 640px) {
  .wiz-head-right .btn { min-height: 36px; padding: 0 8px; font-size: .85rem; }
}
/* While an upload is running, the "upload your first agreement" prompt and the empty-list note are redundant. */
.upload-status:has(.busy) ~ .empty, .upload-status:has(.busy) ~ .empty-note { display: none; }

/* Logo: the mark and the name. */
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; white-space: nowrap; }
.logo-mark { display: block; flex: none; }
/* Wordmark: the drawing masks a box filled with the current text color, so it follows .logo's color everywhere.
   The box spans ascender to descender (240 units, baseline at 195); the negative bottom margin drops the
   descender below the line so the letters, not the "g" tail, center on the mark. */
.logo-name { display: block; flex: none; height: 1.05em; aspect-ratio: 894 / 240; margin-bottom: -.24em; background: currentColor;
  -webkit-mask: url(/assets/logo-name.svg) center / contain no-repeat; mask: url(/assets/logo-name.svg) center / contain no-repeat; }
@media (forced-colors: active) { .logo-name { background: CanvasText; } }
.logo-sm { gap: 5px; font-size: .85rem; }
.logo-sm .logo-mark { width: 16px; height: 16px; }
.logo-md { font-size: 1.1rem; }
.logo-md .logo-mark { width: 28px; height: 28px; }
.logo-lg { gap: 12px; font-size: 1.6rem; }
.logo-lg .logo-mark { width: 44px; height: 44px; }
.powered-by { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 0; font-size: .8rem; color: var(--muted); }
.powered-by .logo { color: var(--muted); font-weight: 650; }
/* A small lock before "Secured by" (an image, so the strict CSP allows it). */
.powered-by::before { content: ""; width: 12px; height: 12px; flex: none; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 1 1 8 0v2h.5A1.5 1.5 0 0 1 14 8.5v5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5v-5A1.5 1.5 0 0 1 3.5 7H4zm1.5 0h5V5a2.5 2.5 0 0 0-5 0v2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 1 1 8 0v2h.5A1.5 1.5 0 0 1 14 8.5v5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5v-5A1.5 1.5 0 0 1 3.5 7H4zm1.5 0h5V5a2.5 2.5 0 0 0-5 0v2z'/%3E%3C/svg%3E") center / contain no-repeat; }
.wiz-body > .powered-by { margin-top: 28px; }

/* Upload: one bar, one sentence, time left; then the result. */
.upload-status { display: grid; gap: 12px; }
.upload-status:not(:empty) { margin: 16px 0 20px; }
.upload-card .progress { height: 8px; }
.upload-card .progress span { transition: width .5s linear; }
.drop-overlay { position: fixed; inset: 12px; z-index: 60; display: grid; place-items: center; border: 2px dashed var(--brand);
  border-radius: 12px; background: color-mix(in srgb, var(--brand-soft) 88%, transparent); pointer-events: none; }
.drop-overlay p { font-size: 1.3rem; font-weight: 650; color: var(--brand); }
.drop-overlay[hidden] { display: none; }

/* Customer pages: one white sheet on the grey page, like a bank's onboarding form. */
.wiz { background: var(--bg); }
.wiz-head { background: rgba(255, 255, 255, .97); }
.wiz-body { background: var(--surface); border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100%; }
@media (max-width: 680px) { .wiz-body { border: 0; } }
.wiz-head .brand { color: var(--brand); }

/* The select bar is the list's header row, like a statement table. */
.list-panel { display: grid; }
.list-panel > .list-toolbar { background: #f8fafc; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 16px 0 4px; min-height: 44px; }
.list-panel > .list-toolbar:not([hidden]) + .list { border-top-left-radius: 0; border-top-right-radius: 0; }
.col-head { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) {
  /* Phone top bar: logo and sign-out on one row, tabs underneath. */
  .topbar { padding: 8px 16px 0; gap: 0 12px; }
  .topbar-left { min-width: 0; flex: 1; gap: 10px; }
  .topbar-left .org-name, .topbar-left select { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; color: var(--muted); }
  .topbar-right > .muted { display: none; }
  .topbar-right .btn { min-height: 40px; padding: 0 4px; }
  .tabs { order: 3; flex-basis: 100%; margin: 4px -4px 0; }
}

/* Phones and tablets: every tap target at least 44px (Apple HIG / WCAG 2.5.5), nothing under 12px. */
@media (pointer: coarse) {
  .btn, .btn-sm { min-height: 44px; }
  .btn-sm { padding: 0 14px; font-size: .9rem; }
  .list-item .row-remove { min-width: 44px; min-height: 44px; margin-right: 4px; opacity: .8; }
  .wiz-head-right .btn { min-height: 40px; }
  .step-list summary { min-height: 44px; display: flex; align-items: center; }
  .step-list li .link-button { min-height: 44px; }
  .chips.quick .chip { min-height: 40px; padding: 6px 14px; }
  .ctx-btn { min-height: 44px; padding: 0 4px; }
  .tab { min-width: 44px; }
}
@media (max-width: 640px) {
  .brand, .col-head { font-size: .75rem; }
  .badge { font-size: .82rem; padding: 4px 10px; }
  .powered-by { font-size: .85rem; }
  .step-mark { font-size: 13px; width: 24px; height: 24px; }
  .muted.small, .small { font-size: .9rem; }
  .part-label { font-size: .9rem; }
}

/* Shorter questions: shared option wording once, grouped Yes/No and True/False. */
.option-lead { margin: 0 0 2px; color: var(--muted); font-size: .95rem; }
.option-none { border-style: dashed; }
.statements { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: #2d3748; font-size: .95rem; }
.statement-list { margin-top: 6px; }
/* Message cards (signed, link expired…) keep a readable width on wide screens. */
.center-screen > .card.wide { width: min(560px, 100%); }

/* Wide screens: headers line up with the content instead of the window edges; the form is a panel. */
@media (min-width: 900px) {
  .topbar { padding-inline: max(28px, calc((100% - 1040px) / 2 + 24px)); }
  .wiz-head { padding-inline: max(24px, calc((100% - 720px) / 2)); }
  .wiz-body { width: min(720px, calc(100% - 48px)); margin: 32px auto 56px; padding: 40px 48px 48px;
    border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); min-height: 0; }
  .review-group dl { grid-template-columns: minmax(180px, 44%) 1fr; }
}

/* Test runs with sample answers. */
.badge-test { color: #8a4b00; background: #fff6e6; margin-right: 4px; }
/* Full width of the screen minus a margin (left: 50% with a transform made it wrap at half the width). */
.sample-banner { position: fixed; left: 12px; right: 12px; bottom: 20px; margin: 0 auto; width: fit-content; max-width: 620px; z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--brand); color: #fff;
  box-shadow: 0 8px 24px rgba(11, 21, 38, .25); font-size: .875rem; line-height: 1.4; }
.sample-banner > span { flex: 1; min-width: 0; }
.sample-banner .btn { flex: none; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); min-height: 34px; font-size: .8125rem; padding: 0 12px; }
.sample-banner .btn:hover { background: rgba(255, 255, 255, .12); }
@media (max-width: 640px) { .sample-banner { bottom: 88px; } }

/* Address check ("did you mean"). */
.address-field { display: grid; gap: 10px; }
.address-suggest { display: grid; gap: 8px; padding: 14px; border: 1px solid #d7e1ee; border-radius: 10px; background: var(--brand-soft); }
.address-option { font: inherit; text-align: left; width: 100%; }
.address-ok { color: var(--accent); font-weight: 600; }

/* Many short options: a compact grid instead of a tall list. */
.options.grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.options.grid .option { min-height: 46px; padding: 11px 12px; align-items: center; gap: 10px; }
.options.grid .option input { margin-top: 0; }
.options.grid .option-lead, .options.grid > p { grid-column: 1 / -1; }
@media (max-width: 640px) { .options.grid { grid-template-columns: 1fr 1fr; } .options.grid .option { font-size: .95rem; } }

/* Address: the street on its own row, then city, state, ZIP and country. */
.parts.address-parts { grid-template-columns: 2fr 1.4fr 1fr; }
.parts.address-parts > .part:first-child { grid-column: 1 / -1; }
.parts.address-parts > .part:last-child { grid-column: span 2; }
@media (max-width: 640px) {
  .parts.address-parts { grid-template-columns: 1fr 1fr; }
  .parts.address-parts > .part:last-child { grid-column: 1 / -1; }
}

/* "State and Country": the country first; the state box only for the United States. */
.parts.state-country > .part-country { order: -1; }

/* A statement the customer confirms (True/False). */
blockquote.statement { margin: 0; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--soft); border-radius: 0 8px 8px 0; color: var(--ink); font-size: .95rem; }

/* A newer version is out. */
.update-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--brand); color: #fff; box-shadow: 0 8px 24px rgba(11, 21, 38, .25); font-size: .95rem; }
.update-bar .btn { background: #fff; color: var(--brand); border-color: #fff; min-height: 34px; }
.update-bar span { white-space: nowrap; }

/* ==========================================================================
   Company workspace, v3: a private-banking masthead.
   Navy runs from the top bar into each page's masthead (title, a ledger of key
   figures, the main actions); content sits on cool grey in white panels.
   Two type scales: desktop is denser (15px body, 30px titles), phones larger
   to read and tap (16px body, 22px titles, 48px controls).
   ========================================================================== */
:root {
  --navy: #0f2a4a;
  --navy-deep: #0b2140;
  --on-navy: #ffffff;
  --on-navy-muted: rgba(255, 255, 255, .68);
  --on-navy-line: rgba(255, 255, 255, .16);
  --bg: #f2f4f7;
  --line: #dde2e9;
  --muted: #566275;
  --panel-shadow: 0 1px 2px rgba(14, 26, 43, .04), 0 4px 12px -6px rgba(14, 26, 43, .08);
}
.shell { font-size: 15px; line-height: 1.5; overflow-x: clip; background: var(--bg); }
.shell .btn svg, .masthead svg { pointer-events: none; flex: none; }
.shell .btn { white-space: nowrap; font-size: .95rem; min-height: 40px; padding: 0 16px; gap: 8px; }
.shell .btn-sm { min-height: 34px; padding: 0 12px; font-size: .875rem; gap: 6px; }
.tnum, .ledger dd, .cell-num { font-variant-numeric: tabular-nums; }

/* Top bar: navy, continuous with the masthead. */
.shell .topbar { background: var(--navy-deep); border-bottom: 1px solid var(--on-navy-line); color: var(--on-navy); }
.shell .topbar .logo { color: var(--on-navy); }
.shell .topbar .logo-mark { border-radius: 7px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); }
.shell .topbar .org-name { color: var(--on-navy-muted); font-weight: 500; padding-left: 14px; border-left: 1px solid var(--on-navy-line); }
.shell .topbar select { background: transparent; color: var(--on-navy); border-color: var(--on-navy-line); }
.shell .topbar select option { color: var(--ink); }
.shell .tab { color: var(--on-navy-muted); font-size: .95rem; }
.shell .tab:hover { color: var(--on-navy); }
.shell .tab.active { color: var(--on-navy); border-bottom-color: #ffffff; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .12);
  color: var(--on-navy); font-size: .78rem; font-weight: 600; letter-spacing: .02em; box-shadow: inset 0 0 0 1px var(--on-navy-line); }
.user-email { color: var(--on-navy-muted); font-size: .875rem; }
.shell .btn-signout { color: var(--on-navy-muted); padding: 0 6px; }
.shell .btn-signout:hover { color: var(--on-navy); }
.shell .topbar button:focus-visible, .masthead button:focus-visible, .masthead label:focus-visible { outline-color: #ffffff; }

/* Masthead: full-bleed navy band; its text lines up with the content column. */
.content:has(> .masthead:first-child) { padding-top: 0; }
.masthead { margin-inline: calc(50% - 50vw); padding: 28px calc(50vw - 50%) 32px; background: var(--navy); color: var(--on-navy); }
.masthead-inner { display: grid; gap: 10px; }
.masthead-back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; margin-left: -4px; padding: 4px 6px 4px 2px;
  font: inherit; font-size: .875rem; color: var(--on-navy-muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.masthead-back:hover { color: var(--on-navy); }
.masthead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.masthead-text { display: grid; gap: 18px; min-width: 0; }
.masthead h1 { color: var(--on-navy); font-size: 1.875rem; line-height: 1.2; letter-spacing: -.015em; font-weight: 600; overflow-wrap: anywhere; }
.ledger { display: flex; flex-wrap: wrap; margin: 0; row-gap: 12px; }
.ledger-item { padding: 0 24px; border-left: 1px solid var(--on-navy-line); }
.ledger-item:first-child { padding-left: 0; border-left: 0; }
.ledger dt { font-size: .8rem; color: var(--on-navy-muted); }
.ledger dd { margin: 2px 0 0; font-size: 1rem; font-weight: 550; color: var(--on-navy); }
.masthead-actions { display: flex; gap: 10px; flex: none; }
.btn-on-dark { background: #ffffff; color: var(--navy); border-color: #ffffff; }
.btn-on-dark:hover { background: #e8eef6; border-color: #e8eef6; }
.btn-ghost-dark { background: transparent; color: var(--on-navy); border-color: rgba(255, 255, 255, .38); }
.btn-ghost-dark:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .6); }
.masthead .btn:disabled { opacity: .5; }

/* Quiet text buttons for the document's own actions. */
.btn-text { background: transparent; border-color: transparent; color: var(--muted); font-weight: 550; }
.btn-text:hover { background: #e7ebf1; border-color: transparent; color: var(--ink); }
.btn-text-danger:hover { color: var(--danger); background: var(--danger-bg); }
.doc-actions { display: flex; flex-wrap: wrap; gap: 2px; margin: -6px 0 -4px -12px; }

/* Panels: white sheets with a header row. */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--panel-shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1.1rem; }
.panel-empty { padding: 18px 20px; }
.list-flush { border: 0; border-radius: 0; box-shadow: none; }
.fields-details.panel { padding: 0 20px; gap: 16px; }
.fields-details.panel > summary { padding: 16px 0; display: grid; gap: 2px; list-style: none; cursor: pointer; position: relative; padding-right: 28px; }
.fields-details.panel > summary::-webkit-details-marker { display: none; }
.fields-details.panel > summary::after { content: ""; position: absolute; right: 4px; top: 22px; width: 8px; height: 8px; border-right: 1.75px solid var(--muted);
  border-bottom: 1.75px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.fields-details.panel[open] > summary::after { transform: rotate(-135deg); top: 26px; }
.fields-details.panel[open] { padding-bottom: 20px; }
.fields-details.panel[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 0; }
.summary-title { font-weight: 600; font-size: 1rem; }
.summary-sub { color: var(--muted); font-size: .875rem; }

/* Status: a coloured dot and plain words, like a statement line. */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 550; color: var(--ink); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9aa5b5; flex: none; }
.status-ready::before, .status-req-completed::before { background: #17a06a; }
.status-analyzing::before, .status-uploaded::before, .status-req-pending::before, .status-req-sent::before, .status-req-opened::before, .status-req-awaiting_signer::before { background: #2f6fd6; }
.status-review::before { background: #d48a12; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.panel.review { border-color: #e8c98c; padding: 16px 20px 18px; }
.panel.review h2 { font-size: 1.1rem; margin: 0 0 4px; }
.review-actions .btn { flex: 0 0 auto; }
@media (max-width: 640px) { .panel.review { padding: 14px 16px 16px; } }
.status-failed::before, .status-interrupted::before { background: var(--danger); }
.status-req-revoked, .status-expired { color: var(--muted); }
.status-expired::before { background: #9aa5b5; }

/* Agreements table. */
.list-panel { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--panel-shadow); }
.list-panel > .list { border: 0; border-radius: 0; box-shadow: none; }
.list-panel > .list-toolbar.table-head { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #f7f9fb; padding: 0; min-height: 44px; gap: 0; }
.list-panel > .list-toolbar.no-select { padding-left: 16px; }
.col-head { text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 550; color: var(--muted); }
.table-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 64px 64px 136px; align-items: center; column-gap: 16px; }
.list-row.table-row { display: grid; padding: 14px 16px 14px 4px; min-height: 68px; }
.head-row { flex: 1; padding: 0 16px 0 4px; }
.head-main { grid-column: 1 / span 2; display: flex; align-items: center; gap: 12px; }
.col-sent, .col-signed, .cell-num { text-align: center; }
.cell-num { color: var(--ink); font-size: .95rem; }
.trash-spacer { width: 46px; flex: none; }
.row-sub { color: var(--muted); font-size: .85rem; }
.row-counts { display: none; }
.doc-tile { position: relative; display: grid; place-items: end center; width: 34px; height: 40px; padding-bottom: 6px; border-radius: 4px;
  font-size: .66rem; font-weight: 700; letter-spacing: .02em; border: 1px solid; background: #fff; }
.doc-tile::after { content: ""; position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-bottom-left-radius: 3px;
  background: linear-gradient(225deg, var(--surface) 50%, currentColor 50%); opacity: .35; }
.doc-word { color: #1f4e9a; border-color: #c9d7ee; background: #f3f7fd; }
.doc-pdf { color: #a4342a; border-color: #efcdc9; background: #fdf5f4; }
.list-item:hover { background: #f8fafc; }
.list-button:hover { background: transparent; }

/* Sent: one line per customer. */
.sent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main status" "actions actions"; gap: 10px 16px; padding: 16px 20px; }
.sent-row > .row-main { grid-area: main; }
.sent-row > .status { grid-area: status; align-self: start; padding-top: 2px; }
.sent-row > .row-actions { grid-area: actions; flex-wrap: wrap; }
.sent-row > .row-actions:empty { display: none; }
.sent-row > .row-files { grid-column: 1 / -1; }
.check-inline { font-size: .875rem; margin-right: 6px; }
@media (min-width: 900px) {
  .sent-row { grid-template-columns: minmax(0, 1fr) 150px auto; grid-template-areas: "main status actions"; align-items: center; }
  .sent-row > .status { padding-top: 0; }
  .sent-row > .row-actions { justify-content: flex-end; }
}

/* Tablets */
@media (max-width: 899px) {
  .masthead h1 { font-size: 1.6rem; }
  .masthead-row { flex-direction: column; align-items: stretch; }
  .masthead-actions .btn { flex: 1; }
}

/* Phones: bigger type and targets, stacked layout. */
@media (max-width: 640px) {
  .shell { font-size: 16px; }
  .shell .btn { min-height: 48px; font-size: 1rem; }
  .shell .btn-sm, .shell .btn-text { min-height: 44px; }
  .shell .topbar { padding: 8px 16px 0; }
  .shell .topbar .org-name { padding-left: 10px; font-size: .9rem; }
  .user-email { display: none; }
  .avatar { width: 30px; height: 30px; }
  .shell .tab { min-height: 46px; font-size: 1rem; }
  .content:has(> .masthead:first-child) { gap: 16px; }
  .masthead { padding: 20px calc(50vw - 50%) 24px; }
  .masthead h1 { font-size: 1.375rem; line-height: 1.25; }
  .masthead-text { gap: 16px; }
  .ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .ledger-item, .ledger-item:first-child { padding: 0; border: 0; }
  .ledger dt { font-size: .8125rem; }
  .masthead-actions { flex-direction: column-reverse; }
  .masthead-actions .btn { width: 100%; }
  .doc-actions { margin-left: -8px; }
  .table-row { grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 12px; }
  .cell-num, .col-sent, .col-signed { display: none; }
  .col-status { text-align: right; }
  .row-counts { display: inline; }
  .list-row.table-row { padding: 14px 12px 14px 0; }
  .head-row { padding-right: 12px; }
  .trash-spacer { width: 44px; }
  .panel-head, .sent-row, .panel-empty { padding-inline: 16px; }
  .fields-details.panel { padding: 0 16px; }
  .sent-row > .row-actions .btn-primary { flex: 1 1 100%; }
  .status { font-size: .9rem; }
}
/* Hidden inputs (the file picker) never take layout space, whatever the general input styles say. */
.visually-hidden, input.visually-hidden { width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; margin: -1px !important; }

/* v3 refinements: title and actions share the top row; the ledger runs underneath at full width. */
.masthead-row { align-items: center; }
.masthead-inner > .ledger { margin-top: 10px; }
.fields-details.panel:not([open]) { gap: 0; }
@media (min-width: 900px) {
  .sent-row { grid-template-columns: minmax(0, 1fr) 120px 440px; }
}
@media (max-width: 899px) {
  .masthead-row { align-items: stretch; }
}
@media (max-width: 640px) {
  .masthead-inner > .ledger { margin-top: 6px; }
  .masthead-actions { order: 3; }
}
@media (max-width: 899px) {
  /* Narrow screens: title, then the figures, then the actions. */
  .masthead-inner { display: flex; flex-direction: column; gap: 10px; }
  .masthead-row { display: contents; }
  .masthead-back { order: 0; align-self: flex-start; }
  .masthead h1 { order: 1; }
  .masthead-inner > .ledger { order: 2; margin: 6px 0 4px; }
  .masthead-actions { order: 3; margin-top: 8px; }
}
@media (min-width: 900px) { .sent-row { grid-template-columns: minmax(0, 1fr) 110px 480px; } }
@media (max-width: 640px) {
  /* Three figures in one row; four in two rows of two. */
  .ledger { grid-template-columns: repeat(3, 1fr); }
  .ledger:has(> :nth-child(4)) { grid-template-columns: 1fr 1fr; }
  /* Agreement rows: the status sits under the title, so long titles keep the width. */
  .list-row.table-row { grid-template-columns: 34px minmax(0, 1fr); row-gap: 6px; }
  .list-row.table-row > .doc-tile { grid-row: span 2; align-self: start; }
  .list-row.table-row > .status { grid-column: 2; justify-self: start; }
  .col-status { display: none; }
}
@media (min-width: 900px) { .sent-row > .status { align-self: center; } }

/* ---- Compact phones (v3.1): denser type, shorter labels, one-row figures and actions. ---- */
.lbl-short { display: none; }
.account { position: relative; }
.account > summary { list-style: none; cursor: pointer; }
.account > summary::-webkit-details-marker { display: none; }
.account-org { display: none; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; display: grid; gap: 10px; padding: 12px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(14, 26, 43, .18); }
.account-email { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
/* Every screen: your email and "Sign out" live in the menu under your initials, so the top bar stays one row. */
.user-email, .shell .btn-signout { display: none; }
.account:not([open]) .account-menu { display: none; }
@media (max-width: 640px) {
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .shell { font-size: 15px; }
  .shell .btn { min-height: 42px; font-size: .9375rem; padding: 0 14px; }
  .shell .btn-sm, .shell .btn-text { min-height: 38px; font-size: .875rem; padding: 0 10px; }

  /* Top bar: mark, company name, account. The tabs become a bar along the bottom (icon + label), like a banking app. */
  .shell .topbar { flex-wrap: nowrap; min-height: 52px; padding: 0 12px; gap: 10px; min-width: 0; }
  .shell .topbar-left { flex: 1; min-width: 0; gap: 10px; }
  .shell .topbar .logo-name { display: none; }
  .shell .topbar .org-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; color: var(--on-navy); border-left: 0; padding-left: 0; }
  /* Several companies: the name itself is the switcher (tap it to pick another). */
  .shell .topbar-left select { display: block; min-width: 0; max-width: 100%; min-height: 36px; padding: 4px 26px 4px 8px; font-size: .9375rem; font-weight: 550;
    color: var(--on-navy); background-color: rgba(255, 255, 255, .08); border: 1px solid var(--on-navy-line); border-radius: 8px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 9px center; background-size: 11px 8px; }
  .shell .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; order: 0; margin: 0; gap: 0; display: flex; justify-content: space-around;
    background: var(--navy-deep); border-top: 1px solid var(--on-navy-line); padding: 0 4px env(safe-area-inset-bottom); }
  .shell .tab { flex: 1 1 0; min-width: 0; min-height: 58px; padding: 6px 2px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: .75rem; font-weight: 550; border-bottom: 0; border-top: 2px solid transparent; }
  .shell .tab.active { border-top-color: #ffffff; border-bottom: 0; }
  .shell .tab .icon { display: block; }
  .shell .content { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .shell ~ .toast, body:has(.shell .tabs) .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .account-org { display: block; width: 100%; min-height: 40px; }
  .user-email, .shell .btn-signout { display: none; }
  .avatar { width: 30px; height: 30px; font-size: .72rem; }

  /* Masthead: small title, four figures on one line, two actions side by side. */
  .content { padding: 0 12px 40px; gap: 12px; }
  .content:has(> .masthead:first-child) { gap: 12px; }
  .masthead { padding: 12px calc(50vw - 50%) 14px; }
  .masthead-inner { gap: 6px; }
  .masthead-back { font-size: .8125rem; }
  .masthead h1 { font-size: 1.1875rem; line-height: 1.3; }
  .masthead-inner > .ledger { margin: 4px 0 2px; }
  .ledger, .ledger:has(> :nth-child(4)) { display: flex; flex-wrap: nowrap; gap: 0; }
  .ledger-item, .ledger-item:first-child { padding: 0 12px; border-left: 1px solid var(--on-navy-line); }
  .ledger-item:first-child { padding-left: 0; border-left: 0; }
  .ledger dt { font-size: .72rem; }
  .ledger dd { font-size: .9375rem; white-space: nowrap; }
  .masthead-actions { flex-direction: row; gap: 8px; margin-top: 6px; }
  .masthead-actions .btn { width: auto; flex: 1; }

  /* Document actions: one quiet row. */
  .doc-actions { flex-wrap: nowrap; margin: 0 0 -4px -8px; gap: 0; }

  /* Panels and rows. */
  .panel, .list-panel { border-radius: 10px; }
  .panel-head { padding: 10px 14px; }
  .panel-head h2 { font-size: 1.02rem; }
  .summary-title { font-size: .9375rem; }
  .sent-row { padding: 12px 14px; gap: 8px 10px; }
  .sent-row > .row-actions .btn-primary { flex: 0 0 auto; }
  .row-title { font-size: .9375rem; }
  .row-sub { font-size: .8125rem; }
  .status { font-size: .8125rem; }
  .check-inline { font-size: .8125rem; }
  .fields-details.panel { padding: 0 14px; }
  .fields-details.panel > summary { padding: 12px 24px 12px 0; }
  .fields-details.panel > summary::after { top: 17px; }
  .fields-details.panel[open] > summary::after { top: 21px; }
  .list-row.table-row { padding: 10px 10px 10px 0; min-height: 0; }
  .list-panel > .list-toolbar.table-head { min-height: 40px; }
  .doc-tile { width: 28px; height: 34px; font-size: .6rem; padding-bottom: 4px; }
  .list-row.table-row { grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; }
}
@media (max-width: 640px) and (pointer: coarse) {
  .shell .btn-sm { min-height: 38px; }
  .list-item .row-remove { min-width: 40px; min-height: 40px; }
}
.status-counts { display: none; }
@media (max-width: 640px) {
  .status-counts { display: inline; margin-left: 6px; color: var(--muted); font-weight: 400; }
  /* Download and Countersign side by side; the certificate choice underneath. */
  .sent-row > .row-actions .check-inline { order: 3; flex-basis: 100%; }
}
.file-list .file-name.link-button { font: inherit; color: var(--link); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.file-list .file-name.link-button:hover { text-decoration: underline; }
/* Activity log for one agreement. */
.activity { list-style: none; margin: 4px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; display: grid; gap: 6px; }
.activity li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; font-size: .875rem; }
.activity-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.activity-who { overflow-wrap: anywhere; text-align: right; }
@media (max-width: 640px) { .activity li { grid-template-columns: 1fr; gap: 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); } .activity-who { text-align: left; } }

/* App message box (replaces the browser's alert/confirm). */
.app-dialog { width: min(460px, calc(100vw - 32px)); max-width: none; padding: 22px 24px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgba(11, 21, 38, .18); }
.app-dialog::backdrop { background: rgba(11, 21, 38, .35); }
.app-dialog-text { margin: 0 0 18px; font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #912018; border-color: #912018; color: #fff; }
@media (max-width: 640px) {
  .app-dialog { padding: 18px 18px 14px; }
  .app-dialog-text { font-size: .875rem; margin-bottom: 14px; }
  .app-dialog-actions .btn { flex: 1; }
}

/* Search boxes above the agreements list and a sent list. */
.search { position: relative; display: block; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted, #6b7280); pointer-events: none; }
.search input[type=search] { width: 100%; padding-left: 36px; }
.list-search { margin: 0 0 12px; max-width: 360px; }
.panel-head .search { width: min(260px, 50%); margin-left: auto; }
.panel-head .search input[type=search] { min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: .875rem; }
.filtered { display: none !important; }
@media (max-width: 640px) {
  .list-search { max-width: none; margin-bottom: 10px; }
  .list-search input[type=search] { min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
  .panel-head .search { width: 55%; }
}
@media (max-width: 640px) { .toast { font-size: .875rem; bottom: 16px; } }

/* Phones: sign-in, customer welcome / signed / link messages and other card screens use the same compact
   type scale as the app pages. */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .center-screen { padding: 20px 16px; }
  .hero { gap: 14px; }
  .hero h1 { font-size: 1.55rem; line-height: 1.18; }
  .lede { font-size: .95rem; line-height: 1.5; }
  .logo-lg { font-size: 1.3rem; gap: 10px; }
  .logo-lg .logo-mark { width: 36px; height: 36px; }
  .card { padding: 20px 18px; }
  .center-screen .card h1 { font-size: 1.3rem; }
  .center-screen .card h2 { font-size: 1.05rem; }
  .btn-lg { min-height: 46px; font-size: .975rem; padding: 0 20px; }
  .wiz-body h1 { font-size: 1.3rem; }
  .wiz-body .lede { font-size: .95rem; }
  .wiz-body .facts { font-size: .9rem; gap: 6px; }
  .wiz-body .row-actions > .btn { width: 100%; min-height: 44px; }
}

/* Sign-in: a navy brand panel beside a white sign-in panel; stacked on phones. */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--surface); }
.signin-brand { position: relative; overflow: hidden; color: #fff; display: grid; align-items: center; padding: 56px clamp(32px, 6vw, 88px);
  background: radial-gradient(120% 80% at 0% 0%, #17406f 0%, rgba(23, 64, 111, 0) 60%), linear-gradient(160deg, #0c2a4d 0%, #081d36 100%); }
.signin-brand::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.signin-brand-inner { position: relative; z-index: 1; max-width: 520px; display: grid; gap: 26px; }
.signin-brand .logo { color: #fff; }
.signin-brand .logo-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .22); border-radius: 10px; }
.signin-brand h1 { color: #fff; font-size: clamp(2.1rem, 3.4vw, 2.8rem); line-height: 1.1; letter-spacing: -.018em; font-weight: 600; }
.signin-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.signin-points li { display: grid; gap: 2px; padding-left: 26px; position: relative; color: #c5d3e6; font-size: .975rem; line-height: 1.45; }
.signin-points li::before { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: #2fbf8a; box-shadow: inset 0 0 0 4px #0f3a2f; }
.signin-points strong { color: #fff; font-weight: 600; }
.signin-lede { margin: -8px 0 0; color: #c5d3e6; font-size: 1.075rem; line-height: 1.55; max-width: 460px; }

.sample-doc { margin-top: 6px; width: min(380px, 100%); background: #fff; color: var(--ink); border-radius: 12px; padding: 18px 20px 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .08); transform: rotate(-1.5deg); font-size: .8rem; display: grid; gap: 9px; }
.sd-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sd-title { font-family: var(--serif); font-weight: 600; font-size: .95rem; letter-spacing: 0; }
.sd-badge { font-size: .68rem; font-weight: 650; color: var(--accent); background: var(--accent-bg); padding: 2px 8px; border-radius: 999px; }
.sd-lines { display: grid; gap: 5px; margin-bottom: 2px; }
.sd-lines i { display: block; height: 5px; border-radius: 3px; background: #e9edf2; }
.sd-lines i.short { width: 62%; }
.sd-row, .sd-sign { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px dashed #d5dbe4; padding-bottom: 6px; }
.sd-label { color: var(--muted); }
.sd-value { font-weight: 600; color: #1d3f6e; }
.sd-sign { align-items: flex-end; border-bottom: 0; padding-bottom: 0; }
.sd-scribble { color: #1d3f6e; }

.signin-panel { display: grid; place-items: center; padding: 48px 32px; }
.signin-card { width: min(380px, 100%); display: grid; gap: 14px; }
.signin-card h2 { font-size: 1.75rem; letter-spacing: -.015em; }
.signin-card h2 { margin-bottom: 6px; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 50px; font-weight: 600;
  background: #fff; color: var(--ink); border: 1px solid #c9d1dc; border-radius: 10px; box-shadow: 0 1px 2px rgba(11, 21, 38, .06); }
.btn-google:hover { background: #f7f9fb; border-color: #aeb8c6; }
.signin-buttons { display: grid; gap: 10px; }
.signin-trust { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: .8rem; color: var(--muted); }

@media (max-width: 860px) {
  .signin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100dvh; }
  .signin-brand { padding: 28px 20px 30px; align-items: start; }
  .signin-brand-inner { gap: 16px; max-width: none; }
  .signin-brand .logo-lg { font-size: 1.15rem; gap: 10px; }
  .signin-brand .logo-lg .logo-mark { width: 32px; height: 32px; border-radius: 8px; }
  .signin-brand h1 { font-size: 1.7rem; }
  .signin-points { gap: 9px; }
  .signin-lede { font-size: .9rem; margin-top: -4px; }
  .signin-points li { font-size: .875rem; padding-left: 22px; }
  .signin-points li::before { width: 12px; height: 12px; top: 4px; box-shadow: inset 0 0 0 3.5px #0f3a2f; }
  /* The sample agreement, smaller, overlapping into the sign-in panel. */
  .signin-brand { overflow: visible; padding-bottom: 0; z-index: 1; }
  .signin-brand::after { overflow: hidden; }
  .sample-doc { width: min(300px, 92%); justify-self: center; padding: 14px 16px 12px; gap: 7px; font-size: .74rem; transform: rotate(-1.2deg);
    margin: 6px 0 -56px; box-shadow: 0 16px 32px rgba(0, 0, 0, .28), 0 0 0 1px rgba(11, 21, 38, .06); }
  .sd-title { font-size: .9rem; }
  .sd-scribble { width: 104px; height: 28px; }
  .signin-panel { place-items: start center; padding: 84px 20px 40px; }
  .signin-card h2 { font-size: 1.3rem; }
  .btn-google { min-height: 46px; }
}

/* SubSign admin area */
.admin-privacy { margin: -6px 0 0; }
.admin-row { align-items: flex-start; }
.admin-companies .admin-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 300px; gap: 16px; }
.admin-row .row-main { min-width: 0; }
.row-note { font-size: .85rem; color: #2d3748; font-style: italic; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: .8rem; color: var(--muted); }
.admin-stats b { color: var(--ink); font-weight: 600; }
.admin-plan { display: grid; gap: 2px; min-width: 150px; }
.admin-row .row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.admin-plan-select { min-height: 34px !important; padding: 4px 28px 4px 10px !important; width: auto !important; font-size: .85rem; }
.admin-history > summary { cursor: pointer; padding: 12px 20px; font-size: .875rem; color: var(--muted); border-top: 1px solid var(--line); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.admin-system { list-style: none; margin: 0; padding: 8px 20px 14px; display: grid; gap: 10px; }
.admin-system li { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.admin-team-form input[type=email] { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 760px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-row { flex-wrap: wrap; }
  .admin-companies .admin-row { grid-template-columns: 1fr; gap: 10px; }
  .admin-plan { min-width: 0; }
  .admin-row .row-actions { width: 100%; justify-content: flex-start; }
}

/* SubSign admin: editing */
.btn-on-dark-quiet { background: transparent; color: #e8eef6; border-color: rgba(255, 255, 255, .28); }
.btn-on-dark-quiet:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-link { all: unset; cursor: pointer; font-weight: 600; color: var(--ink); }
.admin-link:hover { text-decoration: underline; }
.admin-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.admin-inline-input[class] { min-height: 34px; padding: 4px 10px; font-weight: 600; max-width: 360px; }
.admin-detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding: 16px 20px 6px; }
.field-pair { display: grid; gap: 6px; align-content: start; }
.field-pair > label { font-size: .85rem; font-weight: 550; }
.field-pair.wide { grid-column: 1 / -1; }
.field-pair.switch-row { display: flex; align-items: center; gap: 10px; padding-top: 24px; font-weight: 400; font-size: .9rem; }
.admin-form textarea { min-height: 72px; font: inherit; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; width: 100%; box-sizing: border-box; }
.admin-save { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.admin-usage { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-usage th, .admin-usage td { text-align: right; padding: 9px 20px; border-bottom: 1px solid var(--line); }
.admin-usage th:first-child, .admin-usage td:first-child { text-align: left; }
.admin-usage th { font-size: .78rem; font-weight: 600; color: var(--muted); background: #f8fafc; }
.admin-usage tr:last-child td { border-bottom: 0; }
.admin-danger .panel-head h2 { color: var(--danger); }
.admin-danger .panel-empty { display: grid; gap: 12px; justify-items: start; }
.admin-dialog-form h2 { font-size: 1.15rem; }
.admin-dialog-form label { font-size: .85rem; font-weight: 550; }
@media (max-width: 900px) { .admin-detail { grid-template-columns: minmax(0, 1fr); } .admin-detail > .stack { min-width: 0; } }
@media (max-width: 640px) {
  .admin-form-grid { grid-template-columns: 1fr; padding: 14px 16px 4px; }
  .field-pair.switch-row { padding-top: 4px; }
  .admin-usage th, .admin-usage td { padding: 8px 16px; }
  .admin-inline-input[class] { max-width: none; }
}
.content { grid-template-columns: minmax(0, 1fr); }
.admin-detail, .admin-form-grid > * { min-width: 0; }
.admin-form-grid input:not([type=checkbox]), .admin-form-grid select { width: 100%; min-width: 0; box-sizing: border-box; }

/* Company branding on the customer's pages */
.company-mark { display: flex; align-items: center; gap: 10px; min-width: 0; }
.company-mark .brand { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-logo { display: block; max-height: 28px; max-width: 120px; width: auto; height: auto; object-fit: contain; flex: none; }
.card .company-logo { max-height: 34px; max-width: 150px; }
.wiz-head .company-mark { margin-bottom: 2px; }
.page-foot { display: grid; gap: 4px; justify-items: center; margin-top: 16px; }
.page-foot .powered-by { margin: 0; }
.wiz-body > .page-foot { margin-top: 28px; }
.contact-line { margin: 0; font-size: .85rem; color: var(--muted); text-align: center; }
.contact-line a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Company settings */
.settings-body { padding: 16px 20px 18px; }
.settings-foot { padding: 0 20px 16px; margin: 0; }
.usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.usage-meter { display: grid; gap: 8px; }
.usage-top { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.usage-bar { height: 8px; border-radius: 999px; background: #e9edf2; overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.usage-bar > span.full { background: var(--danger); }
.settings-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-label-sm { font-size: .85rem; font-weight: 550; }
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; }
.logo-preview { max-height: 40px; max-width: 180px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; background: #fff; }
.logo-empty { border: 1px dashed var(--line); border-radius: 6px; padding: 10px 14px; }
.brand-preview { display: grid; gap: 8px; }
.brand-preview-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: #fbfcfd; display: grid; gap: 6px; }
.brand-preview-card img { max-height: 34px; max-width: 180px; object-fit: contain; }
.brand-preview-card .brand { margin: 0; }
.brand-preview-card p { margin: 0; }
@media (max-width: 760px) {
  .usage-grid, .settings-split, .settings-two { grid-template-columns: minmax(0, 1fr); }
  .settings-body { padding: 14px 16px 16px; }
}

/* Company options */
.settings-flat { padding-bottom: 16px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.team-leave { justify-self: start; }
.activity-tools { display: flex; justify-content: flex-end; }
.activity-filter { width: auto !important; min-height: 38px !important; padding: 6px 30px 6px 12px !important; font-size: .9rem; }
.activity-log .row-title { font-size: .95rem; }
@media (max-width: 640px) { .wiz-head .company-logo { max-height: 22px; max-width: 72px; } .wiz-head .company-mark { gap: 8px; } }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--field); border-radius: 8px; background: #fff; cursor: pointer; }
.color-code { font-variant-numeric: tabular-nums; min-width: 84px; }
.preview-btn { display: inline-flex; justify-content: center; align-items: center; height: 34px; border-radius: 8px; color: #fff; font-weight: 600; font-size: .9rem; margin: 4px 0; }
.preview-secured { font-size: .75rem; }
.shell .topbar .account-menu select { background: #fff; color: var(--ink); border: 1px solid var(--field); padding: 6px 10px; }
.code-input[class] { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; max-width: 260px; }
input[type=color][class], .logo-row input[type=color] { width: 48px !important; min-width: 48px; height: 38px; min-height: 38px !important; padding: 3px !important; flex: none; }
.same-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px;
  border: 1px solid var(--brand); border-radius: 10px; background: var(--brand-soft); }
.same-card p { margin: 0; }
.same-title { font-weight: 600; }

/* ---- Legal pages (/legal/*) ---- */
.legal-body { background: var(--surface); }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  padding: 16px max(24px, calc((100% - 860px) / 2)); border-bottom: 1px solid var(--line); background: var(--surface); }
.legal-home { color: var(--ink); text-decoration: none; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: .9rem; }
.legal-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.legal-nav a:hover { color: var(--ink); }
.legal-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.legal-main { padding: 40px max(24px, calc((100% - 860px) / 2)) 64px; }
.legal-doc { max-width: 760px; color: var(--ink); font-size: 1rem; line-height: 1.65; }
.legal-doc h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -.025em; }
.legal-meta { color: var(--muted); font-size: .9rem; margin: 8px 0 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.legal-doc h2 { font-size: 1.15rem; margin: 32px 0 10px; scroll-margin-top: 16px; }
.legal-doc h3 { font-size: 1rem; margin: 20px 0 8px; }
.legal-doc p { margin: 0 0 12px; }
.legal-doc ul { margin: 0 0 12px; padding-left: 22px; }
.legal-doc li { margin: 0 0 6px; }
.legal-doc a { color: var(--link); }
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: .925rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 10px 12px; border: 1px solid var(--line); }
.legal-table thead th, .legal-table tbody th { background: var(--soft); font-weight: 600; }
.legal-table tbody th { width: 28%; }
.legal-foot { padding: 20px max(24px, calc((100% - 860px) / 2)) 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.legal-foot a { color: var(--muted); }
@media (max-width: 640px) {
  .legal-top { padding: 14px 16px; }
  .legal-nav { gap: 2px 16px; font-size: .875rem; }
  .legal-main { padding: 28px 16px 48px; }
  .legal-doc { font-size: .975rem; }
  /* Four-column tables become one card per row on a phone. */
  .legal-table thead { display: none; }
  .legal-table:has(thead) tr { display: block; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
  .legal-table:has(thead) td { display: block; border: 0; padding: 4px 12px; }
  .legal-table:has(thead) td:first-child { font-weight: 600; padding-top: 10px; }
  .legal-table:has(thead) td:last-child { padding-bottom: 10px; }
  .legal-table:has(thead) td:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); }
  .legal-table tbody th { width: 38%; }
}
@media print { .legal-top nav, .legal-foot { display: none; } .legal-main { padding: 0; } }

/* Links to the legal pages, and the acceptance box. */
.legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: .8rem; color: var(--muted); }
.legal-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.legal-links a:hover { color: var(--ink); }
.signin-card .legal-links, .page-foot .legal-links { justify-content: center; }
.signin-card .legal-links { margin-top: 18px; }
.account-legal { padding-top: 8px; border-top: 1px solid var(--line); }
.terms-check { display: flex; align-items: flex-start; gap: 10px; font-size: .925rem; line-height: 1.45; cursor: pointer; }
.terms-check input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; flex: none; }
.terms-check a { color: var(--link); }
.terms-card { width: min(520px, 100%); }
@media (max-width: 640px) { .terms-gate .content { padding-top: 16px; } .terms-card { margin-top: 0; } }
.admin-findings { margin: 6px 0 0; padding-left: 18px; font-size: .86rem; color: var(--text); }
.admin-findings li { margin: 2px 0; }
.btn-inline { background: none; border: 0; padding: 0; font: inherit; color: var(--brand, #0c2a4d); text-decoration: underline; cursor: pointer; min-height: 0; }
.perm-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.perm-table th, .perm-table td { padding: 8px 6px; border-bottom: 1px solid var(--line, #e3e8ef); text-align: center; vertical-align: middle; }
.perm-table thead th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.perm-table th[scope="row"], .perm-table thead th:first-child { text-align: left; font-weight: 450; }
.perm-table .perm-group th { text-align: left; font-weight: 650; padding-top: 16px; background: transparent; }
.perm-table td { width: 72px; }
.perm-table input[type="checkbox"] { width: 20px; height: 20px; }
.with-unit { display: flex; align-items: center; gap: 10px; }
.with-unit input { max-width: 120px; }
.field-set { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.field-set legend { font-weight: 600; margin-bottom: 6px; }
.stack-tight { display: grid; gap: 4px; }
@media (max-width: 600px) { .perm-table td { width: 52px; } .perm-table { font-size: .86rem; } }
.row-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #fff6e0; color: #6b4e00; font-size: .88rem; }
/* Admin company list: badge (logo or initials), note icon, same-name tag, compact view. */
.org-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.org-badge { flex: none; width: 28px; height: 28px; border-radius: 7px; background: #e8edf4; color: #3b4a5e; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; overflow: hidden; }
.org-badge-logo { background: #fff; border: 1px solid var(--line, #e3e8ef); }
.org-badge img { max-width: 100%; max-height: 100%; object-fit: contain; }
.note-tip { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--muted, #5b6778); cursor: pointer; }
.note-tip:hover, .note-tip:focus-visible, .note-tip.open { background: #eef2f7; color: inherit; }
.note-tip-text { display: none; position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: max-content; max-width: min(320px, 80vw); padding: 8px 10px; border-radius: 8px; background: #0c2a4d; color: #fff; font-size: .82rem; font-weight: 400; line-height: 1.4; text-align: left; white-space: pre-wrap; box-shadow: 0 6px 18px rgba(12,42,77,.25); }
.note-tip:hover .note-tip-text, .note-tip:focus-visible .note-tip-text, .note-tip.open .note-tip-text { display: block; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.tag-warn { background: #fff6e0; color: #6b4e00; }
.match-why { color: #6b4e00; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-compact .admin-row { padding-top: 8px; padding-bottom: 8px; align-items: center; }
.admin-compact .admin-stats, .admin-compact .admin-plan .row-sub, .admin-compact .row-actions { display: none; }
.admin-compact .row-main { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; }
.admin-compact .row-main > .row-sub:not(.match-why) { font-size: .84rem; }
.admin-companies .panel-head { flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) {
  .admin-companies .panel-tools { width: 100%; flex-wrap: nowrap; }
  .admin-companies .panel-tools .search { flex: 1 1 0; min-width: 0; width: auto; max-width: none; }
  .admin-companies .panel-tools .btn { flex: none; }
}
.row-warn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; flex-basis: 100%; }
.row-warn-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; min-width: 0; }
.row-warn .btn { white-space: normal; text-align: left; }
.row-warn span { overflow-wrap: anywhere; }

/* SubSign admin on phones: nothing wider than the screen, 44px tap targets, nothing under 12px. */
@media (max-width: 640px) {
  .admin-shell .masthead-actions { flex-wrap: wrap; }
  .admin-shell .masthead-actions .btn { flex: 1 1 40%; min-height: 44px; }
  .admin-shell .ledger:has(> :nth-child(5)) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 0; }
  .admin-shell .ledger:has(> :nth-child(5)) .ledger-item:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
  .admin-shell .ledger dt { font-size: .78rem; }
  .admin-shell .masthead-back { min-height: 44px; margin-block: -8px; }
  .admin-shell .masthead h1 { white-space: normal; overflow: visible; text-overflow: clip; }
  .admin-shell .btn-sm, .admin-shell .btn { min-height: 44px; }
  .admin-shell .admin-row .row-main { flex: 1 1 100%; }
  .admin-shell .row-sub, .admin-shell .row-title { overflow-wrap: anywhere; }
  .admin-shell .admin-inline-input[class] { width: 100%; min-height: 44px; box-sizing: border-box; }
  .admin-shell .row-warn { padding: 8px 10px; }
  .admin-shell .row-warn .btn { width: 100%; justify-content: center; text-align: center; }
  .admin-shell .row-warn-list { width: 100%; }
  .admin-shell .row-warn-list li { display: grid; gap: 4px; }
  /* Companies: title and "Compact view" on one line, the search under them at full width. */
  .admin-shell .admin-companies .panel-tools { display: contents; }
  .admin-shell .admin-companies .panel-tools .btn { margin-left: auto; }
  .admin-shell .admin-companies .panel-tools .search { order: 3; flex: 1 1 100%; width: 100%; }
  .admin-shell .panel-head { flex-wrap: wrap; row-gap: 8px; }
  .admin-shell .panel-head > .search { flex: 1 1 100%; width: 100%; margin-left: 0; }
  .admin-shell .panel-head .search input[type=search] { min-height: 44px; font-size: 1rem; } /* 16px: iOS doesn't zoom in */
  .admin-shell .admin-plan-select, .admin-shell .admin-row select { min-height: 44px !important; }
  .admin-shell .admin-team-form input[type=email] { min-height: 44px; }
  .admin-shell .admin-link { display: inline-block; padding-block: 10px; margin-block: -10px; }
  .admin-shell .note-tip { width: 44px; height: 44px; margin: -9px -8px; }
  .admin-shell .tag { font-size: .78rem; }
  .admin-shell .org-badge { font-size: .75rem; }
  .admin-shell .check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
  .admin-shell .check-row input[type=checkbox] { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; }
  .admin-shell .perm-table { table-layout: fixed; }
  .admin-shell .perm-table thead th:not(:first-child) { width: 54px; }
  .admin-shell .perm-table th[scope="row"] { padding-right: 4px; overflow-wrap: anywhere; }
  .admin-shell .avatar { font-size: .78rem; }
  .admin-shell .perm-table td { padding-inline: 2px; }
  .admin-shell .perm-table thead th { font-size: .78rem; letter-spacing: 0; text-transform: none; padding-inline: 2px; }
  .admin-shell .perm-table td input[type=checkbox] { width: 22px; height: 22px; }
  /* Account button: the 30px circle stays, the tap area is 44px. */
  .avatar { position: relative; }
  .avatar::before { content: ""; position: absolute; inset: -7px; }
}

/* Counters on the tabs: agreements to approve, and what's waiting for SubSign's team. */
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px;
  background: #d92d20; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.shell .tab { position: relative; }
.panel-head .tab-count { margin-left: auto; }
@media (max-width: 640px) {
  .shell .tab .tab-count { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; box-shadow: 0 0 0 2px var(--navy-deep); }
}
@media (forced-colors: active) { .tab-count { border: 1px solid CanvasText; } }

/* Box editor: a flagged page with SubSign's answer boxes the company can move or resize. */
.app-dialog.box-editor { width: min(940px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.box-editor[open] { display: flex; }
.box-editor-body { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 24px); }
.box-editor-body > p { padding: 20px 24px; margin: 0; }
.box-editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; padding: 18px 24px 12px; border-bottom: 1px solid var(--line); }
.box-editor-head h2 { font-size: 1.1rem; margin: 0 0 4px; }
.box-editor-head p { margin: 2px 0 0; max-width: 60ch; }
.box-editor-pager { display: flex; align-items: center; gap: 8px; }
.box-editor-scroll { overflow: auto; background: #e9edf2; padding: 16px; flex: 1 1 auto; min-height: 0; }
.box-editor-stage-wrap { width: max-content; margin: 0 auto; }
.box-editor-stage { position: relative; box-shadow: 0 1px 4px rgba(11, 21, 38, .18); background: #fff; }
.box-editor-page { display: block; }
.box-handle { position: absolute; box-sizing: border-box; min-height: 0; padding: 0; margin: 0; border: 1.5px dashed #5b6778; border-radius: 3px;
  background: rgba(59, 130, 246, .08); cursor: move; touch-action: none; overflow: visible; font: inherit; color: inherit; }
.box-handle.flagged { border: 2px solid #d92d20; background: rgba(217, 45, 32, .1); }
.box-handle.moved { border-style: solid; border-color: #0f7b48; background: rgba(15, 123, 72, .12); }
.box-handle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.box-name { position: absolute; left: 0; bottom: 100%; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px;
  border-radius: 3px 3px 0 0; background: rgba(11, 21, 38, .78); color: #fff; font-size: .75rem; line-height: 1.5; pointer-events: none; }
.box-handle:not(:hover):not(:focus-visible):not(.flagged):not(.added) .box-name { display: none; }
.box-resize { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid currentColor; cursor: nwse-resize; }
.box-handle .box-resize { color: #5b6778; }
.box-handle.flagged .box-resize { color: #d92d20; }
.box-handle.moved .box-resize { color: #0f7b48; }
.box-editor-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 24px; border-top: 1px solid var(--line); }
.box-editor-foot .muted { margin-right: auto; }
@media (max-width: 640px) {
  .app-dialog.box-editor { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; margin: 0; }
  .box-editor-body { max-height: 100vh; height: 100%; }
  .box-editor-head, .box-editor-foot { padding-inline: 14px; }
  .box-editor-scroll { padding: 8px; }
  .box-resize { width: 22px; height: 22px; right: -11px; bottom: -11px; }
  .box-editor-foot .btn { flex: 1 1 auto; }
}
@media (forced-colors: active) { .box-handle { border-color: CanvasText; } .box-handle.flagged { border-color: Highlight; } }
.box-editor-stage.drawing { cursor: crosshair; }
.box-editor-stage.drawing .box-handle { pointer-events: none; opacity: .6; }
.box-ghost { position: absolute; border: 2px dashed var(--brand); background: rgba(29, 78, 216, .08); pointer-events: none; }
.box-handle.added { border: 2px solid #0f7b48; background: rgba(15, 123, 72, .14); }
.box-handle.added .box-name { background: #0f7b48; left: 14px; }
.box-handle.added .box-resize { color: #0f7b48; }
.box-remove { position: absolute; top: -10px; left: -10px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #0f7b48;
  color: #0f7b48; font-size: 14px; line-height: 15px; text-align: center; cursor: pointer; }
.box-picker { padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface-2, #f6f8fb); }
.box-picker p { margin: 0 0 8px; }
.box-picker-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.box-picker-row .input { min-width: 0; flex: 1 1 200px; }
.box-picker-row select.input:last-of-type { flex: 0 1 140px; }
.box-editor-pager [aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (max-width: 640px) { .box-picker { padding-inline: 14px; } .box-remove { width: 26px; height: 26px; top: -13px; left: -13px; line-height: 21px; } }

/* A page busy with something that can't be interrupted (deleting a company). */
.panel.working { display: grid; justify-items: center; gap: 6px; padding: 48px 24px; text-align: center; }
.working-text { margin: 10px 0 0; font-weight: 600; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* Admin: who is about to be deleted */
.delete-who { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.delete-who-logo { max-width: 72px; max-height: 48px; object-fit: contain; flex: none; }
.delete-who dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; min-width: 0; }
.delete-who dt { color: var(--muted); font-size: .85em; }
.delete-who dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .delete-who { flex-direction: column; gap: 10px; } }

/* Admin: Companies | Archive tabs */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 7px; background: none; color: var(--muted);
  font: inherit; font-weight: 600; cursor: pointer; }
.seg-btn:hover { color: var(--ink); }
.seg-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.seg-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(11 21 38 / 12%); }
.seg-count { font-size: .8em; font-weight: 600; min-width: 1.6em; padding: 1px 6px; border-radius: 99px; background: var(--line); color: var(--ink); text-align: center; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-danger hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
/* "What does this mean?" next to "In the agreement" */
.field-tools { display: inline-flex; gap: 14px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.explain { margin: 6px 0 2px; padding: 10px 12px; border-left: 3px solid var(--link); background: var(--soft, #f5f7fa); border-radius: 0 8px 8px 0; }
.explain p { margin: 0 0 6px; }
.explain p:last-child { margin-bottom: 0; }
.explain .statement { margin: 6px 0; }
@media (max-width: 560px) {
  .field-head:has(.field-tools) { flex-wrap: wrap; row-gap: 0; }
  .field-tools { width: 100%; justify-content: flex-start; order: 2; }
}

/* Admin: AI requests used today against the daily limit */
.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--link); border-radius: inherit; }
.meter-mid > span { background: #c98a00; }
.meter-high > span { background: var(--danger, #b42318); }
.meter-thin { display: block; height: 4px; margin-top: 4px; max-width: 320px; }
.ai-org-num { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; flex: none; }
@media (max-width: 560px) {
  .ai-orgs .list-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .ai-org-num { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 8px; text-align: left; }
}
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ai-model + .ai-model { padding-top: 10px; border-top: 1px solid var(--line); }

/* The agreement check's result: one line or one notice; details folded away. */
.check-line p { display: flex; align-items: center; gap: 6px; margin: 0; }
.check-line .icon { color: var(--brand); flex: none; }
.check-more { margin-top: 8px; }
.check-more ul { margin: 6px 0 0; padding-left: 20px; }
.check-more li + li { margin-top: 4px; }

/* The short interview (investor page): one ask and one answer box, fitted to the screen (no page scrollbar). */
.wiz.chat { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.wiz-body.chat-body { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; padding: 22px 20px calc(14px + env(safe-area-inset-bottom)); }
.chat-step { margin: 0; }
.chat-prompt { display: grid; gap: 10px; }
.chat-prompt p { margin: 0; }
.chat-ask { margin: 0; font-size: clamp(1.3rem, 1.1rem + 1vw, 1.6rem); line-height: 1.25; min-height: 1.25em; outline: none; }
.chat-items { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 1rem; line-height: 1.5; transition: opacity .35s ease; }
.chat-items.single { list-style: none; padding-left: 0; }
.chat-items.waiting { opacity: 0; }
.chat-body > * { flex-shrink: 0; }
.chat-form { flex: 1 0 auto; display: flex; flex-direction: column; gap: 6px; }
.chat-form > label { margin: 0; }
.wiz-body > form.chat-form { gap: 6px; }
.chat-box { flex: 1 0 auto; min-height: 128px; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1.5px solid var(--brand); border-radius: 10px; }
.chat-box.has-error { border-color: var(--danger); }
.chat-box:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.chat-form .chat-box textarea, .chat-form .chat-box textarea:focus { border: 0; outline: 0; box-shadow: none; border-radius: 0; }
.chat-box textarea { flex: 1; min-height: 56px; resize: none; padding: 0; width: 100%; font: inherit; font-size: 1rem; line-height: 1.45; color: var(--ink); background: transparent; }
.chat-box-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-mic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--field); background: var(--surface); color: var(--brand); cursor: pointer; }
.chat-mic:hover { background: var(--soft); }
.chat-mic.on { background: var(--danger); border-color: var(--danger); color: #fff; animation: chat-pulse 1.4s ease-in-out infinite; }
@keyframes chat-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--danger) 22%, transparent); } }
.chat-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chat-links .link-button { border: 0; background: none; padding: 10px 0; font: inherit; font-size: .925rem; font-weight: 550; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.chat-links .link-button.quiet { color: var(--muted); font-weight: 400; }
.chat-privacy { margin: 0; line-height: 1.45; }
.chat-reply p, .chat-note { margin: 0; }
.chat-understood { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
.chat-understood summary { cursor: pointer; font-size: .9rem; font-weight: 550; }
.chat-understood dl, .chat-confirm dl { margin: 8px 0 0; display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 4px 14px; font-size: .9rem; max-height: 30vh; overflow: auto; }
.chat-understood dt, .chat-confirm dt { color: var(--muted); }
.chat-understood dd, .chat-confirm dd { margin: 0; overflow-wrap: anywhere; }
.chat-confirm { display: grid; gap: 12px; }
.chat-confirm dl { max-height: 55vh; }
.chat-body > .chat-defaults { overflow-y: auto; min-height: 120px; flex: 0 1 auto; }
.chat-body > .wiz-nav { margin-top: auto; }
.review-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: .75rem; color: var(--muted); background: var(--soft); border: 1px solid var(--line); white-space: nowrap; }
/* "See an example": a panel at the side on a wide screen, a sheet from the bottom on a phone. */
.chat-sheet { margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(400px, 100%); border: 0; border-left: 1px solid var(--line); padding: 0; background: var(--surface); color: var(--ink); box-shadow: -12px 0 32px rgba(11, 21, 38, .16); }
.chat-sheet::backdrop { background: rgba(11, 21, 38, .32); }
.chat-sheet-body { display: grid; gap: 14px; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); align-content: start; }
.chat-sheet h2 { margin: 0; font-size: 1.1rem; }
.chat-sheet p { margin: 0; }
.chat-example { padding: 12px 14px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line); line-height: 1.5; white-space: pre-line; }
@media (max-width: 640px) {
  .chat-sheet { margin: auto 0 0; width: 100%; max-width: 100%; height: fit-content; max-height: 80dvh; overflow-y: auto; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -12px 32px rgba(11, 21, 38, .16); }
  .wiz-body.chat-body { padding: 16px 16px calc(12px + env(safe-area-inset-bottom)); gap: 12px; }
}
@media (min-width: 681px) { .wiz-body.chat-body { margin: 20px auto; padding: 28px 40px 22px; min-height: 0; max-height: 760px; } }
@media (prefers-reduced-motion: reduce) { .chat-items { transition: none; } .chat-mic.on { animation: none; } }
.chat-body > .wiz-nav .btn { white-space: nowrap; padding-inline: 14px; }
.chat-body > .wiz-nav > span:empty { display: none; }

/* The short interview on the company's agreement page. */
.plan-details > summary { cursor: pointer; font-weight: 550; }
.plan-stages { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 22px; }
.plan-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plan-items li { display: grid; gap: 2px; }
.interview-plan textarea { font: inherit; width: 100%; border: 1px solid var(--field); border-radius: 8px; padding: 9px 12px; resize: vertical; }
.interview-plan label.field-label-sm { display: grid; gap: 4px; }
.plan-stages { list-style: none; padding-left: 0; }
.plan-stages p { margin: 0; }
.plan-details > div { margin-top: 22px; }
.plan-items li .btn { justify-self: start; padding-left: 0; }
.plan-checks ul, .plan-fixed ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.plan-checks p { margin: 0; }
.plan-fixed summary { cursor: pointer; font-size: .9rem; }
