@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root[data-theme="dark"] {
    --bg-main: #0a0b10;
    --bg-sidebar: #0f111a;
    --bg-card: rgba(15, 23, 42, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --accent-primary: #6366f1;
    --accent-primary-rgb: 99, 102, 241;
    --accent-secondary: #a855f7;
    --text-main: #ffffff;
    --text-main-rgb: 255, 255, 255;
    --text-muted: #cbd5e1; /* Slate 200 - High legibility for dark mode */
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --transition-speed: 0.3s;
}

:root[data-theme="light"] {
    --bg-main: #ffffff;
    --bg-sidebar: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: #ffffff;
    --accent-primary: #6366f1;
    --accent-primary-rgb: 99, 102, 241;
    --accent-secondary: #a855f7;
    --text-main: #0f172a;
    --text-main-rgb: 15, 23, 42;
    --text-muted: #64748b;
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --transition-speed: 0.3s;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', 'Inter', sans-serif;
    margin: 0;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.text-main { color: var(--text-main) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-accent { color: var(--accent-primary) !important; }

/* Glassmorphism Utilities */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-hover:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.app-header {
    flex-shrink: 0;
    min-height: 68px;
}

.app-shell {
    display: flex;
    flex-direction: row;
    min-height: 0;
    height: calc(100vh - 68px);
    overflow: hidden;
}

.app-main {
    min-width: 0;
    overflow-y: auto;
    background-color: var(--bg-main);
    scroll-behavior: smooth;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    padding: 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-primary-rgb), 0.2) transparent;
    transition: width var(--transition-speed) ease, background-color 0.4s ease, border-color 0.4s ease;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-primary-rgb), 0.1);
    border-radius: 10px;
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-primary-rgb), 0.3);
}

.nav-link {
    color: var(--text-muted) !important;
    border-radius: 10px !important;
    padding: 0.62rem 0.85rem !important;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.nav-link:hover {
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.1) !important;
    color: var(--accent-primary) !important;
}

.nav-link.active {
    background: var(--accent-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb, 0, 72, 153), 0.2);
}

.nav-link i {
    font-size: 1.1rem;
}

.nav-link:hover i {
    transform: none;
}

#nav-promotionIssues-item {
    position: relative;
    margin: 0.2rem 0 0.45rem;
}

#nav-promotionIssues-item::before {
    content: "";
    position: absolute;
    inset: -0.15rem -0.25rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.08), rgba(168, 85, 247, 0.06));
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

#nav-promotionIssues-item:has(#promotionIssuesMenu.show)::before {
    opacity: 1;
}

#nav-promotionIssues {
    position: relative;
    border: 1px solid transparent;
}

#nav-promotionIssues::after {
    content: "";
    position: absolute;
    top: 0.6rem;
    right: 0.62rem;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

#nav-promotionIssues[aria-expanded="true"] {
    background: rgba(var(--accent-primary-rgb), 0.12) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.18);
    color: var(--accent-primary) !important;
}

#nav-promotionIssues .bi-chevron-down {
    color: var(--text-muted);
    margin-right: 0.9rem;
    transition: transform 0.18s ease, color 0.18s ease;
}

#nav-promotionIssues[aria-expanded="true"] .bi-chevron-down {
    color: var(--accent-primary);
    transform: rotate(180deg);
}

#promotionIssuesMenu {
    position: relative;
    margin-left: 1rem;
    padding: 0.35rem 0 0.2rem 0.8rem !important;
}

#promotionIssuesMenu::before {
    content: "";
    position: absolute;
    top: 0.35rem;
    bottom: 0.45rem;
    left: 0.16rem;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(var(--accent-primary-rgb), 0.55), rgba(245, 158, 11, 0.5));
}

#promotionIssuesMenu .nav-link {
    position: relative;
    margin-bottom: 0.35rem;
    padding: 0.55rem 0.75rem !important;
    border: 1px solid rgba(var(--text-main-rgb), 0.06);
    background: rgba(var(--text-main-rgb), 0.035);
    font-size: 0.84rem;
}

#promotionIssuesMenu .nav-link::before {
    content: "";
    position: absolute;
    left: -0.95rem;
    top: 50%;
    width: 0.7rem;
    height: 2px;
    border-radius: 999px;
    background: rgba(var(--accent-primary-rgb), 0.4);
}

#promotionIssuesMenu .nav-link:hover {
    background: rgba(var(--accent-primary-rgb), 0.12) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.2);
}

#promotionIssuesMenu .nav-link.active {
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6) !important;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(var(--accent-primary-rgb), 0.22);
}

#promotionIssuesMenu .nav-link i {
    width: 1.2rem;
    text-align: center;
    color: #f59e0b;
}

#promotionIssuesMenu .nav-link.active i {
    color: #ffffff;
}

:root[data-theme="light"] #nav-promotionIssues[aria-expanded="true"] {
    background: #eef2ff !important;
    box-shadow: inset 0 0 0 1px rgba(var(--accent-primary-rgb), 0.08);
}

:root[data-theme="light"] #promotionIssuesMenu .nav-link {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] #promotionIssuesMenu .nav-link:hover {
    background: #f8fafc !important;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

/* Cards */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.card-header {
    background: rgba(var(--text-main-rgb, 148, 163, 184), 0.05) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    padding: 1rem 1.25rem !important;
    font-weight: 600;
    color: var(--text-main);
}

/* Forms & Inputs */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    color: var(--text-main) !important;
    padding: 0.6rem 1rem !important;
    transition: all 0.2s ease;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.6;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

/* Buttons */
.btn {
    border-radius: 10px !important;
    padding: 0.48rem 0.95rem !important;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) !important;
    border: none !important;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.22s ease backwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* Console */
.gl-console {
    background: var(--bg-sidebar) !important;
    border-radius: 0 0 20px 20px !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-main) !important;
}

.ai-review-content {
    background: #ffffff;
    border-radius: 0 0 20px 20px;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.65;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.ai-review-panel {
    max-width: 100%;
}

.ai-review-score-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ai-review-score-row > div,
.ai-review-section {
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.86);
    padding: 1rem;
}

.ai-review-score {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.ai-review-decision {
    font-weight: 700;
    color: var(--text-main);
    text-transform: capitalize;
}

.ai-review-section {
    margin-top: 0.85rem;
}

.ai-review-section h6 {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ai-review-section p,
.ai-review-list {
    margin: 0;
}

.ai-review-list {
    padding-left: 1.1rem;
}

.ai-review-list li + li {
    margin-top: 0.4rem;
}

.ai-review-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.ai-review-meta,
.ai-review-empty {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.help-panel-content {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.help-panel-content h1,
.help-panel-content h2,
.help-panel-content h3 {
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: 0;
    margin-top: 1rem;
}

.help-panel-content h1 {
    font-size: 1.35rem;
}

.help-panel-content h2 {
    font-size: 1.1rem;
}

.help-panel-content h3 {
    font-size: 1rem;
}

.help-panel-content p,
.help-panel-content ul,
.help-panel-content ol {
    margin-bottom: 0.85rem;
}

.help-panel-content code {
    white-space: normal;
}

.help-ask-box {
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
}

.help-followup-question {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-main);
    font-weight: 700;
}

.help-followup-answer {
    margin-top: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.86);
}

@media (max-width: 768px) {
    .ai-review-score-row {
        grid-template-columns: 1fr;
    }
}

/* Badges */
.badge {
    border-radius: 8px !important;
    padding: 0.4em 0.8em !important;
    font-weight: 600 !important;
}

/* Tables */
.table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--text-main) !important;
    --bs-table-border-color: var(--glass-border) !important;
}

.table > :not(caption) > * > * {
    padding: 0.78rem 1rem !important;
}

.table tbody tr {
    transition: background 0.2s ease, opacity 0.18s ease, transform 0.18s ease;
}

.table tbody tr:hover {
    background: rgba(var(--text-main-rgb, 148, 163, 184), 0.03) !important;
}

.card-footer {
    background: rgba(var(--text-main-rgb), 0.025) !important;
    border-top: 1px solid var(--glass-border) !important;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.loading-row {
    min-height: 54px;
    background: linear-gradient(90deg, rgba(var(--text-main-rgb), 0.04), rgba(var(--text-main-rgb), 0.09), rgba(var(--text-main-rgb), 0.04));
    background-size: 200% 100%;
    animation: shimmer 1.1s ease-in-out infinite;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.render-progress {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.data-loading-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2rem;
    padding: 0.38rem 0.7rem;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.16);
    border-radius: 999px;
    background: rgba(var(--accent-primary-rgb), 0.08);
    color: var(--text-muted);
}

.data-loading-status.is-loading {
    color: var(--accent-primary);
}

.data-loading-spinner {
    width: 0.86rem;
    height: 0.86rem;
    border: 2px solid rgba(var(--accent-primary-rgb), 0.18);
    border-top-color: var(--accent-primary);
    border-radius: 999px;
    animation: spin 0.75s linear infinite;
    flex: 0 0 auto;
}

.data-loading-pulse {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.38);
    animation: pulse-ring 1.2s ease-out infinite;
    flex: 0 0 auto;
}

.data-row-enter {
    animation: rowEnter 0.22s ease both;
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.78;
}

.btn.is-loading i {
    animation: spin 0.8s linear infinite;
}

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

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.38); }
    80%, 100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

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

/* Premium Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.15);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.4);
}

/* Floating Table Scrollbar fix */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.2) transparent;
}

.floating-scroll::-webkit-scrollbar {
    height: 10px; /* Thicker horizontal scrollbar */
}

.floating-scroll::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.3);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 10px;
}

.floating-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.floating-scroll::-webkit-scrollbar-track {
    background: rgba(var(--text-main-rgb, 0, 0, 0), 0.02);
    border-radius: 10px;
}

/* Sticky Scrollbar Styles */
.sticky-scrollbar {
    position: sticky;
    bottom: 0px;
    left: 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 1001;
    background: var(--bg-card);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.sticky-scrollbar div {
    height: 12px; /* Sufficient height for the scrollbar to be visible and grab-able */
}

/* Hide original scrollbar of table container when floating is active */
#mrTableContainer {
    scrollbar-width: none; /* Firefox */
    cursor: grab;
}
#mrTableContainer:active {
    cursor: grabbing;
}
#mrTableContainer::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Responsive mobile/PWA layout */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
}

.mobile-sidebar-toggle,
.mobile-sidebar-close {
    width: 2.45rem;
    height: 2.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    flex: 0 0 auto;
}

.mobile-sidebar-overlay {
    display: none;
}

.feature-atlas-shell {
    --feature-atlas-radius: 24px;
}

.feature-atlas-hero-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.2rem 1.35rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--feature-atlas-radius);
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb), 0.13), rgba(var(--text-main-rgb), 0.025));
    box-shadow: 0 18px 45px rgba(var(--accent-primary-rgb), 0.08);
}

.feature-atlas-hero-description {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.65;
    max-width: 920px;
}

.feature-atlas-control-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: flex-end;
}

.feature-atlas-browser-card,
.feature-atlas-reader-card,
.feature-atlas-runs-card {
    border: 1px solid var(--glass-border) !important;
    background: var(--bg-card);
    border-radius: var(--feature-atlas-radius);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.09);
}

.feature-atlas-browser-card {
    overflow: visible !important;
}

.feature-atlas-workspace {
    align-items: flex-start;
}

.feature-atlas-workspace > [class*="col-"] {
    min-width: 0;
}

.feature-atlas-browser-heading {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-atlas-browser-subtitle {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

.feature-atlas-category-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 0.55rem;
}

.feature-atlas-type-chip {
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: rgba(var(--text-main-rgb), 0.035);
    color: var(--text-main);
    min-height: 74px;
    padding: 0.72rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.28rem;
    text-align: left;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.feature-atlas-type-chip i {
    color: var(--accent-primary);
    font-size: 1.05rem;
}

.feature-atlas-type-chip span {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.15;
}

.feature-atlas-type-chip strong {
    align-self: flex-end;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    background: rgba(var(--accent-primary-rgb), 0.13);
    color: var(--accent-primary);
    font-size: 0.72rem;
}

.feature-atlas-type-chip:hover,
.feature-atlas-type-chip.active {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-primary-rgb), 0.45);
    background: rgba(var(--accent-primary-rgb), 0.11);
}

.feature-atlas-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 1rem 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: rgba(var(--text-main-rgb), 0.035);
}

.feature-atlas-result-label {
    color: var(--text-main);
    font-weight: 800;
    font-size: 0.92rem;
}

.feature-atlas-selected-type {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.feature-atlas-selected-type span {
    margin-top: 0.15rem;
}

.feature-atlas-pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

.feature-atlas-pagination .btn {
    border-radius: 999px;
}

.feature-atlas-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.feature-atlas-filter-grid #featureAtlasSearch {
    grid-column: 1 / -1;
}

.feature-atlas-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0 1rem 1rem;
    max-height: clamp(380px, 58dvh, 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.feature-atlas-card-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.feature-atlas-card-group + .feature-atlas-card-group {
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--glass-border);
}

.feature-atlas-card-group-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.15rem;
    color: var(--text-main);
}

.feature-atlas-card-group-heading > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.feature-atlas-card-group-heading i {
    color: var(--accent-primary);
}

.feature-atlas-card-group-heading small {
    color: var(--text-muted);
    white-space: nowrap;
}

.feature-atlas-card {
    cursor: pointer;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem;
    background: rgba(var(--text-main-rgb), 0.035);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.feature-atlas-card:hover,
.feature-atlas-card.active {
    transform: translateY(-2px);
    border-color: rgba(var(--accent-primary-rgb), 0.42);
    background: rgba(var(--accent-primary-rgb), 0.10);
    box-shadow: 0 14px 35px rgba(var(--accent-primary-rgb), 0.13);
}

.feature-atlas-card-topline,
.feature-atlas-card-footer,
.feature-atlas-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-atlas-card-topline,
.feature-atlas-card-footer {
    justify-content: space-between;
}

.feature-atlas-area-pill,
.feature-atlas-source-kind {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.feature-atlas-area-pill {
    background: rgba(var(--accent-primary-rgb), 0.13);
    color: var(--accent-primary);
}

.feature-atlas-source-kind {
    background: rgba(var(--text-main-rgb), 0.08);
    color: var(--text-muted);
}

.feature-atlas-card-title {
    color: var(--text-main);
    font-size: 1.08rem;
    line-height: 1.3;
    font-weight: 800;
    margin: 0.85rem 0 0.45rem;
    overflow-wrap: anywhere;
}

.feature-atlas-card-summary {
    color: var(--text-main);
    opacity: 0.9;
    font-size: 0.98rem;
    line-height: 1.55;
    margin: 0 0 0.85rem;
}

.feature-atlas-card-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.8rem;
}

.feature-atlas-card-open {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-primary-rgb), 0.13);
    color: var(--accent-primary);
}

.feature-atlas-card-source,
.feature-atlas-source-path {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
    word-break: break-word;
    margin-top: 0.65rem;
}

.feature-atlas-list-loading,
.feature-atlas-empty-state,
.feature-atlas-reader-empty {
    padding: 2.25rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.feature-atlas-empty-state i,
.feature-atlas-reader-empty i {
    display: inline-flex;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.12);
    font-size: 1.6rem;
}

.feature-atlas-reader-empty h4,
.feature-atlas-empty-state h5 {
    color: var(--text-main);
    font-weight: 800;
}

.feature-atlas-reader-empty p,
.feature-atlas-empty-state p {
    font-size: 1.04rem;
    line-height: 1.65;
    max-width: 760px;
    margin: 0 auto;
}

.feature-atlas-reader-card {
    min-height: 0;
    overflow: visible !important;
}

.feature-atlas-reader-article {
    color: var(--text-main);
}

.feature-atlas-reader-hero {
    padding-bottom: 1.25rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--glass-border);
}

.feature-atlas-reader-kicker {
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 900;
    margin-bottom: 0.65rem;
}

.feature-atlas-reader-title {
    color: var(--text-main);
    font-size: clamp(1.75rem, 2.6vw, 2.7rem);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 0.9rem;
    overflow-wrap: anywhere;
}

.feature-atlas-reader-summary {
    color: var(--text-main);
    font-size: clamp(1.15rem, 1.35vw, 1.35rem);
    line-height: 1.75;
    margin-bottom: 1rem;
    max-width: 980px;
}

.feature-atlas-reader-badges,
.feature-atlas-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.feature-atlas-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 1.2rem 0;
}

.feature-atlas-info-box {
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 0.9rem;
    background: rgba(var(--text-main-rgb), 0.035);
    min-width: 0;
}

.feature-atlas-info-box > span {
    display: block;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
    font-size: 0.72rem;
    margin-bottom: 0.45rem;
}

.feature-atlas-info-box strong {
    display: block;
    color: var(--text-main);
    font-size: 1rem;
    word-break: break-word;
}

.feature-atlas-info-box small {
    display: block;
    color: var(--text-muted);
    line-height: 1.45;
    word-break: break-word;
    margin-top: 0.3rem;
}

.feature-atlas-display-hint,
.feature-atlas-reader-source,
.feature-atlas-tab-empty {
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    background: rgba(var(--accent-primary-rgb), 0.08);
    color: var(--text-main);
    line-height: 1.6;
}

.feature-atlas-display-hint,
.feature-atlas-reader-source {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.feature-atlas-reader-source {
    background: rgba(var(--text-main-rgb), 0.035);
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    word-break: break-word;
}

.feature-atlas-code-block {
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    max-height: 420px;
    overflow: auto;
    white-space: pre;
    font-size: 0.86rem;
}

.feature-atlas-wiki {
    color: var(--text-main);
    line-height: 1.78;
    overflow: auto;
}

.feature-atlas-wiki-reader {
    padding: 1.35rem 1.45rem;
    margin: 1.1rem 0;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background: rgba(var(--text-main-rgb), 0.035);
    max-height: none;
    overflow: visible;
}

.feature-atlas-wiki h1,
.feature-atlas-wiki h2,
.feature-atlas-wiki h3 {
    color: var(--text-main);
    font-weight: 900;
}

.feature-atlas-wiki h1 {
    font-size: clamp(1.35rem, 1.8vw, 1.85rem);
    line-height: 1.22;
    margin-bottom: 1.1rem;
}

.feature-atlas-wiki h2 {
    font-size: clamp(1.12rem, 1.35vw, 1.35rem);
    margin: 1.45rem 0 0.65rem;
    color: var(--accent-primary);
}

.feature-atlas-wiki p,
.feature-atlas-wiki li {
    font-size: 1.05rem;
}

.feature-atlas-wiki ul {
    margin-bottom: 1rem;
    padding-left: 1.35rem;
}

.feature-atlas-wiki li + li {
    margin-top: 0.38rem;
}

.feature-atlas-wiki pre {
    white-space: pre-wrap;
    font-family: inherit;
    color: var(--text-main);
    max-height: 520px;
    overflow: auto;
}

.feature-atlas-evidence-card {
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(var(--accent-primary-rgb), 0.05);
}

.feature-atlas-detail-tab {
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem;
    margin-top: 1rem;
    max-height: clamp(320px, 60dvh, 720px);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: rgba(var(--text-main-rgb), 0.03);
}

.feature-atlas-action-bar {
    margin: 1.2rem 0 0.5rem;
}

.feature-atlas-action-bar .btn {
    border-radius: 999px;
    padding: 0.62rem 1rem;
    font-weight: 700;
}

.feature-atlas-metric-card {
    box-shadow: 0 10px 30px rgba(var(--accent-primary-rgb), 0.08);
}

/* DeepWiki-inspired single-screen Feature Atlas */
.feature-atlas-shell {
    height: calc(100dvh - 118px);
    min-height: 560px;
    overflow: hidden;
}

.feature-atlas-deepwiki {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background: var(--bg-card);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.08);
    overflow: hidden;
}

.feature-atlas-dw-topbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(270px, 1.2fr) minmax(260px, 0.9fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.78rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(var(--text-main-rgb), 0.035), rgba(var(--text-main-rgb), 0.01));
}

.feature-atlas-dw-brand {
    display: flex;
    align-items: center;
    gap: 0.78rem;
    min-width: 0;
}

.feature-atlas-dw-logo {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-primary-rgb), 0.12);
    color: var(--accent-primary);
    flex: 0 0 auto;
}

.feature-atlas-dw-kicker {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.feature-atlas-dw-brand h3 {
    color: var(--text-main);
    font-size: clamp(1.08rem, 1.45vw, 1.38rem);
    font-weight: 850;
    line-height: 1.1;
    margin: 0.05rem 0 0.12rem;
}

.feature-atlas-dw-brand p {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
    margin: 0;
    max-width: 680px;
}

.feature-atlas-dw-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    min-width: 0;
}

.feature-atlas-dw-stat-pill {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    min-width: 0;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.42rem 0.58rem;
    background: rgba(var(--text-main-rgb), 0.035);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 750;
}

.feature-atlas-dw-stat-pill i {
    color: var(--accent-primary);
}

.feature-atlas-dw-stat-pill span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feature-atlas-dw-stat-pill strong {
    margin-left: auto;
    color: var(--text-main);
    font-size: 0.9rem;
}

.feature-atlas-dw-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.feature-atlas-dw-actions .btn {
    border-radius: 999px;
    font-weight: 750;
}

.feature-atlas-dw-config {
    position: relative;
}

.feature-atlas-dw-config summary {
    list-style: none;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.35rem 0.72rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 750;
    background: rgba(var(--text-main-rgb), 0.03);
}

.feature-atlas-dw-config summary::-webkit-details-marker {
    display: none;
}

.feature-atlas-dw-config-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: min(340px, 82vw);
    z-index: 20;
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--bg-card);
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.16);
}

.feature-atlas-dw-config-panel label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.feature-atlas-dw-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(260px, 315px) minmax(0, 1fr) minmax(220px, 280px);
}

.feature-atlas-dw-sidebar,
.feature-atlas-dw-reader,
.feature-atlas-dw-right {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.feature-atlas-dw-sidebar {
    border-right: 1px solid var(--glass-border);
    padding: 0.82rem;
    background: rgba(var(--text-main-rgb), 0.018);
}

.feature-atlas-dw-reader {
    padding: 1.15rem clamp(1rem, 2vw, 2rem);
    background: var(--bg-card);
}

.feature-atlas-dw-right {
    border-left: 1px solid var(--glass-border);
    padding: 0.82rem;
    background: rgba(var(--text-main-rgb), 0.018);
}

.feature-atlas-dw-search-wrap {
    position: relative;
    margin-bottom: 0.72rem;
}

.feature-atlas-dw-search-wrap i {
    position: absolute;
    left: 0.82rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.feature-atlas-dw-search-wrap .form-control {
    border-radius: 999px;
    padding-left: 2.35rem;
    min-height: 42px;
    background: var(--bg-card);
}

.feature-atlas-dw-category-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: 190px;
    overflow: auto;
    padding-right: 0.2rem;
    margin-bottom: 0.72rem;
}

.feature-atlas-dw-category-nav .feature-atlas-type-chip {
    min-height: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1.2rem 1fr auto;
    align-items: center;
    gap: 0.45rem;
    border: 0;
    border-radius: 10px;
    padding: 0.48rem 0.58rem;
    background: transparent;
    color: var(--text-muted);
}

.feature-atlas-dw-category-nav .feature-atlas-type-chip:hover,
.feature-atlas-dw-category-nav .feature-atlas-type-chip.active {
    transform: none;
    color: var(--text-main);
    background: rgba(var(--accent-primary-rgb), 0.10);
}

.feature-atlas-dw-category-nav .feature-atlas-type-chip i {
    font-size: 0.95rem;
}

.feature-atlas-dw-category-nav .feature-atlas-type-chip span {
    font-size: 0.84rem;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feature-atlas-dw-category-nav .feature-atlas-type-chip strong {
    align-self: auto;
    font-size: 0.7rem;
    padding: 0.08rem 0.38rem;
}

.feature-atlas-dw-filter-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.38rem;
    margin-bottom: 0.62rem;
}

.feature-atlas-dw-filter-strip .form-select {
    border-radius: 10px;
    font-size: 0.78rem;
}

.feature-atlas-dw-list-toolbar {
    margin: 0 0 0.62rem;
    padding: 0.58rem 0.62rem;
    border-radius: 12px;
    background: rgba(var(--text-main-rgb), 0.03);
}

.feature-atlas-dw-list-toolbar .feature-atlas-selected-type span {
    display: none !important;
}

.feature-atlas-dw-page-list {
    max-height: none;
    padding: 0;
    gap: 0.35rem;
    overflow: visible;
}

.feature-atlas-dw-page-list .feature-atlas-card-group {
    gap: 0.25rem;
}

.feature-atlas-dw-page-list .feature-atlas-card-group + .feature-atlas-card-group {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(var(--text-main-rgb), 0.07);
}

.feature-atlas-dw-page-list .feature-atlas-card-group-heading {
    padding: 0.22rem 0.15rem;
}

.feature-atlas-dw-page-list .feature-atlas-card-group-heading > div {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 850;
}

.feature-atlas-dw-page-list .feature-atlas-card-group-heading small {
    display: none;
}

.feature-atlas-dw-page-row {
    display: grid;
    grid-template-columns: 1.55rem minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.55rem;
    border: 0;
    border-radius: 12px;
    padding: 0.58rem;
    background: transparent;
    box-shadow: none;
}

.feature-atlas-dw-page-row:hover,
.feature-atlas-dw-page-row.active {
    transform: none;
    box-shadow: none;
    background: rgba(var(--accent-primary-rgb), 0.10);
}

.feature-atlas-dw-page-icon {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.10);
}

.feature-atlas-dw-page-main {
    min-width: 0;
}

.feature-atlas-dw-page-title {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 780;
    line-height: 1.24;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feature-atlas-dw-page-summary {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
    margin-top: 0.14rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feature-atlas-dw-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.feature-atlas-dw-page-meta span,
.feature-atlas-dw-page-meta a {
    color: var(--text-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feature-atlas-dw-page-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.feature-atlas-dw-article {
    max-width: 880px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.feature-atlas-dw-article-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.feature-atlas-dw-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.72rem;
}

.feature-atlas-dw-article .feature-atlas-reader-title {
    font-size: clamp(1.75rem, 2.5vw, 2.65rem);
    letter-spacing: -0.035em;
    margin-bottom: 0.8rem;
}

.feature-atlas-dw-article .feature-atlas-reader-summary {
    max-width: 820px;
    font-size: clamp(1.02rem, 1.18vw, 1.18rem);
    line-height: 1.68;
    color: var(--text-main);
    opacity: 0.88;
}

.feature-atlas-dw-source-accordion,
.feature-atlas-dw-rail-card {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(var(--text-main-rgb), 0.025);
}

.feature-atlas-dw-source-accordion {
    margin: 1rem 0;
    padding: 0.85rem 0.95rem;
}

.feature-atlas-dw-source-accordion summary {
    cursor: pointer;
    color: var(--text-main);
    font-weight: 820;
}

.feature-atlas-dw-source-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.feature-atlas-dw-source-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
    border: 1px solid rgba(var(--text-main-rgb), 0.10);
    border-radius: 999px;
    padding: 0.28rem 0.52rem;
    color: var(--text-main);
    background: rgba(var(--text-main-rgb), 0.045);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.74rem;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feature-atlas-dw-source-pill i {
    color: var(--accent-primary);
    flex: 0 0 auto;
}

.feature-atlas-dw-muted {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.feature-atlas-dw-article .feature-atlas-wiki-reader {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    margin: 1.1rem 0;
}

.feature-atlas-dw-article .feature-atlas-wiki h1,
.feature-atlas-dw-article .feature-atlas-wiki h2,
.feature-atlas-dw-article .feature-atlas-wiki h3 {
    color: var(--text-main);
}

.feature-atlas-dw-article .feature-atlas-wiki h1 {
    font-size: 1.42rem;
    margin-top: 1.3rem;
}

.feature-atlas-dw-article .feature-atlas-wiki h2 {
    color: var(--text-main);
    border-top: 1px solid var(--glass-border);
    padding-top: 1.05rem;
    margin-top: 1.35rem;
}

.feature-atlas-dw-article .feature-atlas-wiki p,
.feature-atlas-dw-article .feature-atlas-wiki li {
    font-size: 1rem;
    line-height: 1.74;
}

.feature-atlas-dw-appendix {
    border-top: 1px solid var(--glass-border);
    margin-top: 1.3rem;
    padding-top: 0.9rem;
}

.feature-atlas-dw-rail-card {
    padding: 0.78rem;
    margin-bottom: 0.72rem;
}

.feature-atlas-dw-rail-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 850;
    margin-bottom: 0.65rem;
}

.feature-atlas-dw-rail-title i {
    color: var(--accent-primary);
}

.feature-atlas-dw-right .feature-atlas-dw-source-list {
    flex-direction: column;
}

.feature-atlas-dw-right .feature-atlas-dw-source-pill {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-overflow: clip;
}

.feature-atlas-dw-toc {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.feature-atlas-dw-toc a {
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    padding: 0.34rem 0.42rem;
    font-size: 0.82rem;
    line-height: 1.25;
}

.feature-atlas-dw-toc a:hover {
    color: var(--text-main);
    background: rgba(var(--accent-primary-rgb), 0.10);
}

.feature-atlas-dw-latest-run {
    margin-bottom: 0.55rem;
}

.feature-atlas-dw-runs-table {
    max-height: 180px;
    overflow: auto;
}

.feature-atlas-dw-runs-table td {
    font-size: 0.74rem;
    color: var(--text-muted);
    border-color: var(--glass-border);
    padding: 0.45rem 0 !important;
}

.feature-atlas-dw-empty {
    height: 100%;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1500px) {
    .feature-atlas-dw-layout {
        grid-template-columns: minmax(225px, 260px) minmax(0, 1fr) minmax(190px, 220px);
    }

    .feature-atlas-dw-brand p {
        display: none;
    }
}

@media (max-width: 1280px) {
    .feature-atlas-dw-topbar {
        grid-template-columns: minmax(220px, 1fr) auto;
    }

    .feature-atlas-dw-stats {
        display: none;
    }
}

@media (max-width: 1100px) {
    .feature-atlas-dw-layout {
        grid-template-columns: minmax(230px, 285px) minmax(0, 1fr);
    }

    .feature-atlas-dw-right {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .feature-atlas-shell {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .feature-atlas-deepwiki {
        height: auto;
        overflow: visible;
    }

    .feature-atlas-dw-topbar,
    .feature-atlas-dw-layout {
        display: block;
    }

    .feature-atlas-dw-sidebar,
    .feature-atlas-dw-reader,
    .feature-atlas-dw-right {
        max-height: none;
        overflow: visible;
        border: 0;
    }

    .feature-atlas-dw-category-nav {
        max-height: none;
    }
}

@media (min-width: 1400px) {
    .feature-atlas-card-list:not(.feature-atlas-dw-page-list) {
        max-height: clamp(440px, 62dvh, 780px);
    }
}

@media (max-width: 1199.98px) {
    .feature-atlas-browser-card {
        max-height: none;
    }

    .feature-atlas-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .feature-atlas-hero-panel {
        padding: 1rem;
    }

    .feature-atlas-hero-description {
        font-size: 0.98rem;
    }

    .feature-atlas-control-strip,
    .feature-atlas-control-strip .form-control,
    .feature-atlas-control-strip .btn {
        width: 100% !important;
        justify-content: center;
    }

    .feature-atlas-filter-grid {
        grid-template-columns: 1fr;
    }

    .feature-atlas-category-nav:not(.feature-atlas-dw-category-nav) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-atlas-type-chip {
        min-height: 64px;
        padding: 0.65rem;
    }

    .feature-atlas-list-toolbar {
        flex-direction: column;
        align-items: stretch;
        margin: 0 0.85rem 0.85rem;
    }

    .feature-atlas-pagination {
        justify-content: space-between;
        width: 100%;
    }

    .feature-atlas-card-group-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .feature-atlas-card-group-heading small {
        white-space: normal;
    }

    .feature-atlas-filter-grid #featureAtlasSearch {
        grid-column: auto;
    }

    .feature-atlas-card-list:not(.feature-atlas-dw-page-list) {
        padding: 0 0.85rem 0.85rem;
        max-height: 58dvh;
    }

    .feature-atlas-reader-title {
        font-size: 1.55rem;
    }

    .feature-atlas-reader-summary,
    .feature-atlas-wiki p,
    .feature-atlas-wiki li {
        font-size: 1rem;
    }
}

@media (max-width: 991.98px) {
    :root {
        --mobile-header-height: 62px;
    }

    body {
        height: 100dvh;
        overflow: hidden;
    }

    .app-header {
        min-height: var(--mobile-header-height);
        padding: max(0.55rem, env(safe-area-inset-top)) 0.75rem 0.55rem !important;
        position: sticky;
        top: 0;
        z-index: 1000 !important;
    }

    .app-header .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
        gap: 0.35rem;
        flex-wrap: nowrap;
    }

    .app-header .navbar-brand {
        min-width: 0;
        max-width: 48vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 1rem;
    }

    .app-header .navbar-brand .rounded-circle {
        width: 30px !important;
        height: 30px !important;
        flex: 0 0 30px;
    }

    .app-header .ms-auto {
        gap: 0.35rem !important;
        min-width: 0;
    }

    .app-header .btn {
        min-height: 2.35rem;
        padding: 0.45rem 0.58rem !important;
    }

    #globalHelpBtn span,
    #themeText,
    #currentUserLabel,
    .app-header .vr,
    .app-header .d-none.d-md-flex {
        display: none !important;
    }

    #globalHelpBtn i,
    #themeToggle i,
    .app-header .dropdown button .rounded-circle {
        margin-right: 0 !important;
    }

    .app-header .dropdown button .bi-chevron-down {
        display: none;
    }

    .mobile-sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(2, 6, 23, 0.55);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    body.mobile-nav-open .mobile-sidebar-overlay {
        display: block !important;
    }

    .sidebar {
        position: fixed;
        z-index: 1050;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(86vw, 320px);
        min-width: 0;
        height: 100dvh !important;
        max-height: 100dvh;
        padding: calc(env(safe-area-inset-top) + 0.75rem) 0.9rem calc(env(safe-area-inset-bottom) + 1rem);
        transform: translateX(-105%);
        box-shadow: 20px 0 45px rgba(2, 6, 23, 0.28);
        transition: transform 0.22s ease, background-color 0.4s ease, border-color 0.4s ease;
    }

    body.mobile-nav-open .sidebar {
        transform: translateX(0);
    }

    .app-shell {
        display: block;
        height: calc(100dvh - var(--mobile-header-height));
        min-height: 0;
        overflow: hidden;
    }

    .app-main {
        width: 100%;
        height: 100%;
        padding: 0.9rem !important;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-main > .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .app-main .row {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    .card,
    .glass {
        border-radius: 16px !important;
    }

    .card-header,
    .card-body,
    .card-footer,
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .card-header.d-flex,
    .app-main > .container-fluid > .d-flex,
    .app-main > .container-fluid > .row > .col-12 > .d-flex {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.85rem !important;
    }

    .card-header.d-flex > *,
    .app-main > .container-fluid > .d-flex > *,
    .app-main > .container-fluid > .row > .col-12 > .d-flex > * {
        width: 100%;
        max-width: 100%;
    }

    .app-main .d-flex[class*="gap-"] {
        flex-wrap: wrap;
    }

    .app-main .card > .d-flex {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        gap: 0.6rem !important;
    }

    .app-main .card > .d-flex > .glass {
        width: 100% !important;
        max-width: none !important;
        flex: 1 1 100%;
    }

    .app-main .card-header .form-select,
    .app-main .card-header .form-control,
    .app-main > .container-fluid > .d-flex .form-select,
    .app-main > .container-fluid > .d-flex .form-control,
    .app-main > .container-fluid > .row > .col-12 > .d-flex .form-select,
    .app-main > .container-fluid > .row > .col-12 > .d-flex .form-control,
    .app-main .card > .d-flex .form-select,
    .app-main .card > .d-flex .form-control {
        width: 100% !important;
        min-width: 0;
    }

    .app-main .card-header .btn,
    .app-main > .container-fluid > .d-flex .btn,
    .app-main > .container-fluid > .row > .col-12 > .d-flex .btn {
        flex: 1 1 140px;
        justify-content: center;
    }

    .app-main h3 {
        font-size: 1.35rem;
    }

    .app-main h4 {
        font-size: 1.15rem;
    }

    .app-main h5 {
        font-size: 1rem;
    }

    .btn {
        min-height: 2.35rem;
        touch-action: manipulation;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
    }

    .app-main .table {
        min-width: 640px;
    }

    .app-main .table > :not(caption) > * > * {
        padding: 0.72rem 0.85rem !important;
        vertical-align: top;
    }

    #mrTableContainer {
        overflow: visible !important;
        cursor: default;
    }

    #mrTableContainer table {
        display: block;
        min-width: 0 !important;
        width: 100%;
    }

    #mrTableContainer thead,
    #sticky-scrollbar-container {
        display: none !important;
    }

    #mrTableContainer tbody {
        display: grid;
        gap: 0.85rem;
        width: 100%;
    }

    #mrTableContainer tbody tr {
        display: block;
        width: 100%;
        padding: 0.8rem;
        border: 1px solid var(--glass-border);
        border-radius: 16px;
        background: var(--bg-card);
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }

    #mrTableContainer tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.85rem;
        width: 100%;
        padding: 0.48rem 0.15rem !important;
        border: 0 !important;
        text-align: right !important;
    }

    #mrTableContainer tbody td::before {
        content: attr(data-label);
        flex: 0 0 38%;
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-align: left;
        text-transform: uppercase;
    }

    #mrTableContainer tbody td:not([data-label]) {
        display: block;
        text-align: center !important;
    }

    #mrTableContainer tbody td:not([data-label])::before,
    #mrTableContainer tbody td[data-label="Select"]::before {
        display: none;
    }

    #mrTableContainer tbody td[data-label="Select"] {
        justify-content: flex-start;
        padding-bottom: 0.1rem !important;
    }

    #mrTableContainer tbody td[data-label="Merge Request"] {
        display: block;
        text-align: left !important;
    }

    #mrTableContainer tbody td[data-label="Merge Request"]::before {
        display: block;
        margin-bottom: 0.35rem;
    }

    #mrTableContainer .text-truncate {
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
    }

    #mrTableContainer tbody td .d-flex {
        justify-content: flex-end !important;
        flex-wrap: wrap;
    }

    #mrTableContainer tbody td[data-label="AI Score"] > .d-flex,
    #mrTableContainer tbody td[data-label="Actions"] > .d-flex {
        max-width: 62%;
    }

    .modal-dialog,
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 1rem);
        margin: 0.5rem auto;
    }

    .modal-content {
        border-radius: 18px !important;
        max-height: calc(100dvh - 1rem);
        overflow: hidden;
    }

    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1 1 120px;
    }

    #consoleOutput,
    #logContent,
    #dbLogContent,
    #pipelineLogContent,
    #testRunContent,
    #issuesContent {
        height: min(60dvh, 520px) !important;
        max-height: 60dvh;
    }

    .gl-console,
    pre,
    code {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }

    .app-main .nav-pills,
    .modal .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .app-main .nav-pills .nav-link,
    .modal .nav-pills .nav-link {
        white-space: nowrap;
    }

    #loginContainer {
        padding: 1rem;
    }

    #loginContainer .card {
        width: min(100%, 400px) !important;
    }

    #loginContainer .card-body {
        padding: 2rem 1.25rem !important;
    }
}

@media (max-width: 575.98px) {
    :root {
        --mobile-header-height: 58px;
    }

    .app-header .navbar-brand {
        max-width: 42vw;
        font-size: 0.95rem;
    }

    .app-header .btn {
        min-width: 2.2rem;
    }

    .app-main {
        padding: 0.7rem !important;
    }

    .card-header,
    .card-body,
    .card-footer,
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    #mrTableContainer tbody td {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        text-align: left !important;
    }

    #mrTableContainer tbody td::before,
    #mrTableContainer tbody td[data-label="AI Score"] > .d-flex,
    #mrTableContainer tbody td[data-label="Actions"] > .d-flex {
        flex-basis: auto;
        max-width: 100%;
    }

    #mrTableContainer tbody td .d-flex {
        justify-content: flex-start !important;
    }
}

/* Bug Tracker Fix Center */
.bug-tracker-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.bug-tracker-stat-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.15rem;
    border-radius: 18px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.bug-tracker-stat-card i {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-primary-rgb), 0.12);
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.bug-tracker-stat-card span,
.bug-tracker-detail-grid span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.bug-tracker-stat-card strong {
    display: block;
    color: var(--text-main);
    font-size: 1.25rem;
}

.bug-tracker-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
}

.bug-tracker-detail-grid > div {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.75rem;
    background: rgba(var(--accent-primary-rgb), 0.04);
}

.bug-tracker-detail-grid strong {
    display: block;
    color: var(--text-main);
    font-size: 0.92rem;
    margin-top: 0.25rem;
    overflow-wrap: anywhere;
}

.bug-tracker-richtext {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0.9rem;
    background: var(--bg-main);
    color: var(--text-main);
    max-height: 260px;
    overflow: auto;
    overflow-wrap: anywhere;
}

.bug-tracker-prompt-preview {
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 1rem;
    font-size: 0.82rem;
}
