/* ============================================
   MOBILE BOTTOM NAV
   ============================================ */
.bc-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--surface, #ffffff) !important;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    /* Ensure solid background - no transparency */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

@media (min-width: 769px) {
    .bc-bottom-nav { display: none !important; }
}

/* Hide AppFooter on mobile - bottom nav replaces it */
@media (max-width: 768px) {
    .app-footer,
    footer:not(.bc-bottom-nav) {
        display: none !important;
    }
}

.bc-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: var(--font-medium);
    text-decoration: none;
    position: relative;
    max-width: 72px;
    flex: 1;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    border: none;
    background: none;
}

.bc-bottom-nav-item:active {
    transform: scale(0.95);
}

.bc-bottom-nav-item.active {
    color: var(--link-color);
}

.bc-bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--link-color);
    border-radius: 0 0 2px 2px;
}

.bc-bottom-nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.bc-bottom-nav-label {
    font-size: 10px;
    line-height: 1;
}

.bc-bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(14px);
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============================================
   MOBILE SUBMENU
   ============================================ */
.bc-bottom-submenu {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: var(--surface, #ffffff);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: var(--space-lg);
    z-index: 10000;
    animation: slideUp 0.2s ease;
}

.bc-submenu-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 14px var(--space-lg);
    border-radius: 10px;
    font-size: var(--font-md);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
}

.bc-submenu-item:hover {
    background: var(--border-light);
}

.bc-submenu-icon {
    width: 24px;
    text-align: center;
    font-size: 18px;
}

.bc-submenu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 768px) {
    .bc-topbar-nav {
        display: none;
    }

    .bc-modal {
        width: 90vw;
        max-height: 85vh;
        border-radius: var(--radius-xl);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .bc-table {
        display: block;
        overflow-x: auto;
    }
}

/* NOTE: 480px breakpoint handled in main mobile section below */

/* ============================================
   MOBILE-SPECIFIC OPTIMIZATIONS
   Maximum space utilization, unified 12px grid
   ============================================ */
@media (max-width: 768px) {
    /* ══════════════════════════════════════════
       UNIFIED 12px EDGE GRID - Professional Mobile Layout
       ══════════════════════════════════════════ */
    :root {
        --mobile-edge: 12px;
        --mobile-gap: 8px;
        --mobile-header-height: 52px;
        --mobile-footer-height: 60px;
    }
    
    /* --------------------------------------
       TOP HEADER - 12px edges
       -------------------------------------- */
    .bc-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 var(--mobile-edge, 12px);
        height: var(--mobile-header-height, 52px);
        left: 0;
        right: 0;
    }
    
    /* --------------------------------------
       BOTTOM NAV - 12px edges
       -------------------------------------- */
    .bc-bottom-nav {
        padding-left: var(--mobile-edge, 12px);
        padding-right: var(--mobile-edge, 12px);
        height: var(--mobile-footer-height, 56px);
        left: 0;
        right: 0;
    }
    
    .bc-bottom-nav-item {
        padding: 8px 4px;
    }
    
    .bc-bottom-nav-icon {
        font-size: 18px;
    }
    
    .bc-bottom-nav-label {
        font-size: 9px;
        margin-top: 2px;
    }
    
    /* --------------------------------------
       MAIN CONTENT - 12px edges, aligned grid
       -------------------------------------- */
    .app-main {
        padding: var(--mobile-edge, 12px) !important;
        padding-bottom: calc(var(--mobile-footer-height, 60px) + var(--mobile-edge, 12px) + env(safe-area-inset-bottom, 0px)) !important;
        margin-top: var(--mobile-header-height, 52px);
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* --------------------------------------
       LOGO - Icon only
       -------------------------------------- */
    .bc-header-logo {
        font-size: 0;
        padding: 0;
    }
    
    .bc-header-logo i {
        font-size: 26px !important;
        width: 26px !important;
        height: 26px !important;
    }
    
    .bc-header-logo span {
        display: none !important;
    }
    
    /* --------------------------------------
       USER ZONE - Right aligned, compact
       -------------------------------------- */
    .bc-header-user {
        margin-left: auto;
        gap: 6px;
        display: flex;
        align-items: center;
    }
    
    .bc-credits-display {
        font-size: 11px;
        padding: 4px 8px;
        border-radius: 12px;
    }
    
    .bc-nav-settings,
    .bc-nav-admin {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .avatar {
        width: 34px !important;
        height: 34px !important;
        font-size: 12px !important;
    }
    
    .bc-role-badge {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
    
    /* --------------------------------------
       CARDS - Full width with 12px gap
       -------------------------------------- */
    .card {
        border-radius: 12px;
        margin-bottom: var(--mobile-gap, 8px);
        margin-left: 0;
        margin-right: 0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    
    .card-body {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    .card-header {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    /* --------------------------------------
       PAGE HEADER - Compact
       -------------------------------------- */
    .page-header {
        margin-bottom: var(--mobile-gap, 8px);
        padding: 0;
        gap: 6px;
    }
    
    .page-title {
        font-size: 18px !important;
    }
    
    .page-subtitle {
        font-size: 12px;
        margin-top: 2px;
    }
    
    /* --------------------------------------
       BUTTONS - Compact for mobile
       -------------------------------------- */
    .btn {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .btn i {
        font-size: 12px;
    }

    /* Hide button text on very small screens, keep icons */
    .page-header .btn span,
    .page-header .btn:not(:has(i)) {
        font-size: 13px;
    }
    
    /* --------------------------------------
       FORMS - Compact inputs
       -------------------------------------- */
    .form-input,
    .form-select,
    .form-textarea {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: var(--space-sm);
    }
    
    .form-label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    /* --------------------------------------
       ARTICLES TABLE VIEW - Mobile optimized
       -------------------------------------- */
    .articles-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--mobile-gap, 8px) !important;
    }
    
    .article-card {
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    
    .article-card .card-body {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    .article-card-header {
        flex-direction: row;
        align-items: center;
        gap: var(--space-xs);
        margin-bottom: var(--space-xs);
    }
    
    .article-title {
        font-size: 14px !important;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .article-meta {
        gap: var(--space-sm);
        font-size: 11px;
    }
    
    .meta-item i {
        font-size: 10px;
    }
    
    .badge {
        font-size: 10px;
        padding: 2px 6px;
        white-space: nowrap;
    }
    
    /* --------------------------------------
       TABLE - Transform to mobile cards
       -------------------------------------- */
    .bc-table {
        display: block;
        font-size: 12px;
    }
    
    .bc-table thead {
        display: none;
    }
    
    .bc-table tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .bc-table tbody tr {
        display: block;
        background: var(--surface);
        border-radius: 8px;
        padding: 10px;
        border: 1px solid var(--border);
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    
    .bc-table td {
        display: block;
        padding: 4px 0;
        border: none;
    }
    
    .bc-table td:empty {
        display: none;
    }
    
    /* Hide less important columns on mobile */
    .bc-table .hide-mobile {
        display: none;
    }
    
    /* --------------------------------------
       MODALS - Fullscreen on mobile
       -------------------------------------- */
    .bc-modal {
        width: 100% !important;
        max-width: 100% !important;
        height: 100%;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0;
    }
    
    .bc-modal-header {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    .bc-modal-body {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    .bc-modal-footer {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    /* --------------------------------------
       FILTERS - Compact filter bar
       -------------------------------------- */
    .card:has(.form-input):has(.form-select) .card-body {
        padding: var(--space-xs) !important;
        gap: var(--space-xs) !important;
    }
    
    /* --------------------------------------
       EMPTY STATE - Compact
       -------------------------------------- */
    .empty-state {
        padding: var(--space-lg) var(--space-sm);
    }
    
    .empty-state i {
        font-size: 36px;
        margin-bottom: var(--space-sm);
    }
    
    .empty-state h3 {
        font-size: 16px;
    }
    
    /* --------------------------------------
       TYPOGRAPHY - Mobile sizes
       -------------------------------------- */
    h1 { font-size: 20px !important; }
    h2 { font-size: 18px !important; }
    h3 { font-size: 16px !important; }
    h4 { font-size: 14px !important; }
    
    /* --------------------------------------
       SPACING UTILITIES - Tighter on mobile
       -------------------------------------- */
    .mb-lg, .my-lg { margin-bottom: var(--space-sm) !important; }
    .mt-lg, .my-lg { margin-top: var(--space-sm) !important; }
    .p-lg { padding: var(--space-sm) !important; }
    
    /* --------------------------------------
       USER DROPDOWN - Mobile optimized
       -------------------------------------- */
    .bc-user-dropdown-menu {
        right: 0;
        min-width: 180px;
    }
    
    .bc-user-dropdown-item {
        padding: var(--space-sm) var(--space-md);
        font-size: 14px;
    }
    
    /* --------------------------------------
       ADMIN TABS - Card grid layout
       -------------------------------------- */
    .admin-tabs {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
        overflow: visible !important;
        flex-wrap: unset !important;
        border-bottom: none !important;
    }
    
    .admin-tab {
        flex: unset;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 14px 8px !important;
        font-size: 11px !important;
        gap: 6px !important;
        text-align: center;
        background: var(--bg-card, #fff);
        border-radius: 10px;
        border-bottom: none !important;
        margin-bottom: 0 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        white-space: normal !important;
        overflow: visible !important;
        min-width: 0;
    }

    .admin-tab.active {
        background: var(--primary-light, #e8f0fe) !important;
        color: var(--primary) !important;
        border-bottom-color: transparent !important;
        box-shadow: 0 0 0 2px var(--primary) !important;
    }
    
    .admin-tab i {
        font-size: 20px;
    }
    
    /* Users toolbar - stack on mobile */
    .users-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: var(--mobile-gap, 8px) !important;
    }
    
    .users-toolbar .search-box {
        min-width: 100% !important;
        max-width: 100% !important;
    }
    
    .users-toolbar .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Filter chips - horizontal scroll */
    .filter-chips {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    
    .filter-chips::-webkit-scrollbar {
        display: none;
    }
    
    .chip {
        flex-shrink: 0;
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    /* Info box compact */
    .info-box {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    .info-box-roles .role-desc {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    /* --------------------------------------
       CLIENT LIST - Single column grid
       -------------------------------------- */
    .client-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--mobile-gap, 8px) !important;
    }
    
    .client-card {
        border-radius: 12px;
    }
    
    .client-card-header {
        gap: var(--mobile-gap, 8px);
        margin-bottom: var(--mobile-gap, 8px);
    }
    
    .client-card-header h3 {
        font-size: 15px;
    }
    
    .client-industry {
        font-size: 12px;
    }
    
    .client-score-badge {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .client-card-meta {
        font-size: 12px;
        gap: 4px;
    }
    
    .client-card-screenshot {
        height: 100px;
    }
    
    .btn-delete-card {
        opacity: 1;
        padding: 4px 6px;
        font-size: 12px;
    }
    
    /* --------------------------------------
       ANALYTICS VIEW - Stack stats
       -------------------------------------- */
    .stats-row {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--mobile-gap, 8px) !important;
    }
    
    .stat-card .card-body {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    .stat-value {
        font-size: 24px !important;
    }
    
    .stat-label {
        font-size: 12px !important;
    }
    
    .analytics-article {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: var(--mobile-gap, 8px) 0;
    }
    
    .article-stats {
        font-size: 12px;
    }
    
    /* --------------------------------------
       TEMPLATE LIBRARY - Single column
       -------------------------------------- */
    .templates-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--mobile-gap, 8px) !important;
    }
    
    .template-card {
        border-radius: 12px;
    }
    
    .template-title {
        font-size: 15px !important;
    }
    
    .template-preview {
        font-size: 12px !important;
        max-height: 60px;
    }
    
    .template-actions {
        gap: 4px;
    }
    
    /* --------------------------------------
       STALE ARTICLES - Card layout
       -------------------------------------- */
    .action-buttons {
        flex-wrap: wrap;
        gap: 4px !important;
    }
    
    .action-buttons .btn {
        flex: 1;
        min-width: 80px;
        justify-content: center;
    }
    
    .article-excerpt {
        max-width: 100% !important;
    }
    
    .word-count {
        font-size: 10px !important;
        padding: 2px 6px !important;
    }
    
    .sync-time {
        font-size: 11px !important;
    }
    
    /* Pagination compact */
    .pagination {
        flex-wrap: wrap;
        gap: var(--mobile-gap, 8px) !important;
    }
    
    .pagination-info {
        font-size: 11px !important;
        width: 100%;
        text-align: center;
    }
    
    /* --------------------------------------
       PROMPT SETTINGS - Mobile tabs
       -------------------------------------- */
    .category-tabs {
        display: flex !important;
        gap: 2px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap !important;
        margin-bottom: var(--mobile-edge, 12px) !important;
    }
    
    .category-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .category-tab {
        flex-shrink: 0;
        padding: 8px 12px !important;
        font-size: 11px !important;
        gap: 4px !important;
        flex-direction: column;
        align-items: center;
        min-width: 60px;
    }
    
    .category-tab i {
        font-size: 14px;
    }
    
    .category-tab .badge {
        font-size: 9px !important;
        padding: 1px 4px !important;
    }
    
    .prompts-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: var(--mobile-gap, 8px) !important;
    }
    
    .prompt-card {
        border-radius: 12px !important;
    }
    
    .prompt-card-header {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    .prompt-card-title h3 {
        font-size: 14px !important;
    }
    
    .prompt-card-description {
        font-size: 12px !important;
        padding: 0 var(--mobile-edge, 12px) var(--mobile-edge, 12px) !important;
    }
    
    .prompt-card-body {
        padding: var(--mobile-edge, 12px) !important;
    }
    
    .prompt-textarea {
        font-size: 12px !important;
        min-height: 200px;
    }
    
    .variable-tag {
        font-size: 10px !important;
        padding: 2px 6px !important;
    }
    
    /* --------------------------------------
       PROFILE VIEW - Compact layout
       -------------------------------------- */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: var(--mobile-edge, 12px);
    }
    
    .profile-header .avatar {
        margin: 0 auto;
    }
    
    .profile-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--mobile-gap, 8px);
    }
    
    .profile-stat {
        min-width: 80px;
    }
    
    /* --------------------------------------
       PAGE HEADER - Mobile friendly
       -------------------------------------- */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: var(--mobile-gap, 8px) !important;
    }
    
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .page-header .form-group {
        width: 100%;
    }
    
    .page-header .form-select {
        width: 100%;
    }
    
    /* --------------------------------------
       FILTER ROWS - Stack vertically
       -------------------------------------- */
    .card-body[style*="display: flex"][style*="gap"] {
        flex-direction: column !important;
    }
    
    .card-body .form-group[style*="flex: 1"] {
        min-width: 100% !important;
    }
}

/* ============================================
   EXTRA SMALL SCREENS (< 400px)
   Tighter spacing: 8px edges
   ============================================ */
@media (max-width: 400px) {
    :root {
        --mobile-edge: 8px;
        --mobile-gap: 6px;
    }
    
    .app-main {
        padding: var(--mobile-edge, 8px) !important;
        padding-bottom: 60px !important;
    }
    
    .bc-header {
        padding: 0 var(--mobile-edge, 8px);
    }
    
    .bc-bottom-nav {
        padding-left: var(--mobile-edge, 8px);
        padding-right: var(--mobile-edge, 8px);
        height: 52px;
    }
    
    .card-body {
        padding: var(--mobile-edge, 8px) !important;
    }
    
    .page-title {
        font-size: 16px !important;
    }
    
    .btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .article-title {
        font-size: 13px !important;
    }
    
    .article-meta {
        font-size: 10px;
    }
    
    /* Hide credits text, show only icon */
    .bc-credits-display span {
        display: none;
    }
    
    .bc-credits-display {
        padding: 4px;
    }
}

/* ============================================
   REFINED MOBILE RULES
   Targeted, non-destructive mobile overrides
   ============================================ */
@media (max-width: 768px) {

    /* ── Z-INDEX STACK ── */
    .bc-bottom-nav { z-index: 10000 !important; }
    .bc-bottom-submenu { z-index: 10001 !important; }
    .bc-submenu-overlay { z-index: 9999 !important; }
    .bc-modal-overlay { z-index: 10002 !important; }
    .bc-modal { z-index: 10003 !important; }
    .toast, .notification { z-index: 10004 !important; }

    /* ── OVERFLOW PREVENTION ── */
    html, body {
        overflow-x: hidden !important;
    }

    img, video, iframe, embed, object {
        max-width: 100% !important;
        height: auto !important;
    }

    pre, code {
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        overflow-x: auto !important;
    }

    /* Long text handling */
    a, p, td, th, li {
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* ── TABS: Horizontal scroll by default ──
       Note: Component-level scoped styles (e.g. ClientDetailView)
       may override these with their own grid/flex layouts */
    .nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 2px;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tabs .tab {
        flex: 0 0 auto;
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
        border-radius: 8px;
    }

    /* ── FORM INPUTS: Touch-friendly sizing ── */
    .form-input,
    .form-select,
    .form-textarea {
        min-height: 44px;
        font-size: 16px !important; /* Prevents iOS zoom */
    }

    /* ── BUTTONS: Touch targets ── */
    .btn {
        min-height: 40px;
    }

    /* Small/xs buttons keep compact size */
    .btn-xs,
    .btn-sm,
    .btn-icon,
    .btn-icon-only,
    .btn-ghost.btn-sm {
        min-height: 32px !important;
        padding: 4px 8px !important;
    }

    .btn-icon,
    .btn-icon-only {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        padding: 0 !important;
    }

    /* Full-width buttons in form/action contexts */
    .form-actions .btn,
    .bc-modal-footer .btn,
    .page-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* ── DASHBOARD: Hero section ── */
    .dashboard-container {
        padding: var(--mobile-edge, 12px) !important;
    }

    .dashboard-hero-minimal {
        padding: 14px 16px !important;
    }

    .hero-content {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .start-here-link {
        width: 100%;
        justify-content: center;
    }

    .promo-workflow {
        margin-bottom: var(--space-md);
    }

    .promo-title {
        font-size: 16px !important;
        margin-bottom: var(--space-sm);
    }

    .ct-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .ct-card {
        padding: 12px !important;
    }

    .ct-card-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }

    .ct-card-info h3 {
        font-size: 14px !important;
    }

    .ct-card-info p {
        font-size: 12px !important;
        -webkit-line-clamp: 1 !important;
    }

    /* ── ARTICLE CARDS: Mobile grid ── */
    .article-card-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    .article-card-actions .btn-xs,
    .article-card-actions .btn-icon-only {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }

    .article-stats-row {
        flex-wrap: wrap;
        gap: 4px !important;
    }

    /* ── WIZARD: Stats panel ── */
    .stats-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .stat-card-value {
        font-size: 1.2rem !important;
    }

    .stats-seo-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .article-stats-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px;
        padding: 8px 12px !important;
    }

    /* ── WIZARD: Article preview header ── */
    .article-preview-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        padding: 12px !important;
    }

    .article-preview-header h2 {
        font-size: 1.1rem !important;
        line-height: 1.3;
    }

    .article-preview-header > div {
        width: 100%;
        flex-wrap: wrap !important;
    }

    .copy-article-dropdown {
        width: 100%;
        flex-wrap: wrap !important;
    }

    /* ── WIZARD: Featured Image form ── */
    .fi-controls-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .fi-persona-select {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px;
    }

    .fi-persona-select select {
        min-width: 100% !important;
        width: 100% !important;
    }

    .fi-prompt-input {
        font-size: 14px !important;
    }

    .fi-action-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .fi-action-row .btn {
        width: 100% !important;
        justify-content: center;
    }

    .fi-hint {
        text-align: center;
    }

    /* ── WIZARD: Actions & banner ── */
    .wizard-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .wizard-actions .btn {
        width: 100% !important;
        justify-content: center;
    }

    .step-next-banner {
        flex-direction: column !important;
        gap: 8px;
        text-align: center;
    }

    /* ── WIZARD: Schema panels ── */
    .schema-panel-header {
        flex-wrap: wrap !important;
        gap: 4px 8px !important;
        padding: 10px 12px !important;
    }

    .schema-panel-header h4 {
        font-size: 0.85rem !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        flex-wrap: wrap !important;
        row-gap: 4px !important;
        column-gap: 6px !important;
    }

    .schema-panel-header h4 .badge,
    .schema-panel-header .credit-cost-badge {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 0.65rem !important;
        padding: 2px 6px !important;
    }

    .featured-image-body {
        padding: 12px !important;
    }

    /* ── WIZARD: Published links ── */
    .published-link-input-row {
        flex-direction: column !important;
        gap: 6px;
    }

    .published-link-input-row .form-input {
        width: 100% !important;
    }

    /* ── WIZARD: Share link row ── */
    .share-link-row {
        flex-wrap: wrap !important;
        flex-direction: row !important;
    }

    .share-link-row .form-input {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        font-size: 13px !important;
    }

    .share-link-row .btn-outline {
        flex-shrink: 0 !important;
    }

    .share-link-row .btn-primary {
        width: 100% !important;
        justify-content: center;
    }

    .share-link-box {
        padding: 12px !important;
    }

    /* ── WIZARD: WordPress publish buttons ── */
    .wp-buttons {
        display: flex !important;
        gap: 8px !important;
    }

    .wp-buttons .btn {
        flex: 1 1 0 !important;
        white-space: nowrap !important;
        font-size: 0.85rem !important;
        padding: 8px 4px !important;
        justify-content: center !important;
    }

    /* ── CLIENT DETAIL: General form rows ── */
    /* Note: .profile-grid, .header-actions, .tab-nav handled by
       scoped styles in ClientDetailView.vue */

    .form-row {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .form-row .form-group {
        width: 100%;
        min-width: 0;
    }

    /* Score details */
    .score-details-panel {
        padding: var(--mobile-edge, 12px);
    }

    .score-details-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-sm);
    }

    /* ── PROFILE VIEW ── */
    .profile-view {
        padding: 0;
    }

    .api-key-display {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .api-key-display code {
        font-size: 0.75rem;
    }

    .info-row {
        flex-direction: column;
        gap: 2px;
    }

    /* ── ARTICLE EDITOR ── */
    .editor-topbar {
        padding: 6px 10px !important;
        gap: 4px !important;
    }

    .editor-topbar-left {
        min-width: 0 !important;
        flex: 1;
    }

    .editor-topbar-name {
        max-width: 120px !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .editor-topbar-actions {
        gap: 3px !important;
    }

    .editor-topbar-actions .btn {
        padding: 6px 8px !important;
        font-size: 12px !important;
        min-height: 32px !important;
    }

    .editor-topbar-actions .hide-mobile {
        display: none !important;
    }

    .editor-body {
        flex-direction: column !important;
    }

    .editor-main {
        padding: var(--mobile-edge, 12px) !important;
    }

    /* Editor sidebar mobile handled by scoped styles in ArticleEditorView */

    .ai-quick-prompts {
        gap: 4px !important;
    }

    .ai-quick-btn {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }

    /* ── INLINE STYLE OVERRIDES ──
       Override common inline flex patterns used in Vue components */
    .page-header-title[style],
    .header-actions[style],
    [style*="display:flex"][style*="gap:8px"],
    [style*="display: flex"][style*="gap: 8px"] {
        flex-wrap: wrap !important;
    }

    /* ── LANDING PAGES ── */
    .lp-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── PERSONA / AUTHOR GRIDS ── */
    .personas-grid,
    .authors-grid {
        grid-template-columns: 1fr !important;
        gap: var(--mobile-gap, 8px) !important;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── CARD HEADER: Inline buttons wrap ── */
    .card-header[style*="display: flex"],
    .card-header[style*="display:flex"] {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* ── COMPETITOR ADD FORM ── */
    .competitor-add-form[style*="display: flex"],
    .competitor-add-form[style*="display:flex"] {
        flex-direction: column !important;
    }
}
