/* shared modal chrome — used by admin.html (edit board) and index.html (entity mapping) */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 160ms ease;
}
.modal-dialog {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.22);
  width: 600px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms cubic-bezier(.2, .8, .2, 1);
}
.modal-overlay.is-open { opacity: 1; }
.modal-overlay.is-open .modal-dialog {
  opacity: 1;
  transform: translateY(0);
}
.modal-overlay.is-closing { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .modal-overlay,
  .modal-dialog {
    transition-duration: 1ms;
  }
  .modal-dialog { transform: none; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 600; margin: 0; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #aaa;
  padding: 0 2px;
}
.modal-close:hover { color: #111; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal-body > label, .modal-section > label {
  display: block;
  font-size: 12px;
  color: #6b6b72;
  margin-bottom: 4px;
}
.modal-body > input, .modal-body > textarea { margin-bottom: 10px; }
.modal-section { border-top: 1px solid #eee; margin-top: 18px; padding-top: 14px; }
/* The uppercase micro-label, declared once for everything in a modal that wears
   one. They had drifted into three near-copies (11/.07, 11/.06, 10.5/.08) that
   differed by nothing anyone could see. The one difference that MEANS something
   is the ink: a section title and the template row's label name a region and are
   set in body ink; .dw-label sits directly above a single control inside a
   drawer and is dimmed so it doesn't compete with the control's own text. */
.modal-section-title,
.mm-template-label,
.dw-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.modal-section-title,
.mm-template-label { color: var(--text, #111); }
.modal-section-title { margin-bottom: 12px; }
.dw-label { color: #8a8a92; }
/* A section heading with controls parked on its right — the heading keeps its
   own margins, so pass the row's bottom spacing inline where the section
   needs it. */
.section-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* base element styles — mirrors admin.html globals so the modal looks the same on all pages */
.modal-dialog input {
  padding: 8px 10px;
  border: 1px solid #d8d8de;
  border-radius: 7px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.modal-dialog select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 30px 8px 10px;
  border: 1px solid #d8d8de;
  border-radius: 7px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6b72' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
}
/* A select still on select.js's placeholder is showing a prompt, not an answer,
   and should read like the input placeholders next to it. Keyed on the marker
   rather than on an empty value: "" is a real choice on the pickers that offer
   an "App default" / "Same as the tagger" row. */
.modal-dialog select:has(option[data-placeholder]:checked) { color: #9a9aa6; }
/* The open list is painted from the select's own color, so dimming the closed
   control greys every row in the popup with it — an unanswered picker looked
   like a picker with nothing left to pick. The rows carry their color
   themselves; only the prompt is dim. `:enabled` because a disabled select is
   dimmed ON PURPOSE (.mm-live, the extraction row while it loads) and its rows
   should go with it — this rule is only here to undo an inherited dim, not to
   give options a color of their own. */
.modal-dialog select:enabled option { color: #111; }
.modal-dialog select option[data-placeholder] { color: #9a9aa6; }
.modal-dialog textarea {
  width: 100%;
  font: 12px/1.5 "SF Mono", Consolas, monospace;
  padding: 8px 10px;
  border: 1px solid #d8d8de;
  border-radius: 7px;
  resize: vertical;
  box-sizing: border-box;
}

/* Button styles for a modal's action row (the gallery page has no global button
   styles). BOTH action rows: the dialog's own footer and a drawer's
   (modal.js createDrawer). One definition, because a drawer's Cancel is the
   same button as the dialog's Cancel — it was an outlined one only because it
   had been declared somewhere else. Unclassed = the primary; `.ghost` = the
   secondary, the same class every other surface in the app uses for one. */
.modal-footer button,
.drawer-foot button {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  background: #111;
  color: #fff;
}
.modal-footer button.ghost,
.drawer-foot button.ghost { background: #f1f1f3; color: #111; }
.modal-footer button.ghost:hover,
.drawer-foot button.ghost:hover { background: #e6e6ea; }

/* toggle switch */
.switch {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d8d8de;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: left 0.15s;
}
.switch.on { background: #111; }
.switch.on::after { left: 16px; }
.switch.sm { width: 26px; height: 15px; }
.switch.sm::after { width: 11px; height: 11px; }
.switch.sm.on::after { left: 13px; }
/* Align the switch with the first text line, not the middle of the block,
   so rows whose hint wraps keep the toggle on row one. */
.switch-row { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; user-select: none; line-height: 1.4; }
.switch-row .switch { margin-top: -1px; }
.switch-row .switch.sm { margin-top: 2px; }

/* full-width segmented control — Mapping | Tagging pane switch in the board modal */
.pane-toggle {
  display: flex;
  gap: 3px;
  margin: 14px 0 16px;
  padding: 3px;
  background: #f1f1f3;
  border-radius: 9px;
}
.pane-toggle-btn {
  flex: 1;
  border: none;
  border-radius: 7px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #6b6b72;
  background: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.pane-toggle-btn:hover { color: #111; }
.pane-toggle-btn.active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ─── modal strip: a full-bleed collapsible band between a modal's header and
   its scrolling body. Generic chrome, not tied to any one modal — the board
   editor's AI-models fold is one user. Flat by design: the strip is chrome,
   and whatever it holds is hairline-separated, never boxes in boxes. Pair
   with .modal-body-wrap/.modal-body-scrim to dim the body while open. ─── */
.modal-strip {
  flex-shrink: 0;
  background: #fbfbfc;
  border-bottom: 1px solid #eee;
}
/* the two fold heads share everything but their padding */
.strip-head,
.disc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #111);
  cursor: pointer;
  text-align: left;
}
.strip-head { padding: 9px 20px; }
/* fold caret — shared by every collapsible head (strip, disclosure). Holds
   ICONS.chevron (a down caret, 1em, currentColor), so it sizes and colors
   with the text it accompanies; closed points right, open points down. */
.chev {
  flex: none;
  display: inline-flex;
  transform: rotate(-90deg);
  transition: transform 0.12s;
}
.modal-strip.open > .strip-head .chev,
.disclosure.open > .disc-head .chev { transform: rotate(0deg); }
/* the collapsed head's status text — a fold summarizes, it never hides state */
.fold-summary {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: #9a9aa6;
  text-align: right;
}
.strip-body {
  display: none;
  padding: 0 20px 12px;
  max-height: 380px;
  overflow-y: auto;
}
.modal-strip.open > .strip-body { display: block; }

/* ─── fold-out rows (.frow): a flat hairline-separated list — each row a
   summary line (name + description left, value + source right) over a
   fold-out editor. Generic; the strip's capability pickers are one user. ─── */
.frow { border-top: 1px solid #eee; }
.frow:first-child { border-top: none; }
.frow-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
}
/* inside a modal strip, the head's hover bleeds to the strip's full width */
.modal-strip .frow-head { margin: 0 -20px; padding: 10px 20px; }
.frow-head:hover { background: #f3f3f6; }
.frow-name { font-size: 13.5px; font-weight: 550; }
.frow-desc { font-size: 12px; color: #9a9aa6; margin-top: 1px; }
.frow-cur { margin-left: auto; text-align: right; flex: none; max-width: 55%; }
.frow-val { font-size: 12.5px; }
.frow-src { display: block; font-size: 11px; color: #9a9aa6; margin-top: 1px; }
.frow-edit { display: none; padding: 0 0 12px; gap: 8px; }
.frow.open .frow-edit { display: flex; }
.frow.flash { animation: frow-flash 1.2s ease-out; }
@keyframes frow-flash {
  0% { background: #edf2fe; }
  100% { background: transparent; }
}

/* the body wrapper + scrim while a strip is open (the host modal wraps its
   .modal-body so the scrim has a positioned box exactly the body's size) */
.modal-body-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.modal-body-wrap > .modal-body { flex: 1; }
.modal-body-scrim {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(17, 17, 17, 0.14);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.modal-strip.open ~ .modal-body-wrap .modal-body-scrim {
  opacity: 1;
  pointer-events: auto;
}

/* ─── provenance band — "Using <model> Change", centered on a soft ground ─── */
.prov {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #6b6b72;
  background: #f7f7fa;
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
}
.prov b { font-weight: 550; color: var(--text, #111); }
/* the band starts hidden until its label resolves; `hidden` alone loses to
   the display:flex above (same rule as every [hidden] override in styles.css) */
.prov[hidden] { display: none; }
.linkbtn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }

/* ─── disclosure: a boxed in-flow fold (the board editor's Advanced section is
   one user). Chevron rotation and .fold-summary come from the shared fold
   rules above. ─── */
.disclosure { border: 1px solid #eee; border-radius: 9px; }
.disc-head { padding: 10px 12px; }
.disc-body {
  display: none;
  padding: 4px 12px 12px;
  border-top: 1px solid #eee;
}
.disclosure.open .disc-body { display: block; }

@media (prefers-reduced-motion: reduce) {
  .chev,
  .modal-body-scrim {
    transition: none;
  }
  .frow.flash { animation: none; }
}

/* ─── facet editor (admin board modal + any future modal) ─── */
.fe-root { margin-bottom: 10px; }
.fe-facet { margin-bottom: 10px; }
.fe-head { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
input.fe-label { flex: none; width: 240px; padding: 5px 8px; font: inherit; font-weight: 500; border: 1px solid #d8d8de; border-radius: 6px; margin: 0; }
.fe-key-hint { font-size: 11px; color: #b0b0b8; font-family: "SF Mono", Consolas, monospace; white-space: nowrap; }
.fe-val-row input { flex: none; width: 240px; padding: 4px 8px; font: inherit; font-size: 13px; border: 1px solid #d8d8de; border-radius: 6px; margin: 0; }
.fe-values { padding-left: 22px; }
textarea.fe-desc { display: block; width: calc(100% - 22px); margin: 0 0 6px 22px; padding: 4px 8px; font: inherit; font-size: 12px; color: #4b4b52; border: 1px solid #e4e4ec; border-radius: 6px; resize: vertical; min-height: 0; }
textarea.fe-desc::placeholder { color: #b0b0b8; }
.fe-val-row { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.fe-single { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1; color: #6b6b72; cursor: pointer; white-space: nowrap; user-select: none; margin-left: auto; }
.fe-single input[type=checkbox] { flex: none; width: auto; min-width: 0; padding: 0; border: none; border-radius: 0; background: none; cursor: pointer; }
.fe-rm { display: inline-flex; align-items: center; justify-content: center; background: none; border: none; color: #bbb; cursor: pointer; padding: 2px 4px; font-size: 15px; line-height: 1; border-radius: 4px; }
.fe-rm:hover { color: #d33; background: #fdeaea; }
.fe-add-val { background: none; border: none; color: #2563eb; cursor: pointer; font-size: 12px; padding: 2px 0; margin-top: 2px; display: block; }
.fe-add-val:hover { text-decoration: underline; }
.fe-add-facet { display: block; width: 100%; margin-top: 4px; background: none; border: 1px dashed #ccc; border-radius: 6px; padding: 5px 14px; cursor: pointer; color: #6b6b72; font: inherit; font-size: 13px; }
.fe-add-facet:hover { border-color: #999; color: #111; }

/* ─── clipboard chips (the Tagging Guidance copy/paste row) ─── */
.clip-toolbar { display: flex; gap: 6px; }
.clip-btn { background: none; border: 1px solid #d8d8de; border-radius: 5px; color: #6b6b72; cursor: pointer; font: 12px/1 inherit; padding: 3px 9px; }
.clip-btn:hover { border-color: #999; color: #111; }

/* ─── entity mapping modal ───
   The field-ROW component family (.mm-row/.mm-key-locked/.mm-live-*/
   .mm-connector-badge/.mm-locked-badge/.mm-face-prefer/.mm-intro) died with
   the three-section pane — fields are .tile objects now (shared vocabulary,
   below), and cadence/config live in the drawer. What survives here is what
   the rebuilt pane still draws. */
.mm-empty {
  font-size: 13px;
  color: #8a8a92;
  margin: 0;
  padding: 8px 0;
}
/* The amber statement box is `.warn-box` now — shared vocabulary, with the
   drawer/tiles below (the ingest modal states its missing-root case in it). */
/* template picker row (very top of the mapping pane body, above the intro) */
.mm-template-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}
/* .mm-template-label's type is up with .modal-section-title — same label. */
/* The picker itself is .dd-trigger + .dd-caret (dropdown.css) — it shows the
   template the board is on rather than an action, so it reads as a select. */

/* ── connector browse-and-add modal (connector-browse.js) ─────────────────── */
#connector-browse .modal-dialog { width: min(900px, 94vw); }
#connector-browse .modal-body { min-height: 0; } /* let .cb-scroll own the scroll */
.cb-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cb-search { min-width: 180px; }
.cb-search {
  flex: 1;
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid #d8d8e0;
  border-radius: 7px;
}
.cb-sort {
  font: inherit;
  font-size: 13px;
  padding: 7px 8px;
  border: 1px solid #d8d8e0;
  border-radius: 7px;
  background: #fff;
}
.cb-order {
  font: inherit;
  font-size: 12px;
  padding: 7px 10px;
  border: 1px solid #d8d8e0;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.cb-order:hover { background: #f4f4f7; }

.cb-scroll { flex: 1; overflow-y: auto; min-height: 200px; }
.cb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cb-table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #8a8a96;
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
}
.cb-table td { padding: 7px 8px; border-bottom: 1px solid #f2f2f5; vertical-align: middle; }
.cb-table tbody tr:hover { background: #fafafc; }
/* addable rows act as one big checkbox — click anywhere but the Add button */
.cb-table tbody tr.cb-selectable { cursor: pointer; }
/* Scoped under .cb-table so alignment also lands on header cells — a bare
   class loses to the `.cb-table thead th` text-align above. */
.cb-table .cb-end { text-align: right; }
.cb-table .cb-col-sel { width: 28px; text-align: center; }
.cb-table .cb-col-add { width: 84px; text-align: right; }

.cb-primary-name { font-weight: 600; color: #1a1a24; }
.cb-primary-sym { margin-left: 6px; font-size: 11px; color: #9a9aa6; }
.cb-up { color: #16a34a; }
.cb-down { color: #dc2626; }

.cb-add {
  font: inherit;
  font-size: 12px;
  padding: 4px 12px;
  border: 1px solid #d3d3dc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.cb-add:hover { background: #111; color: #fff; border-color: #111; }
.cb-add:disabled { opacity: .55; cursor: default; }
.cb-on-board { font-size: 11px; color: #9a9aa6; }
/* Provider credit (some data licenses require it) — left side of the footer,
   pushing the bulk-add action right. */
.cb-attribution { margin-right: auto; font-size: 11px; color: #9a9aa6; text-decoration: none; }
.cb-attribution:hover { text-decoration: underline; color: #6b6b72; }

.cb-note { padding: 12px 8px; color: #8a8a96; font-size: 13px; text-align: center; }
.cb-more {
  display: block;
  width: 100%;
  margin-top: 4px;
  font: inherit;
  font-size: 13px;
  padding: 9px;
  border: 1px solid #e2e2e8;
  border-radius: 7px;
  background: #f7f7f9;
  cursor: pointer;
}
.cb-more:hover { background: #efeff3; }
.cb-more:disabled { opacity: .6; cursor: default; }

.modal-footer button:disabled,
.drawer-foot button:disabled { opacity: .5; cursor: default; }

/* ── automatic ingestion modal (ingest-modal.js) ──────────────────────────── */
#ingest-modal .modal-dialog { width: min(640px, 94vw); }
/* results view: wide browse-style list; the inner .cb-scroll owns the scroll */
#ingest-modal .modal-dialog.results { width: min(900px, 94vw); }
#ingest-modal .modal-dialog.results .modal-body { overflow: hidden; }
/* Source is the first thing in the modal now, so .modal-section's divider and
   its 32px of lead-in would draw against nothing — an empty band under the
   header. The rule earns its keep between sections, not above the first one. */
.im-settings > .modal-section:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.im-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.im-row > label { font-size: 12px; color: #6b6b72; margin: 0; }
.im-row select { max-width: 260px; }
.im-filters { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.im-filter-row { display: flex; align-items: center; gap: 6px; }
.im-filter-row select { font-size: 13px; padding: 6px 26px 6px 8px; }
.im-filter-val { flex: 1; min-width: 0; }
.im-filter-val input { width: 100%; font-size: 13px; padding: 6px 8px; }
.im-hint { font-size: 12px; color: #9aa0aa; margin: 8px 0 0; line-height: 1.4; }
/* shared modal-body button component (the gallery page has no global button
   styles, so body buttons would otherwise render native). im-preview-btn layers
   its loading spinner on top of this base. */
.im-btn, .im-preview-btn {
  position: relative;
  font: inherit;
  font-size: 12px;
  padding: 6px 14px;
  border: 1px solid #d3d3dc;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.im-btn:hover, .im-preview-btn:hover { background: #111; color: #fff; border-color: #111; }
.im-btn:disabled, .im-preview-btn:disabled { opacity: .55; cursor: default; }
/* keep the button neutral while loading so the dark spinner stays visible */
.im-preview-btn.loading:hover { background: #fff; color: #111; border-color: #d3d3dc; }
/* label reserves the width; spinner sits centered over it (spin keyframe is global) */
.im-preview-btn.loading .im-btn-label { visibility: hidden; }
.im-btn-spin { display: none; }
.im-preview-btn.loading .im-btn-spin {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
/* the count doubles as the door into the results view */
.im-preview-count {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #111;
}
.im-preview-count:hover { text-decoration: underline; }
/* Modal-body status line — shared vocabulary like .im-btn, not ingest-only:
   one 12px line whose tone IS the verdict. Base = neutral accounting ("Last
   run 2m ago — added 3"). Tones borrow the app's existing families rather
   than minting colors: .error the notice red, .ok the bare-text green of
   .cb-up, .warn the text tone of .warn-box. Spacing: base sits 12px under a
   section; .tight hugs the control it judges (the source-health line);
   .flush zeroes the margin for flex-gap parents (the browse modal's relink
   notice). */
.im-status { font-size: 12px; color: #6b6b72; margin: 12px 0 0; line-height: 1.4; }
.im-status.error { color: #b4232a; }
.im-status.warn { color: #7a5b12; }
.im-status.ok { color: #16a34a; }
.im-status.tight { margin: 4px 0 0; }
.im-status.flush { margin: 0; }

/* ── alert editor + history (alerts-modal.js) ── */
#alert-modal .modal-dialog { max-width: 480px; }
.al-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 7px 9px;
  border: 1px solid #d6d9de;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}
.al-input:focus { outline: none; border-color: #9aa0aa; }
.al-cond { display: flex; flex-direction: column; gap: 8px; }
.al-cond-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.al-cond-key { font-size: 12px; color: #6b6b72; min-width: 64px; }
.al-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f0f1f3;
  border: 1px solid #e0e2e6;
  border-radius: 12px;
  padding: 2px 5px 2px 9px;
  font-size: 12.5px;
}
.al-chip button {
  border: none;
  background: none;
  cursor: pointer;
  color: #8a8a92;
  padding: 0 3px;
  font-size: 14px;
  line-height: 1;
}
.al-chip button:hover { color: #b4232a; }
/* history rows ride the .job-row skeleton; unseen ones read heavier */
.al-firing { cursor: pointer; }
.al-firing:hover { background: #f6f7f8; }
.al-firing.al-new .job-label { font-weight: 600; }

/* ─── facet diagnosis (planning/facet-diagnosis-plan.md §6) ───
   One block shape, used in two places: inline under the description being
   edited (facet editor) and inside the Diagnostics modal. Indented to the same
   22px gutter as .fe-desc so it reads as belonging to its facet.
   Everything the block LOOKS like — the rounded shell, the padding, the three
   tones — comes from .warn-box / .mute-box / .good-box in styles.css, the same
   shells the lightbox panel's notices wear. The state classes below are hooks
   for what is specific to a state, not a second palette. */
.fd-block { margin: 0 0 8px 22px; }

/* ── the headline, in ONE place ──
   The modal's collapsible head (.fd-head) and the facet editor's one-line
   summary (.fd-sum) are the same sentence about the same finding, so they are
   the same type: serif, because everything inside a notice is prose the model
   wrote about this board rather than a label the UI chose. Only LAYOUT differs
   between the two densities, and that is what the rules below vary.
   Nothing further down may re-declare font — see the note on .fd-head.fd-toggle. */
.fd-head, .fd-sum { font-family: var(--serif); font-size: 13px; font-weight: 500; line-height: 1.45; color: inherit; }

/* ── compact: the same block inline in the facet editor ──
   KEEPS the panel — the tint is what makes a finding findable in a stack of
   otherwise identical facet rows — but collapses to ONE line, because expanded
   it runs to ~15 and pushes the facet's own values off screen. The caret is the
   leading mark: it says "there is more here" where a dot only said "look". */
.fd-block.fd-compact { margin: -2px 0 8px 22px; padding: 5px 9px; }
.fd-sum { display: flex; align-items: baseline; gap: 6px; }
/* The toolbar button's own glyph, so the line reads as belonging to that
   feature rather than as a generic form warning. Nudged down a hair: the row is
   baseline-aligned for the text, which sits an icon slightly high. */
.fd-icon { flex: none; display: inline-flex; position: relative; top: 2px; }
.fd-icon svg { width: 13px; height: 13px; }

/* ── collapsible: the modal's per-facet sections ──
   Folded by default. The survey is the list of facets and their numbers; the
   essays are what you open one of. */
/* .fd-head.fd-toggle, not .fd-toggle: the element carries both classes and
   `.fd-head { display: block }` is declared further down, so at equal
   specificity it won and quietly un-flexed this — which cost the gap AND the
   caret's rotation, since transforms do not apply to non-replaced inline
   elements. Two symptoms, one missing tenth of specificity. */
/* Deliberately declares NO font, though it is a <button> and the UA gives
   buttons one. Author rules beat the UA sheet at any specificity, so the shared
   `.fd-head, .fd-sum` rule above dresses it — where `font: inherit` here would
   have pulled the sans body font back in at a specificity that rule cannot
   beat, and the two densities would have drifted apart again. */
.fd-head.fd-toggle { display: flex; align-items: baseline; gap: 8px; width: 100%; margin: 0; padding: 0; background: none; border: none; text-align: left; cursor: pointer; }
/* The glyph points right already, so collapsed is UNROTATED — it points at what
   it will open — and expanding turns it down. */
/* inline-block is load-bearing, not tidiness: a bare inline span ignores
   `transform` outright, so the caret would sit there unrotated with nothing in
   the console to say why. */
/* Sans, explicitly: the head around it is serif now, and the serif faces draw
   U+203A about half the size Inter does at the same font-size — the caret went
   tiny with nothing in the rules to say why. It is a UI mark, not prose, so it
   belongs to the UI's face regardless of what the sentence beside it is set in. */
.fd-caret { flex: none; display: inline-block; font-family: var(--sans); font-size: 15px; line-height: 1; opacity: .9; transition: transform .15s; }
.fd-head.fd-toggle[aria-expanded="true"] .fd-caret { transform: rotate(90deg); }
.fd-detail { padding: 6px 0 1px; }
/* Layout only — the type is set once, at the top of this section. Flex rather
   than block so the age can sit at the far end of the line; the toggle variant
   above already flexes for the caret, and this keeps the plain head matching. */
.fd-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 3px; }
/* The age, at the end of whichever headline row it lands on — the collapsible
   modal head, the compact editor summary, or the plain one. Sans and quiet: it
   is a UI stamp, not part of the sentence the model wrote, and it must not
   compete with a line it is only qualifying. `margin-left: auto` is what pushes
   it right, so every head it can appear in has to be a flex row. */
.fd-when {
  flex: none;
  margin-left: auto;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  opacity: .6;
  white-space: nowrap;
}
/* The explanation under it: the same serif, a step down, because it is the
   supporting paragraph rather than the finding. */
.fd-why { font-family: var(--serif); font-size: 12.5px; color: inherit; opacity: .9; }
/* Stacked, not side by side: the box is the content and the action belongs
   under it, the way a form field's button does. Beside it, the box was squeezed
   into a column while the link floated in the whitespace next to it. */
.fd-suggestion { margin-top: 9px; }
/* The label and the copy share a line, because the control belongs to the box
   below them and a row of its own would read as a step after the proposal
   rather than a handle on it. Baseline-aligned, not centred: the two are set at
   different sizes and centring floats the smaller one off the label's line. */
.fd-rewrite-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
/* A heading, not a frame. The proposed wording used to sit in a panel of its
   own inside the notice, which read as two nested boxes for what is one
   thought; the label alone does the separating, so it takes the weight the
   frame used to carry and the notice's own colour. */
.fd-rewrite-cap { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
/* Unclamped. It was capped and scrollable back when it rendered inside the
   facet editor, where its natural height dwarfed the two-row textarea it was
   proposing to replace. It only lives in the modal now, which has the room —
   and a nested scroller inside a scrolling dialog is a worse way to read a
   paragraph than simply letting it be as long as it is.
   Sans and upright, against the serif above it: this is not more prose about
   the board, it is the literal text that would go in the description field —
   set the way that field sets it. */
.fd-rewrite { font-family: var(--sans); }
/* The prompt-shape caveat inside an `improved` block. NOT .fd-note: that is the
   state class for the whole `genuinely-ambiguous-items` block two rules up, and
   sharing the name made each rule apply where it was not meant to — a grey
   panel inside the green one, and the ambiguous block silently rendered a point
   smaller than every other state. One class, one meaning. */
.fd-caveat { font-size: 11px; opacity: .85; margin-top: 3px; }
/* Sans and nowrap, against the serif label beside it: it is a control, not part
   of the sentence, and it must not be what wraps when the label runs long. */
.fd-copy { flex: none; background: none; border: none; color: #2563eb; cursor: pointer; font-family: var(--sans); font-size: 11.5px; padding: 0; white-space: nowrap; }
.fd-copy:hover { text-decoration: underline; }

/* The modal's own survey chrome. Read-only by construction — the two controls
   in here copy the proposed wording and hand the user off to the editor.
   Neither writes: the editor is the only writer into boards.facets. */
.fd-intro { font-size: 12px; color: #6b6b72; line-height: 1.5; margin: 0 0 14px; }
/* Qualifies every figure below it, so it sits above the list rather than in it.
   A .mute-box, like every other "nothing to report yet" panel in the app. */
.fd-busy { line-height: 1.5; margin: 0 0 14px; }
/* .fd-card is a .panel-cell — the lightbox panel's facet card. Only the two
   things the modal adds live here. */
/* No bottom margin: the gap belongs to the block below, because most facets
   have no block at all and a margin here left their card padded 9px above the
   name and 15px below it — the row sat visibly high in its own box. */
.fd-card-head { display: flex; gap: 8px; align-items: center; }
.fd-stat { font-size: 11px; color: #9aa0aa; margin-left: auto; white-space: nowrap; }
/* The consistency figure: a .panel-chip like a facet value, because that is
   what it is — one fact about this facet — carrying the glyph of the button
   this modal opened from so the number is attributed. */
.fd-score { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: #55555e; }
.fd-score .fd-icon { top: 0; }
.fd-score .fd-icon svg { width: 12px; height: 12px; }
/* Flush inside the card, and carrying the gap between itself and the name. */
.fd-card .fd-block { margin: 6px 0 0; }
/* One per modal, above the list — not one per finding. */
.fd-edit { display: block; background: none; border: none; color: #2563eb; cursor: pointer; font: inherit; font-size: 12px; padding: 0; margin: -6px 0 14px; }
.fd-edit:hover { text-decoration: underline; }

/* ─── Field sources: AI marker tokens ─────────────────────────────────────────
   Violet marks a value a MODEL produces (extract, detect — the sources whose
   field-sources.js row carries a capability); grey stays deterministic. One
   pair of tokens so a future inferred source inherits the treatment. */
:root {
  --ai-ink: #5b4bd6;
  --ai-bg: #f4f2fd;
  --ai-bg-line: #e5e1f8;
  --ai-bg-hover: #eeebfb;
}

/* ─── Bottom drawer (modal.js createDrawer) ──────────────────────────────────
   A full-width sheet inside a modal body: scrim over the pane, sheet rising
   from the bottom, head / scrollable body / footer with Cancel + one primary. */
/* Light: this scrim is the third dimming layer on the same pixels — the page
   overlay, then the dialog, then this — so it only has to say "the sheet has
   the floor", not black the pane out. */
.drawer-scrim {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(21, 23, 28, 0.18);
  opacity: 0; pointer-events: none; transition: opacity 0.16s ease;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
/* The entrance is a fixed 12px rise + a fade — the same idiom and the same
   distance .modal-dialog uses above, so every surface in a modal arrives the
   same way. It used to be translateY(102%), which travelled the sheet's OWN
   height over a fixed 200ms: a two-field drawer crept and a tall one flew.
   That transform was also what hid the sheet when closed, so the hiding is
   opacity + visibility's job now. `visibility` is load-bearing, not belt-and-
   braces: an opacity-0 sheet still eats clicks and still holds its buttons in
   the tab order (which the old off-screen sheet did too — a Tab from the pane
   could land inside a closed drawer). It flips instantly on open and only
   after the fade on close, hence the 0s transition with a delay. */
.drawer {
  position: absolute; z-index: 50; left: 0; right: 0; bottom: 0;
  background: #fff; border-top: 1px solid #e4e6ea;
  border-radius: 14px 14px 0 0; box-shadow: 0 -16px 44px rgba(0, 0, 0, 0.18);
  max-height: 88%; display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition:
    opacity 160ms ease,
    transform 180ms cubic-bezier(.2, .8, .2, 1),
    visibility 0s linear 180ms;
}
.drawer.open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition:
    opacity 160ms ease,
    transform 180ms cubic-bezier(.2, .8, .2, 1),
    visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  /* `.drawer.open` has to be named: it now carries a transition of its own, and
     a bare `.drawer` here would lose the specificity contest to it. */
  .drawer, .drawer.open, .drawer-scrim { transition: none; }
  .drawer { transform: none; }
}
.drawer-head { display: flex; align-items: center; gap: 9px; padding: 13px 18px 9px; flex: none; }
.drawer-head svg { width: 17px; height: 17px; }
/* .drawer-title / .drawer-src are the HEAD'S CONTENT, which createDrawer never
   builds — the caller passes nodes (drawerHeadParts). They are the same two
   lines a tile carries (a name, then what produces it), so their type is
   declared once with .tile-name / .tile-sum below. Only the layout each needs
   differs: a tile stacks and truncates, a head sits on one line with the
   source pushed to the far end. */
.drawer-src { margin-left: auto; }
.drawer-body { padding: 4px 18px 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 15px; }
/* The buttons themselves are the shared modal-action pair, up with
   .modal-footer button — nothing about them is the drawer's to restyle. */
.drawer-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid #edeef1; flex: none; }

/* Size variant: a TALL sheet is a fixed fraction of its host dialog — for a
   task whose content resizes as it runs (a directory tree re-renders per
   level), where a content-hugging sheet would bounce on every click. The
   body stops scrolling and hands that job to its one scroll region, and
   .cb-scroll's global 200px floor drops so it can fit — inside drawer bodies
   only; connector-browse and the ingest results view keep theirs. */
.drawer.tall { height: 80%; }
.drawer.tall .drawer-body { overflow: hidden; }
.drawer-body .cb-scroll { min-height: 0; }

/* Drawer form groups — label / control / quiet hint. */
.dw-group { display: flex; flex-direction: column; gap: 6px; }
/* .dw-label's type is up with .modal-section-title — same label, dimmer ink. */
.dw-hint { font-size: 12px; color: #adb1b8; }
.dw-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── Shared vocabulary: glyph atom, object tiles, warn box ──────────────────
   Promoted out of the mapping pane when the ingest modal adopted them; built
   by glyphEl (utils.js) and tileRow (modal.js). Mapping's def rows and source
   cards keep their mm- prefix — single-consumer, still the pane's own. */
.glyph { flex: none; display: inline-flex; color: #868c96; }
.glyph.ai { color: var(--ai-ink); }

/* Object tiles: a bounded object per row at one height; violet tint = a model
   produces it. Nothing on a tile is editable — opening it is the edit. */
.tiles { display: flex; flex-direction: column; gap: 8px; }
.tile {
  display: flex; align-items: center;
  background: #f7f7fa; border: 1px solid #e7e9ed; border-radius: 10px;
  min-height: 62px; overflow: hidden;
}
.tile:hover { background: #eff1f4; }
.tile.ai { background: var(--ai-bg); border-color: var(--ai-bg-line); }
.tile.ai:hover { background: var(--ai-bg-hover); }
.tile-main {
  display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; text-align: left;
  background: none; border: none; font: inherit; cursor: pointer;
  padding: 11px 4px 11px 12px; align-self: stretch;
}
.tile-main .glyph svg { width: 18px; height: 18px; }
.tile-body { min-width: 0; flex: 1; }
/* A tile's title, and the quiet line under it — shared with the drawer head,
   which shows the same two facts about the same object. */
.tile-name,
.drawer-title { font-family: monospace; font-size: 13px; font-weight: 500; color: #15171c; }
.tile-sum,
.drawer-src { font-size: 12.5px; color: #8a8a92; }
.tile-name,
.tile-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sum { margin-top: 2px; }
.tile-rm {
  background: none; border: none; color: #adb1b8; font-size: 16px; line-height: 1;
  cursor: pointer; padding: 0 12px; align-self: stretch; flex: none;
}
.tile-rm:hover { color: #d33; }

/* Amber statement box: a configured thing that can't currently render — a
   face the provider can't draw or a whole domain outage (mapping), the
   server's missing ingest root (ingest). The margin-top exists to lift it
   off a row it sits inside; `.flush` drops it where the container's own
   spacing already separates it. */
.warn-box {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #92650a;
  background: #fff7e6;
  border: 1px solid #ffe1a3;
  border-radius: 6px;
  padding: 6px 9px;
}
.warn-box.flush { margin: 0; }

/* Choice chips (Format, face prefer): app-black selection, never violet. */
.mm-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mm-chips button {
  background: #fff; border: 1px solid #d9dce2; color: #545962;
  font-family: monospace; font-size: 12.5px; padding: 5px 12px;
  border-radius: 6px; cursor: pointer;
}
.mm-chips button:hover { border-color: #111; color: #111; }
.mm-chips button[aria-pressed="true"] { background: #111; border-color: #111; color: #fff; }

/* ─── The pane: identity + face definition rows ────────────────────────────── */
.mm-def { padding: 4px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.mm-def-row {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  background: none; border: none; font: inherit; padding: 8px 6px; border-radius: 9px; cursor: pointer;
}
.mm-def-row:hover { background: #f5f6f8; }
.mm-def-row.locked { cursor: default; }
.mm-def-row.locked:hover { background: transparent; }
.mm-def-row .glyph { margin-top: 1px; }
.mm-def-row .glyph svg { width: 19px; height: 19px; }
.mm-def-body { min-width: 0; flex: 1; }
/* Same ink as a tile's name — identity and face are slots on the same footing
   as the fields below them, and a dimmed label made them read as captions. */
.mm-def-label { font-family: monospace; font-size: 11px; font-weight: 500; color: #15171c; }
.mm-def-val { font-size: 15px; line-height: 1.35; color: #15171c; margin-top: 2px; }
.mm-def-val.none { color: #adb1b8; }
.mm-def-more { font-size: 12.5px; color: #8a8a92; margin-top: 3px; }

/* ─── Slot source picker: horizontal cards inside the drawer ───────────────── */
.mm-srcrow { display: flex; gap: 7px; }
.mm-srcopt {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  text-align: left; background: #f7f7fa; border: 1px solid #e7e9ed;
  border-radius: 9px; padding: 11px 12px; font: inherit; cursor: pointer;
}
.mm-srcopt:hover:not(:disabled) { background: #eff1f4; }
.mm-srcopt.ai { background: var(--ai-bg); border-color: var(--ai-bg-line); }
.mm-srcopt.ai:hover:not(:disabled) { background: var(--ai-bg-hover); }
.mm-srcopt[aria-pressed="true"] { border-color: #111; box-shadow: 0 0 0 1px #111 inset; }
.mm-srcopt:disabled { opacity: 0.5; cursor: not-allowed; }
.mm-srcopt .glyph svg { width: 17px; height: 17px; }
.mm-srcopt .lab { font-size: 12.5px; font-weight: 500; color: #15171c; }
.mm-srcopt .note { font-size: 11px; color: #adb1b8; }
