/**
 * Supplemental Feeds page (#catalog-designs). Scoped under .sf-page.
 * Faithful translation of the Claude Design "Supplemental Feeds" prototype:
 * light/indigo palette (#5B53E8), white cards on #F5F6F8, hairline borders,
 * 14–16px radii, soft shadows. All selectors are .sf-* so nothing leaks.
 */
.sf-page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 28px 120px;
    color: #14171F;
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}
.sf-page code { font-family: ui-monospace, 'SF Mono', monospace; }
.sf-page ::selection { background: rgba(91, 83, 232, 0.18); }

/* Header */
.sf-title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.sf-sub { margin: 9px 0 0; color: #5B6473; font-size: 14.5px; line-height: 1.55; }
.sf-sub code { font-size: 12.5px; background: #EFF0F4; padding: 1px 5px; border-radius: 5px; color: #3B414C; }
.sf-sub strong { color: #3B414C; font-weight: 600; }

.sf-warn { margin-top: 20px; display: flex; align-items: flex-start; gap: 11px; background: #FFFBF0; border: 1px solid #F5E6BE; border-radius: 11px; padding: 13px 15px; }
.sf-warn__icon { flex: 0 0 auto; margin-top: 1px; color: #C28A0E; }
.sf-warn__icon svg { width: 18px; height: 18px; display: block; }
.sf-warn__text { font-size: 13px; line-height: 1.5; color: #6B5A2A; }
.sf-warn__text strong { color: #3B414C; }

.sf-note { margin: 34px 0 0; font-size: 12px; color: #646B78; text-align: center; }

/* Two-column layout: sticky tab rail + active channel */
.sf-layout { margin-top: 26px; display: grid; grid-template-columns: 240px 1fr; gap: 30px; align-items: start; }
.sf-loading { grid-column: 1 / -1; display: flex; justify-content: center; padding: 60px 0; color: #6B7280; }

.sf-rail { display: flex; flex-direction: column; gap: 5px; position: sticky; top: 18px; }
.sf-rail__label { font-size: 10px; font-weight: 700; letter-spacing: .07em; color: #646B78; text-transform: uppercase; padding: 2px 4px 7px; }
.sf-tab { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 11px; padding: 9px 10px; cursor: pointer; transition: all .12s; }
.sf-tab.is-active { border-color: #E4E1FB; background: #FFFFFF; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06); }
.sf-tab__tile { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06); }
.sf-tab__tile svg { width: 19px; height: 19px; display: block; }
.sf-tab__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sf-tab__name { font-size: 13px; font-weight: 700; color: #5B6473; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-tab.is-active .sf-tab__name { color: #14171F; }
.sf-tab__status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #6B7280; }
.sf-tab__dot { width: 6px; height: 6px; border-radius: 50%; background: #C2C9D4; flex: 0 0 auto; }
.sf-tab__dot.is-on { background: #22A06B; }

.sf-stack { min-width: 0; }
.sf-active { display: flex; flex-direction: column; gap: 14px; }

/* Card primitives */
.sf-card { background: #FFFFFF; border: 1px solid #E9EAEE; border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03); overflow: hidden; }
.sf-code { font-family: ui-monospace, monospace; font-size: 11px; color: #6B7280; background: #F2F3F6; padding: 2px 7px; border-radius: 6px; }
.sf-card-soft { background: #FBFBFC; border: 1px solid #ECEDF1; border-radius: 11px; padding: 11px; }
.sf-empty { border: 1px dashed #DCDEE5; border-radius: 11px; padding: 16px; text-align: center; font-size: 12.5px; color: #6B7280; }
.sf-empty code { font-size: 11px; }
.sf-rowlist { display: flex; flex-direction: column; gap: 8px; margin-top: 11px; }
.sf-hint { margin: 7px 0 0; font-size: 12px; color: #6B7280; line-height: 1.5; }

/* Native selects (chevron overlay) */
.sf-select { position: relative; display: flex; align-items: center; }
.sf-select select { width: 100%; appearance: none; -webkit-appearance: none; border: 1px solid #E2E4EA; border-radius: 8px; padding: 8px 28px 8px 10px; font-size: 13px; color: #14171F; background: #FFFFFF; cursor: pointer; outline: none; font-family: inherit; }
.sf-select select:focus { border-color: #9099A6; box-shadow: 0 0 0 3px rgba(144, 153, 166, 0.14); }
.sf-select__chev { position: absolute; right: 9px; pointer-events: none; color: #6B7280; display: flex; }
.sf-select__chev svg { width: 14px; height: 14px; }

/* Toggle switch */
.sf-toggle { width: 42px; height: 24px; border-radius: 999px; border: none; cursor: pointer; padding: 2.5px; display: flex; flex: 0 0 auto; background: #D5D8DF; justify-content: flex-start; transition: all .15s; }
.sf-toggle.is-on { background: #15A34A; justify-content: flex-end; }
.sf-toggle.is-locked, .sf-toggle:disabled { opacity: .45; cursor: not-allowed; }
.sf-pill.is-locked { background: #FEF3C7; color: #92400E; }
.sf-toggle__knob { width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }

/* Segmented Simple/Advanced */
.sf-seg { display: flex; background: #F2F3F6; border-radius: 9px; padding: 3px; gap: 2px; flex: 0 0 auto; }
.sf-seg__btn { font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 7px; border: none; cursor: pointer; background: transparent; color: #646B78; transition: all .12s; }
.sf-seg__btn.is-on { background: #FFFFFF; color: #2A3343; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10); }

/* Feed URL card */
.sf-feed__head { display: flex; align-items: flex-start; gap: 13px; padding: 15px 18px; border-bottom: 1px solid #F0F1F4; }
.sf-feed__tile { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06); }
.sf-feed__tile svg { width: 23px; height: 23px; display: block; }
.sf-feed__hi { flex: 1; min-width: 0; }
.sf-feed__titlerow { display: flex; align-items: center; gap: 9px; }
.sf-feed__name { margin: 0; font-size: 15.5px; font-weight: 700; }
.sf-pill { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: #F1F2F4; color: #646B78; }
.sf-pill.is-on { background: #DCFCE7; color: #15803D; }
.sf-feed__sub { margin: 3px 0 0; font-size: 12.5px; color: #646B78; }
.sf-feed__body { padding: 16px; }
.sf-feed__labelrow { display: flex; align-items: center; gap: 9px; }
.sf-feed__label { font-size: 11px; font-weight: 700; color: #5B6473; text-transform: uppercase; letter-spacing: .05em; }
.sf-badge { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: #EEEDFC; color: #5B53E8; }
.sf-refresh { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: #6B7280; }
.sf-refresh__icon svg { width: 13px; height: 13px; display: block; }
.sf-refresh__txt { font-size: 11.5px; }
.sf-refresh__sel { /* tighter select for the interval picker */ }
.sf-refresh .sf-select select { padding: 4px 22px 4px 8px; font-size: 11.5px; font-weight: 600; color: #3B414C; border-radius: 7px; }
.sf-refresh .sf-select__chev svg { width: 12px; height: 12px; }
.sf-urlbar { margin-top: 11px; display: flex; align-items: center; gap: 8px; background: #FBFBFC; border: 1px solid #E6E7EC; border-radius: 9px; padding: 8px 9px; }
.sf-urlbar__icon { flex: 0 0 auto; color: #6B7280; display: flex; }
.sf-urlbar__icon svg { width: 15px; height: 15px; }
.sf-urlbar__code { flex: 1; min-width: 0; font-size: 12.5px; color: #2A3343; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Ghost style (user 2026-07-13): the URL bar's Copy is a quiet inline action, not a
   solid accent button — indigo text on transparent, tinted only on hover. */
.sf-copy { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #5B53E8; background: transparent; border: none; cursor: pointer; padding: 6px 9px; border-radius: 7px; }
.sf-copy:hover { background: #EEEDFC; }
.sf-copy svg { width: 13px; height: 13px; }
.sf-regen-row { margin-top: 11px; display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.sf-regen { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: #6B7280; background: none; border: none; cursor: pointer; padding: 6px 2px; border-radius: 8px; }
.sf-regen:hover { color: #B4441E; }
.sf-regen svg { width: 13px; height: 13px; }
/* "Run now" — primary action of the row: a filled accent pill (vs the muted
   text-style Regenerate). Rules sit after .sf-regen so they win on the shared element. */
.sf-run { color: #fff; background: #5B53E8; padding: 6px 13px; font-weight: 600; }
.sf-run:hover { color: #fff; background: #4A43D6; }
.sf-run:disabled { opacity: .6; cursor: default; }
.sf-tokenage { font-size: 12px; color: #6B7280; }
/* A video template the last build left out (wrong shape for the channel) — amber, per DESIGN_SYSTEM.md. */
.sf-tokenage--warn { color: #9A6B0E; font-weight: 500; }
.sf-tokenage--error { color: #B42318; font-weight: 600; flex-basis: 100%; }
/* Live "Run now" progress — the channel rebuilds in the background (atomic Hetzner replace);
   the dot pulses until builtAt advances, then flips back to "Last rebuilt just now". */
.sf-tokenage--building { color: #5B53E8; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.sf-tokenage--building::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #5B53E8; animation: sf-buildpulse 1.1s ease-in-out infinite; }
@keyframes sf-buildpulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }

/* Section card (image / video / labels / ai share the header pattern) */
.sf-sec { border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03); }
.sf-sec__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #F0F1F4; }
/* When a section is toggled OFF its body is removed (header-only) — drop the
   header divider so it doesn't dangle above the card's rounded bottom edge. */
.sf-sec.is-collapsed .sf-sec__head { border-bottom: none; }
.sf-sec__icon { width: 32px; height: 32px; border-radius: 8px; background: #F2F3F6; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #646B78; }
.sf-sec__icon svg { width: 17px; height: 17px; }
.sf-sec__hi { flex: 1; min-width: 0; }
.sf-sec__titlerow { display: flex; align-items: center; gap: 8px; }
.sf-sec__title { font-size: 14.5px; font-weight: 700; color: #2A3343; }
.sf-sec__sub { margin: 2px 0 0; font-size: 12px; color: #646B78; }
.sf-optional { font-size: 9px; font-weight: 700; letter-spacing: .04em; color: #646B78; background: #F1F2F4; padding: 2px 6px; border-radius: 5px; }
.sf-sec__body { padding: 20px; display: flex; flex-direction: column; gap: 22px; }

/* Group heads + counters */
.sf-grp-head { display: flex; align-items: center; gap: 8px; }
.sf-grp-head__title { font-size: 13.5px; font-weight: 700; }
.sf-grp-head__info { display: inline-flex; align-items: center; color: #646B78; cursor: help; }
.sf-grp-head__info:hover, .sf-grp-head__info:focus-visible { color: #7A72D8; outline: none; }
.sf-grp-head__info svg { width: 14px; height: 14px; }
/* Header info tooltip — rendered to <body> (position:fixed) so the card's overflow:hidden never clips it. */
.sf-tip { position: fixed; z-index: 10000; max-width: 320px; background: #1F2430; color: #FFFFFF; font-size: 12px; line-height: 1.45; padding: 9px 12px; border-radius: 9px; box-shadow: 0 8px 28px rgba(16, 24, 40, 0.22); pointer-events: none; }
.sf-counter { margin-left: auto; font-size: 11.5px; font-weight: 600; color: #646B78; background: #F2F3F6; padding: 4px 9px; border-radius: 7px; white-space: nowrap; }

/* Mapping row: label | template | schedule [| remove].
   The label is a short tag, the template select is the meaningful choice — so
   the select gets the lion's share of the width and the label input stays
   compact with smaller text. */
.sf-row { display: grid; grid-template-columns: minmax(120px, 0.75fr) minmax(190px, 1.7fr) auto; align-items: center; gap: 8px; }
.sf-row.sf-row--rm { grid-template-columns: minmax(120px, 0.75fr) minmax(190px, 1.7fr) auto 30px; }
.sf-row__input { min-width: 0; border: 1px solid #E2E4EA; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: #14171F; background: #FFFFFF; outline: none; font-family: inherit; }
.sf-row__input.is-invalid { border-color: #E0A99C; background: #FFF9F7; }
.sf-row__input:focus { border-color: #9099A6; box-shadow: 0 0 0 3px rgba(144, 153, 166, 0.14); }
.sf-row__x { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: none; background: none; color: #646B78; cursor: pointer; border-radius: 7px; flex: 0 0 auto; }
.sf-row__x:hover { background: #F2F3F6; color: #6B7280; }
.sf-row__x svg { width: 15px; height: 15px; }

/* Schedule chip */
.sf-sched { flex: 0 0 auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: #5B6473; background: #FFFFFF; border: 1px solid #E2E4EA; border-radius: 8px; padding: 8px 11px; cursor: pointer; }
.sf-sched:hover { border-color: #C2C9D4; }
/* Per-tier schedule button (2026-11-09) — in the tier head, next to its delete button; compact. */
.sf-sched.sf-sched--tier { padding: 5px 9px; font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sf-sched__dot { width: 6px; height: 6px; border-radius: 50%; background: #C2C9D4; flex: 0 0 auto; }
.sf-sched__cal { color: #6B7280; display: flex; }
.sf-sched__cal svg { width: 13px; height: 13px; }
.sf-sched.is-live .sf-sched__dot { background: #15A34A; }
.sf-sched.is-scheduled .sf-sched__dot { background: #D99214; }
.sf-sched.is-ended { color: #6B7280; }
.sf-sched.is-ended .sf-sched__dot { background: #B0B6C0; }

/* Add buttons (dashed) */
/* Add-row buttons sit inside the flex-column body — keep them content-width
   (align-self) so they read as buttons, not full-bleed bars. */
.sf-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 8px 14px; border-radius: 9px; }
.sf-add { color: #3B414C; background: #FFFFFF; border: 1px solid #DDE0E6; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); transition: background .12s, border-color .12s; }
.sf-add:hover { background: #F7F8FA; border-color: #C2C9D4; }
.sf-add.is-disabled { color: #AEB4BE; background: #F7F8FA; border-color: #E2E4EA; box-shadow: none; cursor: not-allowed; }
.sf-add.is-disabled:hover { background: #F7F8FA; border-color: #E2E4EA; }
.sf-add svg { width: 14px; height: 14px; }

/* Advanced: info banner, column label, rules */
.sf-info { display: flex; align-items: flex-start; gap: 9px; background: #F4F3FE; border: 1px solid #E4E1FB; border-radius: 10px; padding: 11px 13px; }
.sf-info__icon { flex: 0 0 auto; margin-top: 1px; color: #7A72D8; }
.sf-info__icon svg { width: 16px; height: 16px; }
.sf-info > div { font-size: 12.5px; line-height: 1.5; color: #5A5470; }
.sf-info strong { color: #3B364F; }
.sf-collabel { width: 100%; border: 1px solid #E2E4EA; border-radius: 8px; padding: 8px 10px; font-size: 13px; color: #14171F; background: #FFFFFF; outline: none; font-family: inherit; }
.sf-collabel.is-invalid { border-color: #E0A99C; background: #FFF9F7; }
.sf-collabel:focus { border-color: #9099A6; box-shadow: 0 0 0 3px rgba(144, 153, 166, 0.14); }

.sf-rules { display: flex; flex-direction: column; gap: 10px; }
.sf-rulecard { border: 1px solid #ECEDF1; border-radius: 12px; background: #FBFBFC; overflow: hidden; }
.sf-rulecard__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #F0F1F4; }
.sf-rulecard__tag { font-size: 11.5px; font-weight: 700; color: #5B6473; text-transform: uppercase; letter-spacing: .04em; }
.sf-rule__del { margin-left: auto; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: none; background: none; color: #646B78; cursor: pointer; border-radius: 7px; }
.sf-rule__del:hover { background: #F2F3F6; color: #6B7280; }
.sf-rule__del svg { width: 15px; height: 15px; }
.sf-rulecard__conds { padding: 11px 12px; display: flex; flex-direction: column; gap: 7px; }
.sf-rulecard__foot { padding: 11px 12px; border-top: 1px solid #F0F1F4; background: #FFFFFF; display: grid; grid-template-columns: auto 1fr 168px; align-items: center; gap: 9px; }
.sf-show { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: #15803D; }
.sf-show svg { width: 14px; height: 14px; }

/* Conditions + tiers (positions, Smart custom labels, Remove products) are drawn by
   js/shared/conditions.js — styled by .rules-* / .cnd-* in css/rules.css. Only the feed-specific
   parts live here: the label value input (.sf-tier__val), the red removal pill (.sf-tier__remove),
   the creative picker inside a tier / "Everything else" row, and the live removal counts (.sf-rc). */

/* Advanced additional row */
.sf-arow { border: 1px solid #ECEDF1; border-radius: 12px; background: #FBFBFC; overflow: hidden; }
.sf-arow > .sf-row { padding: 11px 12px; }
.sf-arow__conds { display: flex; flex-direction: column; gap: 7px; border-top: 1px dashed #ECEDF1; margin: 0 12px; padding: 10px 0 11px; }
.sf-arow__lead { font-size: 10.5px; font-weight: 700; color: #646B78; text-transform: uppercase; letter-spacing: .04em; }

/* Section validation line (blank / repeated label). Saving lives in the channel's save bar below. */
.sf-foot { margin-top: 4px; border-top: 1px solid #EFF0F3; padding-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sf-foot--end { justify-content: flex-end; }
.sf-foot__warn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #C0492A; }
.sf-foot__warn svg { width: 14px; height: 14px; }
.sf-sec__warn { display: flex; margin-top: 6px; }
/* Popup "Done" buttons (position + label editors) */
.sf-btn-save { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #FFFFFF; background: #5B53E8; border: none; cursor: pointer; padding: 9px 16px; border-radius: 9px; }
.sf-btn-save:hover { background: #4A43D6; }
.sf-btn-save--green { background: #22A06B; }
.sf-btn-save--green:hover { background: #1C8C56; }
.sf-btn-save svg { width: 14px; height: 14px; }

/* Smart custom labels */
.sf-labels { border-radius: 14px; overflow: visible; } /* visible so the detail tooltip isn't clipped */
/* Keep the card white like every other card even when enabled — the green
   icon + toggle are the only "on" cue (matches the AI card's purple cue). */
.sf-labels.is-on { background: #FFFFFF; border-color: #E9EAEE; }
.sf-labels__head { display: flex; align-items: center; gap: 12px; padding: 15px 16px; }
.sf-labels__icon { width: 36px; height: 36px; border-radius: 9px; background: #F2F3F6; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #6B7280; }
.sf-labels.is-on .sf-labels__icon { background: #DCF4E6; color: #1C8C56; }
.sf-labels__icon svg { width: 19px; height: 19px; }
.sf-labels.is-on .sf-toggle:not(.is-on) { background: #D5D8DF; }
.sf-labels .sf-toggle.is-on { background: #22A06B; }
.sf-labels__body { padding: 0 16px 16px; border-top: 1px solid #F0F1F4; padding-top: 13px; }
.sf-slotlist { display: flex; flex-direction: column; gap: 8px; }
.sf-slot { display: grid; grid-template-columns: 128px 184px 1fr auto; align-items: center; gap: 11px; background: #FFFFFF; border: 1px solid #ECEDF1; border-radius: 10px; padding: 9px 11px; }
.sf-slot__view { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; font-size: 12px; font-weight: 600; color: #5B6473; background: transparent; border: 1px solid #E2E4EA; border-radius: 8px; padding: 6px 11px; cursor: pointer; white-space: nowrap; }
.sf-slot__view:hover { background: #F7F8FA; }
.sf-slot__viewn { font-size: 10.5px; font-weight: 700; color: #5B6473; background: #F1F2F4; border-radius: 999px; padding: 1px 6px; }
.sf-slot__code { font-family: ui-monospace, monospace; font-size: 11.5px; color: #15803D; background: #EAF7EF; padding: 4px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-slot .sf-select select:focus { border-color: #22A06B; box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.12); }
.sf-slot__prev { display: flex; align-items: center; gap: 7px; min-width: 0; position: relative; }
.sf-slot__warn { flex: 0 0 auto; color: #C28A0E; display: flex; }
.sf-slot__warn svg { width: 13px; height: 13px; }
.sf-slot__preview { flex: 0 1 auto; min-width: 0; font-size: 11.5px; color: #5B6473; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-slot__preview.is-none { color: #646B78; }
.sf-slot__preview.is-warn { color: #9A6B0E; }
.sf-footnote { margin-top: 12px; display: flex; align-items: flex-start; gap: 7px; font-size: 11.5px; color: #646B78; line-height: 1.45; }
.sf-footnote svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; color: #646B78; }
.sf-labels__body .sf-foot, .sf-ai__body .sf-foot { margin-top: 14px; border-top-color: #F0F1F4; padding-top: 14px; }

/* Smart custom labels — per-slot tier builder */
.sf-lblcols { display: flex; flex-direction: column; gap: 14px; }
.sf-lblcol { border: 1px solid #E4F0E9; border-radius: 12px; background: #FCFEFD; padding: 12px; }
.sf-lblcol.is-off { background: #FBFBFC; border-color: #ECEDF1; }
.sf-lblcol__head { display: flex; align-items: center; gap: 10px; }
.sf-lblcol__head .sf-slot__code { flex: 0 0 auto; }
.sf-lblcol__strat { margin-left: auto; flex: 0 0 200px; max-width: 220px; }
.sf-lblcol__strat select:focus { border-color: #22A06B; box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.12); }
.sf-lblcol__none { margin: 10px 2px 2px; font-size: 12px; color: #646B78; }
.sf-lblcol__cogs { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; padding: 8px 10px; background: #FBF1DC; border: 1px solid #F2E2BC; border-radius: 8px; font-size: 11.5px; color: #9A6B0E; }
.sf-lblcol__cogs code { font-family: ui-monospace, monospace; font-size: 10.5px; background: #F6E7C4; padding: 1px 4px; border-radius: 4px; }
.sf-lblcol__cogsico { flex: 0 0 auto; color: #C28A0E; display: flex; margin-top: 1px; }
.sf-lblcol__cogsico svg { width: 14px; height: 14px; }

/* Profit-margin COGS setup guide — shown in the label popup when the strategy needs a
   cost per product and the catalogue has none. Same amber family as the inline notice it
   replaced, sized as a readable block: without COGS the strategy cannot compute a single
   tier, so this is a prerequisite, not a hint. */
.sf-cogsguide { margin-top: 10px; padding: 11px 13px; background: #FBF1DC; border: 1px solid #F2E2BC; border-radius: 10px; color: #7A5406; font-size: 12px; line-height: 1.5; }
.sf-cogsguide__head { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: #8A5D06; }
.sf-cogsguide__ico { flex: 0 0 auto; color: #C28A0E; display: flex; margin-top: 1px; }
.sf-cogsguide__ico svg { width: 15px; height: 15px; }
.sf-cogsguide__why { margin: 8px 0 0; }
.sf-cogsguide__steps { margin: 9px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.sf-cogsguide__steps li { padding-left: 2px; }
.sf-cogsguide code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: #F6E7C4; padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.sf-cogsguide__foot { margin-top: 10px; }
.sf-cogsguide__link { font-weight: 600; color: #8A5D06; text-decoration: underline; text-underline-offset: 2px; }
.sf-cogsguide__link:hover { color: #5E3F04; }


.sf-tier__val { flex: 1 1 auto; min-width: 0; border: 1px solid #E2E4EA; border-radius: 7px; padding: 7px 9px; font-size: 12.5px; font-family: ui-monospace, monospace; color: #15803D; background: #FFFFFF; outline: none; }
.sf-tier__val:focus { border-color: #22A06B; box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.12); }

.sf-matchseg { display: inline-flex; background: #F2F3F6; border-radius: 7px; padding: 2px; gap: 2px; }
.sf-matchseg__btn { font-size: 10.5px; font-weight: 600; color: #6B7280; background: none; border: none; border-radius: 5px; padding: 4px 8px; cursor: pointer; }
.sf-matchseg__btn.is-on { background: #FFFFFF; color: #1C8C56; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); }

.sf-lcond { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sf-lcond__when { font-size: 11px; font-weight: 700; color: #646B78; width: 40px; flex: 0 0 auto; }
.sf-lcond__join { width: 40px; flex: 0 0 auto; text-align: center; font-size: 10.5px; font-weight: 700; color: #1C8C56; background: #E4F7EC; border-radius: 6px; padding: 5px 0; }
.sf-lcond__metric { flex: 1 1 150px; min-width: 130px; }
.sf-lcond__op { flex: 0 0 132px; }
.sf-lcond .sf-select select { padding: 7px 24px 7px 9px; font-size: 12.5px; border-radius: 7px; }
.sf-lcond__op select { color: #5B6473; }
.sf-lcond__num { flex: 1 1 130px; min-width: 110px; display: flex; align-items: center; gap: 6px; }
.sf-lcond__and { font-size: 11px; color: #646B78; flex: 0 0 auto; }
.sf-lcond__unit { font-size: 12px; color: #646B78; flex: 0 0 auto; }
.sf-lcond input.sf-lcond__val { flex: 1 1 70px; min-width: 56px; border: 1px solid #E2E4EA; border-radius: 7px; padding: 7px 9px; font-size: 12.5px; color: #14171F; background: #FFFFFF; outline: none; font-family: inherit; }
.sf-lcond__val--text { flex: 1 1 110px !important; }
.sf-lcond input.sf-lcond__val:focus { border-color: #22A06B; box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.12); }
.sf-lcond .sf-lcond__val.sf-select { flex: 1 1 120px; min-width: 100px; }
.sf-lcond__x { width: 26px; height: 26px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border: none; background: none; color: #646B78; cursor: pointer; border-radius: 6px; }
.sf-lcond__x:hover { background: #F2F3F6; color: #6B7280; }
.sf-lcond__x svg { width: 14px; height: 14px; }

@media (max-width: 560px) {
    .sf-lblcol__head { flex-wrap: wrap; }
    .sf-lblcol__strat { flex: 1 1 100%; margin-left: 0; max-width: none; }
    /* Phones: these header rows never wrapped, so the card clipped the auto-refresh picker,
       the section toggles, the "0 of 10" counters and the Review button. */
    .sf-feed__labelrow, .sf-sec__head, .sf-grp-head { flex-wrap: wrap; row-gap: 6px; }
    .sf-sec__head { padding: 12px 14px; }
    .sf-sec__body { padding: 16px 14px; }
    /* .sf-optctl is defined further down — the parent prefix outranks it. */
    .sf-optctl .sf-optctl__status { min-width: 0; flex: 1 1 100%; }
    .sf-optctl .sf-optctl__acts { flex: 1 1 100%; flex-wrap: wrap; }
}

/* AI optimization — neutral, like every other card (uses the shared sectionHead;
   no purple selected-state / header / icon / toggle). */
.sf-ai__body { padding: 18px; }
.sf-ai__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sf-aiopt { display: flex; align-items: flex-start; gap: 10px; text-align: left; border: 1px solid #ECEDF1; background: #FBFBFC; border-radius: 10px; padding: 11px 12px; cursor: pointer; transition: all .12s; }
.sf-aiopt.is-on { background: #F6F7F9; border-color: #CFD3DB; }
.sf-aiopt__icon { width: 30px; height: 30px; border-radius: 8px; background: #F2F3F6; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #6B7280; font-size: 14px; font-weight: 700; }
.sf-aiopt.is-on .sf-aiopt__icon { background: #E7E9ED; color: #5B6473; }
.sf-aiopt__txt { flex: 1; min-width: 0; }
.sf-aiopt__lblrow { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sf-aiopt__label { font-size: 12.5px; font-weight: 600; color: #2A3343; }
.sf-impact { font-size: 8.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 5px; border-radius: 4px; white-space: nowrap; }
.sf-impact.is-veryhigh { color: #15803D; background: #E4F7EC; }
.sf-impact.is-high { color: #B45309; background: #FEF1DC; }
.sf-impact.is-med { color: #646B78; background: #F2F3F6; }
.sf-aiopt__desc { display: block; margin-top: 3px; font-size: 11px; color: #646B78; line-height: 1.4; }
.sf-aiopt__check { width: 18px; height: 18px; border-radius: 6px; flex: 0 0 auto; margin-top: 1px; display: flex; align-items: center; justify-content: center; background: #FFFFFF; border: 1.5px solid #D5D8DF; color: #FFFFFF; }
.sf-aiopt__check svg { width: 11px; height: 11px; opacity: 0; }
.sf-aiopt.is-on .sf-aiopt__check { background: #15A34A; border-color: #15A34A; }
.sf-aiopt.is-on .sf-aiopt__check svg { opacity: 1; }

/* Guide + extension (collapsible) */
.sf-guide__btn, .sf-ext__btn { width: 100%; display: flex; align-items: center; gap: 11px; background: none; border: none; cursor: pointer; padding: 14px 16px; text-align: left; }
.sf-guide__icon { width: 34px; height: 34px; border-radius: 9px; background: #F2F3F6; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #646B78; }
.sf-guide__icon svg { width: 17px; height: 17px; }
.sf-guide__hi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sf-guide__title { font-size: 13.5px; font-weight: 700; color: #2A3343; }
.sf-guide__sub { font-size: 12px; color: #6B7280; }
.sf-guide__more, .sf-ext__more { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #5B53E8; flex: 0 0 auto; white-space: nowrap; }
.sf-chev { display: flex; transition: transform .18s; }
.sf-chev svg { width: 14px; height: 14px; }
.sf-chev.is-open { transform: rotate(180deg); }
.sf-guide__body { padding: 14px 16px 16px; border-top: 1px solid #F0F1F4; }
.sf-steps { font-size: 12.5px; line-height: 1.7; color: #5B6473; padding-left: 18px; margin: 0; }
.sf-steps li { padding-left: 3px; margin-bottom: 4px; }
.sf-guide__link, .sf-ext__store { cursor: pointer; }
.sf-guide__link { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 12.5px; font-weight: 600; color: #5B53E8; text-decoration: none; }
.sf-guide__link svg { width: 13px; height: 13px; }

.sf-ext__icon { width: 34px; height: 34px; border-radius: 9px; background: #FFFFFF; border: 1px solid #E1E5FA; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #5B53E8; }
.sf-ext__icon svg { width: 18px; height: 18px; }
.sf-ext__hi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sf-ext__titlerow { display: flex; align-items: center; gap: 8px; }
.sf-ext__title { font-size: 13.5px; font-weight: 700; color: #2A3343; }
.sf-ext__badge { font-size: 9px; font-weight: 700; letter-spacing: .04em; color: #5B53E8; background: #EAE8FC; padding: 2px 6px; border-radius: 5px; }
.sf-ext__sub { font-size: 12px; color: #8A86C8; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-ext__body { padding: 16px; border-top: 1px solid #E4E1FB; }
.sf-ext__lead { margin: 0 0 14px; font-size: 12.5px; line-height: 1.55; color: #5B6473; max-width: 560px; }
.sf-ext__steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.sf-ext__step { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: #5B6473; line-height: 1.5; }
.sf-ext__n { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; border: 1px solid #DDE2FB; color: #5B53E8; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sf-ext__actions { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.sf-ext__cta { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #FFFFFF; background: #5B53E8; border: none; cursor: pointer; padding: 9px 16px; border-radius: 9px; }
.sf-ext__cta:hover { background: #4A43D6; }
.sf-ext__cta svg { width: 15px; height: 15px; }
.sf-ext__store { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #5B6473; text-decoration: none; }
.sf-ext__store svg { width: 12px; height: 12px; }
.sf-ext__compat { margin-left: auto; font-size: 11px; color: #646B78; white-space: nowrap; }

/* Overlays: schedule popover + regen confirm modal */
.sf-pop-scrim { position: fixed; inset: 0; z-index: 95; }   /* above .sf-lblmodal-overlay (80): a tier's calendar opens from inside the position popup */
.sf-pop { position: fixed; z-index: 96; width: 300px; background: #FFFFFF; border: 1px solid #E6E7EC; border-radius: 14px; box-shadow: 0 18px 44px rgba(16, 24, 40, 0.20); padding: 14px; }
.sf-cal__hint { font-size: 11px; font-weight: 700; color: #646B78; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.sf-cal__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sf-cal__navbtn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #E6E7EC; background: #FFFFFF; color: #5B6473; cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.sf-cal__navbtn:hover { background: #F7F8FA; }
.sf-cal__month { font-size: 13.5px; font-weight: 700; }
.sf-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.sf-cal__wd { text-align: center; font-size: 10.5px; font-weight: 700; color: #6B7280; padding: 3px 0; }
.sf-cal__day { height: 32px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; border-radius: 8px; cursor: pointer; background: transparent; color: #2A3343; font-weight: 500; border: 1px solid transparent; }
.sf-cal__day:hover { background: #F4F5F7; }
.sf-cal__day.is-range { background: #EEEDFC; color: #4A43D6; font-weight: 600; }
.sf-cal__day.is-sel { background: #5B53E8; color: #FFFFFF; font-weight: 700; }
.sf-cal__day.is-today { border-color: #C9CDF6; }
/* Time of day + timezone under the calendar (2026-11-05). Same border/radius/focus as the app's inputs. */
.sf-cal__clock { margin-top: 11px; padding-top: 11px; border-top: 1px solid #F0F1F4; display: flex; flex-direction: column; gap: 8px; }
.sf-cal__times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sf-cal__time, .sf-cal__tz { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sf-cal__time-l { font-size: 11px; font-weight: 700; color: #646B78; text-transform: uppercase; letter-spacing: .05em; }
.sf-cal__time-in, .sf-cal__tz-sel { height: 32px; width: 100%; box-sizing: border-box; border: 1px solid #E2E4EA; border-radius: 8px; background: #FFFFFF; color: #2A3343; font: inherit; font-size: 12.5px; font-weight: 500; padding: 0 8px; outline: none; }
.sf-cal__time-in:focus, .sf-cal__tz-sel:focus { border-color: #5B53E8; box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.14); }
.sf-cal__time-in:disabled { opacity: .55; cursor: not-allowed; background: #F7F8FA; }
.sf-cal__tz-sel { cursor: pointer; }
/* Hour : minute (: AM/PM) picker — the format follows the project country (24 h in Europe). */
.sf-cal__clockpick { display: flex; align-items: center; gap: 3px; height: 32px; border: 1px solid #E2E4EA; border-radius: 8px; background: #FFFFFF; padding: 0 4px; box-sizing: border-box; min-width: 0; }
.sf-cal__clockpick:focus-within { border-color: #5B53E8; box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.14); }
.sf-cal__clockpick.is-disabled { opacity: .55; background: #F7F8FA; cursor: not-allowed; }
.sf-cal__tp { border: none; background: transparent; font: inherit; font-size: 12.5px; font-weight: 500; color: #2A3343; padding: 0 2px; cursor: pointer; outline: none; min-width: 0; -webkit-appearance: none; appearance: none; text-align: center; }
.sf-cal__tp:disabled { cursor: not-allowed; }
.sf-cal__tp-sep { color: #646B78; font-weight: 600; font-size: 12.5px; }
.sf-cal__presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.sf-cal__preset { font-size: 11.5px; font-weight: 600; color: #5B6473; background: #F4F5F7; border: 1px solid #E6E7EC; border-radius: 7px; padding: 5px 9px; cursor: pointer; }
.sf-cal__preset:hover { background: #ECEDF1; }
.sf-cal__foot { margin-top: 12px; padding-top: 11px; border-top: 1px solid #F0F1F4; display: flex; align-items: center; gap: 8px; }
.sf-cal__label { font-size: 12px; color: #3B414C; flex: 1; font-weight: 600; }
.sf-cal__cancel { font-size: 12px; font-weight: 600; color: #5B6473; background: #FFFFFF; border: 1px solid #E6E7EC; border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.sf-cal__apply { font-size: 12px; font-weight: 600; color: #FFFFFF; background: #5B53E8; border: none; border-radius: 8px; padding: 7px 14px; cursor: pointer; }

.sf-modal-scrim { position: fixed; inset: 0; z-index: 75; background: rgba(15, 18, 26, 0.42); display: flex; align-items: center; justify-content: center; padding: 24px; }
.sf-modal { width: 420px; max-width: 100%; background: #FFFFFF; border: 1px solid #E6E7EC; border-radius: 16px; box-shadow: 0 24px 60px rgba(16, 24, 40, 0.28); padding: 22px; }
.sf-modal__head { display: flex; align-items: flex-start; gap: 13px; }
.sf-modal__icon { width: 38px; height: 38px; border-radius: 10px; background: #FFF1EC; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #D0561F; }
.sf-modal__icon svg { width: 19px; height: 19px; }
.sf-modal__title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.sf-modal__desc { margin: 7px 0 0; font-size: 13px; line-height: 1.55; color: #5B6473; }
.sf-modal__note { margin-top: 15px; display: flex; align-items: flex-start; gap: 9px; background: #FFFBF0; border: 1px solid #F5E6BE; border-radius: 10px; padding: 11px 13px; }
.sf-modal__noteicon { flex: 0 0 auto; margin-top: 1px; color: #C28A0E; display: flex; }
.sf-modal__noteicon svg { width: 16px; height: 16px; }
.sf-modal__note > div { font-size: 12.5px; line-height: 1.5; color: #6B5A2A; }
.sf-modal__note strong { color: #3B414C; }
.sf-modal__actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 9px; }
.sf-modal__cancel { font-size: 13px; font-weight: 600; color: #5B6473; background: #FFFFFF; border: 1px solid #E2E4EA; border-radius: 9px; padding: 9px 15px; cursor: pointer; }
.sf-modal__cancel:hover { background: #FAFAFB; }
.sf-modal__confirm { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #FFFFFF; background: #D0561F; border: none; border-radius: 9px; padding: 9px 15px; cursor: pointer; }
.sf-modal__confirm:hover { background: #B8481A; }

/* Smart-label "View conditions" popup — the tier/condition editor for one label. */
/* View-conditions popups (labels, positions, removal) — 2026-11-06 (user): 860px wide, AUTO height, no inner
   scroll: the BACKDROP scrolls a tall popup like a page, and the Done bar stays pinned to the bottom of the
   screen while the popup runs past it (position: sticky against the scrolling backdrop). `overflow: clip`
   keeps the rounded corners without making the popup its own scroll box (which would break the sticky bar). */
.sf-lblmodal-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(15, 18, 26, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 28px; overflow-y: auto; overscroll-behavior: contain; }
.sf-lblmodal { width: 860px; max-width: 100%; margin: auto 0; display: flex; flex-direction: column; background: #FFFFFF; border-radius: 16px; box-shadow: 0 28px 64px rgba(16, 24, 40, 0.30); overflow: clip; }
.sf-lblmodal__head { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid #F0F1F4; flex: 0 0 auto; }
.sf-lblmodal__head .sf-slot__code { flex: 0 0 auto; }
.sf-lblmodal__title { flex: 1; margin: 0; font-size: 15px; font-weight: 700; color: #14171F; }
.sf-lblmodal__strat { flex: 0 0 190px; }
.sf-lblmodal__strat select:focus { border-color: #22A06B; box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.12); }
.sf-lblmodal__body { flex: none; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.sf-lblmodal__foot { flex: 0 0 auto; border-top: 1px solid #F0F1F4; padding: 13px 18px; display: flex; justify-content: flex-end; position: sticky; bottom: -40px; z-index: 3; background: #FFFFFF; border-radius: 0 0 16px 16px; box-shadow: 0 -6px 14px -10px rgba(16, 24, 40, 0.18); }
/* bottom = minus the overlay's bottom padding: sticky insets from the padded scrollport, so bottom:0 left a
   40px strip under the footer where the body scrolled past it visibly (QA 2026-11-08). */
@media (max-width: 640px) {
    .sf-lblmodal-overlay { padding: 16px 12px; } .sf-lblmodal__foot { bottom: -16px; }
    /* Phone: the 190px strategy select pushed the close X off the right edge — it wraps to its own row (QA 2026-11-08). */
    .sf-lblmodal__head { flex-wrap: wrap; }
    .sf-lblmodal__strat { order: 1; flex: 1 1 100%; }
}
.sf-modal__confirm svg { width: 14px; height: 14px; }

/* ── One save per channel (2026-11-03) ──────────────────────────────────────────────────────────────
   Sticky bar at the bottom of the channel column; shown only while the channel has unsaved settings
   (a section switched off included). Discard = back to the last saved state; Save = one request. */
.sf-savebar {
    position: sticky; bottom: 16px; z-index: 30; margin-top: 14px;
    display: flex; align-items: center; gap: 16px;
    background: #FFFFFF; border: 1px solid #DCD9FA; border-radius: 14px;
    box-shadow: 0 14px 36px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.06);
    padding: 12px 14px 12px 18px;
    animation: sf-savebar-in .16s ease-out;
}
@keyframes sf-savebar-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sf-savebar { animation: none; } }
.sf-savebar.has-error { border-color: #F3C9BC; }
.sf-savebar__txt { flex: 1; min-width: 0; }
.sf-savebar__title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: #14171F; }
.sf-savebar__dot { width: 8px; height: 8px; border-radius: 50%; background: #E0A526; flex: 0 0 auto; box-shadow: 0 0 0 3px #FBF1DC; }
.sf-savebar.has-error .sf-savebar__dot { background: #C0492A; box-shadow: 0 0 0 3px #FBE6DF; }
.sf-savebar__sub { margin-top: 3px; padding-left: 16px; font-size: 12px; color: #6B7280; line-height: 1.45; }
.sf-savebar__err { margin-top: 3px; padding-left: 16px; display: flex; align-items: flex-start; gap: 6px; font-size: 12px; font-weight: 600; color: #C0492A; line-height: 1.45; }
.sf-savebar__err svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
.sf-savebar__acts { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.sf-savebar .bx-ghost { padding: 10px 15px; }
.sf-savebar .bx-primary svg { width: 15px; height: 15px; }
.sf-savebar .bx-primary.is-blocked { background: #B9B6F0; cursor: not-allowed; }
.sf-savebar button:disabled { opacity: .6; cursor: default; }
.sf-tab__unsaved { color: #B7791F; font-weight: 600; }

/* "Save your changes?" dialog (switching channel / leaving the page) */
.sf-leave .sf-modal__head { align-items: flex-start; }
.sf-leave__hd { flex: 1; min-width: 0; }
.sf-leave__icon { background: #EEEDFC; color: #5B53E8; }
.sf-leave__list { margin: 14px 0 0; padding: 11px 14px 11px 30px; background: #F7F8FA; border: 1px solid #EEEFF3; border-radius: 10px; font-size: 12.5px; color: #3B414C; line-height: 1.6; }
.sf-leave .bx-primary svg { width: 15px; height: 15px; }

@media (max-width: 560px) {
    .sf-savebar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; bottom: 10px; }
    .sf-savebar__acts > button { flex: 1; justify-content: center; }
    /* Section header: title keeps the first row (next to its icon); the mode switch + toggle wrap below. */
    .sf-sec__head .sf-sec__hi { flex: 1 1 calc(100% - 52px); }
    .sf-sec__head > .sf-toggle { margin-left: auto; }
    .sf-leave .sf-modal__actions { flex-direction: column-reverse; }
    .sf-leave .sf-modal__actions > button { width: 100%; justify-content: center; }
}

@media (max-width: 860px) {
    .sf-layout { grid-template-columns: 1fr; gap: 16px; }
    .sf-rail { position: static; flex-direction: row; overflow-x: auto; }
    .sf-ai__grid, .sf-ext__steps { grid-template-columns: 1fr; }
    .sf-row, .sf-row.sf-row--rm, .sf-rulecard__foot, .sf-slot { grid-template-columns: 1fr; }
    .sf-opt-card__top { flex-wrap: wrap; }
}

/* ── AI optimization controls + review surface (feed-optimizations.js) ───────── */
.sf-ai__optctl-host { margin-top: 12px; }
.sf-optctl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; background: #F6F5FF; border: 1px solid #E4E1FA; border-radius: 12px; }
.sf-optctl__status { flex: 1; min-width: 200px; font-size: 12.5px; color: #4A4A63; }
.sf-optctl__acts { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.sf-optctl__run { padding: 9px 15px; border: 0; border-radius: 9px; background: #5B53E8; color: #FFFFFF; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.sf-optctl__run:hover:not(:disabled) { background: #4B44CC; }
.sf-optctl__run:disabled { opacity: .6; cursor: default; }
.sf-optctl__review { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border: 1px solid #D9D5F6; border-radius: 9px; background: #FFFFFF; color: #4038C4; font-size: 12.5px; font-weight: 620; cursor: pointer; }
.sf-optctl__review:hover:not(:disabled) { background: #F1F0FC; }
.sf-optctl__review:disabled { opacity: .5; cursor: default; }
.sf-optctl__badge { min-width: 18px; height: 18px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #E4A93C; color: #FFFFFF; font-size: 10.5px; font-weight: 700; }
.sf-optctl__arrow { color: #8079D6; }

.sf-opt-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(15, 18, 26, 0.48); display: flex; align-items: center; justify-content: center; padding: 24px; }
.sf-opt-modal { width: 880px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; background: #FFFFFF; border-radius: 16px; box-shadow: 0 28px 64px rgba(16, 24, 40, 0.32); overflow: hidden; }
.sf-opt-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #F0F1F4; }
.sf-opt-head__t { flex: 1; }
.sf-opt-head__t h3 { margin: 0 0 3px; font-size: 16px; font-weight: 750; color: #14171F; }
.sf-opt-head__t p { margin: 0; font-size: 12px; color: #646B78; line-height: 1.45; }

.sf-opt-tabs { display: flex; gap: 6px; padding: 12px 20px 0; flex-wrap: wrap; }
.sf-opt-tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid #ECEDF1; background: #FFFFFF; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #5B6473; cursor: pointer; }
.sf-opt-tab:hover { background: #F7F7FB; }
.sf-opt-tab.is-active { background: #EEEDFC; border-color: #C9C4F5; color: #4038C4; }
.sf-opt-tab__n { min-width: 18px; padding: 0 5px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: #EFEFF3; color: #6B7280; font-size: 10.5px; font-weight: 700; }
.sf-opt-tab.is-active .sf-opt-tab__n { background: #5B53E8; color: #FFFFFF; }

.sf-opt-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.sf-opt-loading { padding: 40px; text-align: center; color: #646B78; font-size: 13px; }
.sf-opt-empty { padding: 44px 20px; text-align: center; color: #646B78; font-size: 13px; }
.sf-opt-empty__icon { font-size: 30px; margin-bottom: 8px; }
.sf-opt-empty p { margin: 0 auto; max-width: 380px; line-height: 1.5; }

.sf-opt-card { border: 1px solid #ECEDF1; border-radius: 13px; padding: 13px 15px; transition: opacity .2s ease, transform .2s ease; }
.sf-opt-card.is-flagged { border-color: #F3D9B0; background: #FFFBF4; }
.sf-opt-card.is-leaving { opacity: 0; transform: translateY(-6px); }
.sf-opt-card__top { display: flex; gap: 12px; align-items: flex-start; }
.sf-opt-card__thumb { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 9px; overflow: hidden; background: #F4F5F7; display: flex; align-items: center; justify-content: center; }
.sf-opt-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sf-opt-card__noimg { font-size: 20px; }
.sf-opt-card__meta { flex: 1; min-width: 0; }
.sf-opt-card__title { font-size: 13.5px; font-weight: 680; color: #14171F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-opt-card__sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; font-size: 11px; color: #646B78; }
.sf-opt-card__id { font-family: ui-monospace, Menlo, monospace; }
.sf-opt-card__model { padding: 1px 6px; border-radius: 5px; background: #F2F2F6; color: #646B78; }
.sf-opt-card__gone { color: #C0813A; }
.sf-opt-state { padding: 1px 8px; border-radius: 999px; font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; }
.sf-opt-state.is-pending { background: #FEF3E2; color: #B5791F; }
.sf-opt-state.is-accepted { background: #E4F6EC; color: #1F8F55; }
.sf-opt-state.is-rejected { background: #F1F2F4; color: #646B78; }
.sf-opt-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sf-opt-flag { padding: 2px 8px; border-radius: 6px; background: #FBEEDD; color: #A2701F; font-size: 10.5px; font-weight: 600; }

.sf-opt-changes { margin-top: 11px; display: flex; flex-direction: column; gap: 5px; }
.sf-opt-changes__none { font-size: 12px; color: #646B78; }
.sf-opt-chg { display: flex; align-items: center; gap: 10px; padding: 5px 9px; border-radius: 8px; background: #FAFAFC; font-size: 12px; }
.sf-opt-chg.is-same { opacity: .62; }
.sf-opt-chg__f { flex: 0 0 96px; font-weight: 650; color: #5B6473; }
.sf-opt-chg__v { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.sf-opt-chg__before { color: #646B78; text-decoration: line-through; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-opt-chg__arrow { color: #646B78; flex: 0 0 auto; }
.sf-opt-chg__after { color: #16181D; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-opt-conf { flex: 0 0 auto; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.sf-opt-conf.is-high { background: #E4F6EC; color: #1F8F55; }
.sf-opt-conf.is-mid { background: #FEF3E2; color: #B5791F; }
.sf-opt-conf.is-low { background: #FBE7E7; color: #C0483F; }

.sf-opt-acts { display: flex; gap: 8px; margin-top: 12px; }
.sf-opt-btn { padding: 7px 15px; border-radius: 8px; border: 1px solid transparent; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.sf-opt-btn:disabled { opacity: .55; cursor: default; }
.sf-opt-btn--accept { background: #5B53E8; color: #FFFFFF; }
.sf-opt-btn--accept:hover:not(:disabled) { background: #4B44CC; }
.sf-opt-btn--revert { background: #FFFFFF; border-color: #E2E4EA; color: #5B6473; }
.sf-opt-btn--revert:hover:not(:disabled) { background: #F7F7FB; }

.sf-opt-foot { flex: 0 0 auto; border-top: 1px solid #F0F1F4; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sf-opt-bulk { flex: 0 0 auto; }
.sf-opt-pager { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sf-opt-page__n { font-size: 12px; color: #646B78; margin-right: 4px; }
.sf-opt-page { padding: 6px 12px; border: 1px solid #E2E4EA; background: #FFFFFF; border-radius: 8px; font-size: 12px; color: #5B6473; cursor: pointer; }
.sf-opt-page:hover:not(:disabled) { background: #F7F7FB; }
.sf-opt-page:disabled { opacity: .45; cursor: default; }

/* Activation block + active status (feed-optimizations.js mountOptimizerControls) */
.sf-optctl__head { display: block; font-size: 13px; font-weight: 650; color: #16181D; margin-bottom: 3px; }
.sf-optctl__head--on::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1F9D55; margin-right: 7px; vertical-align: 1px; }
.sf-optctl__line { display: block; line-height: 1.5; }
.sf-optctl.is-activate { align-items: flex-end; }
.sf-optctl__acts--col { flex-direction: column; align-items: flex-end; gap: 8px; }
.sf-optctl__all { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #4A4A63; cursor: pointer; }
.sf-optctl__all input { accent-color: #5B53E8; width: 15px; height: 15px; }
.sf-optctl__pause { padding: 9px 13px; border: 1px solid #E2E4EA; border-radius: 9px; background: #FFFFFF; color: #5B6473; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sf-optctl__pause:hover:not(:disabled) { background: #F7F7FB; }
.sf-optctl__pause:disabled { opacity: .6; cursor: default; }
/* Review modal: "More from AI" (highlights, details, FAQs, keywords …) */
.sf-opt-more { margin-top: 10px; border-top: 1px dashed #E7E8EE; padding-top: 8px; font-size: 12.5px; color: #3A3F4A; }
.sf-opt-more summary { cursor: pointer; color: #4038C4; font-weight: 600; font-size: 12px; }
.sf-opt-more__sec { margin-top: 9px; }
.sf-opt-more__lbl { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: #646B78; margin-bottom: 3px; }
.sf-opt-more__list { margin: 0; padding-left: 18px; }
.sf-opt-more__list li { margin: 2px 0; }
.sf-opt-more__details { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 3px 12px; }
.sf-opt-more__dk { color: #6B7280; }
.sf-opt-more__q { font-weight: 600; margin-top: 6px; }
.sf-opt-more__a { color: #4B5563; }
.sf-opt-more__note { font-size: 11.5px; color: #646B78; margin-bottom: 2px; }

/* Review modal: per-product section tabs (Attributes · Category · Highlights · Details · FAQs · Keywords) */
.sf-opt-sec { margin-top: 11px; font-size: 12.5px; color: #3A3F4A; }
.sf-opt-sec__tabs { display: flex; gap: 2px; border-bottom: 1px solid #ECEDF1; overflow-x: auto; scrollbar-width: none; }
.sf-opt-sec__tabs::-webkit-scrollbar { display: none; }
.sf-opt-sec__tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px 8px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #6B7280; cursor: pointer; }
.sf-opt-sec__tab:hover { color: #14171F; }
.sf-opt-sec__tab.is-active { color: #4038C4; border-bottom-color: #5B53E8; }
.sf-opt-sec__tab:focus-visible { outline: 2px solid var(--accent, #5B53E8); outline-offset: -2px; border-radius: 6px; }
.sf-opt-sec__n { min-width: 18px; padding: 0 5px; border-radius: 999px; background: #F1F2F5; color: #646B78; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.sf-opt-sec__tab.is-active .sf-opt-sec__n { background: #EEEDFC; color: #4038C4; }
.sf-opt-sec__panel { padding-top: 10px; }
.sf-opt-sec__panel > .sf-opt-changes { margin-top: 0; }

.sf-opt-cats { display: flex; flex-direction: column; gap: 8px; }
.sf-opt-cat { padding: 9px 11px; border: 1px solid #ECEDF1; border-radius: 10px; background: #FAFAFC; }
.sf-opt-cat__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.sf-opt-cat__lbl { font-weight: 680; color: #14171F; }
.sf-opt-cat__hint { flex: 1; min-width: 0; font-size: 11.5px; color: #646B78; }
.sf-opt-cat__tag { padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.sf-opt-cat__tag.is-mapped { background: #EEEDFC; color: #4038C4; }
.sf-opt-cat__tag.is-new { background: #E4F6EC; color: #1F8F55; }
.sf-opt-cat__tag.is-same { background: #F1F2F5; color: #646B78; }
.sf-opt-cat__tag.is-none { background: #F1F2F5; color: #646B78; }
.sf-opt-cat__grid { display: grid; grid-template-columns: 72px 1fr; gap: 5px 10px; align-items: baseline; }
.sf-opt-cat__k { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: #646B78; }
.sf-opt-cat__v { color: #16181D; word-break: break-word; }
.sf-opt-cat__v.is-empty { color: #646B78; font-style: italic; }
.sf-opt-cat__path { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; color: #5B6473; }
.sf-opt-cat__seg.is-leaf { color: #16181D; font-weight: 600; }
.sf-opt-cat__sep { color: #646B78; }

.sf-opt-kw { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-opt-kw__chip { padding: 3px 9px; border-radius: 999px; background: #F1F2F5; color: #3A3F4A; font-size: 12px; }

@media (max-width: 640px) {
    .sf-opt-cat__grid { grid-template-columns: 1fr; gap: 2px; }
    .sf-opt-cat__hint { order: 9; flex-basis: 100%; }
    .sf-opt-cat__k { margin-top: 4px; }
    .sf-optctl.is-activate { align-items: stretch; }
    .sf-optctl__acts--col { align-items: stretch; width: 100%; }
    .sf-opt-more__details { grid-template-columns: 1fr; }
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    .sf-optctl { background: #201F33; border-color: #34305A; }
    .sf-optctl__head { color: #F0F1F4; }
    .sf-optctl__all { color: #C4C2D6; }
    .sf-optctl__pause { background: #1A1C22; border-color: #2A2D36; color: #C4C2D6; }
    .sf-opt-more { border-color: #2A2D36; color: #646B78; }
    .sf-opt-more summary { color: #B9B4F0; }
    .sf-opt-more__dk, .sf-opt-more__a { color: #9AA1AE; }
    .sf-optctl__status { color: #C4C2D6; }
    .sf-optctl__review { background: #1A1C22; border-color: #34305A; color: #B9B4F0; }
    .sf-opt-modal { background: #1A1C22; }
    .sf-opt-head { border-color: #2A2D36; }
    .sf-opt-modal .cb-close { color: #C4C2D6; }
    .sf-opt-modal .cb-close:hover, .sf-opt-modal .cb-close:active { background: #2A2D36; color: #F0F1F4; }
    .sf-opt-modal .cb-close:focus-visible { box-shadow: 0 0 0 2px #1A1C22, 0 0 0 4px var(--accent); }
    .sf-opt-head__t h3 { color: #F0F1F4; }
    .sf-opt-foot { border-color: #2A2D36; }
    .sf-opt-card { border-color: #2A2D36; }
    .sf-opt-card.is-flagged { background: #241F14; border-color: #4A3C1E; }
    .sf-opt-card__title { color: #F0F1F4; }
    .sf-opt-chg { background: #222530; }
    .sf-opt-chg__after { color: #E8EAF0; }
    .sf-opt-sec { color: #D5D8E0; }
    .sf-opt-sec__tabs { border-color: #2A2D36; }
    .sf-opt-sec__tab { color: #9AA1AE; }
    .sf-opt-sec__tab:hover { color: #F0F1F4; }
    .sf-opt-sec__tab.is-active { color: #B9B4F0; border-bottom-color: #8C86F0; }
    .sf-opt-sec__n { background: #2A2D36; color: #9AA1AE; }
    .sf-opt-sec__tab.is-active .sf-opt-sec__n { background: #2C2950; color: #B9B4F0; }
    .sf-opt-cat { background: #222530; border-color: #2A2D36; }
    .sf-opt-cat__lbl, .sf-opt-cat__v, .sf-opt-cat__seg.is-leaf { color: #F0F1F4; }
    .sf-opt-cat__path { color: #B4B9C4; }
    .sf-opt-cat__tag.is-mapped { background: #2C2950; color: #B9B4F0; }
    .sf-opt-cat__tag.is-new { background: #173527; color: #6FD39E; }
    .sf-opt-cat__tag.is-same, .sf-opt-cat__tag.is-none { background: #2A2D36; color: #9AA1AE; }
    .sf-opt-kw__chip { background: #2A2D36; color: #D5D8E0; }
}

/* ── Advanced mode, redesigned 2026-10-31 ───────────────────────────────────────────────────────────
   One bounded PANEL per feed column (numbered header band + body). Inside the main-image panel the
   rules read as a flow: IF / ELSE IF / OTHERWISE keywords in a left gutter joined by a rail, each
   rule a card with labelled zones (When the product matches · Show · Live). Additional images are
   numbered POSITION cards with the same zones. Conditions keep the Rules-engine chrome (rules.css). */
.sf-legend { display: flex; align-items: flex-start; gap: 10px; background: #F7F6FE; border: 1px solid #E4E1FB; border-radius: 10px; padding: 11px 14px; }
.sf-legend .sf-info__icon { color: #5B53E8; margin-top: 1px; }
.sf-legend__txt { font-size: 12.5px; line-height: 1.5; color: #5A5470; }
.sf-legend__txt strong { color: #2A2540; }
.sf-legend__steps { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 7px; }
.sf-legend__step { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #4A4560; }

.sf-kw { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; height: 22px; padding: 0 8px; border-radius: 6px;
         background: #5B53E8; color: #FFFFFF; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.sf-kw--else { background: #EEF0F4; color: #4B5563; }
.sf-kw--sm { min-width: 40px; height: 19px; font-size: 9.5px; }

.sf-panel { border: 1px solid #E3E5EB; border-radius: 14px; background: #FFFFFF; overflow: hidden; }
.sf-panel + .sf-panel { margin-top: 4px; }
.sf-panel__head { display: flex; align-items: center; gap: 11px; padding: 12px 16px; background: #F8F9FB; border-bottom: 1px solid #E9EBF0; }
.sf-panel__num { width: 24px; height: 24px; border-radius: 7px; background: #1F2430; color: #FFFFFF; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sf-panel__titles { flex: 1 1 auto; min-width: 0; }
.sf-panel__titlerow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sf-panel__title { font-size: 14px; font-weight: 700; color: #14171F; }
.sf-panel__aside { font-size: 11.5px; color: #6B7280; white-space: nowrap; }
.sf-panel__body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.sf-panel__lead { margin: 0; font-size: 12.5px; line-height: 1.5; color: #5B6473; }

.sf-field { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 4px 12px; }
.sf-field__label { font-size: 12px; font-weight: 600; color: #3B414C; }
.sf-field__help { grid-column: 2; font-size: 11.5px; color: #646B78; }
.sf-field .sf-collabel.is-invalid + .sf-field__help { color: #B4533A; }

/* the decision flow */
.sf-flow { display: flex; flex-direction: column; gap: 0; }
.sf-flow__step { position: relative; display: grid; grid-template-columns: 78px 1fr; gap: 0 10px; padding-bottom: 12px; }
.sf-flow__gutter { position: relative; display: flex; justify-content: center; padding-top: 12px; }
/* the rail joining IF → ELSE IF → OTHERWISE */
.sf-flow__step::before { content: ''; position: absolute; left: 38px; top: 36px; bottom: 0; width: 2px; background: #E4E1FB; }
.sf-flow__step--else::before { display: none; }
.sf-flow__card { border: 1px solid #E6E8EE; border-radius: 12px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(20, 23, 31, .04); overflow: hidden; }
.sf-flow__card--else { background: #FAFBFC; border-style: dashed; }
.sf-flow__head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #F0F1F4; background: #FCFCFD; }
.sf-flow__title { font-size: 12.5px; font-weight: 700; color: #1F2430; }
.sf-flow__sub { font-size: 11.5px; color: #646B78; flex: 1 1 auto; }
.sf-flow__empty { border: 1px dashed #DADDE4; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: #6B7280; background: #FBFBFC; margin: 0 0 12px 88px; }
.sf-slots > .sf-flow__empty { margin-left: 0; }
.sf-flow__add { align-self: flex-start; margin: 0 0 12px 88px; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer;
                padding: 8px 14px; border-radius: 9px; color: #5B53E8; background: #F4F3FE; border: 1px dashed #CFCBF6; font-family: inherit; }
.sf-flow__add:hover { background: #EEEDFC; border-color: #B9B3F2; }
.sf-flow__add svg { width: 14px; height: 14px; }

/* zones inside a card */
.sf-zone { padding: 11px 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.sf-zone + .sf-zone { border-top: 1px solid #F0F1F4; }
.sf-zone--if { flex-direction: column; align-items: stretch; }
.sf-zone--if > .sf-zone__label { margin-bottom: 1px; }
.sf-zone--show { background: #FBFCFE; }
.sf-flow__card--else .sf-zone--show { background: transparent; }
.sf-zone--show .sf-row__select { flex: 1 1 260px; min-width: 0; }
.sf-zone__label { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #6B7280; white-space: nowrap; }
.sf-zone__label svg { width: 13px; height: 13px; }
.sf-zone--show > .sf-zone__label:first-child { color: #15803D; min-width: 52px; }
.sf-zone__live { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: 4px; }
.sf-zone__live .sf-zone__label { color: #6B7280; }
.sf-zone__note { margin: 0; padding: 0 12px 11px; font-size: 11.5px; color: #646B78; }
.sf-zone__all { font-size: 12.5px; font-weight: 600; color: #3B414C; }
/* Image / video position tiers (the Smart-custom-labels modal, adapted to creatives). */
.sf-pos__summary { flex: 1 1 260px; min-width: 0; }
/* (.sf-posmodal uses the shared 860px .sf-lblmodal width — 2026-11-06) */
.sf-posmodal__lead { margin: 0 0 12px; font-size: 12.5px; color: #5B6473; line-height: 1.45; }
/* View-conditions popups: Discard / Save footer that activates on changes (2026-11-06) */
.sf-popfoot { align-items: center; gap: 10px; }
.sf-popfoot__status { flex: 1 1 auto; min-width: 0; font-size: 12px; color: #646B78; display: inline-flex; align-items: center; gap: 7px; }
.sf-popfoot__status.is-dirty { color: #14171F; font-weight: 600; }
.sf-popfoot__status.is-dirty::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #F59E0B; flex: 0 0 auto; }
.sf-popfoot button:disabled { opacity: .45; cursor: not-allowed; }
.cnd-tier__out .sf-pick, .cnd-fallback .sf-pick { flex: 1 1 auto; min-width: 0; }
.sf-posmodal .cnd-tiers-host + .sf-zone__note { padding: 6px 2px 0; }

/* additional-image / video position cards */
.sf-slots { display: flex; flex-direction: column; gap: 10px; }
.sf-slotcard { border: 1px solid #E6E8EE; border-radius: 12px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(20, 23, 31, .04); overflow: hidden; }
.sf-slotcard__head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #FCFCFD; border-bottom: 1px solid #F0F1F4; }
.sf-slotcard__pos { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5B53E8; background: #EEEDFC; border-radius: 6px; padding: 4px 8px; white-space: nowrap; }
.sf-slotcard__name { flex: 1 1 auto; min-width: 0; }

@media (max-width: 720px) {
    .sf-field { grid-template-columns: 1fr; }
    .sf-field__help { grid-column: 1; }
    .sf-flow__step { grid-template-columns: 1fr; }
    .sf-flow__gutter { justify-content: flex-start; padding: 0 0 6px; }
    .sf-flow__step::before { display: none; }
    .sf-flow__empty, .sf-flow__add { margin-left: 0; }
    .sf-panel__head { flex-wrap: wrap; }
    .sf-panel__aside { white-space: normal; }
}
.sf-zone--forall { flex-direction: row; align-items: center; }
.sf-zone--forall > .sf-zone__label { margin-bottom: 0; min-width: 52px; }

/* ── "One template / Random from list" picker (2026-11-01) — every position, tier and "Everything
   else" (pickControl in js/supplemental-feeds/supplemental-feeds.js). One mode: the toggle + the
   usual select on one line. Random mode: the toggle, then the list as chips + an "Add template"
   select, then a one-line hint. Same 8px radius / #E2E4EA borders as .sf-select, accent chips. */
.sf-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.sf-pick__mode { padding: 2px; }
.sf-pick__mode .sf-seg__btn { font-size: 11px; padding: 4px 9px; white-space: nowrap; }
.sf-pick__one { flex: 1 1 200px; min-width: 0; }
.sf-pick.is-random { flex-direction: column; align-items: stretch; }
.sf-pick.is-random .sf-pick__mode { align-self: flex-start; }
.sf-pick__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.sf-pick__chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; padding: 4px 4px 4px 9px; border-radius: 7px; border: 1px solid #D9D6FA; background: #EEEDFC; color: #3A33B8; font-size: 12px; font-weight: 600; line-height: 1.2; }
.sf-pick__chipname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sf-pick__chipx { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: none; border-radius: 5px; background: transparent; color: #6B66C9; cursor: pointer; }
.sf-pick__chipx:hover { background: rgba(91, 83, 232, .14); color: #3A33B8; }
.sf-pick__chipx svg { width: 12px; height: 12px; }
.sf-pick__add { flex: 0 1 200px; min-width: 140px; }
.sf-pick__add select { padding: 5px 26px 5px 9px; font-size: 12px; color: #5B53E8; font-weight: 600; border-style: dashed; }
.sf-pick__none { font-size: 12px; color: #646B78; }
.sf-pick__hint { margin: 0; font-size: 11.5px; line-height: 1.4; color: #6B7280; }
.sf-pick__hint.is-warn { color: #B45309; }
.sf-row .sf-pick.is-random { align-self: start; }
@media (max-width: 640px) {
    .sf-pick__add { flex: 1 1 100%; }
}
@media (prefers-color-scheme: dark) {
    .sf-pick__chip { background: #26234A; border-color: #3B3670; color: #C9C5FA; }
    .sf-pick__chipx { color: #A9A4F0; }
    .sf-pick__hint { color: #9AA1AE; }
    .sf-pick__hint.is-warn { color: #F2B260; }
}

/* ── Template picker with previews (js/shared/thumb-select.js, 2026-11-04) ─────────────────── */
.ts { position: relative; display: flex; min-width: 0; }
.ts__btn { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 38px; padding: 4px 8px 4px 5px; border: 1px solid #E2E4EA; border-radius: 8px; background: #FFFFFF; color: #14171F; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.ts__btn:hover { border-color: #C9CDD6; }
.ts__btn:focus-visible, .ts__btn[aria-expanded="true"] { outline: none; border-color: #9099A6; box-shadow: 0 0 0 3px rgba(144, 153, 166, 0.14); }
.ts__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts__meta { flex: 0 0 auto; color: #646B78; font-size: 11.5px; }
.ts__chev { flex: 0 0 auto; display: inline-flex; color: #646B78; }
.ts__thumb { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 5px; overflow: hidden; background: #F1F2F5; border: 1px solid #E6E8EE; }
.ts__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ts__thumb.is-empty { background: repeating-linear-gradient(45deg, #F4F5F8 0 4px, #ECEEF2 4px 8px); }
.ts__thumb--lg { width: 40px; height: 40px; border-radius: 6px; }
.ts__thumb--chip { width: 20px; height: 20px; border-radius: 4px; margin-left: -5px; }
.sf-pick__add .ts__btn { min-height: 32px; border-style: dashed; color: #5B53E8; font-weight: 600; font-size: 12px; }
.sf-pick__add .ts__thumb { width: 22px; height: 22px; }
.ts__list { position: fixed; z-index: 10050; max-width: min(460px, calc(100vw - 16px)); overflow-y: auto; padding: 4px; border: 1px solid #E2E4EA; border-radius: 10px; background: #FFFFFF; box-shadow: 0 12px 32px rgba(20, 23, 31, 0.16); }
.ts__opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; cursor: pointer; color: #14171F; font-size: 13px; }
.ts__opt.is-active { background: #F1F0FD; }
.ts__opt.is-selected .ts__name { font-weight: 600; color: #3A33B8; }
.ts__opttext { display: flex; flex-direction: column; min-width: 0; }
.ts__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts__optmeta { color: #646B78; font-size: 11.5px; }
@media (pointer: coarse) { .ts__opt { min-height: 44px; } }
@media (prefers-color-scheme: dark) {
    .ts__btn { background: #16181D; border-color: #2E323B; color: #E6E8EE; }
    .ts__thumb { background: #22252C; border-color: #2E323B; }
    .ts__thumb.is-empty { background: repeating-linear-gradient(45deg, #22252C 0 4px, #1C1F25 4px 8px); }
    .ts__list { background: #16181D; border-color: #2E323B; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
    .ts__opt { color: #E6E8EE; }
    .ts__opt.is-active { background: #26234A; }
    .ts__opt.is-selected .ts__name { color: #C9C5FA; }
    .sf-pick__add .ts__btn { color: #A9A4F0; }
}

/* ── Remove products from the feed (2026-11-06) — label-style tiers, no output value ── */
.sf-remove__body { padding: 16px 18px 18px; }
.sf-remove__body > .sf-footnote:first-child { margin-top: 0; margin-bottom: 12px; font-size: 12.5px; color: #5B6473; }
.sf-footnote--warn { background: #FFFBF2; border: 1px solid #F2E3C2; border-radius: 9px; padding: 9px 11px; color: #8A4B00 !important; }
.sf-remove__stat { margin: 0 0 10px; font-size: 12.5px; font-weight: 600; color: #14171F; }
.sf-tier__remove { font-size: 12px; font-weight: 600; color: #B42318; background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 999px; padding: 3px 10px; }
/* The outcome row stretches its last child (a value input / picker); the removal pill keeps its own width. */
.sf-remove .cnd-tier__out > .sf-tier__remove:last-child { flex: 0 0 auto; }

/* Remove products: live before → after counts + the small recalculating spinner (2026-11-06) */
.sf-rc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; min-height: 22px; margin: -2px 0 12px 4px; font-size: 12px; color: #14171F; }
.sf-rc:empty { display: none; }
.sf-rc.is-loading > :not(.sf-rc__spin) { opacity: .55; transition: opacity .15s; }
.sf-rc__k { color: #646B78; }
.sf-rc__arrow { color: #646B78; }
.sf-rc__rm { font-weight: 600; color: #B42318; }
.sf-rc__rm.is-zero { color: #646B78; font-weight: 500; }
.sf-rc__err { color: #B42318; }
.sf-rc--total { margin: 6px 0 4px 4px; padding: 10px 0 0; border-top: 1px solid #F0F1F4; background: transparent; font-size: 12.5px; }   /* sits on the white card — no box */
.sf-rc.is-loading .sf-rc__k { color: #646B78; }
.sf-rc__spin { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #ECEBFB; border-top-color: #8C86F5; animation: sf-rc-spin .7s linear infinite; flex: 0 0 auto; }
@keyframes sf-rc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sf-rc__spin { animation-duration: 2s; } }

/* Meta: send each build right away (2026-11-06) */
.sf-metafetch__body { padding: 10px 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.sf-metafetch__line { margin: 0; font-size: 12.5px; line-height: 1.5; color: #5B6473; }
.sf-metafetch__line.is-ok { color: #14171F; }
.sf-metafetch__line.is-ok::first-letter { color: #12805C; font-weight: 700; }
.sf-metafetch__line.is-wait { color: #646B78; }
.sf-metafetch__line.is-error { color: #B42318; }

/* Remove products: compact tier cards (the image positions' design) + the conditions popup (2026-11-06) */
.sf-rmtiers { margin-bottom: 10px; }
.sf-rmtier__brief { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: #14171F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-rmtier__brief.is-none { color: #646B78; }
/* (the red "→ REMOVE" label was dropped from the tier rows — user, 2026-11-06) */
.sf-zone .sf-rc--inline { flex: 1 1 auto; min-width: 0; margin: 0; min-height: 0; font-size: 11.5px; }
.sf-zone--remove .sf-slot__view { margin-left: auto; }
.sf-rmmodal__lead { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; color: #5B6473; }
.sf-rmmodal__counts { margin: 14px 0 4px; }
.sf-rmmodal .sf-footnote { margin-top: 10px; }
/* (.sf-rmmodal uses the shared 760px .sf-lblmodal width) */
.sf-popfoot .bx-ghost { padding: 9px 15px; }
.sf-popfoot .bx-primary svg { width: 15px; height: 15px; }
/* Feed switched off: sections hidden, settings kept (2026-11-06) */
.sf-off-note { margin: 2px 0 0; padding: 14px 16px; border: 1px dashed #E2E4EA; border-radius: 12px; font-size: 12.5px; color: #646B78; background: #FCFCFD; }
/* Remove products — Simple: one set of conditions directly in the section (2026-11-06) */
.sf-rmsimple__lead { margin: 0 0 10px; font-size: 12.5px; color: #5B6473; }
.sf-rmsimple__counts { margin: 10px 0 2px 4px; }
/* Meta fetch card — compact: one line per event, "Show more" for the earlier checks (2026-11-06) */
.sf-metafetch__ev { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 12px; line-height: 1.5; min-width: 0; }
.sf-metafetch__t { color: #646B78; white-space: nowrap; }
.sf-metafetch__f { color: #3B414C; font-weight: 600; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-metafetch__s { color: #5B6473; }
.sf-metafetch__s.is-ok { color: #12805C; font-weight: 600; }
.sf-metafetch__s.is-error { color: #B42318; }
.sf-metafetch__more { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.sf-metafetch__more.is-hidden { display: none; }
.sf-metafetch__toggle { align-self: flex-start; appearance: none; border: none; background: none; padding: 2px 0; font-size: 12px; font-weight: 600; color: #5B53E8; cursor: pointer; font-family: inherit; }
.sf-metafetch__toggle:hover { text-decoration: underline; }
/* Remove products — what a removal does: stop advertising (keep in catalog) vs hide everywhere (2026-11-06) */
.sf-rmaction { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
@media (max-width: 720px) { .sf-rmaction { grid-template-columns: 1fr; } }
.sf-rmaction__opt { display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 11px 12px; border: 1px solid #E2E4EA; border-radius: 10px; background: #fff; cursor: pointer; font-family: inherit; transition: border-color .12s, box-shadow .12s, background .12s; }
.sf-rmaction__opt:hover { border-color: #C9C5F5; }
.sf-rmaction__opt.is-on { border-color: #5B53E8; background: #F7F6FE; box-shadow: 0 0 0 3px rgba(91, 83, 232, .10); cursor: default; }
.sf-rmaction__opt:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(91, 83, 232, .25); }
.sf-rmaction__dot { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; border: 2px solid #C2C7D0; background: #fff; }
.sf-rmaction__opt.is-on .sf-rmaction__dot { border-color: #5B53E8; box-shadow: inset 0 0 0 3px #fff; background: #5B53E8; }
.sf-rmaction__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sf-rmaction__txt strong { font-size: 12.5px; color: #14171F; }
.sf-rmaction__txt span { font-size: 11.5px; color: #646B78; line-height: 1.4; }
/* Auto-refresh info icon (2026-11-07) — the explanation for everyone; the interval selector is admin-only */
.sf-refresh__info { display: inline-flex; align-items: center; color: #6B7280; cursor: help; border-radius: 50%; outline: none; }
.sf-refresh__info svg { width: 14px; height: 14px; display: block; }
.sf-refresh__info:hover, .sf-refresh__info:focus-visible { color: #5B53E8; }
.sf-refresh__info:focus-visible { box-shadow: 0 0 0 3px rgba(91, 83, 232, .25); }
/* Meta: attach automatically (2026-11-07) — card info + confirm popups */
.sf-mfa__info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 18px 16px; }
.sf-mfa__line { margin: 0; font-size: 12.5px; color: #3B414C; }
.sf-mfa__link { font-size: 12.5px; font-weight: 600; color: #5B53E8; text-decoration: none; }
.sf-mfa__link:hover { text-decoration: underline; }
.sf-mfamodal { width: 620px; }
.sf-mfa__body { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.sf-mfa__lead { margin: 0; font-size: 13px; color: #14171F; font-weight: 600; }
.sf-mfa__q { margin: 0; font-size: 12.5px; color: #3B414C; }
.sf-mfa__loading { margin: 0; font-size: 13px; color: #646B78; }
.sf-mfa__list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: #3B414C; line-height: 1.45; }
.sf-mfa__choices { display: grid; grid-template-columns: 1fr; gap: 8px; }
.sf-mfa__err { align-items: flex-start; flex-wrap: wrap; font-size: 12.5px; line-height: 1.5; }
/* The error box holds icon + text + an optional link: the link goes on its OWN line under the text (2026-11-17 — beside
   it, it was squeezed into a narrow third column). */
.sf-mfa__err > span { flex: 1 1 0; min-width: 0; }
.sf-mfa__err > .sf-mfa__link, .sf-mfa__err > .sf-mfa__linkrow { flex: 1 0 100%; margin: 2px 0 0 21px; }
.sf-mfa__linkrow { margin: 8px 0 0; }
.sf-mfa__foot { gap: 8px; box-shadow: none; position: static; }   /* a short popup: no sticky-footer shadow band */
.sf-mfa__danger { background: #B42318 !important; border-color: #B42318 !important; }
/* Merchant Center auto-attach (2026-11-17) */
.sf-gfa__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.sf-gfa__btn { padding: 6px 12px; font-size: 12.5px; }
.sf-mfa__danger:hover { background: #912018 !important; }

/* Advanced position: every applied creative as a thumbnail, ONE compact line (tiers + Everything else) — 2026-11-09 */
.sf-pos__thumbs { flex: 1 1 200px; min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; overflow-x: auto; scrollbar-width: thin; padding: 2px 0; }
.sf-pos__cell { flex: none; display: inline-flex; align-items: center; gap: 3px; cursor: default; }
.sf-pos__cell + .sf-pos__cell { padding-left: 10px; border-left: 1px solid #E6E8EE; }
.sf-pos__key { flex: none; font-size: 11px; font-weight: 600; color: #4338CA; margin-right: 1px; }
.sf-pos__imgs { display: inline-flex; gap: 3px; flex: none; }
.sf-pos__more { align-self: center; font-size: 11px; color: #5B6473; }
.sf-pos__tile { font-size: 11px; font-weight: 700; }
.sf-pos__tile--ai { background: #F4F3FE; color: #5B53E8; border-color: #DDDAF8; }
.sf-pos__tile--gone { background: #FEF3F2; color: #B42318; border-color: #FECDCA; }
.ts__thumb.is-paused { opacity: .55; }

/* Advanced position on ONE line: SHOW · creatives · schedule · View conditions (2026-11-09) */
/* the thumbnails take only the room they need, so schedule + View conditions stay beside them; a very long
   tier list (or a narrow window) wraps to the next line instead of squeezing the pictures into a scroll */
.sf-zone--oneline .sf-pos__thumbs { flex: 0 1 auto; overflow-x: visible; flex-wrap: wrap; row-gap: 6px; }
/* schedule + View conditions always sit at the RIGHT edge of the row (user, 2026-11-09) */
.sf-zone__end { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ── Field rules (2026-11-16, §B6): manual if / else per feed field ── */
.sf-frules__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.sf-frules__body > .sf-flow__empty { margin: 0; }
.sf-frules__add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sf-frules .sf-frules__add .bx-sel { width: auto; min-width: 180px; }
.sf-frule { border: 1px solid #E6E8EE; border-radius: 12px; padding: 12px 14px 14px; background: #FFFFFF; display: flex; flex-direction: column; gap: 10px; }
.sf-frule.is-off { opacity: .6; }
.sf-frule__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Field rules in a popup (2026-11-17): the card shows one line per rule, the editor opens in .sf-frmodal */
.sf-frule__sum { display: flex; align-items: center; gap: 12px; padding-top: 10px; border-top: 1px dashed #EEF0F3; }
.sf-frule__sumtxt { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: #5B6473; line-height: 1.5; overflow-wrap: anywhere; }
.sf-frule__sum .sf-slot__view { flex: 0 0 auto; margin-left: auto; }
.sf-frule__sumline { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-frule__sumline + .sf-frule__sumline { margin-top: 1px; }
.sf-frule--editor { border: none; padding: 0; }
.sf-frmodal__mode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sf-frmodal__modetxt { flex: 1 1 260px; font-size: 12.5px; color: #5B6473; line-height: 1.5; }
@media (max-width: 640px) { .sf-frule__sum { flex-wrap: wrap; } .sf-frule__sum .sf-slot__view { margin-left: 0; } }
.sf-frule__k { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #5B6473; }
.sf-frule .sf-frule__head .sf-frule__field { width: auto; flex: 0 1 240px; min-width: 160px; font-weight: 600; }
.sf-frule__hint { font-size: 11.5px; color: #646B78; }
.sf-frule__tools { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.sf-frule__valwrap { display: flex; align-items: center; gap: 6px; flex: 1 1 260px; min-width: 0; }
.sf-frule__val { flex: 1 1 auto; min-width: 0; }
.sf-frule .sf-frule__val--enum { flex: 0 1 220px; width: auto; min-width: 140px; }
.sf-frule .sf-frule__ins { flex: 0 0 auto; width: auto; max-width: 150px; font-size: 12px; }
.sf-frule__else { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.sf-frule .sf-frule__else > .bx-sel { width: auto; flex: 0 0 auto; }
.sf-frule .sf-frule__else > .sf-frule__valwrap, .sf-frule .sf-frule__else > .sf-frule__val--enum { flex: 1 1 200px; }
.sf-frule__preview { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sf-frule__pvout { width: 100%; }
.sf-frule__pvout:empty { display: none; }
.sf-frule__pvsum { margin: 0; font-size: 12.5px; color: #3B414C; }
.sf-frule__pvbad { color: #B42318; }
.sf-frule__pvtab { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; table-layout: fixed; }
.sf-frule__pvtab th { text-align: left; font-weight: 600; color: #6B7280; padding: 6px 8px; border-bottom: 1px solid #ECEEF2; }
.sf-frule__pvtab td { padding: 6px 8px; border-bottom: 1px solid #F3F4F6; vertical-align: top; overflow-wrap: anywhere; color: #14171F; }
.sf-frule__pvtab td.is-before { color: #646B78; }
.sf-frule__pvtab td.is-after { font-weight: 600; }
@media (max-width: 640px) {
    .sf-frules__body { padding: 12px; }
    .sf-frule__tools { margin-left: 0; }
    .sf-frule__valwrap { flex-wrap: wrap; }
}
@media (prefers-color-scheme: dark) {
    .sf-frule { background: #16181D; border-color: #2E323B; }
    .sf-frule__k, .sf-frule__pvsum { color: #C5CAD3; }
    .sf-frule__pvtab td { color: #E6E8EE; border-color: #23262D; }
    .sf-frule__pvtab th { border-color: #2E323B; }
}
/* Field rules — Simple mode: If [conditions] / Then set … to [value] / Otherwise … */
.sf-frule__step { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sf-frule__stepk { flex: 0 0 76px; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #5B53E8; }
.sf-frule__stepl { font-size: 12.5px; color: #5B6473; }
.sf-frule__step > .sf-frule__valwrap, .sf-frule__step > .sf-frule__else { flex: 1 1 260px; }
@media (max-width: 640px) { .sf-frule__stepk { flex-basis: 100%; } }

/* Google AI disclosure + Meta label destination (2026-11-17, §B7) */
.sf-aidisc { margin-top: 14px; border: 1px solid #E6E8EE; border-radius: 10px; padding: 12px 14px; background: #FAFBFC; }
.sf-aidisc__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sf-aidisc__title { font-size: 13px; font-weight: 600; color: #1F2430; }
.sf-aidisc__txt { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: #5B6473; }
.sf-labels__body .sf-lbltarget { margin-top: 12px; }


/* Channel health (Merchant Center / Commerce Manager, 2026-11-17) */
.sf-health__body { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.sf-health__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sf-health__when { font-size: 12px; color: #646B78; }
.sf-health__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sf-health__chip { display: inline-flex; align-items: baseline; gap: 2px; padding: 5px 10px; border-radius: 999px; background: #F2F3F6; font-size: 12px; color: #5B6473; font-variant-numeric: tabular-nums; }
.sf-health__chip strong { color: #1F2430; font-weight: 700; }
.sf-health__chip.is-bad { background: #FDECEC; color: #A12828; } .sf-health__chip.is-bad strong { color: #A12828; }
.sf-health__chip.is-warn { background: #FFF5E0; color: #8A4B00; } .sf-health__chip.is-warn strong { color: #8A4B00; }
.sf-health__chip.is-good { background: #E8F6EE; color: #1F7A45; } .sf-health__chip.is-good strong { color: #1F7A45; }
.sf-health__line { margin: 0; font-size: 12.5px; color: #5B6473; line-height: 1.5; }
.sf-health__list { display: flex; flex-direction: column; border: 1px solid #E6E8EE; border-radius: 10px; overflow: hidden; }
.sf-health__issue + .sf-health__issue { border-top: 1px solid #EEF0F4; }
.sf-health__isum { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; font-size: 12.5px; }
.sf-health__isum::-webkit-details-marker { display: none; }
.sf-health__isum:focus-visible { outline: 2px solid #5B53E8; outline-offset: -2px; }
.sf-health__sev { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.sf-health__sev.is-bad { background: #FDECEC; color: #A12828; } .sf-health__sev.is-warn { background: #FFF5E0; color: #8A4B00; }
.sf-health__iname { flex: 1 1 auto; min-width: 0; color: #1F2430; overflow-wrap: anywhere; }
.sf-health__icount { flex: 0 0 auto; color: #646B78; font-variant-numeric: tabular-nums; }
.sf-health__idet { padding: 0 12px 10px 12px; font-size: 12px; color: #5B6473; line-height: 1.5; }
.sf-health__idet p { margin: 0 0 4px; }
.sf-health__samples { color: #646B78; overflow-wrap: anywhere; }
/* Plan limits (white-label plans, 2026-11-17): over the product cap / a channel not in the plan */
.sf-plan-limit { align-items: center; margin-bottom: 12px; }
.sf-plan-limit > span { flex: 1 1 auto; }
.sf-plan-limit__btn { flex: 0 0 auto; text-decoration: none; padding: 6px 12px; font-size: 12.5px; }
/* Google popularity — Best sellers (v142) */
.sf-health__pop { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid #E6E8EE; border-radius: 10px; background: #FAFBFC; }
.sf-health__pophead { font-weight: 600; color: #1F2430; }
.sf-health__pop .sf-health__issue { border: 1px solid #EEF0F4; border-radius: 8px; background: #fff; }
.sf-health__poplist { margin: 0; padding: 0 12px 10px 32px; font-size: 12px; color: #5B6473; line-height: 1.6; overflow-wrap: anywhere; }

/* Feed health → "View products" popup (2026-11-18): each product with every issue it has. */
.sf-health__det { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed #EEF0F4; }
.sf-health__dettxt { flex: 1 1 auto; min-width: 0; color: #3B414C; overflow-wrap: anywhere; }
.sf-health__view { flex: 0 0 auto; height: 28px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.sf-health__idet > .sf-health__view { margin-top: 4px; }
.sf-hpmodal { width: 760px; max-width: calc(100vw - 32px); }
.sf-hpmodal .sf-mfa__body { max-height: min(64vh, 620px); overflow-y: auto; }
.sf-hp__cta { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #14171F; }
.sf-hp__count { margin: 0 0 8px; font-size: 12px; color: #5B6473; }
.sf-hp__list { border: 1px solid #EEF0F4; border-radius: 10px; overflow: hidden; }
.sf-hp__row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: #fff; }
.sf-hp__row + .sf-hp__row { border-top: 1px solid #EEF0F4; }
.sf-hp__thumb { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: #F4F5F8; border: 1px solid #E2E4EA; display: inline-flex; }
.sf-hp__thumb img { width: 100%; height: 100%; object-fit: contain; }
.sf-hp__thumb:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sf-hp__mid { flex: 1 1 auto; min-width: 0; }
.sf-hp__title { font-size: 13px; font-weight: 600; color: #14171F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-hp__meta { font-size: 12px; color: #6B7280; overflow-wrap: anywhere; }
.sf-hp__chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.sf-hp__chip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: #F4F5F8; color: #4B5563; overflow-wrap: anywhere; }
.sf-hp__chip.is-bad { background: #FEF3F2; color: #B42318; }
.sf-hp__chip.is-ok { background: #ECFDF3; color: #05603A; }
.sf-hp__open { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--accent, #5B53E8); text-decoration: none; white-space: nowrap; }
.sf-hp__open:hover { text-decoration: underline; }
.sf-hp__note { margin: 10px 0 0; font-size: 12px; color: #6B7280; line-height: 1.5; }
@media (max-width: 560px) { .sf-health__det { flex-wrap: wrap; } .sf-hp__open { display: none; } }
.sf-hpmodal .sf-mfa__body > * { flex-shrink: 0; }   /* the body scrolls; its children never squash (the list was clipped) */

/* AI optimization — Title protection line + editor (2026-11-25). Text ≥ 4.5:1. */
.sf-optctl__protect { flex: 1 1 100%; margin-top: 10px; padding-top: 10px; border-top: 1px solid #EEF0F3; font-size: 12.5px; color: #4B5563; }
.sf-optctl__protect-line strong { color: #14171F; font-weight: 600; }
.sf-optctl__protect-edit { margin-left: 8px; border: none; background: none; padding: 0; font: inherit; font-weight: 600; color: #4F46E5; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.sf-optctl__protect-edit:focus-visible { outline: 2px solid #5B53E8; outline-offset: 2px; border-radius: 3px; }
.sf-optctl__protect-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.sf-optctl__protect-form .bx-in { flex: 1 1 240px; min-width: 0; }
@media (prefers-color-scheme: dark) {
    .sf-optctl__protect { border-top-color: #34305A; color: #C4C2D6; }
    .sf-optctl__protect-line strong { color: #F0F1F4; }
    .sf-optctl__protect-edit { color: #A9A3FF; }
}
