/* =========================================================
   AUDIENCE HUB — quick nav, orbit scene, switchable views
   The five tools sit still, evenly spaced round the org; the motion is
   in the rings, the halo and the spokes flowing in. Reduced motion
   stops all of it. Tokens from css/base/tokens.css.
   ========================================================= */

#page-audience-hub {
    /* One belt: five 176x62 cards, 72deg apart, on radius --hub-r.
       Widest reach: r*cos18 (195) + half a card (88) = 283 < half the scene (300).
       Top: r + 31 = 236; bottom: r*sin54 (166) + 31 = 197; both inside half the height (248). */
    --hub-r: 205px;
    --hub-card-w: 176px;
    --hub-card-h: 62px;
    --hub-scene-w: 600px;
    --hub-scene-h: 496px;
    /* Quick-nav block: 12+10 padding, 38px pill (30 + 3+3 padding + 2 border), 1px rule, 10px margin. */
    --hub-quick-h: 71px;
    --hub-pad-t: 28px;   /* the page's own top padding (layout/content.css) */
    --hub-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- switchable views ---------- */

.hub-stage {
    position: relative;
    padding: 0 6px 34px;
}
.hub-view {
    max-width: 1180px;
    margin: 0 auto;
}
.hub-view[hidden] { display: none; }
.hub-view.is-open {
    animation: hub-view-in 320ms cubic-bezier(.22, 1, .36, 1) backwards;
}
@keyframes hub-view-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* the orbit view is one hero card: copy and ask box on the left, the scene on the right */
#hubViewOrbit.is-open { display: block; padding-top: 4px; }

/* ---------- quick nav (always on top of the page) ---------- */

.hub-quick {
    position: sticky;
    top: var(--topbar);
    z-index: 40;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
    /* lines the switcher up with the 1180px views below it (6px is the stage's own side padding) */
    padding: 12px max(6px, calc((100% - 1180px) / 2)) 10px;
    background: var(--bg);
    border-bottom: 1px solid transparent;
}
.hub-switch {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    max-width: 100%;
}
.hub-switch::-webkit-scrollbar { display: none; }
.hub-switch-btn {
    height: 30px;
    padding: 0 13px;
    border-radius: 999px;
    background: transparent;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--text-2);
    white-space: nowrap;
    flex: none;
    transition: background var(--transition), color var(--transition);
}
.hub-switch-btn:hover { background: var(--primary-soft-2); color: var(--primary-dark); }
.hub-switch-btn.is-current,
.hub-switch-btn.is-current:hover {
    background: var(--primary);
    color: #fff;
}
.hub-switch-btn:focus-visible,
.hub-sat-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* the bar's 3px padding is all the room the ring has before overflow clips it */
.hub-switch-btn:focus-visible { outline-offset: 1px; }

/* ---------- orbit hero: the copy and ask box beside the scene ---------- */

.hub-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--hub-scene-w);
    align-items: center;
    gap: 28px;
    width: 100%;
    padding: 34px 28px 34px 40px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(60% 80% at 82% 45%, rgba(0, 113, 219, .10), transparent 70%),
        radial-gradient(40% 60% at 100% 100%, rgba(109, 92, 231, .10), transparent 70%),
        var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    isolation: isolate;
}
/* a faint dot grid, only behind the scene */
.hub-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: calc(var(--hub-scene-w) + 80px);
    background-image: radial-gradient(var(--border-strong) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask: radial-gradient(closest-side, #000 30%, transparent 100%);
            mask: radial-gradient(closest-side, #000 30%, transparent 100%);
    opacity: .55;
    pointer-events: none;
    z-index: -1;
}
.hub-hero-copy { display: grid; gap: 14px; align-content: center; min-width: 0; }
.hub-eyebrow {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--primary-soft-2);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.hub-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(0, 113, 219, .18); }
.hub-hero-copy .page-title { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; }
.hub-hero-copy .page-title em { font-style: normal; background: var(--primary-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hub-hero-copy .page-description { margin: 0; max-width: 460px; font-size: 13.5px; line-height: 1.6; }

/* ---------- orbit scene ---------- */

.hub-orbit {
    position: relative;
    width: var(--hub-scene-w);
    height: var(--hub-scene-h);
}
/* the glow the org sits in */
.hub-orbit::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--hub-r) * 1.3);
    height: calc(var(--hub-r) * 1.3);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 113, 219, .16), rgba(109, 92, 231, .06) 60%, transparent);
    pointer-events: none;
}
.hub-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    border: 1px solid var(--border);
    border-radius: 50%;
    pointer-events: none;
}
.hub-ring-1 { width: calc(var(--hub-r) * 1.1); height: calc(var(--hub-r) * 1.1); border: 1.5px dashed rgba(0, 113, 219, .28); animation: hub-turn 70s linear infinite; }
.hub-ring-m { width: calc(var(--hub-r) * 2); height: calc(var(--hub-r) * 2); border-color: var(--border-strong); }
.hub-ring-o { width: calc(var(--hub-r) * 2.32); height: calc(var(--hub-r) * 2.32); border-color: rgba(109, 92, 231, .14); border-style: dashed; animation: hub-turn 120s linear infinite reverse; }
@keyframes hub-turn { to { rotate: 360deg; } }

/* spokes: dashes flowing from each tool into the org */
.hub-spoke {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--hub-r) - 118px);
    height: 2px;
    margin-top: -1px;
    transform-origin: 0 50%;
    transform: rotate(var(--a)) translateX(62px);
    background: repeating-linear-gradient(90deg, var(--c, var(--primary)) 0 5px, transparent 5px 12px);
    opacity: .45;
    border-radius: 2px;
    animation: hub-flow 1.6s linear infinite;
    pointer-events: none;
}
@keyframes hub-flow { from { background-position: 0 0; } to { background-position: -24px 0; } }

/* the org, at the centre */
.hub-org {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 150px;
    text-align: center;
    z-index: 2;
}
.hub-org-disc {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 14px 34px -10px rgba(0, 113, 219, .45), 0 0 0 6px rgba(255, 255, 255, .7);
    display: grid;
    place-items: center;
}
/* a gradient rim and a slow halo pulse */
.hub-org-disc::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    padding: 3px;
    background: conic-gradient(from 200deg, var(--primary), #6d5ce7, #12855f, var(--primary));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.hub-org-disc::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(0, 113, 219, .35);
    animation: hub-halo 3.2s ease-out infinite;
    pointer-events: none;
}
@keyframes hub-halo { from { transform: scale(1); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
.hub-org-disc img { width: 100%; height: 100%; object-fit: contain; padding: 16px; border-radius: 50%; }
.hub-org-initial { font-size: 38px; font-weight: 800; letter-spacing: -.03em; background: var(--primary-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hub-org-disc svg { width: 34px; height: 34px; stroke: var(--primary-dark); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hub-org-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 800; letter-spacing: -.02em; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .85); }

/* the centre is a button when Brand & Knowledge is reachable */
button.hub-org { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
button.hub-org:hover .hub-org-disc { transform: scale(1.04); }
button.hub-org:hover .hub-org-name { color: var(--primary-dark); }
button.hub-org:focus-visible { outline: none; }
button.hub-org:focus-visible .hub-org-disc { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }
.hub-org-mark { position: relative; display: grid; place-items: center; width: 140px; height: 140px; margin: -22px 0; }
.hub-org-disc { transition: transform var(--transition); }
.hub-org-disc.is-dark { background: #141b3c; }
.hub-org-tagline {
    max-width: 170px;
    margin-top: -4px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hub-org-nudge {
    margin-top: -2px;
    padding: 3px 9px;
    border: 1px dashed var(--primary);
    border-radius: 999px;
    background: var(--surface);
    font-size: 10.5px;
    font-weight: 800;
    color: var(--primary-dark);
}

/* health ring: one arc per tool, pointing at it; it lights in the tool's colour once used */
.hub-health { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hub-health-arc { fill: none; stroke: var(--border-strong); stroke-width: 4; stroke-linecap: round; opacity: .6; transition: stroke .4s ease, opacity .4s ease; }
.hub-health-arc.is-on { opacity: 1; filter: drop-shadow(0 0 4px currentColor); }
.hub-health-arc[data-sat="crm"].is-on       { stroke: #0071db; color: rgba(0, 113, 219, .5); }
.hub-health-arc[data-sat="qa"].is-on        { stroke: #6d5ce7; color: rgba(109, 92, 231, .5); }
.hub-health-arc[data-sat="audiences"].is-on { stroke: #e8467c; color: rgba(232, 70, 124, .5); }
.hub-health-arc[data-sat="datasets"].is-on  { stroke: #12855f; color: rgba(18, 133, 95, .5); }
.hub-health-arc[data-sat="ads"].is-on       { stroke: #e8921c; color: rgba(232, 146, 28, .5); }

/* "3 of 5 tools in use", under the description */
.hub-pulse { display: inline-flex; align-items: center; gap: 10px; min-height: 22px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.hub-pulse-dots { display: inline-flex; gap: 4px; }
.hub-pulse-dots i { width: 18px; height: 6px; border-radius: 999px; background: var(--border-strong); transition: background .4s ease; }
.hub-pulse-dots i.is-on[data-sat="crm"]       { background: #0071db; }
.hub-pulse-dots i.is-on[data-sat="qa"]        { background: #6d5ce7; }
.hub-pulse-dots i.is-on[data-sat="audiences"] { background: #e8467c; }
.hub-pulse-dots i.is-on[data-sat="datasets"]  { background: #12855f; }
.hub-pulse-dots i.is-on[data-sat="ads"]       { background: #e8921c; }
.hub-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-family: var(--hub-mono);
    font-size: 9.5px;
    color: var(--text-2);
}
.hub-chip b { color: var(--text); }
.hub-chip:first-child { border-color: transparent; background: var(--primary-soft-2); }
.hub-chip:first-child, .hub-chip:first-child b { color: var(--primary-dark); }

/* satellites: five tools, evenly spaced and still; the motion lives in the rings and spokes */
.hub-sat {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    transform: rotate(var(--a)) translateX(var(--hub-r)) rotate(calc(-1 * var(--a)));
}
.hub-sat[data-sat="crm"],       .hub-spoke[data-sat="crm"]       { --a: 270deg; --c: #0071db; --c-soft: #e6f1fc; }
.hub-sat[data-sat="qa"],        .hub-spoke[data-sat="qa"]        { --a: 342deg; --c: #6d5ce7; --c-soft: #efecff; }
.hub-sat[data-sat="audiences"], .hub-spoke[data-sat="audiences"] { --a: 54deg;  --c: #e8467c; --c-soft: #fdebf1; }
.hub-sat[data-sat="datasets"],  .hub-spoke[data-sat="datasets"]  { --a: 126deg; --c: #12855f; --c-soft: #e5f5ee; }
.hub-sat[data-sat="ads"],       .hub-spoke[data-sat="ads"]       { --a: 198deg; --c: #e8921c; --c-soft: #fdf2e2; }
.hub-orbit:has(.hub-sat:hover) .hub-spoke { opacity: .15; }
.hub-orbit:has(.hub-sat[data-sat="crm"]:hover) .hub-spoke[data-sat="crm"],
.hub-orbit:has(.hub-sat[data-sat="qa"]:hover) .hub-spoke[data-sat="qa"],
.hub-orbit:has(.hub-sat[data-sat="audiences"]:hover) .hub-spoke[data-sat="audiences"],
.hub-orbit:has(.hub-sat[data-sat="datasets"]:hover) .hub-spoke[data-sat="datasets"],
.hub-orbit:has(.hub-sat[data-sat="ads"]:hover) .hub-spoke[data-sat="ads"] { opacity: .9; height: 3px; }

.hub-sat-btn {
    position: relative;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: 36px 1fr;
    grid-template-areas: "disc name" "disc meta";
    column-gap: 11px;
    row-gap: 2px;
    align-content: center;
    align-items: center;
    width: var(--hub-card-w);
    height: var(--hub-card-h);
    padding: 0 14px 0 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 24px -14px rgba(20, 27, 60, .35);
    text-align: left;
    transition: border-color var(--transition), box-shadow var(--transition), translate var(--transition);
}
.hub-sat-btn:hover,
.hub-sat-btn:focus-visible {
    translate: 0 -3px;
    border-color: var(--c, var(--primary));
    box-shadow: 0 16px 30px -14px var(--c, var(--primary)), 0 0 0 4px var(--c-soft, var(--primary-soft-2));
}
.hub-sat-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hub-sat-disc {
    grid-area: disc;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--c-soft, var(--primary-soft-2));
    display: grid;
    place-items: center;
}
.hub-sat-disc svg { width: 18px; height: 18px; stroke: var(--c, var(--primary-dark)); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hub-sat[data-sat="qa"] .hub-sat-disc { background: linear-gradient(135deg, #6d5ce7, var(--primary)); }
.hub-sat[data-sat="qa"] .hub-sat-disc::after {
    content: "";
    width: 19px;
    height: 19px;
    background: var(--surface);
    -webkit-mask: var(--emblem-mask-image) center / contain no-repeat;
    mask: var(--emblem-mask-image) center / contain no-repeat;
}
.hub-sat-name { grid-area: name; align-self: end; font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; }
.hub-sat-meta { grid-area: meta; align-self: start; font-size: 11.5px; line-height: 1.25; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-sat-meta b { color: var(--c, var(--text)); font-weight: 800; font-variant-numeric: tabular-nums; }
/* an empty tool says what to do first */
.hub-sat-cta { color: var(--c, var(--primary)); font-weight: 700; }

/* what the tool is for, on hover or focus; CRM sits at the top, so its tip opens below */
.hub-sat-tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    z-index: 5;
    width: 220px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #141b3c;
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    box-shadow: 0 12px 26px -12px rgba(20, 27, 60, .6);
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}
.hub-sat-tip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #141b3c;
}
.hub-sat[data-sat="crm"] .hub-sat-tip { bottom: auto; top: calc(100% + 10px); transform: translate(-50%, -4px); }
.hub-sat[data-sat="crm"] .hub-sat-tip::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #141b3c; }
.hub-sat-btn:hover .hub-sat-tip,
.hub-sat-btn:focus-visible .hub-sat-tip { opacity: 1; transform: translate(-50%, 0); }
.hub-sat:has(.hub-sat-btn:hover),
.hub-sat:has(.hub-sat-btn:focus-visible) { z-index: 6; }
.hub-sat-btn[data-count-state="waiting"] .hub-sat-meta,
.hub-sat-btn[data-count-state="failed"] .hub-sat-meta { opacity: .75; }

/* ---------- ask box (left column of the hero) ---------- */

.hub-ask { width: 100%; max-width: 520px; display: grid; gap: 12px; margin-top: 6px; }
.hub-ask-box {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 12px 28px -18px rgba(0, 113, 219, .5);
}
.hub-ask-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.hub-ask-box textarea {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 11px 0;
    border: 0;
    outline: 0;
    resize: none;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: var(--text);
}
.hub-ask-box .btn { min-height: 44px; min-width: 76px; border-radius: 12px; }
.hub-ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-ask-chip {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2);
    transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.hub-ask-chip:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--surface); }
.hub-ask-chip:focus-visible,
.hub-ask-box .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- saved audiences panel ---------- */

.hub-aud-list { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.hub-aud-empty { margin: 0; padding: 28px 0; font-size: 13px; color: var(--text-2); }
.hub-aud-list .btn { align-self: flex-start; }

.hub-seg { position: relative; }
.hub-seg-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 13px 40px 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-align: left;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.hub-seg-row:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.hub-seg-row:focus-visible,
.hub-seg-delete:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.hub-seg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-seg-name { font-size: 13px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.hub-seg-kind {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--primary-soft-2);
    color: var(--primary-dark);
    font-family: var(--hub-mono);
    font-size: 9px;
    font-weight: 700;
}
.hub-seg-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    font-family: var(--hub-mono);
    font-size: 9.5px;
    color: var(--text-2);
}
.hub-seg-chip.is-ok { border-color: transparent; background: var(--success-soft); }
.hub-seg-chip.is-warn { border-color: transparent; background: var(--warning-soft); }
.hub-seg-chip.is-error { border-color: transparent; background: var(--danger-soft, var(--surface-soft)); }
.hub-seg-chip.is-error .hub-seg-dot { background: var(--danger); }
.hub-seg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.hub-seg-chip.is-warn .hub-seg-dot,
.hub-seg-send.is-sending .hub-seg-dot { background: var(--warning); animation: hub-seg-pulse 1.4s ease-in-out infinite; }
@keyframes hub-seg-pulse { 50% { opacity: .35; } }

.hub-seg-meta { font-family: var(--hub-mono); font-size: 10px; color: var(--text-3); }
.hub-seg-send { font-size: 11px; color: var(--text-2); }
.hub-seg-note { font-size: 11px; color: var(--warning); }
.hub-seg-error { font-size: 11px; color: var(--danger); }

/* Delete, revealed on hover or keyboard focus, like the rail's own rows. */
.hub-seg-delete {
    position: absolute;
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-3);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), color var(--transition);
}
.hub-seg-delete svg { width: 13px; height: 13px; }
.hub-seg:hover .hub-seg-delete,
.hub-seg:focus-within .hub-seg-delete { opacity: 1; pointer-events: auto; }
.hub-seg-delete:hover { color: var(--danger); }
@media (hover: none) { .hub-seg-delete { opacity: 1; pointer-events: auto; } }

@media (prefers-reduced-motion: reduce) {
    .hub-seg-chip.is-warn .hub-seg-dot,
    .hub-seg-send.is-sending .hub-seg-dot { animation: none; }
}

/* ---------- audience detail ---------- */

.hub-aud-detail { display: flex; flex-direction: column; gap: 22px; max-width: 720px; }
.hub-aud-detail .btn { min-height: 44px; }
.hub-aud-detail .btn:focus-visible,
.hub-aud-detail .lab-input:focus-visible,
.hub-aud-people:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hub-aud-back { align-self: flex-start; gap: 4px; margin-left: -10px; }
.hub-aud-back svg { width: 16px; height: 16px; }
.hub-aud-block { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; max-width: 100%; }
.hub-aud-heading { margin: 0; overflow-wrap: anywhere; }
.hub-aud-heading:focus { outline: none; }
.hub-aud-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.hub-aud-from { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.hub-aud-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-aud-danger:hover { color: var(--danger); }
.hub-aud-rename { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.hub-aud-rename label { flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--text-2); }
.hub-aud-rename .lab-input { flex: 1 1 200px; min-height: 44px; min-width: 0; }
.hub-aud-send-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.hub-aud-send-text { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.hub-aud-send-text.is-error { color: var(--danger); }
.hub-aud-people { overflow-x: auto; max-width: 100%; width: 100%; }
#hubAudPeople .hub-db-empty { padding: 4px 0; }

/* ---------- databases panel ---------- */

.hub-db-grid { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.hub-db-sources, .hub-db-catalog { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hub-db-empty { margin: 0; padding: 20px 0; font-size: 13px; color: var(--text-2); }
.hub-db-sources .btn, .hub-db-catalog .btn { align-self: flex-start; min-height: 44px; }
[data-hub-add-source], [data-hub-ads-open] { min-height: 44px; }

.hub-src {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    text-align: left;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.hub-src:hover { border-color: var(--primary); }
.hub-src.is-selected { border-color: var(--primary); background: var(--primary-soft-2); }
.hub-src:focus-visible,
.hub-tbl summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hub-src-name { font-size: 13px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.hub-src-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    font-family: var(--hub-mono);
    font-size: 9.5px;
    color: var(--text-2);
    flex-shrink: 0;
}
.hub-src-chip.is-ok { background: var(--success-soft); }
.hub-src-chip.is-warn { background: var(--warning-soft); }
.hub-src-chip.is-warn .hub-seg-dot { background: var(--warning); }

.hub-cat-title { margin: 0 0 4px; font-size: 15px; font-weight: 800; color: var(--text); }
.hub-tbl { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.hub-tbl summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 44px;
    padding: 10px 14px;
    cursor: pointer;
}
.hub-tbl-name { font-family: var(--hub-mono); font-size: 12px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.hub-tbl-count { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.hub-cols { list-style: none; margin: 0; padding: 0 14px 10px; }
.hub-col { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--border); }
.hub-col-name { font-family: var(--hub-mono); font-size: 11.5px; color: var(--text); }
.hub-col-type { font-family: var(--hub-mono); font-size: 10px; color: var(--text-3); }
.hub-col-id, .hub-col-pii { padding: 2px 7px; border-radius: 999px; font-size: 9.5px; font-weight: 700; }
.hub-col-id { background: var(--primary-soft-2); color: var(--primary-dark); }
.hub-col-pii { background: var(--warning-soft); color: var(--warning); margin-left: auto; }

.hub-ads { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.hub-ads-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-ads-group { display: flex; flex-direction: column; gap: 8px; }
.hub-ads-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}
.hub-ads-name { font-size: 13px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; margin-right: auto; }
.hub-ads .btn { align-self: flex-start; min-height: 44px; }
.hub-ads .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

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

/* ---------- narrow or squatty windows: orbit stacks into a list ---------- */

@media (max-width: 1536px), (max-height: 820px) {
    #page-audience-hub { --hub-pad-t: 20px; }
}
@media (max-height: 760px) {
    .hub-org-disc { width: 80px; height: 80px; }
}
/* not room for copy and scene side by side: stack them, scene centred under the ask box */
@media (max-width: 1240px) {
    .hub-hero { grid-template-columns: 1fr; justify-items: center; padding: 30px 24px; text-align: center; }
    .hub-hero::before { inset: auto 0 0 0; width: auto; height: var(--hub-scene-h); }
    .hub-hero-copy { justify-items: center; }
    .hub-eyebrow { justify-self: center; }
    .hub-hero-copy .page-description { margin-inline: auto; }
    .hub-ask { margin-inline: auto; }
    .hub-ask-chips { justify-content: center; }
}
@media (max-width: 900px) {
    #page-audience-hub { --hub-quick-h: 85px; }   /* 44px pills */
    .hub-switch-btn { min-height: 44px; }
    .hub-hero { padding: 24px 16px; }
    .hub-hero-copy .page-title { font-size: 24px; }
    .hub-orbit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; height: auto; padding: 4px 0; }
    .hub-orbit::before, .hub-ring, .hub-spoke { display: none; }
    .hub-org { position: static; transform: none; grid-column: 1 / -1; justify-self: center; padding: 8px 0 10px; }
    .hub-sat { position: static; transform: none; }
    .hub-sat:last-of-type { grid-column: 1 / -1; }
    .hub-sat-btn { transform: none; width: 100%; min-height: 60px; height: auto; padding: 8px 12px; }
    .hub-sat-tip { display: none; }
    .hub-view.is-open { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hub-sat-btn { transition: none; }
    .hub-view.is-open { animation: none; }
    .hub-ring, .hub-spoke, .hub-org-disc::after { animation: none; }
}
