/* =========================================================
   AD AUTOMATION — boosts (js/features/ads.js)

   Visual language: "bento command center" — a gradient hero,
   card-based overview tiles and pill navigation built on top of
   the shared Palm Mind tokens. Page-scoped extras live in --ads-*.
========================================================= */

:root {
    /* bento surfaces */
    --ads-card: 20px;
    --ads-card-sm: 14px;
    --ads-shadow-card: 0 1px 2px rgba(13, 27, 42, .04), 0 8px 22px -12px rgba(13, 27, 42, .16);
    --ads-lift: 0 2px 5px rgba(13, 27, 42, .05), 0 20px 42px -18px rgba(13, 27, 42, .28);
    --ads-ring: 0 0 0 3px rgba(0, 113, 219, .22);

    /* creative accents, matched to the objective-card gradients below */
    --ads-violet: #6d5ce7;
    --ads-violet-soft: #efecfe;
    --ads-pink: #e8467c;
    --ads-teal: #12855f;
    --ads-amber: #e8921c;
}

/* ---------- page header: lone subtle refresh ---------- */

.ads-header { justify-content: flex-end; margin-bottom: 12px; }

/* ---------- panels: bento cards with an icon chip in the header ---------- */

#page-ads .panel { margin-bottom: 16px; border-radius: var(--ads-card); box-shadow: var(--ads-shadow-card); }
#page-ads .panel-header {
    justify-content: flex-start;
    padding: 14px 18px;
    gap: 14px;
    background: linear-gradient(180deg, var(--surface-soft), var(--surface));
}
#page-ads .panel-title { font-size: 13px; letter-spacing: .01em; }
#page-ads .panel-subtitle { font-size: 11px; line-height: 1.5; max-width: 780px; }

.ads-ico-chip {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary-soft-2), var(--primary-soft));
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(0, 113, 219, .14);
}
.ads-ico-chip svg { width: 19px; height: 19px; }
.ads-ico-violet {
    background: linear-gradient(135deg, #f4f1ff, var(--ads-violet-soft));
    color: var(--ads-violet);
    box-shadow: inset 0 0 0 1px rgba(109, 92, 231, .16);
}
.ads-ico-amber {
    background: linear-gradient(135deg, #fff7e8, var(--warning-soft));
    color: var(--ads-amber);
    box-shadow: inset 0 0 0 1px rgba(232, 146, 28, .18);
}

/* ---------- tabs: a segmented pill bar ---------- */

#page-ads .tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 16px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--ads-shadow-card);
}
#page-ads .tabs .tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .01em;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
#page-ads .tabs .tab svg { width: 15px; height: 15px; opacity: .85; }
#page-ads .tabs .tab:hover { background: var(--surface-hover); color: var(--text); }
#page-ads .tabs .tab.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 8px 18px -8px rgba(0, 113, 219, .75);
}
#page-ads .tabs .tab.active svg { opacity: 1; }

/* ---------- warning banner ---------- */

.ads-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 1px solid color-mix(in srgb, var(--danger) 32%, #fff);
    border-radius: var(--ads-card-sm);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--ads-shadow-card);
}
.ads-banner::before {
    content: "!";
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}
.ads-banner[hidden] { display: none; }

/* ---------- badges ---------- */

.ads-recommended {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff3d6, var(--warning-soft));
    color: var(--warning);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .03em;
    box-shadow: inset 0 0 0 1px rgba(154, 107, 5, .18);
}

.ads-empty, .ads-muted { color: var(--text-3); font-size: 11.5px; }
.ads-empty { padding: 14px 4px; }

/* empty states on this page read as a soft dashed card, not bare text */
#page-ads .empty {
    margin: 4px;
    padding: 34px 18px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--ads-card-sm);
    background: var(--surface-soft);
    color: var(--text-3);
    font-size: 12.5px;
    text-align: center;
}
#page-ads .empty p { margin: 0; }

/* ---------- boosts table ---------- */

.ads-table tbody tr { cursor: default; transition: background .15s ease; }
.ads-table tbody tr:hover { background: var(--primary-soft-2); }
.ads-table td { vertical-align: top; }
.ads-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-top: 11px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.ads-table .action-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ads-table .action-row .btn { padding: 5px 9px; font-size: 11px; }
.ads-table .action-row .btn[disabled] { opacity: .45; cursor: not-allowed; }

.ads-notes { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; align-items: center; }

.ads-tag {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--purple-soft);
    color: var(--purple);
    font-size: 9px;
    font-weight: 800;
}
.ads-tag.is-warn { background: var(--warning-soft); color: var(--warning); }

.ads-error-line { margin-top: 5px; max-width: 220px; color: var(--danger); font-size: 10px; line-height: 1.35; }

.ads-row-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- boost form: one screen ---------- */


.ads-sandbox-note {
    margin-bottom: 14px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--success-soft);
    color: var(--success);
    font-size: 11.5px;
    font-weight: 700;
}

.ads-step-title { margin: 0; font-size: 14px; font-weight: 800; color: var(--text); }

.ads-objectives { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ads-objective {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    cursor: pointer;
}
.ads-objective input { position: absolute; opacity: 0; pointer-events: none; }
.ads-objective b { font-size: 12.5px; color: var(--text); }
.ads-objective span { font-size: 11px; color: var(--text-3); }
.ads-objective.is-on { border-color: var(--primary); background: var(--primary-soft-2); }
.ads-objective:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }

.ads-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.ads-seg button {
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2);
    cursor: pointer;
}
.ads-seg button.is-on { border-color: var(--primary); background: var(--primary-soft-2); color: var(--primary-dark); }

.ads-sub { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.ads-sub[hidden], [data-audience-panel][hidden] { display: none; }
.ads-sub > span em { font-style: normal; font-weight: 600; color: var(--text-3); }

.ads-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ads-total { font-size: 12.5px; color: var(--text-2); }

.ads-picker { display: flex; flex-direction: column; gap: 12px; }

.ads-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ads-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 10px;
    border-radius: 999px;
    background: var(--primary-soft-2);
    color: var(--primary-dark);
    font-size: 11.5px;
    font-weight: 700;
}
.ads-chip button {
    border: 0;
    background: none;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.ads-search { position: relative; }
.ads-results { display: flex; flex-direction: column; margin-top: 4px; }
.ads-results:empty { display: none; }
.ads-results button {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-top: 0;
    background: var(--surface);
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}
.ads-results button:first-child { border-top: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.ads-results button:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.ads-results button:hover { background: var(--surface-hover); }
.ads-results em { font-style: normal; color: var(--text-3); font-size: 11px; }

.ads-check { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-2); }

.ads-hint { margin: 0; font-size: 11px; color: var(--text-3); }

.ads-warning {
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 11.5px;
    font-weight: 600;
}
.ads-warning[hidden] { display: none; }
.ads-warning ul { margin: 5px 0 0; padding-left: 18px; }

.ads-form-error {
    margin-top: 12px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
}
.ads-form-error[hidden] { display: none; }

.ads-review { display: grid; grid-template-columns: 90px 1fr; gap: 7px 12px; margin: 0; font-size: 12.5px; }
.ads-review dt { color: var(--text-3); font-weight: 700; }
.ads-review dd { margin: 0; color: var(--text); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.ads-estimate { font-size: 12.5px; color: var(--text-2); }

.ads-safe {
    margin: 0;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text-2);
    font-size: 11.5px;
}

.ads-days { min-width: 0; }

@media (max-width: 640px) {
    .ads-objectives, .ads-pair { grid-template-columns: 1fr; }
    .ads-cta { flex-direction: column; align-items: flex-start; }
}

/* ---------- Posts tab: Social-Inbox style list + post ---------- */

.ads-split { padding: 14px; }

.ads-row.is-muted { opacity: .6; }

.ads-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-soft);
}
.ads-thumb .cs-media { width: 100%; height: 100%; min-height: 0; border-radius: 0; }
.ads-thumb img, .ads-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ads-thumb .cs-media-note, .ads-thumb .cs-media-play { display: none; }
.ads-thumb-blank { display: block; width: 100%; height: 100%; }

.ads-row .inbox-post-meta { flex-wrap: wrap; }
.ads-row .inbox-post-meta .inbox-channel-badge { width: 16px; height: 16px; border-radius: 5px; }
.ads-row .status { font-size: 9px; padding: 2px 6px; }

/* One badge per platform the post is on. Doubled selector: inbox.css loads later and its
   fixed 34px .post-avatar width would otherwise squeeze two badges onto the title. */
.post-avatar.ads-avatars { display: inline-flex; gap: 4px; width: auto; height: auto; border-radius: 0; }

.ads-media .cs-media { min-height: 0; background: none; }
.ads-media img, .ads-media video { display: block; max-width: 100%; max-height: 300px; }

/* ---------- the boost panel under the post ---------- */

.ads-boost-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ads-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.ads-boost-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}
.ads-boost-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ads-boost-card .action-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ads-boost-card .action-row .btn { padding: 6px 10px; font-size: 11.5px; }
.ads-boost-card .action-row .btn[disabled] { opacity: .45; cursor: not-allowed; }

.ads-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ads-stat { display: flex; flex-direction: column; gap: 2px; }
.ads-stat span { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.ads-stat b { font-size: 13px; color: var(--text); }

.ads-earlier summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-2); }
.ads-earlier[open] summary { margin-bottom: 8px; }
.ads-earlier .ads-boost-card + .ads-boost-card { margin-top: 8px; }

/* ---------- the one-screen form ---------- */

.ads-form { display: flex; flex-direction: column; gap: 16px; }
.ads-field { display: flex; flex-direction: column; gap: 8px; }
.ads-label { font-size: 12px; font-weight: 800; color: var(--text); }
.ads-field-error { color: var(--danger); font-size: 11.5px; font-weight: 700; }
.ads-field-error:empty { display: none; }
.ads-field[hidden] { display: none; }
.ads-estimate .ads-label { margin-right: 6px; }

@media (max-width: 720px) {
    .ads-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* one "Open on …" per platform the post is live on */
.ads-open-links { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }

/* ---------- country dropdown ---------- */

.ads-combo { position: relative; }
.ads-combo > input { width: 100%; padding-right: 34px; }
.ads-combo-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 34px;
    border: 0;
    background: none;
    color: var(--text-3);
    font-size: 13px;
    cursor: pointer;
}
.ads-combo-toggle:hover { color: var(--text); }

.ads-combo-list {
    position: absolute;
    z-index: 5;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}
.ads-combo-list[hidden] { display: none; }
.ads-combo-option {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
}
.ads-combo-option span { color: var(--text-3); font-size: 11px; font-weight: 700; }
.ads-combo-option:hover, .ads-combo-option.is-active { background: var(--primary-soft-2); }
.ads-combo-empty { padding: 10px 12px; font-size: 12px; color: var(--text-3); }

/* ---------- More settings ---------- */

.ads-advanced {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}
.ads-advanced > summary { cursor: pointer; font-size: 12.5px; font-weight: 800; color: var(--text); }
.ads-advanced > summary .ads-muted { font-weight: 600; margin-left: 6px; }
.ads-advanced[open] > summary { margin-bottom: 12px; }
.ads-advanced-body { display: flex; flex-direction: column; gap: 14px; }
.ads-checks { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.ads-check input:disabled + * , .ads-check:has(input:disabled) { opacity: .55; }
[data-budget-panel][hidden] { display: none; }

/* ---------- insights view ---------- */

.modal.ads-insights-modal { width: min(1040px, 100%); }
.ads-insights-modal .modal-body { display: flex; flex-direction: column; gap: 16px; }
.ads-insights-modal #adsDetailMeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

.ads-insights-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.ads-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ads-tile {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 15px 16px 16px;
    border: 1px solid var(--border);
    border-radius: var(--ads-card);
    background: var(--surface);
    box-shadow: var(--ads-shadow-card);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
/* a coloured accent bar across the top, cycling through the page palette */
.ads-tile::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
.ads-tile:nth-child(2)::before { background: linear-gradient(90deg, var(--ads-violet), #8b7cf6); }
.ads-tile:nth-child(3)::before { background: linear-gradient(90deg, var(--ads-teal), #2bb48a); }
.ads-tile:nth-child(4)::before { background: linear-gradient(90deg, var(--ads-amber), #f6b73c); }
.ads-tile:nth-child(5)::before { background: linear-gradient(90deg, var(--ads-pink), #f0568a); }
.ads-tile:hover { transform: translateY(-3px); box-shadow: var(--ads-lift); }
.ads-tile span { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.ads-tile b { font-size: 23px; font-weight: 800; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.ads-tile em { font-style: normal; font-size: 11px; color: var(--text-3); }

.ads-pace { display: flex; align-items: center; gap: 10px; }
.ads-pace-track { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.ads-pace-fill { height: 100%; border-radius: 999px; background: var(--primary-gradient); }

.ads-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ads-charts > * { min-width: 0; }
.ads-chart {
    position: relative;
    min-width: 0;
    overflow-x: clip;
    border: 1px solid var(--border);
    border-radius: var(--ads-card);
    background: var(--surface);
    box-shadow: var(--ads-shadow-card);
    padding-top: 12px;
}
.ads-chart h4 { margin: 0 16px; font-size: 12.5px; font-weight: 800; color: var(--text); }
.ads-chart h4 em { font-style: normal; font-weight: 600; color: var(--text-3); }
.ads-chart .chart-area { min-height: 220px; }
.ads-chart-wide { grid-column: 1 / -1; }

/* small gradient icon chip before a chart heading */
.ads-chip-ico {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary-soft-2), var(--primary-soft));
    color: var(--primary);
}
.ads-chip-ico svg { width: 14px; height: 14px; }
.ads-chip-green { background: linear-gradient(135deg, #e9f8f1, var(--success-soft)); color: var(--ads-teal); }
.ads-chip-violet { background: linear-gradient(135deg, #f4f1ff, var(--ads-violet-soft)); color: var(--ads-violet); }
.ads-chip-amber { background: linear-gradient(135deg, #fff7e8, var(--warning-soft)); color: var(--ads-amber); }

@media (max-width: 760px) {
    .ads-charts { grid-template-columns: 1fr; }
}

/* ---------- pinned action bar above the post ---------- */

.ads-post-head {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 12px; margin-bottom: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.ads-post-head-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; font-size: 13px; }
.ads-post-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ads-post-head .btn { min-height: 38px; }
.ads-more { position: relative; }
.ads-more summary { list-style: none; cursor: pointer; padding: 0 12px; display: inline-flex; align-items: center; font-size: 18px; line-height: 1; }
.ads-more summary::-webkit-details-marker { display: none; }
.ads-more-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; min-width: 150px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.ads-more-menu button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 12.5px; font-weight: 700; text-align: left; color: var(--danger); cursor: pointer; }
.ads-more-menu button:hover { background: var(--danger-soft); }

/* ---------- chart styling (ads-charts.js) ---------- */

.ac-box { position: relative; min-width: 0; max-width: 100%; padding: 6px 10px 12px 6px; }
.ac-box svg { display: block; width: 100%; overflow: visible; }
.ac-box svg:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.ac-axis { fill: var(--text-3); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ac-val { fill: var(--text); font-weight: 700; }
.ac-gl { stroke: var(--border); stroke-width: 1; }
.ac-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ac-area { fill: var(--primary); opacity: .12; }
.ac-bar { fill: var(--primary); opacity: .88; }
.ac-bar.is-last { opacity: 1; }
/* horizontal bars: the category sits in the left gutter, its value at the bar's end */
.ac-hbar { fill: var(--primary); opacity: .85; transition: opacity .12s; }
.ac-hbar.is-on { opacity: 1; }
.ac-hlabel { fill: var(--text-2); font-size: 11.5px; font-weight: 700; }
.ac-hval { fill: var(--text); }
.ac-ref { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ac-reft { fill: var(--text-2); font-size: 11px; font-weight: 700; }
.ac-endlabel { fill: var(--text); }
.ac-pt { fill: var(--primary); stroke: #fff; stroke-width: 2; }
.ac-cross { stroke: var(--border-strong); stroke-width: 1; }
.ac-tip { position: absolute; z-index: 3; min-width: 120px; padding: 8px 10px; background: var(--text); color: #fff; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow-md); transform: translate(-50%, -100%); pointer-events: none; }
.ac-tip[hidden], .ac-cross[hidden], .ac-pt[hidden] { display: none; }
.ac-tip b { display: block; font-size: 13px; margin-top: 1px; }
.ac-tip small { display: block; opacity: .75; font-weight: 600; }
.ac-tip-multi { min-width: 170px; }
.ac-tip-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 3px; }
.ac-tip-row span { display: flex; gap: 6px; align-items: center; }
.ac-tip-row b { margin: 0; }
.ac-swatch { width: 34px; height: 12px; flex: none; vertical-align: middle; }
.ac-daycards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; padding: 12px 16px; }
.ac-daycard { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.ac-daycard span { display: block; font-size: 11px; font-weight: 800; color: var(--text-3); text-transform: uppercase; }
.ac-daycard b { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }

.ads-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 0 16px; }
.ads-chart-head h4 { margin: 0; display: flex; align-items: center; gap: 9px; }
.ads-chart .ads-hint { padding: 4px 16px 0; }
.ads-chart-main { grid-column: 1 / -1; padding-bottom: 4px; }
.ac-ctrls { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; padding: 10px 16px 0; }
.ac-grp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-grp > span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.ads-seg button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.ac-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 16px 14px; }
.ac-highlights[hidden] { display: none; }
.ac-highlights > div { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); }
.ac-highlights span { display: block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.ac-highlights b { display: block; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.ac-highlights em { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.ads-insights-modal .ads-chart { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }

/* ---------- All boosts: tick to compare ---------- */

.ads-pick { width: 44px; padding-right: 0; }
.ads-pick label { display: grid; place-items: center; width: 40px; height: 40px; margin: -8px 0 -8px -8px; cursor: pointer; }
.ads-pick input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.ads-pick input:disabled { cursor: not-allowed; }
.ads-table tr[data-picked="true"] { background: var(--primary-soft-2); }
.ads-comparebar {
    position: sticky; bottom: 12px; margin: 14px 16px 16px; padding: 13px 16px; z-index: 4;
    display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, .14);
    background: linear-gradient(115deg, #0d1b2a 0%, #143a63 70%, #1b4a80 100%);
    color: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 44px -20px rgba(13, 27, 42, .7);
}
.ads-comparebar[hidden] { display: none; }
.ads-comparebar small { opacity: .75; font-weight: 600; }
.ads-comparebar .btn { border-color: transparent; }
.ads-comparebar .btn-primary { background: #fff; color: var(--text); }
.ads-comparebar .btn-ghost { color: #fff; }
.ads-comparebar .btn[disabled] { opacity: .45; cursor: not-allowed; }
.ads-compare-actions { display: flex; gap: 8px; }
.sr-only { position: absolute; left: -9999px; }

/* ---------- compare dialog ---------- */

.ads-compare-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ads-cchips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ads-cchip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 800; }
.ads-cchip button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--text-2); font-size: 15px; line-height: 1; cursor: pointer; }
.ads-cchip button:hover { background: var(--danger-soft); color: var(--danger); }
.ads-cchip button[disabled] { opacity: .35; cursor: not-allowed; }
.ads-cadd { min-height: 34px; padding: 0 12px; border: 1px dashed var(--border-strong); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.ads-verdict { padding: 4px 16px 8px; font-size: 14px; font-weight: 700; color: var(--text); }
.ads-verdict small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.ads-legend { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 16px 0; }
.ads-lg { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 3px 10px 3px 8px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer; }
.ads-lg[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.ads-rank { display: flex; flex-direction: column; gap: 10px; padding: 10px 16px 16px; }
.ads-rank-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 96px; gap: 10px; align-items: center; font-size: 12.5px; }
.ads-rank-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; }
.ads-rank-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-rank-track { height: 14px; background: var(--surface-soft); border-radius: 4px; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.ads-rank-track > div { height: 100%; border-radius: 0 4px 4px 0; }
.ads-rank-val { text-align: right; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ads-best { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 10.5px; font-weight: 800; }
.ads-ctable th:first-child, .ads-ctable td:first-child { position: sticky; left: 0; background: var(--surface); }
.ads-ctable td.is-win { font-weight: 800; }
.ads-ctable thead th { min-width: 130px; }

@media (max-width: 700px) {
    .ac-highlights { grid-template-columns: 1fr; }
    .ads-rank-row { grid-template-columns: 110px minmax(0, 1fr) 80px; }
    .ads-post-head { position: static; }
}
@media (prefers-reduced-motion: reduce) { .ac-bar, .ac-pt { transition: none; } }

/* ---------- compare dialog v2: choose by picture on the left, read the answer on the right ---------- */

.modal.ads-insights-modal .modal-body.ads-cmp {
    display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start;
}
.ads-cmp-pick { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.ads-cmp-pickhead { display: flex; justify-content: space-between; align-items: baseline; }
.ads-cmp-pickhead h4 { margin: 0; font-size: 13px; font-weight: 800; }
.ads-cmp-pickhead span { font-size: 12px; font-weight: 700; color: var(--text-3); }
.ads-cmp-list { display: flex; flex-direction: column; gap: 8px; padding: 2px; max-height: 520px; overflow-y: auto; }
.ads-cmp-res { display: flex; flex-direction: column; gap: 14px; }

.ads-pc { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); }
.ads-pc:hover { background: var(--surface-soft); }
.ads-pc[data-on="true"] { border-color: var(--sc); background: color-mix(in srgb, var(--sc) 7%, white); }
.ads-pc[data-off="true"] .ads-cthumb { opacity: .4; }
.ads-pc[data-blocked="true"] { opacity: .45; }
.ads-pc-main { display: grid; grid-template-columns: 22px 54px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; min-height: 70px; padding: 8px 6px 8px 8px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; border-radius: 10px; }
.ads-pc[data-blocked="true"] .ads-pc-main { cursor: not-allowed; }
.ads-tick { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border-strong); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.ads-pc[data-on="true"] .ads-tick { background: var(--sc); border-color: var(--sc); }
.ads-pc-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ads-pc-text b { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ads-pc-text span { font-size: 11.5px; color: var(--text-3); }
.ads-pc-text em { font-style: normal; font-weight: 700; color: var(--text-2); margin-right: 4px; }
.ads-best-tag { align-self: flex-start; padding: 1px 8px; border-radius: 999px; background: var(--success-soft); color: var(--success) !important; font-size: 10.5px !important; font-weight: 800; }
.ads-pc-line { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.ads-pc .ads-eye { margin-right: 8px; }

.ads-cthumb { position: relative; width: 54px; height: 54px; flex: none; border-radius: 9px; overflow: hidden; background: linear-gradient(135deg, var(--primary-soft), var(--surface-soft)); }
.ads-cthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ads-cthumb i { position: absolute; right: 3px; bottom: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; display: grid; place-items: center; font: 800 9px/1 inherit; font-style: normal; color: #333; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.ads-eye { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-soft); cursor: pointer; font-size: 14px; color: var(--text-2); }

.ads-verdict { padding: 6px 16px 10px; }
.ads-verdict b { display: block; font-size: 16px; line-height: 1.35; }
.ads-mixed { margin: 10px 0 0; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--warning-soft); color: #6f4d03; font-size: 12.5px; font-weight: 600; }
.ads-more-select { min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.ads-rank-row { grid-template-columns: 30px 170px minmax(0, 1fr) 110px; }
.ads-rank-row .ads-cthumb { width: 30px; height: 30px; border-radius: 7px; } .ads-rank-row .ads-cthumb i { display: none; }
.ads-rank-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.ads-numbers summary { list-style: none; cursor: pointer; padding: 4px 16px 6px; min-height: 40px; display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 13px; }
details.ads-numbers summary::-webkit-details-marker { display: none; }
details.ads-numbers summary::after { content: "Show"; font-size: 12px; font-weight: 700; color: var(--primary-dark); }
details.ads-numbers[open] summary::after { content: "Hide"; }

@media (max-width: 860px) {
    .modal.ads-insights-modal .modal-body.ads-cmp { grid-template-columns: 1fr; }
    .ads-cmp-pick { position: static; }
    .ads-cmp-list { max-height: 320px; }
    .ads-rank-row { grid-template-columns: 30px minmax(0, 1fr) 90px; } .ads-rank-row .ads-rank-track { grid-column: 2 / -1; grid-row: 2; }
}

/* =========================================================
   BOOST DIALOG — three steps on the left, a live summary on the right.

   Anchored on `.modal-overlay .ads-modal`: components/modal.css loads after
   this file and its `.modal { width: min(600px, 100%) }` would otherwise win
   and crush the two columns (the same reason .cmp-modal and .crm-modal use
   two classes). The dialog has a set height and the body fills what the
   header, stepper and footer leave, so nothing is cut off; the form column is
   a size container, so its insides adapt to the width it actually gets.
========================================================= */

.modal-overlay .ads-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1120px, calc(100% - 32px));
    max-width: none;
    height: min(780px, 96vh);
    height: min(780px, 96dvh);
    max-height: none;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 40px 90px -40px rgba(13, 27, 42, .55);
}
.ads-modal .modal-header {
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
    align-items: center;
    padding: 16px 28px;
    background: linear-gradient(115deg, #eef6ff 0%, #f8fbff 52%, #f2efff 100%);
}
/* a soft violet orb tucked into the header's right edge */
.ads-modal .modal-header::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(109, 92, 231, .16) 0%, rgba(109, 92, 231, 0) 70%);
    pointer-events: none;
}
.ads-modal .modal-title { font-size: 17px; letter-spacing: -.01em; }
.ads-modal .modal-footer { flex: 0 0 auto; align-items: center; gap: 10px; padding: 14px 28px; }
.ads-modal .modal-footer [hidden] { display: none; }
.ads-modal .modal-footer .btn { padding: 10px 20px; font-size: 13.5px; min-height: 44px; border-radius: 999px; }
.ads-footer-note { margin-right: auto; font-size: 12.5px; font-weight: 700; color: var(--success); }
.ads-footer-note:empty { display: none; }

/* ---- stepper ---- */
.ads-stepper {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 12px 28px;
    list-style: none;
    background: linear-gradient(#fff, var(--surface-soft));
    border-bottom: 1px solid var(--border);
}
.ads-stepper li { display: flex; align-items: center; }
.ads-stepper li + li::before { content: ""; width: 46px; height: 3px; margin: 0 6px; border-radius: 3px; background: var(--border-strong); }
.ads-stepper li.is-done + li::before, .ads-stepper li.is-on::before { background: var(--primary-gradient); }
.ads-stepper button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 16px 6px 6px;
    border: 0;
    border-radius: 999px;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-3);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.ads-stepper i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-hover);
    font-style: normal;
    font-size: 12.5px;
    transition: background var(--transition), color var(--transition);
}
.ads-stepper li.is-on button { color: var(--primary-dark); background: #fff; box-shadow: 0 6px 16px -8px rgba(0, 113, 219, .45), inset 0 0 0 1px var(--primary-soft); }
.ads-stepper li.is-on i { background: var(--primary-gradient); color: #fff; box-shadow: 0 6px 14px -6px rgba(0, 113, 219, .7); }
.ads-stepper li.is-done i { background: var(--success); color: #fff; font-size: 0; }
.ads-stepper li.is-done i::after { content: "\2713"; font-size: 13px; }

/* ---- body: form | summary ---- */
.ads-modal .modal-body.ads-wiz {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    padding: 20px 28px;
    overflow: hidden;
}
.ads-wiz-main {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;               /* a last resort only: the sizes below are chosen so it isn't needed */
    padding-right: 2px;
}
.ads-step { display: flex; flex-direction: column; gap: 18px; }
.ads-step[hidden] { display: none; }

/* readable text everywhere in the dialog */
.ads-modal .ads-field { display: flex; flex-direction: column; gap: 10px; }
.ads-modal .ads-label { font-size: 14px; font-weight: 800; color: var(--text); }
.ads-modal .ads-sub { gap: 7px; font-size: 13px; }
.ads-modal .ads-sub > span em { font-weight: 600; }
.ads-modal .ads-check { font-size: 13px; line-height: 1.4; }
.ads-modal .ads-hint { font-size: 12px; line-height: 1.5; }
.ads-modal .ads-hint[hidden] { display: none; }
.ads-modal .ads-field-error { font-size: 12.5px; }
.ads-modal .lab-input, .ads-modal select.lab-input { min-width: 0; padding: 10px 12px; font-size: 13.5px; }
.ads-modal .ads-seg { gap: 8px; }
.ads-modal .ads-seg button { padding: 9px 16px; font-size: 13px; }
.ads-modal .ads-pair { gap: 12px; }
.ads-modal .ads-pair > * { min-width: 0; }
.ads-modal .ads-total { font-size: 13.5px; }
.ads-modal .ads-chip { font-size: 12.5px; padding: 5px 7px 5px 11px; }

/* ---- step 1: goal cards and platforms ---- */
.ads-modal .ads-objectives { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ads-modal .ads-objective {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border-radius: var(--radius-lg);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.ads-modal .ads-objective:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.ads-modal .ads-objective.is-on { box-shadow: 0 0 0 3px var(--primary-soft); }
.ads-obj-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ads-modal .ads-objective b { font-size: 14.5px; }
.ads-modal .ads-objective .ads-obj-text span { font-size: 12.5px; line-height: 1.4; color: var(--text-3); }
.ads-obj-ico { display: grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; color: #fff; }
.ads-obj-ico svg { width: 25px; height: 25px; }
.ads-obj-engagement { background: linear-gradient(135deg, #f0568a, #e8467c); }
.ads-obj-traffic { background: linear-gradient(135deg, #3d8ce0, #0071db); }
.ads-obj-awareness { background: linear-gradient(135deg, #f6b73c, #e8921c); }
.ads-obj-conversions { background: linear-gradient(135deg, #2bb48a, #12855f); }
.ads-plat { display: inline-flex; align-items: center; gap: 9px; }
.ads-modal .ads-seg .ads-plat { padding: 7px 18px 7px 7px; font-size: 13.5px; }
.ads-plat i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fff; }
.ads-plat i svg { width: 15px; height: 15px; }
.ads-plat-facebook i { background: #0866ff; }
.ads-plat-instagram i { background: linear-gradient(45deg, #f9ce34 0%, #ee2a7b 45%, #6228d7 100%); }

/* ---- step 2: the audience builder ---- */
/* not overflow:hidden — an open dropdown must be able to reach past the card's edge */
.ads-aud { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; }
.ads-aud-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface-soft); border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; }

/* the country, city and interest dropdowns */
.ads-modal .ads-combo-list { max-height: 220px; z-index: 20; border-radius: var(--radius-md); }
.ads-modal .ads-combo-list.is-up { top: auto; bottom: calc(100% + 4px); }
.ads-modal .ads-combo-option { padding: 9px 12px; font-size: 13.5px; }
.ads-modal .ads-combo-option span { font-size: 12px; }
.ads-modal .ads-combo-empty { font-size: 13px; }
.ads-modal .ads-chips { gap: 7px; }
.ads-aud-tabs button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 13px 8px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-3);
    white-space: nowrap;
    cursor: pointer;
}
.ads-aud-tabs button span { overflow: hidden; text-overflow: ellipsis; }
.ads-aud-tabs button svg { flex: 0 0 auto; width: 18px; height: 18px; }
.ads-aud-tabs button:hover { color: var(--text); background: var(--surface-hover); }
.ads-aud-tabs button.is-on { color: var(--primary-dark); background: #fff; border-bottom-color: var(--primary); }
.ads-aud-tabs i {
    flex: 0 0 auto;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-style: normal;
    font-size: 10.5px;
    line-height: 18px;
}
.ads-aud-body { padding: 18px; }
.ads-aud-body [data-aud-panel][hidden] { display: none; }
.ads-aud .ads-picker { gap: 16px; }
.ads-aud-places { display: flex; flex-direction: column; gap: 16px; }

.ads-lock {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 12.5px;
    line-height: 1.45;
}
.ads-lock svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
.ads-lock b { display: block; margin-bottom: 2px; }
.ads-demo { display: flex; flex-direction: column; gap: 12px; }
.ads-demo.is-locked { opacity: .45; pointer-events: none; }
.ads-demo-head { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text); }
.ads-demo-head span { font-weight: 800; color: var(--primary-dark); }
.ads-agetrack { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.ads-agetrack span { height: 10px; border-radius: 5px; background: var(--border); transition: background var(--transition); }
.ads-agetrack span.is-on { background: var(--primary-soft); }
.ads-agetrack span.is-picked { background: var(--primary-gradient); }
.ads-bands { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.ads-genders { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ads-bands button {
    min-width: 0;
    padding: 12px 4px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: #fff;
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-2);
    white-space: nowrap;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition);
}
.ads-bands button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--primary); }
.ads-bands button.is-on { border-color: var(--primary); background: var(--primary-soft-2); color: var(--primary-dark); box-shadow: inset 0 0 0 1px var(--primary); }

/* personas: one-click starting groups above the age and gender controls */
.ads-personas { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ads-persona {
    padding: 6px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-2);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.ads-persona:hover { border-color: var(--primary); }
.ads-persona.is-on { border-color: var(--primary); background: var(--primary-soft-2); color: var(--primary-dark); box-shadow: inset 0 0 0 1px var(--primary); }

/* customers: your audiences | the upload */
.ads-cust { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; }
.ads-cust-title { margin-bottom: 10px; font-size: 13.5px; font-weight: 800; color: var(--text); }
.ads-cust-title em { font-style: normal; font-weight: 600; color: var(--text-3); }
.ads-lists { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.ads-list {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.ads-list:hover { border-color: var(--primary); }
.ads-list.is-on { border-color: var(--primary); background: var(--primary-soft-2); box-shadow: inset 0 0 0 1px var(--primary); }
.ads-list-ico { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-dark); }
.ads-list-ico svg { width: 16px; height: 16px; }
.ads-list-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ads-list-body b { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-list-body em { font-style: normal; font-size: 12px; color: var(--text-3); }
.ads-list-del { flex: 0 0 auto; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--text-3); cursor: pointer; }
.ads-list-del:hover { color: var(--danger); }
.ads-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 220px;
    padding: 16px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fff, var(--surface-soft));
    text-align: center;
    color: var(--text-3);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.ads-drop svg { width: 30px; height: 30px; color: var(--primary); }
.ads-drop b { font-size: 14.5px; color: var(--text); }
.ads-drop span { font-size: 12px; }
.ads-drop:hover, .ads-drop.is-over { border-color: var(--primary); background: var(--primary-soft-2); transform: translateY(-1px); }
.ads-up { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ads-up-file { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.ads-up-file svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--primary); }
.ads-up-file b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ads-up-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ads-up-tiles div { min-width: 0; padding: 8px 10px; border-radius: var(--radius-md); background: var(--surface-soft); }
.ads-up-tiles b { display: block; font-size: 18px; color: var(--text); }
.ads-up-tiles span { font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.ads-up-tiles .is-good b { color: var(--success); }
.ads-up-tiles .is-bad b { color: var(--danger); }
.ads-modal .ads-up .lab-input { width: 100%; padding: 9px 11px; font-size: 13px; }
.ads-up .btn { width: 100%; justify-content: center; padding: 11px 16px; font-size: 13.5px; }
.ads-hint-warn { color: var(--warning); font-weight: 700; }
.ads-cust + .ads-hint { margin-top: 12px; }

/* ---- step 3: budget ---- */
.ads-more-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.ads-more-btn[hidden] { display: none; }
.ads-more-btn b { margin-left: auto; font-size: 17px; color: var(--text-3); }
.ads-more-btn:hover { border-color: var(--primary); }

/* ---- the summary card ---- */
.ads-summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    box-shadow: 0 12px 32px -20px rgba(13, 27, 42, .4);
    overflow: hidden;
}
.ads-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 18px;
    border-radius: 16px;
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 8px 22px rgba(0, 113, 219, .28);
}
/* a static diagonal sheen for depth — no motion, nothing to reduce */
.ads-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .16) 50%, transparent 62%);
    pointer-events: none;
}
.ads-hero span { position: relative; z-index: 1; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.ads-hero b { position: relative; z-index: 1; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; }
.ads-hero em { position: relative; z-index: 1; font-style: normal; font-size: 12.5px; opacity: .9; }
.ads-summary-post { display: flex; gap: 12px; align-items: center; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--text); }
.ads-summary-post > span:last-child { min-width: 0; }
.ads-summary-post em { display: block; margin-top: 2px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--text-3); }
.ads-summary .ads-review { grid-template-columns: 86px minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; }
.ads-summary .ads-review dd { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ads-fineprint { margin: 0; font-size: 11.5px; line-height: 1.5; }

/* ---- the More-options drawer ---- */
.ads-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(380px, 100%);
    padding: 20px;
    border-left: 1px solid var(--border);
    background: var(--surface);
    box-shadow: -12px 0 28px rgba(13, 27, 42, .12);
    animation: adsDrawerIn .16s ease;
}
.ads-drawer[hidden] { display: none; }
.ads-drawer-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--text); }
.ads-drawer .ads-advanced-body { flex: 1; min-height: 0; overflow-y: auto; }
.ads-drawer .ads-checks { gap: 8px 16px; }
@keyframes adsDrawerIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- the form column adapts to the width it actually gets ---- */
@container (max-width: 560px) {
    .ads-cust { grid-template-columns: 1fr; }
    .ads-lists { max-height: 132px; }
    .ads-drop { min-height: 130px; }
    .ads-aud-tabs button svg { display: none; }
}
@container (max-width: 520px) {
    .ads-modal .ads-objectives { grid-template-columns: 1fr; }
    .ads-bands { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ads-aud-tabs button { font-size: 12.5px; padding: 12px 4px; }
}

/* ---- narrower windows: a slimmer summary column; only a tablet-width window stacks ---- */
@media (max-width: 1060px) {
    .ads-modal .modal-body.ads-wiz { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
    .ads-summary-post { display: none; }
    .ads-hero b { font-size: 22px; }
    .ads-summary .ads-review { grid-template-columns: 74px minmax(0, 1fr); font-size: 13px; }
}
@media (max-width: 820px) {
    .ads-modal .modal-body.ads-wiz { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
    .ads-summary { order: -1; flex-direction: row; align-items: center; padding: 10px; gap: 14px; }
    .ads-summary .ads-review { display: none; }
    .ads-hero { flex: 0 0 auto; padding: 10px 14px; }
    .ads-hero b { font-size: 20px; }
    .ads-fineprint { flex: 1; }
}

/* ---- shorter windows: the same layout, tighter ---- */
@media (max-height: 799px) {
    .ads-modal .modal-header { padding-top: 12px; padding-bottom: 12px; }
    .ads-stepper { padding-top: 8px; padding-bottom: 8px; }
    .ads-modal .modal-body.ads-wiz { padding-top: 16px; padding-bottom: 16px; }
    .ads-step { gap: 14px; }
    .ads-modal .ads-objective { padding: 13px 14px; }
    .ads-obj-ico { width: 42px; height: 42px; }
    .ads-obj-ico svg { width: 23px; height: 23px; }
    .ads-aud-body { padding: 16px; }
    .ads-bands button { padding: 10px 4px; }
    .ads-drop { min-height: 180px; }
    .ads-lists { max-height: 190px; }
    .ads-summary { padding: 14px; gap: 10px; }
    .ads-hero { padding: 14px; }
    .ads-hero b { font-size: 26px; }
}
@media (max-height: 699px) {
    .ads-modal .modal-header { padding-top: 9px; padding-bottom: 9px; }
    .ads-modal .modal-title { font-size: 15.5px; }
    .ads-stepper { padding-top: 5px; padding-bottom: 5px; }
    .ads-stepper i { width: 24px; height: 24px; }
    .ads-stepper button { font-size: 13px; }
    .ads-modal .modal-body.ads-wiz { padding-top: 12px; padding-bottom: 12px; gap: 20px; }
    @media (min-width: 1061px) { .ads-modal .modal-body.ads-wiz { grid-template-columns: minmax(0, 1fr) 300px; } }
    .ads-modal .modal-footer { padding-top: 10px; padding-bottom: 10px; }
    .ads-modal .modal-footer .btn { padding: 8px 18px; }
    .ads-wiz-main, .ads-step { gap: 10px; }
    .ads-modal .ads-field { gap: 8px; }
    .ads-modal .ads-label { font-size: 13.5px; }
    .ads-modal .ads-objectives { gap: 10px; }
    .ads-modal .ads-objective { padding: 10px 12px; gap: 11px; }
    .ads-modal .ads-objective b { font-size: 13.5px; }
    .ads-modal .ads-objective .ads-obj-text span { font-size: 12px; line-height: 1.3; }
    .ads-obj-ico { width: 36px; height: 36px; border-radius: 11px; }
    .ads-obj-ico svg { width: 20px; height: 20px; }
    .ads-modal .ads-seg .ads-plat { padding: 5px 14px 5px 6px; }
    .ads-plat i { width: 24px; height: 24px; }
    .ads-modal .lab-input, .ads-modal select.lab-input { padding: 8px 10px; }
    .ads-aud-tabs button { padding: 9px 6px; font-size: 13px; }
    .ads-aud-body { padding: 12px 14px; }
    .ads-demo { gap: 10px; }
    .ads-bands button { padding: 9px 4px; font-size: 13px; }
    .ads-lock { padding: 9px 12px; margin-bottom: 10px; }
    .ads-lists { max-height: 150px; }
    .ads-list { padding: 8px 10px; }
    .ads-drop { min-height: 150px; }
    .ads-up { gap: 7px; }
    .ads-up-tiles div { padding: 6px 8px; }
    .ads-up-tiles b { font-size: 16px; }
    .ads-modal .ads-up .lab-input { padding: 7px 10px; }
    .ads-up .btn { padding: 8px 14px; }
    .ads-more-btn { padding: 10px 14px; }
    .ads-summary { padding: 12px; gap: 8px; }
    .ads-summary-post { display: none; }
    .ads-hero { padding: 12px 14px; }
    .ads-hero b { font-size: 22px; }
    .ads-summary .ads-review { gap: 4px 10px; font-size: 13px; }
    .ads-fineprint { font-size: 11px; }
}

/* =========================================================
   CAMPAIGNS IN ADS — the boost form's campaign step, the Posts lanes,
   and the Campaigns tab.
========================================================= */

/* step 1: pick a campaign (cards), then its goal (compact pills) */
.ads-camps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 176px; overflow-y: auto; padding: 2px; }
.ads-camp {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.ads-camp b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--text); }
.ads-camp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--text-3); }
.ads-camp em { display: flex; align-items: center; gap: 6px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--text-2); }
.ads-camp em i, .ads-camp-card header span i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.ads-camp:hover { border-color: var(--primary); }
.ads-camp.is-on { border-color: var(--primary); background: var(--primary-soft-2); box-shadow: inset 0 0 0 1px var(--primary); }
.ads-camp.is-always { border-style: dashed; }

.ads-goal-note { font-style: normal; font-weight: 600; font-size: 12px; color: var(--text-3); }
.ads-modal .ads-goals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ads-modal .ads-goal { flex-direction: row; align-items: center; gap: 9px; padding: 9px 10px; }
.ads-modal .ads-goal .ads-obj-ico { width: 30px; height: 30px; border-radius: 9px; }
.ads-modal .ads-goal .ads-obj-ico svg { width: 17px; height: 17px; }
.ads-modal .ads-goal .ads-obj-text span { display: none; }          /* the note is the tooltip */
.ads-modal .ads-goal b { font-size: 13px; }
.ads-modal .ads-goal.is-off { opacity: .4; cursor: not-allowed; }
.ads-modal .ads-goal.is-off:hover { transform: none; box-shadow: none; }

@container (max-width: 560px) {
    .ads-camps { grid-template-columns: 1fr; }
    .ads-modal .ads-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Posts tab: live posts | approved posts ready to run as an ad */
.ads-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 10px 4px; }
.ads-lane {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: #fff;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-2);
    cursor: pointer;
}
.ads-lane i { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-hover); font-style: normal; font-size: 11px; line-height: 18px; }
.ads-lane.is-on { border-color: var(--primary); background: var(--primary-soft-2); color: var(--primary-dark); }
.ads-lane.is-on i { background: var(--primary); color: #fff; }
.ads-draft-tag {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--warning-soft);
    color: var(--warning);
    font-style: normal;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

/* Campaigns tab */
.ads-camp-list { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.ads-camp-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; overflow: hidden; }
.ads-camp-card header { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--surface-soft); border-bottom: 1px solid var(--border); }
.ads-camp-card header > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ads-camp-card header b { font-size: 14.5px; color: var(--text); }
.ads-camp-card header span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.ads-camp-totals { display: flex; gap: 18px; }
.ads-camp-totals span { display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; font-weight: 700; color: var(--text-3); }
.ads-camp-totals b { font-size: 15px; color: var(--text); }
.ads-camp-ads { margin: 0; padding: 0; list-style: none; }
.ads-camp-ads li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 100px 150px auto;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-2);
}
.ads-camp-ads li:first-child { border-top: 0; }
.ads-camp-ad { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text); }
.ads-camp-ads .btn { padding: 5px 12px; font-size: 12px; }
.ads-camp-none { display: block !important; color: var(--text-3); }
@media (max-width: 760px) {
    .ads-camp-card header { flex-wrap: wrap; }
    .ads-camp-ads li { grid-template-columns: 1fr auto; }
}

/* a hidden row stays hidden: `.ads-modal .ads-field` sets display, which would beat [hidden] */
.ads-modal .ads-field[hidden] { display: none; }

@media (max-height: 799px) {
    .ads-camps { max-height: 140px; }
    .ads-camp { padding: 8px 11px; gap: 2px; }
}
@media (max-height: 699px) {
    .ads-camps { max-height: 112px; }
    .ads-camp span { display: none; }               /* status and dates: name and goal are what's needed here */
    .ads-modal .ads-goal { padding: 7px 9px; }
    .ads-modal .ads-goal .ads-obj-ico { width: 26px; height: 26px; }
}


/* ---------- overall results, above the tabs: a bento board ---------- */
.ads-overview { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; padding: 0; border: 0; background: none; }
.ads-ov-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 2px 2px 0; }
.ads-ov-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.ads-ov-title b { font-size: 16px; letter-spacing: -.01em; color: var(--text); }
.ads-ov-pulse {
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    border-radius: 4px;
    background: var(--primary-gradient);
    box-shadow: 0 0 0 4px var(--primary-soft-2);
    transform: rotate(45deg);
}
.ads-ov-controls { display: flex; align-items: center; gap: 10px; }
.ads-ov-controls .btn { padding: 6px 14px; font-size: 12.5px; }
.ads-ov-body { display: flex; flex-direction: column; gap: 14px; }
.ads-ov-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ads-ov-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.ads-ov-grid-3 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
/* asymmetric spans: the trend leads, the analyst sits beside it, three peers below */
.ads-ov-grid > .ads-chart { min-width: 0; display: flex; flex-direction: column; grid-column: span 7; }
.ads-ov-grid > .ads-chart + .ads-chart { grid-column: span 5; }
.ads-ov-grid-3 > .ads-chart,
.ads-ov-grid-3 > .ads-chart + .ads-chart { grid-column: span 4; }
.ads-ov-grid > .ads-chart { transition: transform .22s ease, box-shadow .22s ease; }
.ads-ov-grid > .ads-chart:hover { transform: translateY(-2px); box-shadow: var(--ads-lift); }
/* coloured accent strip along each bento card's top edge */
.ads-ov-grid > .ads-chart::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--ads-card) var(--ads-card) 0 0;
    background: linear-gradient(90deg, var(--primary), transparent 72%);
    opacity: .9;
}
.ads-ov-grid > .ads-chart + .ads-chart::before { background: linear-gradient(90deg, var(--ads-violet), transparent 72%); }
.ads-ov-grid-3 > .ads-chart:nth-child(1)::before { background: linear-gradient(90deg, var(--ads-teal), transparent 72%); }
.ads-ov-grid-3 > .ads-chart:nth-child(2)::before { background: linear-gradient(90deg, var(--ads-violet), transparent 72%); }
.ads-ov-grid-3 > .ads-chart:nth-child(3)::before { background: linear-gradient(90deg, var(--ads-amber), transparent 72%); }
.ads-ov-grid .ads-chart-head { padding-bottom: 6px; }
.ads-ov-list { display: flex; flex-direction: column; padding: 4px 16px 12px; max-height: 250px; overflow-y: auto; }
.ads-ov-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 9px 10px; margin: 0 -10px;
    border-top: 1px solid var(--border);
    border-radius: 10px;
    transition: background .15s ease;
}
.ads-ov-row:hover { background: var(--surface-soft); }
.ads-ov-row:first-child { border-top: 0; }
.ads-ov-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ads-ov-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text); }
.ads-ov-main span, .ads-ov-num span { font-size: 11.5px; color: var(--text-3); }
.ads-ov-num { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ads-ov-num b { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.ads-ov-num.is-good b { color: var(--success); }
.ads-ov-num.is-bad b { color: var(--danger); }
.ads-ov-sep { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border-strong); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
@media (max-width: 1100px) {
    .ads-ov-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ads-ov-grid, .ads-ov-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .ads-ov-grid > .ads-chart,
    .ads-ov-grid > .ads-chart + .ads-chart,
    .ads-ov-grid-3 > .ads-chart { grid-column: auto; }
}


/* ---------- the AI analyst card ---------- */
.ads-analyst {
    border-color: color-mix(in srgb, var(--ads-violet) 24%, var(--border));
    background: linear-gradient(158deg, #f3f0ff 0%, var(--primary-soft-2) 46%, #fff 130px);
}
.ads-camp-card .ads-analyst { margin: 12px 16px 16px; }
.ads-ai-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 800; vertical-align: 1px; }
.ads-ai-body { display: flex; flex-direction: column; gap: 8px; padding: 6px 16px 14px; max-height: 360px; overflow-y: auto; }
.ads-ai-body h5 { margin: 6px 0 0; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.ads-ai-headline { margin: 0; font-size: 14px; font-weight: 800; color: var(--text); line-height: 1.4; }
.ads-ai-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.ads-ai-list li span { display: block; font-size: 11.5px; color: var(--text-3); }
.ads-ai-recs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ads-ai-rec { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
.ads-ai-rec p { margin: 6px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.ads-ai-rec .btn { margin-top: 8px; padding: 5px 12px; font-size: 12px; }
.ads-ai-rec details { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.ads-ai-rec summary { cursor: pointer; font-weight: 700; }
.ads-ai-rec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ads-ai-rec-head b { font-size: 13px; color: var(--text); }
.ads-ai-kind { padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 10.5px; font-weight: 800; }
.ads-ai-conf { margin-left: auto; font-style: normal; font-size: 11px; color: var(--text-3); }
.ads-ai-post { padding: 8px 10px; border-radius: var(--radius-md); background: var(--surface-soft); }
.ads-ai-done { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--success); }
.ads-ai-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ads-ai-foot .btn, .ads-ai-body > .btn { padding: 6px 14px; font-size: 12.5px; align-self: flex-start; }
.ads-ai-wait { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 12.5px; color: var(--text-2); }
.ads-ai-spin { flex: none; width: 16px; height: 16px; border: 2px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: ads-ai-spin .8s linear infinite; }
@keyframes ads-ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ads-ai-spin { animation-duration: 3s; } }

.ads-ov-list .ads-hint { padding: 0 0 6px; }

/* a post running on both platforms: one bar per ad, the platform named */
.ads-platform-tag { padding: 2px 8px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--border); font-size: 11px; font-weight: 800; color: var(--text-2); }
.ads-post-head-extra { border-top: 1px dashed var(--border); }
.ads-plat-both { padding-left: 18px; padding-right: 18px; }


/* organic or ad: one small tag that says how a post reaches people, used on the Ads page and in Content Studio */
.delivery { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; border: 1px solid transparent; }
.delivery-organic { background: var(--surface-soft); color: var(--text-2); border-color: var(--border); }
.delivery-both { background: #eef2ff; color: #3b4cc0; border-color: #d6dcfb; }
.delivery-ad { background: #fff3e6; color: #b45309; border-color: #fbd9b0; }
.status.ad { background: #fff3e6; color: #b45309; }

.ads-seg button.is-faint { opacity: .55; }
.ads-ov-controls { flex-wrap: wrap; justify-content: flex-end; }

/* who it reached: every split at once, two to a row */
.ads-seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 4px 16px 8px; }
.ads-seg-card { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; padding: 10px 0 4px; }
.ads-seg-card h5 { margin: 0 14px 2px; font-size: 12.5px; font-weight: 800; color: var(--text); }
.ads-seg-card .ads-hint { padding: 0 14px; }
@media (max-width: 900px) { .ads-seg-grid { grid-template-columns: minmax(0, 1fr); } }

/* the posts list is picked from one dropdown above the Facebook / Instagram tabs */
.ads-lanes { display: block; padding: 10px 10px 4px; }
.ads-lane-select {
    width: 100%;
    padding: 9px 34px 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: #fff;
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
}
.ads-lane-select:hover, .ads-lane-select:focus-visible { border-color: var(--primary); outline: none; }

/* =========================================================
   BENTO POLISH — focus, entrance motion, small-screen behaviour.
   Every animation here is gated behind prefers-reduced-motion.
========================================================= */

/* one visible focus ring for everything you can operate on this page */
#page-ads :is(button, a, input, select, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 8px;
}
#page-ads button:not(:disabled), #page-ads summary, #page-ads label:has(input),
#page-ads .ads-objective, #page-ads .ads-lane, #page-ads .ads-camp,
#page-ads .ads-list, #page-ads .ads-pc-main { cursor: pointer; }

/* campaign cards join the bento language */
.ads-camp-card {
    border-radius: var(--ads-card);
    box-shadow: var(--ads-shadow-card);
    transition: transform .22s ease, box-shadow .22s ease;
}
.ads-camp-card:hover { transform: translateY(-2px); box-shadow: var(--ads-lift); }
.ads-camp-card header { background: linear-gradient(180deg, var(--surface-soft), #fff); }

@media (prefers-reduced-motion: no-preference) {
    /* the page assembles itself when you open it: banner first, then the board */
    @keyframes adsRise {
        from { opacity: 0; transform: translateY(16px) scale(.99); }
        to { opacity: 1; transform: none; }
    }
    #page-ads.active .ads-banner:not([hidden]) { animation: adsRise .45s .05s both; }
    #page-ads.active .ads-overview:not([hidden]) { animation: adsRise .5s .08s both; }
    #page-ads.active .ads-tabs { animation: adsRise .5s .12s both; }
    #page-ads.active .ads-tab:not([hidden]) { animation: adsRise .5s .16s both; }
    /* KPI tiles wave in when their data changes */
    #page-ads #adsOvTiles .ads-tile { animation: adsRise .45s cubic-bezier(.22, 1, .36, 1) both; }
    #page-ads #adsOvTiles .ads-tile:nth-child(1) { animation-delay: .18s; }
    #page-ads #adsOvTiles .ads-tile:nth-child(2) { animation-delay: .23s; }
    #page-ads #adsOvTiles .ads-tile:nth-child(3) { animation-delay: .28s; }
    #page-ads #adsOvTiles .ads-tile:nth-child(4) { animation-delay: .33s; }
    #page-ads #adsOvTiles .ads-tile:nth-child(5) { animation-delay: .38s; }
    #page-ads #adsOvTiles .ads-tile:nth-child(n+6) { animation-delay: .42s; }
}
@media (prefers-reduced-motion: reduce) {
    .ads-tile, .ads-camp-card, .ads-ov-grid > .ads-chart { transition: none; }
    .ads-tile:hover, .ads-camp-card:hover, .ads-ov-grid > .ads-chart:hover { transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .ads-ov-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    #page-ads .tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
    #page-ads .tabs::-webkit-scrollbar { display: none; }
    #page-ads .tabs .tab { flex: 0 0 auto; padding: 9px 14px; }
    .ads-ov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ads-tile b { font-size: 20px; }
    .ads-tile { padding: 13px 14px 14px; }
    #page-ads .panel-header { padding: 12px 14px; gap: 11px; }
    .ads-ico-chip { width: 36px; height: 36px; border-radius: 11px; }
}

/* ---------- insights v2: today first, detail behind "More numbers" ---------- */

.ads-today { border: 1px solid var(--border-strong); border-radius: var(--ads-card, 16px); background: var(--surface); box-shadow: var(--ads-shadow-card); overflow: hidden; }
.ads-today-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 20px; background: linear-gradient(180deg, var(--primary-soft-2), var(--surface)); border-bottom: 1px solid var(--border); }
.ads-today-k { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-dark); }
.ads-today-k i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ads-today-head .ads-muted { margin-left: auto; font-size: 12.5px; }
.ads-today-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.1fr); }
.ads-spot { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 20px; border-right: 1px solid var(--border); }
.ads-spot:last-child { border-right: 0; }
.ads-spot-l { font-size: 12px; font-weight: 700; color: var(--text-2); }
.ads-spot > b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ads-spot-f { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 3px; }
.ads-spot-f em { font-style: normal; font-size: 12px; color: var(--text-3); }
.ads-spot-spark { background: var(--surface-soft); }
.ads-delta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ads-delta.is-good { background: var(--success-soft); color: var(--success); }
.ads-delta.is-bad { background: var(--danger-soft); color: var(--danger); }
.ads-delta.is-flat { background: var(--surface-soft); color: var(--text-2); border: 1px solid var(--border); }
.ads-spark { display: block; width: 100%; height: 48px; margin-top: 4px; }
.ads-spark-area { fill: var(--primary); opacity: .12; }
.ads-spark-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ads-spark-end { fill: var(--surface); stroke: var(--primary); stroke-width: 2.4; }
.ads-spark-empty { margin-top: 6px; font-size: 12px; color: var(--text-3); }

/* the chart: past days quiet, the latest day strong, the 7-day average dashed */
.ads-chart-main .ac-bar { fill: var(--primary-2); opacity: .42; }
.ads-chart-main .ac-bar.is-last { fill: var(--primary); opacity: 1; }
.ads-chart-head h4 em { font-style: normal; font-weight: 600; color: var(--text-3); font-size: 13px; }

.ads-more { border: 1px solid var(--border); border-radius: var(--ads-card, 16px); background: var(--surface); box-shadow: var(--ads-shadow-card); overflow: hidden; }
.ads-more-toggle { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 20px; border: 0; background: transparent; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.ads-more-toggle:hover { background: var(--surface-soft); }
.ads-more-toggle b { display: block; font-size: 15px; font-weight: 800; }
.ads-more-toggle em { display: block; font-style: normal; font-size: 12.5px; color: var(--text-3); }
.ads-more-chev { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); color: var(--text-2); font-size: 15px; transition: transform .2s ease; flex: 0 0 auto; }
.ads-more.is-open .ads-more-chev { transform: rotate(180deg); }
.ads-more-body { display: flex; flex-direction: column; gap: 16px; padding: 4px 20px 22px; }
.ads-more-body[hidden] { display: none; }
.ads-more-title { margin: 6px 0 -4px; font-size: 13px; font-weight: 800; }
.ads-more-title small { margin-left: 8px; font-weight: 600; color: var(--text-3); }

button.ads-tile.is-click { font: inherit; text-align: left; cursor: pointer; width: 100%; color: inherit; }
button.ads-tile.is-click:hover { transform: translateY(-2px); border-color: var(--primary-soft); }
button.ads-tile.is-click:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button.ads-tile.is-click.is-on { background: var(--primary-soft-2); border-color: var(--primary); }
.ads-tile-go { position: absolute; top: 10px; right: 10px; font-style: normal; font-size: 12px; color: var(--text-3); opacity: .55; transition: opacity .15s ease; }
button.ads-tile.is-click:hover .ads-tile-go, button.ads-tile.is-click.is-on .ads-tile-go { opacity: 1; color: var(--primary-dark); }

.ads-days tr.is-today td { background: var(--primary-soft-2); font-weight: 700; }

@media (max-width: 920px) {
    .ads-today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ads-spot:nth-child(2) { border-right: 0; }
    .ads-spot-spark { grid-column: 1 / -1; border-top: 1px solid var(--border); }
}
@media (max-width: 560px) {
    .ads-today-grid { grid-template-columns: minmax(0, 1fr); }
    .ads-spot { border-right: 0; border-bottom: 1px solid var(--border); }
    .ads-today-head .ads-muted { margin-left: 0; }
}

/* ---------- Ads Intelligence page: headline first, then what needs a person ---------- */

.ads-ix { display: flex; flex-direction: column; gap: 16px; }
.ads-ix-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ads-ix-body { display: flex; flex-direction: column; gap: 16px; }
.ads-ix-body[hidden], .ads-ix-skel[hidden], .ads-ix-state[hidden] { display: none; }
.ads-ix-card { min-width: 0; }
.ads-ix-skel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ads-ix-skel i { height: 96px; border-radius: var(--ads-card, 16px); background: linear-gradient(90deg, var(--surface-soft) 25%, var(--primary-soft-2) 45%, var(--surface-soft) 65%); background-size: 300% 100%; animation: adsIxShim 1.3s linear infinite; }
@keyframes adsIxShim { to { background-position: -300% 0; } }
.ads-ix-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px; border: 1px dashed var(--border-strong); border-radius: var(--ads-card, 16px); background: var(--surface); text-align: center; }
.ads-ix-state b { font-size: 16px; }
.ads-ix-state span { color: var(--text-3); max-width: 420px; }


.ads-ix-attn { border: 1px solid #f0d9a6; border-radius: var(--ads-card, 16px); background: var(--warning-soft); padding: 14px 16px; }
.ads-ix-attn[hidden] { display: none; }
.ads-ix-attn h4 { margin: 0 0 8px; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.ads-ix-attn h4 span { padding: 1px 8px; border-radius: 999px; background: var(--warning); color: #fff; font-size: 11px; }
.ads-ix-attn ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ads-ix-attn li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border); }
.ads-ix-attn li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ads-ix-attn li b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-ix-attn li div span { font-size: 12px; color: var(--text-2); }
.ads-ix-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--text-3); }
.ads-ix-attn li.is-bad .ads-ix-dot { background: var(--danger); }
.ads-ix-attn li.is-warn .ads-ix-dot { background: var(--warning); }
.ads-ix-attn li.is-wait .ads-ix-dot { background: var(--primary); }

.ads-tile-delta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.ads-tile-delta em { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.ads-ix-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ads-ix-two > .ads-chart { grid-column: auto; }
.ads-ix-camps { display: flex; flex-direction: column; gap: 8px; padding: 4px 16px 14px; max-height: 360px; overflow-y: auto; }
.ads-ix-camp { display: flex; flex-direction: column; gap: 7px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ads-ix-camp:hover { border-color: var(--primary-soft); background: var(--primary-soft-2); }
.ads-ix-camp:focus-visible, .ads-ix-rank:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ads-ix-camp-top { display: flex; flex-direction: column; gap: 1px; }
.ads-ix-camp-top b { font-size: 13.5px; }
.ads-ix-camp-top em { font-style: normal; font-size: 12px; color: var(--text-3); }
.ads-ix-camp-nums { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 12px; color: var(--text-2); }
.ads-ix-camp-nums b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.ads-ix-rank { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 9px 8px; border: 0; border-top: 1px solid var(--border); border-radius: 8px; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ads-ix-rank:hover:not(:disabled) { background: var(--surface-soft); }
.ads-ix-rank:disabled { cursor: default; }
.ads-ix-sep { margin-top: 6px; padding-top: 8px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.ads-ix-sep.is-good { color: var(--success); margin-top: 0; padding-top: 0; }
.ads-ix-sep.is-bad { color: var(--danger); border-top: 1px solid var(--border-strong); }
.ads-ix-dims { display: flex; justify-content: flex-start; }

/* ---------- the AI analyst: actions first, the reading behind them ---------- */

.ads-analyst { background: var(--surface); border-color: color-mix(in srgb, var(--ads-violet) 22%, var(--border)); }
.ads-aix-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 0; }
.ads-aix-head h4 { margin: 0; display: flex; align-items: center; gap: 6px; }
.ads-aix-meta { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.ads-aix-body { display: flex; flex-direction: column; gap: 12px; padding: 10px 16px 16px; }
.ads-aix-headline { margin: 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--primary-soft-2); border: 1px solid var(--primary-soft); font-size: 15px; font-weight: 800; line-height: 1.45; }
.ads-aix-intro { margin: 0; color: var(--text-2); }
.ads-aix-reads { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.ads-aix-reads li { padding: 3px 10px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.ads-aix-wait { display: flex; gap: 14px; align-items: flex-start; }
.ads-aix-wait b { display: block; margin-bottom: 4px; }
.ads-aix-wait ol { margin: 0 0 8px; padding-left: 18px; font-size: 12.5px; color: var(--text-2); }
.ads-aix-sub { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.ads-aix-sub span { font-size: 12px; color: var(--text-3); }
.ads-aix-recs { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.ads-aix-rec { --kind: var(--primary); display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 12px; border: 1px solid var(--border); border-top: 3px solid var(--kind); border-radius: var(--radius-md); background: var(--surface); transition: opacity .15s ease; }
.ads-aix-rec.is-boost { --kind: var(--success); }
.ads-aix-rec.is-pause { --kind: var(--warning); }
.ads-aix-rec.is-budget { --kind: var(--ads-violet, #6d5ce7); }
.ads-aix-rec.is-audience, .ads-aix-rec.is-timing { --kind: var(--ads-teal, #0f9d8f); }
.ads-aix-rec.is-done { opacity: .6; }
.ads-aix-rec.is-done .ads-aix-title { text-decoration: line-through; }
.ads-aix-rec-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ads-aix-num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--kind); color: #fff; font-size: 12px; font-weight: 800; }
.ads-aix-kind { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--kind); }
.ads-aix-conf { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 11.5px; color: var(--text-3); text-transform: capitalize; }
.ads-aix-meter { display: inline-flex; gap: 2px; }
.ads-aix-meter i { width: 12px; height: 5px; border-radius: 3px; background: var(--border-strong); }
.ads-aix-meter i.is-on { background: var(--kind); }
.ads-aix-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.ads-aix-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.ads-aix-title { font-size: 14.5px; line-height: 1.35; }
.ads-aix-detail { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.ads-aix-post { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-soft); border: 1px solid var(--border); }
.ads-aix-post span { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.ads-aix-post em { font-style: normal; font-size: 12px; color: var(--text-3); }
.ads-aix-post q { margin-top: 4px; font-size: 13px; color: var(--text); }
.ads-aix-evidence { font-size: 12px; color: var(--text-3); }
.ads-aix-evidence summary { cursor: pointer; font-weight: 700; color: var(--text-2); }
.ads-aix-evidence p { margin: 6px 0 0; line-height: 1.5; }
.ads-aix-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.ads-aix-actions .btn { padding: 7px 14px; font-size: 12.5px; }
.ads-aix-added { font-size: 12.5px; font-weight: 700; color: var(--success); }
.ads-aix-nums { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ads-aix-nums i { font-style: normal; padding: 1px 8px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); }
.ads-aix-foot { margin: 0; font-size: 12px; color: var(--text-3); }
.ads-ai-more { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); padding: 10px 14px; }
.ads-ai-more summary { cursor: pointer; font-size: 13px; font-weight: 800; color: var(--primary-dark); }
.ads-ai-more[open] summary { margin-bottom: 6px; }
.ads-camp-card .ads-aix-recs { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 900px) {
    .ads-ix-two { grid-template-columns: minmax(0, 1fr); }
    .ads-ix-skel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .ads-ix-verdict-actions { width: 100%; }
    .ads-ix-verdict-actions .btn { flex: 1; }
    .ads-ix-attn li { flex-wrap: wrap; }
    .ads-aix-conf { margin-left: 0; }
}

/* Ads Intelligence: the headline says one thing, the tiles show their own trend */
.ads-ix-totals { font-style: normal; font-size: 12.5px; color: var(--text-3); margin-top: 4px; font-variant-numeric: tabular-nums; }
.ads-ix-compare { margin: -4px 2px 0; }
.ads-ix-compare[hidden] { display: none; }
.ads-ov-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ads-ov-tiles .ads-tile > b small { font-size: 13px; font-weight: 600; color: var(--text-3); }
.ads-ov-tiles .ads-spark { height: 34px; margin-top: auto; padding-top: 6px; }
.ads-ix-states { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ads-ix-states i { font-style: normal; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-soft); border: 1px solid var(--border); color: var(--text-2); }
.ads-ix-states i.is-problem { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.ads-ix-states i.is-running { background: var(--success-soft); border-color: transparent; color: var(--success); }
.ads-ix-attn li > div em { font-style: normal; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-ix-attn li > div strong { color: var(--text); }
.ads-ix-budget { display: block; height: 6px; margin-top: 6px; border-radius: 99px; background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; max-width: 320px; }
.ads-ix-budget i { display: block; height: 100%; border-radius: 99px; background: var(--warning); }
.ads-ix-attn li > div small { font-size: 11.5px; color: var(--text-3); }
@media (max-width: 1100px) { .ads-ov-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ads-ov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Ads Intelligence: "What stands out" drawn as a comparison, not a paragraph */
.ads-ix-big { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 14px 10px; border-radius: var(--radius-md); background: var(--primary-soft-2); border: 1px solid var(--primary-soft); }
.ads-ix-big b { font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -.03em; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.ads-ix-big span { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.ads-ix-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.ads-ix-bar-row { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.ads-ix-bar-label { color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ads-ix-bar-track { display: block; height: 12px; border-radius: 4px; background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.ads-ix-bar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--primary-2); }
.ads-ix-bar-track i.is-bad { background: var(--danger); }
.ads-ix-bar-track i.is-good { background: var(--success); }
.ads-ix-bar-row b { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.ads-ix-stats { list-style: none; margin: 0; padding: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 28px; border-top: 1px solid var(--border); }
.ads-ix-stats li { display: flex; flex-direction: column; gap: 1px; }
.ads-ix-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.ads-ix-stats span { font-size: 11.5px; color: var(--text-3); text-transform: lowercase; }
.ads-ix-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ads-ix-mini { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-soft); }
.ads-ix-mini > b { font-size: 13px; line-height: 1.35; }
.ads-ix-mini .ads-ix-bars { margin-top: 4px; }
.ads-ix-mini .ads-ix-bar-row { grid-template-columns: minmax(80px, 110px) minmax(0, 1fr) auto; font-size: 12px; }
@media (max-width: 720px) {
    .ads-ix-lead { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .ads-ix-big { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 14px; }
    .ads-ix-big b { font-size: 32px; }
    .ads-ix-big span { margin: 0; }
    .ads-ix-bar-row { grid-template-columns: minmax(0, 1fr) auto; }
    .ads-ix-bar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* Ads Intelligence: rings instead of bars */
.ads-ix-radial, .ads-ix-donut { position: relative; flex: 0 0 auto; }
.ads-ix-radial { width: var(--s, 176px); height: var(--s, 176px); }
.ads-ix-radial svg, .ads-ix-donut svg { display: block; width: 100%; height: 100%; }
.ads-ix-track { fill: none; stroke: var(--surface-soft); stroke: color-mix(in srgb, var(--border) 70%, var(--surface)); }
.ads-ix-ring { fill: none; stroke: var(--primary-2); stroke-linecap: round; transition: stroke-dasharray .6s cubic-bezier(.3, .9, .3, 1); }
.ads-ix-ring.is-bad { stroke: var(--danger); }
.ads-ix-ring.is-good { stroke: var(--success); }
.ads-ix-radial-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.ads-ix-radial-c b { font-size: calc(var(--s, 176px) * 0.2); line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ads-ix-radial-c span { margin-top: 4px; max-width: 70%; font-size: 11.5px; font-weight: 700; color: var(--text-3); line-height: 1.2; }
.ads-ix-big { min-width: 140px; }
.ads-ix-legend { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ads-ix-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 9px; font-size: 13px; }
.ads-ix-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--primary-2); }
.ads-ix-legend i.is-bad { background: var(--danger); }
.ads-ix-legend i.is-good { background: var(--success); }
.ads-ix-legend span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-ix-legend b { font-variant-numeric: tabular-nums; }
.ads-ix-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.ads-ix-mini { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-soft); }
.ads-ix-mini > div:last-child { min-width: 0; flex: 1; }
.ads-ix-mini > div > b { display: block; font-size: 13.5px; line-height: 1.35; }
.ads-ix-mini .ads-ix-radial-c b { font-size: 17px; }
.ads-ix-mini .ads-ix-radial-c span { display: none; }
.ads-ix-shares { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.ads-ix-share { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.ads-ix-share h5 { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.ads-ix-share-body { display: flex; align-items: center; gap: 16px; }
.ads-ix-donut { width: 104px; height: 104px; }
.ads-ix-donut .ads-ix-radial-c b { font-size: 19px; }
.ads-ix-donut .ads-ix-radial-c span { font-size: 10.5px; }
.ads-ix-share-body .ads-ix-legend { flex: 1; min-width: 0; margin: 0; }
@media (max-width: 720px) {
    .ads-ix-lead { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 14px; }
    .ads-ix-lead-main { align-items: stretch; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .ads-ix-ring { transition: none; } }

/* Ads Intelligence v3: one lead, two plain rings, quiet everything else */
.ads-ix-gauges { display: flex; align-items: center; gap: 14px; }
.ads-ix-gauge { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 124px; text-align: center; }
.ads-ix-gauge-ring { position: relative; width: 112px; height: 112px; }
.ads-ix-gauge-ring svg { display: block; width: 100%; height: 100%; }
.ads-ix-gauge-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ads-ix-gauge > span { font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 1.3; }
.ads-ix-ring { stroke-linecap: round; }
@media (max-width: 820px) {
    .ads-ix-lead { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .ads-ix-gauges { justify-content: center; }
}
@media (max-width: 420px) {
    .ads-ix-gauges { flex-wrap: wrap; }
    .ads-ix-pill { order: -1; margin: 0; width: 100%; text-align: center; }
}

/* Needs your attention: a white row with a coloured edge, not a yellow slab */
.ads-ix-attn { border: 0; background: transparent; padding: 0; }
.ads-ix-attn h4 { margin: 0 0 10px; font-size: 14px; }
.ads-ix-attn h4 span { background: var(--text); }
.ads-ix-attn ul { gap: 10px; }
.ads-ix-attn li { --tone: var(--text-3); display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--tone); border-radius: var(--radius-md); }
.ads-ix-attn li.is-bad { --tone: var(--danger); }
.ads-ix-attn li.is-warn { --tone: var(--warning); }
.ads-ix-attn li.is-wait { --tone: var(--primary); }
.ads-ix-attn-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, var(--surface)); }
.ads-ix-attn-ico svg { width: 18px; height: 18px; }
.ads-ix-attn-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ads-ix-attn-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ads-ix-attn-top b { font-size: 14px; }
.ads-ix-chip { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, var(--surface)); }
.ads-ix-chip.is-bad { --tone: var(--danger); } .ads-ix-chip.is-warn { --tone: var(--warning); } .ads-ix-chip.is-wait { --tone: var(--primary); }
.ads-ix-attn-main > em { font-style: normal; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-ix-attn-hint { font-size: 12px; color: var(--text-2); }
.ads-ix-budget-row { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.ads-ix-budget { flex: 1 1 auto; max-width: 340px; height: 8px; margin: 0; }
.ads-ix-budget i { background: var(--tone); }
.ads-ix-attn li.is-warn .ads-ix-budget i { background: var(--warning); }
.ads-ix-budget-row small { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.ads-ix-budget-row small b { color: var(--text); }
@media (max-width: 640px) { .ads-ix-attn li { grid-template-columns: 34px minmax(0, 1fr); } .ads-ix-attn li .btn { grid-column: 1 / -1; } }
@media (max-width: 520px) {
    .ads-ix-share-body { flex-direction: column; align-items: stretch; gap: 12px; }
    .ads-ix-donut { align-self: center; }
    .ads-ix-budget-row { flex-wrap: wrap; gap: 4px; }
    .ads-ix-budget { flex-basis: 100%; max-width: none; }
    .ads-ix-attn-ico { display: none; }
    .ads-ix-attn li { grid-template-columns: minmax(0, 1fr); }
}

/* Ads Intelligence v4: text first; one ring, where a share of a whole is the point */
.ads-ix-score-wrap { display: flex; align-items: center; gap: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.ads-ix-score-wrap .ads-ix-donut { width: 112px; height: 112px; flex: 0 0 auto; }
.ads-ix-score { flex: 1; min-width: 0; border-collapse: collapse; font-size: 13px; }
.ads-ix-score th, .ads-ix-score td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--border); vertical-align: baseline; }
.ads-ix-score thead th { padding-top: 0; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.ads-ix-score thead th:first-child, .ads-ix-score tbody th { text-align: left; }
.ads-ix-score tbody tr:last-child th, .ads-ix-score tbody tr:last-child td { border-bottom: 0; }
.ads-ix-score tbody th { font-weight: 700; display: table-cell; white-space: nowrap; }
.ads-ix-score tbody th i { display: inline-block; width: 10px; height: 10px; margin-right: 9px; border-radius: 3px; vertical-align: -1px; }
.ads-ix-score td b { font-variant-numeric: tabular-nums; }
.ads-ix-score td span { margin-left: 8px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ads-ix-score td .ads-ix-best { padding: 1px 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 11px; font-weight: 800; }
@media (max-width: 640px) { .ads-ix-score-wrap { flex-direction: column; align-items: stretch; gap: 12px; } .ads-ix-score-wrap .ads-ix-donut { align-self: center; } .ads-ix-score { display: block; overflow-x: auto; } }
.ads-ix-score thead th, .ads-ix-score tbody th { background: transparent; }
.ads-ix-score tbody th { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--text); }
.ads-ix-score td { font-size: 14px; background: transparent; }
.ads-ix-score td b { font-size: 14px; font-weight: 800; }
.ads-ix-score thead th { padding-bottom: 8px; }

/* insights: the top card's fourth fact is the budget; a sentence stands in for charts that can't draw yet */
.ads-today-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ads-spot-budget .ads-pace-track { display: block; height: 8px; margin: 6px 0 2px; border-radius: 99px; background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.ads-spot-budget .ads-pace-fill { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.ads-wait { margin: 0; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface-soft); font-size: 13px; color: var(--text-2); }

/* ranked ads: a bar per ad, goals picked from chips */
.ads-ix-rank-goals { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 4px; }
.ads-ix-rank-goals[hidden] { display: none; }
.ads-ix-rank-goals > span { font-size: 12px; font-weight: 700; color: var(--text-3); margin-right: 2px; }
.ads-ix-rank-goals button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ads-ix-rank-goals button em { font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--text-3); }
.ads-ix-rank-goals button:hover { border-color: var(--primary); }
.ads-ix-rank-goals button.is-on { border-color: var(--primary); background: var(--primary-soft-2); color: var(--primary-dark); }
.ads-ix-rank-goals button.is-on em { color: var(--primary-dark); }
.ads-ix-rankchart .ac-hbar { opacity: .45; }
.ads-ix-rankchart .ac-hbar.is-top { opacity: 1; }
.ads-ix-rankchart .ac-hbar.is-on { opacity: .9; }
.ads-ix-rankchart .ac-hbar.is-top.is-on { opacity: 1; }
.ads-ix-rankchart svg.is-click { cursor: pointer; }
.ads-ix-rankchart .ac-hlabel { font-size: 12.5px; font-weight: 600; }

/* saved audiences in the Customers tab */
.ads-auds { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ads-auds .lab-select { width: 100%; min-width: 0; }
.ads-aud-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ads-aud-actions .btn { flex: 1 1 150px; min-width: 0; white-space: normal; }
.ads-aud-actions .btn.is-on { border-color: var(--primary); background: var(--primary-soft-2); color: var(--primary-dark); }
.ads-aud-summary:empty { display: none; }
.ads-aud-summary { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--primary-soft-2); font-size: 13px; overflow-wrap: anywhere; }
.ads-aud-summary p { margin: 0; }

/* targeting list and people preview under the saved-audience picker */
.ads-targeting:empty { display: none; }
.ads-targeting h4 { margin: 0 0 8px; font-size: 13px; }
.ads-target { grid-template-columns: 88px minmax(0, 1fr); font-size: 13px; overflow-wrap: anywhere; }
.ads-target dd { display: block; }
.ads-from { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--primary-soft-2); color: var(--primary-dark); font-size: 11px; font-weight: 700; }
.ads-preview { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 12px; font-size: 13px; }
.ads-preview summary { cursor: pointer; font-weight: 700; }
.ads-preview[open] summary { margin-bottom: 8px; }
.ads-preview p { margin: 0; }

/* saved-audience dropdown: the studio's .dd-field with two-line rows */
.ads-auds .dd-chevron { flex: none; }
.ads-auds .dd-trigger { padding: 9px 12px; font-size: 13px; }
.ads-auds .dd-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ads-auds .dd-panel { max-height: 280px; z-index: 20; }
.ads-auds .dd-option.has-sub { align-items: center; padding: 9px 12px; }
.ads-auds .dd-option.has-sub + .dd-option.has-sub { border-top: 1px solid var(--border); }
.ads-auds .dd-main { display: flex; flex-direction: column; min-width: 0; margin-right: auto; font-style: normal; }
.ads-auds .dd-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ads-auds .dd-main small { color: var(--text-3); font-size: 11px; font-weight: 500; }
.ads-auds .dd-chip { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--surface-soft); color: var(--text-2); font-size: 10.5px; font-style: normal; font-weight: 700; }
.ads-auds .dd-chip.is-ok { background: var(--success-soft); color: var(--success); }
.ads-auds .dd-chip.is-warn { background: var(--warning-soft); color: var(--warning); }
.ads-auds .dd-chip.is-bad { background: var(--danger-soft); color: var(--danger); }
.ads-auds .dd-option.has-sub.is-on::after { content: "\2713"; flex: none; color: var(--primary); font-weight: 800; }

/* the insights dialog on a phone: the restored totals and daily table stay readable */
@media (max-width: 640px) {
    .ads-insights-modal .ads-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ads-days th, .ads-days td { padding: 7px 8px; font-size: 12px; }
}
