@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top, #1b1f3a 0%, #0b1120 50%, #05060f 100%);
    color: #e2e8f0;
    min-height: 100vh;
}

html {
    scroll-behavior: smooth;
}

/* Responsive chart sizing helpers */
.chart-sm {
  height: 36vh;
  min-height: 240px;
  width: 100%;
}
.chart-md {
  height: 45vh;
  min-height: 300px;
  width: 100%;
}
.chart-lg {
  height: 55vh;
  min-height: 340px;
  width: 100%;
}

@media (max-width: 992px) {
  .chart-lg { height: 50vh; min-height: 320px; }
  .chart-md { height: 42vh; min-height: 280px; }
  .chart-sm { height: 34vh; min-height: 220px; }
}
@media (max-width: 768px) {
  .chart-lg { height: 46vh; min-height: 300px; }
  .chart-md { height: 38vh; min-height: 260px; }
  .chart-sm { height: 32vh; min-height: 200px; }
}

.page-shell {
    background: transparent;
    color: inherit;
    padding-bottom: 48px;
}

.page-hero-container {
    padding-top: 48px;
    padding-bottom: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-hero-surface {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(14,116,144,0.12));
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 24px;
    padding: 32px;
    max-height: 320px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(15,23,42,0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}


.page-hero-surface {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(14,116,144,0.12));
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 18px 45px rgba(15,23,42,0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.page-hero-copy {
    flex: 1 1 320px;
    min-width: 260px;
}

.page-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #38bdf8;
    background: rgba(56,189,248,0.12);
    border-radius: 999px;
    padding: 6px 12px;
    margin-bottom: 12px;
}

.page-hero-title {
    font-size: 2.6rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 8px;
}

.page-hero-description {
    max-width: 640px;
    font-size: 1rem;
    line-height: 1.6;
    color: #cbd5f5;
    margin: 0;
}

.page-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

@media (max-width: 768px) {
    .page-hero-surface {
        padding: 24px;
    }
    .page-hero-title {
        font-size: 2.05rem;
    }
    .page-hero-actions {
        width: 100%;
        justify-content: flex-start;
    }
}


.page-body-container {
    padding-bottom: 40px;
}

.section-card {
    background: rgba(10,14,25,0.95);
    border: 1px solid rgba(148,163,184,0.14);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(8,15,40,0.45);
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.section-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(148,163,184,0.12);
}

.section-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 0;
}

.section-card-subtitle {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0;
}

.section-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.section-card .card-body {
    padding: 24px;
    color: #e2e8f0;
}

.card {
    border-radius: 18px;
    border: 1px solid rgba(148,163,184,0.14);
    background: rgba(12,17,30,0.92);
    box-shadow: 0 16px 40px rgba(8,15,40,0.35);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 48px rgba(8,15,40,0.4);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #f8fafc;
    margin-bottom: 0.6rem;
    text-transform: none;
    background: none;
    padding: 0;
}

.card-body {
    color: #e2e8f0;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: #38bdf8;
    margin-bottom: 0.25rem;
}

.section-divider {
    border: none;
    border-top: 1px solid rgba(148,163,184,0.16);
    margin: 3rem 0;
}


.glass-panel {
  background: linear-gradient(135deg, rgba(15,23,42,0.78), rgba(37,99,235,0.24));
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 22px;
  box-shadow: 0 24px 55px rgba(8,15,40,0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.glass-panel > .card-body,
.glass-panel .card-body {
  background: transparent;
  color: #e2e8f0;
}
.glass-panel h4,
.glass-panel h5 {
  color: #f8fafc;
}

/* Themed Dash DataTable */
.dash-table-container {
  background: rgba(11,17,29,0.96);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(8,15,40,0.35);
  padding: 12px;
}
.dash-table-container .dash-table {
  background: transparent !important;
}
.dash-table-container .dash-table-container {
  background: transparent !important;
}
.dash-table-container .dash-header {
  background: rgba(59,130,246,0.18) !important;
  color: #f8fafc !important;
  border-color: rgba(148,163,184,0.18) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dash-table-container .dash-header span {
  color: inherit !important;
}
.dash-table-container .dash-cell {
  color: #e2e8f0 !important;
  border-color: rgba(148,163,184,0.18) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.92rem;
  padding: 10px 12px !important;
}

.dash-table-container .dash-filter {
  background: rgba(11,17,29,0.9) !important;
  border-color: rgba(148,163,184,0.18) !important;
  color: #e2e8f0 !important;
}
.dash-table-container .dash-table-tooltip {
  background: rgba(15,23,42,0.92);
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,0.18);
}

/* Graph surface styling */
.dash-graph {
  background: rgba(11,17,29,0.96);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(8,15,40,0.35);
}
.dash-graph .js-plotly-plot,
.dash-graph .plot-container {
  background: transparent !important;
}

/* Ensure Plotly containers don't introduce their own grey background */
.js-plotly-plot,
.plot-container,
.svg-container {
  background-color: transparent !important;
}

/* Some Plotly templates still inject an inline grey background on the root SVG.
   Force it transparent so all charts sit cleanly on the galaxy card surface. */
.main-svg {
  background: transparent !important;
  background-color: transparent !important;
}

/* Form controls */
input, select, textarea, .form-control, .Select-control, .Select__control, .select__control {
  background: rgba(13,19,33,0.88) !important;
  border: 1px solid rgba(148,163,184,0.24) !important;
  color: #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
input:focus, select:focus, textarea:focus, .form-control:focus, .Select-control:focus, .Select__control--is-focused, .select__control--is-focused {
  border-color: rgba(59,130,246,0.45) !important;
  box-shadow: 0 0 0 0.15rem rgba(59,130,246,0.25) !important;
}
.form-label {
  color: #cbd5f5 !important;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.dccRadioItems, .form-check-input {
  accent-color: #38bdf8;
}

.analyzer-timeframe-dropdown .Select-control,
.analyzer-timeframe-dropdown .Select-menu-outer,
.analyzer-timeframe-dropdown .Select-value,
.analyzer-timeframe-dropdown .Select-placeholder {
  background-color: rgba(12,17,30,0.92) !important;
  color: #e2e8f0 !important;
  border-color: rgba(148,163,184,0.18) !important;
}

.analyzer-timeframe-dropdown .Select-option {
  background-color: rgba(12,17,30,0.92) !important;
  color: #e2e8f0 !important;
}

.analyzer-timeframe-dropdown .Select-option.is-focused,
.analyzer-timeframe-dropdown .Select-option.is-selected {
  background-color: rgba(37,99,235,0.35) !important;
  color: #fff !important;
}

/* Loading overlay */
.dash-loading .dash-loading-outer {
  background: rgba(11,17,29,0.88);
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.12);
}

.app-loading-parent {
  position: relative;
  isolation: isolate;
}

.app-loading-parent .app-skeleton {
  min-height: var(--app-loading-min-height, 220px);
}

.app-loading-overlay.dash-loading {
  transition: opacity 0.2s ease;
}

.app-loading-overlay .dash-spinner {
  width: 100%;
  height: 100%;
  min-height: var(--app-loading-min-height, 220px);
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.14);
  background: linear-gradient(140deg, rgba(15,23,42,0.92), rgba(30,41,59,0.92));
  box-shadow: 0 24px 48px rgba(8,15,40,0.38);
  overflow: hidden;
  position: relative;
}

.app-loading-overlay .dash-spinner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(148,191,255,0.18) 45%, rgba(103,232,249,0.12) 55%, transparent 100%);
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.app-loading-overlay .dash-spinner > div {
  display: none;
}

.app-skeleton {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.14);
  background: linear-gradient(140deg, rgba(15,23,42,0.92), rgba(30,41,59,0.92));
  box-shadow: 0 24px 48px rgba(8,15,40,0.38);
  overflow: hidden;
}

.app-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(148,191,255,0.18) 45%, rgba(103,232,249,0.12) 55%, transparent 100%);
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.app-skeleton--compact {
  border-radius: 14px;
  min-height: 140px;
}

.app-skeleton--text {
  border-radius: 12px;
  min-height: 80px;
}

@keyframes skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Styling for risk metrics, ratios, and other outputs */
.output-text {
    color: #ffffff; /* Set to white */
    font-size: 16px; /* Optional: Adjust size for readability */
}


.animate-fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border: none;
    color: #f8fafc;
    box-shadow: 0 10px 24px rgba(37,99,235,0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(30,64,175,0.35);
}

/* Secondary Button */
.btn-secondary {
    background: rgba(148,163,184,0.18);
    border: 1px solid rgba(148,163,184,0.28);
    color: #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(148,163,184,0.28);
    border-color: rgba(148,163,184,0.45);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(148,163,184,0.18);
}

.page-hero-actions .btn {
    border-radius: 999px;
    padding: 0.55rem 1.4rem;
}

#money-symbol {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    color: #4caf50;
    opacity: 0;
    animation: moneyAnimation 2s ease-in-out;
}

@keyframes moneyAnimation {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(180deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(360deg); }
}

/* General styles for better readability */
h4, h5 {
    color: #ffffff;
}

label {
    color: #ffffff;
}

.output-text {
    color: #ffffff; /* White text for high contrast */
    font-size: 16px; /* Optional: Adjust size for readability */
    font-weight: 400; /* Optional: Adjust weight */
    padding: 5px; /* Optional: Add padding for spacing */
}

.navbar .nav-link {
    color: white !important; /* Make navbar links white */
}

.navbar .nav-link:hover {
    color: #dcdcdc !important; /* Optional: Light gray on hover for better UX */
}

/* Larger, responsive navbar logo */
.navbar-logo { height: 96px; width: auto; }          /* roughly ~2x of current */
@media (max-width: 991.98px) { .navbar-logo { height: 64px; } }
@media (max-width: 575.98px) { .navbar-logo { height: 48px; } }

.navbar-brand {
    color: white !important; /* Set the app name text color to white */
    font-size: 20px; /* Optional: Adjust font size if needed */
    font-weight: bold; /* Optional: Make it bold */
}


.navbar-brand:hover {
    color: #dcdcdc !important; /* Optional: Light gray on hover */
}

.navbar-brand-text {
    font-size: 3rem; /* Adjust size as needed */
    color: white;    /* Ensure it matches the existing navbar text color */
    font-weight: bold; /* Optional for bolder text */
}

.custom-nav-link {
    font-size: 1.2rem; /* Adjust size as needed */
    font-weight: bold; /* Optional for stronger emphasis */
    color: white !important; /* Ensure white text color */
    text-transform: uppercase; /* Optional to make text uppercase */
    padding: 10px 15px; /* Add some spacing */
}

.ratios-window {
    max-height: 300px; /* Adjust this height to match the risk metrics window */
    overflow-y: auto;  /* Add a vertical scroll bar if content overflows */
    background-color: rgba(12,17,30,0.92); /* Ensure consistent styling */
    padding: 10px;
    border: 1px solid rgba(37,99,235,0.35); /* Match other card styles */
    border-radius: 10px;
    color: white !important;
}

.risk-metrics-window {
    max-height: 300px; /* Same height as ratios for alignment */
    overflow-y: hidden; /* No scroll bar for risk metrics */
    background-color: rgba(12,17,30,0.92);
    padding: 10px;
    border: 1px solid rgba(37,99,235,0.35);
    border-radius: 10px;
    color: white !important;
}

.analysis-json {
    white-space: pre-wrap; /* Wrap long lines */
    word-wrap: break-word; /* Break long words */
    overflow: auto;        /* Add scrolling for large content */
    font-family: monospace; /* Use a monospace font for JSON */
    font-size: 14px;        /* Adjust size to fit content */
    padding: 10px;          /* Add spacing */
    background-color: rgba(15,23,42,0.7); /* Optional: Dark background for better contrast */
    color: white;           /* Set font color to white */
    border: 1px solid rgba(148,163,184,0.18); /* Optional: Border for differentiation */
}

.analysis-markdown {
    color: white;           /* Set font color to white */
    font-size: 16px;        /* Adjust font size for readability */
    line-height: 1.5;       /* Increase line height for better spacing */
    white-space: pre-wrap;  /* Preserve Markdown formatting */
    background-color: rgba(15,23,42,0.7); /* Optional: Dark background */
    padding: 10px;          /* Add spacing */
    border: 1px solid rgba(148,163,184,0.18); /* Optional: Border for differentiation */
}

#chat-window {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 5px;
    background-color: #ffffff;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
}

#portfolio-manager-heading {
    text-align: center; /* Center the text */
    margin: 20px 0; /* Add spacing above and below */
    font-size: 24px; /* Adjust font size */
    font-weight: bold; /* Make it bold */
    color: white; /* Set text color */
}

.styled-table {
    margin: 20px auto;
    border-collapse: collapse;
    width: 100%;
    background-color: #1E1E2E;
    color: #FFFFFF;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: center;
}

.styled-table th {
    background-color: #27293D;
    color: #FFD700;
    font-weight: bold;
    padding: 12px;
    border: 1px solid #2E2E3E;
}

.styled-table td {
    padding: 12px;
    border: 1px solid #2E2E3E;
    background-color: #2B2B40;
    color: #D3D3D3;
}

.styled-table tr:nth-child(even) {
    background-color: #2E2E3E;
}

.styled-table tr:nth-child(odd) {
    background-color: #3E3E55;
}

.styled-table tr:hover {
    background-color: #48486B;
    color: white;
    border: 1px solid #FFD700;
}

.my-portfolio-header {
    font-weight: bold;
    font-size: 1.5rem;
    color: #ffffff;  /* or some theme color */
  }
  
  .my-portfolio-row {
    margin-bottom: 1rem;
  }
  
  .my-portfolio-label {
    font-weight: bold;
    color: #a0aec0; /* A slightly softer white */
  }
  
  .my-portfolio-card {
    background-color: #2d3748; /* A darker card background */
    border: 1px solid #4a5568;
  }
  
  .my-portfolio-card-title {
    color: #ffffff;
    border-bottom: 1px solid #4a5568;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
  }

.portfolio-summary-table,
.portfolio-summary-table th,
.portfolio-summary-table td {
  border: none;
}

.portfolio-summary-table th.col-instrument,
.portfolio-summary-table td.col-instrument {
    width: 40%;
    text-align: left;
    padding-left: 1rem;
}

.portfolio-summary-table th.col-allocation,
.portfolio-summary-table td.col-allocation {
    width: 20%;
    text-align: right;
    padding-right: 1rem;
}

.portfolio-summary-table th.col-value,
.portfolio-summary-table td.col-value {
    width: 40%;
    text-align: right;
    padding-right: 1rem;
}

.portfolio-summary-table th,
.portfolio-summary-table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #4a5568; /* A slightly lighter border */
}

.portfolio-summary-table th:first-child,
.portfolio-summary-table td:first-child {
  border-radius: 0.5rem 0 0 0.5rem;
}

.portfolio-summary-table th:last-child,
.portfolio-summary-table td:last-child {
  border-radius: 0 0.5rem 0.5rem 0;
}

.analysis-markdown p,
.analysis-markdown h1,
.analysis-markdown h2,
.analysis-markdown h3,
.analysis-markdown h4,
.analysis-markdown h5,
.analysis-markdown h6,
.analysis-markdown ul,
.analysis-markdown ol,
.analysis-markdown li {
    color: white !important; /* Force all text elements within markdown to be white */
}

.tab-content .tab-pane .analysis-markdown * { /* Target all descendants */
    background-color: transparent !important; /* Ensure no unwanted background colors on child elements */
}


/* --- FINAL STYLES for Dark Theme Accordion --- */

/* Style for the button (header) of each accordion item */
.accordion-button {
    background-color: rgba(37,99,235,0.35) !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 0 !important;
}

/* Style for the button when the accordion item is OPEN */
.accordion-button:not(.collapsed) {
    background-color: #2563eb !important;
    color: white !important;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* Remove the default blue outline on focus */
.accordion-button:focus {
    box-shadow: none !important;
    border-color: rgba(0,0,0,.125) !important;
}

/* Style for the content area of the accordion */
.accordion-body {
    background-color: rgba(12,17,30,0.92) !important;
    color: white !important;
    padding: 1.5rem;
}

/* Style for the accordion item itself (the container) */
.accordion-item {
    background-color: rgba(12,17,30,0.92) !important;
    border: 1px solid rgba(37,99,235,0.35) !important;
    margin-bottom: 5px;
    border-radius: 5px;
    overflow: hidden;
}

/* This targets the default SVG icon (the arrow) and makes it white */
.accordion-button::after {
    filter: brightness(0) invert(1);
}

.accordion-dark-theme .accordion-item {
    background-color: rgba(12,17,30,0.92) !important;
    border: 1px solid rgba(37,99,235,0.35) !important;
    margin-bottom: 5px;
    border-radius: 5px;
    overflow: hidden;
}

.accordion-dark-theme .accordion-header .accordion-button {
    background-color: rgba(37,99,235,0.35) !important;
    color: white !important;
    font-weight: bold !important;
    box-shadow: none !important;
}

.accordion-dark-theme .accordion-header .accordion-button:not(.collapsed) {
    background-color: #2563eb !important;
    color: white !important;
}

.accordion-dark-theme .accordion-body {
    background-color: rgba(12,17,30,0.92) !important;
    color: white !important;
}

/* This targets the default SVG icon (the arrow) and makes it white */
.accordion-dark-theme .accordion-button::after {
    filter: brightness(0) invert(1);
}

/* --- Live Scores: responsive tables + conditional highlighting --- */
.live-scores-table-wrap {
  max-height: 260px;
  overflow: auto;
}

.live-scores-table {
  width: 100%;
}

.live-scores-table-wrap .table-responsive {
  overflow-x: hidden;
}

.live-scores-table-wrap table {
  table-layout: fixed;
}

.live-scores-table-wrap th,
.live-scores-table-wrap td {
  font-size: 0.82rem;
}

.live-scores-table th,
.live-scores-table td {
  padding: 0.45rem 0.55rem;
}

.live-scores-col-indicator {
  width: 52%;
  white-space: normal;
}

.live-score-cell.live-score--pos {
  background-color: rgba(34, 197, 94, 0.12) !important;
  color: #bbf7d0 !important;
}

.live-score-cell.live-score--pos-strong {
  background-color: rgba(34, 197, 94, 0.22) !important;
  color: #86efac !important;
  font-weight: 600;
}

.live-score-cell.live-score--neg {
  background-color: rgba(239, 68, 68, 0.12) !important;
  color: #fecaca !important;
}

.live-score-cell.live-score--neg-strong {
  background-color: rgba(239, 68, 68, 0.22) !important;
  color: #fca5a5 !important;
  font-weight: 600;
}

.live-score-cell.live-score--neutral {
  color: #e2e8f0 !important;
}

/* --- Fix for 'View Saved Analysis' Dropdown Options --- */

/* This styles the container that holds the list of options */
.view-analysis-dropdown .Select-menu-outer {
    background-color: rgba(12,17,30,0.92); /* Dark background for the dropdown menu */
    border: 1px solid #555;
  }
  
  /* This styles each individual option in the dropdown */
  .view-analysis-dropdown .Select-option {
    background-color: rgba(12,17,30,0.92); /* Dark background for the option */
    color: #d6d6d6;             /* Light grey text color for readability */
  }
  
  /* This styles the option when you hover over it */
  .view-analysis-dropdown .Select-option.is-focused {
    background-color: #0d6efd; /* A blue highlight color on hover */
    color: white;               /* White text on hover */
  }
  
  /* This styles the currently selected value shown in the dropdown box */
  .view-analysis-dropdown .Select-value-label {
      color: white !important; /* Ensures the selected text is always white */
  }

/* Responsive tweaks */
@media (max-width: 991.98px) {
    .custom-nav-link { font-size: 1rem; padding: 8px 10px; }
    .navbar-brand-text { font-size: 1.5rem; }
  }
  
  @media (max-width: 767.98px) {
    #assistant-chatbox {
      right: 8px;
      left: 8px;
      width: auto;         /* full width minus margins */
      max-width: none;
      bottom: 70px;
      height: 60vh;        /* taller on mobile */
    }
    #chat-window { height: calc(60vh - 160px); }
    #toggle-assistant { bottom: 12px; right: 12px; }
  }
  
  img.img-fluid { max-width: 100%; height: auto; }

/* Compact navbar with logo filling the bar */
:root { --nav-height: 72px; }               /* desktop height */

.app-navbar { padding-top: 0; padding-bottom: 0; }
.app-navbar .container { min-height: var(--nav-height); }

.app-navbar .app-navbar-logo { height: var(--nav-height); width: auto; display: block; }

.app-navbar .navbar-brand,
.app-navbar .navbar-nav .nav-link {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}

/* reduce custom link extra vertical padding */
.app-navbar .custom-nav-link { padding-top: 0; padding-bottom: 0; }

/* Responsive: slightly shorter bar on tablets/phones */
@media (max-width: 991.98px) { :root { --nav-height: 60px; } }
@media (max-width: 575.98px) { :root { --nav-height: 52px; } }

/* Allow wrapping for the long nav item only */
.navbar .custom-nav-link-wrap { 
    white-space: normal !important; 
    line-height: 1.1; 
    text-align: center;
  }

/* ===========================
   NEW: Global Dark UI Overrides
   =========================== */

/* NEW: Form controls (Dash dcc.Input, dbc.Input, <input>, <select>, <textarea>) */
input[type="text"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="password"],
.form-control,
select,
textarea {
  background-color: rgba(12,17,30,0.92) !important; /* NEW */
  color: #ffffff !important;            /* NEW */
  border: 1px solid rgba(148,163,184,0.18) !important;    /* NEW */
}
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #bdbdbd !important;            /* NEW */
}
input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  border-color: #2563eb !important;     /* NEW */
  box-shadow: 0 0 0 .15rem rgba(14,86,193,.25) !important; /* NEW */
  outline: none !important;             /* NEW */
}

/* ===========================
   NEW: Dash dcc.Dropdown (React-Select v1 class names)
   =========================== */
.Select-control {                         /* NEW */
  background-color: rgba(12,17,30,0.92) !important;   /* NEW */
  border: 1px solid rgba(148,163,184,0.18) !important;      /* NEW */
  color: #fff !important;                 /* NEW */
}
.Select-placeholder,
.Select-value,
.Select-value-label,
.Select-clear-zone,
.Select-arrow-zone {
  color: #e5e5e5 !important;              /* NEW */
}
.Select-input > input {                   /* NEW */
  color: #fff !important;
}
.Select-menu-outer {                      /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
  color: #fff !important;
}
.Select-option {                          /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  color: #fff !important;
}
.Select-option.is-focused {               /* NEW */
  background-color: rgba(15,23,42,0.7) !important;
}
.Select-option.is-selected {              /* NEW */
  background-color: #2563eb !important;
  color: #fff !important;
}

/* ===========================
   NEW: React-Select v2/v3+ fallback (Dash newer versions)
   =========================== */
[class*="Select__control"], [class*="select__control"] {  /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  border-color: rgba(148,163,184,0.18) !important;
  color: #fff !important;
}
[class*="Select__single-value"], [class*="select__single-value"],
[class*="Select__placeholder"],   [class*="select__placeholder"] {  /* NEW */
  color: #e5e5e5 !important;
}
[class*="Select__menu"], [class*="select__menu"] {          /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  color: #fff !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
}
[class*="Select__option"], [class*="select__option"] {       /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  color: #fff !important;
}
[class*="Select__option--is-focused"], [class*="select__option--is-focused"] { /* NEW */
  background-color: rgba(15,23,42,0.7) !important;
}
[class*="Select__option--is-selected"], [class*="select__option--is-selected"] { /* NEW */
  background-color: #2563eb !important;
  color: #fff !important;
}

/* ===========================
   NEW: Bootstrap menus / Offcanvas / Accordion
   =========================== */
.dropdown-menu {                          /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  color: #fff !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
}
.dropdown-item {                          /* NEW */
  color: #fff !important;
}
.dropdown-item:hover,
.dropdown-item:focus {                     /* NEW */
  background-color: rgba(15,23,42,0.7) !important;
  color: #fff !important;
}
.dropdown-item.active,
.dropdown-item:active {                    /* NEW */
  background-color: #2563eb !important;
  color: #fff !important;
}
.offcanvas,
.offcanvas-header,
.offcanvas-body {                          /* NEW */
  background-color: rgba(9,13,24,0.9) !important;
  color: #fff !important;
  border-color: rgba(15,23,42,0.7) !important;
}
.accordion-item,
.accordion-button,
.accordion-body {                          /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  color: #fff !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
}
.accordion-button:not(.collapsed) {        /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* ===========================
   NEW: Plotly graph placeholders & chrome
   =========================== */
.js-plotly-plot,
.plot-container,
.svg-container {
  background-color: rgba(12,17,30,0.92) !important;    /* NEW */
}
.js-plotly-plot .plotly .bg {              /* NEW */
  fill: rgba(12,17,30,0.92) !important;                /* makes empty/placeholder charts dark */
}
.modebar {                                 /* NEW */
  background-color: rgba(12,17,30,0.92) !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
}

/* ===========================
   NEW: dcc.Loading spinner color tweak (optional)
   =========================== */
.dash-spinner * {                          /* NEW */
  border-color: #2563eb !important;
}

/* ===========================
   NEW: Subtle dark scrollbars (optional)
   =========================== */
::-webkit-scrollbar { width: 8px; height: 8px; }              /* NEW */
::-webkit-scrollbar-track { background: rgba(9,13,24,0.9); }            /* NEW */
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.18); border-radius: 4px; } /* NEW */
::-webkit-scrollbar-thumb:hover { background: #555; }         /* NEW */


.app-navbar {
    background: linear-gradient(135deg, rgba(13,19,33,0.90), rgba(30,64,175,0.35)) !important;
    border-bottom: 1px solid rgba(148,163,184,0.18);
    box-shadow: 0 10px 28px rgba(8,15,40,0.35);
    backdrop-filter: saturate(140%) blur(10px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-navbar .navbar-brand,
.app-navbar .navbar-nav .nav-link {
    color: #e2e8f0 !important;
}

.app-navbar .navbar-nav .nav-link:hover,
.app-navbar .navbar-brand:hover {
    color: #38bdf8 !important;
}

/* Underline animation */
.app-navbar .nav-link { position: relative; padding: 0.45rem 0.75rem; }
.app-navbar .nav-link::after {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -6px; height: 2px;
  background: #38bdf8; transform: scaleX(0); transition: transform 160ms ease; opacity: 0.9;
}
.app-navbar .nav-link:hover::after,
.app-navbar .nav-link.active::after { transform: scaleX(1); }

/* Brand sizing */
.app-navbar-logo { height: 28px; margin-right: 10px; }
.app-navbar-title span:first-child { font-weight: 700; letter-spacing: 0.3px; }
.app-navbar-title span:last-child { font-weight: 500; opacity: 0.9; margin-left: 2px; }

/* User label spacing */
.app-nav-user { opacity: 0.85; margin-left: 8px; }

/* Improve collapse layout spacing on small screens */
.app-navbar-nav { gap: 4px; }



.login-card .form-control {
    background-color: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.35);
    color: #f8fafc;
}

.login-card .form-control:focus {
    background-color: rgba(15, 23, 42, 0.95);
    border-color: #38bdf8;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.25);
}

.login-card .form-label {
    color: #94a3b8;
}
.navbar-user-label {
    color: #cbd5f5;
    padding: 0.5rem 0;
    margin: 0 0.75rem;
    pointer-events: none;
}

.nav-logout-button {
    color: #38bdf8 !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    padding: 0;
}

.nav-logout-button:hover,
.nav-logout-button:focus {
    color: #0ea5e9 !important;
    text-decoration: none;
}
.login-container {
    min-height: 100vh;
    width: 100%;
    padding: 3rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell-row {
    width: 100%;
    max-width: 1100px;
}

.login-copy {
    align-items: center;
}

.login-copy-surface {
    background: linear-gradient(150deg, rgba(59,130,246,0.18), rgba(14,116,144,0.14));
    border: 1px solid rgba(148,163,184,0.16);
    border-radius: 32px;
    padding: 48px;
    box-shadow: 0 30px 60px rgba(8,11,30,0.45);
    backdrop-filter: blur(16px);
}

.login-badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(79,70,229,0.15);
    border: 1px solid rgba(165,180,252,0.35);
    border-radius: 999px;
    color: #cbd5f5;
    margin-bottom: 20px;
}

.login-title {
    font-size: clamp(2rem, 2.8vw, 3rem);
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 18px;
}

.login-subtitle {
    font-size: 1.05rem;
    color: #cbd5f5;
    max-width: 420px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: rgba(13, 25, 45, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 38px 48px rgba(4, 10, 30, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 28px;
}

.login-card .card-body {
    padding: 2.75rem;
}

.login-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-card-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.65);
    padding: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 12px 24px rgba(15,23,42,0.4);
}

.login-card-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.35rem;
}

.login-card-caption {
    color: #cbd5f5;
    font-size: 0.95rem;
}

.login-toggle .btn {
    flex: 1;
    border-radius: 999px !important;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.auth-toggle-button {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.32);
    color: #cbd5f5;
}

.auth-toggle-button.active {
    background: linear-gradient(120deg, #3b82f6, #6366f1);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(59,130,246,0.4);
}

.auth-primary-button {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 16px 30px rgba(59,130,246,0.35);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
    color: #94a3b8;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.35), transparent);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
    transform: rotate(180deg);
}

.auth-divider-text {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.google-button {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.google-button:hover,
.google-button:focus {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.55);
}

.google-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: conic-gradient(#4285F4 0deg 90deg, #34A853 90deg 180deg, #FBBC05 180deg 270deg, #EA4335 270deg 360deg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.85rem;
    position: relative;
}

.google-icon::after {
    content: "G";
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #0f172a;
}

.google-label {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .login-card .card-body {
        padding: 2rem;
    }

    .login-container {
        padding: 2rem 1.25rem;
    }
}
.chart-wrapper,
.macro-chart-container {
    width: 100%;
    min-width: 0;
    overflow: visible;
}

.chart-wrapper .js-plotly-plot,
.chart-wrapper .plot-container,
.chart-wrapper .svg-container,
.macro-chart-container .js-plotly-plot,
.macro-chart-container .plot-container,
.macro-chart-container .svg-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Home dashboard grid and cards */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 16px;
}
@media (max-width: 991.98px) {
  .home-grid { grid-template-columns: 1fr; }
}

.home-card {
  background: rgba(13, 19, 33, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(2, 8, 20, 0.45);
  border-color: rgba(148, 163, 184, 0.35);
}
.home-card__header {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #c7d2fe; /* indigo-200 */
}
.home-card__body {
  opacity: 0.95;
  font-size: 0.95rem;
}

/* Home news items */
.home-news-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
}
.home-news-item:hover {
  background: rgba(59,130,246,0.06);
}
.home-news-item img {
  flex: 0 0 auto;
  }

/* Recent buys/sells list items */
.recent-analysis-item {
  background: rgba(12,17,30,0.96) !important;
  border: 1px solid rgba(148,163,184,0.22) !important;
  color: #e2e8f0 !important;
}
.recent-analysis-item:hover {
  background: rgba(30,64,175,0.65) !important;
}

/* Fallback: style recent buys/sells list items even without explicit class */
#recent-buys-container .list-group-item,
#recent-sells-container .list-group-item {
  background: rgba(12,17,30,0.96) !important;
  border: 1px solid rgba(148,163,184,0.22) !important;
  color: #e2e8f0 !important;
}

/* Force dark galaxy background for Bootstrap dark tables (Macro & elsewhere) */
.table-dark,
.table-dark thead,
.table-dark tbody,
.table-dark tr,
.table-dark th,
.table-dark td {
  background-color: rgba(12,17,30,0.96) !important;
  color: #e2e8f0 !important;
}
.table-dark thead th,
.table-dark tbody td {
  border-color: rgba(30,64,175,0.45) !important;
}

/* Global dark table override to match galaxy theme */
.table-dark {
  background-color: rgba(15,23,42,0.92) !important;
  color: #e2e8f0 !important;
}
.table-dark thead th,
.table-dark tbody td {
  border-color: rgba(30,64,175,0.45) !important;
}

/* Neutralize link styling inside home cards (no green underlines) */
.home-card a,
.home-card a:link,
.home-card a:visited {
  text-decoration: none !important;
  color: inherit !important;
}
.home-card a:hover,
.home-card a:focus {
  text-decoration: underline;
  text-decoration-color: rgba(148,163,184,0.45);
}

/* Subheader for sections within a card (e.g., Returns) */
.home-card__subheader {
  margin-top: 6px;
  margin-bottom: 4px;
  font-weight: 600;
  color: #e2e8f0;
}

/* Prevent underlines and keep link color neutral on home cards */
.home-card-link, .home-card-link:link, .home-card-link:visited,
.home-card-link:hover, .home-card-link:focus {
  text-decoration: none !important;
  color: inherit !important;
}

/* Navbar adjustments: center brand, actions on right */
.app-navbar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.app-navbar-brand {
  margin: 0 auto;
  display: flex;
  align-items: center;
}
.app-navbar-logo {
  display: block;
}
.app-navbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-sidebar-toggle {
  border-color: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}
.app-sidebar-toggle:hover,
.app-sidebar-toggle:focus {
  border-color: rgba(148, 163, 184, 0.7);
  color: #f8fafc;
}
.app-pages-dropdown .dropdown-toggle {
  color: #e2e8f0;
}
.nav-logout-button {
  padding: 0.25rem 0.5rem;
}

.app-sidebar .offcanvas-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(10, 16, 28, 0.98);
  color: #e2e8f0;
}
.app-sidebar .offcanvas-header .btn-close {
  filter: invert(1);
}
.app-sidebar .offcanvas-body {
  background: rgba(10, 16, 28, 0.98);
  color: #e2e8f0;
  padding: 14px 16px;
}
.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.app-sidebar-nav .nav-link {
  color: #cbd5f5;
  padding: 8px 12px;
  border-radius: 10px;
}
.app-sidebar-nav .nav-link.active {
  background: rgba(59, 130, 246, 0.3);
  color: #f8fafc;
}
.app-sidebar-divider {
  border-color: rgba(148, 163, 184, 0.2);
  margin: 16px 0 12px;
}
.app-sidebar-logout {
  color: #f8fafc;
  text-decoration: none;
  padding: 0;
  text-align: left;
}
.app-sidebar-logout:hover,
.app-sidebar-logout:focus {
  color: #38bdf8;
  text-decoration: none;
}

/* Pairwise Analysis dropdown: ensure menu is scrollable and not clipped */
#pair-compare-tickers .Select-menu-outer,
#pair-compare-tickers .Select__menu {
  max-height: 260px;
  overflow-y: auto;
  z-index: 9999;
}

/* Boot overlay shown after sign-in while preloading pages */
.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(32,44,82,0.75), rgba(8,12,24,0.98));
  backdrop-filter: blur(6px);
}

.boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 36px;
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.2);
  background: rgba(8,14,30,0.85);
  box-shadow: 0 30px 60px rgba(2,6,23,0.55);
  text-align: center;
  max-width: 420px;
}

.boot-logo {
  width: 220px;
  height: auto;
}

.boot-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(226,232,240,0.2);
  border-top-color: #60a5fa;
  animation: boot-spin 1s linear infinite;
}

.boot-text {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.4;
}

@keyframes boot-spin {
  to { transform: rotate(360deg); }
}

.app-nav-link {
  color: #dbe7ff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.app-nav-link:hover,
.app-nav-link:focus {
  color: #ffffff;
  text-decoration: none;
}

.login-secondary-button {
  margin-top: 22px;
  border-color: rgba(226, 232, 240, 0.4);
  color: #f8fafc;
  align-self: flex-start;
}

.login-secondary-button:hover,
.login-secondary-button:focus {
  color: #0f172a;
  background: #f8fafc;
  border-color: #f8fafc;
}

.build-notes-lead {
  color: #cbd5f5;
  line-height: 1.75;
  margin-bottom: 0;
  font-size: 1.03rem;
}

.build-notes-list {
  margin: 18px 0 0;
  padding-left: 1.25rem;
  color: #dbe7ff;
  line-height: 1.8;
}

.build-notes-card {
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(24, 38, 69, 0.96), rgba(9, 15, 28, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.build-notes-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.build-notes-card-kickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.build-notes-card-kicker,
.build-notes-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(125, 211, 252, 0.2);
  color: #dbeafe;
  font-size: 0.82rem;
  line-height: 1.2;
}

.build-notes-chip--wide {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.2);
  overflow-wrap: anywhere;
}

.build-notes-card-title,
.build-notes-hero-title,
.build-notes-markdown h2 {
  font-family: 'Fraunces', Georgia, serif;
}

.build-notes-card-title {
  font-size: 1.5rem;
  line-height: 1.18;
  color: #f8fafc;
  margin-bottom: 12px;
}

.build-notes-card-summary {
  color: #cbd5f5;
  line-height: 1.75;
  margin-bottom: 20px;
  min-height: 112px;
}

.build-notes-card-button {
  width: 100%;
}

.build-notes-article-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 56px;
}

.build-notes-article-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: stretch;
  margin: 0 auto 28px;
}

.build-notes-hero-copy,
.build-notes-hero-visual {
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 35%),
    linear-gradient(180deg, rgba(12, 19, 36, 0.98), rgba(7, 11, 22, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.35);
}

.build-notes-hero-copy {
  padding: 34px;
}

.build-notes-hero-visual {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.build-notes-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.24);
  color: #bfdbfe;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.build-notes-hero-title {
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  line-height: 0.98;
  color: #f8fafc;
  margin-bottom: 16px;
  max-width: 12ch;
}

.build-notes-hero-summary {
  color: #dbe7ff;
  line-height: 1.8;
  font-size: 1.08rem;
  max-width: 64ch;
  margin-bottom: 20px;
}

.build-notes-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.build-notes-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 24px;
}

.build-notes-stat-card {
  padding: 16px 16px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.build-notes-stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
  margin-bottom: 8px;
}

.build-notes-stat-value {
  color: #f8fafc;
  line-height: 1.45;
  font-weight: 600;
}

.build-notes-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.build-notes-image-frame {
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 22px;
  padding: 10px;
  box-shadow: 0 20px 42px rgba(2, 6, 23, 0.35);
}

.build-notes-image-frame--hero,
.build-notes-image-frame--hero-surface {
  grid-column: 1 / -1;
}

.build-notes-image {
  width: 100%;
  display: block;
  border-radius: 14px;
}

.build-notes-pull-quote {
  margin: 0;
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(2, 132, 199, 0.14), rgba(15, 23, 42, 0.82));
  border: 1px solid rgba(125, 211, 252, 0.16);
  color: #eff6ff;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.45rem;
  line-height: 1.4;
}

.build-notes-article-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.build-notes-article-rail {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.build-notes-rail-block,
.build-notes-next-panel {
  background: rgba(7, 11, 22, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: 0 20px 48px rgba(2, 6, 23, 0.24);
}

.build-notes-rail-title,
.build-notes-next-title {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 12px;
  font-weight: 700;
}

.build-notes-outline,
.build-notes-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
}

.build-notes-outline-item,
.build-notes-highlight-item {
  color: #dbe7ff;
  line-height: 1.55;
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.build-notes-outline-item:first-child,
.build-notes-highlight-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.build-notes-outline-item--sub {
  padding-left: 14px;
  color: #bfdbfe;
}

.build-notes-outline-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.build-notes-outline-link:hover,
.build-notes-outline-link:focus {
  color: #f8fafc;
  text-decoration: none;
}

.build-notes-article-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.build-notes-article-gallery-wrap {
  background: rgba(7, 11, 22, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 26px;
  padding: 18px;
}

.build-notes-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.build-notes-article-body {
  background:
    linear-gradient(180deg, rgba(12, 19, 36, 0.98), rgba(7, 11, 22, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 28px;
  padding: 34px 38px;
  box-shadow: 0 28px 66px rgba(2, 6, 23, 0.32);
}

.build-notes-markdown {
  color: #e2e8f0;
  line-height: 1.9;
  font-size: 1.05rem;
}

.build-notes-markdown h2 {
  color: #f8fafc;
  font-size: 2rem;
  line-height: 1.05;
  margin-top: 2.6rem;
  margin-bottom: 1rem;
}

.build-notes-markdown h3 {
  color: #e0f2fe;
  font-size: 1.18rem;
  margin-top: 1.8rem;
  margin-bottom: 0.7rem;
  letter-spacing: 0.02em;
}

.build-notes-markdown p,
.build-notes-markdown li,
.build-notes-markdown ol {
  color: #dbe7ff;
}

.build-notes-markdown ul,
.build-notes-markdown ol {
  padding-left: 1.25rem;
}

.build-notes-markdown strong {
  color: #f8fafc;
}

.build-notes-markdown hr {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  margin: 2rem 0;
}

.build-notes-markdown blockquote {
  margin: 1.8rem 0;
  padding: 18px 22px;
  border-left: 3px solid #38bdf8;
  background: rgba(8, 47, 73, 0.22);
  border-radius: 0 18px 18px 0;
  color: #f0f9ff;
  font-size: 1.08rem;
}

.build-notes-markdown code {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 0.12rem 0.38rem;
  color: #bfdbfe;
}

.build-notes-markdown pre {
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  padding: 16px;
  overflow-x: auto;
}

.build-notes-markdown pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

.build-notes-markdown a {
  color: #7dd3fc;
}

.build-notes-heading-anchor {
  scroll-margin-top: 96px;
}

.build-notes-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 1100px) {
  .build-notes-article-hero,
  .build-notes-article-layout {
    grid-template-columns: 1fr;
  }

  .build-notes-article-rail {
    position: static;
  }
}

@media (max-width: 992px) {
  .build-notes-gallery,
  .build-notes-stat-grid {
    grid-template-columns: 1fr;
  }

  .build-notes-image-frame--hero {
    grid-column: auto;
  }

  .build-notes-card-summary {
    min-height: 0;
  }

  .build-notes-article-body,
  .build-notes-hero-copy {
    padding: 24px;
  }
}
