/* PayAppHub theme: Slate (ink #1B2235, electric blue #3B5BDB). Loaded after styles.css and app.css. */
:root {
  --ink: light-dark(#1B2235, #E8ECF6);
  --bg: light-dark(#F6F7FB, #0E1220);
  --panel: light-dark(#FFFFFF, #161B2B);
  --soft: light-dark(#EEF1F8, #1E2438);
  --text: light-dark(#1B2235, #E8ECF6);
  --muted: light-dark(#5A6378, #9AA3B8);
  --line: light-dark(#E1E5EF, #2A3149);
  --blue: light-dark(#3B5BDB, #8EA2F4);
  --blue-strong: light-dark(#2F4BC0, #A9B9F7);
  --blue-soft: light-dark(#E6EBFC, #1F2A55);
  --on-blue: light-dark(#FFFFFF, #0E1220);
  --red: light-dark(#B42318, #F29C94);
  --green: light-dark(#1A6B43, #7FD3A6);
  --green-soft: light-dark(#E2F4EA, #173A2A);
  --amber-soft: light-dark(#FFF4DB, #3A2E10);
  --amber: light-dark(#7A5410, #F3D58A);
  --shadow: light-dark(rgba(27, 34, 53, .06), rgba(0, 0, 0, .3));
  --radius: 10px;
}
body { font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
::selection { background: var(--blue-soft); }

/* Header */
.topbar { height: 64px; background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px var(--shadow); }
.brand-mark { width: 34px; height: 34px; border: 0; border-radius: 9px; background: url(/logo-mark.svg) center / contain no-repeat; flex: none; }
@media (prefers-color-scheme: dark) { .brand-mark { background-image: url(/favicon.svg); } }
.brand-button strong { font-size: 14px; font-weight: 650; color: var(--ink); letter-spacing: -0.1px; }
.brand-button small { font-size: 11px; color: var(--muted); }
.wordmark { font-weight: 750; letter-spacing: -0.4px; color: var(--ink); }
.wordmark b { color: var(--blue); font-weight: 750; }

/* Page heading and navigation */
.page-heading h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.4px; color: var(--ink); }
.page-heading p { font-size: 13px; }
.shell-nav { gap: 2px; border-bottom: 1px solid var(--line); }
.shell-nav button { color: var(--muted); font-weight: 500; border-radius: 8px 8px 0 0; transition: color .15s, background .15s; }
.shell-nav button:hover { color: var(--ink); background: var(--soft); }
.shell-nav button.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; background: transparent; }

/* Buttons */
.primary-button, button.primary-button, a.primary-button { background: var(--blue); color: var(--on-blue); border: 1px solid var(--blue); border-radius: 8px; font-weight: 600; font-size: 13px; padding: 9px 14px; cursor: pointer; transition: background .15s, box-shadow .15s; }
.primary-button:hover:not(:disabled) { background: var(--blue-strong); border-color: var(--blue-strong); box-shadow: 0 2px 8px color-mix(in srgb, var(--blue) 30%, transparent); }
.secondary-button, button.secondary-button, a.secondary-button, label.secondary-button { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-weight: 500; font-size: 13px; padding: 9px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.secondary-button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); background: var(--soft); }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: default; }
.text-button { color: var(--blue); cursor: pointer; }
.text-button:hover { text-decoration: underline; }

/* Panels, cards, metrics */
.panel { border-radius: 12px; box-shadow: 0 1px 2px var(--shadow); padding: 22px; }
.panel h2 { font-size: 16px; font-weight: 650; color: var(--ink); letter-spacing: -0.1px; }
.metric { border-radius: 12px; box-shadow: 0 1px 2px var(--shadow); }
.metric span { font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.metric strong { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.3px; }
.notice { background: var(--blue-soft); color: var(--ink); border-radius: 10px; }
.notice.warn, .plan-banner.warn { background: var(--amber-soft); color: var(--amber); }

/* Forms */
.form-grid input, .form-grid textarea, .form-grid select, .inline-form input, .inline-form select, .auth-card input, select, .modal-card input, .modal-card select, .modal-card textarea {
  border-radius: 8px; border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus, .inline-form input:focus, .inline-form select:focus, .auth-card input:focus, select:focus,
.modal-card input:focus, .modal-card select:focus, .modal-card textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.form-grid label, .auth-card label { font-weight: 500; color: var(--muted); }

/* Tables */
table { font-size: 13px; }
th { background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
tbody tr { transition: background .1s; }
tr.clickable:hover td { background: color-mix(in srgb, var(--blue-soft) 45%, transparent); }

/* Status pills and badges */
.badge { background: var(--soft); color: var(--muted); font-weight: 500; }
.pill { font-weight: 500; }
.pill.st-Signed, .pill.st-Paid, .pill.Approved { background: var(--green-soft); color: var(--green); }
.pill.st-Submitted, .pill.st-Finalized, .pill.st-Approved-for-Sending { background: var(--blue-soft); color: var(--blue); }
.pill.Pending { background: var(--amber-soft); color: var(--amber); }
.saved { color: var(--green); }

/* Modals */
.modal-overlay { background: rgba(14, 18, 32, .5); backdrop-filter: blur(2px); }
.modal-card { border-radius: 14px; }
.modal-card h2 { color: var(--ink); font-weight: 650; }

/* Sign-in, sign-up and other account pages */
body.auth { background: radial-gradient(1200px 500px at 50% -10%, var(--blue-soft), transparent 70%), var(--bg); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand img { width: 36px; height: 36px; }
.auth-brand .wordmark { font-size: 22px; }
.auth-tagline { margin: -10px 0 20px 46px; font-size: 13px; font-weight: 600; color: var(--blue); letter-spacing: .01em; }
.auth-card { border-radius: 16px; box-shadow: 0 12px 40px var(--shadow), 0 1px 2px var(--shadow); }
.auth-card h1 { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.2px; }

/* Plans: side-by-side columns with aligned features */
.plan-switch { display: flex; justify-content: center; margin: 6px 0 22px; }
.plan-tabs { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.plan-tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 9px 22px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.plan-tabs button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }
.plan-tabs button span { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--green); background: var(--green-soft); padding: 2px 7px; border-radius: 999px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan-col { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px 18px; display: flex; flex-direction: column; box-shadow: 0 1px 2px var(--shadow); }
.plan-col.popular { border: 2px solid var(--blue); padding: 21px 19px 17px; box-shadow: 0 8px 24px color-mix(in srgb, var(--blue) 14%, transparent); }
.plan-col.current { outline: 3px solid var(--blue-soft); }
.plan-col .flag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--blue); color: var(--on-blue); font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; }
.plan-col h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.plan-col .for { margin: 4px 0 14px; font-size: 12px; color: var(--muted); min-height: 32px; line-height: 1.35; }
.plan-col .price { font-size: 34px; font-weight: 750; color: var(--ink); letter-spacing: -1px; line-height: 1; }
.plan-col .price small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.plan-col .per { font-size: 12px; color: var(--muted); margin: 6px 0 16px; min-height: 16px; }
.plan-col .per b { color: var(--green); font-weight: 600; }
.plan-col .cta { width: 100%; justify-content: center; text-align: center; padding: 11px; font-size: 14px; }
.plan-col .feats { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--line); }
.plan-col .feats li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; min-height: 42px; }
.plan-col .feats li:last-child { border-bottom: 0; }
.plan-col .feats li span { color: var(--muted); }
.plan-col .feats li b { color: var(--ink); font-weight: 600; text-align: right; }
.plan-col .feats li b.yes { color: var(--green); }
.plan-note { text-align: center; font-size: 12px; color: var(--muted); margin: 16px 0 0; }
@media (max-width: 620px) { .plan-grid { grid-template-columns: 1fr; } .plan-col .for { min-height: 0; } }
@media (max-width: 900px) {
  .plan-col { padding: 18px 14px 14px; } .plan-col.popular { padding: 17px 13px 13px; }
  .plan-col .price { font-size: 26px; } .plan-col .price small { display: block; margin: 4px 0 0; font-size: 12px; }
  .plan-col .feats li { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; padding: 8px 0; font-size: 12px; }
  .plan-col .feats li b { text-align: left; }
  .plan-tabs button { padding: 8px 14px; }
}
@media (max-width: 700px) { .topbar { height: auto; } }
@media (max-width: 760px) { .plan-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 440px) { .plan-metrics { grid-template-columns: 1fr; } }
.auth-tagline b { color: var(--ink); font-weight: 700; }

/* ---------- on-screen lien waiver ---------- */
.we-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 10px 0; margin: -6px 0 6px; border-bottom: 1px solid var(--line); }
.we-bar .spacer { flex: 1; }
.we-bar select { padding: 8px 10px; }
.we-count { font-size: 13px; color: var(--muted); padding: 0 6px; }
.we-count b { color: #8a5a00; font-size: 15px; }
.we-done { color: var(--green); font-weight: 600; }
#weAdd.on, #weMove.on { background: var(--blue); color: var(--on-blue); border-color: var(--blue); }
.we-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); margin: 6px 0 14px; }
.we-legend span { display: inline-flex; align-items: center; gap: 6px; }
.we-legend .we-hint { flex-basis: 100%; }
.we-sw { width: 16px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid; }
.we-sw.blank { background: rgba(255, 205, 0, .45); border-color: #d4a200; }
.we-sw.auto { background: rgba(59, 91, 219, .14); border-color: rgba(59, 91, 219, .5); }
.we-sw.typed { background: #fff; border-color: #3B5BDB; }
.we-sw.notary { background: repeating-linear-gradient(45deg, #eee, #eee 3px, #ddd 3px, #ddd 6px); border-color: #bbb; }
.we-pages { display: grid; gap: 22px; justify-items: center; padding-bottom: 40px; }
.we-pages.adding .we-page { cursor: crosshair; }
.we-pages.moving .we-item[data-n] { cursor: move; outline: 2px dashed var(--blue); outline-offset: 1px; box-shadow: inset -5px 0 0 color-mix(in srgb, var(--blue) 55%, transparent); touch-action: none; user-select: none; }
.we-pages.moving .we-item[data-n]:focus { outline-style: solid; z-index: 4; }
.we-pages.moving .we-item:not([data-n]):not(.we-extra) { opacity: .45; pointer-events: none; }
.we-movehint { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; background: var(--soft); font-size: 13px; color: var(--text); }
.we-page { position: relative; width: min(100%, 900px); background: #fff; box-shadow: 0 4px 24px rgba(27, 34, 53, .14), 0 0 0 1px rgba(27, 34, 53, .08); border-radius: 4px; overflow: hidden; }
.we-page img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.we-layer { position: absolute; inset: 0; }
.we-item { position: absolute; box-sizing: border-box; margin: 0; font-family: Helvetica, Arial, sans-serif; color: #111; }
.we-field { border: 1px solid transparent; border-radius: 2px; padding: 0 3px; background: transparent; outline: none; resize: none; line-height: 1.15; transition: background .12s, box-shadow .12s; }
.we-field.blank { background: rgba(255, 205, 0, .38); border: 1px dashed #d4a200; }
.we-field.auto { background: rgba(59, 91, 219, .10); border-color: rgba(59, 91, 219, .25); }
.we-field.typed { background: rgba(255, 255, 255, .92); border-color: rgba(59, 91, 219, .55); }
.we-field.plain { background: rgba(0, 0, 0, .03); border-color: rgba(0, 0, 0, .08); }
.we-field.notary { background: repeating-linear-gradient(45deg, rgba(0,0,0,.04), rgba(0,0,0,.04) 4px, rgba(0,0,0,.08) 4px, rgba(0,0,0,.08) 8px); }
.we-field:focus { background: #fff; border: 1px solid #3B5BDB; box-shadow: 0 0 0 3px rgba(59, 91, 219, .3); z-index: 2; }
.we-field[readonly] { cursor: default; }
.we-check { display: grid; place-items: center; padding: 0; border: 1.5px solid #3B5BDB; border-radius: 2px; background: rgba(255, 255, 255, .85); color: #111; font-weight: 700; line-height: 1; cursor: pointer; }
.we-check.auto { background: rgba(59, 91, 219, .14); }
.we-check:focus-visible { box-shadow: 0 0 0 3px rgba(59, 91, 219, .35); outline: none; }
.we-ph { display: flex; align-items: center; justify-content: center; border: 1px dashed #9aa3b8; color: #5a6378; background: rgba(238, 241, 248, .8); border-radius: 3px; font-style: italic; }
.we-extra { display: block; z-index: 3; }
.we-extra .we-grip { position: absolute; right: 100%; top: 0; margin-right: 2px; }
.we-extra .we-del { position: absolute; left: 100%; top: -4px; margin-left: 3px; }
.we-pages.moving .we-extra { cursor: move; touch-action: none; user-select: none; }
.we-pages.moving .we-extra .we-text { outline: 2px dashed var(--blue); outline-offset: 1px; cursor: move; }
.we-pages.moving .we-extra:focus-within .we-text, .we-pages.moving .we-extra:focus .we-text { outline-style: solid; }
#weUndo:disabled { opacity: .45; }
.we-extra .we-text { display: inline-block; min-width: 40px; padding: 0 2px; background: rgba(255, 255, 255, .92); border: 1px solid rgba(59, 91, 219, .6); border-radius: 2px; outline: none; white-space: pre; line-height: 1.2; color: #111; font-family: Helvetica, Arial, sans-serif; }
.we-extra .we-text:empty::before { content: "Type here"; color: #9aa3b8; }
.we-extra .we-text:focus { box-shadow: 0 0 0 3px rgba(59, 91, 219, .3); }
.we-grip, .we-del { opacity: 0; transition: opacity .12s; font-size: 12px; line-height: 1; color: #5a6378; }
.we-extra:hover .we-grip, .we-extra:hover .we-del, .we-extra:focus-within .we-grip, .we-extra:focus-within .we-del { opacity: 1; }
.we-grip { cursor: grab; padding: 2px 1px; user-select: none; touch-action: none; }
.we-del { border: 0; background: #fff; border-radius: 50%; width: 16px; height: 16px; cursor: pointer; box-shadow: 0 0 0 1px #ccd; }
@media (hover: none) { .we-grip, .we-del { opacity: 1; } }
@media (max-width: 700px) { .we-bar { position: static; } }

/* Billing worksheet: fit every column on a laptop screen without sideways scrolling */
.ws-table th { white-space: normal; line-height: 1.25; vertical-align: bottom; font-size: 10.5px; }
.ws-table td, .ws-table th { padding-left: 6px; padding-right: 6px; }
.ws-table td.val input { width: 84px; padding: 6px 7px; }
.ws-table td:nth-child(2) { max-width: 210px; }
.ws-table select { padding: 6px 4px; }

/* ---------- blog writing (staff) ---------- */
.bp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bp-slug, .bp-cover { display: flex; gap: 8px; align-items: center; }
.bp-slug span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.bp-md-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 6px; }
.bp-small { padding: 6px 10px !important; font-size: 12px !important; }
#bpBody { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; min-height: 420px; }
.bp-preview { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.bp-frame { border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; background: var(--panel); }
.bp-frame h1 { font-size: 28px; margin: 0; color: var(--ink); letter-spacing: -0.02em; }
.bp-frame .bp-meta { color: var(--muted); font-size: 13px; margin: 8px 0 16px; }
.bp-frame img { max-width: 100%; border-radius: 8px; }
.bp-frame .b-body { font-size: 15px; line-height: 1.65; }
.bp-frame .b-body h2 { font-size: 21px; margin: 24px 0 8px; } .bp-frame .b-body h3 { font-size: 17px; }
.bp-frame .b-body table { width: 100%; border-collapse: collapse; } .bp-frame .b-body th, .bp-frame .b-body td { border: 1px solid var(--line); padding: 6px 8px; }
.bp-frame .b-body blockquote { margin: 14px 0; padding: 8px 14px; border-left: 3px solid var(--blue); background: var(--blue-soft); }
@media (max-width: 980px) { .bp-grid { grid-template-columns: 1fr; } .bp-preview { position: static; max-height: none; } }

/* ---------- PayAppHub control panel ---------- */
.cp-tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; width: fit-content; max-width: 100%; }
.cp-tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 9px; cursor: pointer; }
.cp-tabs button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px var(--shadow); }
.cp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cp-two > .panel { margin: 0 0 18px; }
@media (max-width: 900px) { .cp-two { grid-template-columns: 1fr; } }
.cp-list { list-style: none; margin: 0 0 8px; padding: 0; }
.cp-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cp-list li:last-child { border-bottom: 0; }
.cp-list li .cp-barwrap { flex: 0 0 160px; }
.cp-list li.cp-alert-red b { color: var(--red); }
.cp-bar { height: 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.cp-bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.cp-bar.cp-watch i { background: var(--amber); }
.cp-bar.cp-close i, .cp-bar.cp-over i { background: var(--red); }
.cp-saas-yes { background: var(--amber-soft); color: var(--amber); }
.cp-saas-partial { background: var(--blue-soft); color: var(--blue); }
.cp-saas-no { background: var(--soft); color: var(--muted); }
.cp-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.cp-check input { width: auto; }
.cp-tax td { vertical-align: top; }
.cp-tax .pill { white-space: nowrap; }
.cp-state { min-width: 200px; max-width: 280px; }
.cp-state small { display: block; margin-top: 2px; line-height: 1.35; }
.cp-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 18px; }
.cp-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.cp-col i { display: block; width: 100%; max-width: 46px; min-height: 2px; background: var(--blue); border-radius: 6px 6px 2px 2px; }
.cp-col small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cp-col span { font-size: 11px; color: var(--muted); white-space: nowrap; }
@media (max-width: 620px) { .cp-col small { display: none; } .cp-chart { gap: 3px; } }

/* ---------- Control panel: support inbox ---------- */
.cp-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.sp-toolbar { margin: 0 0 12px; flex-wrap: wrap; gap: 8px; }
.sp-toolbar input[type=search] { max-width: 300px; }
.sp-filter button { padding: 7px 14px; }
.sp-filter small { color: var(--muted); font-weight: 500; }
.sp-list { list-style: none; margin: 0; padding: 0; }
.sp-list li { display: grid; grid-template-columns: minmax(150px, 220px) 1fr auto; gap: 14px; align-items: start; padding: 12px 10px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.sp-list li:hover, .sp-list li:focus { background: var(--soft); outline: none; }
.sp-list li:not(.unread) b { font-weight: 500; }
.sp-list li.unread .sp-who b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: 1px; }
.sp-who small, .sp-who .badge { display: block; margin-top: 2px; width: fit-content; }
.sp-who small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.sp-subj { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sp-meta { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.sp-meta small { display: block; font-size: 12px; }
.sp-wait { color: var(--amber); font-weight: 600; }
.sp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.sp-head h2 { margin: 0 0 4px; }
.sp-head p { margin: 0; }
.sp-msg.out { border-left: 3px solid var(--blue); }
.sp-msg-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sp-msg-head small { display: block; }
.sp-frame { width: 100%; border: 0; min-height: 60px; display: block; }
.sp-text { white-space: pre-wrap; word-wrap: break-word; font-size: 14px; line-height: 1.55; }
.sp-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sp-files small { color: var(--muted); }
.sp-reply textarea { width: 100%; }
.sp-reply-row { display: flex; gap: 8px; margin: 8px 0; }
.sp-reply-row input { flex: 1; }
.sp-attached { margin: 4px 0 8px; }
.sp-sig { margin: 6px 0 0; }
.sp-code { position: relative; }
.sp-code pre { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 12px; max-height: 320px; overflow: auto; white-space: pre; }
.sp-code button { position: absolute; top: 10px; right: 10px; }
#spTok { word-break: break-all; }
@media (max-width: 980px) { .sp-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .sp-list li { grid-template-columns: 1fr auto; } .sp-subj { grid-column: 1 / -1; grid-row: 2; } .sp-reply-row { flex-wrap: wrap; } }
.sp-toolbar input, .sp-reply textarea, .sp-reply-row input, #spSigForm textarea, #cpFind {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.sp-toolbar input:focus, .sp-reply textarea:focus, .sp-reply-row input:focus, #spSigForm textarea:focus, #cpFind:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.sp-reply textarea, #spSigForm textarea { resize: vertical; line-height: 1.5; }
.sp-files small { margin-left: 6px; }
.legal-agree { margin: 14px 0 0 !important; text-align: center; }
.legal-agree a { color: var(--blue); }

/* ---------- support view banner, deletion ---------- */
.view-banner { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 9px 16px; background: var(--red); color: #fff; font-size: 14px; }
.view-banner button { background: #fff; color: var(--red); border: 0; border-radius: 7px; padding: 5px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.lc-danger { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.lc-danger h2 { color: var(--red); }
.lc-delete-btn { color: var(--red) !important; border-color: color-mix(in srgb, var(--red) 45%, var(--line)) !important; }
.lc-lock { max-width: 720px; margin: 40px auto; text-align: center; }
.lc-lock h1 { font-size: 26px; margin: 0 0 10px; color: var(--ink); }
.lc-lock .actions { justify-content: center; margin-top: 18px; }
.cp-del { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.view-banner[hidden] { display: none; }

/* ---------- two-step sign-in ---------- */
.ts-modal { max-width: 460px; }
.ts-qr { display: flex; justify-content: center; margin: 8px 0; }
.ts-qr svg { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.ts-key { display: inline-block; margin-top: 4px; font-size: 13px; letter-spacing: .5px; word-break: break-all; }
.ts-steps { margin: 6px 0; padding-left: 20px; font-size: 14px; color: var(--text); }
.ts-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.ts-codes code { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; font-size: 15px; letter-spacing: 1px; }
.ts-gate { max-width: 640px; }
.ts-choice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 8px 0; cursor: pointer; }
.ts-choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.ts-choice input { margin-top: 3px; width: auto; }
.ts-choice span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--ink); }
.ts-choice small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.ts-soon { margin-top: 6px !important; font-style: italic; }
.auth-card .remember { display: flex !important; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 14px; color: var(--text); cursor: pointer; }
.auth-card .remember input { width: auto; margin: 0; }

/* Pay application > Lien waiver: 1. map with AI -> 2. open on screen; or skip the AI */
.wv-steps { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; margin: 10px 0 12px; }
.wv-step { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--panel); }
.wv-step b { display: block; font-size: 15px; } .wv-step small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 3px; }
.wv-step.now { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 15%, transparent); }
.wv-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--soft); color: var(--muted); }
.wv-step.now .wv-n { background: var(--blue); color: var(--on-blue); } .wv-step.done .wv-n { background: #2FA36B; color: #fff; }
.wv-arrow { align-self: center; font-size: 26px; color: var(--muted); }
.wv-skip { margin: 4px 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--soft); font-size: 13px; color: var(--muted); }
.wv-skip .text-button { font-size: 13px; padding: 0; }
@media (max-width: 760px) { .wv-steps { grid-template-columns: 1fr; } .wv-arrow { transform: rotate(90deg); justify-self: center; } }

/* Email to contractor: sent log and dialog */
.pk-sent{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:6px}
.pk-sent li{font-size:14px}
.pk-sent small{display:block;margin-top:2px}
.pk-from,.pk-attach{font-size:14px}
.pk-attach{padding:8px 10px;border:1px solid var(--line,#E3E6EE);border-radius:8px}
.modal-card textarea[name="message"]{min-height:170px}

/* Saved signature */
.sig-preview{display:inline-block;margin-top:8px;padding:6px 10px;border:1px solid var(--line,#E3E6EE);border-radius:8px;background:#fff}
.sig-preview img{display:block;max-height:56px;max-width:260px}
.sig-preview.small{display:block;width:max-content;margin:6px 0 4px}
.sig-preview.small img{max-height:40px;max-width:200px}
.sig-choice{align-items:flex-start;margin:12px 0 4px}
.sig-card{max-width:680px;width:calc(100vw - 32px)}
#sigPad{width:100%;height:auto;aspect-ratio:10/3;border:1px dashed #9AA3B8;border-radius:10px;background:#fff;touch-action:none;cursor:crosshair}

.we-sighint{font-size:13px;color:var(--muted,#6B7390);margin:4px 0 8px}
.we-sig{position:absolute;border:1.5px dashed #3B5BDB;border-radius:4px;background:rgba(59,91,219,.05);cursor:move;touch-action:none}
.we-sig img{width:100%;height:100%;object-fit:contain;object-position:left bottom;pointer-events:none}
.we-sig .we-del{position:absolute;top:-10px;right:-10px}
.we-sig-size{position:absolute;right:-6px;bottom:-6px;width:12px;height:12px;border-radius:3px;background:#3B5BDB;cursor:nwse-resize}
.we-sig:focus{outline:2px solid #3B5BDB;outline-offset:2px}
.we-ph-sig{background:rgba(59,91,219,.05);border:1px dashed #9AA3B8}
.we-ph-sig img{width:100%;height:100%;object-fit:contain;object-position:left bottom}
.we-sig .we-del{opacity:1;background:#fff;border:1px solid #CFD4E2;border-radius:50%;width:20px;height:20px;display:grid;place-items:center;padding:0;cursor:pointer}

@keyframes weSigPulse{0%{box-shadow:0 0 0 0 rgba(59,91,219,.55)}100%{box-shadow:0 0 0 14px rgba(59,91,219,0)}}
.we-sig-new{animation:weSigPulse 1.2s ease-out 2}

.sig-styles{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px;max-height:46vh;overflow:auto;padding:2px}
.sig-style{display:flex;flex-direction:column;gap:2px;border:1px solid var(--line,#E3E6EE);border-radius:10px;padding:8px 10px;cursor:pointer;background:#fff}
.sig-style:has(input:checked){border-color:#3B5BDB;box-shadow:0 0 0 2px rgba(59,91,219,.25)}
.sig-style input{position:absolute;opacity:0;pointer-events:none}
.sig-sample{font-size:30px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sig-style small{color:var(--muted,#6B7390);font-size:11px}
.sig-ink{display:flex;gap:14px;align-items:center;margin:10px 0 2px}

.we-sig-tools{position:absolute;left:0;top:-26px;display:flex;gap:4px}
.we-sig-btn{width:22px;height:22px;border-radius:6px;border:1px solid #CFD4E2;background:#fff;color:#1B2235;font-weight:800;font-size:14px;line-height:1;padding:0;cursor:pointer}
.we-sig-btn:hover{border-color:#3B5BDB;color:#3B5BDB}

/* Pay app steps */
.pa-steps{list-style:none;margin:0 0 14px;padding:10px;display:flex;flex-wrap:wrap;gap:6px;background:var(--panel,#fff);border:1px solid var(--line,#E3E6EE);border-radius:14px}
.pa-steps li{display:flex;align-items:center}
.pa-steps li+li::before{content:"→";color:#9AA3B8;margin:0 4px 0 0;font-weight:700}
.pa-steps button{display:flex;align-items:center;gap:8px;border:1px solid transparent;background:none;border-radius:10px;padding:6px 10px 6px 6px;cursor:pointer;font:inherit;color:#6B7390;text-align:left}
.pa-steps button:hover{background:#F3F5FA}
.pa-steps span small{display:block;font-size:11px;font-weight:600;color:#9AA3B8;line-height:1.1}
.pa-steps span small.next{color:#3B5BDB}
.pa-steps .done button{color:#1B2235}
.pa-steps .done .step-n{background:#2E9E62;color:#fff;border-color:#2E9E62}
.pa-steps .now button{background:#EEF1FF;border-color:#C9D3FA;color:#1B2235;font-weight:700}
.pa-steps .now .step-n{background:#3B5BDB;color:#fff;border-color:#3B5BDB}
.step-n{display:inline-grid;place-items:center;flex:none;width:24px;height:24px;border-radius:50%;border:1.5px solid #9AA3B8;color:#6B7390;font-size:13px;font-weight:800;margin-right:8px;vertical-align:middle;line-height:1}
.pa-steps .step-n{margin-right:0}
h2 .step-n{background:#EEF1FF;border-color:#3B5BDB;color:#3B5BDB}
.primary-button .step-n.inv{width:20px;height:20px;font-size:11px;border-color:rgba(255,255,255,.7);color:#fff;margin-right:6px}
.step-arrow{text-align:center;color:#9AA3B8;font-size:22px;font-weight:700;line-height:1;margin:2px 0 8px}
.step-then{font-size:13px;font-weight:600;color:#9AA3B8;margin-left:6px}
.panel.step-now{border-color:#3B5BDB;box-shadow:0 0 0 3px rgba(59,91,219,.12)}
button.step-now{box-shadow:0 0 0 3px rgba(59,91,219,.25)}
@keyframes stepFlash{0%{box-shadow:0 0 0 0 rgba(59,91,219,.5)}100%{box-shadow:0 0 0 16px rgba(59,91,219,0)}}
.step-flash{animation:stepFlash 1s ease-out 2}
@media (max-width:700px){.pa-steps li+li::before{display:none}.pa-steps button{padding:4px 8px 4px 4px}}

.pa-steps{flex-wrap:nowrap;overflow-x:auto;gap:2px}
.pa-steps li{flex:none}
.wv-n{min-width:24px;width:auto!important;padding:0 4px;font-size:12px}
@media (max-width:900px){.pa-steps{flex-wrap:wrap}}

@keyframes glowBlue{0%,100%{box-shadow:0 0 0 0 rgba(59,91,219,.55),0 0 10px 2px rgba(59,91,219,.35)}50%{box-shadow:0 0 0 7px rgba(59,91,219,0),0 0 22px 6px rgba(59,91,219,.55)}}
button.glow{animation:glowBlue 1.6s ease-in-out infinite;background:#3B5BDB!important;color:#fff!important;border-color:#3B5BDB!important}
button.glow .step-n.inv{border-color:rgba(255,255,255,.8);color:#fff}
@media (prefers-reduced-motion:reduce){button.glow{animation:none;box-shadow:0 0 0 4px rgba(59,91,219,.35)}}
