/* Odaaru e-sign — shared styles. Layout: one narrow reading column for signers; wider working column for staff. */
/* Odaaru house theme (matches odaaru.com): self-hosted Poppins + Manrope (SIL OFL, licences in /shared/fonts) */
@font-face{font-family:Manrope;font-style:normal;font-weight:400;font-display:swap;src:url(/shared/fonts/manrope-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:Manrope;font-style:normal;font-weight:500;font-display:swap;src:url(/shared/fonts/manrope-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:Manrope;font-style:normal;font-weight:600;font-display:swap;src:url(/shared/fonts/manrope-latin-600-normal.woff2) format("woff2")}
@font-face{font-family:Poppins;font-style:normal;font-weight:500;font-display:swap;src:url(/shared/fonts/poppins-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:Poppins;font-style:normal;font-weight:600;font-display:swap;src:url(/shared/fonts/poppins-latin-600-normal.woff2) format("woff2")}
:root {
  --bg: #F2F7FB; --surface: #ffffff; --ink: #002460; --ink-deep: #001A47; --text: #22303C; --muted: #54606C; --line: #DCE5EF;
  --accent: #0065D9; --accent-ink: #ffffff; --soft: #EAF2FC; --good: #16794b; --good-bg: #e3f6ec;
  --warn: #7a5410; --warn-bg: #fff6e0; --bad: #c2352f; --bad-bg: #fdecea;
  --grad: linear-gradient(96deg, #0065D9 0%, #009078 55%, #24C054 100%);
  --f-display: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --f-body: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 18px; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--f-body); font-size: 15px; line-height: 1.55;
  padding: 24px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); }
.wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.wrap.wide { max-width: 1040px; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-weight: 600; font-size: 15px; color: var(--muted); }
.logo img.mark { height: 36px; width: auto; display: block; }
.logo img.word { height: 21px; width: auto; display: block; margin-top: 2px; }
.logo .sub { padding-left: 10px; border-left: 1px solid var(--line); }
.bar { height: 4px; background: var(--grad); border-radius: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -.018em; color: var(--ink); margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); font-size: 12px; word-break: break-all; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,36,96,.04); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.step { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 200px; min-width: 0; }
label { font-weight: 600; font-size: 14px; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; color: var(--text); }
input[type=text], input[type=email], input[type=tel], input[type=search], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.code-input { font-family: var(--f-mono); font-size: 22px; letter-spacing: .35em; max-width: 200px; text-align: center; }
button, .btn { font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button.primary, .btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (hover: hover) {
  button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--ink-deep); }
  button:not(.primary):not(.link):not([aria-pressed=true]):not([aria-selected=true]):hover:not(:disabled), .btn:not(.primary):hover { background: var(--bg); }
}
/* Selected toggles always stay dark with white text (also on phones, where taps leave a "hover" behind) */
button[aria-pressed=true], .tabs button[aria-selected=true] { background: var(--ink) !important; color: #fff !important; border-color: var(--ink) !important; }
button.danger { color: var(--bad); }
button:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; cursor: pointer; }
.docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.docs li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; flex-wrap: wrap; }
.docs li > .grow { min-width: 0; flex: 1 1 180px; }
.docs li > .grow > div:first-child { overflow-wrap: anywhere; } /* long file names wrap instead of running under the tick */
.tick { font-size: 13px; font-weight: 700; color: var(--muted); }
.tick.done { color: var(--good); }
.pad { width: 100%; max-width: 100%; aspect-ratio: 3 / 1; border: 1px dashed var(--muted); border-radius: 8px; background: #fff; display: block; }
.chip { display: inline-block; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--soft); color: var(--accent); }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.msg { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.ok { background: var(--good-bg); color: var(--good); }
.consent { background: var(--soft); border-radius: 8px; padding: 12px; font-size: 13.5px; }
details summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--soft); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button[aria-selected=true] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.linkbox input { flex: 1 1 260px; font-family: var(--f-mono); font-size: 12px; }
footer { font-size: 12px; color: var(--muted); text-align: center; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* Draft room */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 980px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } .split > .side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; } }
.diff { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
ins { background: var(--good-bg); color: var(--good); text-decoration: underline; }
del { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
.chglist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chglist li { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
details.chg { border-top: 1px solid var(--line); padding-top: 10px; }
details.chg h3 { margin: 10px 0 0; font-size: 14px; }
.vers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.vers li { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.vers li[aria-current=true] { border-color: var(--accent); background: var(--soft); }
textarea.script { font-family: var(--f-mono); font-size: 13px; min-height: 180px; }
.result-ok { color: var(--good); } .result-bad { color: var(--bad); }
/* Document viewer */
.wrap.xwide { max-width: 1320px; }
.docgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 1000px) { .docgrid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); } }
.docgrid > .card { max-height: 82vh; overflow: auto; }
.cards2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 1000px) { .cards2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.dv-bar button[aria-pressed=true] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.dv-bar { position: sticky; top: -18px; background: var(--surface); padding: 8px 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.dv-bar button, .dv-bar .btn { padding: 7px 12px; font-size: 14px; line-height: 1.3; border-radius: 8px; white-space: nowrap; }
.dv-seg { display: inline-flex; }
.dv-seg button { border-radius: 0; margin-left: -1px; }
.dv-seg button:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.dv-seg button:last-child { border-radius: 0 8px 8px 0; }
.dv-seg button[aria-pressed=true] { position: relative; }
.dv-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dv-page { background: #fff; color: #1b1b1b; border: 1px solid var(--line); border-radius: 6px; padding: 36px 40px; font-family: Calibri, Carlito, Arial, sans-serif; font-size: 14.5px; line-height: 1.5; box-shadow: 0 1px 3px rgba(10,36,99,.08); }
@media (max-width: 600px) { .dv-page { padding: 18px 14px; } }
.dv-page .dv-p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; color: inherit; }
.dv-page h3.dv-p, .dv-page h4.dv-p, .dv-page h5.dv-p { font-size: 1.15em; font-weight: 700; margin-top: 14px; }
.dv-page ins { background: #dff3e6; color: #126b3e; text-decoration: underline; }
.dv-page del { background: #fde4e4; color: #a01d25; text-decoration: line-through; }
.dv-page .dv-break { border-top: 1px dashed #c7cfe0; padding-top: 10px; margin-top: 16px; }
.dv-page .dv-comment { border-left: 3px solid #e8b25a; padding-left: 8px; }
.dv-tblwrap { overflow-x: auto; margin: 8px 0 12px; }
.dv-tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.dv-tbl td { border: 1px solid #c9d3e6; padding: 6px 8px; vertical-align: top; }
.dv-tbl .dv-p { margin: 0; }
.dv-flash { animation: dvflash 1.6s ease-out; }
@keyframes dvflash { from { background: #fff3c4; } to { background: transparent; } }
.chglist li.jump { cursor: pointer; } .chglist li.jump:hover { background: var(--soft); }

/* Keep the way back visible while scrolling long pages */
.backbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }
.fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 10; box-shadow: 0 2px 8px rgba(10,36,99,.18); }
dialog.dlg { width: min(760px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0,36,96,.22); }
dialog.dlg::backdrop { background: rgba(0, 26, 71, .45); }
dialog.dlg.dlg-small { width: min(460px, calc(100% - 32px)); }
dialog.dlg.dlg-small h2 { margin: 0; }
button.primary.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
td.mono, th { white-space: nowrap; }
footer { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
footer p { margin: 0; } footer .ack { max-width: 760px; margin: 0 auto; line-height: 1.5; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.kv { grid-template-columns: 1fr; } dl.kv dd { margin-bottom: 6px; } }
.msg.warn { background: var(--warn-bg); color: var(--warn); }

/* Signing desk: signed-in user + log out */
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.btn.logout { padding: 6px 14px; font-size: 14px; }
@media (max-width: 600px) { .who { width: 100%; justify-content: space-between; } }

/* New envelope: each person in a light box */
#n-signers > .row { border: 1px solid var(--line, #dfe6ef); border-radius: 12px; padding: 10px; background: var(--card, #fff); }
#n-signers select.act, #n-signers select.wfor { flex: 1 1 220px; }

/* Beta businesses: no texted codes, so no mobile field */
body.no-sms input.mobile,body.no-sms .sms-hint{display:none}

/* Draft room: Edit mode */
.sel-box { display: block; border: 1px dashed var(--line); border-radius: 6px; padding: 8px 10px; margin-top: 4px; white-space: pre-wrap; max-height: 9em; overflow: auto; color: inherit; }
.dv-editing { cursor: text; outline: 2px solid #2f6fed; outline-offset: 2px; }
.dv-editing ::selection { background: #ffe58a; }
.edit-item { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.edit-item del { color: #b42318; } .edit-item ins { color: #067647; text-decoration: none; }

/* Draft room alerts */
.live-bar{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:50;display:flex;gap:12px;align-items:center;flex-wrap:wrap;
  max-width:calc(100% - 32px);padding:10px 12px 10px 16px;border-radius:12px;background:var(--navy,#0A2463);color:#fff;box-shadow:0 8px 24px rgba(10,36,99,.25);font-weight:600}
.live-bar[hidden]{display:none}
.alert-guide{border:1px solid var(--rule,#dde3ee);border-radius:10px;padding:10px 14px;margin:6px 0 10px}
.alert-guide ol{margin:6px 0 4px;padding-left:20px}
.alert-guide li{margin:3px 0}
.live-bar button,.live-bar button.primary{background:#fff;color:#0A2463;border-color:#fff}
/* Feedback button (beta) */
.fb-open{position:fixed;left:16px;bottom:16px;z-index:40;border-radius:999px;padding:8px 16px;background:#fff;border:1px solid var(--rule,#dde3ee);box-shadow:0 4px 14px rgba(10,36,99,.12);font-weight:600}
.fb-dialog{max-width:440px;width:calc(100% - 32px);border:1px solid var(--rule,#dde3ee);border-radius:14px;padding:20px}
.fb-dialog::backdrop{background:rgba(10,36,99,.35)}
.fb-dialog textarea{width:100%;box-sizing:border-box}
.fb-stars{display:flex;gap:4px}
.fb-star{font-size:22px;line-height:1;padding:2px 6px;background:none;border:none;color:#C9D2E3;cursor:pointer}
.fb-star.on{color:#E2A800}
@media print{.fb-open{display:none}}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.room-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.room-head h1 { margin: 0; }
.room-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 16px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: #fff; background: var(--ink); border-radius: 999px; padding: 8px 18px; white-space: nowrap; }
.room-tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; }
.room-line { margin: 6px 0 0; font-weight: 600; color: var(--ink); }
.dv-bar button.info-btn { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; text-align: center; font-size: 17px; color: var(--accent); border-radius: 999px; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; margin-left: -4px; }
.om-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc-head { align-items: baseline; flex-wrap: wrap; }
.doc-head h2 { margin: 0; }
.doc-head .doc-name { font-family: var(--f-mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; flex: 1 1 200px; min-width: 0; }
.doc-head > .muted { margin-left: auto; white-space: nowrap; }
.room-tag.room-tag-sm { font-size: 13px; padding: 6px 14px; }
.dv-views { display: inline-flex; align-items: center; gap: 10px; }
.dv-view-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink); }
button.urgent-btn { margin-left: auto; }
button.urgent-btn[aria-pressed=true] { background: var(--bad) !important; border-color: var(--bad) !important; color: #fff !important; }
.owner-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 3px 0; color: var(--text); }
.owner-line .chip { text-transform: none; letter-spacing: 0; font-family: inherit; font-weight: 700; font-size: 12px; }
