/* VENDORED COPY - Brain/Components/notify-engine/notify-engine.css
   for Fernhollow Property Group, LLC (rentals), per the Site-Kit vendor-copy convention:
   ONE canonical engine, an isolated instance per business.  Byte-identical to
   the canonical source below this header - the header is a prefix and nothing
   else differs.  DO NOT EDIT THIS FILE; change the canonical copy and
   re-vendor.  The instance is configured entirely through NotifyEngine.mount()
   in templates/admin.html: the adapter, the theme-token aliases, and the four
   FHT events.  Its own node:test suite is vendored beside it in notify-tests/
   and is the contract this copy is held to. */
/* ============================================================================
   notify-engine.css — admin UI for the Notification and Email Engine.

   THEMING CONTRACT (ENGINES.md): every colour consumes a host design-system
   token with a neutral fallback — the SAME token names and the SAME neutral
   fallback values as invoice-engine.css and reconciliation-engine.css, so
   the owner's engines read as one family when unthemed and all pick up a
   host's palette identically when themed. Warn/good are this engine's own
   semantic colours (unresolved-variable state, "ready to send"), not brand,
   and are never host-overridable — same convention reconciliation-engine
   uses for match state.

   Every selector in this file is prefixed nte-. State modifiers (nte-is-*)
   are always written as compound selectors (e.g. .nte-tab.nte-is-active),
   never bare, so nothing here can leak onto host markup and no host style
   can leak onto this widget.

   The LOCKED SHELL is .nte-shell: header band (rendered subject), an
   optional warning band, body, footer. Layout/branding/typography live
   here and only here — the Templates tab UI never exposes a way to change
   them; admins edit subject/body copy only (design s6).
   ========================================================================== */

.nte-app { --nte-brand: var(--brand, #2F5D8A);
  --nte-on-brand: var(--on-brand, #fff);
  --nte-surface: var(--surface, #fff);
  --nte-surface-2: var(--surface-2, #F0F2F0);
  --nte-ground: var(--ground, #F4F5F3);
  --nte-ink: var(--ink, #1B1F1B);
  --nte-muted: var(--ink-muted, #62695F);
  --nte-line: var(--line, #D9DCD4);
  --nte-line-strong: var(--line-strong, #C2C6BC);
  --nte-danger: var(--danger, #B3261E);
  --nte-r: var(--r, 10px);
  --nte-mono: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  --nte-body: var(--font-body, ui-sans-serif, system-ui, sans-serif);
  --nte-display: var(--font-display, var(--nte-body));

  /* Engine-owned semantic colours — separate from the brand accent on
     purpose, same reasoning as reconciliation-engine.css: they describe
     validation state, not brand. */
  --nte-warn: #9C6B08; --nte-warn-bg: rgba(156,107,8,.14);
  --nte-good: #2E7D5B; --nte-good-bg: rgba(46,125,91,.12);
  --nte-danger-bg: rgba(179,38,30,.10);
  --nte-brand-bg: color-mix(in srgb, var(--nte-brand) 10%, transparent);

  display: flex; flex-direction: column; gap: 14px;
  font-family: var(--nte-body); color: var(--nte-ink);
  min-width: 0;
}
.nte-app * { box-sizing: border-box; }
.nte-app button, .nte-app input, .nte-app textarea, .nte-app select { font-family: inherit; }
@media (prefers-reduced-motion: reduce) {
  .nte-app * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------ head */
.nte-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--nte-line); }
.nte-brand-label { font: 700 10.5px/1 var(--nte-mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--nte-muted); }
.nte-tabs { display: flex; gap: 4px; background: var(--nte-ground);
  border: 1px solid var(--nte-line); border-radius: 999px; padding: 3px; }
.nte-tab { border: none; background: transparent; color: var(--nte-muted);
  font: 600 13px/1 var(--nte-body); padding: 7px 16px; border-radius: 999px;
  cursor: pointer; transition: background-color .12s ease, color .12s ease; }
.nte-tab:hover { color: var(--nte-ink); }
.nte-tab:focus-visible { outline: 2px solid var(--nte-brand); outline-offset: 2px; }
.nte-tab.nte-is-active { background: var(--nte-surface); color: var(--nte-ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.nte-mode { margin-left: auto; }
.nte-mode-badge { display: inline-flex; align-items: center; font: 700 11px/1 var(--nte-mono);
  letter-spacing: .04em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; }
.nte-mode-off { background: var(--nte-surface-2); color: var(--nte-muted); }
.nte-mode-dry { background: var(--nte-warn-bg); color: var(--nte-warn); }
.nte-mode-live { background: var(--nte-danger-bg); color: var(--nte-danger); }

/* --------------------------------------------------------------- banner */
.nte-errbar:empty { display: none; }
.nte-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: var(--nte-r); font: 500 13.5px/1.4 var(--nte-body); }
.nte-banner-danger { background: var(--nte-danger-bg); color: var(--nte-danger);
  border: 1px solid var(--nte-danger); }
.nte-banner-close { border: none; background: transparent; color: inherit; font-size: 18px;
  line-height: 1; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.nte-banner-close:hover { background: rgba(0,0,0,.06); }
.nte-banner-close:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }

/* ---------------------------------------------------------- placeholder */
.nte-placeholder { display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 4px; padding: 48px 20px;
  color: var(--nte-muted); background: var(--nte-ground); border: 1px dashed var(--nte-line-strong);
  border-radius: var(--nte-r); min-height: 200px; }
.nte-placeholder-title { font: 600 14px/1.3 var(--nte-body); color: var(--nte-ink); margin: 0; }
.nte-placeholder-sub { font: 400 13px/1.4 var(--nte-body); margin: 0; max-width: 34em; }

/* ------------------------------------------------------------- controls */
.nte-h2 { font: 700 15px/1.2 var(--nte-display); color: var(--nte-ink); margin: 0; }
.nte-label { display: block; font: 600 10.5px/1 var(--nte-mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--nte-muted); margin-bottom: 6px; }
.nte-hint { font: 400 12.5px/1.4 var(--nte-body); color: var(--nte-muted); margin: 4px 0 0; }

.nte-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--nte-line-strong);
  background: var(--nte-surface); color: var(--nte-ink); font: 600 13px/1 var(--nte-body);
  cursor: pointer; transition: filter .12s ease, transform .08s ease; }
.nte-btn:hover { filter: brightness(0.97); }
.nte-btn:active { transform: translateY(1px); }
.nte-btn:focus-visible { outline: 2px solid var(--nte-brand); outline-offset: 2px; }
.nte-btn[disabled] { opacity: .45; cursor: not-allowed; }
.nte-btn-primary { background: var(--nte-brand); border-color: var(--nte-brand); color: var(--nte-on-brand); }
.nte-btn-ghost { background: transparent; }
.nte-btn-ghost:hover { border-color: var(--nte-brand); color: var(--nte-brand); filter: none; }
.nte-btn-danger { color: var(--nte-danger); border-color: var(--nte-danger); background: transparent; }
.nte-btn-danger:hover { background: var(--nte-danger-bg); }
.nte-btn-sm { min-height: 28px; padding: 4px 12px; font-size: 12px; }

.nte-input, .nte-textarea, .nte-select {
  width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--nte-line-strong);
  border-radius: calc(var(--nte-r) - 4px); background: var(--nte-surface); color: var(--nte-ink);
  font: 400 13.5px/1.4 var(--nte-body); }
.nte-textarea { min-height: 180px; resize: vertical; font-family: var(--nte-mono); line-height: 1.5; }
.nte-input:focus-visible, .nte-textarea:focus-visible, .nte-select:focus-visible {
  outline: 2px solid var(--nte-brand); outline-offset: 1px; }
.nte-input[readonly] { background: var(--nte-ground); color: var(--nte-muted); }
.nte-select-sm { width: auto; min-height: 28px; padding: 3px 8px; font-size: 12px; }

.nte-field { margin-bottom: 14px; }
.nte-field-issue { font: 600 12px/1.4 var(--nte-body); color: var(--nte-danger); margin: 4px 0 0; min-height: 1px; }
.nte-field-issue:empty { display: none; }

/* -------------------------------------------------------- templates tab */
.nte-tpl-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; min-width: 0; }
@media (max-width: 760px) { .nte-tpl-layout { grid-template-columns: 1fr; } }

.nte-tpl-list { display: flex; flex-direction: column; gap: 10px; background: var(--nte-surface);
  border: 1px solid var(--nte-line); border-radius: var(--nte-r); padding: 14px; min-width: 0; }
.nte-tpl-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nte-tpl-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nte-tpl-row { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; background: transparent; border: 1px solid transparent; border-radius: calc(var(--nte-r) - 4px);
  padding: 8px 10px; cursor: pointer; }
.nte-tpl-row:hover { background: var(--nte-ground); }
.nte-tpl-row:focus-visible { outline: 2px solid var(--nte-brand); outline-offset: -2px; }
.nte-tpl-row.nte-is-selected { background: var(--nte-brand-bg); border-color: var(--nte-brand); }
.nte-tpl-key { font: 700 12.5px/1.3 var(--nte-mono); color: var(--nte-ink); }
.nte-tpl-subj { font: 400 12.5px/1.3 var(--nte-body); color: var(--nte-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.nte-tpl-badge { font: 600 10.5px/1 var(--nte-mono); letter-spacing: .04em; color: var(--nte-muted); }
.nte-empty { list-style: none; padding: 18px 6px; color: var(--nte-muted); font: 400 13px/1.4 var(--nte-body); }

.nte-tpl-editor { background: var(--nte-surface); border: 1px solid var(--nte-line); border-radius: var(--nte-r);
  padding: 18px; min-width: 0; }
.nte-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.nte-editor-head-actions { display: flex; gap: 8px; }
.nte-editor-actions { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; }
.nte-save-msg { font: 600 12.5px/1 var(--nte-body); color: var(--nte-good); }
.nte-save-msg-issue { color: var(--nte-danger); }
.nte-save-msg:empty { display: none; }

/* ------------------------------------------------------------- palette */
.nte-palette { margin-bottom: 20px; padding-top: 14px; border-top: 1px dashed var(--nte-line); }
.nte-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nte-chip { border: 1px solid var(--nte-line-strong); background: var(--nte-ground); color: var(--nte-ink);
  font: 600 12px/1 var(--nte-mono); padding: 6px 10px; border-radius: 999px; cursor: pointer;
  transition: filter .12s ease; }
.nte-chip:hover { filter: brightness(0.96); border-color: var(--nte-brand); }
.nte-chip:focus-visible { outline: 2px solid var(--nte-brand); outline-offset: 1px; }

/* ------------------------------------------------------ preview / shell */
.nte-preview { padding-top: 4px; }
.nte-preview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.nte-shell { border: 1px solid var(--nte-line); border-radius: var(--nte-r); overflow: hidden;
  background: var(--nte-surface); }
.nte-shell-empty { padding: 28px 18px; text-align: center; background: var(--nte-ground); }
.nte-shell-empty .nte-hint { margin: 0; }
.nte-shell-head { background: var(--nte-brand); color: var(--nte-on-brand);
  font: 700 15px/1.4 var(--nte-display); padding: 16px 20px; word-break: break-word; }
.nte-shell-warn { background: var(--nte-warn-bg); color: var(--nte-warn); font: 600 12.5px/1.5 var(--nte-body);
  padding: 10px 20px; border-bottom: 1px solid var(--nte-line); }
.nte-shell-warn code { font-family: var(--nte-mono); background: rgba(0,0,0,.06); border-radius: 3px; padding: 0 3px; }
.nte-shell-body { padding: 20px; font: 400 14px/1.6 var(--nte-body); color: var(--nte-ink);
  white-space: pre-wrap; word-break: break-word; }
.nte-shell-foot { padding: 12px 20px; border-top: 1px solid var(--nte-line); background: var(--nte-ground);
  font: 400 11.5px/1.4 var(--nte-body); color: var(--nte-muted); }
.nte-shell-ready { color: var(--nte-good); font-weight: 700; }
.nte-shell-unsendable { box-shadow: 0 0 0 2px var(--nte-danger); }
.nte-unresolved { background: var(--nte-danger-bg); color: var(--nte-danger); border-radius: 3px;
  padding: 0 2px; font-weight: 600; }
