/* ============================================================================
   BOOST POSTS — redesign (Boost Posts.dc.html handoff). Prefix: bx-
   Indigo accent #5B53E8; page #F5F6F8; pixel-matched to the prototype inline styles.
   ========================================================================== */
.bx { max-width: 1320px; margin: 0 auto; color: #14171F; }
.bx * { box-sizing: border-box; }
@keyframes bx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bx-bar { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* header */
.bx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.bx-h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.bx-subt { margin: 7px 0 0; font-size: 14px; color: #6B7280; }
.bx-headr { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.bx-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #5B6473; background: #fff; border: 1px solid #E2E4EA; border-radius: 9px; padding: 8px 11px; }
.bx-ghost { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #5B6473; background: #fff; border: 1px solid #E2E4EA; border-radius: 9px; padding: 8px 13px; cursor: pointer; }
.bx-ghost:hover { background: #FAFAFB; }
.bx-synced { font-size: 11px; color: #646B78; white-space: nowrap; }

/* auto-boost panel */
.bx-auto { margin-top: 22px; background: linear-gradient(180deg, #FBFAFF, #FFFFFF); border: 1px solid #E7E8EC; border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,0.04); overflow: hidden; }
.bx-auto.is-on { border-color: #D6D2F7; }
.bx-auto-head { display: flex; align-items: flex-start; gap: 13px; padding: 17px 18px; }
.bx-auto-ic { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; background: #EEEDFC; display: flex; align-items: center; justify-content: center; }
.bx-auto-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.bx-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .03em; }
.bx-badge--on { color: #15803D; background: #DCFCE7; }
.bx-badge--off { color: #6B7280; background: #F0F1F4; }
.bx-auto-desc { margin: 5px 0 0; font-size: 13px; color: #6B7280; line-height: 1.5; max-width: 680px; }
.bx-switch { width: 46px; height: 26px; border-radius: 999px; border: none; cursor: pointer; position: relative; transition: background .18s ease; padding: 0; background: #CBD0D8; flex: 0 0 auto; }
.bx-switch.is-on { background: #5B53E8; }
.bx-switch > span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,0.3); transition: left .18s ease; }
.bx-switch.is-on > span { left: 23px; }
.bx-iconbtn { width: 30px; height: 30px; border: 1px solid #E7E8EC; background: #fff; border-radius: 8px; color: #646B78; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.bx-iconbtn:hover { background: #F7F8FA; }
.bx-auto-body { border-top: 1px solid #EEEDFB; padding: 18px; animation: bx-fade .18s ease; }
.bx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; max-width: 760px; }
.bx-lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #646B78; text-transform: uppercase; margin-bottom: 6px; }
.bx-selwrap { position: relative; display: flex; align-items: center; }
.bx-sel { width: 100%; border: 1px solid #E2E4EA; border-radius: 9px; padding: 9px 30px 9px 12px; font-size: 13px; font-weight: 500; color: #2A3343; background: #fff; cursor: pointer; outline: none; -webkit-appearance: none; appearance: none; }
.bx-sel:focus { border-color: #5B53E8; }
.bx-selwrap > svg { position: absolute; right: 10px; pointer-events: none; }
/* Age range — the two ends of ONE value, side by side under a single label. min-width:0 is
   load-bearing: a flex item defaults to min-width:auto and a <select> carries a wide intrinsic
   width, so without it the pair refuses to shrink and blows the 1fr grid column out of the card. */
.bx-range { display: flex; align-items: center; gap: 8px; }
.bx-range > .bx-selwrap { flex: 1 1 0; min-width: 0; }
.bx-range > .bx-selwrap > .bx-sel { width: 100%; min-width: 0; }
.bx-range-sep { flex: 0 0 auto; color: #646B78; font-weight: 600; }
/* Searchable select (combobox). Trigger mimics .bx-sel; the panel is position:fixed
 * (JS computes coords from the trigger rect) so it never clips inside a scrollable
 * modal body and can flip above the field when there's no room below. */
.bx-ssel { position: relative; }
.bx-ssel-native { display: none; }
.bx-ssel-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid #E2E4EA; border-radius: 9px; padding: 9px 12px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; color: #2A3343; text-align: left; transition: border-color .12s, box-shadow .12s; }
.bx-ssel-trigger:hover { border-color: #D6D2F7; }
.bx-ssel.is-open .bx-ssel-trigger { border-color: #5B53E8; box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.12); }
.bx-ssel-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* chevron() returns a <span>-wrapped SVG appended last, so target the last child. */
.bx-ssel-trigger > span:last-child { flex: 0 0 auto; transition: transform .18s ease; }
.bx-ssel.is-open .bx-ssel-trigger > span:last-child { transform: rotate(180deg); }
.bx-ssel-panel { position: fixed; z-index: 200; background: #fff; border: 1px solid #E7E8EC; border-radius: 11px; box-shadow: 0 14px 38px rgba(16, 24, 40, 0.16); padding: 8px; }
.bx-ssel-search { width: 100%; box-sizing: border-box; border: 1px solid #E2E4EA; border-radius: 8px; padding: 8px 11px; font: inherit; font-size: 13px; color: #2A3343; outline: none; margin-bottom: 6px; }
.bx-ssel-search:focus { border-color: #5B53E8; box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.12); }
.bx-ssel-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
/* flex: 0 0 auto is LOAD-BEARING: the list is a height-capped column flex container and
   the row's overflow:hidden (needed for the ellipsis) zeroes its automatic min-height —
   without it, more options than fit in 240px made every row SHRINK into a clipped sliver
   (the broken campaign picker, 2026-07-13) instead of letting the list scroll. */
.bx-ssel-opt { flex: 0 0 auto; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: #2A3343; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-ssel-opt.is-active { background: #F4F5F7; }
.bx-ssel-opt.is-on { background: #EEEDFC; color: #4A43D6; font-weight: 600; }
.bx-ssel-empty { padding: 12px 10px; text-align: center; font-size: 12.5px; color: #6B7280; }
/* Campaign picker + its refresh button (auto-boost "Add to campaign", 2026-07-13):
   the searchable select flexes, the refresh sits beside it as a quiet square ghost. */
.bx-camprow { display: flex; align-items: center; gap: 6px; }
.bx-camprow .bx-ssel { flex: 1; min-width: 0; }
.bx-camprefresh { flex: 0 0 auto; width: 36px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #E2E4EA; border-radius: 9px; background: #fff; color: #6B7280; cursor: pointer; }
.bx-camprefresh:hover { border-color: #5B53E8; color: #5B53E8; }
.bx-camprefresh:disabled { opacity: 0.6; cursor: default; }
.bx-camprefresh.is-busy svg { animation: bx-refspin 0.9s linear infinite; }
@keyframes bx-refspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bx-camprefresh.is-busy svg { animation: none; } }
.bx-inwrap { display: flex; align-items: center; border: 1px solid #E2E4EA; border-radius: 9px; padding: 0 12px; background: #fff; }
.bx-inwrap:focus-within { border-color: #5B53E8; }
.bx-pre { font-size: 13px; color: #6B7280; font-weight: 600; }
.bx-suf { font-size: 12px; color: #646B78; }
.bx-in { flex: 1; border: none; outline: none; font-size: 13px; padding: 9px 6px; background: none; color: #2A3343; min-width: 0; }
.bx-section { margin-top: 16px; padding-top: 15px; border-top: 1px dashed #EAEBF0; }
.bx-section-t { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #646B78; text-transform: uppercase; margin-bottom: 11px; }
.bx-note { margin: 11px 0 0; font-size: 11.5px; color: #6B7280; line-height: 1.5; max-width: 760px; }
/* Nothing on this Page can run as a sales ad, so the list stands down and shows everything with
   a reason on each card. Without a line saying so, a wall of dimmed cards reads as a broken
   integration rather than an answer — so this one carries weight the quiet grey note does not. */
.bx-note--warn { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 13px; font-size: 12px; color: #7A5B12; background: #FEF8E7; border: 1px solid #F2E3B8; border-radius: 10px; line-height: 1.55; }
.bx-check { display: inline-flex; align-items: center; gap: 9px; background: none; border: none; cursor: pointer; padding: 0; }
.bx-checkbox { width: 18px; height: 18px; border-radius: 5px; border: 2px solid #CBD0D8; background: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.bx-checkbox.is-on { border-color: #5B53E8; background: #5B53E8; }
.bx-check-lbl { font-size: 13.5px; font-weight: 600; color: #2A3343; }

/* Segmented cards inside the auto-boost panel (Default campaign / Auto-pause / Scale / Reach gate).
   Each config group becomes its own bordered card; guardrail cards put the enable checkbox in the
   header and tint indigo when on. */
.bx-auto-card { margin-top: 13px; border: 1px solid #E7E8EC; border-radius: 12px; background: #fff; padding: 15px 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03); }
.bx-auto-card:first-child { margin-top: 0; }
.bx-auto-card__head { display: flex; align-items: flex-start; gap: 10px; }
.bx-auto-card__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bx-auto-card__title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.005em; color: #1F2430; }
.bx-auto-card__sub { font-size: 11.5px; color: #646B78; line-height: 1.45; }
.bx-auto-card__body { margin-top: 13px; }
.bx-auto-card__body:empty { display: none; }
/* Guardrail cards — the whole header row is the enable checkbox. */
.bx-auto-card--guard { background: #FCFCFE; }
.bx-auto-card--guard .bx-auto-card__toggle { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; }
.bx-auto-card--guard .bx-auto-card__toggle .bx-checkbox { margin-top: 1px; }
.bx-auto-card--guard.is-on { border-color: #D6D2F7; background: #FBFAFF; box-shadow: 0 1px 2px rgba(91, 83, 232, 0.06); }
.bx-auto-card--guard:not(.is-on) .bx-auto-card__sub { color: #A2A9B5; }

.bx-rule { margin-top: 13px; background: #FAFAFB; border: 1px solid #EDEFF2; border-radius: 11px; padding: 14px 15px; }
.bx-rule-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; font-size: 13px; color: #2A3343; line-height: 1.7; }
.bx-rule-row b { font-weight: 600; }
/* Each half of the rule ("…spent at least $X" / "and its ROAS < Y") stays on one
   line as a unit, so a narrow popup wraps between clauses, never mid-phrase. */
.bx-clause { display: inline-flex; align-items: center; gap: 8px; }
.bx-pill-in { display: inline-flex; align-items: center; background: #fff; border: 1px solid #D7DAE1; border-radius: 8px; overflow: hidden; }
.bx-pill-in input { border: none; outline: none; font-size: 13px; font-weight: 600; color: #14171F; background: none; padding: 8px; width: 54px; }
.bx-pill-selwrap { position: relative; display: inline-flex; align-items: center; }
.bx-pill-sel { appearance: none; -webkit-appearance: none; border: 1px solid #D7DAE1; border-radius: 8px; padding: 8px 26px 8px 11px; font-size: 13px; font-weight: 600; color: #14171F; background: #fff; cursor: pointer; outline: none; }
.bx-pill-sel:focus { border-color: #5B53E8; }
.bx-pill-selwrap > svg { position: absolute; right: 9px; pointer-events: none; }
.bx-op { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 34px; padding: 0 9px; font-size: 14px; font-weight: 700; color: #5B53E8; background: #EEEDFC; border-radius: 8px; }
/* Boost guardrails (auto-pause + budget scale-up) render with the SAME .rules-group / .rules-leaf
   chrome as the main Rules builder (css/rules.css, loaded app-wide; DOM built by the ruleGroup/
   ruleLeaf helpers in boost-tab.js). The boost panel + per-post modal are NARROWER than the rules
   builder column, so here we let the leaf WRAP and drop the fixed-field min-widths so a 2-control
   leaf fits; and we de-grey the fixed (disabled) field dropdowns so they read as pills, not broken. */
/* Applies in BOTH the manual modal (.bx-section) AND the auto-boost panel's guardrail cards
   (.bx-auto-card) — a boost guardrail rule renders identically in either container. */
:is(.bx-section, .bx-auto-card) .rules-conditions { margin-top: 12px; }
:is(.bx-section, .bx-auto-card) .rules-leaf { flex-wrap: wrap; gap: 7px 8px; }
:is(.bx-section, .bx-auto-card) .rules-leaf__metric,
:is(.bx-section, .bx-auto-card) .rules-leaf__window { min-width: 0; flex-shrink: 1; }
/* Tighten ONLY the 2+-leaf AND group's rail gutter (it has a rail child). NEVER touch a
   single-leaf `--norail` group: its body is one child (the children column), so forcing a
   2-track grid here crushes the whole leaf into the first 40px track (the budget "Only while"
   dropdown-collapse bug). --norail keeps its default `grid-template-columns: 1fr` full width. */
:is(.bx-section, .bx-auto-card) .rules-group:not(.rules-group--norail) > .rules-group__body { grid-template-columns: 40px 1fr; }
:is(.bx-section, .bx-auto-card) .rules-leaf select:disabled { opacity: 1; color: var(--rules-text, #1f2937); background: #fff; cursor: default; }

/* "Scale budget while it performs" — the schedule sub-panel (cadence/step/cap rows) above the
   Rules-engine condition leaf. The bare value inputs here aren't inside a .rules-leaf, so they
   need the same border/padding the leaf inputs get — this is what made the section look unpolished. */
.bx-scale { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.bx-scale-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bx-scale .rules-leaf__value-input {
    border: 1px solid var(--rules-border, rgba(15, 23, 42, 0.12));
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 13px;
    background: #fff;
    color: var(--rules-text, #1f2937);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bx-scale .rules-leaf__value-input:focus { border-color: var(--accent, #5B53E8); box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.12); }
.bx-scale-while { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: #5A6473; margin: 14px 0 5px; }
/* Refresh button busts every cache — spin the icon while it re-pulls. */
@keyframes bx-spin { to { transform: rotate(360deg); } }
.bx-ghost.is-spinning svg { animation: bx-spin .7s linear infinite; }
.bx-ghost:disabled { opacity: .65; cursor: default; }
.bx-primary { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #fff; background: #5B53E8; border: none; border-radius: 9px; padding: 10px 18px; cursor: pointer; }
.bx-primary:hover { background: #4A43D6; }
.bx-primary:disabled { opacity: .6; cursor: default; }
.bx-saverow { margin-top: 16px; display: flex; align-items: center; gap: 12px; }

/* tabs */
.bx-tabs { margin-top: 24px; display: flex; align-items: center; gap: 7px; background: #ECEDF1; border-radius: 11px; padding: 4px; width: fit-content; }
.bx-tab { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #6B7280; background: transparent; border: none; border-radius: 8px; padding: 7px 15px; cursor: pointer; }
.bx-tab.is-on { color: #14171F; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,0.12); }
.bx-tab-count { font-size: 11px; font-weight: 700; color: #646B78; background: #E6E8EC; padding: 1px 7px; border-radius: 999px; }
.bx-tab.is-on .bx-tab-count { color: #5B53E8; background: #EEEDFC; }

/* suggested toolbar + grid */
.bx-pane { animation: bx-fade .18s ease; }
.bx-toolbar { margin-top: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bx-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #E2E4EA; border-radius: 9px; padding: 8px 11px; flex: 1; min-width: 220px; max-width: 340px; }
.bx-search input { flex: 1; min-width: 0; border: none; outline: none; font-size: 13px; background: none; color: #14171F; }
.bx-aichip { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #6B7280; background: #F0F1F4; border: 1px solid #E6E7EC; border-radius: 8px; padding: 6px 11px; }
/* Insights-permission hint (reach/views need read_insights) — subtle amber banner. */
.bx-insights-note { margin-top: 12px; display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: #7A4E00; background: #FFF7E8; border: 1px solid #F4E2BC; border-radius: 10px; padding: 9px 13px; }
.bx-insights-note svg { flex: 0 0 auto; }
.bx-insights-note b { font-weight: 700; }
.bx-insights-relink { margin-left: auto; flex: 0 0 auto; color: #5B53E8; font-weight: 600; text-decoration: none; white-space: nowrap; }
.bx-insights-relink:hover { text-decoration: underline; }
.bx-postgrid { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); gap: 14px; }
.bx-card { background: #fff; border: 1px solid #E9EAEE; border-radius: 13px; padding: 15px 16px; cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,0.04); display: flex; flex-direction: column; }
.bx-card:hover { border-color: #D9D5F7; box-shadow: 0 4px 14px rgba(91,83,232,0.08); }
.bx-card.is-pick { border-color: #CDD2DC; box-shadow: 0 0 0 2px rgba(42,51,67,0.12); }
.bx-card.is-dim { opacity: .72; }
.bx-thumb { position: relative; flex: 0 0 auto; border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bx-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bx-card-top { display: flex; gap: 13px; }
.bx-caprow { display: flex; align-items: flex-start; gap: 8px; }
.bx-cap { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: #1C2330; flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bx-rationale { margin: 6px 0 0; font-size: 11.5px; font-style: italic; color: #646B78; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bx-pick { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: #fff; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.bx-promo { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: #9A6B0E; background: #FBF1DC; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.bx-card-foot { margin-top: 13px; padding-top: 12px; border-top: 1px solid #F0F1F4; display: flex; align-items: center; gap: 14px; }
.bx-score { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 7px; }
.bx-stats { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: #6B7280; }
.bx-stat { display: inline-flex; align-items: center; gap: 4px; }
.bx-boost { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #fff; background: #5B53E8; border: none; border-radius: 8px; padding: 8px 15px; cursor: pointer; }
.bx-boost:hover { background: #4A43D6; }
.bx-boost.is-off { color: #5B6473; background: #EEF0F3; }
.bx-boost.is-off:hover { background: #E3E6EB; }
.bx-empty { margin-top: 18px; background: #fff; border: 1px dashed #DCDEE5; border-radius: 13px; padding: 48px; text-align: center; }
.bx-empty-ic { display: inline-flex; width: 46px; height: 46px; border-radius: 12px; background: #EEEDFC; align-items: center; justify-content: center; margin-bottom: 14px; }
.bx-empty-t { font-size: 15px; font-weight: 600; color: #5B6473; }
.bx-empty-d { font-size: 13px; color: #6B7280; margin-top: 5px; }
.bx-muted { font-size: 13px; color: #6B7280; margin-top: 18px; }

/* history */
.bx-histbar { margin-top: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bx-histfilters { display: flex; align-items: center; gap: 5px; background: #fff; border: 1px solid #E2E4EA; border-radius: 9px; padding: 3px; }
.bx-hf { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #5B6473; background: transparent; border: none; border-radius: 7px; padding: 6px 11px; cursor: pointer; }
.bx-hf.is-on { color: #5B53E8; background: #EEEDFC; }
.bx-hf-count { font-size: 10px; font-weight: 700; color: #646B78; background: #F1F2F4; padding: 1px 6px; border-radius: 999px; }
.bx-hf.is-on .bx-hf-count { color: #5B53E8; background: rgba(91,83,232,0.14); }
.bx-histtotal { margin-left: auto; font-size: 12px; color: #646B78; }
.bx-histlist { margin-top: 18px; display: flex; flex-direction: column; gap: 11px; }
.bx-hrow { background: #fff; border: 1px solid #E9EAEE; border-radius: 13px; padding: 15px 16px; box-shadow: 0 1px 2px rgba(16,24,40,0.04); }
.bx-hrow.is-autopaused { border-color: #F2E4C4; }
.bx-hrow-top { display: flex; gap: 14px; align-items: flex-start; }
.bx-hrow-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 5px; }
.bx-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
/* Only the DOT (first child) is the 6px circle — NOT the label span, or "Active"/"Paused" gets
   clamped to 6px wide and clipped to "Activ"/"Paus". flex-shrink:0 keeps the dot perfectly round. */
.bx-status > span:first-child { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; }
.bx-src { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.bx-src--auto { color: #5B53E8; background: #EEEDFC; }
.bx-src--manual { color: #5B6473; background: #F1F2F4; }
.bx-hrow-meta { font-size: 11.5px; color: #646B78; }
.bx-hrow-cap { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.45; color: #1C2330; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.bx-kpis { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; padding-left: 6px; }
.bx-kpi { text-align: right; }
.bx-kpi-l { font-size: 10px; font-weight: 700; letter-spacing: .03em; color: #646B78; text-transform: uppercase; }
.bx-kpi-v { font-size: 15px; font-weight: 700; color: #1C2330; margin-top: 2px; }
.bx-reason { margin-top: 11px; display: flex; align-items: flex-start; gap: 8px; border-radius: 9px; padding: 9px 11px; font-size: 11.5px; line-height: 1.5; }
.bx-reason--auto { background: #FDF8EC; border: 1px solid #F2E4C4; color: #8A6520; }
.bx-reason--norm { background: #F7F8FA; border: 1px solid #EDEFF2; color: #6B7280; }
.bx-hrow-foot { margin-top: 12px; padding-top: 11px; border-top: 1px solid #F0F1F4; display: flex; align-items: center; gap: 10px; }
.bx-tgl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.bx-tgl--pause { color: #5B6473; background: #F2F3F6; border: 1px solid #E6E7EC; }
.bx-tgl--resume { color: #15803D; background: #DCFCE7; border: 1px solid #C8F0D5; }
.bx-reboost { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #5B53E8; background: #EEEDFC; border: 1px solid #E0DCFB; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.bx-reboost:hover { background: #E6E3FB; }
.bx-adslink { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #5B53E8; text-decoration: none; }
/* Guardrail history (v66 boost_events) — the per-boost "History" button + its modal:
   what the worker did (auto-pause / budget increase), when, from which sum to which sum. */
.bx-evbtn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #5B6473; background: #FFFFFF; border: 1px solid #E2E4EA; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-family: inherit; }
.bx-evbtn:hover { border-color: #5B53E8; color: #5B53E8; }
.bx-evmodal { width: 480px; max-width: 100%; max-height: 82vh; display: flex; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(16,24,40,0.4); animation: bx-fade .15s ease; }
.bx-evhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid #ECEDF1; }
.bx-evhead h3 { margin: 0; font-size: 15px; font-weight: 700; color: #14171F; }
.bx-evsub { margin: 3px 0 0; font-size: 12px; color: #646B78; line-height: 1.4; }
.bx-evlist { padding: 12px 18px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.bx-evrow { flex: 0 0 auto; border: 1px solid #ECEDF1; border-left-width: 3px; border-radius: 9px; padding: 9px 12px; }
.bx-evrow.is-scale { border-left-color: #2FA45B; }
.bx-evrow.is-pause { border-left-color: #E5A13A; }
.bx-evrow-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bx-evrow-what { font-size: 12.5px; font-weight: 700; color: #2A3343; }
.bx-evrow.is-scale .bx-evrow-what { color: #15803D; }
.bx-evrow.is-pause .bx-evrow-what { color: #9A6B0E; }
.bx-evrow-when { font-size: 11px; color: #6B7280; white-space: nowrap; }
.bx-evrow-sum { margin-top: 3px; font-size: 12.5px; font-weight: 600; color: #14171F; }
.bx-evrow-why { margin-top: 3px; font-size: 11.5px; color: #6B7280; line-height: 1.45; }
.bx-evempty { padding: 18px 6px; font-size: 12.5px; color: #646B78; text-align: center; line-height: 1.5; }

/* modal */
.bx-modal-bg { position: fixed; inset: 0; z-index: 70; background: rgba(15,18,26,0.55); display: flex; align-items: center; justify-content: center; padding: 28px; animation: bx-fade .15s ease; }
.bx-modal { display: flex; width: 920px; max-width: 100%; max-height: 90vh; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(16,24,40,0.4); }
.bx-modal-l { width: 380px; flex: 0 0 auto; background: #FAFAFB; border-right: 1px solid #ECEDF1; padding: 22px; display: flex; flex-direction: column; }
.bx-modal-l-head { display: flex; align-items: center; gap: 9px; }
.bx-modal-cap { margin: 14px 0 0; font-size: 13px; line-height: 1.55; color: #2A3343; }
.bx-modal-stats { margin-top: 14px; display: flex; align-items: center; gap: 14px; font-size: 12px; color: #6B7280; }
.bx-modal-r { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bx-modal-rh { padding: 20px 22px 0; display: flex; align-items: flex-start; gap: 10px; }
.bx-modal-t { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.bx-modal-st { font-size: 12.5px; color: #6B7280; margin-top: 3px; }
.bx-modal-body { flex: 1; overflow-y: auto; padding: 18px 22px 4px; }
.bx-modal-foot { padding: 14px 22px; border-top: 1px solid #ECEDF1; display: flex; align-items: center; gap: 10px; }
.bx-cancel { font-size: 13px; font-weight: 600; color: #5B6473; background: #fff; border: 1px solid #E2E4EA; border-radius: 9px; padding: 10px 16px; cursor: pointer; }
.bx-cancel:hover { background: #F7F8FA; }
.bx-why { margin-top: auto; padding-top: 18px; }
.bx-why-box { background: #EEEDFC; border: 1px solid #E0DCFB; border-radius: 10px; padding: 12px 13px; }
.bx-why-h { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; color: #5B53E8; letter-spacing: .03em; text-transform: uppercase; }
.bx-why-p { margin: 7px 0 0; font-size: 12px; color: #4A4470; line-height: 1.5; }

/* toast */
.bx-toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 90; display: inline-flex; align-items: center; gap: 9px; background: #14171F; color: #fff; font-size: 13px; font-weight: 600; padding: 12px 18px; border-radius: 11px; box-shadow: 0 10px 30px rgba(16,24,40,0.35); animation: bx-bar .2s ease; }

/* ── Mobile ──────────────────────────────────────────────────────────────────
   One field per row. The base `.bx-grid2` is a hard `1fr 1fr`, and this file had
   no width media query at all — so on a 320px phone (content is ~208px behind the
   80px rail) each column is ~95px, leaving a select ~40px of text box after its
   padding. Nothing OVERFLOWS, which is why a 375px sweep passes it: the labels are
   simply clipped, so "All genders" renders as a couple of characters and the field
   stops being readable rather than visibly broken.

   Placed at the END of the file on purpose — a @media block adds no specificity, so
   an override sitting BEFORE the base rule it means to beat silently does nothing.
   That cascade-order trap has already cost this codebase two bugs. */
@media (max-width: 640px) {
    .bx-grid2 { grid-template-columns: 1fr; max-width: 100%; }

    /* The boost modal is a two-pane row: .bx-modal-l (a hard 380px, flex:0 0 auto) beside
       .bx-modal-r. The parent has max-width:100% so IT fits a phone — but flex-shrink:0 means the
       left pane does not, and it takes all the space there is. Measured at 375px: the modal sized
       to 319px, the left pane rendered 425px (78px off-screen), and .bx-modal-r collapsed to
       ZERO WIDTH — so the pane holding the actual content simply was not there. Nothing about it
       looked broken; the modal just appeared to be missing its body.
       Stack the panes instead. .bx-modal-r already carries min-width:0, and the row has no
       flex-wrap, so flipping direction cannot wrap into extra columns. */
    .bx-modal { flex-direction: column; overflow-y: auto; }
    .bx-modal-l {
        width: auto;
        border-right: none;
        border-bottom: 1px solid #ECEDF1;
    }
}

/* ── Suggested: source (organic / paid ads / all) + format filters (2026-11-03) ── */
.bx-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.bx-seg { display: inline-flex; background: #F4F5F7; border: 1px solid #E9EAEE; border-radius: 10px; padding: 3px; gap: 2px; }
.bx-seg-btn { font: inherit; font-size: 12.5px; font-weight: 600; color: #5B6473; background: transparent; border: none; border-radius: 7px; padding: 6px 14px; cursor: pointer; }
.bx-seg-btn:hover { color: #14171F; }
.bx-seg-btn.is-on { background: #fff; color: #14171F; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.bx-seg-btn:focus-visible, .bx-fmt:focus-visible, .bx-srcopt:focus-visible { outline: 2px solid #5B53E8; outline-offset: 1px; }
.bx-fmts { display: flex; gap: 6px; flex-wrap: wrap; }
.bx-fmt { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 500; color: #2A3343; background: #fff; border: 1px solid #E3E5EA; border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.bx-fmt:hover { border-color: #C9CDD6; }
.bx-fmt.is-on { background: #14171F; border-color: #14171F; color: #fff; }
.bx-fmt-n { font-size: 11.5px; font-weight: 600; color: #6B7280; font-variant-numeric: tabular-nums; }
.bx-fmt.is-on .bx-fmt-n { color: rgba(255,255,255,.7); }
.bx-adline { display: flex; align-items: center; gap: 7px; margin: 4px 0 0; font-size: 12px; color: #5B6473; min-width: 0; }
.bx-adline > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-paid { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: #4338CA; background: #EEF0FF; border-radius: 5px; padding: 2px 6px; }

/* ── Auto-boost: which posts the rule may boost ── */
.bx-srcpick { display: flex; gap: 8px; flex-wrap: wrap; }
.bx-srcopt { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; font-weight: 500; color: #2A3343; background: #fff; border: 1px solid #E3E5EA; border-radius: 9px; padding: 8px 12px; cursor: pointer; }
.bx-srcopt:hover { border-color: #C9CDD6; }
.bx-srcopt.is-on { border-color: #5B53E8; color: #14171F; }
.bx-srcbox { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #C9CDD6; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; line-height: 1; }
.bx-srcopt.is-on .bx-srcbox { background: #5B53E8; border-color: #5B53E8; }

/* One control bar: Suggested/History tabs + the view's own controls on a single line (2026-11-03).
 * Kept on ONE line down to ~1100px: the controls are compacted and the search box is the part that gives. */
.bx-bar { margin-top: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.bx-bar .bx-tabs { margin-top: 0; flex: 0 0 auto; gap: 4px; }
.bx-bar .bx-tab { padding: 6px 11px; gap: 6px; }
.bx-bar-ctl { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.bx-bar-ctl:empty { display: none; }
.bx-bar-ctl .bx-filters { margin: 0; gap: 10px; flex-wrap: nowrap; flex: 0 0 auto; }
.bx-bar-ctl .bx-seg-btn { padding: 6px 11px; }
.bx-bar-ctl .bx-fmts { flex-wrap: nowrap; gap: 4px; }
.bx-bar-ctl .bx-fmt { padding: 5px 8px; gap: 5px; white-space: nowrap; }
.bx-bar-ctl > .bx-search { margin-left: auto; flex: 1 1 200px; min-width: 130px; max-width: 260px; padding: 7px 10px; }
.bx-bar-ctl > .bx-selwrap { flex: 0 0 auto; }
.bx-bar-ctl .bx-histbar { margin-top: 0; flex: 1 1 auto; }
/* Narrower: two tidy lines — tabs · search · sort, then Organic/Paid/All + format chips. */
@media (max-width: 1180px) {
  .bx-bar { flex-wrap: wrap; row-gap: 10px; }
  .bx-bar-ctl { display: contents; }
  .bx-bar-ctl > .bx-search { order: 1; margin-left: auto; }
  .bx-bar-ctl > .bx-selwrap { order: 1; }
  .bx-bar-ctl > .bx-filters { order: 2; flex: 1 1 100%; flex-wrap: wrap; }
  .bx-bar-ctl .bx-fmts { flex-wrap: wrap; }
  .bx-bar-ctl > .bx-histbar { order: 2; flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .bx-bar-ctl > .bx-search { margin-left: 0; flex: 1 1 100%; max-width: none; }
}

/* Smart Auto-Boost: summary card + Configure popup (2026-11-03). */
.bx-auto-head { align-items: center; }
.bx-auto-status { margin: 6px 0 0; font-size: 12px; color: #6B7280; }
.bx-auto-cfgbtn { flex: 0 0 auto; }
.bx-auto-cfgbtn svg { color: #5B53E8; }
/* Configure popup: header · section menu + scrolling sections · sticky footer (2026-11-03). */
.bx-automodal { display: flex; flex-direction: column; width: 920px; max-width: 100%; height: min(86vh, 820px); background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(16,24,40,0.4); outline: none; }
.bx-automodal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #ECEDF1; flex: 0 0 auto; }
.bx-acfg { flex: 1; min-height: 0; display: flex; }
.bx-acfg-nav { width: 200px; flex: 0 0 auto; padding: 14px 10px; border-right: 1px solid #ECEDF1; background: #FAFAFB; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.bx-acfg-navbtn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 13px; font-weight: 500; color: #5B6473; background: none; border: none; border-radius: 8px; padding: 8px 11px; cursor: pointer; }
.bx-acfg-navbtn:hover { background: #F0F1F4; color: #14171F; }
.bx-acfg-navbtn.is-on { background: #EEEDFC; color: #4A43D6; font-weight: 600; }
.bx-acfg-navbtn:focus-visible { outline: 2px solid #5B53E8; outline-offset: 1px; }
.bx-acfg-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #CBD0D8; flex: 0 0 auto; }
.bx-acfg-dot.is-on { background: #22A35A; }
.bx-acfg-navn { margin-left: auto; font-size: 11px; font-weight: 600; color: #6B7280; font-variant-numeric: tabular-nums; }
.bx-automodal-body { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 26px 32px; background: #fff; }
.bx-acfg-sec + .bx-acfg-sec { margin-top: 22px; padding-top: 22px; border-top: 1px solid #F0F1F4; }
.bx-acfg-sec[data-sec="status"] .bx-acfg-sechead { display: none; }
.bx-acfg-sechead { margin-bottom: 14px; }
.bx-acfg-t { margin: 0; font-size: 14.5px; font-weight: 700; color: #14171F; letter-spacing: -0.01em; }
.bx-acfg-sub { margin: 3px 0 0; font-size: 12.5px; color: #646B78; line-height: 1.45; }
.bx-acfg-card .bx-grid2 { max-width: none; gap: 16px 20px; }
.bx-acfg-card > .bx-acfg-field + .bx-acfg-field { margin-top: 14px; }
.bx-acfg-hint { display: block; margin: 6px 0 0; font-size: 12px; font-weight: 400; color: #646B78; line-height: 1.5; }
.bx-acfg-foot { margin-top: 12px; }
.bx-acfg-status { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 12px; background: #F7F8FA; border: 1px solid #ECEDF1; transition: background .15s ease, border-color .15s ease; }
.bx-acfg-status.is-on { background: #F4F3FE; border-color: #D6D2F7; }
.bx-acfg-status-t { font-size: 14.5px; font-weight: 700; color: #14171F; }
.bx-acfg-status .bx-acfg-hint { margin-top: 2px; }
.bx-acfg-srcs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bx-acfg-src { display: flex; align-items: flex-start; gap: 10px; text-align: left; font: inherit; background: #fff; border: 1px solid #E3E5EA; border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.bx-acfg-src:hover { border-color: #C9CDD6; }
.bx-acfg-src.is-on { border-color: #5B53E8; background: #FAFAFF; }
.bx-acfg-src:focus-visible, .bx-acfg-check:focus-visible { outline: 2px solid #5B53E8; outline-offset: 2px; }
.bx-acfg-check { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; font: inherit; background: none; border: none; padding: 0; cursor: pointer; }
.bx-acfg-src .bx-checkbox, .bx-acfg-check .bx-checkbox { margin-top: 1px; }
.bx-acfg-checktxt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bx-acfg-checktxt .bx-acfg-hint { margin-top: 2px; }
.bx-acfg-sep { margin-top: 18px; padding-top: 16px; border-top: 1px dashed #EAEBF0; }
.bx-acfg-card > .bx-section { margin: 0; padding: 0; border: 0; }
.bx-acfg-card > .bx-section > .bx-section-t { display: none; }
.bx-acfg-card > .bx-section .bx-grid2 { max-width: none; gap: 16px 20px; }
.bx-acfg-stack { display: flex; flex-direction: column; gap: 10px; }
.bx-acfg-stack > .bx-auto-card { margin-top: 0; }
.bx-automodal-foot { display: flex; align-items: center; gap: 10px; padding: 13px 20px; border-top: 1px solid #ECEDF1; background: #fff; flex: 0 0 auto; }
@media (max-width: 760px) {
  .bx-automodal { height: 92vh; }
  .bx-acfg-nav { display: none; }
  .bx-automodal-body { padding: 14px 16px 24px; }
  .bx-acfg-card .bx-grid2, .bx-acfg-srcs { grid-template-columns: 1fr; }
  .bx-automodal-foot { flex-wrap: wrap; }
  .bx-automodal-foot .bx-synced { flex: 1 1 100%; white-space: normal; }
}
@media (max-width: 640px) { .bx-auto-head { flex-wrap: wrap; } .bx-auto-cfgbtn { margin-left: 49px; } }
/* The generic mobile `.bx-grid2 { max-width: 100% }` (Mobile block above) is beaten by the
   higher-specificity `.bx-acfg-card .bx-grid2 { max-width: none }` bases — repeat it here, AFTER
   those bases and at their specificity, so it actually applies inside the auto-boost config card. */
@media (max-width: 640px) { .bx-acfg-card .bx-grid2, .bx-acfg-card > .bx-section .bx-grid2 { max-width: 100%; } }
.bx-acfg-card > .bx-section > .bx-grid2 + * { margin-top: 14px; }
.bx-acfg-hint.is-warn { color: #B42318; font-weight: 500; }
.bx-auto-status.is-warn { color: #B42318; font-weight: 500; }

/* Phone (QA 2026-11-08): the header's account chip + age select + Refresh sat on one non-wrapping
   row beside the title (Refresh ended ~280px past a 390px screen, clipped), and the Smart Auto-Boost
   text column — basis 0 — was squeezed to ~70px between the icon and Configure, one word per line. */
.bx-auto-mid { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .bx-head { flex-direction: column; gap: 12px; }
  .bx-headr { flex-wrap: wrap; max-width: 100%; }
  .bx-headr .bx-chip { max-width: 100%; min-width: 0; }
  .bx-headr .bx-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bx-auto-mid { flex: 1 1 calc(100% - 49px); }
}
@media (max-width: 640px) {
  /* Post-card footer: score · stats · view link · Boost on one row overflowed a phone card by ~200px. */
  .bx-card-foot { flex-wrap: wrap; row-gap: 10px; }
  .bx-stats { flex-wrap: wrap; row-gap: 6px; min-width: 0; }
}
