/* ============================================================
   Integration Fox · Engine UI Prototype
   Tokens: style guide artifact 398046d1
   ============================================================ */

/* --- Tokens ------------------------------------------------- */
/* Two themes share this one token set: :root below is the light theme (the new default look),
   and :root[data-theme="dark"] further down overrides it back to the dark theme - see
   app/lib/theme.ts for how the `data-theme` attribute gets set/persisted.

   Values are mapped from the "Integration Fox · Design System v1.0" reference artifact (Salience,
   Aug 2026 - integrationfox-showcase.html) onto this file's existing token names (rather than
   renaming every rule to the artifact's own --canvas/--surface/--card/--ink names, which would
   mean touching every CSS file again):
     navy-deepest -> canvas, navy-dark -> surface, navy-mid -> card, navy-light -> sunken,
     navy-mist -> faint, text-primary -> ink-deep, text-secondary -> ink-secondary,
     text-muted -> ink-muted, orange -> primary, status-ok/success-text -> success,
     accent-teal -> secondary. Fox Orange itself is unchanged (artifact: "Fox Orange is
     unchanged").
   orange-hover is genuinely the .btn-primary:hover/.oauth-btn:hover background in this file, so
   it maps to the artifact's dedicated --primary-hover (#E0570F) - not --primary-ember (#B8460A,
   "orange that has to carry text: inline links, small labels" per the artifact's own swatch role,
   a distinct text-only shade this file has no current consumer for, so it isn't introduced as a
   new token here).
   The previous artifact version had no dedicated warning/error colors, so status-warn reused
   ember and status-error/danger-text were kept as a best guess. The artifact's real ones are
   --warning #8A6100 and --error #C0362C: status-error/danger-text take the error directly, but
   #8A6100 is a text-grade amber that reads olive/brown as a DOT on a light surface (the same
   review that killed the ember reuse), so warn is split the way error already is:
   --status-warn is a brighter amber for dots/fills and the 15% badge tint (>=3:1 non-text),
   and --warn-text (#8A6100) carries warn badge/label text (>=4.5:1). --status-info is the Info
   log-level dot: it used to reuse --status-ok, which made an Info log read as a success, so it
   gets its own hue (blue) - distinct from ok/warn/error and from the brand orange.
   The dark palette mirrors the same roles: warn stays amber there too (the old #FF9A5E was
   identical to dark --orange-hover, colliding with the brand orange), and --glow-alpha drops
   the status-dot/.rag glows to a low alpha in light mode only - a glow reads fine on a dark
   canvas and muddy on a light one.

   --*-rgb tokens are R,G,B triples plugged into rgba(var(--x-rgb), alpha), so the many
   translucent overlays throughout every CSS file (borders, hover backgrounds, dividers, tinted
   badges) stay theme-aware without redesigning each one - every literal rgba(255,255,255,<alpha>)
   was mechanically rewritten to rgba(var(--ink-rgb),<alpha>), same idea for --orange-rgb and
   --status-*-rgb. --sidebar-rgb is the one deliberate exception, NOT overridden per-theme: it's
   only used by the floating "Engineering" chip (.eng-btn), which stays a fixed dark chip in both
   themes - the sidebar itself uses the normal theme-tracking --chrome-rgb/--ink-rgb, same as the
   topbar. */
:root {
  --navy-deepest:  #F6F4F1;
  --navy-dark:     #FFFFFF;
  --navy-mid:      #F6F4F1;
  --navy-light:    #EFECE7;
  --navy-mist:     #9A97AB;

  --orange:        #F26419;
  --orange-hover:  #E0570F;
  --orange-rgb:    242,100,25;
  /* Button fill: darker than the brand orange so white label text passes 4.5:1 (brand orange is
     3.2:1). Same in both themes, since white text needs the same dark fill either way. */
  --orange-fill:       #C24A0C;
  --orange-fill-hover: #A83F08;
  --link-text:         #B8460A;

  --status-ok:      #137A5A;
  --status-ok-rgb:      19,122,90;
  --status-warn:    #D97706;
  --status-warn-rgb:    217,119,6;
  --status-error:   #C0362C;
  --status-error-rgb:   192,54,44;
  --status-info:    #3B6FB6;
  --status-info-rgb:    59,111,182;
  --glow-alpha:     0.3;

  --text-primary:   #2E294E;
  --text-secondary: #4E4A66;
  --text-muted:     #6E6A84;

  --danger-text:   #C0362C;
  --warn-text:     #8A6100;
  --info-text:     #5B6B8C;
  --success-text:  #137A5A;
  --accent-teal:   #127C78;
  --accent-teal-rgb: 18,124,120;

  --ink-rgb:       23,22,43;
  --chrome-rgb:    255,255,255;
  --sidebar-rgb:   23,22,43;

  /* Theme-invariant, like --sidebar-rgb above: the floating "Engineering" chip (.eng-btn) always
     stays a fixed dark chip with a fixed bright-green accent regardless of theme, since a
     darker light-theme green would be low-contrast against its own always-dark background. */
  --eng-accent:     #4CC99A;
  --eng-accent-rgb: 76,201,154;

  /* Fox Navy ("Fox Blue" per the reference design) as an invariant RGB triple, for the sidebar's
     active-nav-item pill (.nav-item.active) - needed because --text-primary (which already equals
     this exact color, #2E294E, in light mode) flips to white in dark mode, so it can't double as
     a fixed accent the way --text-primary normally would. Same pattern as --sidebar-rgb/
     --eng-accent-rgb above. */
  --fox-navy-rgb:   46,41,78;

  --input-bg:      #F8F8FA;
  --input-border:  #C6C6C6;

  --sidebar-w:     240px;
  --topbar-h:      60px;

  --r-control:     5px;
  --r-btn:         9999px;
  --r-card:        12px;
  --r-tile:        24px;

  --duration-fast: 150ms;
  --duration-base: 200ms;
}

:root[data-theme="dark"] {
  --navy-deepest:  #1B1930;
  --navy-dark:     #232039;
  --navy-mid:      #2A2645;
  --navy-light:    #1F1C35;
  --navy-mist:     #6E6A84;

  --orange-hover:  #FF9A5E;
  --link-text:     #FF9A5E;

  --status-ok:      #4CC99A;
  --status-ok-rgb:      76,201,154;
  --status-warn:    #F5B83D;
  --status-warn-rgb:    245,184,61;
  --status-error:   #E0223B;
  --status-error-rgb:   224,34,59;
  --status-info:    #8FA3C9;
  --status-info-rgb:    143,163,201;
  --glow-alpha:     1;

  --text-primary:   #FFFFFF;
  --text-secondary: #C4C1D4;
  --text-muted:     #A29EB8;

  --danger-text:   #FF6B7A;
  --warn-text:     #F5B83D;
  --info-text:     #A0B0CC;
  --success-text:  #4CC99A;
  --accent-teal:   #3FBFB8;
  --accent-teal-rgb: 63,191,184;

  --ink-rgb:       255,255,255;
  --chrome-rgb:    35,32,57;
}

/* --- Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
select, input { font-family: inherit; }

/* --- Base --------------------------------------------------- */
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, 'SF Pro Display', BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--navy-deepest);
  color: var(--text-primary);
  min-height: 100vh;
}
/* The subtle glow only reads correctly against the dark theme's near-black page background -
   on the light theme it would show up as a stray blue smudge, so it's dark-only. */
:root[data-theme="dark"] body {
  background-image: radial-gradient(ellipse at 75% 0%, rgba(49,64,104,0.5) 0%, transparent 55%);
}

/* --- Sidebar ------------------------------------------------ */
/* Toggles with the theme, same as everything else - uses the theme-tracking --text-x / --ink-rgb
   tokens, not fixed colors. --chrome-rgb (shared with the topbar) gives it the same translucent
   glass background in both themes. */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(var(--chrome-rgb),0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(var(--ink-rgb),0.07);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo { width: 34px; height: 37px; flex-shrink: 0; }
.topbar-logo  { width: 28px; height: 30px; flex-shrink: 0; opacity: 0.9; }

.sidebar-brand-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.nav-group { padding: 18px 0 0; }

.nav-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-teal);
  padding: 0 20px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 12px;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: color var(--duration-fast), background var(--duration-fast);
  cursor: pointer;
}

.nav-item:hover { color: var(--text-primary); background: rgba(var(--ink-rgb),0.04); }

/* Active item: a Fox Navy ("Fox Blue") pill, replacing the old orange left-border + tint, per a
   reference design (dark-mode screenshot) showing a rounded, bold-text pill with no border at
   all. The pill's own color is the same in both themes - --fox-navy-rgb at a low alpha for a
   soft tint on the light cream background, and a much higher alpha for dark mode (sampled
   directly from the reference screenshot: #272544 against a #1B1930 page is ~0.75 opacity of
   this exact navy) - one fixed alpha across both themes would either be invisible in light mode
   or a near-opaque block in dark mode, so each theme gets its own, derived from the same color. */
.nav-item.active {
  color: var(--text-primary);
  font-weight: 700;
  background: rgba(var(--fox-navy-rgb), 0.08);
}
:root[data-theme="dark"] .nav-item.active { background: rgba(var(--fox-navy-rgb), 0.75); }

.nav-item-icon {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* Active icon picks up Signal Teal - the reference screenshot shows it distinctly brighter than
   this app's usual --accent-teal, which matches the brand guide's own rule verbatim ("Inside a
   dark band the teal brightens to #3FBFB8") rather than being a one-off guess. Scoped to just
   this icon rather than overriding --accent-teal itself, which several other things (section
   labels, badges) also use in dark mode without this brightening today. */
.nav-item.active .nav-item-icon { opacity: 1; color: var(--accent-teal); }
:root[data-theme="dark"] .nav-item.active .nav-item-icon { color: #3FBFB8; }

/* --- Topbar ------------------------------------------------- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(var(--chrome-rgb),0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a:hover { color: var(--text-secondary); transition: color var(--duration-fast); }

.breadcrumb-sep {
  opacity: 0.3;
  font-size: 11px;
  user-select: none;
}

.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

.page-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* Lives in the user dropdown (see .user-menu-item) rather than as its own topbar pill - IFS-1534.
   Selector is compounded with .user-menu-item so it wins on specificity rather than source
   order - .user-menu-item's `display: block` would otherwise clobber this at equal specificity. */
.user-menu-item.theme-toggle-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-toggle-icon { width: 15px; height: 15px; flex-shrink: 0; }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy-light);
  border: 1.5px solid rgba(var(--ink-rgb),0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar.has-favicon {
  background: #fff;
  border-color: rgba(var(--ink-rgb),0.25);
  padding: 5px;
}
.user-avatar.has-favicon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 2px;
}
.user-avatar-fallback { padding: 6px; }
.user-avatar-fox-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.7;
}

/* User menu (company name + avatar + dropdown) */
.user-menu { position: relative; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px 4px 12px;
  border-radius: var(--r-control);
  transition: background var(--duration-fast);
}
.user-menu-trigger:hover { background: rgba(var(--ink-rgb),0.06); }

.user-company {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.user-menu-caret {
  color: var(--navy-mist);
  flex-shrink: 0;
  transition: transform var(--duration-fast);
}
.user-menu.open .user-menu-caret { transform: rotate(180deg); }

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--navy-mid);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: var(--r-card);
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 200;
  overflow: hidden;
}
.user-menu-dropdown[hidden] { display: none; }

.user-menu-item {
  display: block;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.user-menu-item:hover { background: rgba(var(--ink-rgb),0.07); color: var(--text-primary); }
.user-menu-item.destructive:hover { color: var(--danger-text); }

.user-menu-divider {
  height: 1px;
  background: rgba(var(--ink-rgb),0.08);
  margin: 4px 0;
}

/* Switch customer - a trigger that expands the customer list below it, not a plain nav item like
   Contact Us/Dark mode/Sign Out, but it shared .user-menu-item's exact color/weight with nothing
   to set it apart. Bolder + --text-primary (same treatment .switch-customer-item.is-current
   already uses for "the emphasized row in this menu") gives it the visual weight of a section
   control instead of blending in as one more link.

   Unlike its sibling buttons in this dropdown (the theme toggle, Sign Out), this one is a <button>
   with no inline style reset at all - it was rendering with the browser's default UA button
   background (an opaque light grey) the whole time, just not obviously so while its text was
   --text-secondary. Setting the text to white here without also resetting that background would
   make it unreadable in dark mode (white-on-light-grey) - reset explicitly instead of relying on
   each caller to remember an inline style, which is how this got missed originally. */
.user-menu-switch-trigger {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 600;
}
.switch-caret {
  color: var(--navy-mist);
  flex-shrink: 0;
  transition: transform var(--duration-fast);
}
.user-menu-switch-trigger.open .switch-caret { transform: rotate(180deg); }

.switch-customer-list {
  /* Theme-tracking, not a hardcoded dark tint - the old rgba(0,0,0,...) values only ever read
     correctly against the dark theme's own dark chrome; in light mode they washed out to a
     low-contrast grey box that made the search placeholder below barely legible. */
  background: rgba(var(--ink-rgb),0.04);
  border-top: 1px solid rgba(var(--ink-rgb),0.06);
  border-bottom: 1px solid rgba(var(--ink-rgb),0.06);
}
.switch-customer-list[hidden] { display: none; }

.switch-customer-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.switch-customer-search-icon {
  position: absolute;
  left: 14px;
  width: 13px;
  height: 13px;
  color: var(--navy-mist);
  pointer-events: none;
}
.switch-customer-search {
  display: block;
  width: 100%;
  background: rgba(var(--ink-rgb),0.06);
  border: none;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
  padding: 8px 14px 8px 34px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}
.switch-customer-search::placeholder { color: var(--navy-mist); }

.switch-customer-scroll {
  max-height: 196px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--ink-rgb),0.15) transparent;
}

.switch-customer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.switch-customer-item:hover { background: rgba(var(--ink-rgb),0.07); color: var(--text-primary); }
.switch-customer-item.is-current { color: var(--text-primary); font-weight: 600; }
.switch-customer-item .customer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy-mist);
  flex-shrink: 0;
}
.switch-customer-item.is-current .customer-dot { background: var(--status-ok); }
.switch-customer-item[hidden] { display: none; }

.switch-no-results {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--navy-mist);
  font-style: italic;
}

/* --- Layout ------------------------------------------------- */
.main {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

.page { padding: 28px 32px 64px; }

.page-header { margin-bottom: 24px; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Buttons ------------------------------------------------
   The one button set for engine-next (IFS-1573). Five variants, three sizes, all pills:
     btn-primary    the one main action of a view or dialog (at most one)
     btn-secondary  any other real action (Cancel, Back, View logs, pagination)
     btn-danger     removes or disconnects something; red text, confirm step only
     btn-icon       round, label-less (menus, close, explain); needs an aria-label
     btn-text       link-like inline action (Clear filters, help toggles)
   Sizes: btn-sm (32px), default (44px), btn-lg (54px, hero CTA only); btn-full adds 100% width.
   Pages must not define their own button classes - extend this block instead. */
.btn {
  --btn-h: 44px;
  --btn-px: 22px;
  --btn-fs: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-family: inherit;
  font-size: var(--btn-fs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast), opacity var(--duration-fast), transform 60ms;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn svg { flex: none; }
.btn svg:not([width]) { width: 1.15em; height: 1.15em; }
.btn img { width: 22px; height: 22px; object-fit: contain; flex: none; }

.btn-sm   { --btn-h: 32px; --btn-px: 16px; --btn-fs: 13px; }
.btn-lg   { --btn-h: 54px; --btn-px: 30px; --btn-fs: 18px; font-weight: 700; }
.btn-full { width: 100%; }

.btn-primary { background: var(--orange-fill); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--orange-fill-hover); }

.btn-secondary {
  background: rgba(var(--ink-rgb),0.07);
  color: var(--text-secondary);
  border-color: rgba(var(--ink-rgb),0.12);
}
.btn-secondary:hover:not(:disabled),
.btn-secondary.is-active { background: rgba(var(--ink-rgb),0.12); color: var(--text-primary); }

.btn-danger {
  background: rgba(var(--ink-rgb),0.07);
  color: var(--danger-text);
  border-color: rgba(var(--status-error-rgb),0.35);
}
.btn-danger:hover:not(:disabled) { background: rgba(var(--status-error-rgb),0.12); border-color: rgba(var(--status-error-rgb),0.6); }

.btn-icon { --btn-h: 34px; width: var(--btn-h); padding: 0; background: transparent; color: var(--text-muted); }
.btn-icon.btn-sm { --btn-h: 28px; padding: 0; }
.btn-icon:hover:not(:disabled) { background: rgba(var(--ink-rgb),0.1); color: var(--text-primary); }
/* Close ("✕") glyph needs a larger font-size than btn-sm's 13px to fill a 28px target. */
.btn-icon.btn-close { --btn-fs: 18px; }

.btn-text {
  height: auto;
  padding: 2px 4px;
  border-radius: 6px;
  background: none;
  color: var(--link-text);
  font-size: 13px;
  font-weight: 500;
}
.btn-text:hover:not(:disabled) { text-decoration: underline; }

/* Busy: swap the label for a verb and add .is-busy (pair with disabled) to show the spinner. */
.btn.is-busy::before {
  content: "";
  width: 1em;
  height: 1em;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}
.btn.is-busy:disabled { opacity: 0.7; cursor: progress; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-busy::before { animation-duration: 2.4s; } }

/* --- Platform tiles ----------------------------------------- */
.platform-tile {
  border-radius: var(--r-tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
  letter-spacing: 0.04em;
  width: 40px;
  height: 40px;
  overflow: hidden;
  padding: 6px;
}
.platform-tile.sm  { width: 24px; height: 24px; border-radius: 8px;  padding: 3px; font-size: 7px; }
.platform-tile.lg  { width: 52px; height: 52px; border-radius: 28px; padding: 8px; font-size: 14px; }

.platform-tile img {
  width: 91%;
  height: 91%;
  object-fit: contain;
}

/* All tiles: navy-light background. Platform colour used only for initials text. */
.platform-tile { background: var(--navy-light); }
.pt-aroflo     { color: #60A5FA; }
.pt-hubspot    { color: #FF7A59; }
.pt-shopify    { color: #96BF48; }
.pt-netsuite   { color: #F97316; }
.pt-xero       { color: #13B5EA; }
.pt-salesforce { color: #00A1E0; }

.platform-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.platform-pair-arrow {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

/* --- Status ------------------------------------------------- */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
}
.status-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.ok    { color: var(--status-ok); }
.status-dot.ok::before    { background: var(--status-ok);   box-shadow: 0 0 6px rgba(var(--status-ok-rgb),var(--glow-alpha)); }
.status-dot.warn  { color: var(--warn-text); }
.status-dot.warn::before  { background: var(--status-warn); box-shadow: 0 0 6px rgba(var(--status-warn-rgb),var(--glow-alpha)); }
.status-dot.error { color: var(--danger-text); }
.status-dot.error::before { background: var(--status-error); box-shadow: 0 0 6px rgba(var(--status-error-rgb),var(--glow-alpha)); }
.status-dot.paused { color: var(--text-muted); }
.status-dot.paused::before { background: var(--text-muted); }

/* --- Badges ------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-ok     { background: rgba(var(--status-ok-rgb),0.15);  color: var(--status-ok); }
.badge-warn   { background: rgba(var(--status-warn-rgb),0.15);  color: var(--warn-text); }
.badge-error  { background: rgba(var(--status-error-rgb),0.15);   color: var(--danger-text); }
.badge-info   { background: rgba(var(--ink-rgb),0.12);   color: var(--info-text); }
.badge-paused { background: rgba(var(--ink-rgb),0.08); color: var(--text-muted); }

/* --- Tooltip (shared with app/integrations/[id]/Tooltip.tsx) --- */
/* Moved here from integration.css: the Tooltip component is also used by table-header hints
   (app/components/ThHint.tsx) on pages that don't load integration.css. */
.tip-wrap { position: relative; display: inline-flex; align-items: center; }
.tip-icon {
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(var(--ink-rgb),0.07); color: var(--text-muted);
  font-size: 8.5px; font-weight: 700; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: default; margin-left: 5px; flex-shrink: 0;
  border: 1px solid rgba(var(--ink-rgb),0.1); line-height: 1;
}
.tip-icon:hover { background: rgba(var(--ink-rgb),0.14); color: var(--text-secondary); }

/* Floating tooltip (fixed position — escapes overflow:hidden).
   Dark with light text in both themes. Its colours are their own tokens: the text used to take the theme's
   --text-secondary, which is a dark purple in the light theme, so it sat on the dark background at about 2:1
   (WCAG AA asks for 4.5:1). Light theme now: white on #2E294E, 13.6:1. Dark theme is unchanged. */
.tip-float {
  --tip-bg: #2E294E;
  --tip-fg: #FFFFFF;
  --tip-border: rgba(255,255,255,0.14);
  position: fixed; z-index: 1000; pointer-events: none;
  background: var(--tip-bg); border: 1px solid var(--tip-border);
  border-radius: 7px; padding: 10px 12px;
  font-size: 11.5px; color: var(--tip-fg); font-weight: 400;
  /* the tip is rendered inside tile titles, labels and table headers, which are upper-cased and
     letter-spaced: do not inherit that */
  text-transform: none; letter-spacing: normal;
  line-height: 1.55; width: 240px; white-space: normal;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  opacity: 0; transition: opacity 100ms;
}
:root[data-theme="dark"] .tip-float {
  --tip-bg: #0c1c38;
  --tip-fg: var(--text-secondary);
  --tip-border: rgba(var(--ink-rgb),0.12);
}
.tip-float.is-visible { opacity: 1; }

/* Abbreviated table-column heading (ThHint.tsx): dotted underline signals "there's more here",
   same affordance browsers give <abbr title>. */
.th-abbr {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
}

/* Setting value chip — read-only select appearance for integration settings */
.setting-val {
  display: inline-block;
  background: rgba(var(--ink-rgb),0.06);
  border: 1px solid rgba(var(--ink-rgb),0.10);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
  vertical-align: middle;
  white-space: nowrap;
}

/* --- Integration cards -------------------------------------- */
/* ── Integration list (dashboard) ────────────────────────────── */
.integrations-list { display: flex; flex-direction: column; gap: 14px; }

.intcard {
  background: var(--navy-dark);
  border: 1px solid rgba(var(--ink-rgb),0.08);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: border-color var(--duration-fast);
}
.intcard:hover          { border-color: rgba(var(--ink-rgb),0.15); }
.intcard.is-error       { border-color: rgba(var(--status-error-rgb),0.28); }
.intcard.is-sandbox     { border-color: rgba(var(--status-warn-rgb),0.35); border-left: 3px solid rgba(var(--status-warn-rgb),0.7); }
.intcard.is-sandbox.is-error { border-color: rgba(var(--status-error-rgb),0.28); border-left: 3px solid rgba(var(--status-warn-rgb),0.7); }
.intcard:focus-visible  { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Integration name: the card title, above the platforms */
.intcard-name-row {
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.intcard-name-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Top row: platforms + status + actions */
.intcard-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 18px;
}

.intcard-platform {
  display: flex;
  align-items: center;
  gap: 12px;
}
.intcard-platform-info { display: flex; flex-direction: column; gap: 2px; }
.intcard-platform-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.intcard-connection {
  font-size: 12px;
  color: var(--text-muted);
}
.intcard-arrow { color: var(--navy-mist); text-align: center; font-size: 16px; }

.intcard-name-edit-btn {
  opacity: 0;
  transition: opacity 120ms;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  line-height: 0;
  border-radius: 3px;
}
.intcard:hover .intcard-name-edit-btn { opacity: 1; }
.intcard-name-edit-btn:hover { color: var(--text-primary); }
.intcard-name-input {
  background: var(--navy-deepest);
  border: 1px solid var(--orange);
  border-radius: var(--r-control);
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  width: 220px;
}

.intcard-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  justify-self: stretch;
}
.intcard-actions { display: flex; gap: 6px; }

/* Connection variant badges */
.conn-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.conn-badge.sandbox  { background: rgba(var(--status-warn-rgb),0.18); color: var(--warn-text); }
.conn-badge.unit     { background: rgba(var(--ink-rgb),0.08); color: var(--text-muted); }

/* Record stats strip */
.intcard-stats {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  border-top: 1px solid rgba(var(--ink-rgb),0.06);
}
.intcard-stat {
  padding: 14px 20px;
}
.intcard-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 4px;
}
.intcard-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.intcard-stat-divider { background: rgba(var(--ink-rgb),0.06); }

/* Entity list accordion */
.intcard-entities-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: none;
  border: none;
  border-top: 1px solid rgba(var(--ink-rgb),0.06);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.intcard-entities-toggle:hover { background: rgba(var(--ink-rgb),0.04); color: var(--text-secondary); }
.intcard-entities-toggle .ent-caret {
  margin-left: auto;
  transition: transform var(--duration-fast);
  color: var(--navy-mist);
}
.intcard-entities-toggle.open .ent-caret { transform: rotate(180deg); }

.intcard-entity-list { border-top: 1px solid rgba(var(--ink-rgb),0.05); }
.intcard-entity-list[hidden] { display: none; }

.intcard-entity-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 9px 20px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.04);
  font-size: 13px;
}
.intcard-entity-row:last-child { border-bottom: none; }
.entity-name  { color: var(--text-secondary); font-weight: 500; }
.entity-count { color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }
.entity-scan  { color: var(--navy-mist); font-size: 12px; min-width: 160px; text-align: right; }

.intcard-entity-platform {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-mist);
  border-bottom: 1px solid rgba(var(--ink-rgb),0.04);
  background: rgba(0,0,0,0.1);
}
.intcard-entity-platform .platform-tile {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  padding: 2px;
  font-size: 6px;
}

/* --- Integration detail header ------------------------------ */
.integration-header {
  background: var(--navy-mid);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-card);
  padding: 24px;
  margin-bottom: 18px;
}

.integration-header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.integration-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.integration-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.integration-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --- Stats -------------------------------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: rgba(var(--ink-rgb),0.03);
  border: 1px solid rgba(var(--ink-rgb),0.06);
  border-radius: var(--r-card);
  padding: 18px 20px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 7px;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* --- Tabs --------------------------------------------------- */
.tabs {
  display: flex;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.08);
  margin-bottom: 18px;
  gap: 0;
}

.tab {
  display: block;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.tab:hover  { color: var(--text-secondary); }
.tab.active { color: var(--text-primary); border-bottom-color: var(--orange); }

/* --- Section card ------------------------------------------- */
.section-card {
  background: var(--navy-mid);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-card);
  margin-bottom: 14px;
  overflow: hidden;
}

.section-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-card-body { padding: 4px 0; }

/* --- Entity rows -------------------------------------------- */
.entity-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.05);
  font-size: 13.5px;
}
.entity-row:last-child { border-bottom: none; }

.entity-name { color: var(--text-primary); font-weight: 500; }
.entity-map  { color: var(--text-muted); font-size: 12px; }
.entity-dir  { color: var(--navy-mist); font-size: 13px; }
.entity-count { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Filter bar --------------------------------------------- */
.filter-bar {
  background: var(--navy-mid);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-card);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-input {
  background: rgba(var(--ink-rgb),0.06);
  border: 1.5px solid rgba(var(--ink-rgb),0.12);
  border-radius: var(--r-control);
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  width: 240px;
  outline: none;
  transition: border-color var(--duration-fast);
}
.filter-input::placeholder { color: var(--text-muted); }
.filter-input:focus { border-color: var(--orange); }
.filter-input:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }

.filter-select {
  background: rgba(var(--ink-rgb),0.06);
  border: 1.5px solid rgba(var(--ink-rgb),0.12);
  border-radius: var(--r-control);
  padding: 7px 28px 7px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2386A2B1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  outline: none;
  cursor: pointer;
  transition: border-color var(--duration-fast);
}
.filter-select:focus { border-color: var(--orange); }


.time-filter-group {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  margin-left: auto;
}
.time-filter-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--r-control);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
  white-space: nowrap;
  font-family: inherit;
}
.time-filter-btn:hover { color: var(--text-secondary); background: rgba(var(--ink-rgb),0.05); }
.time-filter-btn.is-active {
  background: rgba(var(--orange-rgb),0.12);
  border-color: rgba(var(--orange-rgb),0.3);
  color: var(--orange);
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(var(--orange-rgb),0.12);
  border: 1px solid rgba(var(--orange-rgb),0.3);
  color: var(--orange);
  border-radius: var(--r-control);
  font-size: 12px;
  padding: 3px 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background var(--duration-fast);
}
.filter-chip:hover { background: rgba(var(--orange-rgb),0.22); }

/* ── RAG level indicator ─────────────────────────────────────── */
.rag {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
}
.rag.info     { background: var(--status-info);  box-shadow: 0 0 5px rgba(var(--status-info-rgb),var(--glow-alpha)); }
.rag.warning  { background: var(--status-warn);  box-shadow: 0 0 5px rgba(var(--status-warn-rgb),var(--glow-alpha)); }
.rag.error    { background: var(--status-error); box-shadow: 0 0 5px rgba(var(--status-error-rgb),var(--glow-alpha)); }

/* ── Multi-select filter ─────────────────────────────────────── */
.filter-multi { position: relative; }

.filter-multi-btn {
  background: rgba(var(--ink-rgb),0.06);
  border: 1.5px solid rgba(var(--ink-rgb),0.12);
  border-radius: var(--r-control);
  padding: 7px 28px 7px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2386A2B1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--duration-fast);
  outline: none;
}
.filter-multi-btn:focus,
.filter-multi.is-open .filter-multi-btn { border-color: var(--orange); }

.filter-multi-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--navy-mid);
  border: 1px solid rgba(var(--ink-rgb),0.12);
  border-radius: var(--r-card);
  min-width: 210px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  z-index: 200;
  padding: 6px 0;
  display: none;
}
.filter-multi.is-open .filter-multi-panel { display: block; }

.filter-multi-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background var(--duration-fast);
  user-select: none;
}
.filter-multi-option:hover { background: rgba(var(--ink-rgb),0.06); }
.filter-multi-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--orange);
  cursor: pointer;
  flex-shrink: 0;
}
.filter-multi-divider { height: 1px; background: rgba(var(--ink-rgb),0.07); margin: 4px 0; }
.filter-multi-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 14px 4px;
}

/* --- Log table ---------------------------------------------- */
.log-table-wrap {
  background: var(--navy-dark);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-card);
  overflow: hidden;
  margin-bottom: 12px;
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1160px;
  table-layout: fixed;
}

.log-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.08);
  white-space: nowrap;
}

.log-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.04);
  color: var(--text-secondary);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-row { cursor: pointer; }
.log-row:hover td { background: rgba(var(--ink-rgb),0.025); }
.log-row.is-expanded td { background: rgba(var(--ink-rgb),0.035); border-bottom-color: transparent; }
.log-row.log-filtered { display: none; }

.log-row-expand { display: none; }
.log-row-expand.is-open { display: table-row; }
.log-row-expand.log-filtered { display: none !important; }
.log-row-expand > td {
  padding: 0;
  overflow: visible;
  white-space: normal;
  border-bottom: 2px solid rgba(var(--orange-rgb),0.15);
  vertical-align: top;
}

.log-ts {
  font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.log-mono {
  font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
}
/* the ids under an Account activity entry (the monospace look of the user log's key columns) */
.activity-ids { margin-top: 3px; word-break: break-all; }
.log-rag-cell  { text-align: center; padding: 10px 4px !important; }
.log-explain-cell { text-align: center; padding: 6px 8px !important; }
.log-msg       { color: var(--text-secondary); }
.log-empty-row td { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px; }


/* Expanded detail panel */
.log-detail { padding: 20px 24px 24px; background: rgba(0,0,0,0.18); }

.log-detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  row-gap: 10px;
  column-gap: 20px;
  font-size: 13px;
  margin-bottom: 20px;
  align-items: start;
}
.log-detail-label {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding-top: 3px;
}
.log-detail-value { color: var(--text-secondary); }
.log-detail-value.mono { font-family: 'SF Mono', 'JetBrains Mono', monospace; font-size: 12px; }
.log-detail-value.rag-row { display: flex; align-items: center; gap: 8px; }

.log-detail-pre {
  background: rgba(0,0,0,0.32);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-control);
  padding: 14px 16px;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  line-height: 1.65;
  max-height: 300px;
  overflow-y: auto;
}

.log-detail-actions { display: flex; gap: 10px; }


.explain-panel {
  margin-top: 16px;
  background: rgba(var(--orange-rgb),0.05);
  border: 1px solid rgba(var(--orange-rgb),0.18);
  border-radius: var(--r-card);
  padding: 16px 20px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.explain-panel[hidden] { display: none; }
.explain-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--orange);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.markdown-text p,
.markdown-text ul,
.markdown-text ol { margin: 0 0 10px; }
.markdown-text > :last-child { margin-bottom: 0; }
.markdown-text ul,
.markdown-text ol { padding-left: 22px; }
.markdown-text li { margin: 3px 0; }
.markdown-text strong { color: var(--text-primary); }
.markdown-text code {
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: rgba(var(--ink-rgb),0.07);
  border-radius: 4px;
  padding: 1px 5px;
}
.markdown-text h4,
.markdown-text h5,
.markdown-text h6 {
  margin: 14px 0 6px;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.35;
}
.markdown-text h4 { font-size: 1.05em; }
.markdown-text h5 { font-size: 1em; }
.markdown-text h6 { font-size: 0.95em; }
.markdown-text > h4:first-child,
.markdown-text > h5:first-child,
.markdown-text > h6:first-child { margin-top: 0; }
.markdown-text li > ul,
.markdown-text li > ol { margin: 3px 0 0; }
.markdown-text pre {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: rgba(var(--ink-rgb),0.07);
  border-radius: 6px;
  overflow-x: auto;
}
.markdown-text pre code {
  background: none;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
}
.markdown-text a { color: var(--orange); text-decoration: underline; }
.explain-thinking { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12.5px; }
.explain-dots { display: inline-flex; gap: 4px; }
.explain-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.explain-dots span:nth-child(2) { animation-delay: 0.2s; }
.explain-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40%           { opacity: 1;   transform: scale(1); }
}

/* --- Pagination --------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--navy-mid);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-card);
  font-size: 12.5px;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-info { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.pagination-controls { display: flex; align-items: center; gap: 8px; }

.pagination-page { font-size: 12px; color: var(--text-muted); padding: 0 6px; }

.per-page-select {
  background: rgba(var(--ink-rgb),0.06);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: var(--r-control);
  padding: 5px 24px 5px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2386A2B1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

/* --- Engineering floating button ---------------------------- */
.sidebar-eng {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
}

/* Fixed bright green (var(--eng-accent)/--eng-accent-rgb), not var(--status-ok) - this chip's
   background is always dark (like the sidebar), so it needs the same always-light-toned accent
   regardless of theme; the light theme's status-ok (#137A5A) is tuned for a light background
   and would be low-contrast here. */
.eng-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(var(--sidebar-rgb),0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--eng-accent-rgb),0.35);
  border-radius: 20px;
  padding: 8px 14px 8px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--eng-accent);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.eng-btn:hover {
  background: rgba(var(--eng-accent-rgb),0.1);
  border-color: rgba(var(--eng-accent-rgb),0.55);
  box-shadow: 0 4px 20px rgba(var(--eng-accent-rgb),0.15);
}
.eng-btn-icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.8; }

/* --- Sitemap modal ------------------------------------------ */
.sitemap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sitemap-overlay[hidden] { display: none; }

.sitemap-modal {
  background: var(--navy-dark);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: var(--r-card);
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.sitemap-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
  position: sticky;
  top: 0;
  background: var(--navy-dark);
}

.sitemap-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.sitemap-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--status-ok);
  background: rgba(var(--status-ok-rgb),0.1);
  border: 1px solid rgba(var(--status-ok-rgb),0.25);
  border-radius: 4px;
  padding: 2px 7px;
}

.sitemap-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  font-family: inherit;
}
.sitemap-close:hover { background: rgba(var(--ink-rgb),0.07); color: var(--text-secondary); }

.sitemap-section { padding: 14px 0 4px; }
.sitemap-section + .sitemap-section { border-top: 1px solid rgba(var(--ink-rgb),0.06); }

.sitemap-section-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 20px 8px;
}

.sitemap-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  text-decoration: none;
  transition: background var(--duration-fast);
}
.sitemap-link:hover { background: rgba(var(--ink-rgb),0.04); }
.sitemap-link:last-child { margin-bottom: 10px; }

.sitemap-link-name {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.sitemap-link:hover .sitemap-link-name { color: var(--text-primary); }

.sitemap-link-path {
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Auth pages --------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--navy-dark);
  border: 1px solid rgba(var(--ink-rgb),0.08);
  border-radius: var(--r-card);
  padding: 40px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.auth-brand-logo  { width: 30px; height: 30px; }
.auth-brand-name  { font-size: 15px; font-weight: 700; color: var(--text-primary); }

.auth-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.auth-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 28px;
  line-height: 1.5;
}

.invite-banner {
  background: rgba(var(--orange-rgb),0.07);
  border: 1px solid rgba(var(--orange-rgb),0.2);
  border-radius: var(--r-control);
  padding: 12px 14px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.invite-banner svg { flex-shrink: 0; margin-top: 2px; color: var(--orange); }
.invite-banner strong { color: var(--text-primary); }

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--navy-mid);
  border: 1px solid rgba(var(--ink-rgb),0.12);
  border-radius: var(--r-control);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-fast), border-color var(--duration-fast);
  font-family: inherit;
  box-sizing: border-box;
}
.social-btn:hover { background: var(--navy-light); border-color: rgba(var(--ink-rgb),0.2); }
.social-btn + .social-btn { margin-top: 10px; }
.social-btn-icon { width: 18px; height: 18px; flex-shrink: 0; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(var(--ink-rgb),0.08); }

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.form-label-row .form-label { margin-bottom: 0; }

.auth-input {
  width: 100%;
  background: var(--navy-deepest);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: var(--r-control);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color var(--duration-fast);
}
.auth-input::placeholder { color: var(--text-muted); }
.auth-input:focus { border-color: var(--orange); }
.auth-input:focus-visible { outline: none; }
.auth-input[disabled] { opacity: 0.4; cursor: not-allowed; }

.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 42px; }

.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  line-height: 1;
}
.pw-toggle:hover { color: var(--text-primary); }

.auth-select {
  width: 100%;
  background: var(--navy-deepest);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: var(--r-control);
  padding: 9px 32px 9px 12px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2386A2B1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color var(--duration-fast);
}
.auth-select:focus { border-color: var(--orange); }
.auth-select option { background: var(--navy-mid); }

.forgot-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.forgot-link:hover { color: var(--orange); text-decoration: underline; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-submit { width: 100%; margin-top: 20px; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-footer a { color: var(--orange); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.auth-footer-sep { margin: 0 8px; opacity: 0.35; }

.auth-success {
  background: rgba(var(--status-ok-rgb),0.06);
  border: 1px solid rgba(var(--status-ok-rgb),0.18);
  border-radius: var(--r-card);
  padding: 32px 20px;
  text-align: center;
}
.auth-success-icon {
  width: 46px;
  height: 46px;
  background: rgba(var(--status-ok-rgb),0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--status-ok);
}
.auth-success-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.auth-success-text  { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }

/* --- Misc --------------------------------------------------- */
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 12px; }
.text-dim   { color: var(--text-muted); opacity: 0.5; }
.entity-meta { margin-left: auto; font-size: 12px; color: var(--text-muted); }

/* --- Onboarding / self-service wizard ----------------------- */

/* Shared funnel shell — no sidebar, distraction-free */
.funnel-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy-deepest);
}
:root[data-theme="dark"] .funnel-page {
  background-image: radial-gradient(ellipse at 50% 0%, rgba(49,64,104,0.55) 0%, transparent 60%);
}

.funnel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.06);
  flex-shrink: 0;
}

.funnel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.funnel-brand img { width: 26px; height: 26px; }

/* Step progress indicator */
.funnel-progress {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 12px;
}

.funnel-step {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px;
  color: var(--navy-mist);
}
.funnel-step.is-done  { color: var(--status-ok); }
.funnel-step.is-active { color: var(--text-primary); font-weight: 500; }

.funnel-step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  background: var(--navy-mid);
  flex-shrink: 0;
}
.funnel-step.is-done .funnel-step-dot {
  background: rgba(var(--status-ok-rgb),0.15);
  color: var(--status-ok);
}
.funnel-step.is-active .funnel-step-dot {
  background: var(--orange);
  color: #fff;
}

.funnel-connector {
  width: 28px; height: 1px;
  background: var(--navy-mid);
  margin: 0 4px;
}

.funnel-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px 80px;
}

.funnel-card {
  width: 100%;
  max-width: 520px;
  background: var(--navy-dark);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-card);
  padding: 36px 40px;
}

.funnel-card-wide { max-width: 640px; }

.funnel-platform-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.06);
}

.funnel-platform-tile {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--navy-mid);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.funnel-platform-tile img { width: 28px; height: 28px; object-fit: contain; }

.funnel-platform-name  { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.funnel-platform-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.funnel-heading { font-size: 19px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.funnel-sub { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 28px; }


.funnel-privacy {
  text-align: center;
  font-size: 11px;
  color: var(--navy-mist);
  margin-top: 18px;
}
.funnel-privacy a { color: var(--text-muted); text-decoration: underline; }

/* Manifest form */
.funnel-field { margin-bottom: 20px; }
.funnel-label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.funnel-label .req { color: var(--orange); margin-left: 2px; }

.funnel-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(var(--ink-rgb),0.06);
  border: 1px solid rgba(var(--ink-rgb),0.10);
  border-radius: var(--r-control);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color var(--duration-fast);
}
.funnel-input:focus { outline: none; border-color: var(--orange); }
.funnel-input::placeholder { color: var(--navy-mist); }

.funnel-field-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }

.funnel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(var(--ink-rgb),0.06);
}

/* Instance picker */
.instance-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }

.instance-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(var(--ink-rgb),0.03);
  border: 1px solid rgba(var(--ink-rgb),0.08);
  border-radius: var(--r-control);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.instance-item:hover { border-color: rgba(var(--orange-rgb),0.35); background: rgba(var(--orange-rgb),0.05); }
.instance-item.is-selected { border-color: var(--orange); background: rgba(var(--orange-rgb),0.10); }

.instance-radio {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid var(--navy-mist);
  flex-shrink: 0;
  transition: border-color var(--duration-fast), background var(--duration-fast);
  display: flex; align-items: center; justify-content: center;
}
.instance-item.is-selected .instance-radio {
  border-color: var(--orange);
  background: var(--orange);
  box-shadow: inset 0 0 0 3px var(--navy-dark);
}

.instance-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.instance-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Plan summary */
.plan-summary {
  background: rgba(var(--ink-rgb),0.03);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-control);
  overflow: hidden;
  margin-bottom: 24px;
}

.plan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(var(--ink-rgb),0.05);
}
.plan-row:last-child { border-bottom: none; }
.plan-row.plan-tax { color: var(--text-muted); font-size: 12px; }
.plan-row.plan-total {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  padding: 16px;
}

.stripe-field-wrap {
  background: rgba(var(--ink-rgb),0.06);
  border: 1px solid rgba(var(--ink-rgb),0.10);
  border-radius: var(--r-control);
  padding: 11px 12px;
  color: var(--navy-mist);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

/* Stripe mounts its own `.StripeElement` div directly as this flex container's child, and that
   div has no intrinsic content size of its own (it's just a shell around Stripe's iframe) - as a
   flex item with the default min-width: auto, it collapses to ~1px with nothing else to size it
   by, and Stripe's JS only reads that width once around mount (a CSS fix applied after mount
   doesn't make it re-measure), so the card fields render completely invisible. */
.stripe-field-wrap .StripeElement { width: 100%; }

/* Confirmation */
.confirm-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(var(--status-ok-rgb),0.12);
  border: 1px solid rgba(var(--status-ok-rgb),0.25);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}

/* Dynamic content label — used in mockups to mark programmatic content */
.dynamic-note {
  display: inline-block;
  font-size: 10px;
  font-style: italic;
  color: var(--navy-mist);
  background: rgba(var(--ink-rgb),0.04);
  border-radius: 3px;
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Landing / integration preview page */
.landing-page {
  min-height: 100vh;
  background: var(--navy-deepest);
}
:root[data-theme="dark"] .landing-page {
  background-image: radial-gradient(ellipse at 50% 0%, rgba(49,64,104,0.55) 0%, transparent 60%);
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.06);
}

.landing-hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 64px 32px 48px;
  text-align: center;
}

.landing-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 36px;
}

.landing-platform {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.landing-platform-tile {
  width: 80px; height: 80px;
  border-radius: var(--r-tile);
  background: var(--navy-mid);
  display: flex; align-items: center; justify-content: center;
}
.landing-platform-tile img { width: 54px; height: 54px; object-fit: contain; }

.landing-platform-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.landing-sync-icon {
  color: var(--orange);
  font-size: 22px;
  padding-top: 18px;
}

.landing-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 14px;
}

.landing-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 580px;
  margin: 0 auto 36px;
}

.landing-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 60px;
}

.landing-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.landing-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.entity-block {
  background: var(--navy-dark);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--r-card);
  margin-bottom: 10px;
  overflow: hidden;
}

.entity-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 20px;
}

.entity-side {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.entity-side img { width: 18px; height: 18px; object-fit: contain; }

.entity-arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  color: var(--orange);
  font-size: 11px;
}
.entity-arrows .dim { color: var(--navy-mist); }

.entity-body {
  border-top: 1px solid rgba(var(--ink-rgb),0.05);
}

.sync-rule-row {
  display: grid;
  grid-template-columns: 1fr 36px 120px 36px 1fr;
  align-items: center;
  gap: 4px;
  padding: 9px 20px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.04);
  font-size: 12px;
}
.sync-rule-row:last-child { border-bottom: none; }

.sync-field {
  background: rgba(var(--ink-rgb),0.05);
  border-radius: 4px;
  padding: 5px 9px;
  color: var(--text-secondary);
}

.sync-fn {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(var(--ink-rgb),0.03);
  border-radius: 4px;
  padding: 5px 6px;
}

.sync-arrow-cell {
  text-align: center;
  color: var(--orange);
  font-size: 13px;
}
.sync-arrow-cell.dim { color: var(--navy-mist); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
