/* =========================================================================
   GuinRank V7 — YouTube Dead Video Recovery & Algorithmic Resuscitation Engine
   File: wwwroot/style/pages/youtube/dead-recovery.css
   Standards: Canonical YouTube Suite Architecture (_agent/YOUTUBE.md)
   Zero-Regression Engineering Standards:
     1. Strict :root theme variables (Zero hardcoded colors)
     2. Dropup Pagination Footer (.crd-menu with bottom: calc(100% + 8px) !important)
     3. In-Row Miniature ApexCharts Sparklines & Microscopic Glass Tooltip (.gr-spark-pill)
     4. Zero-Scroll Trap Modals (Root-level, dual programmatic locks on html/body)
     5. Strict Lucide icon sizing targeting both i and svg
     6. Bento dashed ring rotation on hover (.dashed-ring-wrapper)
   ========================================================================= */

#dead-recovery-app {
    width: 100%;
    position: relative;
}

.dead-recovery-container {
    position: relative;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 20px 80px;
    font-family: inherit;
    transition: max-width 0.3s ease;
}

.dead-recovery-container.is-wide-mode {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: clamp(12px, 2vw, 36px) !important;
    padding-right: clamp(12px, 2vw, 36px) !important;
}

.dead-recovery-container.is-wide-mode .cra-data-wrapper,
.dead-recovery-container.is-wide-mode .dvr-search-section,
.dead-recovery-container.is-wide-mode .console-features,
.dead-recovery-container.is-wide-mode .cra-channel-banner,
.dead-recovery-container.is-wide-mode .cra-kpi-grid,
.dead-recovery-container.is-wide-mode .cra-chart-card,
.dead-recovery-container.is-wide-mode .cra-command-hub,
.dead-recovery-container.is-wide-mode .cra-table-section,
.dead-recovery-container.is-wide-mode .table-card,
.dead-recovery-container.is-wide-mode .table-responsive-wrapper,
.dead-recovery-container.is-wide-mode .car-table-quantum,
.dead-recovery-container.is-wide-mode .video-cards-grid {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.dead-recovery-container.is-wide-mode .col-title,
.dead-recovery-container.is-wide-mode .quantum-video-cell {
    max-width: 480px !important;
}

.dead-recovery-container.is-wide-mode .col-rec,
.dead-recovery-container.is-wide-mode .action-plan-pill {
    max-width: 440px !important;
}

.dead-recovery-container.rtl {
    direction: rtl;
    text-align: right;
}

.dead-recovery-container.ltr {
    direction: ltr;
    text-align: left;
}

[v-cloak] {
    display: none !important;
}

/* Strict Lucide Containment Standard */
#dead-recovery-app svg.lucide,
.dead-recovery-container svg.lucide {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* --- Ambient Glow --- */
.hero-ambient-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 380px;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary-color) 15%, transparent) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(50px);
}

/* --- Top Compliance Micro Badge --- */
.hero-compliance-row {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
    position: relative;
    z-index: 2;
}

.yt-compliance-micro-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    background: var(--bg-body, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.yt-compliance-micro-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.yt-compliance-micro-pill i,
.yt-compliance-micro-pill svg {
    width: 13px !important;
    height: 13px !important;
    color: var(--primary-color);
}

.micro-info-icon {
    opacity: 0.6;
}

/* --- Presentation Hero (console-hero) --- */
.console-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 860px;
    margin: 0 auto 32px;
    padding-top: 6px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--primary-color);
    margin-bottom: 18px;
}

.hero-badge i,
.hero-badge svg {
    width: 14px !important;
    height: 14px !important;
}

.hero-title {
    font-size: 38px;
    font-weight: 900;
    line-height: 1.25;
    color: var(--text-main);
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.hero-title em,
.hero-title .gradient-text,
.gradient-text {
    font-style: normal;
    background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 65%, var(--blue, #25aff4)));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-description {
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0 auto 28px;
    max-width: 760px;
    font-weight: 500;
}

/* Hero Features Belt (Canonical Master Suite Standard) */
.hero-features-belt {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 auto;
}

.hfb-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hfb-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    color: var(--primary-color);
}

.hfb-icon {
    width: 15px !important;
    height: 15px !important;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* --- UNIFIED SEARCH BAR (4 Segments) --- */
.unified-search-container {
    position: relative;
    z-index: 50;
    max-width: 940px;
    margin: 0 auto 36px;
}

.unified-search-bar {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 8px 6px 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.dead-recovery-container.rtl .unified-search-bar {
    padding: 6px 14px 6px 8px;
}

.unified-search-container.is-focused .unified-search-bar,
.unified-search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color) 15%, transparent), var(--shadow-md, 0 8px 24px rgba(0,0,0,0.08));
}

.search-segment {
    display: flex;
    align-items: center;
    position: relative;
}

.search-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 10px;
    flex-shrink: 0;
}

/* Channel Segment */
.dropdown-segment {
    cursor: pointer;
    user-select: none;
}

.segment-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.dropdown-segment:hover .segment-content {
    background: color-mix(in srgb, var(--primary-color) 6%, transparent);
}

.channel-avatar-sm {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border-color);
    flex-shrink: 0;
}

.channel-meta-inline {
    display: flex;
    flex-direction: column;
    max-width: 140px;
    line-height: 1.2;
}

.segment-text {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-handle-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chevron-icon {
    width: 14px !important;
    height: 14px !important;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.dropdown-segment.is-open .chevron-icon {
    transform: rotate(180deg);
}

/* Dropdown Glass Menu */
.segment-dropdown.glass-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    min-width: 280px;
    background: color-mix(in srgb, var(--card-bg) 95%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
    padding: 10px;
    z-index: 120;
    animation: menuFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dead-recovery-container.rtl .segment-dropdown.glass-menu {
    left: auto;
    right: 0;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding: 6px 10px 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}

.dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.dropdown-item:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
    color: var(--primary-color);
}

.dropdown-item.selected {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
    font-weight: 800;
}

.dropdown-item .check-icon {
    width: 14px !important;
    height: 14px !important;
    margin-inline-start: auto;
    color: var(--primary-color);
}

.dropdown-empty-item {
    font-size: 12px;
    color: var(--text-muted);
    justify-content: center;
    cursor: default;
    padding: 10px;
}

.dropdown-add-channel {
    border-top: 1px dashed var(--border-color);
    margin-top: 6px;
    padding-top: 8px;
}

.add-channel-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    width: 100%;
}

/* Range Segment */
.range-segment {
    min-width: 130px;
}

.range-icon {
    width: 15px !important;
    height: 15px !important;
    color: var(--text-muted);
}

/* Input Segment */
.input-segment {
    flex: 1;
    min-width: 220px;
    gap: 8px;
}

.search-icon {
    width: 16px !important;
    height: 16px !important;
    color: var(--text-muted);
}

.unified-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text-main);
    padding: 6px 0;
}

.unified-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.sync-btn {
    border: none;
    background: var(--bg-body);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sync-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
}

.input-clear-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
}

.input-clear-btn:hover {
    color: var(--text-main);
}

/* Action Segment */
.action-segment {
    gap: 10px;
}

.count-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--primary-color);
    white-space: nowrap;
}

.cc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
}

.cc-icon {
    width: 12px !important;
    height: 12px !important;
}

.round-search-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-color) 40%, transparent);
    flex-shrink: 0;
}

.round-search-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: color-mix(in srgb, var(--primary-color) 88%, #000);
}

.round-search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.arrow-icon {
    width: 18px !important;
    height: 18px !important;
}

.dead-recovery-container.rtl .arrow-icon {
    transform: rotate(180deg);
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
}

.btn-spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
    display: inline-block;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* --- 4. FETCHING PROGRESS OVERLAY --- */
.car-fetching-overlay {
    max-width: 940px;
    margin: -16px auto 32px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 20px;
    box-shadow: var(--shadow-sm);
}

.car-fetching-header {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.car-progress-bg {
    width: 100%;
    height: 6px;
    background: var(--bg-body);
    border-radius: 999px;
    overflow: hidden;
}

.car-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--blue, #25aff4));
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* --- 5. STANDARD 6 BENTO FEATURES CLUSTERS (console-features) --- */
.console-features {
    position: relative;
    z-index: 1;
    margin: 0 auto 48px;
    max-width: 1200px;
}

.bento-features-cluster {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.bento-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

/* Bento Layout Modifiers */
.bento-card.bc-wide-top {
    grid-column: span 2;
}

.bento-card.bc-tall {
    grid-row: span 2;
}

.bento-card.bc-wide-mid {
    grid-column: span 2;
}

/* Bento Dashed Ring Container Standard */
.dashed-ring-wrapper {
    position: relative;
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashed-ring-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed color-mix(in srgb, var(--primary-color) 35%, transparent);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.bento-card:hover .dashed-ring-wrapper::before {
    transform: rotate(180deg);
    border-color: var(--primary-color);
}

.bc-icon-wrapper {
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.bento-card:hover .bc-icon-wrapper {
    transform: scale(1.08);
}

.bc-icon-wrapper i,
.bc-icon-wrapper svg {
    width: 22px !important;
    height: 22px !important;
}

.bc-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 8px;
    line-height: 1.35;
}

.bc-desc {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

/* Watermark Decorative Icons */
.bento-decor-icon {
    position: absolute;
    bottom: -15px;
    right: -15px;
    font-size: 90px;
    color: color-mix(in srgb, var(--primary-color) 5%, transparent);
    pointer-events: none;
    z-index: 0;
    line-height: 1;
}

.dead-recovery-container.rtl .bento-decor-icon {
    right: auto;
    left: -15px;
}

.bento-decor-icon i,
.bento-decor-icon svg {
    width: 100px !important;
    height: 100px !important;
}

/* 6 Bento Animations */
.anim-pulse { animation: bentoPulse 4s ease-in-out infinite; }
.anim-spin { animation: bentoSpinSlow 24s linear infinite; }
.anim-tilt { animation: bentoTilt 6s ease-in-out infinite; }
.anim-float { animation: bentoFloat 5s ease-in-out infinite; }
.anim-bounce { animation: bentoBounce 4s ease-in-out infinite; }
.anim-glow { animation: bentoGlow 4s ease-in-out infinite; }

@keyframes bentoPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

@keyframes bentoSpinSlow {
    to { transform: rotate(360deg); }
}

@keyframes bentoTilt {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(8deg); }
}

@keyframes bentoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes bentoBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes bentoGlow {
    0%, 100% { filter: drop-shadow(0 0 0 transparent); }
    50% { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--primary-color) 30%, transparent)); }
}

/* --- 6. ACTIVE DATA RESULTS WRAPPER --- */
.cra-data-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Channel Header Banner */
.cra-channel-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.channel-info-box {
    display: flex;
    align-items: center;
    gap: 18px;
}

.channel-banner-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.channel-banner-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.channel-name-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.channel-banner-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
}

.audit-success-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--success, #22c55e) 12%, transparent);
    color: var(--success, #22c55e);
    font-size: 11.5px;
    font-weight: 800;
}

.audit-success-pill i,
.audit-success-pill svg {
    width: 13px !important;
    height: 13px !important;
}

.channel-sub-details {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.channel-handle-tag {
    font-family: monospace;
    font-weight: 700;
    color: var(--primary-color);
}

.dot-separator {
    opacity: 0.5;
}

/* Resuscitation Score Circle */
.freshness-banner-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 20px;
}

.freshness-score-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    border: 3px solid var(--primary-color);
    line-height: 1;
}

.freshness-score-circle.circle-high {
    border-color: var(--success, #22c55e);
    color: var(--success, #22c55e);
    background: color-mix(in srgb, var(--success, #22c55e) 12%, transparent);
}

.freshness-score-circle.circle-mid {
    border-color: var(--warning, #f59e0b);
    color: var(--warning, #f59e0b);
    background: color-mix(in srgb, var(--warning, #f59e0b) 12%, transparent);
}

.freshness-score-circle.circle-urgent {
    border-color: var(--danger, #ef4444);
    color: var(--danger, #ef4444);
    background: color-mix(in srgb, var(--danger, #ef4444) 12%, transparent);
}

.score-number {
    font-size: 20px;
    font-weight: 900;
}

.score-max {
    font-size: 10px;
    opacity: 0.7;
    font-weight: 700;
}

.freshness-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 240px;
}

.freshness-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.freshness-status-text {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
}

/* --- Executive KPIs Grid --- */
.cra-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.kpi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon i,
.kpi-icon svg {
    width: 18px !important;
    height: 18px !important;
}

.icon-urgent {
    background: color-mix(in srgb, var(--danger, #ef4444) 14%, transparent);
    color: var(--danger, #ef4444);
}

.icon-golden {
    background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
    color: var(--warning, #f59e0b);
}

.icon-lift {
    background: color-mix(in srgb, var(--success, #22c55e) 14%, transparent);
    color: var(--success, #22c55e);
}

.icon-calendar {
    background: color-mix(in srgb, var(--primary-color) 14%, transparent);
    color: var(--primary-color);
}

.kpi-tag {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}

.tag-urgent {
    background: color-mix(in srgb, var(--danger, #ef4444) 10%, transparent);
    color: var(--danger, #ef4444);
}

.tag-golden {
    background: color-mix(in srgb, var(--warning, #f59e0b) 10%, transparent);
    color: var(--warning, #f59e0b);
}

.tag-lift {
    background: color-mix(in srgb, var(--success, #22c55e) 10%, transparent);
    color: var(--success, #22c55e);
}

.tag-calendar {
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    color: var(--primary-color);
}

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.kpi-main-number {
    font-size: 30px;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}

.kpi-sub-unit {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.kpi-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 6px;
}

.kpi-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

/* --- ApexCharts Analytics Section --- */
.cra-charts-section {
    position: relative;
}

.chart-card-full {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-icon i,
.chart-icon svg {
    width: 20px !important;
    height: 20px !important;
}

.chart-main-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 2px;
}

.chart-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0;
}

.chart-legend-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-red { background: var(--danger, #ef4444); }
.dot-green { background: var(--success, #22c55e); }

.chart-render-stage {
    min-height: 280px;
    width: 100%;
}

.chart-insight-box {
    margin-top: 18px;
    padding: 14px 18px;
    background: color-mix(in srgb, var(--primary-color) 6%, transparent);
    border: 1px dashed color-mix(in srgb, var(--primary-color) 25%, transparent);
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.insight-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.insight-text {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.55;
}

.insight-text strong {
    color: var(--primary-color);
    margin-inline-end: 4px;
}

/* --- Studio Master Command Hub --- */
.cra-command-hub {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}

.hub-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hub-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hub-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hub-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.hub-counter-pill {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.hub-actions-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Hub Search Box */
.hub-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px 12px;
    min-width: 200px;
}

.hub-search-icon {
    width: 14px !important;
    height: 14px !important;
    color: var(--text-muted);
}

.hub-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 12.5px;
    color: var(--text-main);
    font-family: inherit;
    width: 100%;
}

.hub-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.hub-clear-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
}

/* Glass Buttons & Dropdowns */
.hub-dropdown-wrap {
    position: relative;
}

.hub-btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hub-btn-glass:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.hub-btn-glass i,
.hub-btn-glass svg {
    width: 14px !important;
    height: 14px !important;
}

.hub-chevron {
    width: 12px !important;
    height: 12px !important;
    opacity: 0.6;
}

.hub-glass-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: color-mix(in srgb, var(--card-bg) 96%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
    padding: 6px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dead-recovery-container.rtl .hub-glass-menu {
    right: auto;
    left: 0;
}

.hub-glass-menu .menu-item {
    border: none;
    background: transparent;
    text-align: left;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}

.dead-recovery-container.rtl .hub-glass-menu .menu-item {
    text-align: right;
}

.hub-glass-menu .menu-item:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
    color: var(--primary-color);
}

.hub-glass-menu .menu-item.active {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
    font-weight: 800;
}

/* View Switcher */
.hub-view-switcher {
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.view-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 5px 8px;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.view-btn:hover {
    color: var(--text-main);
}

.view-btn.active {
    background: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.view-btn i,
.view-btn svg {
    width: 15px !important;
    height: 15px !important;
}

/* --- QUANTUM TABLE SECTION --- */
.cra-table-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-responsive-quantum {
    width: 100%;
    overflow-x: auto;
}

.car-table-quantum {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.dead-recovery-container.rtl .car-table-quantum {
    text-align: right;
}

.car-table-quantum thead tr {
    background: var(--bg-body);
    border-bottom: 2px solid var(--border-color);
}

.car-table-quantum th {
    padding: 14px 16px;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.car-table-quantum tbody tr.quantum-row {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s ease;
}

.car-table-quantum tbody tr.quantum-row:hover {
    background: color-mix(in srgb, var(--primary-color) 4%, transparent);
}

.car-table-quantum td {
    padding: 16px;
    vertical-align: top;
}

.td-index {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    width: 40px;
}

/* Video Cell */
.quantum-video-cell {
    display: flex;
    gap: 12px;
    max-width: 290px;
}

.thumb-wrapper {
    position: relative;
    width: 80px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--border-color);
}

.quantum-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(80%) opacity(0.85);
    transition: filter 0.2s ease;
}

.quantum-row:hover .quantum-thumb {
    filter: grayscale(0%) opacity(1);
}

.thumb-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.thumb-wrapper:hover .thumb-play-overlay {
    opacity: 1;
}

.video-info-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.video-title-line {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta-subline {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-dot {
    opacity: 0.5;
}

/* Flatline Status Cell */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-flatline {
    background: color-mix(in srgb, var(--danger, #ef4444) 12%, transparent);
    color: var(--danger, #ef4444);
    border: 1px solid color-mix(in srgb, var(--danger, #ef4444) 25%, transparent);
}
.badge-flatline .status-dot { background: var(--danger, #ef4444); }

.badge-slump {
    background: color-mix(in srgb, var(--warning, #f59e0b) 12%, transparent);
    color: var(--warning, #f59e0b);
    border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 25%, transparent);
}
.badge-slump .status-dot { background: var(--warning, #f59e0b); }

.badge-gem {
    background: color-mix(in srgb, var(--success, #22c55e) 12%, transparent);
    color: var(--success, #22c55e);
    border: 1px solid color-mix(in srgb, var(--success, #22c55e) 25%, transparent);
}
.badge-gem .status-dot { background: var(--success, #22c55e); }

.flatline-subtext {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 600;
}

.flatline-clock-icon {
    width: 12px !important;
    height: 12px !important;
}

/* Velocity & In-Row Sparkline Cell */
.velocity-box {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

.velocity-num {
    font-size: 14px;
    font-weight: 900;
    color: var(--text-main);
}

.velocity-unit {
    font-size: 10.5px;
    color: var(--text-muted);
}

.sparkline-wrapper {
    width: 110px;
    height: 28px;
}

.inrow-sparkline {
    width: 100%;
    height: 100%;
}

/* Resuscitation Score Cell */
.score-pill-box {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 900;
    line-height: 1;
}

.score-pill-box.score-high {
    background: color-mix(in srgb, var(--success, #22c55e) 14%, transparent);
    color: var(--success, #22c55e);
}

.score-pill-box.score-mid {
    background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
    color: var(--warning, #f59e0b);
}

.score-pill-box.score-urgent {
    background: color-mix(in srgb, var(--danger, #ef4444) 14%, transparent);
    color: var(--danger, #ef4444);
}

.score-val {
    font-size: 15px;
}

.score-scale {
    font-size: 10px;
    opacity: 0.7;
}

.lift-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 800;
    color: var(--success, #22c55e);
    margin-top: 4px;
}

.lift-badge i,
.lift-badge svg {
    width: 11px !important;
    height: 11px !important;
}

/* 3-Pillar Blueprint Cell */
.blueprint-summary-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 320px;
    max-width: 440px;
}

.pillar-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 9px;
}

.pillar-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pillar-badge {
    font-size: 9.5px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
    color: #fff;
    line-height: 1.2;
}

.p-badge-1 { background: var(--primary-color); }
.p-badge-2 { background: var(--warning, #f59e0b); }
.p-badge-3 { background: var(--blue, #25aff4); }

.pillar-name {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--text-muted);
}

.pillar-content-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pillar-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-copy-micro {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-copy-micro:hover {
    color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
}

.btn-copy-micro i,
.btn-copy-micro svg {
    width: 13px !important;
    height: 13px !important;
}

.copied-badge {
    color: var(--success, #22c55e);
}

/* Action Cell */
.btn-open-blueprint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 70%, var(--blue, #25aff4)));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color) 30%, transparent);
}

.btn-open-blueprint:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary-color) 45%, transparent);
}

.btn-open-blueprint i,
.btn-open-blueprint svg {
    width: 14px !important;
    height: 14px !important;
}

/* --- STUDIO CARDS ALTERNATIVE VIEW --- */
.cra-cards-section {
    position: relative;
}

.studio-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.studio-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}

.studio-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.card-thumb-header {
    position: relative;
    width: 100%;
    height: 160px;
    background: var(--border-color);
}

.card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-status-pill {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}

.dead-recovery-container.rtl .card-status-pill {
    left: auto;
    right: 12px;
}

.card-score-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
}

.dead-recovery-container.rtl .card-score-badge {
    right: auto;
    left: 12px;
}

.card-score-badge.score-high {
    background: var(--success, #22c55e);
    color: #fff;
}
.card-score-badge.score-mid {
    background: var(--warning, #f59e0b);
    color: #fff;
}
.card-score-badge.score-urgent {
    background: var(--danger, #ef4444);
    color: #fff;
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.card-video-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-metrics-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.card-blueprint-snippet {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
}

.snippet-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-color);
}

.snippet-tag.tag-piggy {
    color: var(--blue, #25aff4);
}

.snippet-title-text,
.snippet-anchor-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    margin: 2px 0 0;
    line-height: 1.35;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-body);
}

.btn-card-action {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-card-action:hover {
    filter: brightness(1.1);
}

/* --- LOAD MORE & DROPUP PAGINATION --- */
.table-load-more-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.showing-counter {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.pagination-dropup-cluster {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* CRD-MENU DROPUP (STRICT SPECIFICATION) */
.crd-menu-wrapper {
    position: relative;
}

.crd-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.crd-trigger-btn:hover {
    border-color: var(--primary-color);
}

.crd-chevron {
    width: 14px !important;
    height: 14px !important;
}

.crd-menu.dropup {
    position: absolute !important;
    bottom: calc(100% + 8px) !important;
    top: auto !important;
    right: 0;
    min-width: 180px;
    background: color-mix(in srgb, var(--card-bg) 96%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 200;
}

.dead-recovery-container.rtl .crd-menu.dropup {
    right: auto;
    left: 0;
}

.crd-menu-header {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 4px 8px 6px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.crd-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
}

.crd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s ease;
}

.crd-item:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
    color: var(--primary-color);
}

.crd-item.selected {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
    font-weight: 800;
}

/* Subtle YouTube Legal Footer */
.yt-legal-compliance-footer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 20px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

.footer-legal-icon {
    width: 16px !important;
    height: 16px !important;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.yt-legal-compliance-footer p {
    margin: 0;
}

/* --- 7. ROOT-LEVEL ZERO-SCROLL TRAP MODALS (STRICT SPECIFICATION) --- */
/* Dual Programmatic Lock */
html.modal-open,
body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

.custom-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    margin: 0 !important;
    padding: 20px !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    animation: modalBackdropFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.custom-modal-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3) !important;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    animation: modalContentZoom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-card-sm {
    max-width: 580px;
}

.custom-modal-card-lg {
    max-width: 880px;
}

@keyframes modalContentZoom {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Fixed Header */
.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 28px 18px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
    flex-shrink: 0;
}

.modal-header-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-priority {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.priority-urgent {
    background: color-mix(in srgb, var(--danger, #ef4444) 14%, transparent);
    color: var(--danger, #ef4444);
}

.priority-score {
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
}

.priority-stable {
    background: color-mix(in srgb, var(--success, #22c55e) 14%, transparent);
    color: var(--success, #22c55e);
}

.priority-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.modal-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
}

.modal-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0;
}

.btn-close-modal {
    border: none;
    background: var(--bg-body);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-close-modal:hover {
    color: var(--text-main);
    background: color-mix(in srgb, var(--danger, #ef4444) 14%, transparent);
}

.btn-close-modal i,
.btn-close-modal svg {
    width: 16px !important;
    height: 16px !important;
}

/* Modal Navigation Tabs */
.modal-tabs-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 28px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    flex-shrink: 0;
}

.modal-tab {
    border: none;
    background: transparent;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.modal-tab:hover {
    color: var(--text-main);
}

.modal-tab.active {
    background: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Modal Body (Sole Scrollable Container) */
.custom-modal-body {
    padding: 24px 28px;
    overflow-y: auto !important;
    max-height: calc(85vh - 145px);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tab-pane {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: tabFadeIn 0.2s ease;
}

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

/* Modal Video Preview */
.modal-video-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
}

.modal-video-thumb {
    width: 100px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.modal-video-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.modal-current-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.4;
}

.modal-stats-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.mstat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.mstat-item i,
.mstat-item svg {
    width: 12px !important;
    height: 12px !important;
    color: var(--primary-color);
}

/* Modal Diagnosis Box */
.modal-diag-box {
    background: color-mix(in srgb, var(--danger, #ef4444) 8%, transparent);
    border: 1px dashed color-mix(in srgb, var(--danger, #ef4444) 30%, transparent);
    border-radius: 14px;
    padding: 16px;
}

.diag-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.diag-icon {
    width: 18px !important;
    height: 18px !important;
    color: var(--danger, #ef4444);
}

.diag-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--danger, #ef4444);
}

.diag-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-main);
    margin: 0;
}

/* 3 Pillars Overview Grid */
.pillars-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.pillar-summary-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.p-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.p-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.p-card-header h5 {
    font-size: 12.5px;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
}

.pillar-summary-card p {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

/* Diff Comparison Card */
.diff-comparison-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diff-box {
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.diff-original {
    background: var(--bg-body);
}

.diff-recommended {
    background: color-mix(in srgb, var(--success, #22c55e) 6%, transparent);
    border-color: color-mix(in srgb, var(--success, #22c55e) 30%, transparent);
}

.diff-rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.diff-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.diff-label.label-success {
    color: var(--success, #22c55e);
}

.diff-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.5;
}

.diff-text.diff-highlight {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
}

.diff-divider-arrow {
    display: flex;
    justify-content: center;
    color: var(--primary-color);
}

.diff-arrow-icon {
    width: 20px !important;
    height: 20px !important;
}

.btn-copy-diff,
.btn-copy-hook,
.btn-copy-strategy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-copy-diff:hover,
.btn-copy-hook:hover,
.btn-copy-strategy:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Thumbnail Hook Card */
.thumb-hook-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hook-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hook-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
    color: var(--warning, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hook-header h4 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.hook-description {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-main);
    margin: 0;
}

/* Piggyback Card */
.piggyback-modal-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.piggy-anchor-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.anchor-tag,
.strategy-tag {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--blue, #25aff4);
    letter-spacing: 0.04em;
}

.anchor-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.strategy-desc {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-main);
    margin: 0;
}

/* Execution Checklist */
.modal-checklist-wrapper {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.checklist-section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist-section-title i,
.checklist-section-title svg {
    color: var(--primary-color);
}

.checklist-items-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checklist-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
}

.check-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}

.check-step-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.check-step-content h6 {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.check-step-content p {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

/* Modal Footer */
.custom-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-copy-full-plan {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    color: var(--primary-color);
    border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy-full-plan:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-open-studio {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-open-studio:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-close-modal-main {
    padding: 9px 20px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-close-modal-main:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
}

/* Legal Modal Styling */
.legal-modal-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legal-paragraph-box {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
}

.legal-paragraph-box p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-main);
    margin: 0;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .bento-features-cluster {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-card.bc-wide-top,
    .bento-card.bc-wide-mid {
        grid-column: span 2;
    }
    .bento-card.bc-tall {
        grid-row: span 1;
    }
    .cra-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pillars-overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 28px;
    }
    .unified-search-bar {
        border-radius: 20px;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 10px;
    }
    .search-divider {
        display: none;
    }
    .bento-features-cluster {
        grid-template-columns: 1fr;
    }
    .bento-card.bc-wide-top,
    .bento-card.bc-wide-mid {
        grid-column: span 1;
    }
    .cra-channel-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .freshness-banner-card {
        width: 100%;
        justify-content: flex-start;
    }
    .cra-kpi-grid {
        grid-template-columns: 1fr;
    }
    .hub-header-row {
        flex-direction: column;
        align-items: stretch;
    }
    .hub-actions-cluster {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 24px;
    }
    .custom-modal-header,
    .custom-modal-body,
    .custom-modal-footer {
        padding: 16px;
    }
    .custom-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .custom-modal-footer button,
    .custom-modal-footer a {
        width: 100%;
        justify-content: center;
    }
}

