/**
 * Brand History Insights - CSS v2.7.0
 *
 * TABLE OF CONTENTS:
 *  1. Variables & Theme (aligned with LOF design tokens)
 *  2. Buy Signal (XL / M / S) — emoji-based
 *  3. Deal Calendar Heatmap
 *  4. Prediction Card
 *  5. Reliability Meter
 *  6. Deal Quality Badge
 *  7. Mini Trend Pill Badges (AJAX injected)
 *  7b. Horizontal Highlight Chips (v2.6.0 - for card feeds)
 *  7c. Pros/Cons Lines (for brand pages)
 *  8. Full Panel
 *  9. Medium Panel
 * 10. Compact Badge
 * 11. Post Insight Card
 * 12. Global Stats Bar
 * 13. Stats Row & Stat Boxes
 * 14. Comparison Table
 * 15. Tags
 * 16. Confidence Dots
 * 17. Highlight Cards (prediction_highlights)
 * 18. Animations
 * 19. Responsive (Mobile First)
 * 20. Dark Mode
 * 21. Print & Accessibility
 *
 * v2.6.0: Horizontal chips design for LOF/CLO cards.
 *         Simplified UI, moved below offer content.
 * v2.7.0: Top-Heavy UX - urgency alert component for top-of-page placement.
 *         Buy signal moved from dashboard to above offer lists.
 */

/* ==========================================================================
   1. Variables & Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Primary (matches LOF) */
    --bhi-accent: #00C896;
    --bhi-accent-dark: #00A67D;
    --bhi-accent-light: #E6FBF5;
    --bhi-accent-glow: rgba(0, 200, 150, 0.15);

    /* Sale */
    --bhi-sale: #ff6b35;
    --bhi-sale-light: #fff7f0;

    /* Warning */
    --bhi-warning: #FFC107;
    --bhi-warning-light: rgba(255, 193, 7, 0.12);

    /* Text (matches LOF) */
    --bhi-text: #1a2332;
    --bhi-text-secondary: #5c6a7f;
    --bhi-text-muted: #8b97a8;

    /* Backgrounds (matches LOF) */
    --bhi-bg: #ffffff;
    --bhi-bg-subtle: #f8fafb;
    --bhi-border: #e0e7ee;
    --bhi-border-light: #eef2f6;

    /* Shadows (matches LOF) */
    --bhi-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --bhi-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --bhi-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --bhi-shadow-glow: 0 4px 20px rgba(0, 200, 150, 0.2);

    /* Radius (matches LOF) */
    --bhi-radius: 20px;
    --bhi-radius-sm: 12px;
    --bhi-radius-xs: 8px;
    --bhi-radius-pill: 100px;

    /* Transitions */
    --bhi-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --bhi-duration: 0.2s;
    --bhi-transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Font (matches LOF) */
    --bhi-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --bhi-muted: #c0c8d1;

    /* Signal colors */
    --bhi-signal-buy: #00C896;
    --bhi-signal-good: #4CAF50;
    --bhi-signal-wait: #FFC107;
    --bhi-signal-uncertain: #8b97a8;
}

/* ==========================================================================
   2. Buy Signal (XL / M / S) — emoji-based
   ========================================================================== */

.bhi-signal {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--bhi-radius-sm);
    font-family: var(--bhi-font);
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s var(--bhi-ease), transform 0.4s var(--bhi-ease);
}

/* XL */
.bhi-signal-xl {
    padding: 18px 22px;
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border);
    border-radius: var(--bhi-radius);
    box-shadow: var(--bhi-shadow-sm);
}

.bhi-signal-xl .bhi-signal-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bhi-radius-sm);
    flex-shrink: 0;
    font-size: 1.8rem;
    line-height: 1;
}

.bhi-signal-buy_now { border-color: rgba(0, 200, 150, 0.3); }
.bhi-signal-buy_now .bhi-signal-icon { background: rgba(0, 200, 150, 0.1); }
.bhi-signal-buy_now .bhi-signal-label { color: var(--bhi-signal-buy); }

.bhi-signal-good_time { border-color: rgba(76, 175, 80, 0.3); }
.bhi-signal-good_time .bhi-signal-icon { background: rgba(76, 175, 80, 0.1); }
.bhi-signal-good_time .bhi-signal-label { color: var(--bhi-signal-good); }

.bhi-signal-wait { border-color: rgba(255, 193, 7, 0.3); }
.bhi-signal-wait .bhi-signal-icon { background: rgba(255, 193, 7, 0.1); }
.bhi-signal-wait .bhi-signal-label { color: #b8860b; }

.bhi-signal-uncertain { border-color: var(--bhi-border); }
.bhi-signal-uncertain .bhi-signal-icon { background: rgba(139, 151, 168, 0.1); }

.bhi-signal-body {
    flex: 1;
    min-width: 0;
}

.bhi-signal-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.bhi-signal-text {
    margin: 4px 0 0;
    font-size: 0.875rem;
    color: var(--bhi-text-secondary);
    line-height: 1.5;
}

/* M */
.bhi-signal-m {
    padding: 14px 18px;
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border);
    border-radius: var(--bhi-radius);
    box-shadow: var(--bhi-shadow-sm);
    gap: 10px;
}

.bhi-signal-m .bhi-signal-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.bhi-signal-m strong {
    font-size: 0.9rem;
}

/* S — pill badge */
.bhi-signal-s {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--bhi-radius-pill);
    border: 1.5px solid;
    line-height: 1.3;
    opacity: 1;
    transform: none;
}

.bhi-signal-s.bhi-signal-buy_now { background: rgba(0, 200, 150, 0.1); border-color: rgba(0, 200, 150, 0.3); color: var(--bhi-signal-buy); }
.bhi-signal-s.bhi-signal-good_time { background: rgba(76, 175, 80, 0.1); border-color: rgba(76, 175, 80, 0.3); color: var(--bhi-signal-good); }
.bhi-signal-s.bhi-signal-wait { background: var(--bhi-warning-light); border-color: rgba(255, 193, 7, 0.3); color: #b8860b; }

/* ==========================================================================
   2b. Urgency Alert (v2.7.0 — top-of-page buy signal)
   ========================================================================== */

/* Standalone urgency banner placed BEFORE offer lists */
.bhi-urgency-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    margin: 0 0 20px;
    background: linear-gradient(135deg, var(--bhi-accent-light) 0%, #f0fdf9 100%);
    border: 2px solid rgba(0, 200, 150, 0.25);
    border-radius: var(--bhi-radius);
    box-shadow: var(--bhi-shadow-sm), 0 0 0 1px rgba(0, 200, 150, 0.08);
    font-family: var(--bhi-font);
    animation: bhi-urgency-fade-in 0.4s var(--bhi-ease) both;
}

@keyframes bhi-urgency-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bhi-urgency-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--bhi-radius-sm);
    font-size: 1.6rem;
    line-height: 1;
    box-shadow: var(--bhi-shadow-sm);
}

.bhi-urgency-body {
    flex: 1;
    min-width: 0;
}

.bhi-urgency-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--bhi-accent-dark);
}

.bhi-urgency-text {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--bhi-text-secondary);
    line-height: 1.5;
}

/* Signal-specific urgency colors */
.bhi-urgency-alert.bhi-signal-buy_now {
    background: linear-gradient(135deg, rgba(0, 200, 150, 0.12) 0%, rgba(0, 200, 150, 0.05) 100%);
    border-color: rgba(0, 200, 150, 0.35);
}
.bhi-urgency-alert.bhi-signal-buy_now .bhi-urgency-icon { background: rgba(0, 200, 150, 0.15); }
.bhi-urgency-alert.bhi-signal-buy_now .bhi-urgency-label { color: #007a5e; }

.bhi-urgency-alert.bhi-signal-good_time {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.04) 100%);
    border-color: rgba(76, 175, 80, 0.3);
}
.bhi-urgency-alert.bhi-signal-good_time .bhi-urgency-icon { background: rgba(76, 175, 80, 0.12); }
.bhi-urgency-alert.bhi-signal-good_time .bhi-urgency-label { color: #2e7d32; }

.bhi-urgency-alert.bhi-signal-wait {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.04) 100%);
    border-color: rgba(255, 193, 7, 0.3);
}
.bhi-urgency-alert.bhi-signal-wait .bhi-urgency-icon { background: rgba(255, 193, 7, 0.12); }
.bhi-urgency-alert.bhi-signal-wait .bhi-urgency-label { color: #b8860b; }

/* Confidence dots in urgency alert */
.bhi-urgency-alert .bhi-confidence {
    flex-shrink: 0;
    margin-left: auto;
}

/* ==========================================================================
   2c. Global History Toggle (v2.7.0 — unified expired offers control)
   ========================================================================== */

/* Wrapper - positioned after urgency alert, before offers */
.bhi-history-toggle-wrapper {
    margin: 0 0 16px;
    text-align: right;
}

/* Toggle button - minimal, right-aligned */
.bhi-history-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bhi-bg-subtle);
    border: 1.5px solid var(--bhi-border-light);
    border-radius: var(--bhi-radius-pill);
    font-family: var(--bhi-font);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bhi-text-muted);
    cursor: pointer;
    transition: all 0.2s var(--bhi-ease);
}

.bhi-history-toggle:hover {
    background: var(--bhi-bg);
    border-color: var(--bhi-border);
    color: var(--bhi-text-secondary);
}

.bhi-history-toggle[aria-expanded="true"] {
    background: var(--bhi-accent-light);
    border-color: rgba(0, 200, 150, 0.25);
    color: var(--bhi-accent-dark);
}

.bhi-toggle-icon {
    font-size: 1rem;
    line-height: 1;
}

.bhi-toggle-text {
    white-space: nowrap;
}

/* Show/hide text based on state */
.bhi-history-toggle .bhi-toggle-show { display: inline; }
.bhi-history-toggle .bhi-toggle-hide { display: none; }
.bhi-history-toggle[aria-expanded="true"] .bhi-toggle-show { display: none; }
.bhi-history-toggle[aria-expanded="true"] .bhi-toggle-hide { display: inline; }

.bhi-toggle-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s var(--bhi-ease);
}

.bhi-history-toggle[aria-expanded="true"] .bhi-toggle-arrow {
    transform: rotate(180deg);
}

/* ==========================================================================
   3. Deal Calendar Heatmap
   ========================================================================== */

.bhi-calendar {
    margin-bottom: 20px;
}

.bhi-calendar-heading {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bhi-text-muted);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--bhi-font);
}

.bhi-calendar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.bhi-cal-cell {
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border-light);
    border-radius: var(--bhi-radius-xs);
    padding: 10px 4px;
    text-align: center;
    transition: transform var(--bhi-duration) var(--bhi-ease), box-shadow var(--bhi-duration) var(--bhi-ease);
    cursor: default;
}

.bhi-cal-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--bhi-shadow-sm);
}

.bhi-cal-month {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--bhi-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: var(--bhi-font);
}

.bhi-cal-count {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bhi-text);
    font-family: var(--bhi-font);
    font-variant-numeric: tabular-nums;
}

/* Heatmap levels */
.bhi-cal-level-0 { background: var(--bhi-bg); }
.bhi-cal-level-1 { background: rgba(0, 200, 150, 0.08); }
.bhi-cal-level-2 { background: rgba(0, 200, 150, 0.18); }
.bhi-cal-level-3 { background: rgba(0, 200, 150, 0.30); }
.bhi-cal-level-4 { background: rgba(0, 200, 150, 0.45); }
.bhi-cal-level-4 .bhi-cal-count { color: #005a3c; }

.bhi-cal-hot { border-color: var(--bhi-signal-buy); border-width: 2px; }
.bhi-cal-cold { opacity: 0.6; }
.bhi-cal-current { box-shadow: 0 0 0 2px var(--bhi-accent); }

/* v2.7.0: Contextual label for hot/quiet/current months */
.bhi-cal-label {
    display: block;
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-top: 2px;
    font-family: var(--bhi-font);
}
.bhi-cal-hot .bhi-cal-label { color: var(--bhi-signal-buy); }
.bhi-cal-cold .bhi-cal-label { color: var(--bhi-text-muted); }
.bhi-cal-current .bhi-cal-label { color: var(--bhi-accent-dark); }

/* ==========================================================================
   4. Prediction Card
   ========================================================================== */

.bhi-prediction {
    display: flex;
    gap: 14px;
    padding: 18px;
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border);
    border-radius: var(--bhi-radius);
    box-shadow: var(--bhi-shadow-sm);
    margin-bottom: 16px;
    font-family: var(--bhi-font);
    transition: box-shadow var(--bhi-transition-smooth);
}

.bhi-prediction:hover {
    box-shadow: var(--bhi-shadow-md);
}

.bhi-pred-now { border-left: 4px solid var(--bhi-signal-buy); }
.bhi-pred-imminent { border-left: 4px solid var(--bhi-signal-good); }
.bhi-pred-soon { border-left: 4px solid var(--bhi-warning); }
.bhi-pred-not_yet { border-left: 4px solid var(--bhi-muted); }

.bhi-pred-icon {
    flex-shrink: 0;
    font-size: 1.4rem;
    line-height: 1;
}

.bhi-pred-body {
    flex: 1;
    min-width: 0;
}

.bhi-pred-body strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--bhi-text);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bhi-pred-text {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: var(--bhi-text-secondary);
    line-height: 1.5;
}

.bhi-pred-reason {
    margin: 0 0 6px;
    font-size: 0.8rem;
    color: var(--bhi-text-muted);
    line-height: 1.5;
    font-style: italic;
}

.bhi-pred-days,
.bhi-pred-discount {
    margin: 0 0 4px;
    font-size: 0.8rem;
    color: var(--bhi-text-muted);
}

/* ==========================================================================
   5. Reliability Meter
   ========================================================================== */

.bhi-reliability {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-family: var(--bhi-font);
}

.bhi-reliability-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bhi-text-secondary);
    white-space: nowrap;
}

.bhi-reliability-meter {
    flex: 1;
    min-width: 80px;
    max-width: 200px;
    height: 10px;
    background: var(--bhi-border-light);
    border-radius: var(--bhi-radius-pill);
    overflow: hidden;
}

.bhi-reliability-fill {
    height: 100%;
    border-radius: var(--bhi-radius-pill);
    transition: width 0.8s var(--bhi-ease);
}

.bhi-reliability-value {
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bhi-reliability-text {
    font-size: 0.8rem;
    color: var(--bhi-text-muted);
}

/* ==========================================================================
   6. Deal Quality Badge
   ========================================================================== */

.bhi-deal-quality {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: var(--bhi-radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--bhi-font);
}

.bhi-quality-excellent { background: rgba(0, 200, 150, 0.12); color: #007a5e; border: 1.5px solid rgba(0, 200, 150, 0.25); }
.bhi-quality-good { background: rgba(76, 175, 80, 0.12); color: #2e7d32; border: 1.5px solid rgba(76, 175, 80, 0.25); }
.bhi-quality-average { background: var(--bhi-warning-light); color: #b8860b; border: 1.5px solid rgba(255, 193, 7, 0.25); }
.bhi-quality-modest { background: rgba(255, 152, 0, 0.12); color: #e65100; border: 1.5px solid rgba(255, 152, 0, 0.25); }

.bhi-quality-row {
    margin-bottom: 12px;
}

/* ==========================================================================
   7. Mini Trend Pill Badges (AJAX injected into LOF/SDC cards)
   ========================================================================== */

/* Base wrapper for all injected signals */
.bhi-mini-trend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
    margin-left: 8px;
}

/* Signal pill badge — the core new component */
.bhi-signal-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: var(--bhi-radius-pill);
    font-family: var(--bhi-font);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    transition: opacity var(--bhi-duration) var(--bhi-ease);
}

.bhi-pill-emoji {
    font-size: 0.72rem;
    line-height: 1;
}

.bhi-pill-label {
    letter-spacing: 0.2px;
}

/* Signal pill color variants */
.bhi-pill--buy-now {
    background: rgba(0, 200, 150, 0.12);
    color: #007a5e;
    border: 1px solid rgba(0, 200, 150, 0.25);
}

.bhi-pill--good-time {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.bhi-pill--wait {
    background: rgba(255, 193, 7, 0.1);
    color: #b8860b;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* Score pill (for RICH level) */
.bhi-score-pill {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 8px;
    border-radius: var(--bhi-radius-pill);
    background: var(--bhi-bg-subtle);
    border: 1px solid var(--bhi-border-light);
    font-family: var(--bhi-font);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--bhi-text-secondary);
    white-space: nowrap;
}

/* Signal dot (SMALL level — brand directory) */
.bhi-signal-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* RICH signal layout */
.bhi-mini-trend--rich {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-top: 8px;
}

/* MEDIUM signal layout — pill-only fallback (no pros/cons yet) */
.bhi-mini-trend--medium {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    vertical-align: middle;
    cursor: default;
}

/* DETAIL layout — pill + info + pros/cons stacked vertically */
.bhi-mini-trend--detail {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    margin-top: 8px;
}

/* SMALL signal layout */
.bhi-mini-trend--small {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
}

/* Dot sizing for compact brand links */
.brand-link .bhi-signal-dot,
.sb-brand-item .bhi-signal-dot {
    width: 6px;
    height: 6px;
}

/* Ensure signals don't break brand link layout */
.brand-link .bhi-mini-trend,
.sb-brand-item .bhi-mini-trend {
    pointer-events: none;
}

/* ==========================================================================
   7b. Horizontal Highlight Chips (v2.6.0 — compact card signals)
   ========================================================================== */

/* Chips container - horizontal row placed before card footer */
.bhi-mini-trend--chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0;
    padding-top: 8px;
    border-top: 1px solid var(--bhi-border-light);
}

/* Chips row wrapper */
.bhi-chips-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Individual chip - compact pill style (v2.6.1 larger font for readability) */
.bhi-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-family: var(--bhi-font);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    border-radius: var(--bhi-radius-pill);
    transition: opacity 0.15s ease;
}

/* Stat chip (neutral - active offers count) */
.bhi-chip--stat {
    background: var(--bhi-accent-light);
    color: var(--bhi-accent-dark);
    border: 1px solid rgba(0, 200, 150, 0.2);
}

/* Discount chip (highlight - best discount %) */
.bhi-chip--discount {
    background: rgba(255, 152, 0, 0.1);
    color: #e65100;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

/* Pro chip (positive highlight) */
.bhi-chip--pro {
    background: rgba(76, 175, 80, 0.08);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.15);
}

/* Con chip (warning/caution) */
.bhi-chip--con {
    background: rgba(255, 193, 7, 0.08);
    color: #b8860b;
    border: 1px solid rgba(255, 193, 7, 0.15);
}

/* Mini signal pill (fallback when no chips) */
.bhi-signal-pill--mini {
    padding: 3px 8px;
    font-size: 0.7rem;
}

/* ==========================================================================
   7c. Pros/Cons Lines (for brand pages - rich level)
   ========================================================================== */

/* Each line: icon + text */
.bhi-pc-line {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-family: var(--bhi-font);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
}

.bhi-pc-icon {
    flex-shrink: 0;
    font-size: 0.78rem;
    line-height: 1.45;
}

.bhi-pc-text {
    color: var(--bhi-text-secondary);
}

/* Pro lines — green tinted text */
.bhi-pc-pro .bhi-pc-text {
    color: #1b7a4a;
}

/* Con lines — red tinted text */
.bhi-pc-con .bhi-pc-text {
    color: #c0392b;
}

/* Info line — muted, contextual */
.bhi-pc-info .bhi-pc-text {
    color: var(--bhi-text-secondary);
}

/* Toggle button for collapsed pros/cons */
.bhi-pc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
    padding: 2px 8px;
    font-family: var(--bhi-font);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--bhi-text-muted);
    background: var(--bhi-bg-subtle);
    border: 1px solid var(--bhi-border-light);
    border-radius: var(--bhi-radius-pill);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1.4;
}

.bhi-pc-toggle:hover {
    color: var(--bhi-accent-dark);
    background: var(--bhi-accent-light);
    border-color: rgba(0, 200, 150, 0.2);
}

/* Hidden pros/cons container */
.bhi-pc-hidden {
    overflow: hidden;
}

/* ==========================================================================
   8. Full Panel
   ========================================================================== */

.bhi-full-panel {
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border);
    border-radius: var(--bhi-radius);
    box-shadow: var(--bhi-shadow-sm);
    padding: 28px 24px;
    margin: 24px 0;
    font-family: var(--bhi-font);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--bhi-transition-smooth);
}

.bhi-full-panel:hover {
    box-shadow: var(--bhi-shadow-md);
}

.bhi-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bhi-text);
    line-height: 1.3;
}

/* ==========================================================================
   9. Medium Panel
   ========================================================================== */

.bhi-medium-panel {
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border);
    border-radius: var(--bhi-radius);
    box-shadow: var(--bhi-shadow-sm);
    padding: 24px 20px;
    margin: 24px 0;
    font-family: var(--bhi-font);
    transition: box-shadow var(--bhi-transition-smooth);
}

.bhi-medium-panel:hover {
    box-shadow: var(--bhi-shadow-md);
}

/* ==========================================================================
   10. Compact Badge
   ========================================================================== */

.bhi-compact-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bhi-accent-light);
    border: 1.5px solid rgba(0, 200, 150, 0.15);
    border-radius: var(--bhi-radius-pill);
    font-family: var(--bhi-font);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--bhi-accent-dark);
    margin: 12px 0;
}

.bhi-compact-text {
    white-space: nowrap;
}

/* ==========================================================================
   11. Post Insight Card
   ========================================================================== */

.bhi-post-insight {
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border);
    border-radius: var(--bhi-radius);
    box-shadow: var(--bhi-shadow-sm);
    padding: 20px;
    margin-top: 24px;
    font-family: var(--bhi-font);
}

.bhi-pi-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bhi-pi-header strong {
    font-size: 0.95rem;
    color: var(--bhi-text);
}

.bhi-pi-body p {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--bhi-text-secondary);
    line-height: 1.6;
}

.bhi-pi-body p:last-child { margin-bottom: 0; }
.bhi-pi-prediction { font-style: italic; color: var(--bhi-text-muted); }

/* ==========================================================================
   12. Global Stats Bar
   ========================================================================== */

.bhi-global-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--bhi-accent-light) 0%, #f0faf6 100%);
    border: 1.5px solid rgba(0, 200, 150, 0.15);
    border-radius: var(--bhi-radius);
    box-shadow: var(--bhi-shadow-sm);
    font-family: var(--bhi-font);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--bhi-text);
    margin: 16px 0;
}

.bhi-gstat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.bhi-gstat-emoji {
    font-size: 1.1rem;
    line-height: 1;
}

.bhi-gstat-separator {
    color: var(--bhi-text-muted);
    font-weight: 300;
    font-size: 1.1rem;
    margin: 0 4px;
}

/* ==========================================================================
   13. Stats Row & Stat Boxes
   ========================================================================== */

.bhi-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.bhi-stats-compact {
    grid-template-columns: repeat(3, 1fr);
}

.bhi-stat-box {
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border-light);
    border-radius: var(--bhi-radius-sm);
    padding: 16px 12px;
    text-align: center;
    transition: box-shadow var(--bhi-transition-smooth), transform var(--bhi-transition-smooth);
}

.bhi-stat-box:hover {
    box-shadow: var(--bhi-shadow-sm);
    transform: translateY(-1px);
}

.bhi-stat-emoji {
    display: block;
    font-size: 1.3rem;
    line-height: 1;
    margin-bottom: 6px;
}

.bhi-stat-number {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--bhi-accent-dark);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.bhi-stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bhi-text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   14. Comparison Table
   ========================================================================== */

.bhi-comparison-table {
    overflow-x: auto;
    margin: 16px 0;
    font-family: var(--bhi-font);
}

.bhi-comparison-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.bhi-comparison-table th,
.bhi-comparison-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--bhi-border-light);
}

.bhi-comparison-table th {
    background: var(--bhi-accent-light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--bhi-text-secondary);
}

.bhi-comparison-table td { color: var(--bhi-text); }
.bhi-comparison-table tr:hover td { background: var(--bhi-accent-light); }

/* ==========================================================================
   15. Tags
   ========================================================================== */

.bhi-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.bhi-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border-light);
    border-radius: var(--bhi-radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--bhi-text-secondary);
    white-space: nowrap;
    font-family: var(--bhi-font);
    transition: border-color var(--bhi-duration) var(--bhi-ease);
}

.bhi-tag:hover {
    border-color: var(--bhi-accent);
}

/* ==========================================================================
   16. Confidence Dots
   ========================================================================== */

.bhi-confidence {
    display: flex;
    gap: 4px;
    align-items: center;
}

.bhi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.bhi-dot-filled { background: var(--bhi-accent); }
.bhi-dot-empty { background: var(--bhi-muted); opacity: 0.3; }

/* Footnote */
.bhi-footnote {
    font-size: 0.75rem;
    color: var(--bhi-text-muted);
    margin: 8px 0 0;
    font-style: italic;
}

/* ==========================================================================
   17. Highlight Cards (prediction_highlights shortcode)
   ========================================================================== */

.bhi-highlights {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bhi-highlights::-webkit-scrollbar {
    display: none;
}

.bhi-highlight-card {
    flex: 0 0 240px;
    min-width: 240px;
    max-width: 240px;
    background: var(--bhi-bg);
    border: 1.5px solid var(--bhi-border);
    border-radius: var(--bhi-radius);
    padding: 18px;
    box-shadow: var(--bhi-shadow-sm);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.bhi-highlight-card:hover {
    border-color: var(--bhi-accent);
    box-shadow: var(--bhi-shadow-md);
}

.bhi-highlight-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bhi-text);
    line-height: 1.3;
}

.bhi-highlight-brand a {
    color: var(--bhi-text) !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.bhi-highlight-brand a:hover {
    color: var(--bhi-accent-dark) !important;
}

.bhi-highlight-text {
    font-size: 0.85rem;
    color: #555; /* v2.6.2: Darker for accessibility (was text-secondary) */
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bhi-highlight-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--bhi-border-light);
    font-size: 0.75rem;
    color: var(--bhi-text-muted);
    flex-wrap: wrap;
    margin-top: auto; /* v2.6.2: Sticky footer - align across row */
}

.bhi-highlight-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* ==========================================================================
   18. Animations
   ========================================================================== */

@keyframes bhi-count-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bhi-stat-box {
    animation: bhi-count-up 0.4s var(--bhi-ease) both;
}

.bhi-stat-box:nth-child(2) { animation-delay: 0.08s; }
.bhi-stat-box:nth-child(3) { animation-delay: 0.16s; }
.bhi-stat-box:nth-child(4) { animation-delay: 0.24s; }

@keyframes bhi-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.bhi-highlight-card {
    animation: bhi-fadeIn 0.3s ease-out;
}

/* Signal pulse */
.bhi-signal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   19. Responsive (Mobile First)
   ========================================================================== */

@media (max-width: 599px) {
    .bhi-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .bhi-stats-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .bhi-full-panel,
    .bhi-medium-panel {
        padding: 20px 16px;
        margin: 16px 0;
    }

    .bhi-heading { font-size: 1.1rem; }
    .bhi-stat-number { font-size: 1.35rem; }

    .bhi-calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Urgency alert mobile */
    .bhi-urgency-alert {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 14px 16px;
    }

    .bhi-urgency-alert .bhi-confidence {
        margin-left: 0;
        justify-content: center;
    }

    .bhi-urgency-icon {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
    }

    .bhi-urgency-label { font-size: 0.95rem; }
    .bhi-urgency-text { font-size: 0.85rem; }

    /* History toggle mobile */
    .bhi-history-toggle-wrapper {
        text-align: center;
    }

    .bhi-history-toggle {
        width: 100%;
        justify-content: center;
    }

    .bhi-signal-xl {
        flex-direction: column;
        text-align: center;
    }

    .bhi-signal-xl .bhi-confidence {
        justify-content: center;
    }

    .bhi-global-bar {
        gap: 8px;
        font-size: 0.85rem;
        padding: 14px 16px;
    }

    .bhi-reliability {
        flex-wrap: wrap;
    }

    .bhi-reliability-meter {
        order: 3;
        min-width: 100%;
    }

    /* v2.6.3: Mobile - Smart Wrapping for chips */
    .bhi-chip {
        white-space: normal; /* Allow wrapping on mobile */
        line-height: 1.25;
        max-width: 100%;
    }

    .bhi-chips-row {
        flex-wrap: wrap; /* Chips can stack on mobile */
    }

    /* Fluid height for highlight cards */
    .bhi-highlight-text {
        -webkit-line-clamp: 3; /* Allow 3 lines on mobile */
    }

    /* Highlight cards scroll horizontally on mobile */
    .bhi-highlight-card {
        flex: 0 0 240px;
        min-width: 240px;
    }
}

/* Tablet */
@media (min-width: 600px) and (max-width: 1023px) {
    .bhi-calendar-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .bhi-highlights {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        overflow-x: visible;
    }

    .bhi-highlight-card {
        flex: none;
        min-width: unset;
        max-width: unset;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .bhi-full-panel { padding: 32px 28px; }
    .bhi-stat-number { font-size: 1.8rem; }

    .bhi-calendar-grid {
        grid-template-columns: repeat(12, 1fr);
    }

    .bhi-highlights {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        overflow-x: visible;
        gap: 20px;
    }

    .bhi-highlight-card {
        flex: none;
        min-width: unset;
        max-width: unset;
    }
}

/* ==========================================================================
   20. Dark Mode
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --bhi-accent: #3dd9a8;
        --bhi-accent-dark: #2ec295;
        --bhi-accent-light: rgba(61, 217, 168, 0.1);
        --bhi-sale-light: rgba(255, 107, 53, 0.1);
        --bhi-warning-light: rgba(255, 193, 7, 0.1);
        --bhi-text: #f0f0f0;
        --bhi-text-secondary: #c0c8d1;
        --bhi-text-muted: #8b97a8;
        --bhi-bg: #1e1e2e;
        --bhi-bg-subtle: #252535;
        --bhi-border: #374151;
        --bhi-border-light: #2d3748;
        --bhi-muted: #555;
        --bhi-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
        --bhi-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
        --bhi-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    }

    .bhi-global-bar {
        background: linear-gradient(135deg, var(--bhi-bg-subtle) 0%, #1e2e28 100%);
    }

    .bhi-reliability-meter {
        background: #2d2d3d;
    }

    .bhi-comparison-table th {
        background: var(--bhi-bg-subtle);
    }

    .bhi-cal-level-4 .bhi-cal-count { color: #3dd9a8; }

    .bhi-signal-s.bhi-signal-wait { color: #FFC107; }

    .bhi-pill--buy-now { background: rgba(0, 200, 150, 0.15); color: #3dd9a8; border-color: rgba(0, 200, 150, 0.3); }
    .bhi-pill--good-time { background: rgba(76, 175, 80, 0.15); color: #66bb6a; border-color: rgba(76, 175, 80, 0.3); }
    .bhi-pill--wait { background: rgba(255, 193, 7, 0.15); color: #FFC107; border-color: rgba(255, 193, 7, 0.3); }

    .bhi-score-pill {
        background: var(--bhi-bg-subtle);
        border-color: var(--bhi-border);
        color: var(--bhi-text-secondary);
    }

    .bhi-pc-pro .bhi-pc-text { color: #3dd9a8; }
    .bhi-pc-con .bhi-pc-text { color: #e74c3c; }
    .bhi-pc-info .bhi-pc-text { color: var(--bhi-text-secondary); }
    .bhi-pc-toggle { background: var(--bhi-bg-subtle); border-color: var(--bhi-border); color: var(--bhi-text-muted); }
    .bhi-pc-toggle:hover { color: #3dd9a8; background: rgba(61, 217, 168, 0.1); }

    /* Dark mode for horizontal chips (v2.6.0) */
    .bhi-mini-trend--chips { border-top-color: var(--bhi-border); }
    .bhi-chip--stat { background: rgba(61, 217, 168, 0.15); color: #3dd9a8; border-color: rgba(61, 217, 168, 0.25); }
    .bhi-chip--discount { background: rgba(255, 152, 0, 0.15); color: #ffb74d; border-color: rgba(255, 152, 0, 0.25); }
    .bhi-chip--pro { background: rgba(76, 175, 80, 0.12); color: #66bb6a; border-color: rgba(76, 175, 80, 0.2); }
    .bhi-chip--con { background: rgba(255, 193, 7, 0.12); color: #FFC107; border-color: rgba(255, 193, 7, 0.2); }

    /* Dark mode urgency alert */
    .bhi-urgency-alert {
        background: linear-gradient(135deg, rgba(61, 217, 168, 0.1) 0%, var(--bhi-bg-subtle) 100%);
    }
    .bhi-urgency-icon { background: var(--bhi-bg-subtle); }
    .bhi-urgency-alert.bhi-signal-buy_now .bhi-urgency-label { color: #3dd9a8; }
    .bhi-urgency-alert.bhi-signal-good_time .bhi-urgency-label { color: #66bb6a; }
    .bhi-urgency-alert.bhi-signal-wait .bhi-urgency-label { color: #FFC107; }

    /* Dark mode history toggle */
    .bhi-history-toggle {
        background: var(--bhi-bg-subtle);
        border-color: var(--bhi-border);
    }
    .bhi-history-toggle:hover { background: var(--bhi-bg); }
    .bhi-history-toggle[aria-expanded="true"] {
        background: rgba(61, 217, 168, 0.12);
        border-color: rgba(61, 217, 168, 0.3);
        color: #3dd9a8;
    }
}

/* ==========================================================================
   20b. Unified Empty State (v2.7.0)
   ========================================================================== */

/* When one section has content and the other is empty, make empty message less prominent */
.skp-no-active-coupons.skp-secondary-empty,
.soa-no-active.soa-secondary-empty {
    padding: 12px 16px;
    background: #f8f9fa;
    border-color: #e0e4e8;
    border-left-width: 1px;
    opacity: 0.7;
}

.skp-no-active-coupons.skp-secondary-empty h3,
.soa-no-active.soa-secondary-empty h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.skp-no-active-coupons.skp-secondary-empty .skp-explanation,
.soa-no-active.soa-secondary-empty p {
    display: none;
}

.skp-no-active-coupons.skp-secondary-empty .skp-cta-buttons {
    display: none;
}

/* Dark mode secondary empty states */
@media (prefers-color-scheme: dark) {
    .skp-no-active-coupons.skp-secondary-empty,
    .soa-no-active.soa-secondary-empty {
        background: var(--bhi-bg-subtle);
        border-color: var(--bhi-border);
    }
}

/* ==========================================================================
   21. Print & Accessibility
   ========================================================================== */

@media print {
    .bhi-full-panel,
    .bhi-medium-panel,
    .bhi-post-insight {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }

    .bhi-mini-trend {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bhi-stat-box,
    .bhi-reliability-fill,
    .bhi-highlight-card {
        animation: none;
        transition: none;
    }
}

@media (prefers-contrast: high) {
    .bhi-full-panel,
    .bhi-medium-panel,
    .bhi-prediction,
    .bhi-post-insight {
        border-width: 2px;
    }

    .bhi-dot-filled {
        outline: 1px solid var(--bhi-text);
    }
}
