:root {
  --ink: #1b2430; --muted: #5d6b7a; --line: #dde3ea; --bg: #f5f7fa; --card: #fff;
  --brand: #1f4e79; --brand-2: #2f6fa8; --ok: #1e7b4a; --warn: #a86400; --bad: #b3261e;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--brand); color: #fff; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.seal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--brand); margin-right: 6px; font-family: Georgia, serif; }
.topbar-right { display: flex; gap: 14px; align-items: center; }
.topbar .muted { color: #cfe0f0; font-size: 13px; }
.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.layout { display: grid; grid-template-columns: 250px 1fr; max-width: 1150px; margin: 0 auto; gap: 24px; padding: 24px 16px 80px; }
#steps { position: sticky; top: 16px; align-self: start; }
#steps ol { list-style: none; margin: 0; padding: 0; }
#steps li { padding: 8px 12px; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 14px; }
#steps li.done { color: var(--ink); }
#steps li.done::before { content: "✓ "; color: var(--ok); }
#steps li.active { background: #e3edf7; color: var(--brand); font-weight: 600; }
main { min-width: 0; }
#progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
#progress-bar { height: 100%; background: var(--brand-2); width: 0; transition: width .3s; }
#step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 26px 0 8px; }
h3 { font-size: 16px; margin: 18px 0 6px; }
.lead { color: var(--muted); margin: 0 0 20px; }
label { display: block; font-weight: 600; margin: 16px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 14px; margin: -2px 0 6px; }
input:not([type]), input[type=text], input[type=tel], input[type=url], input[type=password], input[type=email], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #c4ced8; border-radius: 8px; font: inherit; background: #fff;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 8px 0; cursor: pointer; font-weight: 400; }
.choice:hover { border-color: var(--brand-2); }
.choice.selected { border-color: var(--brand-2); background: #f0f6fc; }
.choice input { margin-top: 4px; }
.choice small { display: block; color: var(--muted); }
.nav { display: flex; justify-content: space-between; margin-top: 18px; }
button { font: inherit; cursor: pointer; border-radius: 8px; padding: 10px 18px; border: 1px solid transparent; }
.primary { background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-2); }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.secondary { background: #fff; border-color: #c4ced8; color: var(--ink); }
.small { padding: 6px 12px; font-size: 14px; }
.callout { border-left: 4px solid var(--brand-2); background: #f0f6fc; padding: 12px 14px; border-radius: 6px; margin: 14px 0; font-size: 15px; }
.callout.warn { border-color: var(--warn); background: #fff6e8; }
.callout.bad { border-color: var(--bad); background: #fdeceb; }
.callout.ok { border-color: var(--ok); background: #eaf6ef; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; background: #fcfdfe; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #e8edf3; color: var(--muted); margin-right: 4px; }
.pill.ok { background: #dff3e7; color: var(--ok); }
.pill.warn { background: #fff0d6; color: var(--warn); }
.pill.bad { background: #fbe0de; color: var(--bad); }
.auth { font-size: 14px; padding: 8px 0; border-top: 1px dashed var(--line); }
.auth:first-child { border-top: 0; }
.auth i { font-style: italic; }
.results { max-height: 380px; overflow: auto; }
.big-number { font-size: 34px; font-weight: 700; }
.preview { font-family: "Times New Roman", Times, serif; background: #fff; border: 1px solid var(--line); padding: 40px 48px; line-height: 2; max-height: 70vh; overflow: auto; }
.preview .center { text-align: center; line-height: 1.4; }
.preview h4 { font-size: 16px; margin: 18px 0 4px; }
.preview h5 { font-size: 15px; margin: 14px 0 4px; text-decoration: underline; padding-left: 20px; }
.preview p { text-indent: 40px; margin: 0; }
.preview .caption { display: grid; grid-template-columns: 1fr 1fr; line-height: 1.4; margin: 16px 0; }
.preview .caption div:first-child { border-right: 1px solid #000; border-bottom: 1px solid #000; padding: 8px; }
.preview .caption div:last-child { padding: 8px 16px; }
.placeholder { background: #fff3c4; }
button.placeholder { display: inline; color: inherit; font: inherit; font-family: inherit; padding: 0 3px; border: 1px dashed #a86400; border-radius: 3px; cursor: pointer; line-height: inherit; text-indent: 0; }
button.placeholder:hover, button.placeholder:focus { background: #ffe08a; }
.field-flag { outline: 3px solid #c9a227 !important; background: #fff3c4 !important; }
.gaps { list-style: none; margin: 8px 0 0; padding: 0; }
.gaps li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.gaps li:first-child { border-top: 0; }
.muted { color: var(--muted); }
.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; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
table.verify { width: 100%; border-collapse: collapse; font-size: 14px; }
table.verify td, table.verify th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  #steps { position: static; overflow-x: auto; }
  #steps ol { display: flex; gap: 4px; }
  #steps li { white-space: nowrap; }
  .row { grid-template-columns: 1fr; }
  #step { padding: 18px; }
  .preview { padding: 20px; }
}
/* Voice dictation (public/portal/voice.js) */
.hb-mic { margin: 6px 0 0; }
.hb-mic.rec { background: #a63d2a; color: #fff; border-color: #a63d2a; }
@media (max-width: 600px) { .topbar-right { flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; } .topbar .brand { font-size: 15px; } }
/* Live help chatbot */
#hb-help { position: fixed; right: 16px; bottom: 16px; z-index: 40; font-size: 15px; }
.hb-help-btn { background: var(--ink, #1c2a4a); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; }
.hb-help-panel { position: absolute; right: 0; bottom: 52px; width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line, #d5dbe6); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); overflow: hidden; }
.hb-help-panel[hidden] { display: none; }
.hb-help-panel header { padding: 12px 14px 8px; border-bottom: 1px solid var(--line, #d5dbe6); }
.hb-help-panel header p { margin: 4px 0 0; font-size: 13px; }
.hb-help-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
.hb-help-chip { font-size: 13px; border: 1px solid var(--line, #d5dbe6); background: #f6f7fb; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.hb-help-log { flex: 1; overflow: auto; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.hb-help-msg { max-width: 92%; padding: 8px 10px; border-radius: 10px; white-space: pre-wrap; line-height: 1.4; }
.hb-help-msg.me { align-self: flex-end; background: #1c2a4a; color: #fff; }
.hb-help-msg.bot { align-self: flex-start; background: #eef1f7; }
.hb-help-msg.typing { opacity: .7; font-style: italic; }
#hb-help-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px; border-top: 1px solid var(--line, #d5dbe6); align-items: end; }
#hb-help-in { width: 100%; resize: none; }
@media (max-width: 600px) { #hb-help { right: 10px; bottom: 10px; } }
