/* ============================================================
   DATA MODULES (Audiences · Bulk Upload) — extends search.css
   ============================================================ */

/* LiveRamp connection pill */
.lr-pill {
    display: flex; align-items: center; gap: 9px;
    background: #fff; border: 1px solid var(--line);
    border-radius: 2px; padding: 8px 13px; font-size: 13.5px; color: var(--ink-2);
}
.lr-pill b { color: var(--ink); font-weight: 600; }
.lr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.lr-sync { font-size: 12px; color: var(--ink-3); border-left: 1px solid var(--line-soft); padding-left: 9px; }

/* audiences layout */
.aud-page { container-type: inline-size; }
.aud-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.aud-title-row h1 { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.aud-actions { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; max-width: 100%; }
.aud-actions .btn { max-width: 100%; white-space: normal; }
.aud-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.aud-filters { display: grid; gap: 18px; padding: 20px; align-self: start; position: sticky; top: 16px; min-width: 0; }
.aud-filter-group { min-width: 0; }
.aud-filter-group .rail-h { margin-bottom: 10px; }
.aud-table { min-width: 0; max-width: 100%; overflow-x: auto; }
.aud-table .dtable { min-width: 680px; }
.aud-table .dtable td:nth-child(2) { min-width: 220px; }
.aud-create .field { min-width: 0 !important; max-width: 100%; }
@container (max-width: 860px) {
    .aud-grid { grid-template-columns: minmax(0, 1fr); }
    .aud-filters { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 580px) {
    .aud-actions { width: 100%; }
    .aud-actions .btn { flex: 1 1 auto; }
    .aud-filters { grid-template-columns: minmax(0, 1fr); }
    .aud-filters .aud-radios { flex-direction: row; flex-wrap: wrap; gap: 4px 8px; }
}

.aud-radios { display: flex; flex-direction: column; gap: 2px; }
.aud-radio {
    display: flex; align-items: center; gap: 9px;
    background: none; border: 0; cursor: pointer;
    padding: 7px 8px; border-radius: 2px;
    font-size: 13.5px; color: var(--ink-2); text-align: left;
    transition: background 0.12s ease, color 0.12s ease;
}
.aud-radio:hover { background: var(--surface-hover); }
.aud-radio .dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 1.5px solid var(--line); background: #fff; flex: 0 0 auto;
    transition: all 0.12s ease;
}
.aud-radio.on { color: var(--ink); font-weight: 550; }
.aud-radio.on .dot { border: 5px solid var(--blue); }

/* destination chips */
.dchips { display: flex; gap: 6px; flex-wrap: wrap; }
.dchip {
    font-size: 11.5px; font-weight: 550; padding: 2px 9px; border-radius: 2px;
    background: var(--bg-soft); border: 1px solid var(--line-soft); color: var(--ink-2);
    white-space: nowrap;
}
.rec-zero { color: var(--ink); font-weight: 600; }

/* ============ Bulk Upload ============ */
.bu-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
@container (max-width: 860px) { .bu-grid { grid-template-columns: 1fr; } }

.dropzone {
    border: 1.5px dashed var(--line); border-radius: var(--r-md);
    background: var(--bg-soft-2);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 34px 20px; cursor: pointer; text-align: center;
    transition: all 0.15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-soft); }
.dropzone .dz-ico { color: var(--blue); }
.dropzone .dz-t { font-size: 14.5px; font-weight: 550; }
.dropzone .dz-s { font-size: 12.5px; color: var(--ink-3); }
.dropzone .dz-file { font-size: 13.5px; font-weight: 600; color: var(--blue); }

.dest-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 0; border-bottom: 1px solid var(--line-soft);
}
.dest-row:last-child { border-bottom: 0; }
.dest-row .d-ico {
    width: 36px; height: 36px; border-radius: 2px; flex: 0 0 auto;
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; color: var(--ink-2);
}
.dest-row .d-main { flex: 1; min-width: 0; }
.dest-row .d-n { font-size: 14px; font-weight: 550; }
.dest-row .d-p { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dest-row .d-region { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

.mono { font-family: var(--font-mono); font-size: 12px; }

/* CM360 display module */
.cm-link { color: var(--blue); font-weight: 500; cursor: pointer; }
.cm-link:hover { text-decoration: underline; }
.alert-tri { color: var(--ink); font-size: 14px; }
.alert-link {
    display: inline-flex; align-items: center; gap: 7px;
    background: none; border: 0; cursor: pointer; padding: 0;
    margin-top: 8px; font-size: 13.5px; color: var(--blue); font-weight: 500;
}
.alert-link:hover { text-decoration: underline; }
.star { cursor: pointer; color: var(--ink); font-size: 15px; transition: color 0.12s ease; }
.star:hover { color: var(--ink-3); }
.star.on { color: #000; }

/* DCO Feed (Google Studio) */
.dco-source { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.dco-source b { color: var(--ink); font-weight: 600; }
.studio-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(124,124,124,0.2); flex: 0 0 auto; }
.dco-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.dco-tabs button { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer;
    padding: 11px 18px; font-size: 14px; font-weight: 600; color: var(--ink); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.dco-tabs button:hover { color: var(--blue); }
.dco-tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.dco-tabs .dt-count { font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 2px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.dco-tabs button.on .dt-count { color: #fff; background: var(--blue); border-color: var(--blue); }
.dco-table { overflow-x: auto; }
.dco-table table { min-width: 900px; }
.color-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cc-sw { width: 14px; height: 14px; border-radius: 2px; border: 1px solid var(--line); flex: 0 0 auto; }
.dco-detail-btn { border: 1px solid var(--line); background: #fff; border-radius: 2px; padding: 5px 12px; font-size: 12.5px; font-weight: 550; color: var(--blue); cursor: pointer; }
.dco-detail-btn:hover { background: var(--blue-soft); }
.dco-drawer { margin-top: 16px; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.dco-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.dco-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); }
@container (max-width: 760px) { .dco-fields { grid-template-columns: 1fr; } }
.dco-field { background: #fff; padding: 11px 18px; }
.dco-field .df-k { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-3); }
.dco-field .df-v { font-size: 13.5px; color: var(--ink); margin-top: 3px; word-break: break-word; white-space: pre-line; }
.dco-field.wide { grid-column: 1 / -1; }
.dco-field .df-input { margin-top: 5px; font-size: 13px; }
.dco-field .df-input.input, .dco-field .df-input.select { padding: 8px 11px; }
.dco-drawer-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.dco-dirty { font-size: 12.5px; font-weight: 600; color: var(--ink); background: #f7f7f7; border: 1px solid #dedede; border-radius: 2px; padding: 4px 11px; }
.dco-table tr.dco-edited td { background: rgba(97,97,97,0.04); }
.dco-sticky-l { position: sticky; left: 0; background: #fff; z-index: 1; }
.dco-table tbody tr:hover .dco-sticky-l { background: var(--bg-soft); }
.dco-table tr.sel .dco-sticky-l { background: var(--blue-soft); }

/* pacing */
.pace-v.pace-under, .v.pace-under { color: var(--ink); }
.pace-v.pace-over, .v.pace-over { color: var(--ink); }
.pace-v.pace-onpace, .v.pace-onpace { color: var(--ink); }
.pace-wrap { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.pace-track { position: relative; flex: 1; height: 8px; border-radius: 2px; background: var(--surface-muted); overflow: hidden; }
.pace-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }
.pace-fill.onpace { background: var(--green); }
.pace-fill.under { background: #a9a9a9; }
.pace-fill.over { background: var(--red); }
.pace-ideal { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink-3); opacity: 0.55; }
.pace-pct { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.pace-pct.onpace { color: var(--ink); }
.pace-pct.under { color: var(--ink); }
.pace-pct.over { color: var(--ink); }
.dtable tfoot tr.pace-totals td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700; background: var(--bg-soft-2); padding-top: 13px; padding-bottom: 13px; }

/* studio automation */
.std-split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 18px; align-items: start; }
@container (max-width: 980px) { .std-split { grid-template-columns: 1fr; } }
.std-panelhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.std-h { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.std-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.std-camp-meta { display: flex; gap: 22px; padding: 12px 20px; background: var(--bg-soft-2); border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-2); }
.std-camp-meta b { color: var(--ink); }
.std-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.std-row:hover { background: var(--bg-soft); }
.std-row.active { background: var(--blue-soft); }
.std-all { background: var(--bg-soft-2); }
.std-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.std-row-name { font-size: 14px; font-weight: 550; }
.std-scroll { max-height: 440px; overflow-y: auto; }
.std-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.std-foot-info { font-size: 13px; color: var(--ink-2); font-weight: 550; }
.std-preview-label { font-size: 15px; font-weight: 600; color: var(--blue); margin-bottom: 14px; }
.std-pg-title { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 8px; }
.std-pg { display: flex; flex-direction: column; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 2px; overflow: hidden; }
.std-pg-row { display: flex; gap: 12px; background: #fff; padding: 9px 13px; }
.std-pg-k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; flex: 0 0 90px; }
.std-pg-v { font-size: 13px; color: var(--ink); flex: 1; word-break: break-word; }
.std-actionbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.std-parent { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; background: var(--blue-soft); border: 1px solid #dedede; border-radius: var(--r-md); padding: 12px 15px; font-size: 13.5px; color: var(--ink); }
.std-parent input { position: absolute; opacity: 0; pointer-events: none; }
.std-parent .checkbox { flex: 0 0 auto; margin-top: 1px; }
.std-parent input:checked + .checkbox { background: var(--blue); border-color: var(--blue); }
.std-parent .checkbox svg { opacity: 0; color: #fff; }
.std-parent input:checked + .checkbox svg { opacity: 1; }
.std-unset { font-size: 12.5px; color: var(--ink-3); font-style: italic; }

/* CM360 creatives */
.crt-grid { display: grid; grid-template-columns: 1fr 430px; gap: 18px; align-items: start; }
@container (max-width: 980px) { .crt-grid { grid-template-columns: 1fr; } }
.crt-ico { color: #000; font-size: 14px; }
.rm-dot { width: 9px; height: 9px; border-radius: 50%; background: #c2c2c2; box-shadow: 0 0 0 3px rgba(194,194,194,0.3); flex: 0 0 auto; }
.eye-btn { background: none; border: 0; cursor: pointer; font-size: 15px; padding: 2px; opacity: 1; }
.eye-btn:hover { opacity: 1; }
.new-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
    background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-md);
    box-shadow: var(--sh-3); padding: 6px; min-width: 230px;
    display: flex; flex-direction: column;
}
.nm-item { background: none; border: 0; cursor: pointer; text-align: left; font-size: 13.5px; padding: 8px 12px; border-radius: 2px; color: var(--ink); }
.nm-item:hover { background: var(--bg-soft); }
.nm-sep { height: 1px; background: var(--line-soft); margin: 5px 4px; }
.crt-panel { position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 140px); overflow: hidden; }
.crt-head { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px 0; }
.crt-x { background: none; border: 0; cursor: pointer; font-size: 14px; color: var(--ink-3); padding: 2px; flex: 0 0 auto; }
.crt-x:hover { color: var(--ink); }
.crt-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crt-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.crt-facts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 16px 0 14px; }
.crt-fact { background: var(--bg-soft-2); border: 1px solid var(--line-soft); border-radius: 2px; padding: 10px 12px; }
.crt-fact .k { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.crt-fact .v { font-size: 13.5px; font-weight: 550; margin-top: 3px; }
.crt-log { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.crt-log:last-child { border-bottom: 0; }
.crt-log .k { font-size: 12px; color: var(--ink-3); }
.crt-log .v { font-size: 13.5px; margin-top: 3px; }
.crt-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }

/* SEO model chips */
.seo-models { display: flex; flex-wrap: wrap; gap: 8px; }
/* SEO model multi-select dropdown */
.mp-wrap { position: relative; }
.mp-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; cursor: pointer; }
.mp-caret { color: var(--ink-3); font-size: 12px; }
.mp-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: 2px; box-shadow: 0 12px 32px rgba(0,0,0,0.12); overflow: hidden; }
.mp-sort { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.mp-sort-label { font-size: 12px; color: var(--ink-3); margin-right: 2px; }
.mp-sort button { border: 1px solid var(--line); background: #fff; border-radius: 2px; padding: 4px 10px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.mp-sort button.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.mp-list { max-height: 300px; overflow-y: auto; padding: 6px; }
.mp-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: 0; border-radius: 2px; padding: 7px 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.mp-item:hover { background: var(--surface, #f5f5f7); }
.mp-item.on { color: var(--ink); }
.seo-model {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; border: 1.5px solid var(--line); border-radius: 2px;
    padding: 7px 14px 7px 9px; font-size: 13px; font-weight: 500; color: var(--ink-2);
    cursor: pointer; transition: all 0.13s ease;
}
.seo-model:hover { border-color: #b9b9c0; }
.seo-model.on { border-color: var(--blue); background: var(--blue-soft); color: var(--ink); }

/* prevent select collapse inside grids */
.bu-grid .field, .bu-grid .select { min-width: 0; max-width: 100%; }

/* reporting spend bars */
.rep-bar { height: 10px; border-radius: 2px; background: var(--surface-muted); overflow: hidden; min-width: 120px; }
.rep-fill { height: 100%; border-radius: 2px; background: var(--blue); }

/* ============ Shared connection workspace ============ */
.import-head { display: flex; align-items: flex-start; gap: 20px; margin: 0 0 20px; }
.import-head > div:first-child { flex: 1; min-width: 0; }
.import-conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(390px, 1fr)); gap: 16px; }
.import-conn { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.mc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mc-kind { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.mc-name { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.mc-detail { font-size: 13px; color: var(--ink-2); margin-top: -4px; }
.mc-rows { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.mc-rows > div { display: flex; gap: 10px; align-items: baseline; }
.mc-k { flex: 0 0 92px; font-size: 11.5px; color: var(--ink-3); }
.mc-v { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.mc-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; border-top: 1px solid var(--line-soft, #eee); padding-top: 10px; }
.mc-actions { display: flex; gap: 16px; }
.import-chip { display: inline-block; border: 1px solid var(--line); border-radius: 2px; padding: 2px 10px; font-size: 12px; color: var(--ink-2); background: #fff; white-space: nowrap; }
.import-meta { display: flex; flex-direction: column; gap: 9px; border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px; }
.import-meta > div { display: flex; gap: 12px; align-items: baseline; }
.import-meta .mc-k { flex: 0 0 110px; }

/* CM360 creative context must fit the workspace independently of table scrolling. */
.cm360-creative-advertiser { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; max-width: 100%; margin-bottom: 14px; }
.cm360-creative-advertiser > .sub { flex: 0 0 auto; }
.cm360-creative-advertiser > .select { flex: 0 1 520px; width: min(520px, 100%); min-width: 0; max-width: 100%; box-sizing: border-box; text-overflow: ellipsis; }
