body { font-family: Arial, Helvetica, sans-serif; background: #0d1117; color: #e6edf3; margin: 0; }
        a { color: #7cc7ff; }
        .wrap { max-width: 1280px; margin: 0 auto; padding: 24px; }
        .hero { padding: 24px; border: 1px solid #30363d; background: linear-gradient(180deg, #161b22 0%, #121821 100%); border-radius: 12px; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18); }
        .muted { color: #9da7b3; }
        .grid { display: grid; gap: 18px; }
        .grid-2 { grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr); }
        .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .hero-title-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); align-items: stretch; }
        .execution-grid { grid-template-columns: minmax(320px, 1.05fr) minmax(320px, 0.95fr); }
        .card { border: 1px solid #30363d; background: #161b22; border-radius: 12px; padding: 18px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16); }
        .execution-card { min-width: 0; }
        .hero-run-card { position: relative; overflow: hidden; }
        .hero-run-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, #1f6feb 0%, #3fb950 100%); }
        .hero-card-topline { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 14px; }
        .hero-rank-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: rgba(31, 111, 235, 0.14); color: #7cc7ff; font-size: 12px; font-weight: 700; }
        .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
        label { display: block; font-size: 12px; margin-bottom: 6px; color: #9da7b3; }
        input, select { width: 100%; box-sizing: border-box; background: #0d1117; color: #e6edf3; border: 1px solid #30363d; border-radius: 8px; padding: 10px 12px; }
        button, .action-btn, .table-action { display: inline-flex; align-items: center; justify-content: center; background: #238636; color: white; border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; text-decoration: none; font-weight: 700; transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease; }
        button:hover, .action-btn:hover, .table-action:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22); }
        .secondary-btn { background: #1f6feb; }
        .secondary-btn.copy-success { background: #238636; box-shadow: 0 0 0 1px rgba(35, 134, 54, 0.35); }
        .secondary-btn.copy-error { background: #da3633; box-shadow: 0 0 0 1px rgba(218, 54, 51, 0.35); }
        .table-action { padding: 7px 10px; font-size: 13px; white-space: nowrap; }
.habit-refresh-btn { padding: 9px 12px; white-space: nowrap; }
.speed-strip { border-color: rgba(124, 199, 255, 0.18); background: linear-gradient(180deg, rgba(22, 27, 34, 0.96) 0%, rgba(13, 17, 23, 0.96) 100%); }
.speed-strip-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.speed-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.speed-hint { margin-top: 10px; line-height: 1.45; }
.habit-hidden { display: none; }
.top-run-trigger { min-width: 112px; }
.route-pref-card { border-color: rgba(124, 199, 255, 0.14); }
.route-pref-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.route-pref-toggle { display: inline-flex; gap: 6px; padding: 4px; border: 1px solid #30363d; border-radius: 999px; background: #0d1117; }
.route-pref-btn { padding: 7px 11px; border-radius: 999px; background: transparent; color: #9da7b3; box-shadow: none; }
.route-pref-btn:hover { background: rgba(124, 199, 255, 0.10); box-shadow: none; transform: none; }
.route-pref-btn.active { background: #1f6feb; color: #ffffff; }
        table { width: 100%; border-collapse: collapse; }
        th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #30363d; font-size: 14px; vertical-align: top; }
        th { color: #9da7b3; font-weight: 600; }
        .pill { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #1f2937; color: #c9d1d9; font-size: 12px; }
        .good { color: #3fb950; font-weight: 700; }
        .small { font-size: 12px; }
        .stats-row { display: flex; flex-wrap: wrap; gap: 10px; }
        .stat-chip { display: inline-flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid #30363d; background: #0d1117; min-width: 120px; }
        .hero-profit-chip { border-color: rgba(63, 185, 80, 0.28); box-shadow: inset 0 0 0 1px rgba(63, 185, 80, 0.08); }
        .risk { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
        .risk-low { background: rgba(63, 185, 80, 0.12); color: #3fb950; }
        .risk-medium { background: rgba(210, 153, 34, 0.12); color: #d29922; }
        .risk-high { background: rgba(248, 81, 73, 0.12); color: #f85149; }
        .signal-row { display: flex; flex-wrap: wrap; gap: 8px; }
        .signal-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
        .fresh-live { background: rgba(63, 185, 80, 0.12); color: #3fb950; border-color: rgba(63, 185, 80, 0.25); }
        .fresh-recent { background: rgba(31, 111, 235, 0.12); color: #7cc7ff; border-color: rgba(124, 199, 255, 0.22); }
        .fresh-stale { background: rgba(210, 153, 34, 0.12); color: #d29922; border-color: rgba(210, 153, 34, 0.22); }
        .depth-deep { background: rgba(63, 185, 80, 0.12); color: #3fb950; border-color: rgba(63, 185, 80, 0.25); }
        .depth-ok { background: rgba(31, 111, 235, 0.12); color: #7cc7ff; border-color: rgba(124, 199, 255, 0.22); }
        .depth-thin { background: rgba(210, 153, 34, 0.12); color: #d29922; border-color: rgba(210, 153, 34, 0.22); }
        .confidence-high { background: rgba(63, 185, 80, 0.14); color: #3fb950; border-color: rgba(63, 185, 80, 0.28); }
        .confidence-medium { background: rgba(31, 111, 235, 0.12); color: #7cc7ff; border-color: rgba(124, 199, 255, 0.24); }
        .confidence-low { background: rgba(210, 153, 34, 0.12); color: #d29922; border-color: rgba(210, 153, 34, 0.24); }
        .wallet-ready, .asset-ready, .asset-zero-buy, .execution-ready, .execution-owned, .execution-zero-buy { background: rgba(63, 185, 80, 0.12); color: #3fb950; border-color: rgba(63, 185, 80, 0.25); }
        .wallet-unknown, .asset-unknown, .asset-none, .execution-unknown { background: rgba(124, 199, 255, 0.10); color: #7cc7ff; border-color: rgba(124, 199, 255, 0.20); }
        .wallet-short, .wallet-caution, .asset-partial, .asset-partial-owned, .execution-blocked { background: rgba(210, 153, 34, 0.12); color: #d29922; border-color: rgba(210, 153, 34, 0.24); }
        .primary-run-card { grid-column: 1 / -1; border-color: rgba(63, 185, 80, 0.42); background: linear-gradient(180deg, rgba(14, 40, 24, 0.88) 0%, rgba(22, 27, 34, 0.98) 42%, rgba(13, 17, 23, 0.98) 100%); box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(63, 185, 80, 0.10); }
        .primary-run-card h3 { font-size: 26px; }
        .primary-run-card .hero-rank-pill { background: rgba(63, 185, 80, 0.16); color: #7ee787; border: 1px solid rgba(63, 185, 80, 0.30); }
        .primary-run-card .action-btn { font-size: 16px; padding: 12px 18px; }
        .execution-callout { display: grid; gap: 4px; margin: 0 0 12px 0; padding: 12px 13px; border: 1px solid rgba(63, 185, 80, 0.22); border-radius: 12px; background: rgba(63, 185, 80, 0.08); }
        .execution-callout strong { color: #7ee787; }
        .execution-callout span { color: #9da7b3; font-size: 12px; line-height: 1.45; }
        .confidence-personal-match { box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.24), 0 0 18px rgba(63, 185, 80, 0.10); }
        .confidence-personal-caution { opacity: 0.82; }
        .personal-match-route { border-color: rgba(63, 185, 80, 0.22) !important; }

        .why-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px 0; }
        .why-chip { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .01em; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.045); color: var(--muted); }
        .why-volume { color: #8bd5ff; border-color: rgba(139,213,255,0.20); background: rgba(139,213,255,0.08); }
        .why-spread { color: #d2a8ff; border-color: rgba(210,168,255,0.20); background: rgba(210,168,255,0.08); }
        .why-fresh { color: #7ee787; border-color: rgba(126,231,135,0.20); background: rgba(126,231,135,0.08); }
        .why-confidence { color: #f2cc60; border-color: rgba(242,204,96,0.20); background: rgba(242,204,96,0.08); }
        .trust-note-stack { display: grid; gap: 8px; }
        .trust-note-stack.compact { gap: 6px; }
        .trust-note { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid #30363d; border-radius: 10px; background: #0d1117; }
        .trust-note.compact { padding: 9px 10px; }
        .trust-note strong { font-size: 12px; color: #e6edf3; }
        .trust-note span { font-size: 12px; color: #9da7b3; line-height: 1.45; }
        .table-trust-stack { display: grid; gap: 4px; }
        .progress-track { height: 12px; border-radius: 999px; overflow: hidden; background: #0d1117; border: 1px solid #30363d; }
        .progress-fill { height: 100%; background: linear-gradient(90deg, #1f6feb 0%, #3fb950 100%); }
        .quick-summary { margin-top: 14px; padding: 14px; border: 1px solid #30363d; border-radius: 10px; background: #0d1117; }
        .trust-summary-card { border-color: rgba(31, 111, 235, 0.22); box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.06); }
        .checklist-box { white-space: pre-line; font-family: Consolas, Monaco, monospace; background: #0d1117; border: 1px solid #30363d; border-radius: 10px; padding: 14px; line-height: 1.55; overflow-x: auto; }
        .step-list { margin: 0; padding-left: 20px; }
        .step-list li + li { margin-top: 10px; }
        ul { margin: 0; padding-left: 18px; }
        li + li { margin-top: 8px; }

        .identity-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 13px; color: #9da7b3; }
        .identity-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #30363d; border-radius: 999px; background: #161b22; color: #e6edf3; text-decoration: none; }
        .identity-pill:hover { background: rgba(124, 199, 255, 0.08); }
        .identity-panel { border-color: rgba(124, 199, 255, 0.18); background: linear-gradient(180deg, rgba(22, 27, 34, 0.98) 0%, rgba(13, 17, 23, 0.98) 100%); }
        .identity-panel-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
        .identity-main { display: flex; gap: 13px; align-items: center; min-width: 0; }
        .character-portrait { width: 76px; height: 76px; border-radius: 14px; object-fit: cover; flex: 0 0 auto; border: 1px solid rgba(124, 199, 255, 0.28); background: #0d1117; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22); }
        .character-portrait-placeholder { display: inline-flex; align-items: center; justify-content: center; color: #7cc7ff; font-size: 22px; }
        .identity-copy { min-width: 0; }
        .identity-copy strong { display: block; overflow-wrap: anywhere; }
        .identity-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
        .route-control-card .merged-route-pref { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(48, 54, 61, 0.72); }
        .hero-identity-panel { align-self: stretch; }
        .site-footer { margin-top: 28px; padding-top: 4px; }
        .site-footer-panel { border-color: rgba(124, 199, 255, 0.12); background: rgba(22, 27, 34, 0.72); }
        .site-footer-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
        .site-footer-links { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
        .execution-helper-card { border-color: rgba(124, 199, 255, 0.18); background: linear-gradient(180deg, rgba(22, 27, 34, 0.98) 0%, rgba(13, 17, 23, 0.98) 100%); }
        .execution-helper-card .signal-row { margin: 12px 0 0 0; }
        .execution-helper-list { margin-top: 12px; padding-left: 18px; color: #9da7b3; font-size: 13px; line-height: 1.45; }
        .execution-helper-list li + li { margin-top: 7px; }
        .active-run-banner { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin: 0 0 14px 0; padding: 13px 14px; border: 1px solid rgba(63, 185, 80, 0.34); border-radius: 12px; background: linear-gradient(90deg, rgba(63, 185, 80, 0.14) 0%, rgba(31, 111, 235, 0.10) 100%); }
        .active-run-banner strong { display: block; color: #7ee787; margin: 3px 0; }
        .active-run-banner span { display: block; color: #9da7b3; font-size: 12px; line-height: 1.45; }
        .active-run-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
        .commit-hidden { display: none !important; }
        .active-run-card { border-color: rgba(63, 185, 80, 0.56) !important; box-shadow: 0 0 0 1px rgba(63, 185, 80, 0.18), 0 18px 42px rgba(0, 0, 0, 0.22); }
        .active-run-card .hero-rank-pill { background: rgba(63, 185, 80, 0.18); color: #7ee787; border: 1px solid rgba(63, 185, 80, 0.32); }
        .has-active-run .route-dimmed { opacity: 0.44; filter: saturate(0.75); transition: opacity 0.18s ease, filter 0.18s ease; }
        .has-active-run .route-dimmed:hover { opacity: 0.82; filter: none; }
        .has-active-run .active-run-card .personal-route-action { background: #238636; }
        .has-active-run .route-dimmed .personal-route-action { background: #1f6feb; }
        @media (max-width: 960px) {
            .grid-2, .grid-3, .execution-grid, .hero-title-grid { grid-template-columns: 1fr; }
            .hero-card-topline { align-items: flex-start; flex-direction: column; }
            .speed-strip-row { flex-direction: column; align-items: flex-start; }
            .speed-actions { justify-content: flex-start; }
            .identity-panel-row { align-items: flex-start; flex-direction: column; }
            .identity-main { align-items: flex-start; }
            .character-portrait { width: 64px; height: 64px; border-radius: 12px; }
            .identity-panel-actions { justify-content: flex-start; }
            .route-pref-row { align-items: flex-start; flex-direction: column; }
            .site-footer-row { align-items: flex-start; flex-direction: column; }
            .site-footer-links { justify-content: flex-start; }
            .active-run-banner { align-items: flex-start; flex-direction: column; }
            .active-run-actions { justify-content: flex-start; }
            .route-pref-toggle { width: 100%; justify-content: space-between; }
            .route-pref-btn { flex: 1; }
        }


/* Extracted spacing/layout helpers from former inline styles */
.page-title { margin-top: 0; margin-bottom: 10px; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.section-heading { margin-top: 24px; margin-bottom: 10px; }
.section-heading-spacious { margin-top: 28px; margin-bottom: 10px; }
.section-heading h2, .section-heading-spacious h2 { margin: 0 0 8px 0; }
.section-heading p, .section-heading-spacious p { margin: 0; }
.card-title { margin: 4px 0 6px 0; }
.run-title { margin: 4px 0 0 0; }
.route-line { margin: 0 0 10px 0; }
.route-summary { margin: 0 0 14px 0; }
.no-margin { margin: 0; }
.flex-between-start { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.flex-between-start-spaced { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.flex-between-tight { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.table-scroll { overflow-x: auto; }

/* Phase 2.9b: cargo top-up and route diversity helpers */
.cargo-topup-card { display: grid; gap: 4px; padding: 12px 13px; border: 1px solid rgba(124, 199, 255, 0.24); border-radius: 12px; background: rgba(31, 111, 235, 0.08); }
.cargo-topup-card strong { color: #7cc7ff; }
.cargo-topup-card.compact { padding: 10px 11px; }
.cargo-topup-card.compact span { display: block; line-height: 1.45; }
.topup-table-note { color: #7cc7ff; }

/* Phase 2.9d: decision score labels and colours */
.decision-score-chip,
.decision-score-cell {
    border-color: rgba(157, 167, 179, 0.24);
}

.decision-score-chip .decision-score-value,
.decision-score-cell .decision-score-value {
    font-size: 20px;
    line-height: 1;
    letter-spacing: -0.02em;
}

.decision-score-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 3px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    border: 1px solid transparent;
}

.score-excellent {
    border-color: rgba(63, 185, 80, 0.48) !important;
    background: rgba(46, 160, 67, 0.12) !important;
}
.score-excellent .decision-score-value,
.score-excellent .decision-score-label {
    color: #7ee787;
}
.score-excellent .decision-score-label {
    border-color: rgba(63, 185, 80, 0.38);
    background: rgba(46, 160, 67, 0.16);
}

.score-strong {
    border-color: rgba(124, 199, 255, 0.42) !important;
    background: rgba(31, 111, 235, 0.11) !important;
}
.score-strong .decision-score-value,
.score-strong .decision-score-label {
    color: #7cc7ff;
}
.score-strong .decision-score-label {
    border-color: rgba(124, 199, 255, 0.32);
    background: rgba(31, 111, 235, 0.15);
}

.score-decent {
    border-color: rgba(210, 153, 34, 0.44) !important;
    background: rgba(210, 153, 34, 0.10) !important;
}
.score-decent .decision-score-value,
.score-decent .decision-score-label {
    color: #e3b341;
}
.score-decent .decision-score-label {
    border-color: rgba(210, 153, 34, 0.36);
    background: rgba(210, 153, 34, 0.14);
}

.score-weak {
    border-color: rgba(219, 109, 40, 0.38) !important;
    background: rgba(219, 109, 40, 0.08) !important;
}
.score-weak .decision-score-value,
.score-weak .decision-score-label {
    color: #ffa657;
}
.score-weak .decision-score-label {
    border-color: rgba(219, 109, 40, 0.30);
    background: rgba(219, 109, 40, 0.12);
}

.score-ignore {
    border-color: rgba(139, 148, 158, 0.24) !important;
    background: rgba(139, 148, 158, 0.06) !important;
}
.score-ignore .decision-score-value,
.score-ignore .decision-score-label {
    color: #8b949e;
}
.score-ignore .decision-score-label {
    border-color: rgba(139, 148, 158, 0.22);
    background: rgba(139, 148, 158, 0.10);
}

td.decision-score-cell {
    min-width: 86px;
    border-left: 3px solid transparent;
}

td.decision-score-cell .decision-score-value {
    font-size: 17px;
}
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    color: #7cc7ff;
}

.sort-indicator {
    display: inline-block;
    width: 14px;
    margin-left: 4px;
    font-size: 10px;
    line-height: 1;
    opacity: 0.55;
    vertical-align: middle;
    text-align: center;
}

th.sortable.sort-active .sort-indicator {
    opacity: 1;
    color: #7cc7ff;
}


/* === START: PHASE 3.1 CHARACTER DISTANCE TO SELECTED HUB === */
.signal-badge.location-ready {
    border-color: rgba(63, 185, 80, 0.32);
    background: rgba(63, 185, 80, 0.12);
    color: #7ee787;
}

.signal-badge.location-unknown {
    border-color: rgba(210, 153, 34, 0.32);
    background: rgba(210, 153, 34, 0.10);
    color: #e3b341;
}
/* === END: PHASE 3.1 CHARACTER DISTANCE TO SELECTED HUB === */

/* === START: MERGED ROUTE CONTROL PANEL === */
.route-control-merged {
    padding: 16px;
}

/* === START: PHASE 3.2F WALLET FILTER LAYOUT BALANCE === */
.route-control-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(180px, 1fr);
    gap: 16px;
    align-items: center;
}

.route-control-filters {
    min-width: 0;
}

.route-control-filters .filters {
    display: grid;
    grid-template-columns: minmax(145px, 0.9fr) minmax(110px, 0.7fr) minmax(260px, 1.65fr) auto;
    gap: 10px;
    align-items: end;
}

.route-control-stats {
    min-width: 0;
}

.route-control-stats .stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}
/* === END: PHASE 3.2F WALLET FILTER LAYOUT BALANCE === */

@media (max-width: 1100px) {
    .route-control-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .route-control-stats .stats-row,
    .route-control-badges {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .route-control-filters .filters {
        grid-template-columns: 1fr 1fr;
    }

    .wallet-filter-group,
    .filter-action {
        grid-column: 1 / -1;
    }
}
/* === END: MERGED ROUTE CONTROL PANEL === */

/* === START: CONTROL PANEL BADGES === */
.route-control-badges {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.control-badge {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.08);
}

.control-badge.highlight {
    background: rgba(0, 255, 180, 0.08);
    border-color: rgba(0, 255, 180, 0.25);
    color: #7fffd4;
    font-weight: 600;
}
/* === END: CONTROL PANEL BADGES === */
/* === START: CONTROL PANEL UX REFINEMENT === */

.refined-filters {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.filter-group label {
    font-size: 11px;
    color: #888;
    display: block;
    margin-bottom: 4px;
}

.filter-group select {
    width: 100%;
}

.filter-action {
    display: flex;
    align-items: flex-end;
}

.primary-action-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    background: linear-gradient(135deg, #00c8ff, #00ffa2);
    border: none;
    color: #002b36;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.primary-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 200, 255, 0.25);
}

.primary-action-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* tighten overall panel */
.route-control-merged {
    padding: 14px 16px;
}

/* badges alignment tweak */
.route-control-badges {
    gap: 8px;
}

/* mobile refinement */
@media (max-width: 900px) {
    .refined-filters {
        grid-template-columns: 1fr;
    }

    .filter-action {
        justify-content: flex-start;
    }

    .primary-action-btn {
        width: 100%;
    }
}

/* === END: CONTROL PANEL UX REFINEMENT === */
/* === START: BEST RUN PRIMARY CARD STABILITY === */
#topRoutesGrid .primary-run-card {
    grid-column: 1 / -1;
    order: -10;
}

#topRoutesGrid .personal-route-card:not(.primary-run-card) {
    order: 0;
}
/* === END: BEST RUN PRIMARY CARD STABILITY === */

/* === START: SITE NAV AND STATIC PAGES === */
.site-nav {
    margin: 14px 0 18px;
}

.site-nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    padding: 10px 0 8px;
    border-bottom: 1px solid rgba(124, 199, 255, 0.14);
}

.site-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 0 7px;
    color: #9da7b3;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    transition: color 0.16s ease, border-color 0.16s ease;
}

.site-nav-link:hover {
    color: #e6edf3;
    border-bottom-color: rgba(124, 199, 255, 0.28);
}

.site-nav-link.active {
    color: #7cc7ff;
    border-bottom-color: #7cc7ff;
}

.page-hero {
    margin-bottom: 0;
}

.page-intro {
    max-width: 760px;
    line-height: 1.55;
}

.page-content-grid {
    display: grid;
    gap: 14px;
}

.page-content-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
}

.page-content-card p {
    margin: 0 0 10px;
    line-height: 1.55;
}

.page-content-card p:last-child {
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .site-nav-inner {
        gap: 12px;
        align-items: center;
    }

    .site-nav-link {
        flex: 0 0 auto;
    }
}
/* === END: SITE NAV AND STATIC PAGES === */

/* === START: SHARED TITLE PANEL PAGE ORDER === */
.page-hero-under-nav {
    margin-top: 18px;
}
/* === END: SHARED TITLE PANEL PAGE ORDER === */
/* === START: UPDATE LOG UPGRADE === */

.update-timeline {
    display: grid;
    gap: 18px;
}

.update-entry {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 14px;
    align-items: start;
}

.update-date {
    font-size: 11px;
    color: #7cc7ff;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-top: 6px;
}

.update-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.update-impact {
    font-weight: 600;
    margin-bottom: 10px;
    color: #e6edf3;
}

.update-list {
    margin: 0 0 12px 18px;
    color: #9da7b3;
}

.update-why {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(124, 199, 255, 0.18);
    border-radius: 10px;
    background: rgba(31, 111, 235, 0.08);
}

.update-why strong {
    display: block;
    margin-bottom: 4px;
    color: #7cc7ff;
}

.update-why p {
    margin: 0;
    font-size: 13px;
    color: #9da7b3;
}

/* upcoming section */
.update-entry.upcoming .update-date {
    color: #7ee787;
}

.update-entry.upcoming .update-card {
    border-color: rgba(63, 185, 80, 0.32);
    box-shadow: inset 0 0 0 1px rgba(63, 185, 80, 0.08);
}

/* mobile */
@media (max-width: 720px) {
    .update-entry {
        grid-template-columns: 1fr;
    }

    .update-date {
        margin-bottom: 6px;
    }
}

/* === END: UPDATE LOG UPGRADE === */
/* === START: PHASE 3.2B DECISION CONFIDENCE UI === */
.fill-high {
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
    border-color: rgba(63, 185, 80, 0.25);
}

.fill-medium {
    background: rgba(31, 111, 235, 0.12);
    color: #7cc7ff;
    border-color: rgba(124, 199, 255, 0.22);
}

.fill-low {
    background: rgba(210, 153, 34, 0.12);
    color: #d29922;
    border-color: rgba(210, 153, 34, 0.24);
}

.time-estimate {
    background: rgba(210, 168, 255, 0.10);
    color: #d2a8ff;
    border-color: rgba(210, 168, 255, 0.22);
}

.risk-flag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px 0;
}

.risk-flag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.24);
    background: rgba(210, 153, 34, 0.10);
}

.why-explained {
    display: grid;
    gap: 6px;
    margin: 0 0 12px 0;
}

.why-explained strong {
    font-size: 12px;
    color: #e6edf3;
}

.why-explained ul {
    margin: 0;
    padding-left: 18px;
}

.why-explained li {
    color: #9da7b3;
    font-size: 12px;
    line-height: 1.45;
}

.why-explained.compact li + li {
    margin-top: 4px;
}

.decision-why-note {
    border-color: rgba(124, 199, 255, 0.16);
    background: rgba(13, 17, 23, 0.72);
}

.decision-why-note .risk-flag-row,
.decision-why-note .why-explained {
    margin-bottom: 0;
}
/* === END: PHASE 3.2B DECISION CONFIDENCE UI === */

/* === START: PHASE 3.2C TABLE SORTING POLISH === */
.table-signal {
    display: inline-flex;
    width: max-content;
    max-width: 150px;
    white-space: normal;
    line-height: 1.25;
}

.table-scroll table th,
.table-scroll table td {
    vertical-align: top;
}

.table-scroll table th.sortable {
    color: #c9d1d9;
}

.table-scroll table th.sortable.sort-active {
    color: #7cc7ff;
}

.table-scroll table th.sortable .sort-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin-left: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
}

.table-scroll table th.sortable.sort-active .sort-indicator {
    background: rgba(124, 199, 255, 0.12);
}
/* === END: PHASE 3.2C TABLE SORTING POLISH === */

/* === START: PHASE 3.2D ROW COMPRESSION === */
.route-board-card {
    padding: 14px;
}

.route-board-scroll {
    overflow-x: auto;
}

.route-board-table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.route-board-table th,
.route-board-table td {
    border-bottom: 0;
}

.route-sort-header tr {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 2px;
}

.route-sort-header th {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: auto;
    padding: 6px 10px;
    border: 1px solid rgba(48, 54, 61, 0.86);
    border-radius: 999px;
    background: rgba(13, 17, 23, 0.72);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.route-sort-header .route-sort-label {
    color: #7cc7ff;
    border-color: transparent;
    background: transparent;
    padding-left: 0;
}

.route-sort-header th.sortable:hover {
    color: #7cc7ff;
    border-color: rgba(124, 199, 255, 0.28);
}

.compressed-route-row td {
    padding: 0;
}

.route-table-card {
    padding: 12px 14px;
    border: 1px solid rgba(48, 54, 61, 0.86);
    border-radius: 12px;
    background: rgba(13, 17, 23, 0.42);
}

.route-table-card:hover {
    border-color: rgba(124, 199, 255, 0.26);
    background: rgba(13, 17, 23, 0.66);
}

.route-card-mainline {
    display: grid;
    grid-template-columns: minmax(180px, 1.05fr) minmax(160px, 0.9fr) minmax(320px, 1.45fr) auto;
    gap: 14px;
    align-items: center;
}

.route-card-identity,
.route-card-path {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.route-card-identity strong,
.route-card-path strong {
    color: #e6edf3;
    overflow-wrap: anywhere;
}

.route-card-identity span,
.route-card-path span {
    color: #9da7b3;
    font-size: 12px;
    line-height: 1.25;
}

.route-card-numbers {
    display: grid;
    grid-template-columns: repeat(4, minmax(70px, 1fr));
    gap: 8px;
    align-items: stretch;
}

.route-card-numbers > span {
    display: grid;
    gap: 3px;
    padding: 7px 9px;
    border: 1px solid rgba(48, 54, 61, 0.82);
    border-radius: 10px;
    background: rgba(22, 27, 34, 0.72);
    min-width: 0;
}

.route-card-numbers small {
    color: #9da7b3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.route-card-numbers strong {
    font-size: 13px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.decision-score-inline strong {
    font-size: 18px;
}

.route-card-signal-line,
.route-card-status-line {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin-top: 9px;
}

.route-card-status-line {
    color: #9da7b3;
    font-size: 12px;
    line-height: 1.4;
}

.route-status-cluster {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid rgba(48, 54, 61, 0.72);
    border-radius: 10px;
    background: rgba(22, 27, 34, 0.52);
}

.route-status-cluster strong {
    color: #c9d1d9;
}

.route-why-compact span:not(:first-child),
.route-risk-compact span:not(:first-child) {
    color: #9da7b3;
}

.route-risk-compact {
    border-color: rgba(210, 153, 34, 0.18);
}

.route-risk-compact span:not(:first-child) {
    color: #d29922;
}

@media (max-width: 980px) {
    .route-card-mainline {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .route-card-numbers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .route-card-mainline .table-action {
        justify-self: start;
    }
}

@media (max-width: 560px) {
    .route-board-card {
        padding: 10px;
    }

    .route-table-card {
        padding: 11px;
    }

    .route-card-numbers {
        grid-template-columns: 1fr;
    }

    .route-status-cluster {
        width: 100%;
    }
}
/* === END: PHASE 3.2D ROW COMPRESSION === */

/* === START: TRADE ITEM SCANNER PAGE === */
.scanner-layout {
    display: grid;
    gap: 14px;
}

.scanner-search-card,
.scanner-verdict-card,
.scanner-empty-card {
    border-color: rgba(124, 199, 255, 0.16);
}

.scanner-form {
    display: grid;
    gap: 8px;
}

.scanner-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.scanner-input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(48, 54, 61, 0.9);
    border-radius: 10px;
    background: rgba(13, 17, 23, 0.82);
    color: #e6edf3;
    font: inherit;
}

.scanner-input:focus {
    outline: none;
    border-color: rgba(124, 199, 255, 0.62);
    box-shadow: 0 0 0 3px rgba(124, 199, 255, 0.10);
}

.scanner-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.scanner-examples a {
    display: inline-flex;
    padding: 5px 9px;
    border: 1px solid rgba(124, 199, 255, 0.18);
    border-radius: 999px;
    color: #7cc7ff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    background: rgba(31, 111, 235, 0.08);
}

.scanner-verdict-topline {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.scanner-verdict-topline h2,
.scanner-results h2,
.scanner-empty-card h2 {
    margin: 0 0 6px;
}

.scanner-signal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.scanner-signal-grid > div {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(48, 54, 61, 0.82);
    border-radius: 10px;
    background: rgba(22, 27, 34, 0.62);
}

.scanner-signal-grid small {
    color: #9da7b3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.scanner-signal-grid strong {
    color: #e6edf3;
}

.scanner-verdict-reason {
    margin: 12px 0 0;
    color: #9da7b3;
    line-height: 1.45;
}

.scanner-results {
    display: grid;
    gap: 10px;
}

.scanner-route-mainline {
    grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.55fr) auto;
}

.scanner-card-numbers {
    grid-template-columns: repeat(4, minmax(72px, 1fr));
}

.scanner-strong {
    background: rgba(63, 185, 80, 0.16);
    color: #7ee787;
    border-color: rgba(63, 185, 80, 0.32);
}

.scanner-good {
    background: rgba(31, 111, 235, 0.14);
    color: #7cc7ff;
    border-color: rgba(124, 199, 255, 0.28);
}

.scanner-caution {
    background: rgba(210, 153, 34, 0.12);
    color: #d29922;
    border-color: rgba(210, 153, 34, 0.30);
}


/* === START: SCANNER ITEM AUTOCOMPLETE === */
.scanner-autocomplete-wrap {
    position: relative;
    min-width: 0;
}

.scanner-suggestions {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    overflow: hidden;
    border: 1px solid rgba(124, 199, 255, 0.24);
    border-radius: 12px;
    background: rgba(13, 17, 23, 0.98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.scanner-suggestion {
    display: flex;
    width: 100%;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.62);
    background: transparent;
    color: #e6edf3;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.scanner-suggestion:last-child {
    border-bottom: 0;
}

.scanner-suggestion small {
    color: #8b949e;
    white-space: nowrap;
}

.scanner-suggestion:hover,
.scanner-suggestion.is-active {
    background: rgba(124, 199, 255, 0.10);
}
/* === END: SCANNER ITEM AUTOCOMPLETE === */

@media (max-width: 760px) {
    .scanner-input-row,
    .scanner-route-mainline,
    .scanner-signal-grid {
        grid-template-columns: 1fr;
    }

    .scanner-verdict-topline {
        flex-direction: column;
    }

    .scanner-card-numbers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* === END: TRADE ITEM SCANNER PAGE === */


/* === START: RUN THIS MODE === */
.run-this-panel {
    border: 1px solid rgba(63, 185, 80, 0.42);
    background:
        radial-gradient(circle at top left, rgba(63, 185, 80, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(14, 40, 24, 0.92) 0%, rgba(22, 27, 34, 0.98) 46%, rgba(13, 17, 23, 0.98) 100%);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(63, 185, 80, 0.10);
}

.run-this-header,
.run-this-body,
.run-this-actions,
.run-this-signal-row {
    display: flex;
    gap: 14px;
}

.run-this-header {
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.run-this-header h2,
.run-this-main h3 {
    margin: 0 0 8px;
}

.run-this-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(63, 185, 80, 0.16);
    color: #7ee787;
    border: 1px solid rgba(63, 185, 80, 0.30);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.run-this-body {
    align-items: stretch;
    justify-content: space-between;
}

.run-this-main {
    min-width: 0;
    flex: 1 1 auto;
}

.run-this-main h3 {
    font-size: 30px;
    line-height: 1.1;
}

.run-this-reason {
    color: #c9d1d9;
    line-height: 1.55;
    margin: 12px 0 0;
    max-width: 780px;
}

.run-this-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 10px;
    min-width: 330px;
}

.run-this-signal-row {
    flex-wrap: wrap;
    align-items: center;
    margin-top: 16px;
}

.run-this-actions {
    flex-wrap: wrap;
    align-items: center;
    margin-top: 18px;
}

.run-this-primary {
    font-size: 16px;
    padding: 12px 18px;
}

.run-this-secondary {
    text-decoration: none;
    border-radius: 8px;
    padding: 12px 14px;
    color: #ffffff;
}

@media (max-width: 900px) {
    .run-this-header,
    .run-this-body {
        flex-direction: column;
    }

    .run-this-stats {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .run-this-main h3 {
        font-size: 24px;
    }
}
/* === END: RUN THIS MODE === */

/* === START: PHASE 3.2A RUN MEMORY PANEL === */
.run-memory-card {
    border-color: rgba(124, 199, 255, 0.16);
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.92) 0%, rgba(13, 17, 23, 0.94) 100%);
}

.run-memory-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.run-memory-header strong {
    display: block;
    margin: 2px 0 4px;
    font-size: 18px;
}

.run-memory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.run-memory-stat,
.run-memory-event {
    border: 1px solid rgba(139, 148, 158, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    padding: 10px 12px;
}

.run-memory-stat strong {
    display: block;
    margin-top: 3px;
    color: #f0f6fc;
    line-height: 1.35;
}

.run-memory-recent {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.run-memory-event span,
.run-memory-event strong,
.run-memory-event small {
    display: block;
}

.run-memory-event span {
    color: #9da7b3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.run-memory-event strong {
    margin: 4px 0;
    color: #f0f6fc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.run-memory-event small {
    color: #8b949e;
}

.run-memory-run {
    border-color: rgba(63, 185, 80, 0.26);
}

.run-memory-skip {
    border-color: rgba(210, 153, 34, 0.26);
}

.run-memory-complete {
    border-color: rgba(31, 111, 235, 0.30);
}

.run-memory-empty .run-memory-clear {
    opacity: 0.55;
}

@media (max-width: 900px) {
    .run-memory-header,
    .run-memory-grid {
        grid-template-columns: 1fr;
    }

    .run-memory-header {
        flex-direction: column;
    }

    .run-memory-recent {
        grid-template-columns: 1fr;
    }
}
/* === END: PHASE 3.2A RUN MEMORY PANEL === */

/* === START: PHASE 3.2F WALLET-READY FILTER === */
.wallet-filter-group select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wallet-filter-note {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.35;
    color: #8b949e;
    max-width: 260px;
}

.wallet-filter-note.active {
    color: #7fffd4;
}
/* === END: PHASE 3.2F WALLET-READY FILTER === */
