/* ═══════════════════════════════════════════════════════════════════════════
   Brand Footprint
   Hero (idle + loading) lives at the top of this file using the global
   app tokens. Result page lives in its own .t-app token scope (refined
   variant ported from the BrandHunt Refined Prototype) and supports both
   themes via a [data-theme="dark"] .t-app override block.
   All @media rules live in stylingMedias.css per project rule.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page shell ─────────────────────────────────────────────────────────── */
.bf-page {
    background: var(--bg-page);
    min-height: 100vh;
    font-family: var(--font-ui);
}

/* ════════════════════════════════════════════════════════════════════════════
   HERO — replaces the old static header. Full-bleed canvas with animated
   gradient mesh, oversized input as the focal point, quick-pick chips,
   trust ticker. Orange is reintroduced here as a deliberate accent (mesh,
   sparkle, eyebrow pill, focus glow, loader rings) — the result page stays
   monochrome because it's a data dashboard; the landing gets to be expressive.
   ════════════════════════════════════════════════════════════════════════════ */

.bf-hero {
    position: relative;
    min-height: 100vh;
    margin-top: -16px;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 80px;
}

/* ── Mesh background ─────────────────────────────────────────────────────── */
.bf-hero__mesh {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 120% 80% at 50% 0%, rgba(255, 255, 255, 0.6), transparent 60%),
        var(--bg-page);
    overflow: hidden;
}

.bf-mesh-blob {
    position: absolute;
    width: 540px;
    height: 540px;
    border-radius: 50%;
    filter: blur(96px);
    opacity: 0.55;
    will-change: transform;
}

.bf-mesh-blob--1 {
    background: radial-gradient(circle, var(--accent), transparent 65%);
    top: -120px;
    left: -80px;
    opacity: 0.32;
    animation: bf-blob-drift-1 18s ease-in-out infinite alternate;
}
.bf-mesh-blob--2 {
    background: radial-gradient(circle, #ffd6a8, transparent 65%);
    top: 8%;
    right: -120px;
    opacity: 0.50;
    animation: bf-blob-drift-2 22s ease-in-out infinite alternate;
}
.bf-mesh-blob--3 {
    background: radial-gradient(circle, #ffe9d4, transparent 65%);
    bottom: -160px;
    left: 30%;
    width: 620px;
    height: 620px;
    opacity: 0.45;
    animation: bf-blob-drift-3 26s ease-in-out infinite alternate;
}
.bf-mesh-blob--4 {
    background: radial-gradient(circle, var(--accent), transparent 70%);
    bottom: 10%;
    right: 8%;
    width: 380px;
    height: 380px;
    opacity: 0.18;
    animation: bf-blob-drift-4 20s ease-in-out infinite alternate;
}

@keyframes bf-blob-drift-1 {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(80px, 60px, 0) scale(1.15); }
}
@keyframes bf-blob-drift-2 {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-120px, 80px, 0) scale(1.08); }
}
@keyframes bf-blob-drift-3 {
    0%   { transform: translate3d(0, 0, 0) scale(1.05); }
    100% { transform: translate3d(60px, -100px, 0) scale(1); }
}
@keyframes bf-blob-drift-4 {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-60px, -40px, 0) scale(1.2); }
}

/* Dot-grid texture sitting above the blobs for crisp depth. */
.bf-mesh-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(216, 90, 48, 0.22) 1.2px, transparent 1.2px);
    background-size: 22px 22px;
    mask-image: radial-gradient(ellipse 85% 65% at 50% 50%, black, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 50%, black, transparent 80%);
    pointer-events: none;
}

/* Dark mode — flip the dot color to white-with-alpha so the grid reads
   against the deep neutral background instead of disappearing into it. */
[data-theme="dark"] .bf-mesh-grid {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.10) 1.2px, transparent 1.2px);
}

/* ── Floating top-right action group ─────────────────────────────────────── */
.bf-hero__nav {
    position: absolute;
    top: 28px;
    right: 32px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 4;
}

/* ── Hero content column ─────────────────────────────────────────────────── */
.bf-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 22px;
}

.bf-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(15, 15, 14, 0.04);
}

.bf-hero__sparkle {
    color: var(--accent);
    font-size: 0.95rem;
    line-height: 1;
    animation: bf-sparkle-pulse 2.8s ease-in-out infinite;
}

@keyframes bf-sparkle-pulse {
    0%, 100% { transform: scale(1)   rotate(0deg);   opacity: 1;   }
    50%      { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
}

.bf-hero__headline {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 5.6vw, 4.2rem);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -0.035em;
    color: var(--text-primary);
    margin: 4px 0 0;
}

.bf-hero__headline-accent {
    display: inline-block;
    width: 100%;
    background: linear-gradient(120deg, var(--accent) 0%, #ff8a4f 50%, #f06a2a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: italic;
    font-weight: 700;
    padding-bottom: 0.12em;
    position: relative;
}

.bf-hero__sub {
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    max-width: 520px;
}

/* ── Hero input — oversized pill with integrated CTA ─────────────────────── */
.bf-hero-input {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 620px;
    margin-top: 10px;
    padding: 6px 6px 6px 22px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 24px 60px -20px rgba(15, 15, 14, 0.18),
        0 8px 22px -12px rgba(255, 122, 64, 0.18);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.bf-hero-input:focus-within {
    border-color: var(--accent);
    box-shadow:
        0 0 0 4px rgba(255, 122, 64, 0.16),
        0 24px 60px -20px rgba(15, 15, 14, 0.24),
        0 10px 28px -10px rgba(255, 122, 64, 0.28);
    transform: translateY(-1px);
}

.bf-hero-input__icon {
    font-size: 1.05rem;
    opacity: 0.45;
    margin-right: 12px;
    transition: opacity 0.15s ease;
}
.bf-hero-input:focus-within .bf-hero-input__icon { opacity: 0.9; }

.bf-hero-input__field {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 18px 0;
    font-family: var(--font-ui);
    letter-spacing: -0.005em;
}
.bf-hero-input__field::placeholder {
    color: var(--text-muted);
    transition: opacity 0.4s ease;
}

.bf-hero-input__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 13px;
    font-family: var(--font-ui);
    font-size: 0.98rem;
    font-weight: 600;
    padding: 14px 22px;
    cursor: pointer;
    letter-spacing: 0.005em;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.15s ease;
    box-shadow: 0 4px 14px rgba(15, 15, 14, 0.18);
}
.bf-hero-input__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 15, 14, 0.26);
}
.bf-hero-input__cta:active { transform: translateY(0); }

.bf-hero-input__arrow {
    display: inline-block;
    font-size: 1.05rem;
    line-height: 1;
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.bf-hero-input__cta:hover .bf-hero-input__arrow { transform: translateX(3px); }

.bf-hero__error {
    font-size: 0.86rem;
    color: #dc2626;
    margin: -6px 0 0;
}

/* ── Quick-pick brand chips ──────────────────────────────────────────────── */
.bf-quick-picks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.bf-quick-picks__label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-right: 4px;
}

.bf-quick-pick {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-family: var(--font-mono, var(--font-ui));
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.18s ease, background 0.15s ease;
}
.bf-quick-pick:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
    border-color: var(--accent);
    background: rgba(255, 122, 64, 0.06);
    box-shadow: 0 6px 16px -8px rgba(255, 122, 64, 0.32);
}
.bf-quick-pick:active { transform: translateY(0); }

/* ── Trust ticker strip ──────────────────────────────────────────────────── */
.bf-trust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.bf-trust__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bf-trust__sep {
    color: var(--border);
    font-weight: 400;
}

.bf-trust__dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}
.bf-trust__dot--accent {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 122, 64, 0.18);
    animation: bf-trust-pulse 2.4s ease-in-out infinite;
}
@keyframes bf-trust-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255, 122, 64, 0.18); }
    50%      { box-shadow: 0 0 0 5px rgba(255, 122, 64, 0.28); }
}

/* ════════════════════════════════════════════════════════════════════════════
   LOADER — orbital rings + center step icon + horizontal dot timeline.
   Sits inside the same .bf-hero canvas so the mesh background continues.
   ════════════════════════════════════════════════════════════════════════════ */

.bf-hero__content--loader {
    gap: 28px;
    max-width: 560px;
}

/* Domain pill with typing cursor */
.bf-loader-domain {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(15, 15, 14, 0.06);
    font-family: var(--font-mono, var(--font-ui));
    font-size: 0.92rem;
    color: var(--text-primary);
}
.bf-loader-domain__icon { opacity: 0.55; }
.bf-loader-domain__text { letter-spacing: -0.005em; }
.bf-loader-domain__cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: var(--accent);
    margin-left: 2px;
    animation: bf-cursor-blink 1.05s steps(1) infinite;
}
@keyframes bf-cursor-blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Concentric orbital rings */
.bf-loader-orb {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 0 0;
}

.bf-loader-orb__ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid transparent;
    inset: 0;
}

.bf-loader-orb__ring--outer {
    inset: 0;
    border-top-color: var(--accent);
    border-right-color: rgba(255, 122, 64, 0.35);
    animation: bf-orb-spin 4.2s linear infinite;
}
.bf-loader-orb__ring--mid {
    inset: 22px;
    border-bottom-color: rgba(15, 15, 14, 0.4);
    border-left-color: rgba(15, 15, 14, 0.18);
    animation: bf-orb-spin 3.0s linear infinite reverse;
}
.bf-loader-orb__ring--inner {
    inset: 44px;
    border-top-color: var(--accent);
    border-right-color: transparent;
    border-bottom-color: rgba(255, 122, 64, 0.5);
    animation: bf-orb-spin 2.0s linear infinite;
}
@keyframes bf-orb-spin {
    to { transform: rotate(360deg); }
}

.bf-loader-orb__core {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--bg-primary), #fff8f1);
    border: 1px solid var(--border-subtle);
    box-shadow:
        0 8px 28px rgba(255, 122, 64, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bf-loader-orb__icon {
    font-size: 2.2rem;
    line-height: 1;
    animation: bf-icon-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bf-icon-pop {
    0%   { transform: scale(0.4) rotate(-30deg); opacity: 0; }
    60%  { transform: scale(1.15) rotate(8deg);  opacity: 1; }
    100% { transform: scale(1)    rotate(0deg);  opacity: 1; }
}

.bf-loader-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    animation: bf-title-rise 0.4s ease-out;
}
@keyframes bf-title-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Horizontal dot timeline */
.bf-loader-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 4px;
}

.bf-loader-tl-step {
    display: flex;
    align-items: center;
    gap: 0;
}

.bf-loader-tl-dot {
    position: relative;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.bf-loader-tl-step.is-active .bf-loader-tl-dot {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.25);
    box-shadow: 0 0 0 5px rgba(255, 122, 64, 0.22);
    animation: bf-dot-glow 1.4s ease-in-out infinite;
}
@keyframes bf-dot-glow {
    0%, 100% { box-shadow: 0 0 0 5px rgba(255, 122, 64, 0.22); }
    50%      { box-shadow: 0 0 0 9px rgba(255, 122, 64, 0.10); }
}

.bf-loader-tl-step.is-done .bf-loader-tl-dot {
    background: var(--text-primary);
    border-color: var(--text-primary);
}

.bf-loader-tl-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-primary);
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1;
}

.bf-loader-tl-line {
    width: 56px;
    height: 2px;
    background: var(--border);
    transition: background 0.3s ease;
}
.bf-loader-tl-step.is-done .bf-loader-tl-line {
    background: var(--text-primary);
}

.bf-loader-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 4px 0 0;
    letter-spacing: 0.005em;
}

/* Reduce motion — honour OS-level preference. */
@media (prefers-reduced-motion: reduce) {
    .bf-mesh-blob,
    .bf-hero__sparkle,
    .bf-loader-orb__ring,
    .bf-loader-orb__icon,
    .bf-loader-tl-step.is-active .bf-loader-tl-dot,
    .bf-trust__dot--accent,
    .bf-loader-domain__cursor,
    .bf-loader-title {
        animation: none !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   HOMEPAGE — wraps the hero (which reuses .bf-hero) and adds the
   "What you get" dimensions strip below. Same warm palette, lighter weight
   so the hero stays the centerpiece.
   ════════════════════════════════════════════════════════════════════════════ */

.home-shell {
    width: 100%;
}

.home-wyg {
    position: relative;
    padding: 96px 24px 120px;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-page);
}

.home-wyg__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 14px;
}

.home-wyg__heading {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.2vw, 2.4rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 56px;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

/* Italic gradient accent — mirrors .bf-hero__headline-accent so the same
   visual signature carries from the hero into this section. */
.home-wyg__heading-accent {
    display: inline-block;
    background: linear-gradient(120deg, var(--accent) 0%, #ff8a4f 50%, #f06a2a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: italic;
    font-weight: 700;
    padding-bottom: 0.12em;
}

/* ── 3-step "How it works" flow ──────────────────────────────────────────── */
.home-steps {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 1040px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.home-steps__item {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 28px 24px 24px;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.home-steps__item:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow:
        0 12px 28px -16px rgba(15, 15, 14, 0.18),
        0 4px 14px -8px rgba(255, 122, 64, 0.22);
}

/* Dotted connector between steps on desktop. The ::after on each non-last
   item draws a horizontal dotted line in the brand orange, sitting in the
   gutter between cards. Hidden on narrow viewports (handled in stylingMedias). */
.home-steps__item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -20px;
    width: 20px;
    height: 0;
    border-top: 2px dotted var(--accent);
    opacity: 0.45;
    transform: translateY(-50%);
}

.home-steps__num {
    display: inline-block;
    width: 100%;
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1.05;
    letter-spacing: -0.04em;
    background: linear-gradient(120deg, var(--accent) 0%, #ff8a4f 50%, #f06a2a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-bottom: 0.18em;
    margin-bottom: 14px;
}

.home-steps__title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.home-steps__desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

/* ── "Inside the report" chip strip ──────────────────────────────────────── */
.home-includes {
    margin: 56px auto 0;
    max-width: 1040px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.home-includes__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.home-includes__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.home-includes__chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-family: var(--font-mono, var(--font-ui));
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.005em;
}

/* ════════════════════════════════════════════════════════════════════════════
   UNDO TOAST — appears when the user navigates away from a result (logo
   click, back button), giving them a 6-second grace window to bring it
   back. Non-blocking: the reset happens immediately, the toast is just an
   undo affordance.
   ════════════════════════════════════════════════════════════════════════════ */
.bf-undo-toast {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px 12px 18px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 14px;
    box-shadow:
        0 12px 32px -8px rgba(15, 15, 14, 0.32),
        0 4px 14px -4px rgba(15, 15, 14, 0.18);
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 500;
    overflow: hidden;
    animation: bf-undo-rise 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: calc(100vw - 48px);
}

@keyframes bf-undo-rise {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.bf-undo-toast__icon {
    font-size: 1.05rem;
    line-height: 1;
    color: var(--accent);
    font-weight: 700;
}

.bf-undo-toast__text {
    color: var(--bg-primary);
    letter-spacing: 0.005em;
}

.bf-undo-toast__btn {
    background: transparent;
    color: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 6px 14px;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bf-undo-toast__btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

.bf-undo-toast__close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s ease, background 0.15s ease;
}
.bf-undo-toast__close:hover {
    color: var(--bg-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Countdown bar at the bottom — fills from 100% to 0% over 6s, matching the
   setTimeout in BrandFootprintPage. Pure CSS animation, GPU-friendly. */
.bf-undo-toast__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    transform-origin: left center;
    animation: bf-undo-countdown 6s linear forwards;
}

@keyframes bf-undo-countdown {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .bf-undo-toast { animation: none; }
    .bf-undo-toast__progress { animation: none; opacity: 0.4; }
}

/* Auto-track variant carries a longer sentence — let it read as a tidy card
   with a wrapping line rather than one ever-wider strip. */
.bf-undo-toast--track { max-width: min(420px, calc(100vw - 48px)); }
.bf-undo-toast--track .bf-undo-toast__text { white-space: normal; line-height: 1.35; }
.bf-undo-toast--track .bf-undo-toast__text strong { font-weight: 700; }

/* ── How-it-works button — used in floating top-right of hero canvas ───────── */
.bf-hiw-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: var(--font-ui);
    box-shadow: 0 2px 8px rgba(15, 15, 14, 0.04);
}
.bf-hiw-btn:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
    border-color: var(--border);
}

/* Result mode: lets the t-app shell handle internal spacing. Keeps the
   global navbar offset intact via padding. */
.bf-body--result {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESULT — BrandHunt Refined Prototype, refined variant.
   Token scope is .t-app so it does not leak into the rest of the app.
   Dark mode is wired via [data-theme="dark"] .t-app overrides further down.
   ═══════════════════════════════════════════════════════════════════════════ */

.t-app {
    --bg: #f6f6f4;
    --surface: #ffffff;
    --surface-2: #fbfbf9;
    --border: rgba(15, 15, 14, 0.08);
    --border-2: rgba(15, 15, 14, 0.12);
    --text: #111110;
    --muted: #6b6b66;
    --muted-2: #8e8e88;

    --accent: #111110;
    --accent-soft: rgba(17, 17, 16, 0.06);
    --track: rgba(15, 15, 14, 0.06);

    --pos-bg: #e6f5ec;
    --pos-fg: #1f7a3a;
    --med-bg: #fdf3df;
    --med-fg: #8a6320;
    --neu-bg: #efefec;
    --neu-fg: #6b6b66;

    --placeholder-bg: #e9e9e4;
    --placeholder-fg: #d8d8d2;
    --placeholder-text: #8e8e88;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --pad: 20px;
    --gap: 16px;

    --t-font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --t-font-display: 'Inter', sans-serif;
    --t-font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --shadow-card: 0 1px 0 rgba(15, 15, 14, 0.04);

    width: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--t-font-ui);
    font-size: 13px;
    line-height: 1.45;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.t-app, .t-app * { box-sizing: border-box; }

/* ────────────────────────────────────────────────────────────────────────────
   Dark-mode token override for the result-page scope. Single source of truth:
   redefine the same tokens under [data-theme="dark"] .t-app so every rule
   that reads them (cards, tabs, KPIs, sentiment pills, placeholders, etc.)
   inverts together. A handful of hardcoded literals further down in the file
   need their own overrides — they're collected in a single dark block at
   the end of this section.
   ──────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .t-app {
    --bg: #0d0d0c;
    --surface: #181816;
    --surface-2: #1f1f1c;
    --border: rgba(255, 255, 255, 0.08);
    --border-2: rgba(255, 255, 255, 0.14);
    --text: #f3f2ec;
    --muted: #a4a49d;
    --muted-2: #807e76;

    /* Primary affordance flips to a warm off-white in dark mode; matches the
       text color so the Admin-Controls / Score-tone pills read as the
       inverse-emphasis equivalent of black-in-light-mode. */
    --accent: #f3f2ec;
    --accent-soft: rgba(243, 242, 236, 0.08);
    --track: rgba(255, 255, 255, 0.06);

    /* Sentiment pills — keep semantic hue, switch to translucent backgrounds
       so they sit naturally on dark surfaces without looking like stickers. */
    --pos-bg: rgba(95, 196, 134, 0.16);
    --pos-fg: #6cd296;
    --med-bg: rgba(224, 184, 95, 0.16);
    --med-fg: #f0c97a;
    --neu-bg: rgba(255, 255, 255, 0.06);
    --neu-fg: #a4a49d;

    --placeholder-bg: rgba(255, 255, 255, 0.04);
    --placeholder-fg: rgba(255, 255, 255, 0.09);
    --placeholder-text: #807e76;

    --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.45);
}

/* ── Result-shell header ───────────────────────────────────────────────────
   Single contiguous header containing: action row (admin cluster far left,
   user actions far right), brand identity, and tabs. */
.t-shell-h {
    background: var(--surface);
    padding: 18px 24px 0;
    border-radius: 16px 16px 0 0;
}

/* Two clusters: __admin (HIW · Refresh · cached — admins only, sits above the
   brand logo) and __main (New Analysis · Share · Track · view switch — what
   every user sees, pinned right via margin-left:auto so it stays right even
   when the admin cluster is empty). */
.t-shell-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    min-height: 32px;
}
.t-shell-actions:empty { display: none; }
.t-shell-actions__admin,
.t-shell-actions__main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.t-shell-actions__main { margin-left: auto; }

.t-btn-ghost {
    padding: 7px 12px;
    background: transparent;
    border: 1px solid var(--border-2);
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.t-btn-ghost:hover { background: var(--accent-soft); color: var(--text); }

.t-btn-primary {
    padding: 7px 14px;
    background: var(--text);
    color: var(--surface);
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}
.t-btn-primary:hover:not(:disabled) { opacity: 0.9; }
.t-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.t-btn-primary.is-on { background: #1f7a3a; }

/* Canvas */
.t-canvas {
    padding: 24px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Brand identity row */
.t-brand-row {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 18px;
    align-items: center;
    padding-bottom: 18px;
}
.t-brand-mark {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: var(--text);
    color: var(--surface);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.02em;
    overflow: hidden;
    flex-shrink: 0;
}
.t-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.t-brand-mark-initials { display: block; line-height: 1; }
.t-brand-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.t-brand-name {
    font-family: var(--t-font-display);
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text);
    line-height: 1.15;
}
.t-brand-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.t-brand-link {
    display: inline-block;
    margin-top: 6px;
    color: var(--text);
    font-size: 12px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-2);
    align-self: flex-start;
}
.t-brand-link:hover { text-decoration-color: var(--text); }

/* Tabs (sit at the bottom of the shell header) */
.t-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin: 0 -24px;
    padding: 4px 24px 12px;
    border-bottom: 1px solid var(--border);
    /* Hide scrollbar; horizontal scroll still works on touch / shift-wheel */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.t-tabs::-webkit-scrollbar { display: none; }

.t-tab {
    padding: 7px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    flex-shrink: 0;
}
.t-tab:hover { color: var(--text); background: var(--accent-soft); }
.t-tab.is-on {
    color: var(--text);
    background: var(--bg);
    border-color: var(--border-2);
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(15, 15, 14, 0.05);
}
.t-tab.is-locked {
    color: var(--muted-2);
    cursor: pointer;
    opacity: 0.78;
}
.t-tab.is-locked:hover {
    color: var(--text);
    background: var(--accent-soft);
    opacity: 1;
}
.t-tab-lock {
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.85;
}

/* Anonymous unlock CTA — replaces the bottom half of Overview for gated users */
.bf-unlock {
    margin-top: 24px;
    padding: 36px 28px 32px;
    border: 1.5px solid var(--accent);
    border-radius: 14px;
    background: var(--accent-soft, rgba(244, 114, 80, 0.08));
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bf-unlock.is-pulse {
    transform: scale(1.012);
    box-shadow: 0 0 0 4px var(--accent-soft, rgba(244, 114, 80, 0.18));
}
.bf-unlock-eyebrow {
    font-size: 11px;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}
.bf-unlock-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.bf-unlock-sub {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    max-width: 620px;
    margin: 0 auto 18px;
}
.bf-unlock-list {
    list-style: none;
    padding: 0;
    margin: 0 auto 22px;
    max-width: 380px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
}
.bf-unlock-list li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--border, rgba(15, 15, 14, 0.08));
}
.bf-unlock-list li:last-child { border-bottom: none; }
.bf-unlock-actions {
    display: inline-flex;
    gap: 10px;
    justify-content: center;
}

/* Cards */
.t-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.t-card-h {
    padding: 16px var(--pad) 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.t-card-title {
    font-family: var(--t-font-display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--text);
}
.t-card-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.t-card-right { color: var(--muted); font-size: 12px; }
.t-card-body { padding: 8px var(--pad) var(--pad); }

.t-stamp { color: var(--muted-2); font-size: 11px; }

.t-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.t-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.t-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.t-row-4 .t-metric { background: var(--surface); box-shadow: var(--shadow-card); }

.t-empty { padding: 24px 8px; color: var(--muted); font-size: 13px; text-align: center; }
.t-empty-banner {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
}
.t-tiny { font-size: 10px; }
.t-muted { color: var(--muted); }

/* Brand Snapshot */
.t-snap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.t-snap-cell {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: var(--surface-2);
}
.t-snap-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.t-snap-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.t-snap-big {
    font-family: var(--t-font-display);
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1;
}
.t-snap-frac { color: var(--muted-2); font-size: 14px; font-weight: 400; }
.t-snap-mid {
    font-family: var(--t-font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.t-snap-foot { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.t-globe, .t-people { font-size: 28px; opacity: 0.55; }

.t-insight {
    margin-top: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 10px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
}
.t-insight-tag {
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--text);
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.t-insight-body { font-size: 12.5px; color: var(--text); margin: 0; line-height: 1.55; }

/* Signals list */
.t-signals { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.t-sig {
    display: grid;
    grid-template-columns: 22px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px dashed var(--border);
    font-size: 13px;
}
.t-sig:last-child { border-bottom: 0; }
.t-sig-ic { font-size: 13px; opacity: 0.6; }
.t-sig-label { color: var(--text); }
.t-sig-val { font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }

.t-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.t-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Key Metrics */
.t-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.t-metric {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 10px;
    padding: 12px;
}
.t-metric-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.t-metric-val {
    font-family: var(--t-font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}
.t-metric-delta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.t-metric-delta.is-up { color: var(--pos-fg); }
.t-metric-delta.is-down { color: #b1452a; }

.t-channels { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; margin-top: 16px; }
.t-sub-h { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.t-channels-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.t-legend { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.t-legend li {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 3px 0;
}
.t-dot { width: 8px; height: 8px; border-radius: 50%; }
.t-legend-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.t-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted-2); margin-top: 4px; }
.t-snap-mini { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.t-snap-mini-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed var(--border-soft, #eaeaea); }
.t-snap-mini-row:last-child { border-bottom: 0; }
.t-snap-mini-val { font-weight: 600; color: var(--ink, #111); font-variant-numeric: tabular-nums; }

/* Org chart */
.t-org { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0; }
.t-org-tier { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.t-org-card {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 140px;
    text-align: center;
}
.t-org-card.is-ceo { background: var(--text); color: var(--surface); border-color: var(--text); }
.t-org-card.is-ceo .t-org-title { color: rgba(255, 255, 255, 0.7); }
.t-org-card.is-sm { padding: 8px 12px; min-width: 110px; }
.t-org-name { font-size: 12.5px; font-weight: 600; }
.t-org-title { font-size: 11px; color: var(--muted); margin-top: 2px; }
.t-org-line { width: 1px; height: 14px; background: var(--border-2); }

/* Global presence */
.t-globe-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}
.t-globe-num {
    font-family: var(--t-font-display);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}
.t-globe-cta { text-align: right; font-size: 11px; }

/* Lists (news, roles, watch, recs) */
.t-news, .t-roles, .t-watch, .t-recs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.t-news li, .t-roles li, .t-watch li, .t-recs li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px dashed var(--border);
}
.t-news li:last-child, .t-roles li:last-child, .t-watch li:last-child, .t-recs li:last-child {
    border-bottom: 0;
}
.t-news li { grid-template-columns: 8px 1fr; }
.t-news-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 2px; }
.t-news-title { font-size: 13px; color: var(--text); font-weight: 500; }
.t-news-src { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.t-news-link, .t-role-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.t-news-link:hover .t-news-title, .t-role-link:hover .t-news-title {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.t-role-time { font-size: 11px; color: var(--muted-2); }
.t-rec-ic {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--text);
    display: grid;
    place-items: center;
    font-size: 13px;
}

/* Tables */
.t-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.t-table th {
    text-align: left;
    font-weight: 500;
    color: var(--muted-2);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 4px;
    border-bottom: 1px solid var(--border);
}
.t-table td {
    padding: 10px 4px;
    border-bottom: 1px dashed var(--border);
    font-variant-numeric: tabular-nums;
}
.t-table td:first-child { font-weight: 500; }
.t-table td .t-avi { margin-right: 6px; vertical-align: middle; }
.t-table tr.is-self td { background: var(--accent-soft); }
.t-table tr:last-child td { border-bottom: 0; }

.t-avi {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
}

/* Promo bar */
.t-promo {
    margin-top: 8px;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
}
.t-promo-l { display: flex; align-items: center; gap: 12px; }
.t-promo-ic { font-size: 18px; }
.t-promo-title { font-weight: 600; font-size: 13px; color: var(--text); }
.t-promo-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Brand tab */
.brand-id { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.brand-logo-block { display: flex; align-items: center; gap: 14px; }
.brand-logo-lg {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: var(--text);
    color: var(--surface);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.02em;
    overflow: hidden;
}
.brand-logo-lg img { width: 100%; height: 100%; object-fit: cover; }
.brand-id-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.brand-palette-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.brand-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.brand-swatch { display: flex; flex-direction: column; gap: 6px; }
.brand-swatch-chip {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.brand-swatch-hex {
    font-family: var(--t-font-mono);
    font-size: 11px;
    color: var(--muted);
}
.brand-voice { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.brand-voice li {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: baseline;
    font-size: 13px;
}
.brand-voice-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    text-align: center;
}
.brand-quote {
    margin: 0 0 14px;
    padding: 14px 18px;
    border-left: 3px solid var(--accent);
    background: var(--surface-2);
    border-radius: 0 8px 8px 0;
    font-size: 15px;
    line-height: 1.5;
    font-style: italic;
    color: var(--text);
}
.brand-pos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand-pos-val { font-weight: 500; font-size: 13px; margin-top: 2px; color: var(--text); }

/* Industries / Specialties chip rows on Brand Identity card */
.brand-id-tags {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}
.brand-id-tagrow {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: flex-start;
}
.brand-id-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.brand-id-chip {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--neu-bg);
    color: var(--text);
    border: 1px solid var(--border);
    line-height: 1.5;
}
.brand-id-chip--ind {
    background: var(--accent-soft);
    border-color: var(--border-2);
    font-weight: 500;
}

/* Chips (filters) */
.t-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-2);
    background: var(--surface);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
.t-chip:hover { background: var(--accent-soft); }
.t-chip.is-on { background: var(--text); color: var(--surface); border-color: var(--text); }

/* Social tab */
.social-channels { display: flex; flex-direction: column; gap: 10px; }
.social-ch {
    display: grid;
    grid-template-columns: 10px 110px 70px 1fr 60px;
    gap: 12px;
    align-items: center;
    font-size: 12.5px;
}
.social-dot { width: 10px; height: 10px; border-radius: 50%; }
.social-ch-n { font-weight: 500; color: var(--text); }
.social-ch-v { color: var(--muted); font-variant-numeric: tabular-nums; }
.social-ch-bar {
    height: 6px;
    background: var(--track);
    border-radius: 3px;
    overflow: hidden;
}
.social-ch-bar > span { display: block; height: 100%; border-radius: 3px; }
.social-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.social-title { margin-top: 6px; font-size: 12.5px; }

/* Signals tab */
.signals-detailed { list-style: none; padding: 0; margin: 0; }
.sig-row {
    display: grid;
    grid-template-columns: 28px 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px dashed var(--border);
}
.sig-row:last-child { border-bottom: 0; }
.sig-row-body { display: flex; flex-direction: column; gap: 2px; }
.sig-row-top { display: flex; align-items: center; gap: 10px; }
.sig-row-val {
    font-family: var(--t-font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    min-width: 70px;
    text-align: right;
}

/* Org tab */
.org-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.org-cell {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
}
.org-avi {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
}
.org-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.org-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--neu-bg);
    color: var(--neu-fg);
}
.org-bars { display: flex; flex-direction: column; gap: 10px; }
.org-bar {
    display: grid;
    grid-template-columns: 180px 1fr 70px 40px;
    gap: 14px;
    align-items: center;
    font-size: 12.5px;
}
.org-bar-l { color: var(--text); font-weight: 500; }
.org-bar-track { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.org-bar-track > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.org-bar-v { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.org-bar-pct { color: var(--muted-2); font-variant-numeric: tabular-nums; text-align: right; }

/* News tab */
.news-detailed { list-style: none; padding: 0; margin: 0; }
.news-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px dashed var(--border);
}
.news-row:last-child { border-bottom: 0; }
.news-cat {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--neu-bg);
    color: var(--neu-fg);
}

/* Jobs tab */
.jobs-list { list-style: none; padding: 0; margin: 0; }
.job-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px dashed var(--border);
}
.job-row:last-child { border-bottom: 0; }

/* Pager — Jobs tab (extensible to other long-list tabs later) */
.bf-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.bf-pager .t-chip:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.bf-pager-info {
    font-size: 13px;
    text-align: center;
    flex: 1;
}

/* Leaflet map container — used in Locations + Jobs tabs */
.bf-leaflet-map {
    width: 100%;
    height: 420px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
    z-index: 0; /* keep tile pane below sticky header */
}
.bf-leaflet-map .leaflet-control-attribution {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.85);
}

/* Competitors tab */
.comp-map {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
}

/* ────────────────────────────────────────────────────────────────────────────
   Dark-mode overrides for spots that bypass the .t-app token system.
   The token block at the top of this file covers the vast majority — these
   rules patch the handful of hardcoded literals (sentiment-fixed greens,
   the inverted CEO card, the platform badge, and OSM map tiles).
   ──────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .t-app .t-btn-primary.is-on {
    /* Tracking pill — slightly brighter green for dark-bg contrast. */
    background: #2da55a;
    color: #ffffff;
}

[data-theme="dark"] .t-app .t-metric-delta.is-down {
    /* Negative delta — the dark-rust red drops to mud on a dark surface. */
    color: #e07a5f;
}

[data-theme="dark"] .t-app .t-org-card.is-ceo .t-org-title {
    /* CEO card intentionally inverts (light tile on dark page). The title
       is white-with-alpha in light mode; on the inverted tile it needs to
       become dark-with-alpha so it stays readable. */
    color: rgba(0, 0, 0, 0.55);
}

/* Leaflet OSM tiles ship light. Filtering them inline keeps OSM as the
   provider (free, no API key) without requiring a tile-layer swap.
   brightness + saturation lift gives a dimmed, slightly desaturated map
   that reads as "dark theme" while keeping pin colors and text legible. */
[data-theme="dark"] .bf-leaflet-map .leaflet-tile-pane {
    filter: brightness(0.62) saturate(0.55) hue-rotate(8deg);
}

[data-theme="dark"] .bf-leaflet-map .leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.7);
}
[data-theme="dark"] .bf-leaflet-map .leaflet-control-attribution a {
    color: rgba(255, 255, 255, 0.85);
}

/* The +/- zoom control box defaults to white. Match the dark surface. */
[data-theme="dark"] .bf-leaflet-map .leaflet-bar a {
    background: var(--surface);
    color: var(--text);
    border-bottom-color: var(--border);
}
[data-theme="dark"] .bf-leaflet-map .leaflet-bar a:hover {
    background: var(--surface-2);
}

/* ── How It Works modal ──────────────────────────────────────────────────── */
/* How It Works drawer — right-side slide-in panel. Backdrop dims the page; the
   drawer slides in from the right with a header, scrollable body, and ESC/
   click-out to dismiss. */
.bf-hiw-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1200;
    animation: bf-hiw-fadeIn 0.2s ease;
}

.bf-hiw-modal {
    /* Sits below the fixed navbar so the drawer header isn't clipped. */
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 840px;
    max-width: 96vw;
    background: var(--bg-primary);
    border-left: 1px solid var(--border);
    z-index: 1201;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.28);
    animation: bf-hiw-slideIn 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bf-hiw-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes bf-hiw-slideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0);    }
}

.bf-hiw-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    flex-shrink: 0;
    margin-bottom: 0;
}

.bf-hiw-modal__close {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    font-family: var(--font-ui);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bf-hiw-modal__close:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.bf-hiw-modal__eyebrow {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bf-hiw-modal__eyebrow::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.bf-hiw-modal__title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.bf-hiw-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.bf-hiw-modal__subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0 0 22px;
    line-height: 1.6;
}

/* ── Tab strip ────────────────────────────────────────────────────────────── */
.bf-hiw-tabs {
    display: flex;
    gap: 6px;
    padding: 6px;
    margin: 0 0 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    flex-wrap: nowrap;
}

.bf-hiw-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bf-hiw-tab__label,
.bf-hiw-tab__hint {
    width: 100%;
}

.bf-hiw-tab:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.bf-hiw-tab.is-active {
    background: var(--bg-primary);
    border-color: var(--border-subtle);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bf-hiw-tab__label {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
}

.bf-hiw-tab__hint {
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.2;
    opacity: 0.85;
}

/* ── Panel — warm canvas all four HIW tabs render onto ──────────────────────
 * Pipeline / Caching / Output & Reference wrap their content in .bf-hiw-panel.
 * The Sources & Cost tab is a Shadow-DOM host (.bf-hiw-strategy) — it gets the
 * matching radius below; the embedded :host stylesheet already paints the same
 * warm background, so the two render as the same surface. */
.bf-hiw-panel {
    background: #f7f6f1;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 28px 28px 30px;
}
[data-theme="dark"] .bf-hiw-panel {
    background: #0f100e;
    border-color: rgba(255, 255, 255, 0.06);
}

.bf-hiw-strategy {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}
[data-theme="dark"] .bf-hiw-strategy {
    border-color: rgba(255, 255, 255, 0.06);
}

.bf-hiw-section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-subtle);
}
.bf-hiw-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.bf-hiw-section__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bf-hiw-section__icon { font-size: 1.15rem; line-height: 1; }
.bf-hiw-section__title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 0; }

.bf-hiw-section__body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0 0 8px;
    line-height: 1.7;
}
.bf-hiw-section__body:last-child { margin-bottom: 0; }

/* "See what changed" CTA — opens the standalone Before→After reference page */
.bf-hiw-doclink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 16px;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.bf-hiw-doclink:hover {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.bf-hiw-doclink__arrow { opacity: .7; }

.bf-hiw-passes { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }

.bf-hiw-pass { display: flex; gap: 14px; align-items: flex-start; }

.bf-hiw-pass__num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0;
    margin-top: 1px;
}

.bf-hiw-pass__content { display: flex; flex-direction: column; gap: 4px; }
.bf-hiw-pass__title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.bf-hiw-pass__desc { font-size: 0.83rem; color: var(--text-secondary); margin: 0; line-height: 1.65; }
/* Secondary aside inside a step — used for the "what decides the order" detail. */
.bf-hiw-pass__desc--note { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border-subtle); font-size: 0.8rem; opacity: .85; }

/* ── Call-flow map (Pipeline tab) ────────────────────────────────────────────
 * A hand-built flowchart that mirrors analyzeBrand()'s execution order in plain
 * language. No Mermaid/diagram lib — nodes + connectors are plain CSS so they
 * theme natively with the rest of the modal. Three kinds (ai / api / in-house)
 * each carry a --flow-c (accent) + --flow-bg / --flow-bg-dark (tint) so chips
 * and nodes share one palette. AI nodes get a hover tooltip explaining their
 * prompt. Layout is intrinsically responsive (flex-wrap + auto-fill grid) — no
 * @media, per the project's stylingMedias.css rule. */
.bf-flow-chip--ai,      .bf-flow-node--ai      { --flow-c: #7c3aed; --flow-bg: rgba(124, 58, 237, 0.07); --flow-bg-dark: rgba(139, 92, 246, 0.16); }
.bf-flow-chip--api,     .bf-flow-node--api     { --flow-c: #0e7490; --flow-bg: rgba(14, 116, 144, 0.07); --flow-bg-dark: rgba(34, 170, 200, 0.15); }
.bf-flow-chip--inhouse, .bf-flow-node--inhouse { --flow-c: #6b7280; --flow-bg: rgba(107, 114, 128, 0.07); --flow-bg-dark: rgba(148, 156, 168, 0.13); }

/* Legend */
.bf-flow-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.bf-flow-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.74rem; font-weight: 600;
    padding: 4px 10px; border-radius: 999px;
    border: 1px solid var(--flow-c);
    color: var(--flow-c);
    background: var(--flow-bg);
}
[data-theme="dark"] .bf-flow-chip { background: var(--flow-bg-dark); }
.bf-flow-chip__icon { font-size: 0.78rem; line-height: 1; }

/* Overview strip — the five phases at a glance */
.bf-flow-overview { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.bf-flow-ov-step {
    flex: 1 1 130px;
    display: flex; flex-direction: column; gap: 3px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}
.bf-flow-ov-num { font-size: 0.7rem; font-weight: 800; color: var(--accent); }
.bf-flow-ov-label { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }

/* Drilldown — phase cards connected by a downward arrow */
.bf-flow { display: flex; flex-direction: column; }
.bf-flow-phase {
    position: relative;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}
.bf-flow-phase:not(:last-child) { margin-bottom: 28px; }
.bf-flow-phase:not(:last-child)::after {
    content: '↓';
    position: absolute; left: 50%; bottom: -24px;
    transform: translateX(-50%);
    color: var(--text-secondary); opacity: 0.55;
    font-size: 1rem; font-weight: 700; line-height: 1;
}

.bf-flow-phase__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.bf-flow-phase__num {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent-light); border: 1px solid var(--accent); color: var(--accent);
    font-size: 0.72rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.bf-flow-phase__title { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }
.bf-flow-phase__mode {
    margin-left: auto;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em;
    padding: 2px 9px; border-radius: 999px;
    border: 1px solid var(--border-subtle); color: var(--text-secondary);
    background: var(--bg-secondary);
}
.bf-flow-phase__mode--parallel { color: #0e8a6e; border-color: rgba(14, 138, 110, 0.4); }
.bf-flow-phase__mode--mixed { color: #4f6bed; border-color: rgba(79, 107, 237, 0.4); }
.bf-flow-phase__mode--ondemand { color: #7c3aed; border-color: rgba(124, 58, 237, 0.4); }
[data-theme="dark"] .bf-flow-phase__mode--parallel { color: #2fbf9b; }
[data-theme="dark"] .bf-flow-phase__mode--mixed { color: #8ba0f7; }
[data-theme="dark"] .bf-flow-phase__mode--ondemand { color: #b794f6; }
.bf-flow-phase__note { font-size: 0.78rem; color: var(--text-secondary); margin: 0 0 10px; line-height: 1.5; }

.bf-flow-nodes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.bf-flow-node {
    display: flex; flex-direction: column; gap: 3px;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--flow-c);
    background: var(--flow-bg);
}
[data-theme="dark"] .bf-flow-node { background: var(--flow-bg-dark); border-color: rgba(255, 255, 255, 0.07); border-left-color: var(--flow-c); }
.bf-flow-node__top { display: flex; align-items: center; gap: 6px; }
.bf-flow-node__name { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.bf-flow-node__by { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.35; }
.bf-flow-node__when { font-size: 0.7rem; font-weight: 600; color: #bf6a09; line-height: 1.3; }
[data-theme="dark"] .bf-flow-node__when { color: #e0922f; }

/* Info dot + hover tooltip — explains an AI step's prompt without cluttering */
.bf-flow-i {
    flex-shrink: 0; position: relative; cursor: help;
    width: 15px; height: 15px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.62rem; font-weight: 800; font-style: normal; line-height: 1;
    background: var(--flow-c, var(--accent)); color: #fff;
}
.bf-flow-i--inline { vertical-align: middle; width: 14px; height: 14px; }
.bf-flow-tip {
    position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
    width: 240px; max-width: 60vw;
    padding: 9px 11px; border-radius: 8px;
    background: var(--text-primary); color: var(--bg-primary);
    font-size: 0.72rem; font-weight: 500; font-style: normal; line-height: 1.45;
    text-align: left; letter-spacing: 0;
    opacity: 0; visibility: hidden; transition: opacity 0.12s ease;
    z-index: 20; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); pointer-events: none;
}
.bf-flow-i:hover .bf-flow-tip, .bf-flow-i:focus .bf-flow-tip { opacity: 1; visibility: visible; }

/* Free / paid cost marker — a light binary signal so the team can see where
 * money is spent at a glance. Dollar amounts + tiers + the spend plan live on
 * the Sources & Cost tab; this doesn't repeat them. `mixed` = a free source is
 * tried first, a paid one only as fallback (the optimisation targets). */
.bf-flow-legend--cost { align-items: center; }
.bf-flow-legend__label {
    font-size: 0.72rem; font-weight: 700; color: var(--text-secondary);
    letter-spacing: 0.04em; text-transform: uppercase; margin-right: 2px;
}
.bf-flow-cost {
    flex-shrink: 0;
    font-size: 0.64rem; font-weight: 700; letter-spacing: 0.02em;
    padding: 1px 8px; border-radius: 999px; white-space: nowrap;
    border: 1px solid transparent;
}
.bf-flow-node__top .bf-flow-cost { margin-left: auto; }
.bf-flow-cost--free  { color: #0e8a6e; background: rgba(14, 138, 110, 0.10); border-color: rgba(14, 138, 110, 0.35); }
.bf-flow-cost--paid  { color: #bf6a09; background: rgba(191, 106, 9, 0.10);  border-color: rgba(191, 106, 9, 0.35); }
.bf-flow-cost--mixed { color: #8a6a2c; background: linear-gradient(90deg, rgba(14, 138, 110, 0.14), rgba(191, 106, 9, 0.14)); border-color: rgba(150, 120, 50, 0.45); }
[data-theme="dark"] .bf-flow-cost--free  { color: #2fbf9b; background: rgba(20, 170, 135, 0.16); border-color: rgba(20, 170, 135, 0.4); }
[data-theme="dark"] .bf-flow-cost--paid  { color: #e0922f; background: rgba(217, 135, 30, 0.16); border-color: rgba(217, 135, 30, 0.4); }
[data-theme="dark"] .bf-flow-cost--mixed { color: #e8c98f; background: linear-gradient(90deg, rgba(20, 170, 135, 0.18), rgba(217, 135, 30, 0.18)); border-color: rgba(180, 150, 80, 0.5); }

/* Live AI model chip — value comes from /settings/ai-models (the same config
 * the admin AI Center edits), so it always reflects the real model, never
 * hardcoded. Only rendered on AI nodes, so --flow-c is the AI purple. */
.bf-flow-node__model {
    align-self: flex-start;
    margin-top: 1px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.68rem; font-weight: 600;
    color: var(--flow-c);
    background: var(--flow-bg);
    border: 1px solid var(--flow-c);
    border-radius: 5px;
    padding: 1px 7px;
}
[data-theme="dark"] .bf-flow-node__model { background: var(--flow-bg-dark); }

/* ── Anonymous gating: paywall card + locked wall ────────────────────────── */
.bf-paywall-card,
.bf-locked-wall {
    margin: 24px 0;
    border-radius: 20px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    overflow: hidden;
}

.bf-paywall-card-inner {
    padding: 32px 28px;
    text-align: center;
}

.bf-locked-wall {
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bf-locked-wall-inner {
    padding: 48px 32px;
    text-align: center;
    max-width: 520px;
}

.bf-paywall-card-eyebrow,
.bf-locked-wall-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.bf-paywall-card-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.bf-locked-wall-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-primary);
}

.bf-paywall-card-subtitle,
.bf-locked-wall-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 auto 20px;
    max-width: 480px;
    line-height: 1.55;
}

.bf-locked-wall-subtitle {
    font-size: 15px;
    margin-bottom: 24px;
}

.bf-paywall-card-actions,
.bf-locked-wall-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.bf-paywall-card-cta {
    padding: 10px 24px;
    border-radius: 999px;
    font-weight: 600;
}

.bf-locked-wall-cta {
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 600;
}

.bf-paywall-card-secondary,
.bf-locked-wall-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.bf-paywall-card-secondary {
    padding: 10px 24px;
}

.bf-locked-wall-secondary {
    padding: 12px 28px;
}

.bf-paywall-card-secondary:hover,
.bf-locked-wall-secondary:hover {
    background: var(--bg-muted);
    border-color: var(--accent);
}

/* ── Social tab: empty state + submission modal ──────────────────────────── */
/* Banner shown at the top of the Social tab when our scrapers couldn't verify
   any handles for the brand — invites the user to submit them. */
.bf-socials-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
}
.bf-socials-empty-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.45;
}
.bf-socials-empty-text strong { font-weight: 600; }
.bf-socials-empty-text span   { color: var(--text-muted); font-size: 0.82rem; }

/* Submission modal — centered dialog, same overlay treatment as the HiW drawer
   but a smaller, focused card so the input fields read as a quick form. */
.bf-soc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: bf-soc-fadeIn 0.18s ease;
}
@keyframes bf-soc-fadeIn { from { opacity: 0; } to { opacity: 1; } }

.bf-soc-modal {
    width: 520px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: bf-soc-popIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bf-soc-popIn {
    from { transform: scale(0.96); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.bf-soc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.bf-soc-title { font-size: 1.05rem; font-weight: 600; }
.bf-soc-sub   { color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }

.bf-soc-close {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 999px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bf-soc-close:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.bf-soc-intro {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-muted);
}
.bf-soc-intro strong { color: var(--text-primary); }

.bf-soc-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bf-soc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.bf-soc-field-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}
.bf-soc-input {
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-muted);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.bf-soc-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
}
.bf-soc-input:disabled { opacity: 0.55; cursor: not-allowed; }

.bf-soc-error {
    font-size: 0.82rem;
    color: var(--danger, #e44);
    padding: 8px 10px;
    background: rgba(228, 68, 68, 0.08);
    border: 1px solid rgba(228, 68, 68, 0.2);
    border-radius: 8px;
}

.bf-soc-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.bf-soc-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bf-soc-result-row {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.86rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bf-soc-result-row strong { font-weight: 600; font-size: 0.9rem; }
.bf-soc-result-hint { color: var(--text-muted); font-size: 0.78rem; line-height: 1.4; }

.bf-soc-result-ok      { border-left: 3px solid #2da76d; }
.bf-soc-result-pending { border-left: 3px solid var(--accent); }
.bf-soc-result-bad     { border-left: 3px solid #e44; }

/* ── SourceBadge — provenance indicator on resolved fields ───────────────── */
.bf-src-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    position: relative;
    cursor: help;
    font-size: 0.72rem;
    line-height: 1;
    color: var(--text-muted);
    opacity: 0.7;
    transition: opacity 0.15s;
}
.bf-src-badge:hover,
.bf-src-badge:focus { opacity: 1; outline: none; }

.bf-src-badge-icon { font-size: 0.85em; }

.bf-src-badge--ai_kb      { color: var(--accent); }
.bf-src-badge--ai_web     { color: #506ef0; }
.bf-src-badge--crossed    { color: #2da76d; }

.bf-src-badge-tip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
    z-index: 600;
    pointer-events: none;
    min-width: 140px;
    line-height: 1.35;
    font-weight: 500;
    text-align: left;
    opacity: 1;
}
.bf-src-badge-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border);
}
