/* views.css — view-specific sections: users/login/sources/awin/products/settings/workbench/run/admins/rules/import. */
/* ---------- users domain (lean MVP, 2026-08-15) ---------- */
.status-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.status-badge.warn { background: var(--amber-bg); color: var(--warn-ink); }
.status-badge.ok { background: rgba(91, 122, 78, 0.14); color: var(--ok-ink); }

/* Status dot — replaces the colour-circle glyphs used in the product drawer,
   the import run chip, and any future status badge. currentColor keeps it
   theme-aware; the explicit color modifier keeps the meaning independent of
   surrounding text colour. */
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 0; margin-right: 4px; flex-shrink: 0; }
.status-dot.ok   { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.err  { background: var(--err); }
.status-dot.none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-tertiary); }
.u-id { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-tertiary); word-break: break-all; }
.u-stat { font-size: 15px; font-weight: 600; font-family: var(--font-display); }
.u-stat-label { font-size: 11px; color: var(--ink-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.chat-msg { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--bg-inset); border: 1px solid var(--border); }
.chat-msg .msg-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.chat-msg.user .msg-meta { justify-content: flex-end; }
.msg-role { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 12px; }
.msg-role.user { background: var(--amber-bg); color: var(--warn-ink); }
.msg-role.assistant { background: rgba(91, 122, 78, 0.14); color: var(--ok-ink); }
.msg-when { font-size: 11px; color: var(--ink-tertiary); }
.chat-msg .msg-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; }
.msg-blocks { margin-top: 6px; font-size: 12px; color: var(--ink-secondary); }
.chat-msg .msg-img { margin-top: 6px; font-size: 12px; color: var(--accent); }

/* ---------- login ---------- */
#view-login { max-width: 420px; margin: 12vh auto; }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 36px; }
.login-card h1 { font-size: 28px; margin-bottom: 6px; }
.login-card p.sub { color: var(--ink-secondary); font-size: 13px; margin-bottom: 24px; }
.login-card input { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 14px; margin-bottom: 12px; font-family: var(--font-body); }
.login-card .login-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-secondary); margin-bottom: 5px; }
.login-card input:focus { border-color: var(--accent); }
.login-card button.primary { width: 100%; padding: 12px; background: var(--accent-deep); color: var(--bg); border: none; border-radius: 8px; font-size: 14px; font-weight: 600; }
.login-card .error { color: var(--err-ink); font-size: 12.5px; margin-top: 10px; min-height: 18px; }

/* ---------- sources ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 24px; }
.grid-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.source-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border-color .15s; }
.source-card:hover { border-color: var(--accent); }
.source-card h3 { font-size: 17px; margin-bottom: 4px; }
.source-card .key { font-family: var(--font-mono); font-size: 12px; color: var(--ink-tertiary); }
.source-card .meta { margin-top: 10px; font-size: 12px; color: var(--ink-secondary); display: flex; gap: 14px; flex-wrap: wrap; }
.tier-badge { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.tier-badge.fit { background: var(--accent-deep); color: var(--bg); }
.tier-badge.browse { background: var(--bg-inset); color: var(--ink-secondary); border: 1px solid var(--border); }
.source-card.archived { opacity: .62; }
.source-card.archived:hover { border-color: var(--border-strong); }
.source-card .card-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.arch-badge { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--amber-bg); color: var(--warn-ink); }

/* Run Status Chip */
.run-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.run-chip.succeeded { background: var(--chip-ok-bg); color: var(--ok-ink); }
.run-chip.failed { background: var(--chip-err-bg); color: var(--err-ink); }
.run-chip.running { background: var(--chip-run-bg); color: var(--chip-run-ink); }
.run-chip.queued { background: var(--amber-bg); color: var(--warn-ink); }
.run-chip.none { background: var(--bg-paper-subtle); color: var(--c-ink-subtle); cursor: default; }

/* Action Popover Menu */
.source-menu-wrapper {
  position: relative;
  display: inline-block;
}
.source-menu-popover {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(35, 42, 38, 0.16);
  border-radius: 6px;
  padding: 4px 0;
  min-width: 140px;
  display: none;
}
.source-menu-popover.open {
  display: block;
}
.source-menu-popover button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink-primary);
  font-family: var(--font-body);
}
.source-menu-popover button:hover {
  background: var(--bg-inset);
}
.source-menu-popover button.danger {
  color: var(--err-ink);
}

/* ---------- AWIN block (Sources page) ---------- */
#awin-block { margin: 6px 0 30px; }
#awin-block > h3 { font-family: var(--font-body); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-tertiary); margin-bottom: 8px; }
.muted { color: var(--ink-secondary); font-size: 12.5px; }
.awin-adv { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.awin-adv-head { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.awin-adv-head::-webkit-details-marker { display: none; }
.awin-adv-head strong { font-size: 15px; }
.awin-adv-head .key { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-tertiary); }
.awin-feed-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.awin-feed-row .grow { flex: 1; min-width: 180px; }
.awin-feed-row .key { font-family: var(--font-mono); font-size: 11px; color: var(--ink-tertiary); }
.awin-feed-actions { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.awin-schedule { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-secondary); flex-wrap: wrap; }
.awin-sched-toggle { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.awin-schedule select { height: var(--control-h-sm, 24px); min-height: 24px; padding: 2px 24px 2px 8px !important; font-size: 12px; }
.awin-schedule input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; }
.awin-schedule input[type=number] { width: 62px; height: var(--control-h-sm, 24px); min-height: 24px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font-family: var(--font-mono); font-size: 12px; }
/* Connected sources — two-line list rows (spec 2026-08-27) */
.src-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.src-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  padding: 12px 16px;
  transition: background 0.1s ease;
}
.src-row:hover, .src-row:focus-within { background: var(--bg-inset); }
.src-row-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.src-id { flex: 1 1 240px; min-width: 0; font-size: 13px; }
.src-run { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.src-sched { flex: none; }
.src-actions { flex: none; margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.src-meta {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 4px 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-secondary);
}
.awin-src-card .meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-secondary); }
.awin-src-card .key { font-family: var(--font-mono); font-size: 12px; color: var(--ink-tertiary); white-space: nowrap; }
.awin-src-card.is-draft { opacity: .75; }
/* AWIN onboarding wizard (modal) */
.awin-wizard-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.awin-wizard-cols h4 { font-size: 12px; font-weight: 600; color: var(--ink-secondary); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 6px; }
.awin-wizard-profile { margin: 0; }
.awin-wizard-profile dt { font-size: 11px; font-weight: 600; color: var(--ink-secondary); text-transform: uppercase; letter-spacing: .04em; margin-top: 10px; }
.awin-wizard-profile dd { font-family: var(--font-mono); font-size: 12px; color: var(--ink-primary); margin: 2px 0 0; }
.awin-cat-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.awin-cat-tabs button { border: 1px solid var(--border); background: var(--bg-card); border-radius: 16px; padding: 3px 12px; font-size: 12px; color: var(--ink-secondary); }
.awin-cat-tabs button.active { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }
.awin-cat-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--bg-card); }
.modal .awin-cat-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 0; margin: 0; }
.modal .awin-cat-item input[type=checkbox] { width: 14px; height: 14px; padding: 0; }
.awin-cat-item .n { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-tertiary); }
.awin-cat-item .map-preview { color: var(--ink-tertiary); font-size: 11px; font-family: var(--font-mono); }
/* Pull-health dots (recent run status on connected source cards) */
.awin-pull-health { display: inline-flex; align-items: center; gap: 4px; }
.pull-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-tertiary); }
.pull-dot.succeeded { background: var(--ok-ink); }
.pull-dot.failed { background: var(--err-ink); }
.pull-dot.cancelled, .pull-dot.interrupted { background: var(--ink-tertiary); }
.pull-fail-warn { color: var(--warn-ink); font-weight: 600; font-family: var(--font-body); }
.awin-never-pulled { color: var(--ink-tertiary); font-style: italic; }
/* Intro-rate collapsible detail on connected source cards */
.awin-stats { cursor: pointer; }
.awin-stats summary { list-style: none; }
.awin-stats summary::-webkit-details-marker { display: none; }
.awin-stats summary:hover { color: var(--ink-primary); }
.awin-stats-detail { display: block; font-size: 10.5px; color: var(--ink-tertiary); font-family: var(--font-body); }
/* Key-validation health line at the top of Connected sources */
.awin-key-health { display: block; margin: 0 0 8px; font-size: 12px; color: var(--ink-secondary); }
/* Wizard: unselected-leaf preview */
.awin-unselected { margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 6px; font-size: 12.5px; }
.awin-unselected summary { cursor: pointer; list-style: none; color: var(--ink-secondary); font-weight: 600; }
.awin-unselected summary::-webkit-details-marker { display: none; }
.awin-unselected summary:hover { color: var(--ink-primary); }
.awin-unselected-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.awin-unselected-item .leaf { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Category recommendation (2026-08-23): Recommended badge, mapped-category
   hint, non-recommended de-emphasis, skeleton shimmer, one-click select. */
.awin-cat-not-rec .awin-cat-name { color: var(--ink-tertiary); }
.awin-rec-badge { flex-shrink: 0; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); border-radius: 999px; padding: 1px 7px; }
.awin-mapped { flex-shrink: 1; font-size: 11px; color: var(--ink-tertiary); font-family: var(--font-mono); max-width: 35%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.awin-cat-name { flex: 1; min-width: 0; }
.awin-sel-rec-btn { margin-bottom: 8px; }
/* Legacy whitelist rules (2026-08-24): removable chips for stored rules on
   columns the wizard no longer edits — visible so an uncheck actually
   delists (ghost-rules fix). */
.awin-legacy { margin-top: 8px; border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; }
.awin-legacy-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--ink-secondary); }
.awin-legacy-note { font-size: 11.5px; margin: 4px 0 6px; }
.awin-legacy-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.awin-legacy-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 6px 2px 10px; background: var(--bg-card); }
.awin-legacy-chip .col { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-tertiary); }
.awin-legacy-del { border: none; background: none; cursor: pointer; color: var(--ink-tertiary); font-size: 11px; padding: 0 2px; }
.awin-legacy-del:hover { color: var(--err-ink); }
.awin-wizard-stage { font-size: 12px; color: var(--ink-secondary); font-style: italic; margin-bottom: 8px; }
.awin-skel { border-radius: 6px; background: linear-gradient(90deg, var(--bg-card) 25%, var(--border) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: awin-shimmer 1.4s infinite; }
@keyframes awin-shimmer { to { background-position: -200% 0; } }
.awin-unselected-item .n { font-family: var(--font-mono); font-size: 11px; color: var(--ink-tertiary); }
.awin-wizard-estimate { margin-top: 12px; }

/* ---------- products (catalogue management) ---------- */
.prod-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.prod-tabs button { border: 1px solid var(--border); background: var(--bg-card); border-radius: 20px; padding: 6px 16px; font-size: 13px; font-weight: 500; color: var(--ink-secondary); }
.prod-tabs button.active { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }
.prod-tabs button .cnt { font-family: var(--font-mono); font-size: 11px; opacity: .75; margin-left: 4px; }
.prod-filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.prod-filters select, .prod-filters input { height: var(--control-h); padding: 0 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); font-size: 13px; font-family: var(--font-body); }
.prod-filters input { flex: 1; min-width: 180px; }
/* Data-table row contract (Task 15): td vertical padding derives from
   --row-h (34px) minus the 1.45em line box, so every row lands at exactly
   34px regardless of the table's font-size. */
table.products { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.products th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-tertiary); }
table.products th .th-sort { background: none; border: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
table.products th .th-sort:hover { color: var(--ink-primary); }
table.products th .th-sort.active { color: var(--ink-primary); font-weight: 800; }
table.products th .sort-ind { font-size: 9px; }
table.products td { padding: calc((var(--row-h) - 1.45em) / 2) 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.products tr:last-child td { border-bottom: none; }
.pthumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-inset); display: block; }
.pname { font-weight: 600; }
.psub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-tertiary); }
.vec-badge { font-family: var(--font-mono); font-size: 10.5px; padding: 2px 7px; border-radius: 10px; margin-right: 4px; white-space: nowrap; }
.vec-badge.yes { background: var(--chip-ok-bg); color: var(--ok-ink); }
.vec-badge.no { background: var(--bg-inset); color: var(--ink-tertiary); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.prod-pager { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 12.5px; color: var(--ink-secondary); }
.prod-pager .spacer { flex: 1; }

/* Source Filter Chips */
.prod-source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 10px;
}
.prod-source-chips .chip {
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  background: var(--bg-paper-subtle);
  color: var(--c-ink-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.prod-source-chips .chip:hover {
  border-color: var(--c-ink-subtle);
  color: var(--c-ink);
}
.prod-source-chips .chip.active {
  background: var(--c-ink);
  color: var(--bg-paper);
  border-color: var(--c-ink);
  font-weight: 500;
}

/* Product Quality Filters Bar */
.prod-quality-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.prod-quality-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.prod-quality-selects {
  display: flex;
  align-items: center;
  gap: 8px;
}
.prod-quality-selects select {
  padding: 5px 24px 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

/* Sticky Toolbar & Table Header */
.prod-toolbar {
  position: sticky;
  /* Pinned flush under the 44px topbar: .view's padding-top (20px) shifts
     the sticky constraint box, so the offset must cancel it — a stale
     top:44px (pre-split layout) left product rows visibly scrolling
     through the gap above the search row (fixed 2026-09-01). */
  top: -20px;
  z-index: 10;
  background: var(--bg-paper);
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border-subtle);
}
.prod-table thead th {
  position: static;
  background: var(--bg-paper-subtle);
}

/* Products Multi-Selection Floating Toolbar */
.prod-selection-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-ink);
  color: var(--bg-paper);
  padding: 8px 16px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.prod-selection-toolbar button {
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: var(--on-accent);
  cursor: pointer;
  transition: background 0.15s ease;
}
.prod-selection-toolbar button:hover {
  background: rgba(255, 255, 255, 0.24);
}
.prod-selection-toolbar button.danger {
  background: rgba(198, 40, 40, 0.85);
  border-color: rgba(198, 40, 40, 0.9);
}

/* Skeleton Loading Animation */
.skeleton-line, .skel-line {
  height: 14px;
  border-radius: 4px;
  background: var(--skeleton-grad);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skel-block {
  border-radius: 8px;
  background: var(--skeleton-grad);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skel-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--bg-card);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Run Error Log Filtering */
.run-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-paper-subtle);
  border-bottom: 1px solid var(--c-border-subtle);
  flex-wrap: wrap;
}
.run-filter-row .chip {
  padding: 2px 8px;
  font-size: 11.5px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: var(--bg-paper);
  cursor: pointer;
}
.run-filter-row .chip.active {
  background: var(--c-ink);
  color: var(--on-accent);
  border-color: var(--c-ink);
}

/* User Visual Chat Inspection */
.chat-msg-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.chat-bubble-user {
  background: var(--c-ink);
  color: var(--bg-paper);
  padding: 10px 14px;
  border-radius: 12px 12px 2px 12px;
  margin-left: auto;
  max-width: 75%;
  font-size: 13px;
  line-height: 1.4;
}
.chat-bubble-ai {
  background: var(--bg-paper);
  border: 1px solid var(--c-border);
  padding: 12px 16px;
  border-radius: 12px 12px 12px 2px;
  margin-right: auto;
  max-width: 85%;
  font-size: 13px;
  line-height: 1.4;
}
.chat-product-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg-paper-subtle);
  border: 1px solid var(--c-border-subtle);
  border-radius: 6px;
  margin-top: 6px;
}
.chat-palette-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.chat-palette-swatch {
  height: 24px;
  flex: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--on-accent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Compact Table Rows */
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 230px;
}
.prod-table.compact tbody tr {
  height: var(--row-h-compact, 34px);
}
.prod-table.compact .pthumb {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  object-fit: cover;
}
.prod-table.compact .pname {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.prod-table.compact .psub {
  font-size: 11px;
  color: var(--c-ink-subtle);
  line-height: 1.2;
}

/* Vector Dot Indicators */
.vec-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 6px;
}
.vec-dot::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-tertiary);
}
.vec-dot.yes::after {
  background: var(--ok);
}

/* ---------- settings (admin panels) ---------- */
/* Shared form input — same family as the login + modal inputs so the whole
   admin shell reads as one system. Settings-specific layout lives in the
   markup; this class is just the chrome. */
.settings-form label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-secondary); margin: 14px 0 5px; letter-spacing: .02em; }
.settings-form label:first-of-type { margin-top: 8px; }
.settings-form input[type=text],
.settings-form input[type=password],
.settings-form input[type=url] { width: 100%; height: var(--control-h); padding: 0 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); font-family: var(--font-body); font-size: 13.5px; color: var(--ink-primary); transition: border-color .12s, box-shadow .12s; }
.settings-form select { width: 100%; height: var(--control-h); padding: 0 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); font-family: var(--font-body); font-size: 13.5px; color: var(--ink-primary); transition: border-color .12s, box-shadow .12s; }
.settings-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(111,116,87,.18); }
.settings-form select[aria-invalid="true"] { border-color: var(--err-ink); }
.settings-form select[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(138,58,34,.26); }
.settings-form select[aria-invalid="true"]:not(:focus) { box-shadow: 0 0 0 3px rgba(138,58,34,.16); }
.settings-form select:disabled { background: var(--bg-inset); color: var(--ink-tertiary); cursor: not-allowed; }
.settings-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(111,116,87,.18); }
.settings-form input[aria-invalid="true"] { border-color: var(--err-ink); }
.settings-form input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(138,58,34,.26); }
.settings-form input[aria-invalid="true"]:not(:focus) { box-shadow: 0 0 0 3px rgba(138,58,34,.16); }
.settings-form input:disabled { background: var(--bg-inset); color: var(--ink-tertiary); cursor: not-allowed; }
/* Hint variants — distinct from labels (size + colour hierarchy):
   - .hint-info = static explanation (lighter, smaller, ink-secondary)
   - .hint-status = live status (role=status) — colour + shape, not colour alone */
.settings-form .hint-info { color: var(--ink-secondary); font-size: 12px; margin: 4px 0 0; }
.settings-form .hint-status { color: var(--ink-secondary); font-size: 12px; margin: 4px 0 0; display: inline-flex; align-items: center; gap: 6px; }
.settings-form .hint-status.ok { color: var(--ok-ink); }
.settings-form .hint-status.warn { color: var(--warn-ink); }
.settings-form .hint-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.settings-form .field-error { color: var(--err-ink); font-size: 12px; margin: 4px 0 0; display: flex; align-items: center; gap: 6px; }
.settings-form .field-error .x-mark { font-weight: 700; }
.settings-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.settings-actions .saving-spinner { display: none; width: 12px; height: 12px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.settings-actions[aria-busy="true"] .saving-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .settings-actions .saving-spinner { animation: none; border-top-color: var(--accent); } }
.settings-key-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-top: 5px; }
.settings-key-row button.btn {
  height: var(--control-h, 28px) !important;
  line-height: var(--control-h, 28px);
  padding: 0 12px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.settings-key-row .key-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-secondary); }
.settings-key-row .key-state .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.settings-key-row .key-state.ok { color: var(--ok-ink); }
.settings-key-row .key-state.missing { color: var(--err-ink); }

/* Admins Role Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
}
.role-badge.owner {
  background: var(--role-owner-bg);
  color: var(--role-owner-ink);
  border: 1px solid var(--role-owner-border);
}
.role-badge.admin {
  background: var(--role-admin-bg);
  color: var(--role-admin-ink);
  border: 1px solid var(--role-admin-border);
}

/* Settings Quick Navigation Chips */
.settings-nav-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.settings-nav-chips .chip {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 14px;
  border: 1px solid var(--c-border);
  background: var(--bg-paper-subtle);
  color: var(--c-ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.settings-nav-chips .chip:hover {
  background: var(--c-border-subtle);
  border-color: var(--c-ink-subtle);
}

/* Settings 2-Column Responsive Card Wall */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 16px;
  align-items: start;
}
.settings-card {
  margin: 0 !important;
  max-width: none !important;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--bg-paper);
}
.settings-card .settings-form {
  padding: 16px 18px !important;
}
.settings-card.highlight {
  outline: 2px solid var(--focus-ring);
  box-shadow: 0 0 12px rgba(25, 118, 210, 0.25);
  transition: outline 0.2s ease, box-shadow 0.2s ease;
}
.src-row.highlight {
  outline: 2px solid var(--focus-ring);
  box-shadow: 0 0 12px rgba(25, 118, 210, 0.25);
  transition: outline 0.2s ease, box-shadow 0.2s ease;
}
.awin-feed-filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* Audit Log View */
.audit-chips-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.chip-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.chip-filter:hover {
  background: var(--bg-hover);
  color: var(--ink);
}
.chip-filter.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.audit-table th {
  position: sticky;
  top: -20px;
  z-index: 10;
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-card);
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.audit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--ink);
  vertical-align: middle;
}
.audit-table tr:hover td {
  background: var(--bg-hover);
}

.audit-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 6px 0;
}


/* ---------- workbench ---------- */
.wb-head { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wb-head .fname { font-family: var(--font-mono); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-head .spacer { flex: 1; }
.wb-alerts { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 12.5px; border: 1px solid; }
.alert.warn { background: var(--amber-bg); border-color: var(--warn-border); color: var(--warn-ink); }
.alert.info { background: var(--info-bg); border-color: var(--info-border); color: var(--accent-deep); }

.workbench { display: grid; grid-template-columns: 400px 1fr; gap: 16px; align-items: start; }
/* Grid overflow guard: a grid item's min-width defaults to auto, so the
   preview table's min-content width (sticky th + many columns) would blow
   the 1fr column past the viewport and inflate the whole page. min-width:0
   lets the wrap's overflow-x do the scrolling instead (2026-08-17). */
.workbench > .panel { min-width: 0; }
/* Reference panel follows the page scroll so the live preview stays visible
   while the admin works down the (uncapped) field list — no inner-scroll
   traps on the primary work surface. */
.workbench > .panel:nth-child(2) { position: sticky; top: 12px; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; }
.panel > header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-secondary); display: flex; justify-content: space-between; align-items: center; }

/* field list — rows, not nested cards: one containment layer (the panel),
   fields separated by hairlines. Status is a small dot, not a side stripe. */
/* Group separators: each standard-field category gets a top rule so the
   groups read as sections, not a flat list (2026-08-17 visual feedback). */
.field-group { padding: 6px 0; border-top: 1px solid var(--border); }
.field-group:first-child { border-top: none; }
.field-group > .gname { padding: 12px 16px 5px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--ink-secondary); text-transform: uppercase; }
.field-card { margin: 0 16px; border-bottom: 1px solid var(--bg-inset); overflow: hidden; }
.field-card:last-child { border-bottom: none; }
.field-card .fdot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--border-strong); }
.field-card.mapped .fdot { background: var(--ok); }
.field-card.unmapped.required .fdot { background: var(--err); }
.field-card.mapped.lowconf .fdot { background: var(--warn-ink); }
.field-card .fhead { display: flex; align-items: center; gap: 8px; padding: 9px 0; cursor: pointer; }
.field-card .fhead .fname2 { font-weight: 600; font-size: 13px; }
.field-card .fhead .req { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; color: var(--err-ink); text-transform: uppercase; }
.field-card .fbody { padding: 2px 0 12px 15px; display: none; }
.field-card.open .fbody { display: block; }
.field-card .mapped-to { padding: 0 0 8px 15px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-secondary); display: flex; align-items: center; gap: 6px; }
.field-card .mapped-to .x { color: var(--ink-tertiary); cursor: pointer; border: none; background: none; font-size: 13px; padding: 4px 8px; margin: -4px -8px -4px 0; min-width: 24px; min-height: 24px; }
.field-card .mapped-to .x:hover { color: var(--err-ink); }
.field-card select, .field-card input[type=text] { width: 100%; height: var(--control-h); padding: 0 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); font-family: var(--font-mono); font-size: 12px; margin-top: 6px; }
.field-card .sample-hint { font-size: 11px; color: var(--ink-tertiary); margin-top: 6px; font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-card .rationale { font-size: 11.5px; color: var(--ink-secondary); margin-top: 8px; padding-left: 9px; border-left: 2px solid var(--border); }
.field-card .swap-warn { margin-top: 8px; font-size: 11.5px; color: var(--warn-ink); background: var(--amber-bg); padding: 7px 9px; border-radius: 6px; }
.field-card .transform-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.field-card .transform-row label { font-size: 11px; color: var(--ink-tertiary); white-space: nowrap; }
.field-card .transform-row select { flex: 1; min-width: 0; }
/* dimension_string config: axis order + fallback unit, with helper text */
.field-card .tf-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.field-card .tf-row label { font-size: 11px; color: var(--ink-tertiary); white-space: nowrap; }
.field-card .tf-row input.axes-input { flex: 1; min-width: 0; margin-top: 0; font-family: var(--font-mono); }
.field-card .tf-row select.unit-select { width: auto; margin-top: 0; }
.field-card .tf-hint { display: block; font-size: 11px; color: var(--ink-tertiary); margin-top: 5px; line-height: 1.5; }
.field-card .merge-axis-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.field-card .merge-axis-row .axis-tag { font-family: var(--font-mono); font-size: 11px; color: var(--ink-tertiary); width: 22px; flex: none; }
.field-card .merge-axis-row select { flex: 1; min-width: 0; margin-top: 0; }
.field-card .price-guard { margin-top: 8px; padding: 9px; border: 1px solid var(--warn-border); background: var(--amber-bg); border-radius: 6px; font-size: 12px; }
.field-card .price-guard label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.field-card .price-guard input { margin-top: 2px; }
.field-card.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--bg-inset); }

/* right preview */
.preview-table-wrap { overflow-x: auto; max-height: 44vh; overflow-y: auto; }
table.preview { border-collapse: collapse; font-family: var(--font-mono); font-size: 11px; width: 100%; }
table.preview th { position: sticky; top: 0; background: var(--bg-inset); padding: 6px 8px; text-align: left; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.preview th .src-col { display: block; font-weight: 400; font-size: 10px; color: var(--ink-tertiary); }
table.preview td { padding: 5px 8px; border-bottom: 1px solid var(--bg-inset); max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.preview tr.row-err td { background: var(--row-err-bg); }
table.preview tr.row-warn td { background: var(--amber-bg); }
table.preview td .llm-badge { cursor: help; font-size: 12px; }
/* unmapped CSV columns — collapsible strip on the field panel (UX trim
   2026-08-16: the standalone third panel was mostly empty). Chips stay
   draggable into a field's column select. */
.unmapped-strip { border-bottom: 1px solid var(--border); }
.unmapped-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 16px; background: var(--bg-inset); border: none; cursor: pointer; font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--ink-secondary); }
.unmapped-toggle:hover { color: var(--ink-primary); }
.unmapped-arrow { transition: transform .15s; }
.unmapped-toggle[aria-expanded="true"] .unmapped-arrow { transform: rotate(180deg); }
.unmapped-cols { padding: 10px 16px 12px; display: flex; flex-wrap: wrap; gap: 6px; max-height: 24vh; overflow-y: auto; }
.preview-issues { padding: 8px 12px; font-size: 11.5px; max-height: 16vh; overflow-y: auto; }
.preview-issues .issue { padding: 5px 8px; border-radius: 5px; margin-bottom: 4px; background: var(--bg-inset); }
.preview-issues .issue.err { background: var(--row-err-bg); color: var(--err-ink); }
.preview-issues .issue.warn { background: var(--amber-bg); color: var(--warn-ink); }

.wb-footer { margin-top: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; align-items: center; gap: 16px; }
.coverage { font-size: 13px; }
.coverage b.ok { color: var(--ok-ink); }
.coverage b.bad { color: var(--err-ink); }
.wb-footer .spacer { flex: 1; }

/* run detail */
.run-errors { margin-top: 14px; }
.run-errors table { width: 100%; border-collapse: collapse; font-size: 12px; }
.run-errors th {
  position: sticky;
  top: -20px;
  z-index: 10;
  text-align: left;
  padding: 6px 8px;
  background: var(--bg-inset);
  font-family: var(--font-mono);
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}
.run-errors td { padding: 6px 8px; border-bottom: 1px solid var(--bg-inset); font-family: var(--font-mono); font-size: 11px; vertical-align: top; }
.run-errors td.msg { font-family: var(--font-body); }

/* users table sticky header — preview table keeps its own top:0 rule
   (its scroll container has no 20px padding offset, so -20px would clip) */
#user-table th, table.users th, #users-table th {
  position: sticky;
  top: -20px;
  z-index: 10;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

/* dashboard sparklines */
.dash-sparkline {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  width: 48px;
  height: 24px;
}
.dash-sparkline polyline {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dash-sparkline.success polyline {
  stroke: var(--ok);
}
.dash-sparkline.danger polyline {
  stroke: var(--err);
}
.dash-sparkline.neutral polyline {
  stroke: var(--accent);
}

/* admins */
.admin-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--bg-inset); }
.admin-row code { font-family: var(--font-mono); font-size: 12px; background: var(--bg-inset); padding: 3px 8px; border-radius: 5px; }
.hint { font-size: 12px; color: var(--ink-tertiary); margin-top: 8px; }
/* ---------- rules page ---------- */
.rules-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.rules-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.rules-panel > header { padding: 13px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rules-panel > header h2 { font-family: var(--font-display); font-size: 17px; font-weight: 500; }
.rules-panel > header .hint { font-size: 12px; color: var(--ink-tertiary); margin: 0; }
.rules-panel > header .actions { display: flex; gap: 8px; align-items: center; }

table.rules { width: 100%; border-collapse: collapse; font-size: 13px; }
#rules-table-wrap { overflow-x: auto; }
table.rules th { text-align: left; padding: 9px 14px; background: var(--bg-inset); border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-secondary); }
table.rules td { padding: calc((var(--row-h) - 1.45em) / 2) 14px; border-bottom: 1px solid var(--bg-inset); vertical-align: middle; }
table.rules tr:last-child td { border-bottom: none; }
table.rules td.pattern { font-family: var(--font-mono); font-size: 12px; }
table.rules td .type-badge { font-family: var(--font-mono); font-size: 10.5px; padding: 2px 8px; border-radius: 4px; background: var(--bg-inset); border: 1px solid var(--border); color: var(--ink-secondary); }
table.rules td .src-tag { font-family: var(--font-mono); font-size: 11px; color: var(--ink-tertiary); }
table.rules td .src-tag.global { color: var(--accent); font-weight: 600; }
table.rules td.note { color: var(--ink-secondary); font-size: 12px; max-width: 240px; }
table.rules td.row-actions { text-align: right; white-space: nowrap; }
table.rules td.row-actions button { margin-left: 6px; }
table.rules .empty { padding: 28px; text-align: center; color: var(--ink-tertiary); }

.layer-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border: 1px solid transparent; cursor: help; }
.layer-chip .conf { color: inherit; opacity: .7; font-weight: 500; text-transform: none; letter-spacing: 0; }
.layer-chip.rule { background: var(--chip-ok-bg); color: var(--ok-ink); border-color: var(--chip-ok-border); }
.layer-chip.history { background: var(--chip-run-bg); color: var(--chip-run-ink); border-color: var(--chip-run-border); }
.layer-chip.embedding { background: var(--chip-embedding-bg); color: var(--chip-embedding-ink); border-color: var(--chip-embedding-border); }
.layer-chip.llm { background: var(--bg-inset); color: var(--ink-tertiary); border-color: var(--border); }
/* Low-confidence embedding proposals (server flags meta.high === false):
   amber = "please review before committing". */
.layer-chip.lowconf { background: var(--amber-bg); color: var(--warn-ink); border-color: var(--chip-warn-border); }

/* ---------- auto-learn card ---------- */
.learn-card { padding: 16px 14px; display: flex; gap: 14px; align-items: flex-start; }
.learn-card .checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 500; }
.learn-card .checkbox input { width: 16px; height: 16px; }
.learn-card .desc { font-size: 12px; color: var(--ink-secondary); margin-top: 8px; line-height: 1.5; }
.history-list { padding: 0 14px 14px; }
.history-list table { width: 100%; border-collapse: collapse; font-size: 12px; font-family: var(--font-mono); }
.history-list th { text-align: left; padding: 6px 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-tertiary); border-bottom: 1px solid var(--border); }
.history-list td { padding: 6px 10px; border-bottom: 1px solid var(--bg-inset); }
.history-list td.field { color: var(--ok-ink); font-weight: 600; }
.history-list .empty { padding: 16px; text-align: center; color: var(--ink-tertiary); font-family: var(--font-body); font-size: 12.5px; }

/* ---------- workbench: required/warn + provenance + commit gate ---------- */
.field-card .fhead .req-ast { color: var(--err-ink); font-weight: 700; margin-left: -3px; }
.field-card .fhead .warn-badge { font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .05em; padding: 2px 7px; border-radius: 4px; background: var(--amber-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); text-transform: uppercase; }
.field-card .fhead .provenance-chip { margin-left: auto; }
.field-card .optional-hint { margin-top: 6px; font-size: 11.5px; color: var(--ink-tertiary); font-style: italic; }
.field-card .required-hint { margin-top: 6px; font-size: 11.5px; color: var(--err-ink); font-weight: 500; }

.commit-gate { margin-top: 12px; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; }
.commit-gate > .gate-title { font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-secondary); margin-bottom: 8px; }
.commit-gate ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.commit-gate li { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; }
.commit-gate li .mark { width: 14px; display: inline-block; text-align: center; font-weight: 700; }
.commit-gate li.mapped .mark { color: var(--ok-ink); }
.commit-gate li.unmapped .mark { color: var(--err-ink); }
.commit-gate li.warn-unmapped { color: var(--warn-ink); }
.commit-gate li.warn-unmapped .mark { color: var(--warn-ink); }
.commit-gate li .label { font-family: var(--font-body); }
.commit-gate li .field-name { font-weight: 600; color: var(--ink-primary); }
.commit-gate .gate-summary { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-secondary); }
.commit-gate .gate-summary.bad { color: var(--err-ink); font-weight: 600; }
.commit-gate .gate-summary.ok { color: var(--ok-ink); font-weight: 600; }

/* ---------- upload hero + feed picker ---------- */
/* Import is a single-column page — cap the measure instead of taking the
   1500px catalogue width. */
#view-import { max-width: 780px; }
.upload-hero { display: flex; align-items: flex-start; gap: 16px; padding: 26px 24px; border: 2px dashed var(--border); border-radius: 14px; background: var(--bg-card); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; width: 100%; line-height: inherit; }
.upload-hero:hover, .upload-hero.drag-over { border-color: var(--accent); background: var(--bg-inset); }
.upload-hero .hero-icon { width: 30px; height: 30px; color: var(--accent); flex: none; margin-top: 2px; }
.upload-hero .hero-icon svg, .fp-ico svg, .q-ico svg { display: block; }
.fp-ico svg { width: 16px; height: 16px; color: var(--ink-secondary); }
.q-ico { display: inline-flex; vertical-align: -2px; }
.q-ico svg { width: 12px; height: 12px; }
.upload-hero .hero-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.upload-hero .hero-title { font-size: 16px; font-weight: 600; color: var(--ink-primary); font-family: var(--font-body); }
.upload-hero .hero-sub { font-size: 12.5px; color: var(--ink-tertiary); line-height: 1.55; }
.import-recent { margin-top: 28px; }
.import-recent > h3 { font-family: var(--font-body); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-tertiary); margin-bottom: 10px; }
#import-runs .queue-item:last-child { margin-bottom: 0; }
#import-runs .queue-empty { text-align: left; padding: 18px 4px; }
.imp-view-all { background: none; border: none; padding: 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.imp-view-all:hover { text-decoration: underline; }
.feeds-explainer { font-size: 12.5px; color: var(--ink-secondary); line-height: 1.6; max-width: 760px; margin: -6px 0 14px; }
.source-card .card-actions { margin-top: 10px; display: flex; gap: 8px; }
.source-card { display: flex; flex-direction: column; }
.source-card .grow { flex: 1; }
.feed-pick { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-card); cursor: pointer; margin-bottom: 8px; font-family: var(--font-body); }
.feed-pick:hover { border-color: var(--accent); background: var(--bg-inset); }
.feed-pick .fp-name { font-weight: 600; font-size: 13.5px; color: var(--ink-primary); }
.feed-pick .fp-sub { font-size: 11.5px; color: var(--ink-tertiary); margin-top: 2px; }
.feed-pick .fp-arrow { margin-left: auto; color: var(--ink-tertiary); }
.feed-pick.new-feed { border-style: dashed; }
.modal details.advanced { margin-top: 6px; }
.modal details.advanced summary { font-size: 12px; color: var(--ink-secondary); cursor: pointer; margin-bottom: 8px; }
.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.tz-chip { display: inline-flex; align-items: center; padding: 4px 10px; font-size: 11.5px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); }
.lang-toggle button { padding: 4px 10px; font-size: 11.5px; background: var(--bg-card); color: var(--ink-secondary); border: none; cursor: pointer; font-family: var(--font-body); }
.lang-toggle button.active { background: var(--accent); color: var(--on-accent); }

/* ---------- workbench reflow ---------- */
@media (max-width: 1120px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  /* Sticky reference panels would stack awkwardly in the single-column
     collapse — everything flows statically on narrow screens. */
  .workbench > .panel:nth-child(2), .workbench > .panel:nth-child(3) { position: static; }
}

/* Column Mapping 2-Column Split Workbench */
.cm-sticky-head {
  position: sticky;
  /* Same stale-44px fix as .prod-toolbar (2026-09-01): pinning flush
     needs -20px to cancel .view's padding-top inside the sticky box. */
  top: -20px;
  z-index: 10;
  background: var(--bg-paper);
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cm-workbench-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 12px;
}
@media (max-width: 1024px) {
  .cm-workbench-grid {
    grid-template-columns: 1fr;
  }
}
.compact-cm-table tbody tr {
  height: 34px;
}
.compact-cm-table select {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 4px;
}

/* Dashboard High-Density Executive Layout */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.dash-card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-secondary);
}
.dash-card-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 6px;
}
.dash-card-sub {
  font-size: 11.5px;
  color: var(--ink-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-prog-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0 4px;
}
.dash-prog-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.dash-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 900px) {
  .dash-split-grid { grid-template-columns: 1fr; }
}

.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.dash-panel-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Funnel Visualization */
.dash-funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.dash-funnel-label {
  width: 95px;
  font-size: 12px;
  color: var(--ink-secondary);
}
.dash-funnel-bar-wrapper {
  flex: 1;
  height: 20px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}
.dash-funnel-bar-fill {
  height: 100%;
  background: var(--accent-light);
  border-right: 2px solid var(--accent);
  transition: width 0.4s ease;
}
.dash-funnel-count {
  width: 50px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* Recent Activity Table */
.dash-activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dash-activity-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.dash-activity-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-light);
  color: var(--ink);
}
.dash-activity-table tr:hover td {
  background: var(--bg-hover);
}

/* Product Quick View Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 36;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.drawer-header-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.3;
}
.drawer-header-sub {
  font-size: 11.5px;
  color: var(--ink-secondary);
}
.drawer-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-secondary);
  font-size: 14px;
}
.drawer-close:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  font-size: 12.5px;
}

.drawer-hero-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.drawer-section {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}
.drawer-section-title {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.drawer-prop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.drawer-prop-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-prop-k {
  font-size: 11px;
  color: var(--ink-secondary);
}
.drawer-prop-v {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.drawer-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- Hallmark Tactile Micro-Texture & Refinements ---------- */
/* 1. Custom Minimal Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(35, 42, 38, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(35, 42, 38, 0.3);
}

/* 2. High-Contrast Sharp Focus Ring (Accessibility + Craft) */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 1.5px var(--bg-card), 0 0 0 3.5px var(--accent) !important;
}

/* 3. Smooth Momentum Scroll */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(35, 42, 38, 0.15) transparent;
}

/* 4. Click-to-Copy Micro-interaction */
.click-to-copy {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  padding: 1px 4px;
  margin: -1px -4px;
  transition: all 0.15s ease;
}
.click-to-copy:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.click-to-copy::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect width='14' height='14' x='8' y='8' rx='2' ry='2'/><path d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect width='14' height='14' x='8' y='8' rx='2' ry='2'/><path d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/></svg>") center/contain no-repeat;
  vertical-align: -1px;
  font-size: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.click-to-copy:hover::after {
  opacity: 0.7;
}

/* 5. Delightful Empty States */
.empty-state-card {
  text-align: center;
  padding: 36px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin: 16px 0;
}
.empty-state-icon {
  margin-bottom: 8px;
  opacity: 0.55;
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.empty-state-icon svg { display: block; }
.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.empty-state-desc {
  font-size: 12px;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

/* 6. Pro Keyboard Row Focus — moved to base.css for global table row selection */





