/* BluMatrix proposal portal.
   Brand tokens: navy #003459, cyan #22B6DB, Montserrat. One bold element per page: the navy title band
   with its terms strip; everything below stays quiet so the documents and the conversation lead. */
:root {
  --navy: #003459;
  --navy-2: #0B4A75;
  --cyan: #22B6DB;
  --cyan-ink: #0E7FA0;
  --paper: #F5F8FA;
  --surface: #FFFFFF;
  --ink: #003459;
  --steel: #4F6476;
  --line: #D6E2EA;
  --soft: #E8F3F8;
  --good: #1B7F4B;
  --warn: #9A5B00;
  --bad: #A4262C;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "Montserrat", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6; }
a { color: var(--cyan-ink); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0 0 12px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }

/* ---------- top bar ---------- */
.topbar { background: var(--navy); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 46px; width: auto; display: block; }
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #CFE3EF; }
.topbar form { margin: 0; }
.linklike { background: none; border: 0; color: #fff; font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; }

/* ---------- the title band (the one bold element) ---------- */
.band { background: var(--navy); color: #fff; padding: 28px 0 0; border-bottom: 6px solid var(--cyan); }
.band .for { color: var(--cyan); font-weight: 600; font-size: 15px; margin: 0 0 10px; }
.band h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; letter-spacing: -0.02em; max-width: 20ch; text-wrap: balance; }
.band .summary { color: #CFE3EF; max-width: 64ch; margin: 16px 0 0; font-size: 17px; }
.terms { display: flex; flex-wrap: wrap; margin: 28px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(255,255,255,.18); }
.terms li { padding: 14px 22px 16px 0; margin-right: 22px; border-right: 1px solid rgba(255,255,255,.18); font-weight: 600; font-size: 15px; }
.terms li:last-child { border-right: 0; }

/* ---------- layout ---------- */
.page { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; padding: 32px 0 72px; align-items: start; }
.notice { background: var(--soft); border-left: 4px solid var(--cyan); padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 20px; }
.notice.error { background: #FBECEC; border-left-color: var(--bad); }

.binder section { margin-bottom: 30px; }
.binder h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.binder h2 small { font-weight: 500; color: var(--steel); font-size: 14px; margin-left: 8px; }
.docs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.doc { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--line); }
.doc:first-child { border-top: 0; }
.doc .type { width: 48px; height: 56px; border: 1.5px solid var(--line); border-radius: 4px 12px 4px 4px; display: grid; place-items: end center; padding-bottom: 6px; font-size: 11px; font-weight: 700; color: var(--steel); background: linear-gradient(var(--soft), var(--soft)) top/100% 14px no-repeat, #fff; }
.doc .type[data-kind="PDF"] { color: var(--bad); }
.doc .type[data-kind="Word"] { color: #1F5FAD; }
.doc .type[data-kind="Excel"] { color: var(--good); }
.doc .type[data-kind="PowerPoint"] { color: #B4501E; }
.doc h3 { font-size: 16px; font-weight: 700; }
.doc p { margin: 3px 0 0; color: var(--steel); font-size: 14px; }
.doc .meta { font-size: 13px; color: var(--steel); margin-top: 4px; }
.doc .actions { display: flex; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-s);
  border: 1.5px solid var(--navy); background: var(--navy); color: #fff; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn.quiet { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--navy); color: var(--navy); }
.btn.accent { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }
.btn.accent:hover { background: #4CC6E5; }
.btn.danger { background: #fff; color: var(--bad); border-color: #E7B9BB; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }

/* ---------- signing card ---------- */
.signcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; margin-top: 12px; }
.signcard h3 { font-size: 17px; margin-bottom: 6px; }
.track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 16px 0 18px; padding: 0; list-style: none; counter-reset: step; }
.track li { position: relative; padding-top: 26px; font-size: 13px; color: var(--steel); }
.track li::before { content: ""; position: absolute; top: 6px; left: 0; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.track li::after { content: ""; position: absolute; top: 12px; left: 16px; right: 4px; height: 2px; background: var(--line); }
.track li:last-child::after { display: none; }
.track li.done { color: var(--navy); font-weight: 600; }
.track li.done::before { background: var(--cyan); border-color: var(--cyan); }
.track li.done::after { background: var(--cyan); }
.signcard .buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.status-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--soft); color: var(--navy); }
.status-pill.completed { background: #E3F4EA; color: var(--good); }
.status-pill.declined, .status-pill.voided { background: #FBECEC; color: var(--bad); }

/* ---------- chat ---------- */
.chat { position: sticky; top: 20px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--radius-m);
  display: flex; flex-direction: column; max-height: calc(100vh - 40px); min-height: 460px; }
.chat header { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.chat header h2 { font-size: 17px; }
.chat header p { font-size: 13px; color: var(--steel); margin: 4px 0 0; }
.log { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { font-size: 15px; line-height: 1.55; }
.msg.you { align-self: flex-end; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; max-width: 88%; }
.msg.bot { align-self: stretch; }
.msg.bot p { margin: 0 0 8px; }
.msg.bot ul { margin: 0 0 8px; padding-left: 20px; }
.msg.bot sup a { font-size: 11px; font-weight: 700; text-decoration: none; background: var(--soft); padding: 0 5px; border-radius: 3px; margin-left: 1px; }
.cites { margin: 6px 0 0; padding: 0; list-style: none; border-left: 2px solid var(--line); }
.cites li { font-size: 12.5px; color: var(--steel); padding: 2px 0 2px 10px; }
.cites li a { font-weight: 600; }
.msg .follow { margin-top: 8px; font-size: 13px; }
.thinking { color: var(--steel); font-size: 14px; }
.thinking::after { content: ""; display: inline-block; width: 1em; animation: dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.starters { display: flex; flex-direction: column; gap: 6px; }
.starters button { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px; font: inherit; font-size: 14px; color: var(--navy); cursor: pointer; }
.starters button:hover { border-color: var(--cyan); }
.ask { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 8px; align-items: flex-end; }
.ask textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink); }
.ask textarea:focus { border-color: var(--cyan); outline: none; }
.chat .fine { font-size: 12px; color: var(--steel); padding: 0 14px 12px; margin: 0; }

/* ---------- forms, dialogs ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
input[type=text], input[type=email], textarea, select { width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink); background: #fff; }
input:focus, textarea:focus, select:focus { border-color: var(--cyan); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 5px; }
.hint { font-size: 13px; color: var(--steel); margin-top: 4px; }
dialog { border: 0; border-radius: var(--radius-m); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 52, 89, .28); color: var(--ink); }
dialog::backdrop { background: rgba(0, 32, 56, .55); }
dialog form { padding: 24px; }
dialog h2 { font-size: 20px; margin-bottom: 6px; }
dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- sign-in ---------- */
.gate { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 1.1fr 1fr; }
.gate .left { background: var(--navy); color: #fff; padding: 64px clamp(24px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; border-right: 6px solid var(--cyan); }
.gate .left .for { color: var(--cyan); font-weight: 600; }
.gate .left h1 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 16px; max-width: 18ch; }
.gate .left p { color: #CFE3EF; max-width: 46ch; }
.gate .right { padding: 64px clamp(24px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; max-width: 560px; }
.gate h2 { font-size: 24px; margin-bottom: 8px; }
.code-input { font-size: 28px !important; letter-spacing: .4em; text-align: center; font-weight: 700; }

/* ---------- preview ---------- */
.preview-bar { background: #fff; border-bottom: 1px solid var(--line); }
.preview-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.preview-bar h1 { font-size: 18px; }
.paper { background: #fff; max-width: 860px; margin: 28px auto 64px; padding: clamp(24px, 5vw, 64px); border: 1px solid var(--line); border-radius: var(--radius-m); }
.paper table { border-collapse: collapse; width: 100%; margin: 12px 0 20px; font-size: 14px; }
.paper td, .paper th { border: 1px solid var(--line); padding: 7px 10px; vertical-align: top; text-align: left; }
.paper th, .paper tr:first-child td { background: var(--soft); font-weight: 600; }
.paper h1 { font-size: 30px; margin: 0 0 14px; }
.paper h2 { font-size: 21px; margin: 28px 0 10px; }
.paper h3 { font-size: 17px; margin: 20px 0 8px; }
.paper p, .paper li { max-width: 72ch; }
.paper img { max-width: 100%; height: auto; }
.table-wrap { overflow-x: auto; }
.sheet-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sheet-tabs a { padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; font-size: 14px; }
.pdf-frame { width: 100%; height: calc(100vh - 60px); border: 0; display: block; background: #525659; }

/* ---------- admin ---------- */
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 32px 0 16px; flex-wrap: wrap; }
.admin-head h1 { font-size: 30px; font-weight: 800; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; margin-bottom: 24px; }
.panel h2 { font-size: 19px; margin-bottom: 4px; }
.panel > p.hint { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 700; color: var(--steel); font-size: 13px; padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
.inline { display: inline; margin: 0; }
.doc-edit { border-top: 1px solid var(--line); padding: 14px 0; }
.doc-edit:first-of-type { border-top: 0; }
.doc-edit summary { cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; list-style: none; }
.doc-edit summary::-webkit-details-marker { display: none; }
.doc-edit summary .t { font-weight: 700; }
.doc-edit summary .m { font-size: 13px; color: var(--steel); }
.stat { font-size: 13px; color: var(--steel); }
.stat b { color: var(--navy); font-size: 15px; }
.copy { display: flex; gap: 8px; }
.copy input { font-size: 14px; }
.qa { border-top: 1px solid var(--line); padding: 14px 0; }
.qa:first-child { border-top: 0; }
.qa .q { font-weight: 700; }
.qa .a { color: var(--steel); font-size: 14px; white-space: pre-wrap; margin-top: 4px; }
.flag { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 4px; background: #FFF3DC; color: var(--warn); margin-left: 6px; }

/* ---------- mock DocuSign ---------- */
.mockds-bar { background: #fff; border-bottom: 3px solid #FFCC22; }
.mockds-bar .wrap { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mockds-note { background: #FFF8DB; padding: 10px 0; font-size: 14px; }

footer.site { color: var(--steel); font-size: 13px; padding: 24px 0 40px; border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .page { grid-template-columns: 1fr; }
  .chat { position: static; max-height: none; }
  .gate { grid-template-columns: 1fr; }
  .gate .left { border-right: 0; border-bottom: 6px solid var(--cyan); padding: 40px 20px; }
  .gate .right { padding: 32px 20px 48px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .doc { grid-template-columns: 40px minmax(0, 1fr); }
  .doc .type { width: 40px; height: 48px; }
  .doc .actions { grid-column: 1 / -1; }
  .doc .actions .btn { flex: 1; }
  .terms li { border-right: 0; padding-right: 0; width: 100%; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .track { grid-template-columns: 1fr; gap: 8px; }
  .track li::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.jump-chat { display: none; }
@media (max-width: 980px) { .jump-chat { display: inline-flex; margin-top: 18px; } }

/* admin list filters */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.filters input[type=search] { max-width: 320px; }
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 3px; }
.tabs a { padding: 6px 12px; border-radius: 4px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--navy); }
.tabs a span { color: var(--steel); font-weight: 500; margin-left: 4px; }
.tabs a[aria-current="page"] { background: var(--navy); color: #fff; }
.tabs a[aria-current="page"] span { color: #CFE3EF; }
.status-pill.live { background: #E3F4EA; color: var(--good); }
.status-pill.draft { background: var(--soft); color: var(--steel); }
.status-pill.expired, .status-pill.archived { background: #F1F1F1; color: var(--steel); }

/* ---------- client proposal page ---------- */
.hero { background: var(--navy); color: #fff; border-bottom: 6px solid var(--cyan); padding: 40px 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; padding-bottom: 32px; }
.hero .for { color: var(--cyan); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; }
.hero h1 { font-size: clamp(30px, 4.2vw, 48px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; max-width: 22ch; text-wrap: balance; }
.hero .summary { color: #CFE3EF; max-width: 64ch; margin: 16px 0 0; font-size: 17px; }
.contact-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius-m); padding: 18px 20px; font-size: 14px; }
.contact-card .label { color: #8FB0C6; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; }
.contact-card .name { font-weight: 700; font-size: 16px; margin: 0 0 2px; }
.contact-card a { color: var(--cyan); word-break: break-all; }
.contact-card .until { color: #8FB0C6; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
.facts { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.facts li { padding: 16px 28px 18px 0; margin-right: 28px; border-right: 1px solid rgba(255, 255, 255, .14); font-weight: 600; font-size: 15px; }
.facts li:last-child { border-right: 0; }

.nextstep { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: var(--radius-m); padding: 22px 24px; margin-bottom: 32px;
  box-shadow: 0 1px 2px rgba(0, 52, 89, .04), 0 8px 24px rgba(0, 52, 89, .05); }
.nextstep .label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan-ink); margin: 0 0 6px; }
.nextstep h2 { font-size: 20px; margin-bottom: 6px; }
.nextstep .hint { margin: 0; font-size: 14px; }
.nextstep .buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.docgroup { margin-bottom: 28px; }
.docgroup h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--steel); margin-bottom: 10px; }
.docgroup h2 span { font-weight: 600; color: #9AB0C0; margin-left: 4px; }
.docs { box-shadow: 0 1px 2px rgba(0, 52, 89, .03); }
.doc { transition: background .15s; }
.doc:hover { background: #FAFCFD; }
.doc h3 a { color: var(--navy); text-decoration: none; }
.doc h3 a:hover { color: var(--cyan-ink); text-decoration: underline; }
.doc-body { min-width: 0; }
.doc-body p { overflow-wrap: anywhere; }
.empty { color: var(--steel); }

/* the chat: a fixed-height panel that scrolls inside itself, however long the answers */
.chat { position: sticky; top: 20px; height: calc(100vh - 40px); max-height: 780px; min-height: 0; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 52, 89, .04), 0 12px 32px rgba(0, 52, 89, .07); }
.chat header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.chat-close { display: none; background: none; border: 0; font-size: 28px; line-height: 1; color: var(--steel); cursor: pointer; padding: 0 4px; }
.chat .log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; gap: 16px; }
.starters-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--steel); margin: 0 0 2px; }
.msg { overflow-wrap: anywhere; min-width: 0; }
.msg.you { font-size: 14.5px; }
.msg.bot { background: var(--paper); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 12px 14px; font-size: 14.5px; }
.msg.bot .answer { position: relative; }
.msg.bot .answer.clamped { max-height: 11.5em; overflow: hidden; }
.msg.bot .answer.clamped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(rgba(245, 248, 250, 0), var(--paper)); }
.msg.bot .answer p:last-child, .msg.bot .answer ul:last-child { margin-bottom: 0; }
.msg .more { background: none; border: 0; padding: 4px 0 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--cyan-ink); cursor: pointer; }
.sources { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.sources summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--steel); list-style: none; }
.sources summary::-webkit-details-marker { display: none; }
.sources summary::before { content: "\25B8  "; }
.sources[open] summary::before { content: "\25BE  "; }
.sources .cites { margin-top: 6px; }
.msg .follow { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ask { background: #fff; }
.ask textarea { font-size: 16px; }
.chat-fab { display: none; }
.topbar .wrap { min-height: 72px; }
.brand img { height: 60px; margin: -4px 0; }
.filters input[type=search] { min-width: 300px; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .chat { display: none; }
  body.chat-open { overflow: hidden; }
  body.chat-open .chat { display: flex; position: fixed; inset: 0; z-index: 60; height: auto; max-height: none; border-radius: 0; border: 0; }
  .chat-close { display: block; }
  .chat-fab { display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 40; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px;
    border: 0; border-radius: 999px; background: var(--cyan); color: var(--navy); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 52, 89, .3); }
  body.chat-open .chat-fab { display: none; }
  .page { padding-bottom: 96px; }
}
@media (max-width: 700px) {
  .topbar .wrap { min-height: 60px; }
  .brand img { height: 46px; }
  .topbar .who { justify-content: flex-end; text-align: right; }
  .filters input[type=search] { min-width: 0; }
  .hero { padding-top: 26px; }
  .hero-grid { padding-bottom: 24px; }
  .facts li { border-right: 0; margin-right: 0; padding: 10px 0; width: 100%; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .facts li:last-child { border-bottom: 0; }
  .nextstep { padding: 18px; }
  .nextstep .buttons .btn, .nextstep .buttons form, .nextstep .buttons form .btn { width: 100%; }
}

/* ---------- sign-in pages: brand panel on the left, the form on the right ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-brand { position: relative; overflow: hidden; background: var(--navy); color: #fff; padding: 40px clamp(28px, 5vw, 72px);
  display: flex; flex-direction: column; gap: 40px; border-right: 6px solid var(--cyan); }
.auth-brand::after { content: ""; position: absolute; right: -180px; bottom: -180px; width: 460px; height: 460px; border-radius: 50%;
  border: 1px solid rgba(34, 182, 219, .22); box-shadow: 0 0 0 70px rgba(34, 182, 219, .04), 0 0 0 140px rgba(34, 182, 219, .03); pointer-events: none; }
.auth-logo { display: inline-block; align-self: flex-start; }
.auth-logo img { width: 190px; height: auto; display: block; }
.auth-pitch { margin: auto 0; max-width: 460px; position: relative; z-index: 1; }
.auth-pitch .for { color: var(--cyan); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.auth-pitch h1 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 16px; }
.auth-pitch > p { color: #CFE3EF; font-size: 16px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; color: #E3EEF5; font-size: 15px; }
.auth-points li::before { content: "\2713"; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(34, 182, 219, .18); color: var(--cyan); font-size: 12px; font-weight: 800; margin-top: 1px; }
.auth-foot { font-size: 12.5px; color: #8FB0C6; margin: 0; position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: 48px 24px; background: var(--paper); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 36px 32px;
  box-shadow: 0 1px 2px rgba(0, 52, 89, .04), 0 12px 32px rgba(0, 52, 89, .07); }
.auth-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 8px; }
.auth-card .lead { color: var(--steel); margin-bottom: 22px; }
.auth-card label { margin-top: 0; }
.auth-card input { margin-bottom: 16px; }
.auth-card .notice { margin-bottom: 18px; }
.stepper { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan-ink); margin-bottom: 8px; }
.btn.block { display: flex; width: 100%; min-height: 48px; font-size: 15px; }
.btn.ms { background: #fff; color: #1B1B1B; border-color: #8C8C8C; gap: 12px; }
.btn.ms:hover { background: #F3F3F3; color: #1B1B1B; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; }
.auth-links .linklike { color: var(--cyan-ink); padding: 0; font-size: 14px; }
.auth-help { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.auth-team { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.send-all { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: #FFF9EC; border: 1px solid #F2C46D;
  border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.sent-ok { color: var(--good); font-weight: 700; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.panel .panel-head h2 { border: 0; padding: 0; margin: 0; }
.panel-head .count { font-size: 14px; font-weight: 600; color: var(--steel); margin-left: 4px; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; }
.people li.empty { display: block; color: var(--steel); font-size: 14px; }
.people .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--soft); color: var(--navy); display: grid; place-items: center; font-weight: 800; }
.people .addr { font-weight: 700; overflow-wrap: anywhere; }
.people .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--steel); margin-top: 3px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--steel); }
.tag-good { background: #E3F4EA; color: var(--good); }
.person-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.add-people { margin-top: 18px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); }
.add-people h3 { font-size: 15px; margin-bottom: 4px; }
.add-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 16px; }
.add-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 12px; }
.add-options .check { margin: 0; }
.add-options .btn { margin-left: auto; }
.revoke-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
@media (max-width: 700px) {
  .people li { grid-template-columns: 32px minmax(0, 1fr); }
  .people .avatar { width: 32px; height: 32px; }
  .person-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .add-row { grid-template-columns: 1fr; }
  .add-options .btn { margin-left: 0; width: 100%; }
}
.attention { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; background: #FFF9EC; border: 1px solid #F2C46D;
  border-left: 4px solid var(--warn); border-radius: var(--radius-s); padding: 12px 16px; margin-bottom: 14px; font-size: 14px; }
.attention-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.waiting { border-left: 4px solid var(--warn); }
.waiting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.waiting-row:first-of-type { border-top: 0; }
.mail-preview dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.mail-preview dt { color: var(--steel); font-weight: 600; }
.mail-preview dd { margin: 0; overflow-wrap: anywhere; }
.mail-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 24px; }
.sign-current { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; background: var(--paper); border-radius: var(--radius-s); margin: 4px 0 8px; }
.company-sign { margin: 10px 0 14px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: var(--radius-s); background: #fff; }
.company-sign h3 { font-size: 15px; margin-bottom: 4px; }
.company-sign form.inline { display: inline-block; margin-top: 8px; }
.sign-pick { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.sign-pick summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--cyan-ink); }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-brand { border-right: 0; border-bottom: 6px solid var(--cyan); padding: 24px 20px 28px; gap: 20px; }
  .auth-brand::after { display: none; }
  .auth-logo img { width: 140px; }
  .auth-pitch h1 { font-size: 26px; }
  .auth-points, .auth-foot { display: none; }
  .auth-main { padding: 24px 16px 48px; place-items: start center; }
  .auth-card { padding: 26px 20px; box-shadow: none; }
}

/* ---------- admin: overview and proposal workspace ---------- */
.admin-nav a { text-decoration: none; font-weight: 600; opacity: .85; }
.admin-nav a:hover { opacity: 1; color: #fff; }
.crumbs { margin: 22px 0 -18px; font-size: 13px; }
.crumbs a { text-decoration: none; font-weight: 600; }
.crumbs a::before { content: "\2190  "; }
.admin-head h1 .status-pill { vertical-align: middle; font-size: 12px; margin-left: 6px; position: relative; top: -3px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; }
.tile b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--navy); }
.tile span { font-size: 13px; color: var(--steel); }
.tile.attention { border-color: #F2C46D; background: #FFF9EC; }
.tile.attention b { color: var(--warn); }
.steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: step; }
.steps li { counter-increment: step; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: 13px; font-weight: 600; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; margin-right: 8px; background: var(--soft); color: var(--navy); font-size: 12px; }
.steps li.done { color: var(--good); border-color: #BFE3CD; background: #F3FAF6; }
.steps li.done::before { content: "\2713"; background: var(--good); color: #fff; }
.steps li a { color: inherit; text-decoration: none; }
.subnav { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; background: var(--paper); padding: 8px 0; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 6px 12px; border-radius: var(--radius-s); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--navy); white-space: nowrap; }
.subnav a:hover { background: #fff; }
.subnav a span { color: var(--steel); font-weight: 500; margin-left: 2px; }
.panel { scroll-margin-top: 64px; }
.panel h2 { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
table.data tbody tr:hover td { background: #FAFCFD; }
.status-pill.sent, .status-pill.delivered { background: #E8F3F8; color: var(--cyan-ink); }
.status-pill.client_signed { background: #FFF3DC; color: var(--warn); }
@media (max-width: 980px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crumbs { margin: 14px 0 -10px; }
  .head-actions { width: 100%; }
  .head-actions .btn, .head-actions form { flex: 1 1 auto; }
  .head-actions form .btn { width: 100%; }
}

/* ---------- phones ---------- */
/* 16px form text everywhere: iOS zooms the page into any smaller field */
input[type=text], input[type=email], input[type=search], input[type=number], input[type=date], textarea, select { font-size: 16px; }
input[type=search], input[type=number], input[type=date] { border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; font-family: inherit; color: var(--ink); background: #fff; }
.mobile-only { display: none; }
@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .topbar .wrap { flex-wrap: wrap; min-height: 56px; padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .brand img { height: 36px; }
  .topbar .who { flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
  .topbar .who > span { flex-basis: 100%; order: -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .band { padding-top: 22px; }
  .band .summary { font-size: 16px; }
  .page { padding: 20px 0 48px; gap: 24px; }
  .binder h2 { font-size: 18px; }
  .doc { padding: 14px; gap: 12px; }
  .signcard { padding: 16px; }
  .signcard .buttons .btn, .signcard .buttons form, .signcard .buttons form .btn { width: 100%; }
  dialog form { padding: 18px; }
  dialog .row { flex-direction: column-reverse; }
  dialog .row .btn { width: 100%; }

  .admin-head { padding: 20px 0 12px; align-items: flex-start; }
  .admin-head h1 { font-size: 24px; }
  .admin-head .btn { flex: 1 1 auto; }
  .panel { padding: 16px; }
  .copy { flex-direction: column; }
  .filters { align-items: stretch; }
  .filters input[type=search] { max-width: none; flex: 1 1 100%; }
  .tabs { overflow-x: auto; }
  .doc-edit summary { flex-wrap: wrap; }
  .grid2 > div[style*="padding-top"] { padding-top: 8px !important; }  /* checkbox columns line up with fields only side by side */

  /* tables become one card per row; layout.js copies each column heading into data-label */
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.data tr:last-child { border-bottom: 0; }
  table.data td { border: 0; padding: 3px 0; text-align: left !important; white-space: normal !important; }
  table.data td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; color: var(--steel); }
  table.data td:first-child::before { display: none; }
  table.data td .inline { display: inline-block; margin: 4px 6px 0 0; }

  .preview-bar .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .preview-bar h1 { font-size: 16px; }
  .paper { margin: 16px 0 40px; border-radius: 0; border-left: 0; border-right: 0; }
  .pdf-frame { height: calc(100vh - 110px); }
  .mobile-only { display: block; }
}
