/* ============================================================
   LendingWise Design System — components with NO Metronic equivalent
   Hand-maintained translation of the React reference implementations in
   .claude/skills/lw-design/components/ into plain CSS classes for the PHP/jQuery monolith.
   Source hashes (sha256, first 12) at translation time — `scripts/design-system/lw-design-manifest.sh --check`
   fails when the vendored .jsx no longer match, which means this file needs a review:
     StatusPill.jsx=afa9252aaff3 Table.jsx=1589b095e81c Dropzone.jsx=98d7922e4cb2
   Consumes ONLY --lw-* tokens (public/assetsNew/css/lw-tokens.css, loaded before this file),
   so every class renders correctly in light and under body.dark-mode with no extra rules.
   The two production sheets this has to coexist with:
     - dark-mode.css: its broad `body.dark-mode span:not(...)` colour reset excludes [class*="lw-"].
     - custom.css:    `.dropzone { border: 0 !important; padding: … !important }` — the dropzone rules
                      below carry !important on those two properties so `class="dropzone lw-dropzone"` works.
   Icons: the Metronic head ships Font Awesome 5.15.1 (`fas fa-…`). The legacy OpenHead pages ship
   Font Awesome 4.7 — there use `fa fa-clock-o`, `fa fa-check-circle`, `fa fa-times-circle`,
   `fa fa-minus-circle`, `fa fa-cloud-upload`, `fa fa-exclamation-circle`.
   Markup recipes and states: .claude/skills/lw-design/component-map.md
   ============================================================ */

/* ---- StatusPill ------------------------------------------------------------
   <span class="lw-pill lw-pill--pass"><i class="fas fa-check-circle" aria-hidden="true"></i> Passed</span>
   Status  : lw-pill--pending (default) | lw-pill--pass | lw-pill--fail | lw-pill--disabled
   Variant : soft (default: tint + ink) | lw-pill--solid (fill + on-label) | lw-pill--dot (ink dot + text)
   Size    : md (default) | lw-pill--sm
   Icons   : fa-clock (pending) · fa-check-circle (pass) · fa-times-circle (fail) · fa-minus-circle (disabled)
   RULE: status colour lives on this small element only — never on the cell or the row. */
.lw-pill {
  --lw-pill-fill: var(--lw-status-pending-fill);
  --lw-pill-on:   var(--lw-text-on-warning);
  --lw-pill-tint: var(--lw-status-pending-tint);
  --lw-pill-ink:  var(--lw-status-pending-ink);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--lw-font-sans);
  font-weight: var(--lw-fw-medium);
  font-size: var(--lw-fs-sm);
  line-height: 1;
  letter-spacing: 0.01em;
  padding: 0.4rem 0.65rem;
  color: var(--lw-pill-ink);
  background: var(--lw-pill-tint);
  border-radius: var(--lw-radius-pill);
  white-space: nowrap;
  vertical-align: middle;
}
.lw-pill--pending { /* explicit form of the default, so markup can always name its status */
  --lw-pill-fill: var(--lw-status-pending-fill);
  --lw-pill-on:   var(--lw-text-on-warning);
  --lw-pill-tint: var(--lw-status-pending-tint);
  --lw-pill-ink:  var(--lw-status-pending-ink);
}
.lw-pill--pass {
  --lw-pill-fill: var(--lw-status-pass-fill);
  --lw-pill-on:   var(--lw-text-on-success);
  --lw-pill-tint: var(--lw-status-pass-tint);
  --lw-pill-ink:  var(--lw-status-pass-ink);
}
.lw-pill--fail {
  --lw-pill-fill: var(--lw-status-fail-fill);
  --lw-pill-on:   var(--lw-text-on-danger);
  --lw-pill-tint: var(--lw-status-fail-tint);
  --lw-pill-ink:  var(--lw-status-fail-ink);
}
.lw-pill--disabled {
  --lw-pill-fill: var(--lw-status-disabled-fill);
  --lw-pill-on:   var(--lw-text-on-disabled);
  --lw-pill-tint: var(--lw-status-disabled-tint);
  --lw-pill-ink:  var(--lw-status-disabled-ink);
}
.lw-pill > i {
  font-size: 0.95em;
  line-height: 1;
  color: inherit;
}
.lw-pill--sm {
  font-size: var(--lw-fs-xs);
  padding: 0.3rem 0.5rem;
}
.lw-pill--solid {
  color: var(--lw-pill-on);
  background: var(--lw-pill-fill);
}
.lw-pill--dot {
  gap: 0.4rem;
  padding: 0;
  background: none;
  border-radius: 0;
  font-weight: var(--lw-fw-normal);
  font-size: var(--lw-fs-md);
  letter-spacing: 0;
  line-height: inherit;
  color: var(--lw-text-secondary);
}
.lw-pill--dot.lw-pill--sm {
  font-size: var(--lw-fs-sm);
}
.lw-pill--dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lw-pill-ink);
  flex-shrink: 0;
}
.lw-pill--dot > i {
  display: none; /* the dot replaces the icon */
}

/* ---- Table row status accent (pairs with a StatusPill cell) ------------------
   <tr class="lw-row-status--pass"> … </tr>  → the FIRST cell shows a 3px left accent in the status ink.
   Drawn as an inset box-shadow, not a border, so it survives `.table-bordered td { border … !important }`
   (style.bundle.css) and `body.dark-mode .table td { border-color … !important }` (dark-mode.css), takes
   no layout space (no first-column shift between accented and plain rows) and needs no reservation on
   unaccented rows. Cells keep their surface colour. Replaces the .chkRed / .chkPurp / .chkYellow /
   .bg-light-green floods and the inline tenant background floods — remove those when you add this. */
tr.lw-row-status--pending > td:first-child,
tr.lw-row-status--pending > th:first-child { box-shadow: inset 3px 0 0 0 var(--lw-status-pending-ink); }
tr.lw-row-status--pass > td:first-child,
tr.lw-row-status--pass > th:first-child { box-shadow: inset 3px 0 0 0 var(--lw-status-pass-ink); }
tr.lw-row-status--fail > td:first-child,
tr.lw-row-status--fail > th:first-child { box-shadow: inset 3px 0 0 0 var(--lw-status-fail-ink); }
tr.lw-row-status--disabled > td:first-child,
tr.lw-row-status--disabled > th:first-child { box-shadow: inset 3px 0 0 0 var(--lw-status-disabled-ink); }

/* ---- Dropzone (quiet) ---------------------------------------------------------
   Two ways to use it — same look, same states:
   A) Native, no JavaScript: a <label> wraps the file input, so a click opens the picker by itself.
      <label class="lw-dropzone">
        <i class="fas fa-cloud-upload-alt" aria-hidden="true"></i>
        <span class="lw-dropzone__label">Drag files here or click to upload</span>
        <span class="lw-dropzone__hint">PDF, JPG, PNG, DOCX · up to 25 MB</span>
        <input type="file" multiple name="files[]">
      </label>
   B) Bound to Dropzone.js (the app's upload library): keep the library's `dropzone` class so its own
      preview / progress / message rules (all scoped under .dropzone in plugins.bundle.css) still apply;
      Dropzone.js toggles `dz-drag-hover`, which is honoured here as the dragover state.
      <div class="dropzone lw-dropzone" id="myDropzone">
        <div class="dz-message"><i class="fas fa-cloud-upload-alt" aria-hidden="true"></i>
          <span class="lw-dropzone__label">Drag files here or click to upload</span>
          <span class="lw-dropzone__hint">PDF, JPG, PNG, DOCX · up to 25 MB</span></div>
      </div>
   Error line (either form): <span class="lw-dropzone__error" role="alert"><i class="fas fa-exclamation-circle" aria-hidden="true"></i> File exceeds 25 MB</span>
   Modifier : lw-dropzone--compact (tighter padding, hint hidden — inline / table use)
   States   : .is-dragover (or Dropzone.js's .dz-drag-hover) · .is-error · .is-disabled / [aria-disabled="true"]
              (disabled zones do not light up on dragover; do not give them tabindex).
   Quiet by default (dashed input border, muted icon); intensifies to primary blue + primary TINT only while
   dragging over. Never a saturated fill. Deprecates the magenta .dropzone rules in custom.css. */
.lw-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  min-height: 0;
  padding: 1.75rem 1.5rem !important;            /* !important: custom.css .dropzone { padding … !important } */
  font-family: var(--lw-font-sans);
  font-weight: var(--lw-fw-normal);
  border: 2px dashed var(--lw-input-border) !important;   /* !important: custom.css .dropzone { border: 0 !important } */
  border-radius: var(--lw-radius);
  background: var(--lw-input-bg);
  color: var(--lw-text-muted);
  cursor: pointer;
  transition: border-color var(--lw-transition-fast), background var(--lw-transition-fast);
}
.lw-dropzone > i,
.lw-dropzone .dz-message > i {
  font-size: 1.6rem;
  color: var(--lw-text-muted);
  transition: color var(--lw-transition-fast);
}
.lw-dropzone__label {
  display: block;
  font-size: var(--lw-fs-md);
  font-weight: var(--lw-fw-medium);
  color: var(--lw-text);
}
.lw-dropzone__hint {
  display: block;
  font-size: var(--lw-fs-sm);
  color: var(--lw-text-muted);
}
.lw-dropzone > input[type="file"] {
  display: none;
}
.lw-dropzone .dz-message {                        /* Dropzone.js message wrapper: lay it out like the native form */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.lw-dropzone--compact {
  gap: 0.35rem;
  padding: 1rem !important;
}
.lw-dropzone--compact > i,
.lw-dropzone--compact .dz-message > i {
  font-size: 1.2rem;
}
.lw-dropzone--compact .lw-dropzone__hint {
  display: none;
}
.lw-dropzone:not(.is-disabled):not([aria-disabled="true"]).is-dragover,
.lw-dropzone:not(.is-disabled):not([aria-disabled="true"]).dz-drag-hover {
  border-color: var(--lw-primary) !important;
  background: var(--lw-primary-tint);
}
.lw-dropzone:not(.is-disabled):not([aria-disabled="true"]).is-dragover > i,
.lw-dropzone:not(.is-disabled):not([aria-disabled="true"]).dz-drag-hover > i,
.lw-dropzone:not(.is-disabled):not([aria-disabled="true"]).is-dragover .dz-message > i,
.lw-dropzone:not(.is-disabled):not([aria-disabled="true"]).dz-drag-hover .dz-message > i,
.lw-dropzone:not(.is-disabled):not([aria-disabled="true"]).is-dragover .lw-dropzone__label,
.lw-dropzone:not(.is-disabled):not([aria-disabled="true"]).dz-drag-hover .lw-dropzone__label {
  color: var(--lw-primary-ink);
}
.lw-dropzone.is-error {
  border-color: var(--lw-input-border-error) !important;
}
.lw-dropzone.is-disabled,
.lw-dropzone[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}
.lw-dropzone:focus-visible {
  outline: 2px solid var(--lw-focus-ring-inner);
  outline-offset: 0;
  box-shadow: 0 0 0 4px var(--lw-focus-ring-outer);
}
.lw-dropzone__error {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-family: var(--lw-font-sans);
  font-size: var(--lw-fs-sm);
  color: var(--lw-danger-ink);
}

/* ---- Admin Field Edit Mode (CU-868m662tt) ----------------------------------
   The in-context form field controller on the loan file. No Metronic equivalent:
   this is a page MODE, not a component — a fixed toggle, a status banner, and a
   set of overlay states applied to markup the tab already rendered.

   Everything here is inert until <body> gains .lw-field-edit, so an ordinary loan
   file page pays for the toggle button and nothing else.

   Two-class selectors (.btn.fieldEditModeToggle) are deliberate throughout: Metronic's
   own `.btn.btn-icon { display: inline-flex }` and friends are two- and three-class
   rules, and a single-class rule loses the specificity tie to them.
   ------------------------------------------------------------------------- */

/* The toggle normally sits in the file header beside the favourites star, styled by
   the same Metronic icon-button classes as its neighbours (fieldEditMode.placeToggle()).
   While the mode is on it is filled, so the header says the page is in edit mode. */
.btn.fieldEditModeToggle.is-active,
.btn.fieldEditModeToggle.is-active:hover {
  background: var(--lw-primary);
  color: var(--lw-text-on-primary);
  border-color: var(--lw-primary);
}

.btn.fieldEditModeToggle.is-active i {
  color: var(--lw-text-on-primary);
}

/* dark-mode.css forces EVERY `.btn.btn-light` transparent with !important (the header
   icon buttons), which would erase both the active fill and the master tint — in dark
   mode the header would no longer say the page is in edit mode. Only a more specific
   !important can win; scoped to this one control's two states. */
body.dark-mode .btn.btn-light.fieldEditModeToggle.is-active {
  background-color: var(--lw-primary) !important;
  border-color: var(--lw-primary) !important;
}

body.dark-mode .btn.btn-light.fieldEditModeToggle--master {
  background-color: var(--lw-danger-tint) !important;
  border-color: var(--lw-danger) !important;
}

body.dark-mode .btn.btn-light.fieldEditModeToggle--master.is-active {
  background-color: var(--lw-danger) !important;
}

/* Fallback only: a page with no favourites star gets the old floating corner button. */
.btn.fieldEditModeToggle.fieldEditModeToggle--floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 95;               /* above page content, below Metronic's modals (1050+) */
  box-shadow: var(--lw-shadow-dropdown);
}

.btn.fieldEditModeToggle.fieldEditModeToggle--floating.is-active {
  bottom: 64px;              /* clear of the banner, which owns the bottom edge */
}

/* MASTER MODE — a different tenant, a different blast radius (CU-868m662tt).

   Inside the master tenant the same gear writes tblFormFieldsMaster: what every NEW
   company inherits and what a reset restores. The ordinary edit-mode banner is already
   warning-amber, so amber cannot carry this distinction; master takes the danger ramp,
   which is the next step up the same scale.

   It is on the TOGGLE as well as the banner, because the toggle is what an admin sees
   before they commit to the mode — the point at which "am I in the master file or a
   customer's?" is still a cheap question to answer. */
.btn.fieldEditModeToggle--master {
  background: var(--lw-danger-tint);
  color: var(--lw-danger-ink);
  border-color: var(--lw-danger);
}

.btn.fieldEditModeToggle--master.is-active {
  background: var(--lw-danger);
  color: var(--lw-text-on-danger);
  border-color: var(--lw-danger);
}

@media (max-width: 767.98px) {
  /* Icon only — the label costs more width than it earns on a phone. */
  .btn.fieldEditModeToggle .fieldEditModeToggle__label {
    display: none;
  }
}

/* Bottom, not top. A top banner would sit on Metronic's fixed #kt_header and
   cover the navigation, and pinning it below the header means tracking
   --lw-loan-chrome-top, which is only valid at >=992px (Metronic swaps in
   .header-mobile and stops fixing the subheader below that). The bottom edge has
   no such chrome, pairs with the toggle, and stays visible while scrolling. */
.fieldEditModeBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 96;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  /* Right padding keeps Done clear of the floating Help widget in the bottom-right
     corner (~90px wide, 18px in), which otherwise sits on top of it. */
  padding: 0.5rem 124px 0.5rem 1rem;
  font-family: var(--lw-font-sans);
  font-size: var(--lw-fs-sm);
  background: var(--lw-warning-tint);
  color: var(--lw-warning-ink);
  border-bottom: var(--lw-border-width) solid var(--lw-warning);
}

/* Tint, not fill. The design system keeps status colour off large surfaces — the red
   lives on the pill and the border, and the banner stays a tint like its amber sibling. */
.fieldEditModeBanner--master {
  background: var(--lw-danger-tint);
  color: var(--lw-danger-ink);
  border-bottom-color: var(--lw-danger);
  border-top: var(--lw-border-width) solid var(--lw-danger);
}

.fieldEditModeBanner[hidden] {
  display: none;
}

.fieldEditModeBanner__main,
.fieldEditModeBanner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.fieldEditModeBanner__sep {
  opacity: 0.5;
}

.fieldEditModeBanner__note,
.fieldEditModeBanner__counts {
  color: var(--lw-text-muted);
}

/* The status line doubles as the diagnosis when a stage comes back empty. Muted grey
   would let "No fields resolved" read as ordinary chrome, which is how three rounds of
   this bug went unnoticed in the banner that was already reporting it. */
.fieldEditModeBanner__counts.is-error {
  font-weight: var(--lw-fw-semibold);
  color: var(--lw-status-fail-ink);
}

/* NOT muted. This note states the propagation rule — the single most misreadable fact
   in the feature — so it has to read as content, not chrome. Same reasoning as
   .is-error above, which was added after three rounds of a banner reporting a failure
   nobody saw. */
.fieldEditModeBanner__note.fieldEditModeBanner__note--master {
  max-width: 46rem;
  color: var(--lw-danger-ink);
  font-weight: var(--lw-fw-medium);
}

.fieldEditModeBanner__off {
  font-weight: var(--lw-fw-semibold);
}

/* Shown only in the top position (below). The icons are disabled only there — the
   bottom fallback means the page had no icon group to disable. */
.fieldEditModeBanner__details,
.fieldEditModeBanner__offIcons {
  display: none;
}

/* THE TOP POSITION (PO) — inline in the subheader row, just before the file's action
   icons. fieldEditMode.placeBanner() moves the banner there and adds this modifier; the
   fixed-bottom rules above stay as the fallback for a page with no action-icon group.

   ONE LINE ONLY. The subheader is position:fixed and the content under it is offset by a
   constant (--lw-loan-chrome-top in custom.css), not a measurement, so a taller subheader
   would cover the top of the form. The essentials stay visible; everything marked __extra
   goes into the details tooltip, and the file title truncates instead of wrapping. */
.fieldEditModeBanner.fieldEditModeBanner--inline {
  position: static;
  /* Never shrinks — a squeezed banner clipped "Editing …" and spilled Done over the icons.
     The file title is what gives way (below). */
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-right: 0.5rem;
  padding: 0.2rem 0.3rem 0.2rem 0.75rem;
  gap: 0.5rem;
  font-size: var(--lw-fs-xs);
  white-space: nowrap;
  border: var(--lw-border-width) solid var(--lw-warning);
  border-radius: var(--lw-radius-pill);
}

.fieldEditModeBanner.fieldEditModeBanner--inline.fieldEditModeBanner--master {
  border: var(--lw-border-width) solid var(--lw-danger);
}

.fieldEditModeBanner--inline .fieldEditModeBanner__main,
.fieldEditModeBanner--inline .fieldEditModeBanner__actions {
  flex-wrap: nowrap;
}

.fieldEditModeBanner--inline .fieldEditModeBanner__extra {
  display: none;
}

/* The counts stay on screen only while they report a problem — the editor's diagnosis. */
.fieldEditModeBanner--inline .fieldEditModeBanner__countsWrap:not(:has(.is-error)) {
  display: none;
}

.fieldEditModeBanner--inline .fieldEditModeBanner__details {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: auto;
  padding: 0 0.1rem;
  color: inherit;
}

.fieldEditModeBanner--inline .fieldEditModeBanner__offIcons {
  display: inline;
}

.fieldEditModeBanner--inline #fieldEditModeExit {
  padding: 0.15rem 0.7rem;
  font-size: var(--lw-fs-xs);
  border-radius: var(--lw-radius-pill);
}

/* The file title gives way, rather than wrapping and growing the fixed subheader: one line,
   truncated, with its own info icon kept on that line. */
body.lw-field-edit #kt_subheader .container-fluid > .flex-grow-1.min-width-0 {
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

body.lw-field-edit #kt_subheader h6.text-break {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Narrower desktops: "Editing <form>" moves into the details tooltip too. */
@media (max-width: 1399.98px) {
  .fieldEditModeBanner--inline .fieldEditModeBanner__portal {
    display: none;
  }
}

/* Below lg Metronic stops fixing the subheader, so the banner may wrap freely there. */
@media (max-width: 991.98px) {
  .fieldEditModeBanner.fieldEditModeBanner--inline,
  .fieldEditModeBanner--inline .fieldEditModeBanner__main,
  .fieldEditModeBanner--inline .fieldEditModeBanner__actions {
    flex-wrap: wrap;
    white-space: normal;
  }

  .fieldEditModeBanner.fieldEditModeBanner--inline {
    border-radius: var(--lw-radius-lg);
  }
}

/* The file's action icons while the mode is on — fieldEditMode.setActionIconsDisabled().
   The swallowing happens in a capture listener; this is only how they look. */
body.lw-field-edit .lw-fieldedit-actionOff {
  opacity: 0.35;
  filter: grayscale(1);
  cursor: not-allowed;
}

/* "There's a better way" — the notice and intro popup on Platform Settings → Form Fields
   and Custom Form Fields (sections/fieldEditModeNotice.php). The Alert recipe: soft tint,
   ink text, icon and left accent — the ink token, not alert-light-primary's own blue,
   which is the deprecated #3699FF-as-text. */
.alert.fieldEditModeNotice {
  align-items: center;
  background-color: var(--lw-primary-tint);
  border: 0;
  border-left: 3px solid var(--lw-primary-ink);
}

.fieldEditModeNotice .alert-text,
.fieldEditModeNotice .alert-icon i,
.fieldEditModeNotice .alert-text i {
  color: var(--lw-primary-ink);
}

.fieldEditModeNotice__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1rem;
}

@media (max-width: 767.98px) {
  .alert.fieldEditModeNotice {
    flex-wrap: wrap;
  }

  .fieldEditModeNotice__actions {
    margin: 0.5rem 0 0;
  }
}

.fieldEditModeIntro .modal-content {
  border-radius: var(--lw-radius-lg);
}

.fieldEditModeIntro__lead {
  font-size: var(--lw-fs-md);
}

.fieldEditModeIntro__heading {
  margin: 1.25rem 0 0.5rem;
  font-weight: var(--lw-fw-semibold);
  color: var(--lw-text-primary);
}

.fieldEditModeIntro__steps {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.fieldEditModeIntro__steps li {
  margin-bottom: 0.4rem;
}

/* A picture of where to click, not controls: never focusable or clickable. */
.fieldEditModeIntro__where {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0 0.25rem;
  vertical-align: middle;
  pointer-events: none;
}

.fieldEditModeIntro__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fieldEditModeIntro__list li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.fieldEditModeIntro__list i {
  flex: 0 0 1rem;
  text-align: center;
  color: var(--lw-primary-ink);
}

@media (max-width: 575.98px) {
  .fieldEditModeIntro__list {
    grid-template-columns: 1fr;
  }
}

.fieldEditModeIntro__note {
  margin: 1.25rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: var(--lw-radius);
  background-color: var(--lw-success-tint);
  color: var(--lw-text-primary);
}

.fieldEditModeIntro__note i {
  margin-right: 0.4rem;
  color: var(--lw-success-ink);
}

/* Data entry is OFF in this mode. Killing pointer events on the controls stops
   Property Info's .autosave blur handlers firing, stops Chosen dropdowns opening
   behind the panel, and stops stray focus — without touching a single handler or
   removing the `disabled` attribute that keeps a revealed field unwritable. */
body.lw-field-edit #loanModForm input,
body.lw-field-edit #loanModForm textarea {
  pointer-events: none;
}

/* SELECTS, RADIOS AND CHECKBOXES/SWITCHES ARE THE EXCEPTION — deliberately clickable.
   A change to one is a PREVIEW (CU-868m662tt, PO): it runs the page's show/hide JS so
   the child fields it controls open up and can be configured, and fieldEditMode.js
   makes sure nothing is saved and Done puts it back. The original reason for selects:
   An admin cannot decide whether a pick list should stay visible without seeing
   what is IN it, and the label alone rarely says ("Occupancy", "Lien Position").
   So a dropdown opens and scrolls in this mode. What keeps a choice from being SAVED
   is enforced in JS, not here — fieldEditMode.guardDataEntry() reverts an
   autosave-bound control on a CAPTURE-phase event, before every autosave handler on
   the page (they bind on bubble, directly and delegated on document); a same-origin
   write guard refuses anything else that tries to save; and Done restores every value. */
body.lw-field-edit #loanModForm select,
body.lw-field-edit #loanModForm .chosen-container,
body.lw-field-edit #loanModForm input[type="radio"],
body.lw-field-edit #loanModForm input[type="checkbox"] {
  pointer-events: auto;
}

/* ...except while the settings panel is open. A Chosen list is positioned in the
   document, not in a layer, so it would render UNDER the slide-over — the original
   reason every control here had pointer-events killed. */
body.lw-field-edit.is-fieldedit-panel-open #loanModForm select,
body.lw-field-edit.is-fieldedit-panel-open #loanModForm .chosen-container {
  pointer-events: none;
}

/* ...except anything the editor itself renders. */
body.lw-field-edit #loanModForm .lw-fieldedit-ui,
body.lw-field-edit #loanModForm .lw-fieldedit-ui input,
body.lw-field-edit #loanModForm .lw-fieldedit-ui select,
body.lw-field-edit #loanModForm .lw-fieldedit-ui textarea {
  pointer-events: auto;
}

body.lw-field-edit .lw-fieldedit-section {
  outline: var(--lw-border-width) dashed var(--lw-border-strong);
  outline-offset: 2px;
}

body.lw-field-edit .lw-fieldedit-target {
  position: relative;        /* chip anchor (Phase 2) */
}

body.lw-field-edit .lw-fieldedit-target:hover {
  background: var(--lw-surface-hover);
}

/* A field the tenant has HIDDEN, shown because its section is revealing.
   `.secHide` is display:none unless revealed, so this only ever paints on a field
   the admin asked to see.

   ⚠️ DELIBERATE DEPARTURE from "status colour never fills" (PO request, CU-868m662tt).
   The rule exists to stop status floods in DATA tables, where a tinted row reads as a
   property of the record. Nothing here is a record: this is a transient, Manager-only
   configuration overlay, and the tint marks a SETTING ("this field is switched off")
   on a tab where a revealed field is otherwise indistinguishable from its 40 visible
   neighbours. The previous quiet treatment — dashed grey at 0.75 opacity — was
   reported as too easy to miss, which defeats the reveal.

   Scope is what keeps it honest: it cannot appear outside body.lw-field-edit, so no
   ordinary page can ever show it. The tint is also NOT the only signal — the dashed
   outline (shape) and the is-field-off left accent both carry it, so the state does
   not depend on colour perception.

   Tokens, not a hex: --lw-danger-tint is #FFE2E5 in light and #581A21 in dark, so the
   wash stays faint and the label stays legible in both themes. Opacity is deliberately
   NOT reduced any more — the admin has to be able to read the field to judge it. */
body.lw-field-edit .lw-fieldedit-target.secHide {
  background: var(--lw-danger-tint);
  outline: var(--lw-border-width) dashed var(--lw-danger);
  outline-offset: 1px;
}

/* Hover has to stay perceptible, but the tint already owns the background and wins on
   specificity over the generic :hover fill — so hover firms the OUTLINE instead of
   introducing a second red. */
body.lw-field-edit .lw-fieldedit-target.secHide:hover {
  outline-style: solid;
}

/* The reveal, scoped to ONE section. custom.css sets
   `.secHide { display: none !important }`, so this has to carry !important too — it
   wins on specificity (four classes + descendant), not on order, which is what makes
   it safe to load before or after custom.css.

   Per section, not page-wide: on a tab like Loan Info a global reveal drops dozens
   of fields into the layout at once and the admin loses their place. The body class
   is the cheap gate; .is-revealing-hidden on the card is what actually selects. */
body.lw-field-edit-reveal .lw-fieldedit-section.is-revealing-hidden .lw-fieldedit-target.secHide {
  display: block !important;
}

/* A SECTION WHOSE FIELDS ARE ALL OFF IS STILL SHOWN IN EDIT MODE.

   PO requirement: an admin cannot turn a field back on in a section they cannot see,
   and a section with every field off collapses to nothing. Measured on a real loan
   file: 12 of Quick App's 64 sections are in this state, including Fees & Costs with
   77 fields and Quick App Info with 40 — all of them unreachable.

   The cards ARE in the DOM and the editor has already resolved them and attached their
   chips; they are simply display:none. So this is a reveal, not a rebuild.

   NOT behind the per-section reveal toggle, deliberately. That toggle lives ON the card,
   so requiring a click to see the card is circular. These appear the moment the mode is
   entered.

   ⚠️ secHide IS NOT STRIPPED. It records what the server rendered, the editor reads
   field state off it, and the section chip's counts depend on it still meaning that.
   This is a CSS override scoped to the mode and undone by leaving it — the same
   discipline as the hidden-FIELD reveal above. `!important` is required to beat
   `.secHide { display: none !important }`, and it also beats an inline style="display:none"
   on the cards that hide themselves that way.

   ⚠️ KEYED ON THE MARKER CLASS, not on .secHide alone. markSectionsHiddenFromUsers()
   only sets the marker on sections that belong to THIS file's module(s) — on an HMLO
   file, 8 of the 11 hidden sections are Equipment, MEF or LM/SS products, and offering
   an HMLO tenant "SBA Questions" to switch on would read as a broken editor. Selecting
   on .secHide here would reveal them regardless of what the JS decided. */
body.lw-field-edit .card.card-custom.lw-fieldedit-section--offForUsers.secHide,
body.lw-field-edit .card.card-custom.lw-fieldedit-section--offForUsers[style*="display:none"],
body.lw-field-edit .card.card-custom.lw-fieldedit-section--offForUsers[style*="display: none"] {
  display: block !important;
}

/* Say so, unmistakably. A revealed section looks identical to a live one otherwise,
   and an admin who scrolls past would have no way to know this whole block is invisible
   to every ordinary user.

   PO call (CU-868m662tt): the HEADER carries it — a faint red header in place of the
   grey one, with the reason as plain text beside the heading. It replaced an amber pill
   and an amber card tint that read as loud. The fields themselves stay untinted so their
   own states remain readable. `!important` only because Metronic's bg-gray-100 utility
   on these headers is itself !important (and dark-mode.css re-declares it so). */
body.lw-field-edit .lw-fieldedit-section.lw-fieldedit-section--offForUsers > .card-header {
  background-color: var(--lw-danger-tint) !important;
}

body.lw-field-edit .lw-fieldedit-section--offForUsers > .card-header::after {
  content: 'Hidden from users — every field in this section is off';
  margin-left: 0.75rem;
  color: var(--lw-danger-ink);
  font-size: var(--lw-fs-xs);
  font-weight: var(--lw-fw-medium);
  white-space: nowrap;
}

/* Section chip — sits in the card toolbar the section already has, beside the
   collapse control, so it reads as chrome and never disturbs the heading text. */
.lw-fieldedit-sectionChip {
  display: none;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.4rem;
}

body.lw-field-edit .lw-fieldedit-sectionChip {
  display: inline-flex;
}

/* The rename pencil sits beside the section heading rather than in the toolbar (PO
   call — renaming is the one action that is about the heading). Sized down and given a
   little air so it reads as an affordance on the title, not another toolbar button. */
.lw-fieldedit-rename--inline {
  margin-left: 0.4rem;
  vertical-align: middle;
  opacity: 0.55;
  transition: opacity var(--lw-transition-fast);
}

.card-header:hover .lw-fieldedit-rename--inline,
.lw-fieldedit-rename--inline:focus-visible {
  opacity: 1;
}

.lw-fieldedit-sectionChip .btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* While a section is revealing, say so on the card itself — otherwise an admin who
   scrolls away cannot tell which sections are showing fields that are really off. */
body.lw-field-edit .lw-fieldedit-section.is-revealing-hidden {
  outline-color: var(--lw-primary);
}

/* The banner is fixed over the bottom edge, so the last rows of a long form would
   otherwise be unreachable. Only while the mode is active. */
body.lw-field-edit {
  padding-bottom: 56px;
}

/* Field chip — the per-field entry point. Absolutely positioned so adding it
   cannot reflow a grid that 131 templates hand-wrote. */
.lw-fieldedit-chip {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  display: none;             /* only exists while the mode is on */
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  color: var(--lw-primary-ink);
  background: var(--lw-surface);
  border: var(--lw-border-width) solid var(--lw-border);
  border-radius: var(--lw-radius-sm);
}

body.lw-field-edit .lw-fieldedit-chip {
  display: inline-flex;
}

.lw-fieldedit-chip:hover {
  color: var(--lw-text-on-primary);
  background: var(--lw-primary);
  border-color: var(--lw-primary);
}

/* State — a 3px left accent for "off" and the chip for "scoped". Off/highlighted/scoped
   are independent and can co-occur. HIGHLIGHT HAS NO BAR: it is the amber cell fill of
   .lw-field-flagged (below), which paintChip() applies in the mode exactly as the page
   pass does for everyone — the admin sees what users see (PO). */
body.lw-field-edit .lw-fieldedit-target.is-field-off {
  box-shadow: inset 3px 0 0 0 var(--lw-status-disabled);
}

body.lw-field-edit .lw-fieldedit-target.is-field-scoped .lw-fieldedit-chip {
  border-color: var(--lw-primary);
}

/* Settings panel — a slide-over, not a modal. The admin has to watch the field
   react to a toggle, which a dialog covering the form defeats. It is also not a
   second dialog stacked on a first, so the single-dialog rule is preserved. */
.lw-fieldedit-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  /* Over the banner AND over Metronic's scroll-to-top/bottom floats (#kt_scrollBottom
     is z-index 100 and sat on the Save button); still under Metronic's modals (1050+). */
  z-index: 101;
  display: flex;
  flex-direction: column;
  width: 340px;
  max-width: 92vw;
  font-family: var(--lw-font-sans);
  background: var(--lw-surface-raised);
  border-left: var(--lw-border-width) solid var(--lw-border);
  box-shadow: var(--lw-shadow-dropdown);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.lw-fieldedit-panel[hidden] {
  display: none;
}

.lw-fieldedit-panel.is-open {
  transform: translateX(0);
}

.lw-fieldedit-panel.is-saving {
  opacity: 0.6;
  pointer-events: none;
}

.lw-fieldedit-panel__head,
.lw-fieldedit-panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

.lw-fieldedit-panel__head {
  border-bottom: var(--lw-border-width) solid var(--lw-border-light);
}

.lw-fieldedit-panel__foot {
  justify-content: flex-end;
  border-top: var(--lw-border-width) solid var(--lw-border-light);
  /* Clear of the floating Help widget in the bottom-right corner (~52px tall, 18px up),
     which otherwise sits over Cancel and Save (PO). */
  margin-bottom: 76px;
}

.lw-fieldedit-panel__name {
  display: block;
  font-size: var(--lw-fs-xs);
  color: var(--lw-text-muted);
  background: none;
}

.lw-fieldedit-panel__body {
  flex: 1 1 auto;
  padding: 0.5rem 1rem;
  overflow-y: auto;          /* the panel is the only scroll container here */
  overscroll-behavior: contain;
}

.lw-fieldedit-panel__group {
  padding: 0.6rem 0;
  border-bottom: var(--lw-border-width) solid var(--lw-border-light);
}

.lw-fieldedit-panel__groupTitle {
  margin: 0 0 0.4rem;
  font-size: var(--lw-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lw-text-muted);
}

.lw-fieldedit-panel__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.3rem;
  font-size: var(--lw-fs-sm);
  color: var(--lw-text);
  cursor: pointer;
}

/* The portal the admin is actually looking at. Without this an admin on Quick App
   cannot tell at a glance which of the six toggles governs the field in front of
   them, and the other four are legitimately different. */
.lw-fieldedit-panel__row.is-current-portal .lw-fieldedit-panel__rowLabel {
  font-weight: 600;
  color: var(--lw-primary-ink);
}

.lw-fieldedit-panel__error {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: var(--lw-fs-sm);
  color: var(--lw-danger-ink);
  background: var(--lw-danger-tint);
}

.lw-fieldedit-panel__error[hidden] {
  display: none;
}

/* Drag is always on in edit mode (no Reorder toggle): the gear chip is a click (opens
   the panel) and a handle (drag past a few pixels, fieldEditMode.enableReorder()). The
   grab cursor is what tells the admin the second job exists. */
body.lw-field-edit .lw-fieldedit-chip {
  cursor: grab;
}

body.lw-field-edit .lw-fieldedit-chip:active,
body.lw-field-edit .ui-sortable-helper .lw-fieldedit-chip {
  cursor: grabbing;
}

/* jQuery UI needs a sized placeholder or the drop target collapses to nothing and
   the layout jumps under the cursor. */
.lw-fieldedit-placeholder {
  border: var(--lw-border-width) dashed var(--lw-primary);
  border-radius: var(--lw-radius-sm);
  background: var(--lw-primary-tint);
  visibility: visible !important;
}

/* Field highlight (CU-868m662tt) — a tenant-chosen visual cue on a form field.
   ALWAYS ON, for every user, not just in edit mode: the point is that staff notice
   the field while doing their job.

   ⚠️ A CLASS OF ITS OWN, deliberately NOT `.mandatory`. fileCommon.js reads
   `.mandatory` in eight places to enforce required-on-save, so styling a field with it
   would turn a presentation toggle into a data-entry blocker. Nothing but CSS reads
   `.lw-field-flagged`.

   IT FILLS THE FIELD'S OWN CELL, the way the legacy form field controller marks a
   mandatory field (custom.css `.mandatory`: a 14% amber fill on the input box itself,
   plus radio circles, Chosen and Select2 boxes). PO call: it replaced a 3px
   left bar that read as decoration rather than "this field". Tokenised — --lw-warning-tint
   is that same amber over white and has a real dark-mode value, where the legacy
   literal does not. A deliberate exception to the design system's "status colour
   on small elements only" rule: the fill is on the CONTROL, not across the row or the
   label, and it is the look staff already read as "pay attention to this field". */
.lw-field-flagged input.form-control,
.lw-field-flagged select.form-control,
.lw-field-flagged textarea.form-control,
.lw-field-flagged .input-group-text,
.lw-field-flagged .chosen-container .chosen-single,
.lw-field-flagged .chosen-container-multi .chosen-choices,
.lw-field-flagged .select2-container .select2-selection,
.lw-field-flagged .radio > input:not(:checked) ~ span,
.lw-field-flagged .checkbox > input:not(:checked) ~ span {
  background-color: var(--lw-warning-tint) !important;
}

/* Chosen paints its arrow box separately; legacy clears it for .mandatory the same way
   (custom.css `.mandatory > a.chosen-single > div { background: none }`), so the fill
   runs the full width of the cell. */
.lw-field-flagged .chosen-container .chosen-single > div,
body.dark-mode .lw-field-flagged .chosen-container .chosen-single > div {
  background: transparent !important;
}

/* dark-mode.css paints every control with `body.dark-mode input.form-control { … !important }`,
   which out-specifies the rule above; the same selectors under body.dark-mode restore it. */
body.dark-mode .lw-field-flagged input.form-control,
body.dark-mode .lw-field-flagged select.form-control,
body.dark-mode .lw-field-flagged textarea.form-control,
body.dark-mode .lw-field-flagged .input-group-text,
body.dark-mode .lw-field-flagged .chosen-container .chosen-single,
body.dark-mode .lw-field-flagged .chosen-container-multi .chosen-choices,
body.dark-mode .lw-field-flagged .select2-container .select2-selection,
body.dark-mode .lw-field-flagged .radio > input:not(:checked) ~ span,
body.dark-mode .lw-field-flagged .checkbox > input:not(:checked) ~ span {
  background-color: var(--lw-warning-tint) !important;
}

.lw-fieldedit-panel__hint {
  margin: 0.3rem 0 0;
  font-size: var(--lw-fs-xs);
  color: var(--lw-text-muted);
}

/* The system tip shown read-only above a company's Additional Tip box. */
.lw-fieldedit-panel__systemTip {
  margin: 0 0 0.4rem;
}

/* The plain-English read-back of a field's conditions, above its Edit button. */
.lw-fieldedit-panel__condSummary {
  margin: 0 0 0.5rem;
  font-size: var(--lw-fs-sm);
  color: var(--lw-text);
}

/* A field tooltip's "Additional Tip" rule (CU-868m662tt) — loanForm::additionalTipHtml().
   NOT edit-mode only: every user sees it, in a Bootstrap .tooltip or a Loan Info help
   .popover. Drawn in the tip's own text colour, softened: this app's tooltips are white
   with dark text in light mode and navy with white text in dark (not the inverted
   --lw-tooltip-* surface), so a fixed token vanished on one or the other. Measured both. */
.tooltip .lw-tip-sep,
.popover .lw-tip-sep {
  margin: 0.4rem 0;
  border: 0;
  color: inherit;             /* the UA sheet gives <hr> color:gray, which currentColor would take */
  border-top: var(--lw-border-width) solid currentColor;
  opacity: 0.3;
}

/* dark-mode.css darkens EVERY <hr> with !important, which on the navy tooltip is invisible. */
body.dark-mode .tooltip .lw-tip-sep,
body.dark-mode .popover .lw-tip-sep {
  border-top-color: currentColor !important;
}

/* Tooltip text as the admin typed it: line breaks, bullet characters and indentation kept.
   Left-aligned, because Bootstrap centres .tooltip-inner and centred bullets read badly. */
.lw-tip-text {
  display: block;
  white-space: pre-wrap;
  text-align: left;
}

/* A section heading's tooltip popover — marked by _customPage.js — keeps its line breaks too. */
.popover.lw-tip-preline .popover-body {
  white-space: pre-wrap;
  text-align: left;
}

/* "Hide from Borrowers", under a tooltip box in the Field Edit Mode panel. */
.lw-fieldedit-panel__tipHide {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
}

.lw-fieldedit-panel__tipHide .checkbox {
  margin-bottom: 0;
}

.lw-fieldedit-panel__tipHide .checkbox > span {
  margin-right: 0.5rem;
}

/* The rename box (Phase 2).

   Metronic's .form-control is themed by dark-mode.css, not by the token layer, so the
   input is pinned to the --lw-input-* tokens here instead of inheriting whatever that
   file happens to say. One declaration, correct in both themes, and it cannot drift
   when the legacy dark-mode overrides are edited. */
.lw-fieldedit-panel [data-lw-label] {
  background: var(--lw-input-bg);
  color: var(--lw-input-fg);
  border: var(--lw-border-width) solid var(--lw-input-border);
}

.lw-fieldedit-panel [data-lw-label]:focus {
  border-color: var(--lw-input-border-focus);
  box-shadow: var(--lw-shadow-focus);
}

.lw-fieldedit-panel [data-lw-label]::placeholder {
  color: var(--lw-input-placeholder);
}

.lw-fieldedit-panel [data-lw-label]:disabled {
  background: var(--lw-input-bg-disabled);
  color: var(--lw-input-fg-disabled);
}

/* The Chosen container inside the panel must not overflow it. */
.lw-fieldedit-panel .chosen-container {
  width: 100% !important;
}

/* Custom fields in Admin Field Edit Mode (CU-868m662tt Phase 6).

   The modal frames the real Platform Settings custom-field form, so it needs a height
   of its own — an iframe has no intrinsic one. Viewport-relative so the form's three
   columns and the display/mandatory table fit without a second scrollbar on most
   screens; the frame scrolls when they do not. */
.lw-fieldedit-cfModal .modal-content {
  background: var(--lw-surface-raised);
  border-radius: var(--lw-radius-lg);
  box-shadow: var(--lw-shadow-dropdown);
}

.lw-fieldedit-cfModal__frame {
  display: block;
  width: 100%;
  height: 72vh;
  border: 0;
  background: var(--lw-surface);
}

/* The just-saved field, pointed at after the reload. A short left accent in the pass
   colour — status on a small element, never a fill — removed after a few seconds. */
body.lw-field-edit .lw-fieldedit-target.lw-fieldedit-target--justAdded {
  box-shadow: inset 3px 0 0 0 var(--lw-status-pass);
}

/* A field shown by the reveal although the page's conditional logic hides it (its parent
   question is not answered the way that shows it). It is ON for users — so not the red
   "switched off" treatment — just not shown on this file right now: a neutral dashed
   outline says "revealed for you, conditional for them". */
body.lw-field-edit-reveal .lw-fieldedit-section.is-revealing-hidden .lw-fieldedit-target.is-field-conditional {
  outline: var(--lw-border-width) dashed var(--lw-border-strong);
  outline-offset: 1px;
}

/* ---- ChatPanel (CU-868jr5px1) ----------------------------------------------
   The floating surface the HubSpot support chat is embedded into. Not a
   translation of a vendored .jsx — the design system has no floating chat
   surface yet, so this is built from the Modal contract's tokens (surface-raised,
   radius-lg, shadow-dropdown) and uses Bootstrap's own `.close` control.
   Add it to component-map.md when the DS gains a ChatPanel component.

   HubSpot renders its chat into .lw-chat-panel__body via
   hsConversationsSettings.inlineEmbedSelector, so the panel owns the chrome the
   inline embed does not provide: a close button and a resize handle.

   Two constraints that are not obvious and must not be "tidied away":
     - Hidden with visibility, never display:none and never a transform. The
       widget loads while hidden and needs a laid-out box to measure into, and a
       transform would make the panel the containing block for the position:fixed
       parts of HubSpot's own UI — which stacks its messages on top of each other.
     - The panel is anchored to the bottom of the viewport, so it grows upward.
       The resize handle is therefore on the TOP edge, not the usual bottom-right.
   -------------------------------------------------------------------------- */
.lw-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--lw-z-dropdown);
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 100px);
  overflow: hidden;
  background: var(--lw-surface-raised);
  border: 1px solid var(--lw-border);
  border-radius: var(--lw-radius-lg);
  box-shadow: var(--lw-shadow-dropdown);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.lw-chat-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.lw-chat-panel__grip {
  flex: 0 0 auto;
  height: 10px;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.lw-chat-panel__grip::before {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: var(--lw-radius-pill);
  background: var(--lw-border-strong);
}
.lw-chat-panel__grip:hover::before,
.lw-chat-panel__grip:focus-visible::before {
  background: var(--lw-primary);
}
.lw-chat-panel__grip:focus-visible {
  outline: 2px solid var(--lw-focus-ring-inner);
  outline-offset: -2px;
}
/* While dragging, the pointer crosses HubSpot's iframe. Pointer capture keeps the
   events coming to the grip; this stops the iframe reacting to them. */
.lw-chat-panel.is-resizing .lw-chat-panel__body {
  pointer-events: none;
}
.lw-chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--lw-border-light);
}
.lw-chat-panel__close {
  color: var(--lw-text-muted);
  opacity: 1;
}
.lw-chat-panel__close:hover {
  color: var(--lw-text-primary);
}
.lw-chat-panel__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--lw-surface);
}
/* HubSpot mounts a wrapper of its own inside the embed target, so the fill has to
   apply to whatever it puts there, not just to an iframe. */
.lw-chat-panel__body > *,
.lw-chat-panel__body iframe {
  width: 100%;
  height: 100%;
}
.lw-chat-panel__body iframe {
  border: 0;
}
@media (max-width: 575.98px) {
  .lw-chat-panel {
    right: 16px;
    left: 16px;
    width: auto;
  }
}

/* ---- Verification panel (CU-868mnncwm) --------------------------------------
   The returning-borrower one-time-code panel on the public web forms, rendered by
   renderBorrowerVerifyPrompt() in fileCommon.js under the borrower email field.
   Neutral card; colour only on the small status icon and its text.
   States on .lw-verify__status: --info (sent) | --error | --success | --busy (spinner).
   .lw-verify-filled briefly marks the fields the prefill changed. */
.lw-verify {
  padding: var(--lw-sp-4);
  font-family: var(--lw-font-sans);
  color: var(--lw-text);
  background: var(--lw-surface-alt);
  border: var(--lw-border-width) solid var(--lw-border);
  border-radius: var(--lw-radius);
}
.lw-verify__title {
  display: flex;
  align-items: center;
  gap: var(--lw-sp-2);
  margin-bottom: var(--lw-sp-1);
  font-size: var(--lw-fs-md);
  font-weight: var(--lw-fw-semibold);
}
.lw-verify__title > i {
  color: var(--lw-primary-ink);
}
.lw-verify__intro {
  margin-bottom: var(--lw-sp-3);
  color: var(--lw-text-muted);
}
.lw-verify__methods {
  margin: 0 0 var(--lw-sp-3);
  padding: 0;
  border: 0;
}
.lw-verify__code {
  max-width: 16rem;
  margin-bottom: var(--lw-sp-3);
}
.lw-verify__code .form-control {
  font-family: var(--lw-font-mono);
  font-size: var(--lw-fs-lg);
  letter-spacing: 0.2em;
}
.lw-verify__status:empty {
  display: none;
}
.lw-verify__status {
  display: flex;
  align-items: flex-start;
  gap: var(--lw-sp-2);
  margin-bottom: var(--lw-sp-3);
  color: var(--lw-text-secondary);
}
.lw-verify__status > i,
.lw-verify__status > .spinner-border {
  flex: 0 0 auto;
  margin-top: 0.15em;
}
.lw-verify__status--info > i    { color: var(--lw-primary-ink); }
.lw-verify__status--busy        { color: var(--lw-text-muted); }
.lw-verify__status--error       { color: var(--lw-danger-ink); }
.lw-verify__status--success > i { color: var(--lw-success-ink); }
.lw-verify__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lw-sp-2);
}
.lw-verify__actions .cancelButtonOTP {
  margin-left: auto;
}
.lw-verify-filled {
  background-color: var(--lw-primary-light) !important;   /* !important: Metronic .form-control background */
  transition: background-color var(--lw-transition);
}
