/* ThreadsTraffic - High-End Bento Grid Design System
   Pitch Black #09090B | Vibrant Neon Orange #FF5500 | Dark Zinc #121215/85
   No-Emoji Rule | Custom UI Dropdowns | Dynamic Breadcrumbs */

:root {
    /* Base Surfaces */
    --canvas-bg: #09090B;
    --bento-bg: rgba(18, 18, 21, 0.85);
    --bento-bg-elevated: #18181B;
    --bento-border: #27272A;
    --bento-border-hover: #3F3F46;
    --badge-surface: #09090B;

    /* Brand Primary & Neon Tokens */
    --brand-primary: #FF5500;
    --brand-hover: #F97316;
    --brand-glow: drop-shadow(0 0 10px rgba(255, 85, 0, 0.35));
    --brand-box-glow: 0 0 20px rgba(255, 85, 0, 0.25);
    --brand-ring: rgba(255, 85, 0, 0.35);

    /* Semantic Status Tokens */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-text: #34D399;
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-text: #F87171;
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-text: #FBBF24;
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --info-text: #60A5FA;

    /* Typography & Neutral Colors */
    --text-white: #FFFFFF;
    --text-zinc-200: #E4E4E7;
    --text-zinc-400: #A1A1AA;
    --text-zinc-500: #71717A;
    --text-zinc-600: #52525B;

    /* Border Radii */
    --radius-bento: 1.75rem; /* rounded-3xl / 28px */
    --radius-card: 1.25rem;  /* 20px */
    --radius-control: 0.75rem; /* 12px */
    --radius-pill: 9999px;

    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: var(--canvas-bg);
    color: var(--text-white);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Subtle Gradient Glow */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    left: 10%;
    width: 800px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 85, 0, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ==========================================================================
   TOP FIXED NAVBAR (NO STATIC PAGE TITLE, DYNAMIC BREADCRUMBS)
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bento-border);
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text-white);
    text-decoration: none;
}

.brand-logo-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-control);
    background: linear-gradient(135deg, #FF5500 0%, #D94400 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 85, 0, 0.4);
}

.brand-logo-icon svg {
    width: 18px;
    height: 18px;
}

.brand-name {
    font-weight: 800;
    font-size: 1.05rem;
}

.brand-divider {
    width: 1px;
    height: 22px;
    background: var(--bento-border);
}

/* Dynamic Breadcrumbs (#page-breadcrumbs) */
#page-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb-item {
    color: var(--text-zinc-400);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-family: inherit;
}

.breadcrumb-item:hover {
    color: var(--text-white);
}

.breadcrumb-separator {
    color: var(--text-zinc-600);
    user-select: none;
    font-size: 0.85rem;
}

.breadcrumb-current {
    font-weight: 700;
    color: var(--text-white);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Header Right Actions */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

/* Quick project selector in header */
.header-project-wrap {
    min-width: 200px;
}

/* Primary and Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-control);
    padding: 0.55rem 1.15rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-primary);
    box-shadow: 0 0 15px rgba(255, 85, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--brand-hover);
    border-color: var(--brand-hover);
    box-shadow: 0 0 22px rgba(255, 85, 0, 0.45);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--text-zinc-200);
    border-color: var(--bento-border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border-color: var(--bento-border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-zinc-400);
    border-color: transparent;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   NAVIGATION TABS (SUB-NAVBAR)
   ========================================================================== */
.tabs-nav-wrapper {
    padding: 1rem 2rem 0;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

.tabs-nav {
    display: inline-flex;
    background: #121215;
    border: 1px solid var(--bento-border);
    padding: 0.3rem;
    border-radius: var(--radius-pill);
    gap: 0.3rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-zinc-400);
    padding: 0.5rem 1.25rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-pill);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.tab-btn svg {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-white);
}

.tab-btn.active {
    background: var(--brand-primary);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(255, 85, 0, 0.35);
}

.tab-badge {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.tab-btn.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ==========================================================================
   CUSTOM UI DROPDOWNS (ZERO <select> RULE)
   ========================================================================== */
.custom-dropdown {
    position: relative;
    user-select: none;
    font-family: inherit;
}

.dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    background: #09090B;
    border: 1px solid var(--bento-border);
    color: var(--text-white);
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius-control);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.dropdown-trigger:hover, .custom-dropdown.open .dropdown-trigger {
    border-color: var(--bento-border-hover);
    background: #121215;
}

.custom-dropdown.open .dropdown-trigger {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-ring);
}

.dropdown-trigger .dropdown-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-zinc-400);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-dropdown.open .dropdown-chevron {
    transform: rotate(180deg);
    color: var(--brand-primary);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 180px;
    background: #121215;
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-control);
    padding: 0.35rem;
    z-index: 200;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--bento-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-height: 240px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-zinc-200);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-white);
}

.dropdown-item.active {
    background: rgba(255, 85, 0, 0.12);
    color: var(--brand-primary);
    font-weight: 600;
}

.dropdown-item .dropdown-check {
    width: 14px;
    height: 14px;
    color: var(--brand-primary);
    opacity: 0;
}

.dropdown-item.active .dropdown-check {
    opacity: 1;
}

/* ==========================================================================
   MAIN APP CONTENT & BENTO GRID LAYOUT
   ========================================================================== */
.app-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
    width: 100%;
    position: relative;
    z-index: 10;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

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

/* ==========================================================================
   BENTO GRID ARCHITECTURE (7:5 PROPORTIONS)
   ========================================================================== */
.bento-grid-overview {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Bento Tile Surface */
.bento-tile {
    background: var(--bento-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-bento);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bento-tile:hover {
    border-color: var(--bento-border-hover);
}

/* Category Badge Surface */
.category-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    background: var(--badge-surface);
    border: 1px solid var(--bento-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.category-badge svg {
    width: 18px;
    height: 18px;
}

.bento-tile:hover .category-badge {
    border-color: var(--brand-primary);
}

/* 1. DOMINANT HERO TILE (7 COLUMNS) */
.hero-tile {
    grid-column: span 7;
    min-height: 360px;
}

.tile-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.tile-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tile-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-zinc-500);
}

.tile-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
}

.hero-metric-wrap {
    margin: 0.5rem 0 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

/* 5xl font-black text-white font-mono glow-orange */
.hero-big-number {
    font-size: 3.25rem;
    font-weight: 900;
    color: #FFFFFF;
    font-family: var(--font-mono);
    line-height: 1;
    filter: drop-shadow(0 0 15px rgba(255, 85, 0, 0.4));
}

.hero-unit {
    font-size: 0.9rem;
    color: var(--text-zinc-400);
    font-weight: 500;
}

/* Period micro-switcher 7Д / 30Д */
.period-switch {
    display: inline-flex;
    background: #09090B;
    border: 1px solid var(--bento-border);
    padding: 0.2rem;
    border-radius: var(--radius-pill);
    gap: 0.2rem;
}

.period-btn {
    background: transparent;
    border: none;
    color: var(--text-zinc-400);
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.15s ease;
}

.period-btn.active {
    background: var(--brand-primary);
    color: #FFFFFF;
}

/* Interactive Canvas Chart Container */
.chart-container {
    width: 100%;
    height: 180px;
    position: relative;
    margin-top: auto;
}

.chart-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 2. RIGHT STACK OF TILES (5 COLUMNS) */
.right-stack {
    grid-column: span 5;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Top Wide Card in Right Stack */
.status-action-tile {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.status-badge-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 600;
}

.status-badge-indicator.drafts {
    background: rgba(161, 161, 170, 0.12);
    color: var(--text-zinc-200);
    border: 1px solid rgba(161, 161, 170, 0.25);
}

.status-badge-indicator.review {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-badge-indicator.auto {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-badge-indicator.pause {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-badge-indicator .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Two Lower Square Cards (grid-cols-2) */
.lower-square-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.metric-square-tile {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.square-number {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-white);
    line-height: 1;
}

.square-status {
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.square-status.success { color: var(--success-text); }
.square-status.danger { color: var(--danger-text); }
.square-status.warning { color: var(--warning-text); }
.square-status.muted { color: var(--text-zinc-500); }

/* ==========================================================================
   INBOX / POSTS FEED COMPONENT
   ========================================================================== */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    background: #121215;
    border: 1px solid var(--bento-border);
    color: var(--text-zinc-400);
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-chip:hover {
    color: var(--text-white);
    border-color: var(--bento-border-hover);
}

.filter-chip.active {
    background: rgba(255, 85, 0, 0.15);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 600;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.post-card {
    background: var(--bento-bg);
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(20px);
}

.post-card:hover {
    border-color: var(--bento-border-hover);
}

.post-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1C1C20;
    border: 1px solid var(--bento-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-zinc-400);
}

.author-avatar svg {
    width: 18px;
    height: 18px;
}

.author-name {
    font-weight: 700;
    color: var(--text-white);
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.author-name:hover {
    color: var(--brand-primary);
}

.post-date {
    font-size: 0.75rem;
    color: var(--text-zinc-500);
}

.post-original-content {
    background: #09090B;
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-control);
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-zinc-200);
    line-height: 1.6;
    word-break: break-word;
}

.draft-box {
    background: rgba(255, 85, 0, 0.04);
    border: 1px solid rgba(255, 85, 0, 0.2);
    border-radius: var(--radius-control);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.draft-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--brand-primary);
    font-weight: 600;
}

.draft-text {
    font-size: 0.925rem;
    color: var(--text-white);
    line-height: 1.6;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(39, 39, 42, 0.5);
}

.post-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge svg {
    width: 12px;
    height: 12px;
}

.badge-secondary {
    background: rgba(161, 161, 170, 0.1);
    color: var(--text-zinc-400);
    border: 1px solid var(--bento-border);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   SETTINGS & FORMS
   ========================================================================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.settings-card {
    background: var(--bento-bg);
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-bento);
    padding: 1.75rem;
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-card.full-width {
    grid-column: span 2;
}

.card-header-styled {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--bento-border);
}

.card-header-styled h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-zinc-400);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.flex-1 { flex: 1; }

input[type="text"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    background: #09090B;
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-control);
    padding: 0.65rem 0.95rem;
    color: var(--text-white);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s ease;
}

input:focus, textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-ring);
}

textarea {
    resize: vertical;
}

.code-textarea {
    font-family: var(--font-mono);
    font-size: 0.825rem;
    line-height: 1.5;
}

/* Prompt Playground */
.prompt-playground-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.playground-result-box {
    background: #09090B;
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-control);
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-zinc-200);
    margin-top: 0.75rem;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

/* Search queries */
.add-query-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.queries-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
}

.query-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.95rem;
    background: #09090B;
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-control);
    font-size: 0.875rem;
}

.query-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* External Connections Cards */
.connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.conn-tile {
    background: #09090B;
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-card);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

/* ==========================================================================
   QUEUE & JOURNAL TABLES
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.data-table th {
    background: #09090B;
    color: var(--text-zinc-400);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--bento-border);
}

.data-table th:first-child { border-top-left-radius: var(--radius-control); }
.data-table th:last-child { border-top-right-radius: var(--radius-control); }

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(39, 39, 42, 0.4);
    color: var(--text-zinc-200);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   MODALS (BENTO SURFACE & MATTE BLUR)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-card {
    background: #121215;
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-bento);
    padding: 2.25rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--bento-border);
    position: relative;
    animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-card h2, .modal-card h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 0.5rem;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Login Modal Specifics */
.login-header-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-control);
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 20px rgba(255, 85, 0, 0.4);
}

.login-header-icon svg {
    width: 24px;
    height: 24px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    background: #121215;
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-control);
    padding: 0.85rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.2s ease-out;
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast-success { border-color: rgba(16, 185, 129, 0.4); }
.toast-success svg { color: var(--success-text); }
.toast-error { border-color: rgba(239, 68, 68, 0.4); }
.toast-error svg { color: var(--danger-text); }
.toast-info { border-color: rgba(255, 85, 0, 0.4); }
.toast-info svg { color: var(--brand-primary); }

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

/* Helpers */
.hidden { display: none !important; }
.text-muted { color: var(--text-zinc-400); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.ml-1 { margin-left: 0.5rem; }
.btn-block { width: 100%; }

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-zinc-500);
    font-size: 0.95rem;
    background: var(--bento-bg);
    border: 1px dashed var(--bento-border);
    border-radius: var(--radius-bento);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.empty-state svg {
    width: 32px;
    height: 32px;
    color: var(--text-zinc-600);
}

/* Sub-Tabs Nav (Pills) */
.sub-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--bento-border);
    padding-bottom: 0.75rem;
}

.sub-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-zinc-400);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-control);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.sub-tab-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.04);
}

.sub-tab-btn.active {
    background: #18181B;
    border-color: var(--bento-border);
    color: var(--brand-primary);
}

.filter-counter {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-zinc-300);
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.25rem;
    transition: background-color 0.15s ease;
}

.filter-chip.active .filter-counter {
    background: var(--brand-primary);
    color: #fff;
}

/* Post card hierarchy & ergonomics */
.post-card-top-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-origin-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.post-section-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-zinc-500);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* ==========================================================================
   SKELETON LOADERS SYSTEM (SHIMMER ANIMATION)
   ========================================================================== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.02) 20%,
        rgba(255, 255, 255, 0.07) 35%,
        rgba(255, 255, 255, 0.02) 50%
    );
    background-size: 300% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-card {
    background: var(--bento-bg);
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
}

.skeleton-line.w-full { width: 100%; }
.skeleton-line.w-85 { width: 85%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-35 { width: 35%; }
.skeleton-line.w-20 { width: 20%; }
.skeleton-line.h-18 { height: 18px; }
.skeleton-line.h-24 { height: 24px; }
.skeleton-line.h-36 { height: 36px; }

.skeleton-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-pill {
    height: 24px;
    width: 75px;
    border-radius: var(--radius-pill);
}

.skeleton-btn {
    height: 32px;
    width: 85px;
    border-radius: var(--radius-control);
}

.skeleton-box {
    border-radius: var(--radius-control);
    min-height: 70px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .bento-grid-overview {
        grid-template-columns: 1fr;
    }
    .hero-tile, .right-stack {
        grid-column: span 1;
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .settings-card.full-width {
        grid-column: span 1;
    }
    .prompt-playground-grid {
        grid-template-columns: 1fr;
    }
}
