/* -------------------------------------------------------------
   Global reset & base
------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter",
        "Segoe UI", sans-serif;
    background: #050716;
    color: #0b1020;
}

/* Links */
a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Utility */
.muted {
    color: #6b7280;
}

/* -------------------------------------------------------------
   Layout
------------------------------------------------------------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar --------------------------------------------------- */

.sidebar {
    width: 260px;
    background: radial-gradient(circle at top left, #1e293b 0%, #020617 55%);
    color: #e5e7eb;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-brand-title {
    font-weight: 700;
    font-size: 18px;
}

.sidebar-section-title {
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 8px;
}

.sidebar-nav-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Primary button in sidebar */
.btn-primary-wide {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border: none;
    color: #f9fafb;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.45);
}

.btn-primary-wide:hover {
    filter: brightness(1.06);
}

/* Sidebar links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #e5e7eb;
    cursor: pointer;
}

.sidebar-link span.icon {
    font-size: 14px;
}

.sidebar-link:hover {
    background: rgba(148, 163, 184, 0.18);
}

.sidebar-link-muted {
    color: #9ca3af;
}

/* Grow section so footer sticks to bottom */
.sidebar-grow {
    flex: 1;
}

/* Main content ------------------------------------------------ */

.main-content {
    flex: 1;
    background: radial-gradient(circle at top, #f9fafb 0%, #e5e7eb 60%, #d1d5db 100%);
    padding: 32px 40px;
    overflow: auto;
}

/* Responsive layout ------------------------------------------ */

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 20px 16px 24px;
    }

    .app-shell {
        flex-direction: column;
    }
}

/* -------------------------------------------------------------
   Generic cards / typography
------------------------------------------------------------- */

.page {
    max-width: 1120px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1,
.page-header h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #020617;
    margin-bottom: 4px;
}

.page-header .subtitle {
    font-size: 14px;
    color: #6b7280;
}

.card {
    background: rgba(248, 250, 252, 0.96);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.card+.card {
    margin-top: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #020617;
}

.card-body-text {
    font-size: 16px;
    line-height: 1.7;
    color: #111827;
}

/* Pills & chips ---------------------------------------------- */

.meta-pill,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(15, 23, 42, 0.04);
    color: #0f172a;
}

.meta-pill-mode {
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
}

.meta-pill-muted {
    background: rgba(148, 163, 184, 0.12);
    color: #6b7280;
}

/* Tags */
.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    color: #374151;
    font-size: 11px;
    margin-right: 6px;
    margin-bottom: 4px;
}

/* Buttons ---------------------------------------------------- */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #f9fafb;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.07);
}

/* -------------------------------------------------------------
   INDEX PAGE (landing)
------------------------------------------------------------- */

.landing-hero {
    max-width: 700px;
    margin: 40px auto 24px;
    text-align: center;
}

.landing-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #4f46e5;
}

.landing-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #020617;
    margin-bottom: 6px;
}

.landing-subtitle {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
}

/* Landing search panel */

.landing-panel {
    max-width: 720px;
    margin: 0 auto;
    background: rgba(248, 250, 252, 0.98);
    border-radius: 20px;
    padding: 22px 22px 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
    border: 1px solid rgba(226, 232, 240, 0.96);
}

.search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #9ca3af;
}

.search-input {
    width: 100%;
    padding: 11px 14px 11px 38px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 14px;
    color: #111827;
}

.search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.5);
}

/* Mode toggle buttons */

.mode-toggle {
    display: inline-flex;
    border-radius: 999px;
    background: #e5e7eb;
    padding: 3px;
    margin-bottom: 16px;
}

.mode-toggle button {
    border: none;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    background: transparent;
    cursor: pointer;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mode-toggle button.is-active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

/* Primary CTA on landing */

.landing-cta-row {
    margin-top: 4px;
    text-align: center;
}

/* Recent runs list */

.recent-runs {
    max-width: 720px;
    margin: 24px auto 0;
}

.recent-runs-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
    margin-bottom: 10px;
}

.run-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.run-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.82);
    border: 1px solid rgba(226, 232, 240, 0.9);
    font-size: 13px;
}

.run-list-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.run-list-title {
    font-weight: 500;
    color: #111827;
}

.run-list-meta {
    font-size: 12px;
    color: #6b7280;
}

/* Mobile tweaks for landing */
@media (max-width: 720px) {
    .landing-hero {
        margin-top: 16px;
    }

    .landing-panel {
        padding: 16px 14px;
    }

    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-wrapper {
        width: 100%;
    }

    .landing-cta-row .btn-primary {
        width: 100%;
    }
}

/* -------------------------------------------------------------
   RUN DETAIL PAGE
------------------------------------------------------------- */

.run-page {
    max-width: 1120px;
    margin: 0 auto 40px;
}

/* Hero header */

/* Hero header */

.run-hero-clean {
    margin-bottom: 24px;
    padding: 0 4px;
}

.run-hero-kicker {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 4px;
}

.run-hero-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    /* Slate 900 */
    line-height: 1.2;
    margin-bottom: 8px;
}

.run-hero-meta {
    font-size: 14px;
    color: #0f172a;
    font-family: monospace, monospace;
    /* Or just sans if preferred */
    display: flex;
    gap: 16px;
    align-items: center;
}

.run-hero-meta span {
    display: inline-block;
}

/* Old styles kept for fallback/reference if needed elsewhere, or remove if unused */
.run-hero-card {
    display: none;
    /* Hiding old one */
}

.run-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #020617;
    margin-bottom: 4px;
}

.run-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.run-hero-right {
    display: flex;
    align-items: center;
}

.run-id-chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    font-size: 11px;
    color: #6b7280;
}

/* Tabs ------------------------------------------------------ */

.run-tabs {
    margin-top: 18px;
    margin-bottom: 10px;
    display: inline-flex;
    background: rgba(229, 231, 235, 0.8);
    border-radius: 999px;
    padding: 3px;
    gap: 4px;
}

.run-tab-btn {
    border: none;
    padding: 7px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.run-tab-btn.is-active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

/* Tab panels */

.run-tab-panel {
    display: none;
    margin-top: 6px;
}

.run-tab-panel.is-active {
    display: block;
}

/* Unified Panel Card (White, clean border) */
.panel-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

.panel-card .card-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

/* -------------------------------------------------------------
   ARTICLE / DOCUMENT STYLE
------------------------------------------------------------- */

/* The "paper" container */
.article-paper {
    max-width: 860px;
    margin: 20px auto 60px;
    background: #ffffff;
    padding: 60px 80px;
    border-radius: 2px;
    /* Slight rounding or none for paper feel */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    color: #111827;
    /* Dark slate */
    font-family: "Georgia", "Times New Roman", serif;
    /* Serif for article body? Or clean sans? Image looks clean sans. */
    /* Let's stick to the sans-serif from the image, looks like Inter/Arial but very clean */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header inside the article */
.article-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 3px solid #0f172a;
    /* Thick dark line matching screenshot */
}

.article-title {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    /* Dark navy/black */
    line-height: 1.2;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.article-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-meta {
    font-size: 14px;
    color: #475569;
    font-family: monospace;
    /* Or standard sans */
    font-family: system-ui, sans-serif;
    margin-top: 8px;
}

/* Content typography */
.article-content {
    font-size: 16px;
    line-height: 1.7;
    /* Readable leading */
    color: #1e293b;
}

.article-content h2,
.article-content h3 {
    margin-top: 32px;
    margin-bottom: 12px;
    font-weight: 700;
    color: #0f172a;
}

.article-content h2 {
    font-size: 22px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.article-content h3 {
    font-size: 18px;
}

.article-content p {
    margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 18px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 6px;
    padding-left: 0;
}

.article-content strong {
    color: #0f172a;
    font-weight: 700;
}

/* Layout inside insights tab -------------------------------- */

.run-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 18px;
    margin-top: 12px;
}

.run-col-left,
.run-col-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Lens cards */

.overview-card {
    border-left: 4px solid #4f46e5;
}

.expert-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .expert-grid {
        grid-template-columns: 1fr;
    }
}

.expert-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.expert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.expert-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.expert-card-icon {
    font-size: 24px;
    color: #334155;
    flex-shrink: 0;
    margin-left: 12px;
}

.expert-card-body {
    font-size: 16px;
    line-height: 1.7;
    color: #334155;
    font-weight: 400;
}

/* Override default card for expert layout if needed */
.expert-layout .card {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.lens-card .lens-icon {
    margin-right: 6px;
}

/* Opportunity cards ----------------------------------------- */

.opportunity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.opportunity-card {
    border-radius: 16px;
    padding: 16px 16px 14px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.opportunity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.opp-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.opp-id-pill {
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.opp-title {
    font-size: 15px;
    font-weight: 600;
    color: #020617;
}

.opp-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.score-pill {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(148, 163, 184, 0.16);
    color: #374151;
}

.score-impact {
    background: rgba(248, 113, 113, 0.12);
    color: #b91c1c;
}

.score-feasible {
    background: rgba(52, 211, 153, 0.16);
    color: #047857;
}

.opp-description {
    font-size: 13px;
    line-height: 1.6;
    color: #111827;
    margin-bottom: 6px;
}

.opp-section {
    margin-top: 4px;
    margin-bottom: 4px;
}

.opp-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #9ca3af;
    margin-bottom: 2px;
}

.opp-section p,
.opp-section ul {
    font-size: 13px;
    color: #111827;
}

.opp-section ul {
    padding-left: 18px;
}

.opp-tags {
    margin-top: 6px;
}

.opp-experts {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed rgba(148, 163, 184, 0.7);
}

.opp-experts summary {
    font-size: 12px;
    color: #4b5563;
    cursor: pointer;
}

.opp-experts ul {
    margin-top: 4px;
    padding-left: 18px;
    font-size: 13px;
}

/* Solution Cards (Redesign) ------------------------------ */

.sol-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sol-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    /* For absolute positioning of action button */
}

.btn-design-action {
    position: absolute;
    top: 24px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fdf2f8;
    color: #be185d;
    border: 1px solid #fbcfe8;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-design-action:hover {
    background: #fce7f3;
    border-color: #f9a8d4;
    transform: translateY(-1px);
}

/* .sol-card:last-child border reset removed as cards are now standalone boxes */

.sol-header {
    margin-bottom: 20px;
}

.sol-meta-row {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.sol-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.sol-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
}

.sol-tag {
    font-size: 13px;
    color: #4f46e5;
    /* Indigo 600 */
    font-weight: 500;
    /* Optional: subtle background if desired, but screenshot looked like text */
    /* background: rgba(79, 70, 229, 0.05); 
       padding: 2px 6px; 
       border-radius: 4px; */
}

.sol-section {
    margin-bottom: 24px;
}

.sol-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 12px;
}

.sol-section-title span:last-child {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.sol-icon {
    font-size: 18px;
    /* You might want a specific color here, e.g. blue */
    color: #3b82f6;
}

.sol-body {
    font-size: 16px;
    color: #475569;
    line-height: 1.7;
}

.sol-body ul {
    margin: 0;
    padding-left: 20px;
}

.sol-body li {
    margin-bottom: 6px;
}

/* Design Actions */
.sol-card-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.btn-design {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fdf2f8;
    color: #be185d;
    border: 1px solid #fbcfe8;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-design:hover {
    background: #fce7f3;
    border-color: #f9a8d4;
    transform: translateY(-1px);
}


.sol-tech-label {
    font-weight: 600;
    color: #0f172a;
}

/* Helper for "pill" style lists if we want them? 
   The screenshot shows bullet points, so standard UL is fine. 
*/

.trend-axis-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trend-axis {
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 10px 12px;
}

.trend-axis-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.trend-pill-id {
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.16);
    color: #0284c7;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trend-pill-title {
    font-size: 14px;
    font-weight: 500;
    color: #020617;
}

.trend-axis-body {
    margin-top: 8px;
    font-size: 13px;
    color: #111827;
}

.trend-desc {
    margin-bottom: 6px;
}

.trend-section {
    margin-top: 4px;
    margin-bottom: 4px;
}

.trend-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #9ca3af;
    margin-bottom: 2px;
}

.trend-section ul {
    padding-left: 18px;
}

/* Article tab ------------------------------------------------ */

.article-card {
    margin-top: 12px;
}

.article-body {
    font-size: 14px;
    line-height: 1.7;
    color: #111827;
    max-width: 760px;
}

/* Simple prose-style typography */
.prose h2 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 14px;
    margin-bottom: 6px;
}

.prose h3 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 4px;
}

.prose p {
    margin-bottom: 8px;
}

.prose ul,
.prose ol {
    margin-bottom: 8px;
    padding-left: 22px;
}

.prose li {
    margin-bottom: 3px;
}

/* Empty state */
.empty-article {
    text-align: center;
    padding: 30px 10px;
    color: #6b7280;
}

.empty-icon {
    font-size: 26px;
    margin-bottom: 6px;
}

.empty-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.empty-subtitle {
    font-size: 13px;
}

/* Debug JSON card ------------------------------------------- */

.debug-card {
    margin-top: 18px;
}

/* Responsive for run detail --------------------------------- */

@media (max-width: 900px) {
    .run-hero-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .run-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .run-tabs {
        margin-top: 14px;
    }

    .run-tab-panel {
        margin-top: 10px;
    }
}