/* HouseFind Pro: agent workspace and signing pages. */
:root {
  --pro-bg: #f4f6f9;
  --pro-surface: #ffffff;
  --pro-ink: #16202e;
  --pro-muted: #5b6676;
  --pro-line: #dde2e9;
  --pro-accent: #1e56c8;
  --pro-accent-dark: #17449f;
  --pro-accent-soft: #e6eeff;
  --pro-sign: #c2410c;
  --pro-sign-soft: #fff1e8;
  --pro-ai: #6d3fc0;
  --pro-ai-soft: #f1ebfc;
  --pro-ok: #18794e;
  --pro-ok-soft: #e4f5ec;
  --pro-warn: #8a5d00;
  --pro-warn-soft: #fff6d6;
  --pro-danger: #b42318;
  --pro-danger-soft: #fdecea;
  --pro-bar: #16202e;
  --pro-bar-fg: #e8edf5;
  --pro-radius: 8px;
  --pro-font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pro-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body.pro {
  margin: 0; background: var(--pro-bg); color: var(--pro-ink);
  font-family: var(--pro-font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.pro a { color: var(--pro-accent); }
body.pro h1, body.pro h2, body.pro h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
body.pro h1 { font-size: 22px; font-weight: 750; letter-spacing: -.01em; }
body.pro h2 { font-size: 16px; font-weight: 700; }
body.pro h3 { font-size: 14px; font-weight: 700; }
body.pro p { margin: 0; }
.pro-muted { color: var(--pro-muted); }
.pro-mono { font-family: var(--pro-mono); font-size: 12px; }
.pro-small { font-size: 12.5px; }

/* top bar */
.pro-bar { background: var(--pro-bar); color: var(--pro-bar-fg); position: sticky; top: 0; z-index: 50; }
.pro-bar__inner { display: flex; align-items: center; gap: 20px; padding: 0 20px; min-height: 52px; flex-wrap: wrap; }
.pro-brand { font-weight: 800; letter-spacing: .01em; color: #fff !important; text-decoration: none; font-size: 15px; }
.pro-brand span { color: #8fb0ff; font-weight: 700; }
.pro-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.pro-nav a { color: var(--pro-bar-fg) !important; text-decoration: none; padding: 6px 12px; border-radius: 6px; opacity: .78; font-weight: 500; }
.pro-nav a:hover, .pro-nav a:focus-visible { opacity: 1; background: rgba(255,255,255,.08); outline: none; }
.pro-nav a[aria-current="page"] { opacity: 1; background: rgba(255,255,255,.14); }
.pro-bar__spacer { flex: 1; }
.pro-user { display: flex; gap: 12px; align-items: center; font-size: 13px; opacity: .9; }
.pro-user form { margin: 0; }
.pro-user button { background: none; border: 0; color: var(--pro-bar-fg); cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }

.pro-main { padding: 24px 20px 48px; max-width: 1280px; margin: 0 auto; display: grid; gap: 20px; }
.pro-main--wide { max-width: none; padding: 0; gap: 0; }
.pro-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pro-head__spacer { flex: 1; }

/* flash */
.pro-flash { padding: 10px 14px; border-radius: var(--pro-radius); font-weight: 500; }
.pro-flash--ok { background: var(--pro-ok-soft); color: var(--pro-ok); }
.pro-flash--error { background: var(--pro-danger-soft); color: var(--pro-danger); }
.pro-main--wide .pro-flash { border-radius: 0; }

/* buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--pro-line);
  background: var(--pro-surface); color: var(--pro-ink); font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; line-height: 1.3;
}
.btn:hover { border-color: #b9c2cf; }
.btn:focus-visible, .pro-input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--pro-accent); outline-offset: 1px; }
.btn--primary { background: var(--pro-accent); border-color: var(--pro-accent); color: #fff !important; }
.btn--primary:hover { background: var(--pro-accent-dark); border-color: var(--pro-accent-dark); }
.btn--ai { background: var(--pro-ai-soft); border-color: transparent; color: var(--pro-ai) !important; }
.btn--danger { color: var(--pro-danger) !important; }
.btn--sm { padding: 4px 9px; font-size: 12px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0; color: var(--pro-accent); cursor: pointer; font: inherit; text-decoration: underline; }
.btn-link--danger { color: var(--pro-danger); }

.pro-input, body.pro select, body.pro textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--pro-line); border-radius: 6px;
  background: var(--pro-surface); color: var(--pro-ink); font: inherit; font-size: 13.5px;
}
body.pro textarea { resize: vertical; min-height: 70px; }
.pro-field { display: grid; gap: 4px; }
.pro-field > span, .pro-label { font-size: 11.5px; font-weight: 600; color: var(--pro-muted); text-transform: uppercase; letter-spacing: .04em; }
.pro-form { display: grid; gap: 12px; }
.pro-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.inline-form { display: inline; margin: 0; }

/* cards and tables */
.pro-card { background: var(--pro-surface); border: 1px solid var(--pro-line); border-radius: 10px; padding: 18px; display: grid; gap: 14px; min-width: 0; }
.pro-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.pro-table-wrap { overflow-x: auto; background: var(--pro-surface); border: 1px solid var(--pro-line); border-radius: 10px; }
.pro-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pro-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--pro-muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--pro-line); background: #fafbfc; }
.pro-table td { padding: 12px 14px; border-bottom: 1px solid var(--pro-line); vertical-align: top; }
.pro-table tr:last-child td { border-bottom: 0; }
.pro-table a.row-link { color: var(--pro-ink); font-weight: 650; text-decoration: none; }
.pro-table a.row-link:hover { color: var(--pro-accent); }
.pro-empty { padding: 32px; text-align: center; color: var(--pro-muted); display: grid; gap: 10px; justify-items: center; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.pill--draft { background: var(--pro-accent-soft); color: var(--pro-accent); }
.pill--wait { background: var(--pro-warn-soft); color: var(--pro-warn); }
.pill--ok { background: var(--pro-ok-soft); color: var(--pro-ok); }
.pill--sign { background: var(--pro-sign-soft); color: var(--pro-sign); }
.pill--ai { background: var(--pro-ai-soft); color: var(--pro-ai); }
.pill--muted { background: #eef0f3; color: var(--pro-muted); }

.tabs-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs-filter a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--pro-line); background: var(--pro-surface); color: var(--pro-ink); text-decoration: none; font-weight: 550; font-size: 13px; }
.tabs-filter a[aria-current="true"] { background: var(--pro-ink); border-color: var(--pro-ink); color: #fff; }

.ai-start { background: linear-gradient(0deg, var(--pro-ai-soft), var(--pro-ai-soft)); border: 1px solid #e0d5f6; border-radius: 10px; padding: 16px; display: grid; gap: 10px; }
.ai-start textarea { min-height: 84px; }

/* login */
.pro-auth { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.pro-auth__card { width: min(420px, 100%); background: var(--pro-surface); border: 1px solid var(--pro-line); border-radius: 12px; padding: 28px; display: grid; gap: 16px; }
.pro-auth__demo { background: var(--pro-accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; }

/* deal workspace */
.deal { display: grid; grid-template-columns: 320px minmax(0, 1fr) 340px; height: calc(100vh - 52px); min-height: 560px; }
.deal__side { background: var(--pro-surface); border-right: 1px solid var(--pro-line); overflow-y: auto; padding: 16px; display: grid; gap: 18px; align-content: start; }
.deal__center { overflow: auto; background: #e9edf2; min-width: 0; position: relative; }
.deal__chat { background: var(--pro-surface); border-left: 1px solid var(--pro-line); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.deal-section { display: grid; gap: 8px; }
.deal-section__head { display: flex; align-items: center; gap: 8px; }
.deal-section__head h2 { flex: 1; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--pro-muted); }
.deal-title { display: grid; gap: 4px; }
.party { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 10px; border: 1px solid var(--pro-line); border-radius: 8px; }
.party b { font-weight: 650; }
.party small { color: var(--pro-muted); grid-column: 1; overflow-wrap: anywhere; }
.party form { grid-row: 1 / span 3; grid-column: 2; align-self: center; }
.kv { display: grid; gap: 8px; }
.kv label { display: grid; gap: 3px; }
.kv label > span { font-size: 11.5px; color: var(--pro-muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.kv input.is-ai, .kv textarea.is-ai { border-color: #b9a2ea; background: var(--pro-ai-soft); }
.kv input.is-missing { border-color: #e2c26b; background: var(--pro-warn-soft); }
.kv .computed { padding: 7px 10px; border: 1px dashed var(--pro-line); border-radius: 6px; color: var(--pro-muted); background: #fafbfc; }
.save-state { font-size: 11px; color: var(--pro-ok); font-weight: 600; }
.doc-list { display: grid; gap: 4px; }
.doc-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; cursor: pointer; border: 1px solid transparent; background: none; text-align: left; font: inherit; color: inherit; width: 100%; }
.doc-item:hover { background: #f4f6f9; }
.doc-item[aria-pressed="true"] { background: var(--pro-accent-soft); border-color: #c8d7fb; }
.doc-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.issues { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.issues li { font-size: 12.5px; padding: 6px 9px; border-radius: 6px; }
.issues .error { background: var(--pro-danger-soft); color: var(--pro-danger); }
.issues .warning { background: var(--pro-warn-soft); color: var(--pro-warn); }
.signer-row { display: grid; gap: 4px; padding: 9px 10px; border: 1px solid var(--pro-line); border-radius: 8px; }
.signer-row__top { display: flex; gap: 8px; align-items: center; }
.signer-row__top b { flex: 1; }
.copy-row { display: flex; gap: 6px; }
.copy-row input { font-family: var(--pro-mono); font-size: 11px; }
details.pro-details > summary { cursor: pointer; font-weight: 600; color: var(--pro-accent); list-style: none; }
details.pro-details > summary::-webkit-details-marker { display: none; }
details.pro-details[open] > summary { margin-bottom: 10px; }
.activity { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; font-size: 12px; }
.activity div { display: grid; gap: 1px; padding-bottom: 6px; border-bottom: 1px solid #eef0f3; }
.activity time { color: var(--pro-muted); font-size: 11px; }

.doc-toolbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: rgba(233, 237, 242, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--pro-line); }
.doc-toolbar__title { font-weight: 700; flex: 1; min-width: 0; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--pro-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; border: 1.5px solid; }
.legend .l-agent { border-color: #3b6fd8; background: #eef3ff; }
.legend .l-ai { border-color: #7a4fd0; background: #f4eeff; }
.legend .l-missing { border-color: #c29400; background: #fff7d6; }
.legend .l-sign { border-color: #d0541a; background: #fff2ea; }
.pages { display: grid; gap: 16px; justify-items: center; padding: 16px 16px 48px; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .12), 0 6px 18px rgba(16, 24, 40, .08); max-width: 100%; }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.pdf-overlay { position: absolute; inset: 0; }
.pdf-page__num { position: absolute; top: -1px; right: -1px; transform: translateY(-100%); font-size: 11px; color: var(--pro-muted); }
.pdf-loading { padding: 40px; text-align: center; color: var(--pro-muted); }

/* fields over the PDF */
.fld {
  position: absolute; border: 1.5px solid #3b6fd8; background: rgba(238, 243, 255, .82); border-radius: 2px;
  font-family: Arial, Helvetica, sans-serif; color: #123d8f; overflow: hidden; display: flex; align-items: center;
  padding: 0 3px; line-height: 1.05; cursor: default; white-space: nowrap;
}
.fld--multiline { align-items: flex-start; white-space: pre-wrap; padding-top: 2px; }
.fld--ai { border-color: #7a4fd0; background: rgba(244, 238, 255, .88); color: #4f2c97; }
.fld--missing { border-color: #c29400; background: rgba(255, 247, 214, .9); color: #6e5100; }
.fld--sign { border-color: #d0541a; background: rgba(255, 242, 234, .9); color: #a53c0a; justify-content: center; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.fld--signer { border-style: dashed; }
.fld--checkbox { justify-content: center; font-weight: 800; }
.fld--editable { cursor: text; }
.fld--editable.fld--checkbox { cursor: pointer; }
.fld--editable:hover { box-shadow: 0 0 0 2px rgba(30, 86, 200, .25); }
.fld--done { border-color: #18794e; background: rgba(228, 245, 236, .92); color: #0f5132; }
.fld--done img { max-width: 100%; max-height: 100%; }
.fld--current { box-shadow: 0 0 0 3px rgba(194, 65, 12, .35); animation: pulse 1.6s ease-in-out infinite; }
.fld--readonly { border-color: transparent; background: transparent; color: #12265c; }
.fld input, .fld textarea { width: 100%; height: 100%; border: 0; background: #fff; font: inherit; color: inherit; padding: 0 2px; outline: none; }
.fld textarea { resize: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(194, 65, 12, .12); } }
@media (prefers-reduced-motion: reduce) { .fld--current { animation: none; } }

/* chat */
.chat__head { padding: 12px 14px; border-bottom: 1px solid var(--pro-line); display: flex; align-items: center; gap: 8px; }
.chat__head h2 { flex: 1; font-size: 14px; }
.chat__log { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 9px 11px; border-radius: 10px; max-width: 92%; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.msg--user { align-self: flex-end; background: var(--pro-accent); color: #fff; border-bottom-right-radius: 3px; }
.msg--assistant { align-self: flex-start; background: var(--pro-ai-soft); border-bottom-left-radius: 3px; }
.msg--error { align-self: stretch; background: var(--pro-danger-soft); color: var(--pro-danger); max-width: none; }
.msg ul { margin: 6px 0 0; padding-left: 18px; white-space: normal; }
.msg--pending { color: var(--pro-muted); font-style: italic; }
.chat__compose { border-top: 1px solid var(--pro-line); padding: 10px; display: grid; gap: 8px; }
.chat__compose textarea { min-height: 64px; max-height: 200px; }
.chat__actions { display: flex; gap: 8px; align-items: center; }
.chat__actions .hint { flex: 1; font-size: 11.5px; color: var(--pro-muted); }
.mic { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--pro-ai); color: #fff; cursor: pointer; display: grid; place-items: center; }
.mic svg { width: 16px; height: 16px; }
.mic[aria-pressed="true"] { background: var(--pro-danger); animation: pulse 1.2s infinite; }
.chat__suggest { display: flex; gap: 6px; flex-wrap: wrap; }
.chat__suggest button { border: 1px solid #e0d5f6; background: #fff; color: var(--pro-ai); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }

/* template editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: calc(100vh - 52px); min-height: 560px; }
.editor__pages { overflow: auto; background: #e9edf2; }
.editor__side { background: var(--pro-surface); border-left: 1px solid var(--pro-line); overflow-y: auto; padding: 16px; display: grid; gap: 16px; align-content: start; }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.palette button { border: 1px solid var(--pro-line); background: #fff; border-radius: 6px; padding: 7px 8px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.palette button[aria-pressed="true"] { border-color: var(--pro-accent); background: var(--pro-accent-soft); color: var(--pro-accent); font-weight: 650; }
.editor .pdf-overlay { cursor: crosshair; }
.efld { position: absolute; border: 1.5px solid #3b6fd8; background: rgba(238, 243, 255, .6); font: 10px/1.1 Arial, sans-serif; color: #123d8f; overflow: hidden; padding: 1px 3px; cursor: move; white-space: nowrap; }
.efld--sign { border-color: #d0541a; background: rgba(255, 242, 234, .7); color: #a53c0a; }
.efld--signer { border-style: dashed; }
.efld--new { border-color: #7a4fd0; background: rgba(244, 238, 255, .7); color: #4f2c97; }
.efld[aria-selected="true"] { box-shadow: 0 0 0 2px #16202e; z-index: 2; }
.efld__handle { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; background: #16202e; cursor: nwse-resize; }
.drag-box { position: absolute; border: 1.5px dashed var(--pro-accent); background: rgba(30, 86, 200, .08); pointer-events: none; }
.prop-grid { display: grid; gap: 10px; }
.field-list { display: grid; gap: 2px; max-height: 300px; overflow-y: auto; font-size: 12.5px; }
.field-list button { display: flex; gap: 8px; border: 0; background: none; padding: 5px 6px; border-radius: 5px; text-align: left; font: inherit; cursor: pointer; }
.field-list button:hover { background: #f4f6f9; }
.field-list button span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--pro-ai); width: 0; transition: width .3s; }

/* signing page */
body.sign { background: var(--pro-bg); }
.sign-bar { background: var(--pro-bar); color: var(--pro-bar-fg); position: sticky; top: 0; z-index: 30; }
.sign-bar__inner { max-width: 1000px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sign-bar__brand { font-weight: 800; flex: 1; min-width: 0; }
.sign-bar__brand small { display: block; font-weight: 500; opacity: .75; }
.sign-wrap { max-width: 1000px; margin: 0 auto; padding: 20px 16px 120px; display: grid; gap: 16px; }
.sign-card { background: var(--pro-surface); border: 1px solid var(--pro-line); border-radius: 12px; padding: 22px; display: grid; gap: 14px; }
.consent-text { max-height: 300px; overflow-y: auto; border: 1px solid var(--pro-line); border-radius: 8px; padding: 14px; display: grid; gap: 10px; font-size: 13.5px; background: #fafbfc; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-weight: 550; }
.check-line input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.sign-progress { position: fixed; left: 0; right: 0; bottom: 0; background: var(--pro-surface); border-top: 1px solid var(--pro-line); z-index: 30; box-shadow: 0 -6px 18px rgba(16, 24, 40, .08); }
.sign-progress__inner { max-width: 1000px; margin: 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sign-progress__text { flex: 1; min-width: 160px; font-weight: 600; }
.sign-doc-title { font-weight: 700; padding: 6px 2px; }
.modal { position: fixed; inset: 0; background: rgba(16, 24, 40, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.modal__card { width: min(560px, 100%); background: var(--pro-surface); border-radius: 12px; padding: 20px; display: grid; gap: 12px; }
.modal__tabs { display: flex; gap: 6px; }
.pad { border: 1.5px dashed var(--pro-sign); border-radius: 8px; background: #fffaf6; touch-action: none; width: 100%; height: 170px; display: block; }
.typed-preview { font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive; font-size: 40px; color: #0c2a6b; min-height: 64px; display: flex; align-items: center; padding: 0 8px; border: 1.5px dashed var(--pro-sign); border-radius: 8px; background: #fffaf6; overflow: hidden; white-space: nowrap; }
.sign-done { text-align: center; justify-items: center; }
.sign-done svg { width: 56px; height: 56px; color: var(--pro-ok); }

@media (max-width: 1100px) {
  .deal { grid-template-columns: 300px minmax(0, 1fr); height: auto; }
  .deal__chat { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--pro-line); height: 520px; }
  .deal__center { min-height: 70vh; }
}
@media (max-width: 760px) {
  .deal, .editor { grid-template-columns: minmax(0, 1fr); height: auto; }
  .deal__side { border-right: 0; border-bottom: 1px solid var(--pro-line); }
  .deal__center, .editor__pages { min-height: 60vh; max-height: 80vh; }
  .editor__side { border-left: 0; }
  .pro-bar__inner { padding: 8px 14px; gap: 10px; }
  .pro-main { padding: 16px 14px 40px; }
}

/* Keep long template names and messages inside the deal side column. */
.deal__side { overflow-x: hidden; }
.deal__side > *, .deal-section > *, .copy-row > * { min-width: 0; }
.deal__side select { max-width: 100%; }

/* Signature styles (OFL fonts vendored in /fonts/signature). */
@font-face { font-family: "HF Great Vibes"; src: url("/fonts/signature/Great-Vibes.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "HF Dancing Script"; src: url("/fonts/signature/Dancing-Script.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "HF Sacramento"; src: url("/fonts/signature/Sacramento.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "HF Caveat"; src: url("/fonts/signature/Caveat.woff2") format("woff2"); font-weight: 600; font-display: swap; }
.modal__card { max-height: calc(100vh - 32px); overflow-y: auto; }
.style-list { display: grid; gap: 8px; }
.style-option {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 0 12px;
  border: 1.5px solid var(--pro-line); border-radius: 10px; background: #fffdfa; padding: 8px 14px; cursor: pointer; text-align: left; font: inherit; color: #0c2a6b;
}
.style-option[aria-checked="true"] { border-color: var(--pro-sign); box-shadow: 0 0 0 3px rgba(194, 65, 12, .15); background: var(--pro-sign-soft); }
.style-option__sig { font-size: 34px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.style-option__ini { font-size: 30px; line-height: 1.25; grid-row: 1; grid-column: 2; }
.style-option__label { grid-column: 1 / -1; font-family: var(--pro-font); font-size: 11.5px; color: var(--pro-muted); text-transform: uppercase; letter-spacing: .05em; }
.fld--optional { border-color: #9aa6b6; background: rgba(255, 255, 255, .85); }

/* Document builder */
.builder { display: grid; grid-template-columns: 470px minmax(0, 1fr); height: calc(100vh - 52px); min-height: 560px; }
.builder__side { background: var(--pro-surface); border-right: 1px solid var(--pro-line); overflow-y: auto; padding: 16px; display: grid; gap: 16px; align-content: start; }
.builder__side > * { min-width: 0; }
.builder__preview { overflow: auto; background: #e9edf2; min-width: 0; }
.builder__save { position: sticky; bottom: -16px; background: var(--pro-surface); padding: 12px 0 16px; border-top: 1px solid var(--pro-line); display: grid; gap: 6px; }
.role-checks { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; }
.role-checks label { display: inline-flex; gap: 5px; align-items: center; }
.blocks { display: grid; gap: 8px; }
.block { border: 1px solid var(--pro-line); border-radius: 9px; padding: 10px; display: grid; gap: 8px; background: #fbfcfd; }
.block[data-type="checkbox"], .block[data-type="choice"] { border-left: 3px solid var(--pro-sign); }
.block[data-type="signatures"] { border-left: 3px solid var(--pro-sign); background: var(--pro-sign-soft); }
.block[data-type="heading"] { border-left: 3px solid var(--pro-ink); }
.block[data-type="field"], .block[data-type="fields"] { border-left: 3px solid var(--pro-accent); }
.block__head { display: flex; align-items: center; gap: 6px; }
.block__type { flex: 1; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pro-muted); }
.block__head button { border: 0; background: none; cursor: pointer; color: var(--pro-muted); font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.block__head button:hover { background: #eef0f3; color: var(--pro-ink); }
.block__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.block__grid > * { min-width: 0; }
.block textarea { min-height: 54px; font-size: 13px; }
.block .pro-input, .block select { font-size: 12.5px; padding: 5px 8px; }
.block .item { display: grid; gap: 6px; padding: 8px; border: 1px dashed var(--pro-line); border-radius: 7px; }
.add-row { display: flex; flex-wrap: wrap; gap: 4px; }
.add-row button { border: 1px dashed #b9c2cf; background: none; border-radius: 6px; padding: 3px 8px; font: inherit; font-size: 11.5px; color: var(--pro-muted); cursor: pointer; }
.add-row button:hover { border-color: var(--pro-accent); color: var(--pro-accent); }
.block .add-row { opacity: .55; }
.block:hover .add-row, .block:focus-within .add-row { opacity: 1; }
.pfld { position: absolute; border: 1.5px solid #3b6fd8; background: rgba(238, 243, 255, .55); font: 8px/1.1 Arial, sans-serif; color: #123d8f; overflow: hidden; padding: 0 2px; white-space: nowrap; pointer-events: none; }
.pfld--party { border-color: #d0541a; background: rgba(255, 242, 234, .6); color: #a53c0a; }
@media (max-width: 960px) {
  .builder { grid-template-columns: minmax(0, 1fr); height: auto; }
  .builder__side { border-right: 0; border-bottom: 1px solid var(--pro-line); }
  .builder__preview { min-height: 70vh; }
}

/* Google sign-in, welcome steps */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 14px;
  background: #fff; color: #1f1f1f !important; border: 1px solid #747775; border-radius: 6px;
  font-weight: 600; font-size: 14px; text-decoration: none !important;
}
.btn-google:hover { background: #f6f8fb; }
.btn-google:focus-visible { outline: 2px solid var(--pro-accent); outline-offset: 2px; }
.pro-auth__hint { margin-top: -6px !important; }
.pro-auth__or { display: flex; align-items: center; gap: 12px; color: var(--pro-muted); font-size: 12.5px; }
.pro-auth__or::before, .pro-auth__or::after { content: ""; flex: 1; height: 1px; background: var(--pro-line); }
.pro-welcome { width: min(600px, 100%); margin: 16px auto 0; display: grid; gap: 20px; }
.pro-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pro-steps li { display: flex; align-items: center; gap: 8px; color: var(--pro-muted); font-weight: 600; font-size: 13px; }
.pro-steps li + li::before { content: ""; width: 28px; height: 1px; background: var(--pro-line); margin-right: 2px; }
.pro-steps b { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 12px; }
.pro-steps li[aria-current] { color: var(--pro-accent); }
.pro-steps li[aria-current] b { background: var(--pro-accent); border-color: var(--pro-accent); color: #fff; }
.pro-steps li.is-done { color: var(--pro-ok); }

/* templates: drop zone, recognition result, starter documents */
.dropzone { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 34px 16px; border: 2px dashed #b9c2cf; border-radius: 10px; background: #fafbfc; cursor: pointer; }
.dropzone b { font-size: 15px; }
.dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--pro-accent); background: var(--pro-accent-soft); }
.dropzone.is-busy { cursor: progress; opacity: .7; }
.dropzone [data-status]:not(:empty) { margin-top: 6px; font-weight: 600; color: var(--pro-accent); }
.recognized { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; border: 1px solid var(--pro-line); border-radius: 10px; padding: 16px; }
.recognized__thumb canvas { width: 100%; height: auto; display: block; border: 1px solid var(--pro-line); border-radius: 4px; box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.recognized__file { aspect-ratio: 8.5 / 11; display: grid; place-items: center; border: 1px solid var(--pro-line); border-radius: 4px; background: #fafbfc; font-weight: 800; color: var(--pro-muted); letter-spacing: .06em; }
.recognized__body { display: grid; gap: 12px; min-width: 0; }
.recognized__head, .recognized__parties, .recognized__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.recognized__facts { display: flex; gap: 22px; flex-wrap: wrap; margin: 0; }
.recognized__facts dt { font-size: 11.5px; font-weight: 600; color: var(--pro-muted); text-transform: uppercase; letter-spacing: .04em; }
.recognized__facts dd { margin: 0; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.recognized__reason { background: var(--pro-accent-soft); border-radius: 8px; padding: 9px 12px; }
.intake__paste summary { cursor: pointer; color: var(--pro-accent); font-weight: 600; font-size: 13px; }
.intake__paste form { margin-top: 12px; }
.starters { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.starter { border: 1px solid var(--pro-line); border-radius: 8px; padding: 14px; display: grid; gap: 8px; align-content: start; justify-items: start; margin: 0; }
.starter__head { display: flex; gap: 8px; align-items: start; justify-content: space-between; width: 100%; }
.starter__roles { color: var(--pro-sign); font-weight: 600; }
@media (max-width: 640px) { .recognized { grid-template-columns: minmax(0, 1fr); } .recognized__thumb { max-width: 180px; } }
