/* @ekm-tags: style, misc, patient, hr */
/* @ekm-tags+: patient, hr */
/* EKM Sign — staff screens (js/ekm-esign.js) and the signing form (js/ekm-esign-form.js). Built on the portal's theme tokens
   (--c-*, --status-*), so it follows the active theme, light or dark. */
.esg, .esg-ws, .esf-doc, .esp-body {
  --esg-bg: var(--c-bg, #F3EDE4);
  --esg-card: var(--c-box, #FAF6EF);
  --esg-border: var(--c-box-border, #D9D0C4);
  --esg-ink: var(--c-ink, #1C1814);
  --esg-ink2: var(--c-ink2, #3D3830);
  --esg-muted: var(--c-muted, #5A5248);
  --esg-danger: var(--status-danger-ink, #B23A2E);
  --esg-danger-bg: var(--status-danger-bg, rgba(178, 58, 46, 0.11));
  --esg-ok: var(--status-success-ink, #2E8B4F);
  --esg-ok-bg: var(--status-success-bg, rgba(46, 139, 79, 0.12));
  --esg-wait: var(--status-pending-ink, #B8752E);
  --esg-wait-bg: var(--status-pending-bg, rgba(217, 166, 92, 0.18));
  --esg-font: var(--font-ui, 'DM Sans', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-family: var(--esg-font);
  color: var(--esg-ink);
}
.esg { font-size: 14px; line-height: 1.45; }
.esg h4 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--esg-muted); }
.esg-h { margin: 0; font-size: 17px; font-weight: 650; }
.esg-sub { margin: 4px 0 10px; color: var(--esg-muted); font-size: 13px; }
.esg-muted { color: var(--esg-muted); font-size: 12.5px; }
.esg-small { font-size: 12px; margin-top: 16px; }
.esg-empty { color: var(--esg-muted); padding: 14px 0; margin: 0; }
.esg-alert { background: var(--esg-danger-bg); color: var(--esg-danger); border-radius: 8px; padding: 9px 12px; margin: 0 0 12px; }
.esg-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.esg-bar > .esg-h { flex: 1; align-self: center; }
.esg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.esg-btn { font: inherit; font-size: 13px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--esg-border); background: var(--esg-card); color: var(--esg-ink); cursor: pointer; }
.esg-btn:hover:not(:disabled) { border-color: var(--esg-ink2); }
.esg-btn:disabled { opacity: .55; cursor: default; }
.esg-btn--primary { background: var(--esg-ink); color: var(--esg-card); border-color: var(--esg-ink); }
.esg-btn:focus-visible, .esg-tab:focus-visible, .esg-row-btn:focus-visible { outline: 2px solid var(--esg-ink); outline-offset: 2px; }
.esg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--esg-border); margin-bottom: 14px; }
.esg-tab { font: inherit; font-size: 14px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--esg-muted); cursor: pointer; }
.esg-tab.is-active { color: var(--esg-ink); border-bottom-color: var(--esg-ink); font-weight: 600; }
.esg-filter { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--esg-muted); margin-bottom: 8px; }
.esg-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--esg-border); }
.esg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--esg-border); padding: 8px 0; flex-wrap: wrap; }
.esg-row-btn { font: inherit; text-align: left; background: none; border: 0; padding: 4px 0; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 220px; }
div.esg-row-btn { cursor: default; }
.esg-row-title { font-weight: 600; }
.esg-row-sub { color: var(--esg-muted); font-size: 12.5px; }
.esg-row-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.esg-chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, .06); color: var(--esg-ink2); white-space: nowrap; }
.esg-chip--pending { background: var(--esg-wait-bg); color: var(--esg-wait); }
.esg-chip--stable { background: var(--esg-ok-bg); color: var(--esg-ok); }
.esg-chip--danger { background: var(--esg-danger-bg); color: var(--esg-danger); }
.esg-detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.esg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.esg-table th { text-align: left; font-weight: 600; color: var(--esg-muted); border-bottom: 1px solid var(--esg-border); padding: 6px 8px 6px 0; }
.esg-table td { vertical-align: top; border-bottom: 1px solid var(--esg-border); padding: 8px 8px 8px 0; }
.esg-answers dl { display: grid; grid-template-columns: minmax(140px, 32%) 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.esg-answers dt { color: var(--esg-muted); }
.esg-answers dd { margin: 0; white-space: pre-wrap; }
.esg-answers h4 { text-transform: none; letter-spacing: 0; color: var(--esg-ink2); }
.esg-events { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.esg-events li { padding: 3px 0; }
.esg-events li > span:first-child { color: var(--esg-muted); display: inline-block; min-width: 170px; }
.esg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; margin: 8px 0; }
.esg-grid label, .esg-wide { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--esg-muted); }
.esg-wide { margin: 8px 0; }
.esg-grid .esg-wide { grid-column: 1 / -1; margin: 0; }
.esg-check { flex-direction: row !important; align-items: center; gap: 6px !important; color: var(--esg-ink2) !important; }
.esg input[type=text], .esg input[type=email], .esg input[type=number], .esg input[type=date], .esg select, .esg textarea {
  font: inherit; font-size: 14px; color: var(--esg-ink); background: var(--esg-card); border: 1px solid var(--esg-border); border-radius: 7px; padding: 7px 9px; width: 100%; box-sizing: border-box;
}
.esg textarea { resize: vertical; }
.esg-signer { border: 1px solid var(--esg-border); border-radius: 10px; padding: 8px 14px 6px; margin: 10px 0; }
.esg-signer legend { font-weight: 600; padding: 0 6px; }
.esg-editor { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.esg-editor-preview { position: sticky; top: 8px; border: 1px solid var(--esg-border); border-radius: 12px; padding: 14px; background: var(--esg-bg); max-height: 80vh; overflow: auto; }
.esg-blk { border: 1px solid var(--esg-border); border-radius: 10px; padding: 8px 12px 10px; margin: 8px 0; background: var(--esg-card); }
.esg-blk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.esg-blk-type { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--esg-muted); }
.esg-blk-tools .esg-btn { padding: 3px 8px; font-size: 12px; margin-left: 4px; }
.esg-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--esg-muted); margin-bottom: 6px; }
@media (max-width: 860px) { .esg-editor { grid-template-columns: 1fr; } .esg-editor-preview { position: static; } }

/* Workspace overlay */
.esg-ws { position: fixed; inset: 0; z-index: 9000; background: var(--esg-bg); display: flex; flex-direction: column; overflow: hidden; }
.esg-ws[hidden] { display: none; }
.esg-ws-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--esg-border); background: var(--esg-card); }
.esg-ws-title { margin: 0; font-family: var(--font-display, Georgia, serif); font-size: 24px; }
.esg-ws-body { flex: 1; overflow: auto; padding: 18px 24px 40px; max-width: 1180px; width: 100%; margin: 0 auto; box-sizing: border-box; }
/* Workspace redesign (owner 2026-11-13: "easier to navigate/use", "should land on templates"). Dense and calm like the Inbox
   restyle: square-ish corners (4px), 44px targets, one action row, tabs with small ink-square counts, lists in one card. */
.esg-ws .esg-btn { min-height: 40px; border-radius: 4px; padding: 0 14px; }
.esg-ws .esg-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.esg-ws .esg-tabs { gap: 2px; margin-bottom: 16px; }
.esg-ws .esg-tab { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; }
.esg-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
  border-radius: 3px; background: var(--esg-ink); color: var(--esg-card); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.esg-tab:not(.is-active) .esg-tab-count { background: var(--esg-border); color: var(--esg-ink); }
.esg-note { margin: 0 0 12px; padding-left: 10px; border-left: 2px solid var(--esg-border); color: var(--esg-muted); font-size: 13px; }
.esg-emptybox { background: var(--esg-card); border: 1px solid var(--esg-border); border-radius: 4px; padding: 28px 22px; text-align: center; }
.esg-emptybox-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.esg-emptybox-line { margin: 0 auto; max-width: 520px; color: var(--esg-muted); font-size: 13px; }
.esg-emptybox-acts { justify-content: center; margin-bottom: 0; }
.esg-listtools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 10px; }
.esg-listtools:empty { display: none; }
.esg-search { min-height: 40px; width: 260px; max-width: 100%; box-sizing: border-box; border: 1px solid var(--esg-border); border-radius: 4px; background: var(--esg-card); color: var(--esg-ink); padding: 0 12px; font: inherit; font-size: 13px; }
.esg-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--esg-muted); }
.esg-tplcard { background: var(--esg-card); border: 1px solid var(--esg-border); border-radius: 4px; }   /* not overflow:hidden: the More menu must show */
.esg-tplhead, .esg-tplrow { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 100px 96px 250px; gap: 14px; align-items: center; padding: 10px 16px; }
.esg-tplhead { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--esg-muted); border-bottom: 1px solid var(--esg-border); padding-top: 8px; padding-bottom: 8px; }
.esg-tpllist { list-style: none; margin: 0; padding: 0; }
.esg-tplrow { border-bottom: 1px solid var(--esg-border); min-height: 56px; }
.esg-tplrow:last-child { border-bottom: 0; }
.esg-tplrow:hover { background: var(--esg-bg); }
.esg-tplname { display: flex; flex-direction: column; min-width: 0; }
.esg-tplname .esg-row-title { overflow-wrap: anywhere; }
.esg-tplcell { font-size: 13px; color: var(--esg-ink2); min-width: 0; overflow-wrap: anywhere; }
.esg-tplacts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.esg-sendhint { font-size: 12px; align-self: center; cursor: help; white-space: nowrap; }
.esg-ws .esg-list { background: var(--esg-card); border: 1px solid var(--esg-border); border-radius: 4px; padding: 0 16px; }
.esg-ws .esg-list .esg-row { min-height: 56px; }
.esg-ws .esg-list .esg-row:last-child { border-bottom: 0; }
.esg-more { position: relative; }
.esg-more > summary { list-style: none; display: inline-flex; align-items: center; }
.esg-more > summary::-webkit-details-marker { display: none; }
.esg-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: flex; flex-direction: column; gap: 4px; min-width: 150px; padding: 6px;
  background: var(--esg-card); border: 1px solid var(--esg-border); border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.esg-menu .esg-btn { width: 100%; text-align: left; }
@media (max-width: 600px) {
  .esg-ws .esg-ws-body { padding: 14px 16px 32px; }
  .esg-ws .esg-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .esg-ws .esg-tab { white-space: nowrap; flex: 0 0 auto; }
}
@media (max-width: 1100px) {
  .esg-tplhead { display: none; }
  .esg-tplrow { grid-template-columns: 1fr auto; }
  .esg-tplrow .esg-tplcell:nth-of-type(2), .esg-tplrow .esg-tplcell:nth-of-type(3) { display: none; }
  .esg-tplacts { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 600px) { .esg-ws-top, .esg-ws-body { padding-left: 16px; padding-right: 16px; } }

/* Signing form */
.esf-doc { max-width: 760px; margin: 0 auto; background: var(--esg-card); border: 1px solid var(--esg-border); border-radius: 14px; padding: 22px 26px; font-size: 15px; line-height: 1.55; }
.esg-editor-preview .esf-doc { padding: 16px; font-size: 14px; }
.esf-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--esg-muted); }
.esf-title { margin: 4px 0 2px; font-size: 22px; }
.esf-sub { color: var(--esg-muted); font-size: 13px; }
.esf-head { border-bottom: 1px solid var(--esg-border); padding-bottom: 12px; margin-bottom: 14px; }
/* Letterhead on forms (owner 2026-11-09): practice details left, logo right, a fine bronze rule, as on the signed PDF */
.esf-lh { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1.5px solid #A7865F; }
.esf-lh-text { display: flex; flex-direction: column; font-size: 12.5px; line-height: 1.5; color: var(--esg-muted); }
.esf-lh-text strong { font-size: 14px; color: var(--esg-ink); letter-spacing: .01em; }
.esf-lh-logo { width: 56px; height: auto; flex: none; }
@media (max-width: 480px) { .esf-lh-text { font-size: 11.5px; } .esf-lh-logo { width: 46px; } }
.esf-h { margin: 18px 0 6px; font-size: 16px; }
.esf-p p { margin: 0 0 10px; }
.esf-status { background: rgba(0, 0, 0, .05); border-radius: 8px; padding: 9px 12px; }
.esf-field { margin: 12px 0; display: flex; flex-direction: column; gap: 5px; }
/* sections that only apply to some answers (show_if) open in place; text boxes grow with what is typed */
.esf-field[hidden] { display: none; }
.esf-field[data-esf-show-if] { padding-left: 14px; border-left: 2px solid var(--esg-border); animation: esf-open .18s ease-out; }
@keyframes esf-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .esf-field[data-esf-show-if] { animation: none; } }
textarea[data-esf-grow] { resize: vertical; min-height: 4.5em; overflow-y: hidden; }
.esf-label { font-size: 13px; font-weight: 600; color: var(--esg-ink2); }
.esf-who { font-weight: 400; color: var(--esg-muted); }
.esf-req { color: var(--esg-danger); }
.esf-answer { padding: 6px 0; white-space: pre-wrap; }
.esf-blank { color: var(--esg-muted); font-style: italic; }
.esf-doc input[type=text], .esf-doc input[type=date], .esf-doc select, .esf-doc textarea {
  font: inherit; font-size: 15px; color: var(--esg-ink); background: var(--esg-bg); border: 1px solid var(--esg-border); border-radius: 8px; padding: 9px 10px; width: 100%; box-sizing: border-box;
}
.esf-initials { max-width: 110px; text-transform: uppercase; }
.esf-check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; margin: 8px 0; cursor: pointer; }
.esf-check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.esf-sig { border-top: 1px dashed var(--esg-border); margin-top: 18px; padding-top: 12px; }
.esf-sig-name { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-size: 30px; line-height: 1.2; }
.esf-sig-meta { font-size: 12.5px; color: var(--esg-muted); }
.esf-sig-tabs { display: flex; gap: 6px; margin: 8px 0; }
.esf-tab { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--esg-border); background: none; color: var(--esg-ink2); cursor: pointer; }
.esf-tab.is-active { background: var(--esg-ink); color: var(--esg-card); border-color: var(--esg-ink); }
.esf-typed-preview { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-size: 32px; min-height: 46px; padding: 6px 0; border-bottom: 1px solid var(--esg-ink2); margin-top: 6px; }
.esf-typed-preview[hidden] { display: none; }
/* Typed signature styles (owner 2026-11-16, "like Adobe"; the sixteen realistic signature styles the owner chose 2026-11-18): the signer picks one;
   the typed name is shown and signed in it. font-size scales each style to a similar visual size.
   Fonts are served from this site (css/fonts; licences in css/fonts/ESIGN-FONTS-LICENSES.txt), never from Google. */
@font-face { font-family: "EKM Signature Bold"; src: url("fonts/esign-mr-dafoe.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Executive"; src: url("fonts/esign-mrs-saint-delafield.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Classic"; src: url("fonts/esign-herr-von-muellerhoff.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Refined"; src: url("fonts/esign-mr-de-haviland.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Flourish"; src: url("fonts/esign-monsieur-la-doulaise.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Modern"; src: url("fonts/esign-ms-madi.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Formal"; src: url("fonts/esign-mea-culpa.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Flowing"; src: url("fonts/esign-windsong.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Light"; src: url("fonts/esign-corinthia.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Natural"; src: url("fonts/esign-allison.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Elegant"; src: url("fonts/esign-ephesis.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Ornate"; src: url("fonts/esign-imperial-script.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Swash"; src: url("fonts/esign-bilbo-swash-caps.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Italic"; src: url("fonts/esign-italianno.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Polished"; src: url("fonts/esign-great-vibes.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EKM Signature Script"; src: url("fonts/esign-petit-formal-script.woff2") format("woff2"); font-weight: 400; font-display: swap; }
.esf-font-bold { font-family: "EKM Signature Bold", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-bold { font-size: 30px; } .esf-style-name.esf-font-bold { font-size: 32px; }
.esf-font-executive { font-family: "EKM Signature Executive", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-executive { font-size: 37px; } .esf-style-name.esf-font-executive { font-size: 39px; }
.esf-font-classic { font-family: "EKM Signature Classic", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-classic { font-size: 28px; } .esf-style-name.esf-font-classic { font-size: 30px; }
.esf-font-refined { font-family: "EKM Signature Refined", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-refined { font-size: 36px; } .esf-style-name.esf-font-refined { font-size: 39px; }
.esf-font-flourish { font-family: "EKM Signature Flourish", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-flourish { font-size: 23px; } .esf-style-name.esf-font-flourish { font-size: 24px; }
.esf-font-modern { font-family: "EKM Signature Modern", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-modern { font-size: 31px; } .esf-style-name.esf-font-modern { font-size: 33px; }
.esf-font-formal { font-family: "EKM Signature Formal", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-formal { font-size: 25px; } .esf-style-name.esf-font-formal { font-size: 27px; }
.esf-font-flowing { font-family: "EKM Signature Flowing", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-flowing { font-size: 21px; } .esf-style-name.esf-font-flowing { font-size: 22px; }
.esf-font-light { font-family: "EKM Signature Light", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-light { font-size: 36px; } .esf-style-name.esf-font-light { font-size: 38px; }
.esf-font-natural { font-family: "EKM Signature Natural", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-natural { font-size: 39px; } .esf-style-name.esf-font-natural { font-size: 41px; }
.esf-font-elegant { font-family: "EKM Signature Elegant", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-elegant { font-size: 30px; } .esf-style-name.esf-font-elegant { font-size: 32px; }
.esf-font-ornate { font-family: "EKM Signature Ornate", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-ornate { font-size: 34px; } .esf-style-name.esf-font-ornate { font-size: 36px; }
.esf-font-swash { font-family: "EKM Signature Swash", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-swash { font-size: 33px; } .esf-style-name.esf-font-swash { font-size: 35px; }
.esf-font-italic { font-family: "EKM Signature Italic", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-italic { font-size: 39px; } .esf-style-name.esf-font-italic { font-size: 41px; }
.esf-font-polished { font-family: "EKM Signature Polished", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-polished { font-size: 30px; } .esf-style-name.esf-font-polished { font-size: 32px; }
.esf-font-script { font-family: "EKM Signature Script", "Snell Roundhand", "Segoe Script", cursive; }
.esf-typed-preview.esf-font-script { font-size: 22px; } .esf-style-name.esf-font-script { font-size: 23px; }
.esf-sig-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 10px; }
.esf-sig-styles[hidden] { display: none; }
.esf-style { font: inherit; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--esg-border); background: var(--esg-card); color: var(--esg-ink); cursor: pointer; text-align: left; overflow: hidden; }
.esf-style.is-active { border: 2px solid var(--esg-ink); padding: 7px 9px; }
.esf-style:focus-visible { outline: 2px solid var(--esg-ink); outline-offset: 2px; }
.esf-style-name { font-size: 34px; line-height: 1.45; align-self: stretch; border-bottom: 1px solid var(--esg-border); padding-bottom: 2px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.esf-style-label { font-size: 12px; color: var(--esg-muted); }
.esf-pad-wrap { margin-top: 8px; }
.esf-pad { width: 100%; max-width: 600px; height: auto; aspect-ratio: 600 / 160; background: #fff; border: 1px solid var(--esg-border); border-radius: 8px; display: block; cursor: crosshair; }
.esf-consent { margin-top: 22px; border-top: 1px solid var(--esg-border); padding-top: 12px; }
.esf-consent-text { font-size: 13px; color: var(--esg-muted); max-height: 160px; overflow: auto; background: var(--esg-bg); border-radius: 8px; padding: 8px 12px; }
.esf-consent-text p { margin: 0 0 6px; }
.esf-error { color: var(--esg-danger); background: var(--esg-danger-bg); border-radius: 8px; padding: 8px 12px; }
.esf-error[hidden] { display: none; }
.esf-actions { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.esf-btn { font: inherit; font-size: 15px; padding: 10px 22px; border-radius: 9px; border: 1px solid var(--esg-ink); background: var(--esg-ink); color: var(--esg-card); cursor: pointer; }
.esf-link { font: inherit; font-size: 13px; background: none; border: 0; color: var(--esg-muted); text-decoration: underline; cursor: pointer; padding: 4px 0; }
@media (max-width: 600px) { .esf-doc { padding: 16px; border-radius: 0; border-left: 0; border-right: 0; } }

/* Signing page (sign.html) and the portal's "Documents to sign" (js/ekm-esign-signer.js) */
.esp-body { margin: 0; min-height: 100vh; background: var(--c-bg, #F3EDE4); color: var(--c-ink, #1C1814); font-family: var(--font-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif); }
.esp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 16px 24px; border-bottom: 1px solid var(--c-box-border, #D9D0C4); background: var(--c-box, #FAF6EF); }
.esp-brand { font-family: var(--font-display, Georgia, serif); font-size: 20px; font-weight: 600; }
.esp-secure { font-size: 13px; color: var(--c-muted, #5A5248); }
.esp { padding: 24px 16px 48px; }
.esp-inner { max-width: 760px; margin: 0 auto; }
.esp-card { background: var(--c-box, #FAF6EF); border: 1px solid var(--c-box-border, #D9D0C4); border-radius: 14px; padding: 22px 24px; font-size: 15px; line-height: 1.55; }
.esp-h { margin: 0 0 12px; font-size: 21px; outline: none; }
.esp-card input[type=date], .esp-card input[type=text] { font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid var(--c-box-border, #D9D0C4); border-radius: 8px; background: var(--c-bg, #F3EDE4); color: inherit; width: 100%; max-width: 280px; box-sizing: border-box; margin-top: 6px; }
.esp-code { letter-spacing: 6px; font-variant-numeric: tabular-nums; }
.esp-note { color: var(--c-muted, #5A5248); font-size: 13.5px; }
.esp-help { color: var(--c-muted, #5A5248); font-size: 13.5px; margin-top: 18px; }
.esp-help a { color: inherit; }
.esp-wait { text-align: center; color: var(--c-muted, #5A5248); padding: 40px 0; }
.esp-list { list-style: none; margin: 0; padding: 0; }
.esp-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--c-box-border, #D9D0C4); }
.esp-item-title { font-weight: 600; }
.esp-item-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.esp-btn--plain { background: none !important; color: var(--c-ink, #1C1814) !important; border-color: var(--c-box-border, #D9D0C4) !important; }
.esp-after { justify-content: center; }
.esp [aria-busy="true"] { cursor: progress; }
@media (max-width: 600px) { .esp { padding: 0 0 40px; } .esp-card { border-radius: 0; border-left: 0; border-right: 0; } .esp-top { padding: 12px 16px; } }
/* Focus is moved to the heading on each new screen for screen readers; no ring for that programmatic focus. */
.esp-h[tabindex="-1"]:focus, .esf-title[tabindex="-1"]:focus { outline: none; }

/* Redesign 2030 rules (tests/redesign-2030-guard-browser.test.mjs; owner 2026-10-26): every control at least 44 px tall (touch
   size), no capsule pills, no rounded boxes inside the page (corners under 8 px: the chart's own sheet is the one surface). */
.esg-btn, .esg-tab, .esf-btn, .esf-link, .esf-tab { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.esg-row-btn { min-height: 44px; justify-content: center; }
.esg input[type=text], .esg input[type=email], .esg input[type=number], .esg input[type=date], .esg select, .esg textarea,
.esf-doc input[type=text], .esf-doc input[type=date], .esf-doc select, .esf-doc textarea,
.esp-card input[type=date], .esp-card input[type=text] { min-height: 44px; }
.esg-chip { border-radius: 4px; }
.esf-tab { border-radius: 6px; }
.esg-btn, .esg-alert, .esg-signer, .esg-blk, .esg-editor-preview, .esf-doc, .esf-status, .esf-consent-text, .esf-error, .esf-btn, .esf-pad, .esp-card,
.esg input, .esg select, .esg textarea, .esf-doc input, .esf-doc select, .esf-doc textarea, .esp-card input { border-radius: 6px; }

/* ── PDF templates (Adobe-style, 2026-11-05): the original pages with boxes on top ─────────────────────────────────────
   Pages are drawn by pdf.js into .esx-canvas; boxes are positioned in % of the page (js/ekm-esign-pdf.js place/boxStyle).
   Boxes on a page must match the PDF's own blanks, so they are exempt from the 44 px control size (a page field is
   often 20 px tall); the buttons and inputs around the page keep it. Corners stay under 8 px; no pills. */
.esx-page { position: relative; width: 100%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); margin: 0 auto; overflow: hidden; }
.esx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.esx-layer { position: absolute; inset: 0; }
.esx-pagenum { text-align: center; font-size: 12px; color: var(--esg-muted); margin: 6px 0 18px; }

/* Editor (EKM OS → EKM Sign → Templates) */
.esx-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; position: sticky; top: 0; z-index: 3; background: var(--esg-bg); padding: 8px 0; border-bottom: 1px solid var(--esg-border); }
.esx-tools [data-arm][aria-pressed="true"] { background: var(--esg-ink); color: var(--esg-card); border-color: var(--esg-ink); }
.esx-rolepick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--esg-muted); }
.esx-rolepick select { min-height: 44px; }
.esx-hint { flex-basis: 100%; }
/* Find the blanks (owner 2026-11-17): the summary, its options and Undo, under the toolbar */
.esx-fb { border: 1px solid var(--esg-border); border-radius: 6px; background: var(--esg-card); padding: 4px 14px 10px; margin: 0 0 10px; font-size: 13px; }
.esx-fb[hidden] { display: none; }
.esx-fb h4 { margin: 8px 0 4px; }
.esx-fb-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 6px 0; }
.esx-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.esx-pages { min-width: 0; max-width: 900px; }
.esx-pages.is-placing .esx-layer { cursor: crosshair; }
.esx-side { position: sticky; top: 70px; border: 1px solid var(--esg-border); border-radius: 6px; padding: 4px 14px 14px; background: var(--esg-card); font-size: 13px; }
.esx-roles { list-style: none; margin: 0; padding: 0; }
.esx-roles li { display: flex; align-items: center; gap: 6px; padding: 3px 0; flex-wrap: wrap; }
.esx-dot { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.esx-warn { color: var(--esg-danger); font-weight: 600; }
.esx-props { grid-template-columns: 1fr; }
.esx-box { position: absolute; box-sizing: border-box; border: 2px solid var(--esx-c, #2c5fbe); background: color-mix(in srgb, var(--esx-c, #2c5fbe) 14%, transparent); border-radius: 3px; padding: 0 3px; margin: 0; font: inherit; font-size: 11px; color: var(--esx-c, #2c5fbe); cursor: move; display: flex; align-items: center; overflow: hidden; touch-action: none; min-height: 0; }
.esx-box.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--esx-c, #2c5fbe); z-index: 2; }
.esx-box:focus-visible { outline: 2px solid var(--esg-ink); outline-offset: 2px; }
.esx-box-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; font-weight: 600; }
.esx-handle { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; background: var(--esx-c, #2c5fbe); cursor: nwse-resize; }
.esx-ghost { position: absolute; border: 2px dashed var(--esg-ink); background: rgba(44, 95, 190, .08); pointer-events: none; }
.esx-foot { padding: 10px 0; border-top: 1px solid var(--esg-border); }
.esx-save { margin-left: auto; }
@media (max-width: 900px) { .esx-main { grid-template-columns: 1fr; } .esx-side { position: static; } }

/* Signing a PDF (EKM OS, sign.html, the patient portal) */
.esf-doc--pdf { max-width: 900px; }
.esf-pdf { margin: 12px 0 8px; }
/* Guided signing (owner 2026-11-12, "like DocuSign"): pinned to the BOTTOM of the screen so a site's sticky, blurred header can
   never cover it; --esf-guide-bottom lifts it above another bottom bar (the website intake's actions). */
.esf-guide-hint { margin: 6px 0 10px; color: var(--esg-ink2); font-size: 14px; }
.esf-guide { position: sticky; bottom: var(--esf-guide-bottom, 0px); z-index: 6; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: 12px 0; padding: 10px 14px; background: var(--esg-card); color: var(--esg-ink); border: 2px solid #E8B70A; border-radius: 14px;
  box-shadow: 0 -8px 24px rgba(28, 24, 20, .18); }
.esf-guide-left { font-weight: 700; font-size: 16px; }
.esf-guide-go { min-height: 46px; min-width: 120px; padding: 8px 24px; font-size: 17px; font-weight: 700; }
.esf-guide-go.is-finish { background: var(--esg-ok); border-color: var(--esg-ok); color: #fff; }
.esf-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* the flag in the page margin that points at the box to do now */
.esf-flag { position: absolute; z-index: 5; transform: translate(calc(-100% - 6px), -50%); padding: 5px 16px 5px 9px; background: #F5C518; color: #1C1814;
  font: 700 13px/1 var(--esg-font); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.esf-flag.is-above { transform: translate(-4px, calc(-100% - 5px)); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), 18px calc(100% - 7px), 10px 100%, 2px calc(100% - 7px), 0 calc(100% - 7px));
  padding: 5px 10px 12px 9px; }
.esf-ov.is-current { outline: 3px solid #E8B70A; outline-offset: 2px; animation: esf-pulse 1.1s ease-in-out 3; z-index: 4; }
@keyframes esf-pulse { 50% { outline-color: rgba(232, 183, 10, .25); box-shadow: 0 0 0 6px rgba(245, 197, 24, .35); } }
@media (prefers-reduced-motion: reduce) { .esf-ov.is-current { animation: none; } }
/* "Adopt your signature" opens as a dialog the first time a Sign here box is pressed */
.esf-adopt-dialog-acts { display: none; }
.esf-adopt-dlg { padding: 0; border: 0; background: transparent; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: visible; }
.esf-adopt-dlg::backdrop { background: rgba(28, 24, 20, .55); }
.esf-adopt.is-dialog { box-sizing: border-box; margin: 0; padding: 18px 20px; max-height: calc(100vh - 32px); overflow: auto; background: var(--esg-card, #FAF6EF); color: var(--esg-ink, #1C1814);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.esf-adopt.is-dialog .esf-adopt-dialog-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
/* sixteen styles make the dialog scroll on a phone: its buttons stay in sight at the bottom */
.esf-adopt.is-dialog .esf-adopt-dialog-acts { position: sticky; bottom: -18px; margin: 14px -20px -18px; padding: 12px 20px 18px; background: var(--esg-card, #FAF6EF); border-top: 1px solid var(--esg-border, #E2D9CC); }
.esf-adopt { margin-top: 18px; border-top: 1px solid var(--esg-border); padding-top: 12px; }
.esf-h { margin: 0 0 4px; font-size: 17px; }
.esf-doc .esf-ov, .esf-doc input.esf-ov { position: absolute; box-sizing: border-box; margin: 0; min-height: 0; border-radius: 2px; font: inherit; font-size: 12px; line-height: 1.1; }
.esf-doc input.esf-ov { padding: 0 3px; border: 1px solid #2c5fbe; background: rgba(44, 95, 190, .08); color: #111; max-width: none; width: auto; }
.esf-doc input.esf-ov:focus { outline: 2px solid #2c5fbe; outline-offset: 1px; background: #fff; }
.esf-doc .esf-ov--req { border-color: #b23a2e; background: rgba(178, 58, 46, .07); }
.esf-ov--check { display: flex; align-items: center; justify-content: center; border: 1px solid #2c5fbe; background: rgba(44, 95, 190, .08); cursor: pointer; }
.esf-ov--check input { margin: 0; width: 80%; height: 80%; min-height: 0; }
.esf-ov--sign { border: 2px solid #c2407a; background: #fff2c2; color: #5b1d38; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 4px; overflow: hidden; }
.esf-ov--sign:focus-visible { outline: 2px solid #111; outline-offset: 1px; }
.esf-ov--sign.is-applied { background: rgba(255, 255, 255, .6); border: 1px dashed #2c5fbe; color: #111; font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-weight: 400; font-size: 18px; }
.esf-ov--sign img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.esf-ov--auto, .esf-ov--done { display: flex; align-items: center; padding: 0 3px; color: #111; overflow: hidden; white-space: nowrap; }
/* a patient detail EKM Psychiatry filled in (read-only): a light tint so it reads as already done, not as a box to fill */
.esf-ov--data { background: rgba(37, 99, 235, .07); border-bottom: 1px dotted rgba(37, 99, 235, .45); font-size: 11px; }
.esf-ov--auto { background: rgba(44, 95, 190, .06); color: #1f3f7a; }
.esf-ov--sigdone { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-size: 16px; }
.esf-ov--other { border: 1px dashed #8a8a8a; background: rgba(0, 0, 0, .03); color: #6a6a6a; font-size: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; }

/* Import Word or PDF: the "check what was found" note above the form editor */
.esg-note { background: var(--esg-card); border: 1px solid var(--esg-border); border-left: 3px solid var(--esg-ink2); border-radius: 6px; padding: 10px 14px; margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; }
.esg-note ul { margin: 6px 0 0; padding-left: 18px; }

/* Saved signatures tab (js/ekm-provider-signature.js, owner 2026-11-13). Pages and boxes reuse the .esx-* PDF classes above. */
.psg-sec { border: 1px solid var(--esg-border); border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; background: var(--esg-card); }
.psg-note { background: var(--esg-ok-bg); color: var(--esg-ok); border-radius: 8px; padding: 9px 12px; margin: 0 0 12px; }
.psg-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--esg-muted); margin: 8px 0; max-width: 420px; }
.psg-label.psg-inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; max-width: none; white-space: nowrap; }
.psg-input { font: inherit; font-size: 14px; color: var(--esg-ink); background: var(--esg-card); border: 1px solid var(--esg-border); border-radius: 7px; padding: 7px 9px; min-height: 40px; }
.psg-padwrap { max-width: 600px; border: 1px dashed var(--esg-border); border-radius: 8px; background: #fff; }
.psg-pad { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.psg-upload { display: inline-flex; align-items: center; }
.psg-mine { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.psg-img { max-width: 260px; max-height: 90px; background: #fff; border: 1px solid var(--esg-border); border-radius: 6px; padding: 6px; }
.psg-pages { margin-top: 8px; }
.psg-box { display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: move; touch-action: none; font-size: 11px; color: #1a1a24; }
.psg-box img { max-width: 100%; max-height: 100%; pointer-events: none; }
.psg-box span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 14px 0 3px; pointer-events: none; }
.psg-x { position: absolute; top: -1px; right: -1px; width: 16px; height: 16px; line-height: 14px; padding: 0; font-size: 13px; border: 0; border-radius: 0 0 0 4px; background: var(--esg-ink); color: var(--esg-card); cursor: pointer; }
.psg-tools [aria-pressed="true"] { background: var(--esg-ink); color: var(--esg-card); border-color: var(--esg-ink); }
.psg-box--name, .psg-box--date { justify-content: flex-start; }   /* the stamped text starts at the box's left edge */
/* Typed signature (owner 2026-11-13: "like adobe where you type it in"): one card per script style, showing the typed name. */
.psg-modes { display: flex; gap: 6px; margin: 4px 0 10px; }
.psg-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; max-width: 900px; margin: 8px 0; }
.psg-font { font: inherit; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 14px; border: 1px solid var(--esg-border); border-radius: 10px; background: #fff; color: #1a1a24; cursor: pointer; text-align: left; min-height: 84px; }
.psg-font.is-active { border-color: var(--esg-ink); box-shadow: 0 0 0 2px var(--esg-ink); }
.psg-font:focus-visible { outline: 2px solid var(--esg-ink); outline-offset: 2px; }
.psg-font-sample { font-size: 40px; line-height: 1.45; align-self: stretch; border-bottom: 1px solid #b9b0a3; padding-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.psg-font-label { font-size: 11.5px; color: #5a5248; text-transform: uppercase; letter-spacing: .05em; }

/* EKM Sign letters (Phase 1, owner 2026-11-17): a letter as it prints on EKM letterhead (js/ekm-esign-letter.js). A page-like
   sheet (US Letter proportions, 1-inch margins at full width), serif body, calm spacing; placeholders are marked, never invented. */
.esl-controls { margin: 10px 0; }
.esl-controls select { min-width: min(100%, 340px); }
.esl-wrap { background: var(--esg-bg); border-radius: 8px; padding: 18px; overflow-x: auto; }
.esl-page { box-sizing: border-box; max-width: 816px; margin: 0 auto; background: #fff; color: #1c1814; padding: 72px 84px 64px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .08); font: 11.5pt/1.55 Georgia, "Times New Roman", serif; }
.esl-lh { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 14px; border-bottom: 1.5px solid #b08d57; margin-bottom: 26px; }
.esl-lh-text { display: flex; flex-direction: column; font: 9.5pt/1.45 -apple-system, "Segoe UI", Arial, sans-serif; color: #3a332b; }
.esl-lh-text strong { font-size: 11pt; color: #1c1814; }
.esl-lh-logo { width: 56px; height: auto; }
.esl-line { margin: 0; }
.esl-meta { margin-bottom: 18px; }
.esl-meta .esl-re { margin-top: 6px; font-weight: 700; }
.esl-salutation { margin-bottom: 12px; }
.esl-body p { margin: 0 0 12px; text-align: left; }
.esl-sign { margin-top: 22px; break-inside: avoid; page-break-inside: avoid; }
.esl-sigspace { height: 54px; display: flex; align-items: center; }
.esl-sigimg { max-height: 50px; max-width: 220px; width: auto; height: auto; }
/* the provider signing a letter (Phase 3) */
.esl-sign-view { display: flex; flex-direction: column; gap: 14px; }
.esl-attest { border: 1px solid var(--esg-line, #d9d2c7); border-radius: 10px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.esl-attest legend { font-weight: 700; padding: 0 4px; }
.esl-attest .esg-check, .esl-consent .esg-check { align-items: flex-start; min-height: 32px; }
.esl-consent { display: flex; flex-direction: column; gap: 6px; }
.esl-signer { font-weight: 700; }
.esl-license { font-size: 9.5pt; color: #3a332b; }
.esl-var { background: #fff2c2; color: #5b3d00; border-radius: 3px; padding: 0 3px; font-family: -apple-system, "Segoe UI", Arial, sans-serif; font-size: .88em; }
@media (max-width: 700px) { .esl-page { padding: 28px 20px; font-size: 11pt; } .esl-wrap { padding: 8px; } }

/* ===========================================================================================================================
   EKM Sign workspace, modern (owner 2026-11-18: "upscale high tech modern"; mockup approved: "build the redesign").
   Dark, crisp and calm: near-black surfaces, hairline borders, one indigo accent, Geist type, a side menu, a top bar, and the
   Templates library as a list with a live preview beside it. Scoped to the full-screen workspace (.esgx-ws); the chart's
   Signatures panel and the patient signing pages keep the portal theme.
   =========================================================================================================================== */
.esgx-ws, .esgx-ws .esg, .esgx-ws .esp-body {
  --esg-bg: #09090B; --esg-card: #111114; --esg-border: rgba(255, 255, 255, .08); --esg-ink: #FAFAFA; --esg-ink2: #E4E4E7; --esg-muted: #A1A1AA;
  --esg-danger: #FCA5A5; --esg-danger-bg: rgba(248, 113, 113, .12); --esg-ok: #6EE7B7; --esg-ok-bg: rgba(52, 211, 153, .12);
  --esg-wait: #FCD34D; --esg-wait-bg: rgba(251, 191, 36, .12);
  /* the accent is the person's own portal theme color (owner 2026-11-18: "match the users theme"); lightened for text on black */
  --esgx-acc: var(--c-accent, #9C9A93); --esgx-acc-ink: var(--c-accent-text, #fff);
  --esgx-accent: color-mix(in srgb, var(--esgx-acc) 62%, #fff); --esgx-acc-hi: color-mix(in srgb, var(--esgx-acc) 82%, #fff);
  --esgx-acc-soft: color-mix(in srgb, var(--esgx-acc) 14%, transparent); --esgx-acc-line: color-mix(in srgb, var(--esgx-acc) 42%, transparent);
  --esgx-acc-glow: color-mix(in srgb, var(--esgx-acc) 60%, transparent); --esgx-raise: rgba(255, 255, 255, .04); --esgx-hair: rgba(255, 255, 255, .06); --esgx-faint: #71717A;
  --esg-font: "Geist", "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
.esgx-ws { background: #09090B; }
/* documents stay white paper inside the dark frame, as signers see them (the letter preview already is) */
.esgx-ws .esf-doc {
  --esg-bg: #FAFAFA; --esg-card: #FFFFFF; --esg-border: #E4E4E7; --esg-ink: #18181B; --esg-ink2: #3F3F46; --esg-muted: #52525B;
  --esg-danger: #B91C1C; --esg-danger-bg: #FEF2F2; --esg-ok: #047857; --esg-ok-bg: #ECFDF5; --esg-wait: #B45309; --esg-wait-bg: #FFFBEB;
  color-scheme: light; color: var(--esg-ink); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .9);
}
.esgx .esf-doc input[type=text], .esgx .esf-doc input[type=date], .esgx .esf-doc input[type=email], .esgx .esf-doc select, .esgx .esf-doc textarea {
  background: var(--esg-bg); border: 1px solid var(--esg-border); box-shadow: none; }
.esgx-ws .esg-ws-body { max-width: none; padding: 0; overflow: hidden; display: flex; }
.esgx { flex: 1; min-width: 0; display: flex; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; font-size: 14px; }
.esgx :focus-visible { outline: 2px solid var(--esgx-accent); outline-offset: 2px; }

/* side menu */
.esgx-side { flex: 0 0 240px; box-sizing: border-box; padding: 18px 14px; border-right: 1px solid var(--esgx-hair); background: #0B0B0E; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.esgx-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.esgx-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--esgx-acc-ink);
  background: linear-gradient(135deg, var(--esgx-acc-hi), var(--esgx-acc)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 6px 18px -6px var(--esgx-acc-glow); }
.esgx-brandtext { display: flex; flex-direction: column; line-height: 1.15; }
.esgx-brandname { font-weight: 600; font-size: 14px; }
.esgx-brandsub { font-size: 12px; color: var(--esgx-faint); }
.esgx-nav { display: flex; flex-direction: column; gap: 2px; border: 0; margin: 0; }
.esgx .esgx-navbtn { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-height: 38px; width: 100%; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--esg-muted); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; transition: background-color .15s, color .15s; }
.esgx .esgx-navbtn:hover { background: rgba(255, 255, 255, .05); color: var(--esg-ink); }
.esgx .esgx-navbtn.is-active { background: rgba(255, 255, 255, .07); color: var(--esg-ink); box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset; border: 0; }
.esgx-navlabel { flex: 1; }
.esgx .esg-tab-count { min-width: 0; height: auto; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .06); color: var(--esg-muted); font-size: 11px; font-weight: 500; }
.esgx .esgx-navbtn.is-active .esg-tab-count { background: var(--esgx-acc-soft); color: var(--esgx-accent); }
.esgx-sidecard { margin-top: auto; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px;
  background: var(--esgx-acc-soft); box-shadow: 0 0 0 1px var(--esgx-acc-line) inset; }
.esgx-sidecard-t { font-size: 12px; font-weight: 600; color: var(--esgx-accent); }
.esgx-sidecard-d { font-size: 12.5px; color: var(--esg-muted); line-height: 1.45; }

/* main column + top bar */
.esgx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(900px 380px at 30% -120px, color-mix(in srgb, var(--esgx-acc) 16%, transparent), transparent 70%), #09090B; }
.esgx-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--esgx-hair); }
.esgx-crumb { font-size: 13px; color: var(--esgx-faint); display: flex; gap: 8px; align-items: center; }
.esgx-crumb b { color: var(--esg-ink); font-weight: 500; }
.esgx-crumb span { color: #3F3F46; }
.esgx-search { flex: 1 1 260px; max-width: 460px; margin-left: auto; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: 10px;
  background: var(--esgx-raise); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset; color: var(--esgx-faint); }
.esgx-search:focus-within { box-shadow: 0 0 0 1px var(--esgx-acc-line) inset, 0 0 0 4px var(--esgx-acc-soft); }
.esgx .esgx-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--esg-ink); font: inherit; font-size: 13.5px; padding: 0; outline: none; }
.esgx-search input::placeholder { color: var(--esgx-faint); }
.esgx .esgx-search input:focus, .esgx .esgx-search input:focus-visible { outline: none; box-shadow: none; }   /* the box itself shows focus */
.esgx-spacer { flex: 1; }
.esgx-topacts { display: flex; align-items: center; gap: 8px; }
.esgx-close { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--esg-muted); cursor: pointer; display: grid; place-items: center; }
.esgx-close:hover { background: rgba(255, 255, 255, .08); color: var(--esg-ink); }
.esgx-content { flex: 1; overflow: auto; padding: 28px 28px 72px; box-sizing: border-box; }
.esgx-content > * { max-width: 1240px; }

/* buttons, chips, fields, menus, lists: the shared EKM Sign pieces in this look */
.esgx .esg-btn { min-height: 36px; padding: 0 14px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .05); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset;
  color: var(--esg-ink2); font-size: 13.5px; font-weight: 500; transition: background-color .15s, filter .15s; }
.esgx .esg-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .09); border: 0; color: var(--esg-ink); }
.esgx .esg-btn--primary { color: var(--esgx-acc-ink); background: linear-gradient(180deg, var(--esgx-acc-hi), var(--esgx-acc)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset, 0 8px 22px -10px var(--esgx-acc-glow); font-weight: 600; }
.esgx .esg-btn--primary:hover:not(:disabled) { background: linear-gradient(180deg, var(--esgx-acc-hi), var(--esgx-acc)); filter: brightness(1.06); }
.esgx .esg-chip { background: rgba(255, 255, 255, .06); color: var(--esg-ink2); }
.esgx .esg-alert { background: var(--esg-danger-bg); color: var(--esg-danger); border-radius: 10px; }
.esgx input[type=text], .esgx input[type=email], .esgx input[type=number], .esgx input[type=date], .esgx select, .esgx textarea {
  background: var(--esgx-raise); border: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1) inset; border-radius: 9px; color: var(--esg-ink); }
/* the portal's global input rule (index.html, many :not() parts) outranks the rules above and paints typed text near-black */
.esgx-ws input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]), .esgx-ws textarea, .esgx-ws select {
  color: var(--esg-ink) !important; -webkit-text-fill-color: currentColor; caret-color: var(--esgx-accent); }
.esgx-ws input::placeholder, .esgx-ws textarea::placeholder { color: var(--esgx-faint); -webkit-text-fill-color: var(--esgx-faint); opacity: 1; }
.esgx input:focus, .esgx select:focus, .esgx textarea:focus { outline: none; box-shadow: 0 0 0 1px var(--esgx-acc-line) inset, 0 0 0 4px var(--esgx-acc-soft); }
.esgx .esg-menu { background: #18181B; border: 0; border-radius: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 20px 40px -12px rgba(0, 0, 0, .8); padding: 6px; min-width: 300px; }
.esgx .esg-menu .esg-btn { background: transparent; box-shadow: none; justify-content: flex-start; }
.esgx .esg-menu .esg-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .07); }
.esgx-newmenu > summary { gap: 6px; }
.esgx .esg-h { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.esgx .esg-sub { color: var(--esg-muted); }
.esgx .esg-list, .esgx .esg-emptybox, .esgx .esg-blk, .esgx .esg-signer, .esgx .esg-editor-preview { background: rgba(17, 17, 20, .8); border: 0; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset; }
.esgx .esg-list { padding: 4px 16px; }
.esgx .esg-row { border-bottom-color: var(--esgx-hair); }
.esgx .esg-note { border-left-color: var(--esgx-acc-line); }
.esgx .esl-wrap { background: transparent; }
/* My signature: the chosen style and Type/Draw read in the theme color (a white ring on a white card did not show) */
.esgx .psg-font.is-active { border-color: transparent; box-shadow: 0 0 0 3px var(--esgx-accent), 0 10px 26px -12px var(--esgx-acc-glow); }
.esgx .psg-font:hover:not(.is-active) { box-shadow: 0 0 0 2px var(--esgx-acc-line); }
.esgx .esf-tab { background: rgba(255, 255, 255, .04); color: var(--esg-muted); border: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset; }
.esgx .esf-tab.is-active { background: var(--esgx-acc-soft); color: var(--esg-ink); box-shadow: 0 0 0 1px var(--esgx-acc-line) inset; }

/* Templates: heading, quick actions */
.esgx-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.esgx-h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.esgx-lead { margin: 0; color: var(--esg-muted); font-size: 14px; }
.esgx-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 26px; }
.esgx-tile { text-align: left; cursor: pointer; border-radius: 14px; padding: 16px; background: rgba(24, 24, 27, .6); border: 1px solid rgba(255, 255, 255, .08); color: var(--esg-ink);
  display: flex; gap: 14px; align-items: flex-start; font: inherit; transition: transform .2s cubic-bezier(.2, .8, .2, 1), border-color .2s, background-color .2s; }
.esgx-tile:hover { transform: translateY(-2px); border-color: var(--esgx-acc-line); background-color: rgba(24, 24, 27, .9); }
.esgx-tile-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; transition: background-color .2s, color .2s; }
.esgx-tile-ic { background: var(--esgx-acc-soft); color: var(--esgx-accent); box-shadow: 0 0 0 1px var(--esgx-acc-line) inset; }
.esgx-tile:hover .esgx-tile-ic { background: linear-gradient(135deg, var(--esgx-acc-hi), var(--esgx-acc)); color: var(--esgx-acc-ink); }
.esgx-tile-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.esgx-tile-t { font-size: 14.5px; font-weight: 600; }
.esgx-tile-d { font-size: 13px; color: var(--esg-muted); line-height: 1.45; }

/* Templates: library (list + preview) */
.esgx-lib { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.esgx-list { flex: 999 1 520px; min-width: 0; border-radius: 16px; background: rgba(17, 17, 20, .8); box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 24px 48px -24px rgba(0, 0, 0, .8); padding-bottom: 8px; }
/* Templates search (owner 2026-11-18: "make the search more visible and upgrade the design"): large, at the top of the list */
.esg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.esgx-bigsearch { padding: 14px 14px 0; }
.esgx-bigsearch-in { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 10px 0 16px; border-radius: 14px; cursor: text;
  background: rgba(255, 255, 255, .05); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset; color: var(--esgx-accent); transition: box-shadow .15s, background-color .15s; }
.esgx-bigsearch-in:hover { background: rgba(255, 255, 255, .065); }
.esgx-bigsearch-in:focus-within { background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 1px var(--esgx-acc-line) inset, 0 0 0 4px var(--esgx-acc-soft); }
.esgx .esgx-bigsearch-in input { flex: 1; min-width: 0; min-height: 50px; border: 0; background: transparent !important; box-shadow: none !important; padding: 0;
  color: var(--esg-ink) !important; -webkit-text-fill-color: currentColor; font: inherit; font-size: 15.5px; outline: none; }
.esgx .esgx-bigsearch-in input::placeholder { color: var(--esgx-faint); -webkit-text-fill-color: var(--esgx-faint); }
.esgx .esgx-bigsearch-in input::-webkit-search-cancel-button { display: none; }
.esgx .esgx-bigsearch-in input:focus, .esgx .esgx-bigsearch-in input:focus-visible { outline: none; box-shadow: none !important; }
.esgx-kbd { flex: none; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; font: 600 12px var(--esg-font); color: var(--esgx-faint);
  background: rgba(255, 255, 255, .05); box-shadow: 0 0 0 1px rgba(255, 255, 255, .1) inset; }
.esgx-found { flex: none; font-size: 12.5px; color: var(--esg-muted); white-space: nowrap; }
.esgx .esgx-qclear { flex: none; width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--esg-muted); display: grid; place-items: center; cursor: pointer; }
.esgx .esgx-qclear:hover { background: rgba(255, 255, 255, .08); color: var(--esg-ink); }
/* rows: the icon says letter or form, so the extra "Letter" pill goes; "Approved" is the quiet default, drafts stand out */
.esgx-rowmain .esgx-kind { display: none; }
.esgx-rowmain { grid-template-columns: 32px minmax(0, 1fr) auto; }
.esgx-st-approved { color: var(--esgx-faint); font-size: 12px; }
.esgx-st-draft { color: #FCD34D; font-weight: 500; }
.esgx .esgx-newver { flex: none; min-height: 30px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 500; white-space: nowrap;
  color: #FCD34D; background: rgba(251, 191, 36, .1); box-shadow: 0 0 0 1px rgba(251, 191, 36, .3) inset; }
.esgx .esgx-newver:hover { background: rgba(251, 191, 36, .18); }
.esgx .esgx-danger { color: var(--esg-danger); background: transparent; box-shadow: 0 0 0 1px rgba(248, 113, 113, .35) inset; border: 0; }
.esgx .esgx-danger:hover:not(:disabled) { background: var(--esg-danger-bg); }
.esgx-insp-danger { padding: 0 18px 18px; margin-top: -6px; }
.esgx-insp-danger .esgx-danger { width: 100%; min-height: 40px; }
.esgx-listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--esgx-hair); }
.esgx-segs { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: 9px; background: var(--esgx-raise); box-shadow: 0 0 0 1px var(--esgx-hair) inset; }
.esgx-seg { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; background: transparent; color: var(--esg-muted); display: inline-flex; align-items: center; gap: 6px; }
.esgx-seg:hover { color: var(--esg-ink); }
.esgx-seg.is-on { background: rgba(255, 255, 255, .1); color: var(--esg-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.esgx-segn { font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }
.esgx .esg-check { color: var(--esg-muted) !important; }
.esgx-grouph { margin: 0; padding: 14px 16px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--esgx-faint); display: flex; gap: 8px; }
.esgx-grouph span { font-weight: 500; letter-spacing: 0; }
.esgx-rows { list-style: none; margin: 0; padding: 0 6px; }
.esgx-row { display: flex; align-items: center; gap: 8px; border-radius: 10px; padding-right: 8px; transition: background-color .12s; }
.esgx-row:hover { background: rgba(255, 255, 255, .035); }
.esgx-row.is-sel { background: var(--esgx-acc-soft); box-shadow: 0 0 0 1px var(--esgx-acc-line) inset; }
.esgx-rowmain { flex: 1; min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 10px; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.esgx-rowic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.esgx-kind-letter { background: var(--esgx-acc-soft); color: var(--esgx-accent); }
.esgx-kind-form { background: rgba(255, 255, 255, .06); color: var(--esg-ink2); }
.esgx-rowtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.esgx-rowtext .esg-row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esgx-rowtext .esg-row-sub { color: var(--esgx-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esgx-kind { font-size: 11.5px; font-weight: 500; padding: 3px 8px; border-radius: 6px; color: var(--esgx-accent); background: var(--esgx-acc-soft); }
.esgx-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--esg-muted); white-space: nowrap; }
.esgx-status > span { width: 6px; height: 6px; border-radius: 50%; background: #71717A; }
.esgx-st-approved > span { background: #34D399; box-shadow: 0 0 8px rgba(52, 211, 153, .7); }
.esgx-st-draft > span { background: #FBBF24; }
.esgx-rowact { flex: none; display: flex; align-items: center; }
.esgx-rowact .esg-btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.esgx-rowact .esg-sendhint { color: var(--esgx-faint); }
/* one strong button per screen: the row buttons are quiet until their row is hovered or selected */
.esgx .esgx-rowact .esg-btn--primary { background: var(--esgx-acc-soft); color: var(--esgx-accent); box-shadow: 0 0 0 1px var(--esgx-acc-line) inset; font-weight: 500; }
.esgx .esgx-row:hover .esgx-rowact .esg-btn--primary, .esgx .esgx-row.is-sel .esgx-rowact .esg-btn--primary {
  color: var(--esgx-acc-ink); background: linear-gradient(180deg, var(--esgx-acc-hi), var(--esgx-acc)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset, 0 8px 22px -10px var(--esgx-acc-glow); }

.esgx-insp { flex: 1 1 340px; max-width: 400px; position: sticky; top: 0; border-radius: 16px; background: rgba(17, 17, 20, .85); box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 24px 48px -24px rgba(0, 0, 0, .8); overflow: hidden; }
.esgx-insp-head { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--esgx-hair); }
.esgx-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--esgx-accent); }
.esgx-insp-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.esgx-insp-desc { margin: 0; font-size: 13px; color: var(--esg-muted); line-height: 1.5; }
.esgx-paperwrap { padding: 18px; background: radial-gradient(300px 160px at 50% 0%, var(--esgx-acc-soft), transparent 70%); }
.esgx-paper { background: #fff; color: #18181B; border-radius: 8px; padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 7px;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .1); transform: perspective(900px) rotateX(4deg); }
.esgx-paper-lh { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid #E4E4E7; font-size: 9px; letter-spacing: .06em; }
.esgx-paper-lh img { width: 18px; height: auto; display: block; }   /* the EKM logo, as on the signed letter */
.esgx-paper-k { font-size: 8.5px; color: #52525B; }
.esgx-paper-k em { font-style: normal; background: #F4F4F5; color: #3F3F46; padding: 0 3px; border-radius: 2px; }
.esgx-paper-re { font-size: 9px; }
.esgx-ln { height: 5px; border-radius: 3px; background: #E4E4E7; }
.esgx-ln.w96 { width: 96%; } .esgx-ln.w88 { width: 88%; } .esgx-ln.w92 { width: 92%; } .esgx-ln.w64 { width: 64%; } .esgx-ln.w90 { width: 90%; } .esgx-ln.w72 { width: 72%; }
.esgx-ln.gap { margin-top: 4px; }
.esgx-paper-sig { height: 1px; width: 46%; background: #A1A1AA; margin-top: 16px; }
.esgx-meta { margin: 0; padding: 4px 18px 14px; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.esgx-meta dt { color: var(--esgx-faint); }
.esgx-meta dd { margin: 0; }
.esgx-note { margin: 0 18px 12px; font-size: 13px; color: var(--esg-muted); line-height: 1.5; }
.esgx-insp-acts { padding: 0 18px 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.esgx-insp-acts > .esg-btn--primary { flex: 1 1 160px; min-height: 40px; }
.esgx-insp-acts .esg-more .esg-menu { right: 0; bottom: calc(100% + 6px); top: auto; }

@media (max-width: 1100px) { .esgx-insp { position: static; max-width: none; } }
@media (max-width: 860px) {
  .esgx { flex-direction: column; overflow: auto; }
  .esgx-side { flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; border-right: 0; border-bottom: 1px solid var(--esgx-hair); padding: 10px 14px; overflow: visible; }
  .esgx-nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; scrollbar-width: none; }
  .esgx .esgx-navbtn { width: auto; white-space: nowrap; flex: 0 0 auto; }
  .esgx-sidecard { display: none; }
  .esgx-main { overflow: visible; }
  .esgx-top { padding: 10px 16px; }
  .esgx-content { padding: 20px 16px 48px; overflow: visible; }
  /* phone: the name gets the full width; status and the row's button sit under it */
  .esgx-row { flex-wrap: wrap; padding-right: 0; }
  .esgx-rowmain { flex: 1 1 100%; grid-template-columns: 32px minmax(0, 1fr); row-gap: 4px; }
  .esgx-rowmain .esgx-kind { display: none; }
  .esgx-rowmain .esgx-status { grid-column: 2; }
  .esgx-rowtext .esg-row-title, .esgx-rowtext .esg-row-sub { white-space: normal; }
  .esgx-rowact:not(:empty) { padding: 0 10px 10px 56px; }
  .esgx .esgx-newver { margin: 0 0 8px 56px; }
}

/* To sign: "Waiting for your signature" and "Completed" (owner 2026-11-18) */
.esgx-minesec { margin: 0 0 22px; }
.esgx-minesec-h { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--esg-muted); display: flex; gap: 8px; align-items: center; }
.esgx-minesec-h span { font-weight: 500; letter-spacing: 0; color: var(--esgx-faint, var(--esg-muted)); }
.esgx-minesec .esg-row-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.esgx-minesec .esg-row-right .esg-btn { min-height: 36px; }
.esgx-filed { font-weight: 500; }

/* Sent (owner 2026-11-18: "please update this design ... a voided spot ... completed, etc. where it is organized") */
.esgx-senttabs { margin: 4px 0 16px; }
.esgx-sentempty { padding: 28px 0; }
.esgx-sentlist { list-style: none; margin: 0; padding: 6px; border-radius: 16px; background: rgba(17, 17, 20, .8); box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 24px 48px -24px rgba(0, 0, 0, .8); }
.esgx-sentrow + .esgx-sentrow { border-top: 1px solid var(--esgx-hair, rgba(255, 255, 255, .06)); }
.esgx .esgx-sentmain { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 14px; align-items: center; gap: 14px; padding: 14px 12px; border: 0; border-radius: 12px;
  background: transparent; color: var(--esg-ink); font: inherit; text-align: left; cursor: pointer; transition: background-color .12s; }
.esgx .esgx-sentmain:hover { background: rgba(255, 255, 255, .04); }
.esgx-sentmain .esgx-rowic { width: 36px; height: 36px; }
.esgx-senttext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.esgx-senttext .esg-row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esgx-sentwho { font-size: 13px; color: var(--esg-ink2); }
.esgx-sentmeta { font-size: 12.5px; color: var(--esgx-faint, var(--esg-muted)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esgx-signers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.esgx-signer { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .05); color: var(--esg-ink2); }
.esgx-signer em { font-style: normal; color: var(--esgx-faint, var(--esg-muted)); }
.esgx-rs-signed em { color: var(--esg-ok); }
.esgx-rs-declined em { color: var(--esg-danger); }
.esgx-sentright { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.esgx-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.esgx-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.esgx-pill-wait { color: #FCD34D; background: rgba(251, 191, 36, .1); }
.esgx-pill-ok { color: var(--esg-ok); background: var(--esg-ok-bg); }
.esgx-pill-bad { color: var(--esg-danger); background: var(--esg-danger-bg); }
.esgx-pill-off { color: var(--esg-muted); background: rgba(255, 255, 255, .05); }
.esgx-filechip { font-size: 12px; color: var(--esg-muted); }
.esgx-fc-filed { color: var(--esg-ok); }
.esgx-fc-failed { color: var(--esg-danger); }
.esgx-chev { color: var(--esgx-faint, var(--esg-muted)); font-size: 18px; }
.esgx-tone-off .esgx-senttext .esg-row-title { color: var(--esg-ink2); }
@media (max-width: 640px) {
  .esgx .esgx-sentmain { grid-template-columns: 32px minmax(0, 1fr) 12px; }
  .esgx-sentright { grid-column: 2; grid-row: 2; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
  .esgx-senttext .esg-row-title { white-space: normal; }
}

/* ===========================================================================================================================
   EKM Sign, upscale finish (owner 2026-11-20: "the whole design of e-sign needs to follow this upscale aesthetic ... similar";
   then: "I was talking about the upscale appearance modern lux look", not new colors). The palette above stays: dark surfaces
   and the person's own theme accent. What changes is the finish: a serif display title with an italic line and a short accent
   rule, letter-spaced labels with hairlines, pill buttons, a grouped side menu, outlined icons and softer, deeper cards.
   Fonts are ones the portal already loads (Italiana, Cormorant Garamond, Instrument Serif); no new font load.
   =========================================================================================================================== */
.esgx-ws { --esgx-display: "Italiana", "Cormorant Garamond", "Iowan Old Style", Georgia, serif; --esgx-italic: "Instrument Serif", "Cormorant Garamond", Georgia, serif; }

/* side menu: a soft vertical fade, a lettered wordmark, and group labels */
.esgx-side { background: linear-gradient(180deg, color-mix(in srgb, var(--esgx-acc) 10%, #121215) 0%, #0D0D10 46%, #09090B 100%); }
.esgx .esgx-mark { border-radius: 50%; background: transparent; color: var(--esgx-accent); font-family: var(--esgx-display); font-weight: 400; font-size: 17px;
  box-shadow: 0 0 0 1px var(--esgx-acc-line) inset, 0 0 22px -6px var(--esgx-acc-glow); }
.esgx-brandname { font-family: var(--esgx-display); font-weight: 400; font-size: 17px; letter-spacing: .2em; text-transform: uppercase; }
.esgx-brandsub { font-size: 10px; letter-spacing: .24em; text-transform: uppercase; }
.esgx-navgroup { display: flex; align-items: center; gap: 10px; margin: 14px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--esgx-faint); }
.esgx-navgroup::after { content: ""; flex: 1; height: 1px; background: var(--esgx-hair); }
.esgx-nav > .esgx-navgroup:first-child { margin-top: 0; }
.esgx .esgx-navbtn { border-radius: 999px; min-height: 40px; padding: 0 14px; }
.esgx .esgx-navbtn.is-active { color: var(--esgx-acc-ink); background: linear-gradient(180deg, var(--esgx-acc-hi), var(--esgx-acc));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset, 0 10px 24px -12px var(--esgx-acc-glow); font-weight: 600; }
.esgx .esgx-navbtn.is-active .esg-tab-count { background: rgba(0, 0, 0, .14); color: var(--esgx-acc-ink); }
.esgx-sidecard { border-radius: 16px; }
.esgx-sidecard-t { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; }

/* the top of each screen: a faint sheen behind a dated eyebrow, a serif title, an italic line and a short accent rule */
.esgx-main { background:
  radial-gradient(1100px 340px at 78% -140px, color-mix(in srgb, var(--esgx-acc) 20%, transparent), transparent 70%),
  radial-gradient(700px 260px at 8% -80px, rgba(255, 255, 255, .05), transparent 70%), #09090B; }
.esgx-crumb { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.esgx-head { gap: 4px; margin-bottom: 30px; }
.esgx-head .esgx-date { font-size: 11px; letter-spacing: .24em; color: var(--esg-muted); }
.esgx .esgx-h1 { font-family: var(--esgx-display); font-weight: 400; font-size: 46px; letter-spacing: .01em; line-height: 1.05; margin-top: 4px; }
.esgx-head .esgx-lead { font-family: var(--esgx-italic); font-style: italic; font-size: 18.5px; line-height: 1.4; color: var(--esg-ink2); max-width: 760px; }
.esgx-head::after { content: ""; width: 76px; height: 1px; margin-top: 14px; background: linear-gradient(90deg, var(--esgx-accent), transparent); }

/* buttons and segments: pills */
.esgx .esg-btn { border-radius: 999px; padding: 0 16px; }
.esgx .esgx-close { border-radius: 50%; }
.esgx-segs { border-radius: 999px; padding: 4px; }
.esgx-seg { border-radius: 999px; height: 32px; padding: 0 14px; }
.esgx-seg.is-on { color: var(--esgx-acc-ink); background: linear-gradient(180deg, var(--esgx-acc-hi), var(--esgx-acc)); box-shadow: 0 6px 16px -10px var(--esgx-acc-glow); }
.esgx-seg.is-on .esgx-segn { opacity: .75; }

/* cards: rounder and deeper, with outlined icons */
.esgx .esg-list, .esgx .esg-emptybox, .esgx-list, .esgx-insp, .esgx-sentlist { border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 24, 28, .86), rgba(14, 14, 17, .86)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 30px 60px -30px rgba(0, 0, 0, .9); }
.esgx-tile { border-radius: 18px; padding: 18px; background: linear-gradient(180deg, rgba(26, 26, 30, .7), rgba(16, 16, 19, .7)); }
.esgx-tile-ic, .esgx .esgx-rowic { border-radius: 12px; background: transparent; box-shadow: 0 0 0 1px var(--esgx-acc-line) inset; color: var(--esgx-accent); }
.esgx-tile-t { font-size: 15px; }
.esgx-grouph, .esgx-minesec-h { letter-spacing: .2em; }
.esgx-minesec-h::after { content: ""; flex: 1; height: 1px; background: var(--esgx-hair); }
.esgx-insp-title { font-family: var(--esgx-display); font-weight: 400; font-size: 24px; letter-spacing: .01em; }

/* To sign / Signed (owner 2026-11-20: "things arent even"): a summary strip, then rows on one shared column grid */
.esgx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 30px; max-width: 1240px; }
.esgx .esgx-stat { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 0; border-radius: 18px; text-align: left; font: inherit; color: var(--esg-ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset, 0 24px 48px -30px rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.esgx button.esgx-stat { cursor: pointer; transition: box-shadow .2s, transform .2s cubic-bezier(.2, .8, .2, 1); }
.esgx button.esgx-stat:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--esgx-acc-line) inset, 0 24px 48px -30px rgba(0, 0, 0, .9); }
.esgx-stat-k { font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--esgx-faint); }
.esgx-stat-v { font-family: var(--esgx-display); font-size: 34px; line-height: 1; letter-spacing: .01em; font-variant-numeric: lining-nums tabular-nums; }
.esgx-stat-sub { font-size: 12.5px; color: var(--esg-muted); }
.esgx button.esgx-stat .esgx-stat-sub { color: var(--esgx-accent); }

.esgx-mr, .esgx-mr-cols { display: grid; grid-template-columns: minmax(0, 1fr) 132px 236px 240px; column-gap: 24px; align-items: center; }
.esgx-mr-cols { padding: 0 22px 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--esgx-faint); }
.esgx-mr-cols > span:first-child { padding-left: 58px; }
.esgx .esgx-minelist { padding: 0; overflow: hidden; }
.esgx .esgx-mr { position: relative; padding: 16px 22px; border: 0; margin: 0; flex-wrap: nowrap; justify-content: initial; transition: background-color .15s; }
.esgx .esgx-mr + .esgx-mr { border-top: 1px solid var(--esgx-hair); }
.esgx .esgx-mr:hover { background: rgba(255, 255, 255, .025); }
.esgx-mr.is-ready::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--esgx-acc-hi), var(--esgx-acc)); box-shadow: 0 0 12px var(--esgx-acc-glow); }
.esgx .esgx-mr-main { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; align-items: center; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.esgx-mr-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--esgx-accent); box-shadow: 0 0 0 1px var(--esgx-acc-line) inset;
  background: radial-gradient(circle at 30% 20%, var(--esgx-acc-soft), transparent 70%); }
.esgx-mr.is-done .esgx-mr-ic { color: var(--esg-ok); box-shadow: 0 0 0 1px color-mix(in srgb, var(--esg-ok) 38%, transparent) inset; background: radial-gradient(circle at 30% 20%, var(--esg-ok-bg), transparent 70%); }
.esgx-mr-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.esgx-mr-text .esg-row-title { font-size: 15px; font-weight: 500; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esgx .esgx-mr-main:hover .esg-row-title { color: var(--esgx-accent); }
.esgx-mr-text .esgx-about { font-size: 13px; color: var(--esg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esgx-mr-date { display: flex; flex-direction: column; gap: 4px; }
.esgx-mr-k { display: none; }
.esgx-mr-v { font-size: 13.5px; color: var(--esg-ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.esgx-mr-st { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.esgx-st { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--esg-ink2); white-space: nowrap; }
.esgx-st i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.esgx-st--wait i { background: #FBBF24; box-shadow: 0 0 10px rgba(251, 191, 36, .6); }
.esgx-st--ok { color: var(--esg-ok); }
.esgx-st--ok i { box-shadow: 0 0 10px color-mix(in srgb, var(--esg-ok) 60%, transparent); }
.esgx-st--bad { color: var(--esg-danger); }
.esgx-st--off { color: var(--esg-muted); }
.esgx .esgx-mr-acts { display: flex; flex-wrap: nowrap; gap: 8px; justify-content: flex-end; align-items: center; }
.esgx .esgx-mr-acts .esg-btn { min-height: 36px; padding: 0 18px; }
.esgx .esgx-mr-acts .esgx-danger { box-shadow: none; color: var(--esg-muted); padding: 0 12px; }
.esgx .esgx-mr-acts .esgx-danger:hover:not(:disabled) { color: var(--esg-danger); background: var(--esg-danger-bg); }
@media (max-width: 1100px) {
  .esgx-mr, .esgx-mr-cols { grid-template-columns: minmax(0, 1fr) 120px 200px; }
  .esgx .esgx-mr-acts { grid-column: 1 / -1; justify-content: flex-start; padding: 12px 0 0 58px; }
  .esgx-mr-cols > span:last-child { display: none; }
}
@media (max-width: 860px) {
  .esgx .esgx-h1 { font-size: 34px; }
  .esgx-head .esgx-lead { font-size: 16.5px; }
  .esgx-navgroup { display: none; }
  .esgx-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .esgx .esgx-stat { padding: 14px 16px; }
  .esgx-stat-v { font-size: 26px; }
  .esgx-mr-cols { display: none; }
  .esgx .esgx-mr { grid-template-columns: minmax(0, 1fr); row-gap: 10px; padding: 16px; }
  .esgx-mr-date, .esgx-mr-st { padding-left: 58px; }
  .esgx-mr-date { flex-direction: row; gap: 8px; }
  .esgx-mr-k { display: inline; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--esgx-faint); }
  .esgx .esgx-mr-acts { flex-wrap: wrap; padding: 2px 0 0 58px; }
  .esgx-mr-text .esg-row-title, .esgx-mr-text .esgx-about { white-space: normal; }
}
.esgx-st.esgx-filed i { display: none; }   /* the ✓ already marks it */
