/* ==========================================================================
   BLACKHOLE SEARCH — PROFESSIONAL CLEAN THEME
   ========================================================================== */

/* ----------------------------------------
   PAGE: HOMEPAGE HERO
---------------------------------------- */
.bh-hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px 100px;
}

/* Hero logo */
.bh-hero-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.22em;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1;
    user-select: none;
    margin: 0 0 10px 0;
    padding: 0;
    text-align: center;
}
.bh-hero-logo span { color: #fbbf24; }

.bh-hero-icon {
    width: 0.86em;
    height: 0.86em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transform: translateY(-0.02em);
    filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.35));
}
.bh-hero-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Hero tagline */
.bh-hero-tagline {
    font-size: 0.88rem;
    color: #4b5563;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: 32px;
    text-align: center;
}

/* ── Live Info Bar ── */
.bh-info-bar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 28px;
    background: #13151b;
    border: 1px solid #1e2028;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.bh-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    transition: background 0.15s;
}
.bh-info-item:hover { background: #1a1c24; }
.bh-info-item svg {
    width: 15px;
    height: 15px;
    color: #fbbf24;
    flex-shrink: 0;
}

.bh-info-sep {
    width: 1px;
    height: 36px;
    background: #1e2028;
    flex-shrink: 0;
}

.bh-info-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bh-info-label {
    font-size: 0.62rem;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    line-height: 1;
}
.bh-info-value {
    font-size: 0.82rem;
    color: #e2e4e9;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    white-space: nowrap;
}
.bh-ai-status { color: #fbbf24; }

@media (max-width: 640px) {
    .bh-info-bar { flex-wrap: wrap; border-radius: 14px; }
    .bh-info-sep { display: none; }
    .bh-info-item { flex: 1; min-width: 45%; justify-content: center; }
}


/* ----------------------------------------
   PAGE: RESULTS HEADER LAYOUT
---------------------------------------- */
.bh-header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 20px;
    max-width: 1100px;
    margin: 0 auto;
}
.bh-header-logo   { flex-shrink: 0; text-decoration: none; }
.bh-header-search { flex: 1; max-width: 640px; }
.bh-header-right  { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ----------------------------------------
   PAGE: RESULTS BODY LAYOUT
---------------------------------------- */
.bh-results-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 80px;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}
.bh-results-main { flex: 1; min-width: 0; }
.bh-results-side { width: 280px; flex-shrink: 0; }

.bh-tabs-row {
    padding: 0 20px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ----------------------------------------
   AI OVERVIEW CARD
---------------------------------------- */
.bh-ai-card {
    background: #1a1c24;
    border: 1px solid #2a2d38;
    border-radius: 14px;
    padding: 16px;
    margin-top: 10px;
    margin-bottom: 24px;
}
.bh-ai-card-hdr {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fbbf24;
    margin-bottom: 10px;
}
.bh-ai-card-hdr svg { width: 12px; height: 12px; }
.bh-ai-card-body { font-size: 0.88rem; color: #9ca3af; line-height: 1.65; }
.bh-ai-card-body strong { color: #e2e4e9; }

/* ----------------------------------------
   SIDEBAR ASK-AI CARD
---------------------------------------- */
.bh-context-card {
    background: #1a1c24;
    border: 1px solid #272934;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    position: sticky;
    top: 80px;
}
.bh-context-card h4 {
    font-size: 0.8rem;
    color: #fbbf24;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.bh-context-card p { font-size: 0.8rem; color: #6b7280; line-height: 1.55; }
.bh-context-ask-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 7px 13px;
    background: transparent;
    border: 1px solid #2a2d38;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #e2e4e9;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s;
    letter-spacing: 0.02em;
}
.bh-context-ask-btn:hover { border-color: #fbbf24; color: #fbbf24; }
.bh-context-ask-btn svg   { width: 12px; height: 12px; }

/* --- Base & Reset --- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: #0f1117;
    color: #e2e4e9;
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f1117; }
::-webkit-scrollbar-thumb { background: #2a2d36; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3a3d48; }

/* --- Selection --- */
::selection { background: rgba(251, 191, 36, 0.22); color: #fde68a; }

/* ----------------------------------------
   HEADER
---------------------------------------- */
.bh-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 17, 23, 0.92);
    border-bottom: 1px solid #1e2028;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ----------------------------------------
   LOGO
---------------------------------------- */
.bh-header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.bh-header-logo:hover {
    transform: translateY(-1px);
}
.bh-logo-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transform: translateY(-1.5px); /* Optical baseline alignment */
}
.bh-logo-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.bh-logo-text {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1;
}
.bh-logo-text span { color: #fbbf24; }

/* ----------------------------------------
   SEARCH BAR
---------------------------------------- */
.bh-search-wrap {
    position: relative;
}

.bh-search-bar {
    display: flex;
    align-items: center;
    background: #1a1c24;
    border: 1.5px solid #2a2d38;
    border-radius: 999px;
    padding: 0 16px 0 20px;
    height: 46px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bh-search-bar:focus-within {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
}

.bh-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e4e9;
    font-size: 0.95rem;
    font-family: inherit;
    padding: 0 10px;
}

.bh-search-bar input::placeholder { color: #555b6e; }

.bh-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 18px;
    background: #fbbf24;
    color: #0f1117;
    border: none;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
    text-transform: uppercase;
}
.bh-search-btn:hover { background: #fcd34d; }
.bh-search-btn:active { transform: scale(0.97); }

.bh-clear-btn {
    background: transparent;
    border: none;
    color: #555b6e;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    margin-right: 6px;
    transition: color 0.15s;
    flex-shrink: 0;
}
.bh-clear-btn:hover { color: #e2e4e9; }

/* ----------------------------------------
   SEARCH TABS
---------------------------------------- */
.bh-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    border-bottom: 1px solid #1e2028;
    padding: 0 4px;
}
.bh-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #6b7280;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    margin-bottom: -1px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.bh-tab:hover { color: #e2e4e9; }
.bh-tab.active {
    color: #fbbf24;
    border-bottom-color: #fbbf24;
}
.bh-tab svg { width: 13px; height: 13px; }

/* ----------------------------------------
   HERO PAGE — HOMEPAGE
---------------------------------------- */
.bh-hero {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px 80px;
}

.bh-hero-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 4rem);
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1;
    user-select: none;
    margin-bottom: 32px;
    text-align: center;
}
.bh-hero-logo span { color: #fbbf24; }

/* ----------------------------------------
   TRENDING CHIPS
---------------------------------------- */
.bh-trending-label {
    font-size: 0.72rem;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-right: 6px;
}
.bh-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #1a1c24;
    border: 1px solid #272934;
    border-radius: 999px;
    font-size: 0.78rem;
    color: #8b939e;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    font-family: inherit;
}
.bh-chip:hover {
    border-color: #fbbf24;
    color: #e2e4e9;
    background: #1e2028;
}

/* ----------------------------------------
   RESULTS LAYOUT
---------------------------------------- */
.bh-results-stats {
    font-size: 0.78rem;
    color: #4b5563;
    padding: 10px 0 14px;
    border-bottom: 1px solid #1e2028;
    margin-bottom: 20px;
}

/* Chrome style result item */
.bh-result {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #1a1c24;
    animation: bhSlideIn 0.22s cubic-bezier(0.16,1,0.3,1) both;
}
.bh-result:last-child { border-bottom: none; }

@keyframes bhSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bh-result-body { flex: 1; min-width: 0; }

.bh-result-origin {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.bh-favicon {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #1e2028;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bh-favicon img { width: 14px; height: 14px; object-fit: contain; }
.bh-result-domain { font-size: 0.8rem; color: #8b939e; font-weight: 500; }
.bh-result-url { font-size: 0.74rem; color: #555b6e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }

.bh-result-title a {
    font-size: 1.05rem;
    font-weight: 500;
    color: #8ab4f8;
    text-decoration: none;
    line-height: 1.3;
    display: block;
    margin-bottom: 5px;
    transition: color 0.1s;
}
.bh-result-title a:hover { color: #fbbf24; text-decoration: underline; }

.bh-result-snippet {
    font-size: 0.84rem;
    color: #8b939e;
    line-height: 1.55;
}

.bh-result-thumb {
    flex-shrink: 0;
    width: 96px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1c24;
    border: 1px solid #272934;
}
.bh-result-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}
.bh-result:hover .bh-result-thumb img { transform: scale(1.04); }

/* ----------------------------------------
   CACHE BADGE
---------------------------------------- */
.bh-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-left: 8px;
}
.bh-badge.cached { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.28); }
.bh-badge.live    { background: rgba(52,211,153,0.10); color: #34d399; border: 1px solid rgba(52,211,153,0.25); }

/* ----------------------------------------
   LOADING BAR
---------------------------------------- */
@keyframes bhProgress {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(20%); }
    100% { transform: translateX(200%); }
}
.bh-progress-bar {
    height: 3px;
    background: #1e2028;
    border-radius: 999px;
    overflow: hidden;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    display: none;
}
.bh-progress-bar.active { display: block; }
.bh-progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, transparent, #fbbf24, transparent);
    animation: bhProgress 1.2s ease-in-out infinite;
}

/* ----------------------------------------
   ERROR / EMPTY STATE
---------------------------------------- */
.bh-empty {
    padding: 40px 0;
    text-align: left;
}
.bh-empty h3 { font-size: 1rem; font-weight: 500; color: #e2e4e9; margin-bottom: 10px; }
.bh-empty li { font-size: 0.85rem; color: #6b7280; margin-bottom: 4px; list-style: disc; margin-left: 20px; }

/* ----------------------------------------
   CLOCK WIDGET
---------------------------------------- */
.bh-clock {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #1a1c24;
    border: 1px solid #272934;
    border-radius: 8px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: #8b939e;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.bh-clock #live-time { color: #fbbf24; font-weight: 600; }

/* ----------------------------------------
   PAGE PUSH WRAPPER
   Shrinks and adapts smoothly when AI panel opens
   so all content stays perfectly centered
---------------------------------------- */
.bh-page-wrap {
    min-height: 100vh;
    width: 100%;
    margin-right: 0;
    transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1), margin-right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    background: #0f1117;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

body.ai-open .bh-page-wrap {
    width: calc(100% - 380px);
    margin-right: 380px;
}

/* ----------------------------------------
   AI CHAT FAB BUTTON
---------------------------------------- */
.bh-ai-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    background: #1a1c24;
    border: 1.5px solid #2a2d38;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e4e9;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.25s, transform 0.25s;
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
    letter-spacing: 0.02em;
}
.bh-ai-fab:hover {
    border-color: #fbbf24;
    background: #1e2028;
    box-shadow: 0 4px 32px rgba(251,191,36,0.16);
}
.bh-ai-fab svg { width: 16px; height: 16px; color: #fbbf24; }
.bh-ai-fab .bh-ai-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #34d399;
    animation: bhPulse 2s ease infinite;
    flex-shrink: 0;
}

body.ai-open .bh-ai-fab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}
@keyframes bhPulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.75); }
}

/* ----------------------------------------
   IMAGE GRID — Images Tab
---------------------------------------- */
.bh-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 4px 0 20px;
}
.bh-img-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 10px;
    overflow: hidden;
    background: #13151b;
    border: 1px solid #1e2028;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.bh-img-card:hover {
    transform: translateY(-3px);
    border-color: rgba(251,191,36,0.4);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.bh-img-thumb-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #1a1d26;
}
.bh-img-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.bh-img-card:hover .bh-img-thumb-wrap img {
    transform: scale(1.05);
}
.bh-img-caption {
    font-size: 0.72rem;
    color: #8b939e;
    padding: 0 8px 8px;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ----------------------------------------
   VIDEO GRID — Videos Tab
---------------------------------------- */
.bh-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    padding: 4px 0 20px;
}
.bh-video-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: #13151b;
    border: 1px solid #1e2028;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.bh-video-card:hover {
    transform: translateY(-3px);
    border-color: rgba(251,191,36,0.35);
    box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}
.bh-video-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #0d0f14;
    overflow: hidden;
}
.bh-video-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.bh-video-card:hover .bh-video-thumb-wrap img {
    transform: scale(1.04);
}
.bh-video-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1d26, #0d0f14);
}
.bh-video-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    transition: background 0.18s ease;
}
.bh-video-play-icon svg {
    width: 40px;
    height: 40px;
    color: rgba(255,255,255,0.85);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    transition: transform 0.18s ease;
}
.bh-video-card:hover .bh-video-play-icon {
    background: rgba(0,0,0,0.15);
}
.bh-video-card:hover .bh-video-play-icon svg {
    transform: scale(1.15);
    color: #fbbf24;
}
.bh-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.bh-video-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bh-video-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e4e9;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.bh-video-pub {
    font-size: 0.7rem;
    color: #fbbf24;
    font-weight: 600;
}
.bh-video-desc {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Tab loading states ── */
.bh-tab-loader, .bh-tab-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 20px;
    color: #8b939e;
    font-size: 0.85rem;
}

/* ----------------------------------------
   AI CHAT PANEL — push-in from right
   No overlay. Panel slides in, page slides left.
---------------------------------------- */
.bh-ai-panel {
    position: fixed;
    top: 0; right: 0;
    width: 380px;
    height: 100vh;
    height: 100dvh;
    background: #13151b;
    border-left: 1px solid #1e2028;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    will-change: transform;
    -webkit-transform: translate3d(100%, 0, 0);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -6px 0 36px rgba(0,0,0,0.55);
    overflow: hidden;
}
.bh-ai-panel.open { 
    transform: translateX(0); 
    -webkit-transform: translate3d(0, 0, 0);
}

.bh-ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #1e2028;
    flex-shrink: 0;
}
.bh-ai-panel-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}
.bh-ai-icon-wrap {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e2028, #2a2d38);
    border: 1px solid #fbbf24;
    display: flex; align-items: center; justify-content: center;
}
.bh-ai-icon-wrap svg { width: 15px; height: 15px; color: #fbbf24; }

.bh-ai-close-btn {
    background: transparent;
    border: none;
    color: #4b5563;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.bh-ai-close-btn:hover { color: #e2e4e9; }

.bh-ai-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 999px;
    margin-left: 4px;
}

/* ----------------------------------------
   VOICE TYPING MIC BUTTON
---------------------------------------- */
.bh-mic-btn {
    background: transparent;
    border: none;
    color: #8b939e;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s, transform 0.15s, background 0.15s;
    flex-shrink: 0;
}
.bh-mic-btn svg {
    width: 17px;
    height: 17px;
}
.bh-mic-btn:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}
.bh-mic-btn.recording {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    animation: micPulse 1.2s infinite;
}
@keyframes micPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Floating speech notification toast */
.bh-speech-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #1a1d26;
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    z-index: 99999;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
    max-width: 90vw;
}
.bh-speech-toast.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
}

/* Chat Messages Area */
.bh-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Empty state */
.bh-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 10px;
    opacity: 0.6;
}
.bh-chat-empty svg { width: 36px; height: 36px; color: #fbbf24; opacity: 0.5; }
.bh-chat-empty p { font-size: 0.82rem; color: #8b939e; text-align: center; line-height: 1.5; }

/* Chat bubbles */
.bh-msg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
}
.bh-msg-role {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.bh-msg-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
}
.bh-msg-logo svg {
    width: 100%;
    height: 100%;
}
.bh-msg.user .bh-msg-role { color: #fbbf24; text-align: right; }
.bh-msg.ai .bh-msg-role { color: #fbbf24; }

.bh-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.6;
    word-break: break-word;
}
.bh-msg.user { align-items: flex-end; }
.bh-msg.user .bh-msg-bubble {
    background: #1e2028;
    border: 1px solid #2a2d38;
    color: #e2e4e9;
    border-radius: 14px 14px 2px 14px;
}
.bh-msg.ai .bh-msg-bubble {
    background: #0d0f14;
    border: 1px solid #1c1e27;
    color: #d1d5db;
    border-radius: 2px 14px 14px 14px;
    position: relative;
}
.bh-msg.ai .bh-msg-bubble strong { color: #fff; }

/* AI Message Typography & Formatting */
.bh-msg-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bh-msg-content h1, .bh-msg-content h2, .bh-msg-content h3, .bh-msg-content h4, .bh-msg-content h5, .bh-msg-content h6 {
    color: #fbbf24;
    margin: 6px 0 2px;
    font-weight: 600;
    line-height: 1.35;
}
.bh-msg-content h1 { font-size: 1.15rem; }
.bh-msg-content h2 { font-size: 1.05rem; }
.bh-msg-content h3 { font-size: 0.96rem; }
.bh-msg-content h4 { font-size: 0.90rem; }
.bh-msg-content p { margin: 0; line-height: 1.6; }
.bh-msg-content ul, .bh-msg-content ol {
    margin: 4px 0 6px 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bh-msg-content li { line-height: 1.55; }
.bh-msg-content hr {
    border: none;
    border-top: 1px solid #232733;
    margin: 8px 0;
}

/* Inline Code */
.bh-inline-code {
    background: #1a1d26;
    border: 1px solid #282c3a;
    color: #fbbf24;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 5px;
}

/* Code Block with Copy Button */
.bh-code-wrap {
    margin: 8px 0;
    border-radius: 10px;
    background: #08090d;
    border: 1px solid #202430;
    overflow: hidden;
}
.bh-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #11131a;
    border-bottom: 1px solid #1c202a;
}
.bh-code-lang {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.bh-code-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    background: #1b1e28;
    border: 1px solid #2a2e3d;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 0.73rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}
.bh-code-copy-btn:hover {
    background: #242836;
    color: #fbbf24;
    border-color: #fbbf24;
}
.bh-code-copy-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}
.bh-code-wrap pre {
    margin: 0;
    padding: 12px 14px;
    overflow-x: auto;
    background: transparent;
}
.bh-code-wrap code {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.82rem;
    color: #e5e7eb;
    line-height: 1.5;
    white-space: pre;
}

/* AI Markdown Tables */
.bh-ai-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 8px 0;
}
.bh-ai-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.80rem;
}
.bh-ai-table th, .bh-ai-table td {
    padding: 6px 10px;
    border: 1px solid #232733;
    text-align: left;
}
.bh-ai-table th {
    background: #141720;
    color: #fbbf24;
    font-weight: 600;
}
.bh-ai-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

/* Message Footer with Copy Action */
.bh-msg-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    gap: 8px;
}
.bh-msg-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #8b939e;
    font-size: 0.72rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.bh-msg-copy-btn:hover {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fbbf24;
}
.bh-msg-copy-btn svg {
    width: 12px;
    height: 12px;
}

/* AI Overview Card in Search Results */
.bh-ai-card {
    background: #111319;
    border: 1px solid #202430;
    border-left: 3px solid #fbbf24;
    border-radius: 12px;
    padding: 16px 18px;
    margin-top: 10px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.bh-ai-card-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 10px;
}
.bh-ai-card-body {
    font-size: 0.86rem;
    color: #d1d5db;
    line-height: 1.65;
}
.bh-ai-card-body strong { color: #fff; }
.bh-card-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #171922;
    border: 1px solid #282c3a;
    border-radius: 6px;
    color: #8b939e;
    font-size: 0.72rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.bh-card-copy-btn:hover {
    background: #202432;
    color: #fbbf24;
    border-color: #fbbf24;
}
.bh-card-copy-btn svg {
    width: 12px;
    height: 12px;
}

/* Typing indicator */
.bh-typing span {
    display: inline-block;
    width: 6px; height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    margin: 0 2px;
    animation: bhTyping 1.2s ease infinite;
}
.bh-typing span:nth-child(2) { animation-delay: 0.2s; }
.bh-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bhTyping {
    0%,60%,100% { transform: translateY(0); opacity: 0.4; }
    30%          { transform: translateY(-6px); opacity: 1; }
}

/* ----------------------------------------
   PREMIUM BORDERLESS CHAT INPUT CAPSULE
---------------------------------------- */
.bh-chat-input-wrap {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: #13151b;
    border-top: 1px solid #1a1c24;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.bh-chat-input-capsule {
    background: #181a22;
    border: 1px solid #242732;
    border-radius: 16px;
    padding: 6px 10px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.bh-chat-input-capsule:focus-within {
    background: #1c1f2a;
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(251, 191, 36, 0.2);
}

.bh-chat-input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #e2e4e9;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    padding: 6px 4px 2px;
    line-height: 1.5;
    min-height: 38px;
    max-height: 120px;
}
.bh-chat-input::placeholder { color: #555b6e; }

.bh-chat-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.bh-chat-send-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fbbf24;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}
.bh-chat-send-btn:hover { background: #fcd34d; }
.bh-chat-send-btn:active { transform: scale(0.95); }
.bh-chat-send-btn svg { width: 14px; height: 14px; color: #0f1117; }
.bh-chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }


/* ----------------------------------------
   RESPONSIVE — MOBILE SEARCH & PUSH SUITE
---------------------------------------- */
@media (max-width: 860px) {
    .bh-results-page {
        flex-direction: column;
        gap: 18px;
        padding: 0 16px 80px;
        width: 100%;
        box-sizing: border-box;
    }
    .bh-results-main {
        width: 100%;
    }
    .bh-results-side {
        width: 100%;
        order: 2;
    }
    .bh-context-card {
        position: static;
        margin-top: 10px;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 640px) {
    /* 2-Row Header Layout on Mobile */
    .bh-header-inner {
        flex-direction: column;
        align-items: center;
        padding: 10px 14px 8px;
        gap: 8px;
    }
    .bh-header-logo {
        margin: 0 auto;
        justify-content: center;
    }
    .bh-logo-text {
        font-size: 1.25rem;
    }
    .bh-logo-icon {
        width: 20px;
        height: 20px;
    }
    .bh-header-right {
        display: none; /* Hide secondary top clock on mobile */
    }
    .bh-header-search {
        width: 100%;
        max-width: 100%;
    }
    .bh-search-bar {
        height: 42px;
        padding: 0 8px 0 12px;
        border-radius: 999px;
    }
    .bh-search-bar input {
        font-size: 0.88rem;
        padding: 0 6px;
    }
    .bh-search-btn-text {
        display: none !important;
    }
    .bh-search-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 0;
        border-radius: 50%;
        gap: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .bh-search-btn svg {
        width: 14px;
        height: 14px;
        margin: 0;
    }

    /* Tabs horizontal scrolling */
    .bh-tabs-row {
        padding: 0 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .bh-tabs-row::-webkit-scrollbar {
        display: none;
    }
    .bh-tabs {
        width: max-content;
        min-width: 100%;
        justify-content: center;
    }
    .bh-tab {
        padding: 8px 12px;
        font-size: 0.74rem;
        white-space: nowrap;
    }

    /* Results list */
    .bh-results-stats {
        padding: 8px 0 10px;
        margin-bottom: 12px;
        font-size: 0.74rem;
    }
    .bh-result {
        gap: 12px;
        padding: 12px 0;
    }
    .bh-result-url {
        max-width: 190px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.7rem;
    }
    .bh-result-title a {
        font-size: 0.98rem;
        line-height: 1.35;
    }
    .bh-result-snippet {
        font-size: 0.8rem;
        line-height: 1.45;
    }
    .bh-result-thumb {
        width: 64px;
        height: 54px;
        border-radius: 6px;
    }

    /* Hero section on Mobile */
    .bh-hero-section {
        padding: 40px 16px 80px;
        min-height: calc(100vh - 40px);
    }
    .bh-hero-logo {
        font-size: 2.5rem;
        margin-bottom: 6px;
    }
    .bh-hero-tagline {
        font-size: 0.78rem;
        margin-bottom: 22px;
        padding: 0 10px;
    }
    .bh-info-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        border-radius: 12px;
        margin-top: 22px;
    }
    .bh-info-item {
        padding: 10px 12px;
        gap: 8px;
    }
    .bh-info-sep {
        display: none;
    }
    .bh-info-value {
        font-size: 0.75rem;
    }
    .bh-info-label {
        font-size: 0.58rem;
    }

    .bh-ai-fab {
        padding: 10px 14px;
        font-size: 0.75rem;
        bottom: 20px;
        right: 16px;
    }
    .bh-ai-fab svg {
        width: 14px;
        height: 14px;
    }

    /* AI panel & push on mobile */
    body.ai-open {
        overflow: hidden;
        touch-action: none;
    }
    body.ai-open .bh-page-wrap {
        width: 100%;
        margin-right: 0;
        filter: brightness(0.65);
        transition: filter 0.3s ease;
    }
    .bh-ai-panel {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-left: none;
        border-radius: 0;
        transform: translateY(100%);
        -webkit-transform: translate3d(0, 100%, 0);
        transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 9999;
    }
    .bh-ai-panel.open {
        transform: translateY(0);
        -webkit-transform: translate3d(0, 0, 0);
    }
    .bh-ai-panel-header {
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
    }
    .bh-chat-messages {
        padding: 14px;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .bh-chat-input-wrap {
        padding: 8px 12px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        background: #13151b;
        border-top: 1px solid #1e2028;
    }
    .bh-chat-input-capsule {
        border-radius: 14px;
        padding: 4px 8px 6px 10px;
    }
    .bh-chat-input {
        font-size: 16px; /* 16px strictly prevents iOS auto-zoom jitter */
        min-height: 36px;
        line-height: 1.4;
    }
}


