/* campaign-canvas.css — it-26.1 additions over the shared .cnr-* dark canvas (conditional-routing.css).
   Only the campaign-specific bits live here: per-kind node accent colours, the failure-policy chip, a
   disabled palette item, and the palette group labels. Everything structural (canvas, palette, node
   cards, edges, pan/zoom, dialogs) is reused from conditional-routing.css. */

.cnr-editor, .mig-surface {
  --cmp-wait: var(--cnr-start);   /* blue — timing */
  --cmp-cond: var(--cnr-cond);    /* purple — the brancher */
  --cmp-set: var(--cnr-amber);    /* amber — set fields */
  --cmp-assign: #2bb6b0;          /* teal — assign */
  --cmp-hook: #8891a6;            /* slate — webhook */
  --cmp-send: var(--cnr-rule);    /* green — send */
}

/* per-kind accent bar + icon tint (mirrors .cnr-node--cond/--rule) */
.cnr-node--wait   .cnr-node__accent { background: var(--cmp-wait); }
.cnr-node--wait   .cnr-node__ic { color: var(--cmp-wait);   background: color-mix(in srgb, var(--cmp-wait) 18%, transparent); }
.cnr-node--set    .cnr-node__accent { background: var(--cmp-set); }
.cnr-node--set    .cnr-node__ic { color: var(--cmp-set);    background: color-mix(in srgb, var(--cmp-set) 18%, transparent); }
.cnr-node--assign .cnr-node__accent { background: var(--cmp-assign); }
.cnr-node--assign .cnr-node__ic { color: var(--cmp-assign); background: color-mix(in srgb, var(--cmp-assign) 18%, transparent); }
.cnr-node--hook   .cnr-node__accent { background: var(--cmp-hook); }
.cnr-node--hook   .cnr-node__ic { color: var(--cmp-hook);   background: color-mix(in srgb, var(--cmp-hook) 18%, transparent); }
.cnr-node--send   .cnr-node__accent { background: var(--cmp-send); }
.cnr-node--send   .cnr-node__ic { color: var(--cmp-send);   background: color-mix(in srgb, var(--cmp-send) 18%, transparent); }

/* palette icon tints per campaign kind */
.cnr-ic--wait   { color: var(--cmp-wait); }
.cnr-ic--set    { color: var(--cmp-set); }
.cnr-ic--assign { color: var(--cmp-assign); }
.cnr-ic--hook   { color: var(--cmp-hook); }
.cnr-ic--send   { color: var(--cmp-send); }

/* palette group label + a disabled (not-yet-available) item */
.cnr-palette__group-label {
  font-size: .64rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--cnr-eyebrow); margin: .9rem 0 .1rem .2rem;
}
.cnr-palette__group-label:first-child { margin-top: 0; }
.cnr-palette__item--off { opacity: .5; cursor: not-allowed; }
.cnr-palette__item--off:hover { border-color: var(--cnr-border); background: var(--cnr-panel); }
.cnr-palette__lock { margin-left: auto; font-size: 1rem; color: var(--cnr-muted); align-self: center; }

/* failure-policy chip on an action node */
.cmp-failchip {
  display: inline-flex; align-items: center; gap: .25rem; margin-top: .5rem;
  font-size: .68rem; font-weight: 600; padding: .12rem .45rem; border-radius: 6px;
  color: #e9c07a; background: color-mix(in srgb, var(--cnr-amber) 14%, transparent);
}

/* the START card doubles as the eligibility trigger — clickable */
.cnr-node--start.cmp-trigger { cursor: pointer; }
.cnr-node--start.cmp-trigger:hover { border-color: var(--cnr-start); }


/* failure-policy radio group in the config dialog */
.cmp-fp { display: flex; flex-direction: column; gap: .4rem; }
.cmp-fp__opt {
  display: flex; gap: .55rem; align-items: flex-start; padding: .55rem .65rem;
  border: 1px solid var(--md-sys-color-outline-variant); border-radius: 10px; cursor: pointer;
}
.cmp-fp__opt.is-on { border-color: var(--md-sys-color-primary); background: color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent); }
.cmp-fp__opt b { font-size: .84rem; }
.cmp-fp__opt span { font-size: .74rem; color: var(--md-sys-color-on-surface-variant); }
.cmp-fp__badge { margin-left: .35rem; font-size: .6rem; font-weight: 700; color: var(--cnr-rule); letter-spacing: .04em; }

/* ============ P4 docked-drawer layout (the wireframe's persistent right panel) ============ */

/* header enrollment counts */
.cmp-stats { display: flex; align-items: center; gap: 1.4rem; margin-right: .4rem; }
.cmp-stat { display: flex; flex-direction: column; text-align: right; line-height: 1.1; }
.cmp-stat b { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cnr-text); }
.cmp-stat span { font-size: .58rem; letter-spacing: .07em; text-transform: uppercase; color: var(--cnr-eyebrow); }

/* the work row: dark canvas (flex) + light drawer (fixed) */
.cmp-work { flex: 1; display: flex; min-height: 0; }

/* selected-node highlight on the canvas — a pulsing purple glow so the in-focus node reads at a glance
   (mirrors the amber rejoin-target pulse). Reduced-motion holds a steady ring. */
.cnr-node.is-selected { animation: cmp-focus-pulse 1.4s ease-in-out infinite; }
.cnr-node--start.cmp-trigger.is-selected { animation: none; box-shadow: 0 0 0 2px var(--cnr-start); }
@media (prefers-reduced-motion: reduce) {
  .cnr-node.is-selected { animation: none; box-shadow: 0 0 0 2px var(--cnr-cond), 0 10px 26px -12px rgba(0,0,0,.7); }
}
@keyframes cmp-focus-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--cnr-cond), 0 0 5px 0 color-mix(in srgb, var(--cnr-cond) 30%, transparent), 0 10px 26px -12px rgba(0,0,0,.7); }
  50%      { box-shadow: 0 0 0 2px var(--cnr-cond), 0 0 18px 4px color-mix(in srgb, var(--cnr-cond) 70%, transparent), 0 10px 26px -12px rgba(0,0,0,.7); }
}

/* it-26.9: while placing a `goto`, the steps you may rejoin pulse-glow so the eligible set reads at a
   glance. Gold, not the canvas's purple accent — it has to POP against a busy dark canvas where purple
   blends in. The animation is the whole affordance; a static ring is easy to miss. */
.cnr-node.is-eligible { cursor: pointer; animation: cmp-rejoin-pulse 1.25s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  /* no pulsing for motion-sensitive users — hold a steady ring instead */
  .cnr-node.is-eligible { animation: none; box-shadow: 0 0 0 2px var(--cnr-amber), 0 0 12px 1px color-mix(in srgb, var(--cnr-amber) 55%, transparent); }
}
@keyframes cmp-rejoin-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--cnr-amber), 0 0 4px 0 color-mix(in srgb, var(--cnr-amber) 35%, transparent); }
  50%      { box-shadow: 0 0 0 2px var(--cnr-amber), 0 0 18px 4px color-mix(in srgb, var(--cnr-amber) 75%, transparent); }
}

/* ---- Save button: blocked-state alert affordance + error popover (it-26.9 UX) ----
   The inline "why can't I save" sentence was cluttery and easy to miss; the state now rides the button
   itself (an alert badge + a soft amber ring) and the detail is a clickable checklist popover. */
.cmp-save-wrap { position: relative; display: inline-flex; }
.cnr-save.is-blocked {
  /* the affordance: a warning ring so a disabled Save reads as "needs attention", not merely "off" */
  box-shadow: 0 0 0 2px var(--cnr-amber), 0 0 10px -1px color-mix(in srgb, var(--cnr-amber) 60%, transparent);
}
.cnr-save { position: relative; } /* anchor for the badge */
.cmp-save-alert {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px; background: var(--cnr-amber); color: #201600;
  font-size: .7rem; font-weight: 800; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
/* the popover: opens below-right of Save, red accent bar, then the clickable checklist */
.cmp-save-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: max-content; max-width: 320px; text-align: left;
  background: var(--md-sys-color-surface, #fff); color: var(--md-sys-color-on-surface, #1d1b20);
  border: 1px solid var(--md-sys-color-outline-variant, #d7d3dc);
  border-left: 3px solid var(--md-sys-color-error);
  border-radius: var(--r-md, 12px); box-shadow: var(--elev-2); padding: .65rem .75rem;
  font-size: .78rem; line-height: 1.45;
}
.cmp-problem-head {
  display: flex; align-items: center; gap: .35rem; margin-bottom: .4rem;
  color: var(--md-sys-color-error); font-weight: 700;
}
.cmp-problem-head .material-symbols-rounded { font-size: 1rem; }
.cmp-problem-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .15rem; }
/* each line is a clickable button that focuses the offending step */
.cmp-problem-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .3rem .4rem; border: 0; border-radius: var(--r-sm, 8px);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.cmp-problem-item:hover, .cmp-problem-item:focus-visible {
  background: color-mix(in srgb, var(--md-sys-color-error) 12%, transparent); outline: none;
}
.cmp-problem-item__go { font-size: 1rem; opacity: 0; color: var(--md-sys-color-error); flex: none; }
.cmp-problem-item:hover .cmp-problem-item__go, .cmp-problem-item:focus-visible .cmp-problem-item__go { opacity: .8; }

/* ---- the docked light drawer ---- */
.cmp-drawer {
  width: 760px; max-width: 60vw; flex: none; background: #fff; color: #1a1a22;
  border-left: 1px solid var(--cnr-border); display: flex; flex-direction: column; overflow: hidden;
}
[x-cloak] { display: none !important; }
:root[data-theme="dark"] .cmp-drawer { /* the drawer stays light by design (house dialogs are light) */ }


.cmp-drawer__panel { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cmp-drawer__head {
  display: flex; align-items: flex-start; gap: .7rem; padding: 1rem 1.05rem .85rem;
  border-bottom: 1px solid #ececf0;
}
.cmp-drawer__ic {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
}
.cmp-drawer__ic .material-symbols-rounded { font-size: 1.15rem; }
.cmp-drawer__kind { font-size: .6rem; letter-spacing: .07em; text-transform: uppercase; color: #8a8a95; }
.cmp-drawer__title { font-size: 1.02rem; font-weight: 700; line-height: 1.2; margin-top: .1rem; }
.cmp-drawer__x {
  margin-left: auto; width: 30px; height: 30px; border-radius: 7px; color: #8a8a95; flex: none;
  display: grid; place-items: center; border: none; background: none; cursor: pointer;
}
.cmp-drawer__x:hover { background: #f2f2f5; }
.cmp-drawer__x:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: -2px; }
.cmp-drawer__body { flex: 1; overflow-y: auto; padding: 1rem 1.05rem 1.4rem; display: flex; flex-direction: column; gap: 1.05rem; }

.cmp-fld { display: flex; flex-direction: column; gap: .45rem; }
.cmp-fld__l { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6b6b78; }
/* Divider + spacing between two distinct concerns in one drawer panel (e.g. the routing rule and its
   fallback assignments). Section titles themselves use the house `.card__title`. */
.cmp-sec { border-top: 1px solid #ececf0; margin-top: 1.1rem; padding-top: 1rem; }
/* it-49.4 — a config section's header is a click-to-collapse toggle carrying a status glyph (green ✓ =
   set, amber ⚠ = needs attention) + a chevron. The body sits in .cmp-sec-body and is x-show-hidden when
   collapsed (kept mounted, so inner md-switch/md-select keep their x-init state — no it-38 remount). */
.cmp-sec-hd { display: flex; align-items: center; justify-content: space-between; gap: .5rem; cursor: pointer; user-select: none; }
.cmp-sec-hd:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; border-radius: 4px; }
.cmp-sec-hd__r { display: inline-flex; align-items: center; gap: .35rem; }
.cmp-sec-ico { font-size: 26px; font-variation-settings: 'wght' 600; }
.cmp-sec-ico--ok { color: #1a7f37; }
.cmp-sec-ico--warn { color: var(--cnr-amber, #d9a24a); }
.cmp-sec-chev { font-size: 20px; color: #9a9aa6; transition: transform .15s ease; }
.cmp-sec-chev.is-open { transform: rotate(180deg); }
.cmp-sec-body { display: flex; flex-direction: column; gap: .45rem; margin-top: .55rem; }
/* it-49.4 — the config node's rollup glyph, pinned top-right of the Enrollment & configuration card. */
.cnr-node__status { position: absolute; top: 12px; right: 12px; font-size: 20px; line-height: 1; font-variation-settings: 'wght' 600; }
.cnr-node__status.is-ok { color: #1a7f37; }
.cnr-node__status.is-warn { color: var(--cnr-amber, #d9a24a); }
.cmp-note {
  font-size: .82rem; line-height: 1.4; color: #43434e; background: #f6f6f9;
  border: 1px solid #ececf0; border-radius: 9px; padding: .6rem .7rem;
}
.cmp-note b { color: #1a1a22; }
.cmp-and { color: #8a8a95; font-weight: 600; }
.cmp-hint { font-size: .72rem; color: #6b6b78; line-height: 1.4; margin-top: .15rem; }

/* it-48: the step's image. Deliberately the same visual language as the SMS chat box's staged
   attachment (.sms-preview) — a 64px rounded thumb with a corner remove — because it is the same
   product idea (an image staged to send) and a second dialect for it would be noise. */

/* The drop target is the whole block; the dashed border belongs to the EMPTY state, where it is the
   affordance. Once an image is there the image IS the affordance, so the dashes come off. */
.cmp-drop { border-radius: var(--radius-sm, 8px); transition: background .12s; margin-top: .1rem; }
.cmp-drop--over { background: #f4f1fb; box-shadow: inset 0 0 0 2px var(--md-sys-color-primary, #6750a4); }

/* Centered: the empty state is a target, and a target that hugs the left edge of a full-width dashed
   box reads as a stray label rather than something to aim at. */
.cmp-drop__cta {
  display: flex; align-items: center; justify-content: center; gap: .6rem; cursor: pointer;
  border: 1px dashed #c9c9d4; border-radius: var(--radius-sm, 8px);
  padding: .75rem; transition: border-color .12s, background .12s; text-align: center;
}
.cmp-drop__cta:hover { border-color: var(--md-sys-color-primary, #6750a4); background: #faf9fe; }
.cmp-drop__cta .material-symbols-rounded { color: var(--md-sys-color-primary, #6750a4); font-size: 1.4rem; }
.cmp-drop__text { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.cmp-drop__text strong { font-size: .82rem; color: var(--md-sys-color-primary, #6750a4); font-weight: 600; }
.cmp-drop__text small { font-size: .7rem; color: #6b6b78; }

.cmp-media { display: flex; align-items: center; gap: .7rem; }
.cmp-media__thumb {
  position: relative; width: 64px; height: 64px; flex: none;
  border-radius: var(--radius-sm, 8px); overflow: hidden; background: #f3f3f6;
  /* An edge, so a white or light image still reads as a thumbnail rather than an empty slot. */
  border: 1px solid #e6e6ee;
}
.cmp-media__img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Same corner-affordance as .sms-preview__rm, so removing an image feels identical in both places. */
.cmp-media__rm {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; padding: 0;
}
.cmp-media__rm .material-symbols-rounded { font-size: .9rem; }
.cmp-media__meta { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; min-width: 0; }
/* A status, not a warning: muted rather than the error red, because "not saved yet" is the normal state
   of everything else in this drawer too. */
.cmp-media__state {
  font-size: .68rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  color: #6b6b78; background: #f0f0f4; border-radius: 999px; padding: .12rem .5rem;
}
.cmp-media__note { font-size: .72rem; color: #6b6b78; line-height: 1.35; }
.cmp-media__img { cursor: zoom-in; }

/* Full-size view. No panel chrome — the image IS the content, so a dialog header would only shrink it.
   Sized to the viewport rather than the image so a large photo never pushes the page (Aldo: no
   scrollbars); `contain` keeps the aspect honest, which matters when the point is checking the picture. */
.cmp-media__full { position: relative; max-width: min(92vw, 1100px); max-height: 88vh; }
.cmp-media__full img {
  display: block; max-width: 100%; max-height: 88vh; object-fit: contain;
  border-radius: var(--radius-sm, 8px); background: #fff;
}
.cmp-media__fullrm {
  position: absolute; top: -.6rem; right: -.6rem; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; padding: 0;
}
/* the drawer's Edit condition/filter buttons use the house .btn .btn--tonal — right-aligned, with
   breathing room above the condition read view. */
/* the collapsible section body (it-49.4) reparents these buttons out of .cmp-fld, so match both */
.cmp-fld > .btn, .cmp-sec-body > .btn { align-self: flex-end; margin-top: .9rem; }
.cmp-toggle { display: flex; align-items: center; gap: .6rem; }
.cmp-toggle > span { display: flex; flex-direction: column; }
.cmp-toggle b { font-size: .85rem; }

/* one field-assignment per row: field | value | only-when-blank | delete */
.cmp-assign-row {
  display: grid; grid-template-columns: 1.3fr 1.5fr auto auto; gap: .6rem; align-items: center;
  padding: .55rem .6rem; border: 1px solid #ececf0; border-radius: 10px;
}
.cmp-assign-row > md-outlined-select, .cmp-assign-row > div, .cmp-assign-row md-outlined-text-field { width: 100%; min-width: 0; }
.cmp-owb { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
/* A standalone checkbox row in a drawer panel (it-26.5's opt-out toggle). Same anatomy as .cmp-owb,
   which is deliberately nowrap because it is an inline cell in the set_field_values row-table; a
   full-width row wants its label to wrap instead. */
.cmp-check { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: #43434e; }

/* the drawer is light even in the app's dark surfaces — pin MD control text colors */
.cmp-drawer { --md-sys-color-on-surface: #1a1a22; --md-sys-color-on-surface-variant: #5a5a66; }

/* condition read view (drawer) — one resolved condition per row on a simple light, rounded surface
   (no border), with AND/OR divider pills between rows so the boolean structure is followable. */
.cmp-cond-read { display: flex; flex-direction: column; }
.cmp-cond-item {
  padding: .5rem .65rem; background: #f4f4f7; border-radius: 10px;
  font-size: .84rem; line-height: 1.5; color: #1a1a22;
}
.cmp-cond-item b { font-weight: 700; }
.cmp-cond-op { color: #8a8a95; margin: 0 .28rem; }
/* plain value: bold. A tag value reuses the house .chip .chip--tag (chips.css) with inline colours. */
.cmp-cond-val { font-weight: 650; }
/* a secondary suffix (e.g. a tag's added/expiry date window) — muted, lighter */
.cmp-cond-muted { color: #8a8a95; font-weight: 500; font-size: .8rem; }
/* AND / OR divider between rows: a short rule with a centred pill */
.cmp-cond-sep { display: flex; align-items: center; gap: .5rem; padding: .3rem 0 .3rem .4rem; }
.cmp-cond-sep::after { content: ""; flex: 1; height: 1px; background: #e6e6ec; }
.cmp-cond-sep span {
  font-size: .58rem; font-weight: 800; letter-spacing: .08em; padding: .1rem .4rem; border-radius: 999px;
}
.cmp-cond-sep .is-and { color: #5b45c9; background: color-mix(in srgb, var(--cmp-cond) 12%, transparent); }
.cmp-cond-sep .is-or { color: #6b6b78; background: #eeeef3; }

/* "open in a new tab" link (e.g. view the selected webhook) */
.cmp-openlink {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .3rem;
  font-size: .8rem; font-weight: 600; color: var(--cmp-cond); text-decoration: none;
}
.cmp-openlink:hover { text-decoration: underline; }
.cmp-openlink .material-symbols-rounded { font-size: 1rem; }

/* ── it-47.1 sender leaf: the picked number/person shown as a detail card (not a flat list of every
   number). Same light drawer palette as .cmp-cond-item. ── */
.snr-pick-card {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .8rem .85rem; background: #f4f4f7; border-radius: 12px;
}
.snr-pick-card--warn { background: color-mix(in srgb, var(--cnr-amber, #d9a24a) 14%, #f4f4f7); }
.snr-pick-card__ic { font-size: 1.35rem; color: #5a5a66; line-height: 1.4; }
.snr-pick-card__body { flex: 1; min-width: 0; }
.snr-pick-card__label { font-weight: 700; font-size: 1.05rem; color: #1a1a22; }
.snr-pick-card__sub { font-size: .82rem; color: #5a5a66; margin-top: .1rem; }
.snr-pick-card__meta { display: flex; align-items: center; gap: .45rem; margin-top: .45rem; flex-wrap: wrap; }
.snr-pick-card__warn {
  display: flex; align-items: center; gap: .35rem; margin-top: .5rem; font-size: .8rem; color: #9a6a1e;
}
.snr-pick-card__warn .material-symbols-rounded { font-size: 1rem; }

/* it-47.1 / it-49.1 — the head-node config's "used by" campaign list (drawer). */
.snr-usage { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.snr-usage__item {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .65rem; background: #f4f4f7; border-radius: 10px;
  color: #1a1a22; text-decoration: none; font-size: .84rem;
}
.snr-usage__item:hover { background: #ececf0; }
.snr-usage__name { flex: 1; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snr-usage__ext { font-size: 14px; color: #8a8a95; }

/* ── it-26.12 webhook step: the read-only metadata card + shared-reference banner. Same anatomy as the
   it-47 sender rulecard — a shared def the campaign references live, shown but not edited here. ── */
.cmp-fld__lrow { display: flex; align-items: center; gap: .6rem; }
.cmp-link { color: var(--cmp-cond); font-weight: 600; }

.cmp-whcard { border: 1px solid var(--cnr-border, #e0e0e8); border-radius: 11px; overflow: hidden; background: #fff; margin-top: .55rem; }
.cmp-whcard.is-disabled { border-color: color-mix(in srgb, var(--cnr-amber, #d9a24a) 55%, #e0e0e8); }
.cmp-whcard__top { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid #ececf0; }
.cmp-whcard__top .cnr-ic--hook { font-size: 1.15rem; }
.cmp-whcard__name { font-weight: 700; font-size: .9rem; }
.cmp-whcard__acts { margin-left: auto; display: flex; align-items: center; gap: .2rem; }
.cmp-iconbtn { width: 30px; height: 30px; border-radius: 7px; border: none; background: transparent;
  color: #6b6b78; display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.cmp-iconbtn:hover { background: #f4f4f7; color: #1a1a22; }
.cmp-iconbtn .material-symbols-rounded { font-size: 1.1rem; }

.cmp-chip { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 9999px;
  font-size: .72rem; font-weight: 650; border: 1px solid transparent; }
.cmp-chip--on { background: #e8f6ee; color: #1c6b3f; border-color: #cfeadb; }
.cmp-chip--off { background: #fbeede; color: #8a5a12; border-color: #f0d9b4; }

.cmp-whalert { display: flex; align-items: flex-start; gap: .5rem; margin: 0 .75rem .65rem; padding: .55rem .7rem;
  border-radius: 9px; font-size: .78rem; line-height: 1.45; color: #7a5410;
  background: color-mix(in srgb, var(--cnr-amber, #d9a24a) 16%, #fff); }
.cmp-whalert .material-symbols-rounded { font-size: 1.05rem; flex: none; }

.cmp-whkv { padding: .45rem .75rem .6rem; display: flex; flex-direction: column; }
.cmp-whkv__row { display: flex; align-items: baseline; gap: .5rem; padding: .3rem 0; font-size: .83rem; }
.cmp-whkv__row + .cmp-whkv__row { border-top: 1px solid #ececf0; }
.cmp-whkv__k { font-size: .68rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: #6b6b78; width: 5.2rem; flex: none; }
.cmp-whkv__v { font-weight: 600; color: #1a1a22; word-break: break-all; }
.cmp-method { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 6px; font-size: .72rem; font-weight: 700;
  background: color-mix(in srgb, var(--cmp-hook) 16%, #fff); color: #4a5468; border: 1px solid color-mix(in srgb, var(--cmp-hook) 30%, #fff); }
.cmp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8em; }

.cmp-whwarn { display: flex; align-items: flex-start; gap: .55rem; margin-top: .6rem; padding: .6rem .75rem; border-radius: 10px;
  font-size: .78rem; line-height: 1.45; color: #454b57;
  background: color-mix(in srgb, var(--cmp-hook) 12%, #fff); border: 1px solid color-mix(in srgb, var(--cmp-hook) 26%, #fff); }
.cmp-whwarn b { color: #2b2f38; }

/* Read-only preview of the picked SMS template's published content (it-56): body + optional media. */
.cmp-smsprev { margin-top: .7rem; }
.cmp-smsprev__box { border: 1px solid var(--md-sys-color-outline-variant, #d7dae0); border-radius: 10px;
  background: var(--md-sys-color-surface-container, #f4f4f6); padding: .7rem .8rem; }
.cmp-smsprev__body { white-space: pre-wrap; word-break: break-word; font-size: .85rem; line-height: 1.5; color: #2b2f38; }
.cmp-smsprev__media { margin-top: .6rem; }
.cmp-smsprev__img { max-width: 160px; max-height: 120px; border-radius: 8px; display: block; }
.cmp-smsprev__vthumb { position: relative; display: inline-block; width: 200px; aspect-ratio: 16 / 9;
  overflow: hidden; background: #000; border-radius: 8px; cursor: pointer; }
.cmp-smsprev__vthumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.cmp-smsprev__playico { position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  font-size: 40px; background: rgba(0,0,0,.18); transition: opacity .15s; pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.cmp-smsprev__vthumb:hover .cmp-smsprev__playico { opacity: 0; }
.cmp-whwarn .material-symbols-rounded { font-size: 1.05rem; flex: none; color: var(--cmp-hook); }

/* .cnr-insert (the mid-tree "+") moved to conditional-routing.css in it-47: it is a shared .cnr-*
   canvas primitive, and the sender-rule editor uses it too. It also depends on @keyframes cnr-glow,
   which already lives there — so the rule and its animation are finally in one file. */

/* The version pair the canvas is currently showing.
   One continuous accent down the left of BOTH rows and no background wash: the earlier version tinted
   the block AND drew a bar on the version row only, so the bar stopped halfway down and the wash muddied
   the state badges sitting on it. A single edge marker reads as "you are here" and leaves the row's own
   colours alone. */
.float-table tr.is-viewing > td:first-child,
.float-table tr.cmp-vnote-row.is-viewing > td:first-child {
  box-shadow: inset 3px 0 0 var(--md-sys-color-primary);
}

/* Version note row (it-26.3) — a full-width sub-row joined to its version so the two <tr>s read as
   one block: the version row drops its bottom border, this one carries the rounded bottom. */
.float-table tr.cmp-vnote-row > td {
  /* The pairing comes from dropping the divider between the two rows, NOT from zero padding — the note
     still needs breathing room above it, especially once the read view swaps to a taller MD3 field. */
  border-top: 0;
  padding-top: .35rem;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}
.cmp-vnote { display: flex; align-items: center; gap: .45rem; min-height: 1.9rem; }
.cmp-vnote > .material-symbols-rounded { font-size: 15px; color: var(--md-sys-color-outline); flex: none; }
.cmp-vnote--muted { color: var(--md-sys-color-outline); font-size: .82rem; font-style: italic; }

/* Read state: plain text, nothing that looks like a form. Hover/focus paints a faint background just
   where the text sits, which — with the qtip — is the only cue that it's editable. */
.cmp-vnote__read {
  flex: 1; min-width: 0; cursor: text;
  padding: .2rem .4rem; margin: -.2rem 0; border-radius: 6px;
  color: var(--md-sys-color-on-surface-variant); font-size: .82rem;
  transition: background var(--md-sys-motion-duration-short2, .1s) ease;
}
.cmp-vnote__read:hover,
.cmp-vnote__read:focus-visible { background: color-mix(in srgb, currentColor 8%, transparent); outline: none; }
.cmp-vnote__read.is-empty .cmp-vnote__text { font-style: italic; opacity: .7; }
.cmp-vnote__text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Edit state: the real MD3 field, filling the row. */
.cmp-vnote__field { flex: 1; min-width: 0; --md-outlined-text-field-container-shape: 8px; }

/* The viewing highlight spans both rows of the pair. */
.float-table tr.cmp-vnote-row.is-viewing > td:first-child {
  box-shadow: inset 3px 0 0 var(--md-sys-color-primary);
}

/* it-26.3.1 — migration target-picker: the shared mini-canvas in node-pick mode. A pickable node
   shows a pointer + hover lift; the chosen destination is ringed in the primary colour. */
.cnr-node--pickable { cursor: pointer; }
.cnr-node--pickable:hover { box-shadow: var(--elev-2); transform: translateY(-1px); }
.cnr-node--selected {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* it-47 — the sender rule's logic, disclosed under its leaf set in the drawer. The mini-canvas is the
   SHARED renderMini output (.cnr-node cards on an absolutely-positioned host), so it needs a sized
   host and the dark canvas ground those cards are designed against. It expands into the drawer body's
   own scroll — deliberately no nested scroller. */
.cmp-sender-logic__bar {
  display: flex; align-items: center; gap: .6rem; margin-top: .5rem;
  font-size: .75rem; color: #6b6b78;
}
.cmp-linkbtn {
  font: inherit; font-size: .78rem; font-weight: 650; color: var(--cmp-cond);
  background: none; border: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: .15rem;
}
.cmp-linkbtn:hover { text-decoration: underline; }
.cmp-sender-logic {
  position: relative; margin-top: .5rem; padding: 12px;
  border-radius: 10px; border: 1px solid var(--cnr-border);
  background-color: var(--cnr-bg);
  background-image: radial-gradient(var(--cnr-dot) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  overflow-x: auto;
  /* renderMini positions its cards absolutely from (0,0), so the host has to carry the height. It sets
     an inline height when it draws; this is the floor before that happens. */
  min-height: 120px;
}

/* ---- Sender: the role cascade's tier rows (it-26.5 FR4) ----
   Mockup state 3. A tier is one priority row: rank controls, the roles a single person must hold ALL
   of, and a remove. Deliberately NOT the .snr-* family — that prefix belongs to it-47's sender-RULE
   canvas, and this lives in the campaign drawer, so it takes the .cmp-* family like its neighbours. */
.cmp-tier {
  display: flex; align-items: center; gap: .5rem;
  border: 1px solid #ececf0; border-radius: 9px; padding: .4rem .5rem; background: #fff;
}
.cmp-tier__rank { display: flex; flex-direction: column; align-items: center; gap: 0; }
.cmp-tier__n { font-size: .75rem; font-weight: 600; color: #6b6b78; line-height: 1; }
/* Wraps rather than scrolls: a company with many roles makes the row taller, never a scroll trap. */
.cmp-tier__roles { display: flex; flex-wrap: wrap; gap: .3rem; flex: 1; align-items: center; }

/* A tier that can never fire (its roles are a superset of an earlier tier's). Muted rather than
   alarming — it is a warning that never blocks the save, and the explanation sits below the list. */
.cmp-tier.is-shadowed { opacity: .55; border-style: dashed; }

.cmp-note--warn {
  background: var(--md-sys-color-warning-container, #fff4e5);
  border-color: var(--md-sys-color-warning, #e8b04b);
  color: #5c4108;
  margin-top: .4rem;
}

/* ============ it-26.14 — full-page version-migration surface (migrate.html) ============ */
/* it-65: fills its main.main--bleed box (edge-to-edge, no max-width/padding) inside the
   app shell — same in-shell model as .cnr-editor, not a fixed viewport takeover. */
.mig { position: relative; height: 100%; display: flex; flex-direction: column; background: var(--cnr-bg, #0e0e15); color: #e9e9f0; }
.mig__hd { display: flex; align-items: center; gap: 1rem; padding: .7rem 1.2rem; border-bottom: 1px solid var(--cnr-border, #2a2a37); z-index: 3; }
.mig__back { color: inherit; }
.mig__title { flex: 1; min-width: 0; }
.mig__eyebrow { font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8a8a95; }
.mig__title h1 { font-size: 1.05rem; margin: .1rem 0 0; font-weight: 700; }
.mig__actions { display: flex; align-items: center; gap: .6rem; }
.mig__counter { font-size: .82rem; color: #9a9aa8; margin-right: .3rem; font-variant-numeric: tabular-nums; }
.mig__empty { margin: 2rem; }

/* legend — a centered node-lookalike card floating over the canvas (fixed, does not pan). Explains the
   default + the two per-node actions once, so the cards stay clean. */
.mig__legend-card {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: min(560px, 92%); background: var(--cnr-panel, #16161f);
  border: 1px solid var(--cnr-border, #2a2a37); border-radius: 14px;
  padding: .8rem 1rem; box-shadow: 0 16px 40px -20px rgba(0,0,0,.7); color: #c9c9d4;
}
.mig__legend-title { font-weight: 700; font-size: .92rem; color: #e9e9f0; margin-bottom: .5rem; }
.mig__legend-rows { display: flex; flex-direction: column; gap: .45rem; font-size: .8rem; }
.mig__legend-item { display: flex; align-items: flex-start; gap: .5rem; }
.mig__legend-item b { color: #e9e9f0; font-weight: 700; }
.mig__legend-item em { color: #8a8a95; font-style: normal; }
.mig__legend-ic { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 15px; color: #fff; flex: none; }
.mig__legend-ic--keep { background: transparent; color: #8a8a95; box-shadow: inset 0 0 0 1px var(--cnr-border, #2a2a37); }
.mig__legend-ic--move { background: var(--cnr-cond, #7c6bde); }
.mig__legend-ic--stop { background: var(--cnr-no, #d9534f); }
.mig__legend-hint { margin-top: .55rem; font-size: .74rem; color: #8a8a95; }

/* work row: pannable canvas (flex) + the docked house drawer (.cmp-drawer), like the editor's .cmp-work.
   position:relative so the floating legend card anchors to the CANVAS area (below the header), not the
   fixed .mig (which would put it at viewport-top, straddling the header). */
.mig__body { flex: 1; display: flex; min-height: 0; position: relative; }
.mig__canvas { flex: 1; position: relative; overflow: hidden; cursor: grab; background:
  radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0) 0 0 / 22px 22px, var(--cnr-bg, #0e0e15); }
.mig__canvas:active { cursor: grabbing; }
.mig-surface { position: absolute; top: 0; left: 0; will-change: transform; }
.mig-surface .cnr-edges { position: absolute; inset: 0; pointer-events: none; }
.mig-collabel { position: absolute; font-size: 1.4rem; font-weight: 800; color: #6a6a78; letter-spacing: .02em; }

/* campaign cards on the surface reuse the global .cnr-node chrome; migration adds state on top.
   overflow:visible so the external count badge + affordance tab aren't clipped by the card. */
.mig-node { width: var(--cnr-node-w, 396px); overflow: visible; cursor: pointer; }
.mig-node.mig-dim { opacity: .32; }
.mig-node.mig-parked { box-shadow: 0 0 0 2px var(--cnr-amber), 0 0 16px 1px color-mix(in srgb, var(--cnr-amber) 45%, transparent); cursor: pointer; }
.mig-node.mig-d-move { box-shadow: 0 0 0 2px var(--cnr-cond), 0 0 16px 1px color-mix(in srgb, var(--cnr-cond) 50%, transparent); }
.mig-node.mig-d-stop { box-shadow: 0 0 0 2px var(--cnr-no, #d9534f), 0 0 16px 1px color-mix(in srgb, var(--cnr-no, #d9534f) 50%, transparent); }
.mig-node.mig-picking-src { box-shadow: 0 0 0 2px var(--cnr-cond); }

/* ** contact-count badge, top-right, external */
.mig-badge {
  position: absolute; top: -12px; right: -12px; height: 26px; padding: 0 8px 0 6px;
  display: inline-flex; align-items: center; gap: 2px; border-radius: 9999px;
  background: var(--cnr-amber); color: #201600; font-size: .82rem; font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,.5); font-variant-numeric: tabular-nums;
}
.mig-badge .material-symbols-rounded { font-size: 16px; }

/* * external affordance tab — sits on the card's bottom-right edge, like the sketch */
.mig-aff {
  position: absolute; right: 14px; bottom: -16px; display: inline-flex; gap: 4px; z-index: 2;
  background: var(--cnr-panel, #16161f); border: 1px solid var(--cnr-border, #2a2a37);
  border-radius: 9px; padding: 3px;
}
.mig-aff__btn {
  width: 30px; height: 28px; border: none; border-radius: 6px; background: transparent; color: #c3c3cf;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.mig-aff__btn .material-symbols-rounded { font-size: 18px; }
.mig-aff__btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.mig-aff__btn--keep.is-on { background: rgba(255,255,255,.14); color: #fff; }
.mig-aff__btn--move.is-on { background: var(--cnr-cond); color: #fff; }
.mig-aff__btn--stop.is-on { background: var(--cnr-no, #d9534f); color: #fff; }

/* the read-only inspect drawer reuses the house .cmp-drawer (light, docked). A narrow variant, since
   it's a read-only peek rather than the full editor. */
.cmp-drawer--narrow { width: 400px; max-width: 92vw; }
/* a node-definition read row inside the light drawer: label left, value right (reuses .cmp-cond-item) */
.mig-defrow { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.mig-defrow b { color: #43434e; font-weight: 600; }
.mig-defrow span { text-align: right; word-break: break-word; }
