/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #060612;
    color: #e0e0ff;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== ANIMATED BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 15% 50%, rgba(0,180,255,0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(180,0,255,0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 85%, rgba(0,255,120,0.03) 0%, transparent 45%),
        radial-gradient(ellipse at 70% 60%, rgba(255,200,0,0.02) 0%, transparent 40%);
    z-index: -1;
    animation: bgPulse 10s ease-in-out infinite alternate;
}
@keyframes bgPulse {
    0% { opacity: 0.4; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.02); }
}

/* Subtle grid overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(0,200,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,200,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -1;
    pointer-events: none;
}

.container { max-width: 1440px; margin: 0 auto; padding: 24px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes borderFlow { 100% { transform: rotate(360deg); } }
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes livePulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(0,255,100,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0,255,100,0); }
}
@keyframes titleGlow {
    0% { filter: brightness(1) drop-shadow(0 0 8px rgba(0,200,255,0.2)); }
    100% { filter: brightness(1.2) drop-shadow(0 0 16px rgba(0,200,255,0.4)); }
}
@keyframes floatUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    padding: 36px 20px 28px;
    margin-bottom: 32px;
    position: relative;
    border-bottom: 1px solid rgba(0,200,255,0.15);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* TOPMANIDMB Shield Logo (CSS) */
.shield-logo {
    width: 56px;
    height: 60px;
    position: relative;
    flex-shrink: 0;
    animation: floatUp 4s ease-in-out infinite;
}
.shield-logo .shield {
    width: 56px;
    height: 60px;
    background: linear-gradient(180deg, #1a3a8a 0%, #0d2266 50%, #091a4d 100%);
    clip-path: polygon(50% 0%, 100% 12%, 100% 65%, 50% 100%, 0% 65%, 0% 12%);
    position: relative;
    box-shadow: 0 4px 20px rgba(0,100,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.shield-logo .shield::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(180deg, #1e4494 0%, #122d6e 100%);
    clip-path: polygon(50% 2%, 98% 13%, 98% 64%, 50% 98%, 2% 64%, 2% 13%);
}
.shield-logo .shield::after {
    content: 'T';
    position: relative;
    z-index: 2;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 900;
    color: transparent;
    background: linear-gradient(180deg, #ffd700 0%, #ffb800 40%, #e6a200 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.header h1 {
    font-size: 2.2em;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #00c8ff 0%, #8b5cf6 50%, #c800ff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleGlow 3s ease-in-out infinite alternate, shimmer 6s linear infinite;
}
.header .subtitle {
    color: #7a7a9a;
    margin-top: 6px;
    font-size: 0.95em;
    font-weight: 400;
    letter-spacing: 0.5px;
}
.header .mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 18px;
    border-radius: 24px;
    font-size: 0.8em;
    font-weight: 700;
    margin-top: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: pulse 2.5s infinite;
    transition: all 0.4s ease;
}
.mode-paper {
    background: rgba(255,200,0,0.12);
    color: #ffc800;
    border: 1px solid rgba(255,200,0,0.4);
    box-shadow: 0 0 20px rgba(255,200,0,0.1);
}
.mode-live {
    background: rgba(0,255,100,0.12);
    color: #00ff64;
    border: 1px solid rgba(0,255,100,0.4);
    box-shadow: 0 0 20px rgba(0,255,100,0.1);
}

/* ===== GRID SYSTEM ===== */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-full { grid-template-columns: 1fr; }
.section { margin-bottom: 24px; }

/* ===== CARDS ===== */
.card {
    background: rgba(14,14,32,0.85);
    border: 1px solid rgba(0,200,255,0.1);
    border-radius: 16px;
    padding: 22px;
    backdrop-filter: blur(12px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.6s ease-out both;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,200,255,0.3), rgba(180,0,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.35s;
}
.card:hover {
    border-color: rgba(0,200,255,0.3);
    box-shadow: 0 8px 32px rgba(0,200,255,0.08), 0 0 0 1px rgba(0,200,255,0.05);
    transform: translateY(-3px);
}
.card:hover::before { opacity: 1; }

/* Stagger animation delays */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }

.card h3 {
    font-size: 0.78em;
    color: #7a7a9a;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    font-weight: 600;
}
.card .value {
    font-size: 2.1em;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
}
.card .sub {
    color: #555570;
    font-size: 0.82em;
    margin-top: 4px;
    font-weight: 500;
}

/* Gradient border card */
.card-gradient {
    border: none;
    background: rgba(14,14,32,0.85);
    position: relative;
    z-index: 0;
}
.card-gradient::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0,200,255,0.3), rgba(180,0,255,0.2), rgba(0,255,100,0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}

/* Highlight card with spinning border */
.card-highlight {
    position: relative;
    overflow: hidden;
}
.card-highlight::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(transparent, rgba(0,200,255,0.12), transparent 30%);
    animation: borderFlow 5s linear infinite;
    z-index: 0;
}
.card-highlight > * { position: relative; z-index: 1; }

/* ===== COLORS ===== */
.green { color: #00ff64; }
.red { color: #ff4466; }
.yellow { color: #ffc800; }
.blue { color: #00c8ff; }
.purple { color: #c800ff; }

/* ===== STAT ROWS ===== */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stat-row:last-child { border: none; }
.stat-label { color: #7a7a9a; font-size: 0.9em; }
.stat-value {
    font-weight: 700;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

/* ===== INDICATORS ===== */
.indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 0.9em;
}
.indicator-name { color: #8888aa; }
.indicator-val { font-weight: 700; font-family: 'SF Mono', monospace; }

/* ===== PREDICTION BOX ===== */
.prediction-box { text-align: center; padding: 24px 0; }
.prediction-dir {
    font-size: 3.2em;
    font-weight: 900;
    margin: 8px 0;
    letter-spacing: 2px;
}
.prediction-up { color: #00ff64; text-shadow: 0 0 40px rgba(0,255,100,0.25); }
.prediction-down { color: #ff4466; text-shadow: 0 0 40px rgba(255,68,102,0.25); }

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-green { background: linear-gradient(90deg, #00ff64, #00c8ff); }
.progress-red { background: linear-gradient(90deg, #ff4466, #ff8800); }

/* ===== WIN RATE GAUGE ===== */
.gauge {
    width: 130px; height: 130px;
    margin: 12px auto;
    position: relative;
}
.gauge svg { transform: rotate(-90deg); }
.gauge-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6em;
    font-weight: 800;
    font-family: 'SF Mono', monospace;
}

/* ===== LIVE DOT ===== */
.live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: #00ff64;
    border-radius: 50%;
    margin-right: 8px;
    animation: livePulse 1.5s infinite;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 9px 22px;
    border: 1px solid rgba(0,200,255,0.25);
    background: rgba(0,200,255,0.08);
    color: #00c8ff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.83em;
    font-weight: 600;
    transition: all 0.25s;
    letter-spacing: 0.3px;
}
.btn:hover {
    background: rgba(0,200,255,0.18);
    border-color: rgba(0,200,255,0.5);
    box-shadow: 0 4px 16px rgba(0,200,255,0.1);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn-group { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ===== TRADE HISTORY TABLE ===== */
.table-wrapper { overflow-x: auto; }
.trade-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88em;
}
.trade-table thead th {
    text-align: left;
    padding: 10px 12px;
    color: #7a7a9a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.78em;
    border-bottom: 1px solid rgba(0,200,255,0.1);
    position: sticky;
    top: 0;
    background: rgba(14,14,32,0.95);
    backdrop-filter: blur(8px);
}
.trade-table tbody tr {
    transition: background 0.2s;
}
.trade-table tbody tr:hover {
    background: rgba(0,200,255,0.04);
}
.trade-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-family: 'SF Mono', monospace;
    font-size: 0.92em;
}
.trade-table .outcome-won { color: #00ff64; font-weight: 700; }
.trade-table .outcome-lost { color: #ff4466; font-weight: 700; }
.trade-table .outcome-pending { color: #ffc800; font-weight: 600; }
.trade-table .dir-up { color: #00ff64; }
.trade-table .dir-down { color: #ff4466; }

/* ===== RECENT TRADE LIST (compact) ===== */
.trade-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.02);
    transition: background 0.2s;
}
.trade-item:hover { background: rgba(255,255,255,0.05); }
.trade-emoji { font-size: 1.2em; }
.trade-info { flex: 1; }
.trade-info .dir { font-weight: 700; }
.trade-info .conf { color: #7a7a9a; font-size: 0.84em; }
.trade-pnl { font-weight: 700; font-size: 1em; font-family: 'SF Mono', monospace; }

/* ===== EQUITY CURVE ===== */
.equity-chart-container {
    width: 100%;
    height: 200px;
    position: relative;
}
.equity-chart-container svg {
    width: 100%;
    height: 100%;
}
.equity-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #555570;
    font-size: 0.9em;
}

/* ===== CALIBRATION BARS ===== */
.calibration-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 180px;
    padding-top: 10px;
}
.calibration-bucket {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    gap: 4px;
}
.calibration-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    width: 100%;
    height: calc(100% - 24px);
}
.calibration-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-expected { background: rgba(0,200,255,0.35); }
.bar-actual { background: rgba(0,255,100,0.7); }
.calibration-label {
    font-size: 0.65em;
    color: #7a7a9a;
    white-space: nowrap;
}
.calibration-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 12px;
    font-size: 0.78em;
    color: #8888aa;
}
.legend-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 2px;
    margin-right: 5px;
    vertical-align: middle;
}

/* ===== PROMPT TABLE ===== */
.prompt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.86em;
}
.prompt-table thead th {
    text-align: left;
    padding: 10px 12px;
    color: #7a7a9a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.76em;
    border-bottom: 1px solid rgba(0,200,255,0.1);
}
.prompt-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.prompt-table tbody tr:hover { background: rgba(0,200,255,0.04); }
.badge-active {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 700;
    background: rgba(0,255,100,0.12);
    color: #00ff64;
    border: 1px solid rgba(0,255,100,0.25);
}
.badge-retired {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    background: rgba(255,68,102,0.1);
    color: #ff4466;
    border: 1px solid rgba(255,68,102,0.2);
}
.badge-baseline {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    background: rgba(0,200,255,0.1);
    color: #00c8ff;
    border: 1px solid rgba(0,200,255,0.2);
    margin-left: 6px;
}

/* ===== SECTION HEADER ===== */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,200,255,0.08);
}
.section-title h2 {
    font-size: 1.1em;
    font-weight: 700;
    color: #c0c0e0;
    letter-spacing: 0.3px;
}
.section-icon {
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,200,255,0.08);
    border-radius: 8px;
    font-size: 0.9em;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 32px 20px 24px;
    margin-top: 40px;
    border-top: 1px solid rgba(0,200,255,0.08);
    color: #444460;
    font-size: 0.82em;
    letter-spacing: 0.3px;
}
.footer a {
    color: #00c8ff;
    text-decoration: none;
}
.footer .version {
    font-weight: 600;
    color: #5a5a7a;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a40; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a55; }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .container { padding: 14px; }
    .header h1 { font-size: 1.5em; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .card .value { font-size: 1.7em; }
    .prediction-dir { font-size: 2.4em; }
    .shield-logo { width: 44px; height: 48px; }
    .shield-logo .shield { width: 44px; height: 48px; }
    .shield-logo .shield::after { font-size: 22px; }
    .trade-table { font-size: 0.78em; }
    .trade-table td, .trade-table thead th { padding: 8px 6px; }
    .calibration-chart { height: 140px; }
    .footer { font-size: 0.75em; }
}
@media (max-width: 480px) {
    .header h1 { font-size: 1.2em; }
    .header .subtitle { font-size: 0.8em; }
    .btn { padding: 7px 14px; font-size: 0.78em; }
    .btn-group { gap: 6px; }
}

/* ===== PHASE 1 PROFESSIONAL THEME ===== */
:root {
    --bg: #07111b;
    --bg-alt: #0d1824;
    --surface: rgba(15, 27, 42, 0.94);
    --surface-soft: rgba(12, 23, 36, 0.9);
    --surface-strong: rgba(19, 34, 53, 0.96);
    --border: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(56, 189, 248, 0.28);
    --text: #e6edf5;
    --muted: #91a4b8;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.12);
    --success-soft: rgba(34, 197, 94, 0.14);
    --warning-soft: rgba(245, 158, 11, 0.14);
    --danger-soft: rgba(239, 68, 68, 0.14);
    --shadow: 0 20px 50px rgba(2, 6, 23, 0.34);
    --mono: 'IBM Plex Mono', 'SF Mono', 'JetBrains Mono', monospace;
    --sans: 'Avenir Next', 'IBM Plex Sans Thai', 'Noto Sans Thai', 'Segoe UI', sans-serif;
}

body {
    font-family: var(--sans);
    background:
        radial-gradient(circle at 12% 8%, rgba(56, 189, 248, 0.1), transparent 24%),
        radial-gradient(circle at 88% 0%, rgba(34, 197, 94, 0.08), transparent 22%),
        linear-gradient(180deg, #07111b 0%, #0a1521 48%, #0d1725 100%);
    color: var(--text);
}

body::before {
    background:
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.08), transparent 28%),
        radial-gradient(circle at 78% 18%, rgba(15, 23, 42, 0.22), transparent 34%),
        radial-gradient(circle at 65% 82%, rgba(34, 197, 94, 0.04), transparent 28%);
    animation: none;
    opacity: 1;
}

body::after {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 72px 72px;
    opacity: 0.22;
}

.container {
    max-width: 1360px;
    padding: 30px 24px 46px;
}

.header {
    text-align: left;
    padding: 12px 0 26px;
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.header-inner {
    justify-content: flex-start;
    gap: 16px;
}

.header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.view-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #d8e7f3;
    font-size: 0.8em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lang-switch,
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.14);
    flex-wrap: wrap;
}

.lang-pill,
.theme-pill {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.06em;
    transition: background 0.2s ease, color 0.2s ease;
}

.lang-pill:hover,
.theme-pill:hover {
    color: #eaf7ff;
}

.lang-pill.active,
.theme-pill.active {
    background: rgba(56, 189, 248, 0.16);
    color: #eaf7ff;
}

.eyebrow {
    margin-bottom: 14px;
    font-size: 0.72em;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #7dd3fc;
    font-weight: 700;
}

.header h1 {
    color: #f8fbff;
    background: none;
    -webkit-text-fill-color: initial;
    animation: none;
    font-size: clamp(2.2rem, 4vw, 4rem);
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.header .subtitle {
    margin-top: 10px;
    color: var(--muted);
    font-size: 1.02em;
    letter-spacing: 0;
    max-width: 760px;
}

.refresh-note {
    color: var(--muted);
    font-size: 0.82em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mode-badge {
    margin-top: 0;
    animation: none;
    padding: 8px 14px;
    border-radius: 999px;
    letter-spacing: 0.08em;
}

.mode-paper {
    background: var(--warning-soft);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.28);
    box-shadow: none;
}

.mode-live {
    background: var(--success-soft);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.28);
    box-shadow: none;
}

.shield-logo {
    animation: none;
}

.shield-logo .shield {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.32);
}

.card,
.card-gradient {
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.card::before {
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.35), transparent);
}

.card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 24px 54px rgba(2, 6, 23, 0.38);
    transform: translateY(-2px);
}

.card-gradient::after {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(15, 23, 42, 0) 38%, rgba(34, 197, 94, 0.14));
}

.card-highlight::after {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), transparent 44%, rgba(34, 197, 94, 0.08));
    animation: none;
}

.card h3 {
    color: var(--muted);
    font-size: 0.76em;
}

.card .value,
.stat-value,
.trade-table td,
.prompt-table td,
.trending-price-pill {
    font-family: var(--mono);
}

.section {
    margin-bottom: 22px;
}

.context-ribbon {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 20px;
}

.ribbon-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.data-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #c6d4e1;
    font-size: 0.82em;
    letter-spacing: 0.02em;
}

.data-pill.good {
    background: var(--success-soft);
    border-color: rgba(34, 197, 94, 0.24);
    color: #86efac;
}

.data-pill.warn {
    background: var(--warning-soft);
    border-color: rgba(245, 158, 11, 0.24);
    color: #fcd34d;
}

.data-pill.bad {
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

.ribbon-copy {
    max-width: 420px;
    color: var(--muted);
    line-height: 1.55;
    font-size: 0.92em;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 20px;
}

.hero-card {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.78em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7dd3fc;
    font-weight: 700;
}

.hero-card h2 {
    font-size: clamp(1.9rem, 3.2vw, 3rem);
    line-height: 1.08;
    margin-bottom: 12px;
    letter-spacing: -0.04em;
}

.hero-lead {
    max-width: 700px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 1em;
}

.summary-points {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.summary-point {
    padding: 13px 15px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #d6e1ec;
    line-height: 1.55;
}

.timeline-block {
    margin-top: 18px;
    padding: 16px 18px 12px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

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

.cycle-timeline-container {
    height: 190px;
}

.timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.78em;
}

.timeline-dot-executed {
    background: rgba(74, 222, 128, 0.86);
}

.timeline-dot-blocked {
    background: rgba(251, 191, 36, 0.86);
}

.timeline-dot-skipped {
    background: rgba(56, 189, 248, 0.86);
}

.timeline-dot-failed {
    background: rgba(248, 113, 113, 0.86);
}

.hero-stack {
    display: grid;
    gap: 20px;
}

.signal-card .prediction-box {
    text-align: left;
    padding: 4px 0 0;
}

.signal-confidence {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 600;
}

.prediction-dir {
    font-size: clamp(2.4rem, 5vw, 4rem);
    letter-spacing: 0.04em;
    margin: 6px 0 8px;
    text-shadow: none;
}

.prediction-up {
    color: #86efac;
}

.prediction-down {
    color: #fca5a5;
}

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

.signal-stat {
    padding: 12px 13px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.signal-stat .stat-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8em;
}

.signal-reason {
    min-height: 48px;
    margin-top: 16px;
    color: #d0dcea;
    line-height: 1.6;
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.section-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-pill {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: #c3d3e4;
    font-size: 0.88em;
    cursor: pointer;
    transition: all 0.22s ease;
}

.nav-pill:hover {
    border-color: rgba(56, 189, 248, 0.32);
    color: #eaf7ff;
}

.nav-pill.active {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.42);
    color: #eaf7ff;
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.08);
}

.nav-pill[hidden] {
    display: none !important;
}

.panel[hidden] {
    display: none !important;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.metric-stack {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.metric-item:last-child {
    border-bottom: none;
}

#breakerReasonValue,
#breakerAckValue,
#breakerResetValue,
#breakerPolicyValue {
    max-width: 320px;
    text-align: right;
    white-space: normal;
    line-height: 1.45;
}

.inline-note {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 18px;
}

.ops-card {
    border-style: dashed;
}

.ops-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.ops-subpanel {
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.34);
}

.ops-auth {
    margin-bottom: 18px;
}

.ops-auth-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.token-input {
    min-width: 260px;
    flex: 1 1 260px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.token-input:focus {
    border-color: rgba(56, 189, 248, 0.38);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.token-input::placeholder {
    color: #7890a6;
}

.btn {
    padding: 10px 16px;
    border-radius: 12px;
    border-color: rgba(56, 189, 248, 0.26);
    background: rgba(56, 189, 248, 0.08);
    color: #dff6ff;
}

.btn:hover {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.44);
    box-shadow: none;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #d6e8f5;
    border-color: rgba(148, 163, 184, 0.16);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 163, 184, 0.28);
}

.section-title,
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.section-title h2,
.section-header h2 {
    margin: 0;
    font-size: 1.08em;
    font-weight: 700;
    color: #dfe9f5;
}

.section-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
}

.trade-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.06);
    border-radius: 12px;
    margin-bottom: 8px;
}

.trade-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.trade-info .conf {
    color: var(--muted);
}

.trade-table thead th,
.prompt-table thead th {
    background: rgba(15, 27, 42, 0.98);
    color: var(--muted);
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

.trade-table tbody tr:hover,
.prompt-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.06);
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.trending-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 14px;
    box-shadow: none;
}

.trending-card:hover {
    border-color: rgba(56, 189, 248, 0.24);
    box-shadow: none;
}

.trending-card::before {
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.32), transparent);
}

.trending-question {
    font-size: 0.96em;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-prices {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.trending-price-pill {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.02em;
}

.pill-yes {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.18);
}

.pill-no {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.18);
}

.pill-label {
    display: block;
    margin-bottom: 3px;
    font-size: 0.64em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.76;
    font-weight: 600;
}

.trending-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.trending-volume {
    font-size: 0.82em;
    color: var(--muted);
    font-family: var(--mono);
}

.trending-tag {
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.22);
}

.trending-link {
    opacity: 1;
}

.footer {
    text-align: left;
    padding: 30px 4px 0;
    margin-top: 34px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    color: var(--muted);
}

.footer .version {
    color: #dbeafe;
}

@media (max-width: 1024px) {
    .hero-grid,
    .performance-grid {
        grid-template-columns: 1fr;
    }

    .header-meta {
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 18px 14px 34px;
    }

    .context-ribbon,
    .compact-grid,
    .signal-meta {
        grid-template-columns: 1fr;
    }

    .compact-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .signal-meta {
        display: grid;
        grid-template-columns: 1fr;
    }

    .summary-point {
        padding: 12px 14px;
    }

    .nav-pill {
        width: 100%;
        justify-content: center;
    }
}

/* ===== PHASE 2 EXECUTIVE VISUAL REFRESH ===== */
body.dashboard-shell {
    --paper: #eef3f7;
    --paper-strong: #f8fbfd;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-soft: rgba(248, 250, 252, 0.94);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --border: rgba(148, 163, 184, 0.28);
    --border-strong: rgba(18, 58, 99, 0.22);
    --text: #102033;
    --muted: #5f7186;
    --accent: #123a63;
    --accent-soft: rgba(18, 58, 99, 0.08);
    --success-soft: rgba(15, 159, 110, 0.1);
    --warning-soft: rgba(183, 121, 31, 0.12);
    --danger-soft: rgba(196, 65, 12, 0.12);
    --shadow: 0 20px 48px rgba(15, 23, 42, 0.09);
    --theme-primary: #123a63;
    --theme-primary-strong: #1d4f80;
    --theme-primary-soft: rgba(18, 58, 99, 0.08);
    --theme-primary-soft-strong: rgba(18, 58, 99, 0.16);
    --theme-primary-shadow: rgba(18, 58, 99, 0.18);
    --theme-heading: #102033;
    --theme-page-start: #f4f7fb;
    --theme-page-mid: #edf2f7;
    --theme-page-end: #e9eff5;
    --theme-orb-1: rgba(59, 130, 246, 0.08);
    --theme-orb-2: rgba(18, 58, 99, 0.08);
    --theme-orb-3: rgba(15, 159, 110, 0.06);
    --theme-hero-start: #14324f;
    --theme-hero-mid: #10243a;
    --theme-hero-end: #173a58;
    --theme-hero-label: #b8d8f2;
    --theme-hero-bullet: #7dd3fc;
    --theme-neutral-soft: #f4f7fa;
    --theme-link: #123a63;
    --mono: 'IBM Plex Mono', 'SF Mono', 'JetBrains Mono', monospace;
    --sans: 'IBM Plex Sans Thai', 'IBM Plex Sans', 'Avenir Next', sans-serif;
    font-family: var(--sans);
    background:
        radial-gradient(circle at top left, var(--theme-orb-1), transparent 24%),
        radial-gradient(circle at 85% 0%, var(--theme-orb-2), transparent 22%),
        linear-gradient(180deg, var(--theme-page-start) 0%, var(--theme-page-mid) 48%, var(--theme-page-end) 100%);
    color: var(--text);
}

body.dashboard-shell[data-theme="navy"] {
    --paper: #eef3f7;
    --paper-strong: #f8fbfd;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-soft: rgba(248, 250, 252, 0.94);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --border: rgba(148, 163, 184, 0.28);
    --border-strong: rgba(18, 58, 99, 0.22);
    --text: #102033;
    --muted: #5f7186;
    --shadow: 0 20px 48px rgba(15, 23, 42, 0.09);
    --theme-primary: #123a63;
    --theme-primary-strong: #1d4f80;
    --theme-primary-soft: rgba(18, 58, 99, 0.08);
    --theme-primary-soft-strong: rgba(18, 58, 99, 0.16);
    --theme-primary-shadow: rgba(18, 58, 99, 0.18);
    --theme-heading: #102033;
    --theme-page-start: #f4f7fb;
    --theme-page-mid: #edf2f7;
    --theme-page-end: #e9eff5;
    --theme-orb-1: rgba(59, 130, 246, 0.08);
    --theme-orb-2: rgba(18, 58, 99, 0.08);
    --theme-orb-3: rgba(15, 159, 110, 0.06);
    --theme-hero-start: #14324f;
    --theme-hero-mid: #10243a;
    --theme-hero-end: #173a58;
    --theme-hero-label: #b8d8f2;
    --theme-hero-bullet: #7dd3fc;
    --theme-neutral-soft: #f4f7fa;
    --theme-link: #123a63;
}

body.dashboard-shell[data-theme="ivory"] {
    --paper: #f5efe6;
    --paper-strong: #fcf8f2;
    --surface: rgba(255, 251, 246, 0.92);
    --surface-soft: rgba(252, 248, 242, 0.95);
    --surface-strong: rgba(255, 252, 248, 0.97);
    --border: rgba(171, 140, 107, 0.24);
    --border-strong: rgba(138, 90, 54, 0.18);
    --text: #2f2418;
    --muted: #746554;
    --shadow: 0 20px 48px rgba(87, 56, 28, 0.08);
    --theme-primary: #8a5a36;
    --theme-primary-strong: #a36f46;
    --theme-primary-soft: rgba(138, 90, 54, 0.09);
    --theme-primary-soft-strong: rgba(138, 90, 54, 0.18);
    --theme-primary-shadow: rgba(138, 90, 54, 0.16);
    --theme-heading: #2f2418;
    --theme-page-start: #fbf7f2;
    --theme-page-mid: #f5efe6;
    --theme-page-end: #eee4d7;
    --theme-orb-1: rgba(217, 119, 6, 0.08);
    --theme-orb-2: rgba(120, 53, 15, 0.07);
    --theme-orb-3: rgba(190, 138, 62, 0.07);
    --theme-hero-start: #65442b;
    --theme-hero-mid: #4d3321;
    --theme-hero-end: #7c5633;
    --theme-hero-label: #f4dec3;
    --theme-hero-bullet: #fbbf24;
    --theme-neutral-soft: #f8f1e8;
    --theme-link: #8a5a36;
}

body.dashboard-shell[data-theme="forest"] {
    --paper: #edf3ef;
    --paper-strong: #f7fbf7;
    --surface: rgba(249, 253, 249, 0.92);
    --surface-soft: rgba(243, 248, 243, 0.95);
    --surface-strong: rgba(252, 255, 252, 0.97);
    --border: rgba(110, 140, 122, 0.24);
    --border-strong: rgba(46, 94, 72, 0.18);
    --text: #14281f;
    --muted: #5f766a;
    --shadow: 0 20px 48px rgba(20, 40, 31, 0.08);
    --theme-primary: #2e5e48;
    --theme-primary-strong: #3e7a5f;
    --theme-primary-soft: rgba(46, 94, 72, 0.09);
    --theme-primary-soft-strong: rgba(46, 94, 72, 0.18);
    --theme-primary-shadow: rgba(46, 94, 72, 0.16);
    --theme-heading: #14281f;
    --theme-page-start: #f4faf6;
    --theme-page-mid: #edf3ef;
    --theme-page-end: #e4ede7;
    --theme-orb-1: rgba(22, 163, 74, 0.08);
    --theme-orb-2: rgba(46, 94, 72, 0.08);
    --theme-orb-3: rgba(14, 116, 144, 0.06);
    --theme-hero-start: #1f4b37;
    --theme-hero-mid: #163728;
    --theme-hero-end: #285842;
    --theme-hero-label: #cce9d8;
    --theme-hero-bullet: #86efac;
    --theme-neutral-soft: #eef6f0;
    --theme-link: #2e5e48;
}

body.dashboard-shell[data-theme="sunset"] {
    --paper: #f7efe9;
    --paper-strong: #fcf8f5;
    --surface: rgba(255, 250, 246, 0.92);
    --surface-soft: rgba(251, 245, 240, 0.95);
    --surface-strong: rgba(255, 252, 249, 0.97);
    --border: rgba(173, 112, 92, 0.24);
    --border-strong: rgba(178, 83, 54, 0.18);
    --text: #341d17;
    --muted: #7c6259;
    --shadow: 0 20px 48px rgba(70, 32, 25, 0.08);
    --theme-primary: #b25336;
    --theme-primary-strong: #d06a45;
    --theme-primary-soft: rgba(178, 83, 54, 0.09);
    --theme-primary-soft-strong: rgba(178, 83, 54, 0.18);
    --theme-primary-shadow: rgba(178, 83, 54, 0.17);
    --theme-heading: #341d17;
    --theme-page-start: #fdf7f4;
    --theme-page-mid: #f7efe9;
    --theme-page-end: #f0e3da;
    --theme-orb-1: rgba(251, 146, 60, 0.09);
    --theme-orb-2: rgba(178, 83, 54, 0.08);
    --theme-orb-3: rgba(244, 114, 182, 0.06);
    --theme-hero-start: #6e3426;
    --theme-hero-mid: #55271d;
    --theme-hero-end: #8a4330;
    --theme-hero-label: #f6d5ca;
    --theme-hero-bullet: #fdba74;
    --theme-neutral-soft: #faeee8;
    --theme-link: #b25336;
}

body.dashboard-shell[data-theme="slate"] {
    --paper: #eef1f4;
    --paper-strong: #f8fafc;
    --surface: rgba(252, 253, 255, 0.9);
    --surface-soft: rgba(245, 247, 250, 0.95);
    --surface-strong: rgba(255, 255, 255, 0.97);
    --border: rgba(123, 138, 160, 0.24);
    --border-strong: rgba(71, 85, 105, 0.18);
    --text: #162131;
    --muted: #667588;
    --shadow: 0 20px 48px rgba(15, 23, 42, 0.1);
    --theme-primary: #475569;
    --theme-primary-strong: #64748b;
    --theme-primary-soft: rgba(71, 85, 105, 0.09);
    --theme-primary-soft-strong: rgba(71, 85, 105, 0.18);
    --theme-primary-shadow: rgba(71, 85, 105, 0.17);
    --theme-heading: #162131;
    --theme-page-start: #f6f8fb;
    --theme-page-mid: #eef1f4;
    --theme-page-end: #e6ebf1;
    --theme-orb-1: rgba(99, 102, 241, 0.07);
    --theme-orb-2: rgba(71, 85, 105, 0.08);
    --theme-orb-3: rgba(14, 165, 233, 0.05);
    --theme-hero-start: #2f3947;
    --theme-hero-mid: #222b37;
    --theme-hero-end: #3d4a5d;
    --theme-hero-label: #d1d8e2;
    --theme-hero-bullet: #cbd5e1;
    --theme-neutral-soft: #f1f4f8;
    --theme-link: #475569;
}

body.dashboard-shell::before {
    background:
        radial-gradient(circle at 14% 16%, var(--theme-orb-1), transparent 30%),
        radial-gradient(circle at 80% 14%, var(--theme-orb-2), transparent 26%),
        radial-gradient(circle at 75% 72%, var(--theme-orb-3), transparent 24%);
    opacity: 1;
    animation: none;
}

body.dashboard-shell::after {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: 96px 96px;
    opacity: 0.18;
}

body.dashboard-shell .container {
    max-width: 1380px;
    padding: 34px 28px 54px;
}

body.dashboard-shell .header {
    padding: 4px 0 0;
    margin-bottom: 28px;
    border-bottom: none;
}

body.dashboard-shell .header::after {
    content: '';
    display: block;
    margin-top: 28px;
    height: 1px;
    background: linear-gradient(90deg, var(--theme-primary-soft-strong), rgba(148, 163, 184, 0.08), transparent);
}

body.dashboard-shell .header-main {
    gap: 28px;
}

body.dashboard-shell .header-inner {
    gap: 18px;
}

body.dashboard-shell .shield-logo {
    width: 62px;
    height: 62px;
    animation: none;
}

body.dashboard-shell .shield-logo .shield {
    width: 62px;
    height: 62px;
    clip-path: none;
    border-radius: 18px;
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-primary-strong) 100%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

body.dashboard-shell .shield-logo .shield::before {
    inset: 3px;
    clip-path: none;
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
}

body.dashboard-shell .shield-logo .shield::after {
    content: 'TM';
    font-family: var(--mono);
    font-size: 17px;
    letter-spacing: 0.08em;
    background: none;
    -webkit-text-fill-color: #f8fbff;
    color: #f8fbff;
    filter: none;
}

body.dashboard-shell .eyebrow {
    color: var(--theme-primary-strong);
    letter-spacing: 0.24em;
    margin-bottom: 16px;
}

body.dashboard-shell .header h1,
body.dashboard-shell .section-title h2,
body.dashboard-shell .hero-card h2,
body.dashboard-shell .trending-question {
    font-family: 'Sora', var(--sans);
}

body.dashboard-shell .header h1 {
    color: var(--theme-heading);
    font-size: clamp(2.3rem, 4vw, 4.2rem);
    letter-spacing: -0.05em;
}

body.dashboard-shell .header .subtitle {
    max-width: 760px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 1.02em;
}

body.dashboard-shell .header-meta {
    align-items: flex-end;
    gap: 14px;
}

body.dashboard-shell .view-badge,
body.dashboard-shell .lang-switch,
body.dashboard-shell .theme-switch,
body.dashboard-shell .mode-badge {
    backdrop-filter: blur(16px);
}

body.dashboard-shell .view-badge {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--theme-primary-soft-strong);
    color: var(--theme-primary);
    font-family: var(--mono);
    letter-spacing: 0.1em;
}

body.dashboard-shell .lang-switch,
body.dashboard-shell .theme-switch {
    background: rgba(255, 255, 255, 0.76);
    border-color: var(--theme-primary-soft-strong);
}

body.dashboard-shell .lang-pill,
body.dashboard-shell .theme-pill {
    color: #6b7d91;
}

body.dashboard-shell .lang-pill.active,
body.dashboard-shell .theme-pill.active {
    background: var(--theme-primary);
    color: #f8fbff;
}

body.dashboard-shell .mode-badge {
    border: 1px solid transparent;
    box-shadow: none;
    font-family: var(--mono);
}

body.dashboard-shell .mode-paper {
    background: rgba(183, 121, 31, 0.12);
    border-color: rgba(183, 121, 31, 0.2);
    color: #8c5c18;
}

body.dashboard-shell .mode-live {
    background: rgba(15, 159, 110, 0.12);
    border-color: rgba(15, 159, 110, 0.2);
    color: #0f7f59;
}

body.dashboard-shell .refresh-note {
    color: #708399;
    font-family: var(--mono);
    font-size: 0.78em;
    letter-spacing: 0.08em;
}

body.dashboard-shell .card,
body.dashboard-shell .card-gradient,
body.dashboard-shell .card-highlight {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

body.dashboard-shell .card::before,
body.dashboard-shell .card-gradient::after,
body.dashboard-shell .card-highlight::after {
    display: none;
}

body.dashboard-shell .card:hover {
    transform: translateY(-2px);
    border-color: var(--theme-primary-soft-strong);
    box-shadow: 0 28px 58px rgba(15, 23, 42, 0.12);
}

body.dashboard-shell .context-ribbon {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(240, 245, 250, 0.96));
    border-left: 5px solid var(--theme-primary);
}

body.dashboard-shell .ribbon-pills {
    gap: 10px;
}

body.dashboard-shell .data-pill {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.24);
    color: #53677e;
    font-family: var(--mono);
}

body.dashboard-shell .data-pill.good {
    color: #0f7f59;
}

body.dashboard-shell .data-pill.warn {
    color: #9a6a1f;
}

body.dashboard-shell .data-pill.bad {
    color: #b0431c;
}

body.dashboard-shell .ribbon-copy {
    max-width: 520px;
    color: #56697f;
}

body.dashboard-shell .hero-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr);
    gap: 22px;
}

body.dashboard-shell .hero-card {
    background: linear-gradient(145deg, var(--theme-hero-start) 0%, var(--theme-hero-mid) 58%, var(--theme-hero-end) 100%);
    color: #eef6fb;
    min-height: 372px;
}

body.dashboard-shell .hero-card .hero-label {
    color: var(--theme-hero-label);
}

body.dashboard-shell .hero-card h2 {
    color: #f7fbff;
    font-size: clamp(2.1rem, 3.4vw, 3.3rem);
}

body.dashboard-shell .hero-card .hero-lead {
    color: rgba(239, 246, 251, 0.78);
}

body.dashboard-shell .hero-label {
    color: #355b81;
    font-family: var(--mono);
    font-size: 0.72em;
    letter-spacing: 0.16em;
}

body.dashboard-shell .summary-points {
    gap: 12px;
}

body.dashboard-shell .summary-point {
    position: relative;
    padding: 15px 16px 15px 40px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(215, 224, 234, 0.9);
    border-radius: 18px;
    color: #25374b;
}

body.dashboard-shell .summary-point::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 20px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--theme-primary);
}

body.dashboard-shell .hero-card .summary-point {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f7fbff;
}

body.dashboard-shell .hero-card .summary-point::before {
    background: var(--theme-hero-bullet);
}

body.dashboard-shell .decision-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

body.dashboard-shell .decision-card {
    position: relative;
    overflow: hidden;
    min-height: 154px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.98));
    border: 1px solid rgba(215, 224, 234, 0.96);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.06);
}

body.dashboard-shell .decision-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--theme-primary);
}

body.dashboard-shell .decision-label {
    color: #5e7288;
    font-family: var(--mono);
    font-size: 0.74em;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

body.dashboard-shell .decision-value {
    color: var(--text);
    font-family: var(--mono);
    font-size: clamp(1.12rem, 1.7vw, 1.48rem);
    font-weight: 700;
    line-height: 1.2;
}

body.dashboard-shell .decision-meta {
    color: #667c92;
    font-size: 0.87em;
    line-height: 1.55;
}

body.dashboard-shell .decision-card.tone-blue::before {
    background: var(--theme-primary);
}

body.dashboard-shell .decision-card.tone-green::before {
    background: #0f9f6e;
}

body.dashboard-shell .decision-card.tone-yellow::before {
    background: #b7791f;
}

body.dashboard-shell .decision-card.tone-red::before {
    background: #c2410c;
}

body.dashboard-shell .decision-card.tone-green .decision-value {
    color: #0f7f59;
}

body.dashboard-shell .decision-card.tone-yellow .decision-value {
    color: #9a6a1f;
}

body.dashboard-shell .decision-card.tone-red .decision-value {
    color: #b0431c;
}

body.dashboard-shell .signal-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98));
}

body.dashboard-shell .prediction-box {
    padding-top: 0;
}

body.dashboard-shell .prediction-dir {
    margin: 4px 0 10px;
    letter-spacing: 0.02em;
}

body.dashboard-shell .prediction-up {
    color: #0f7f59;
}

body.dashboard-shell .prediction-down {
    color: #b0431c;
}

body.dashboard-shell .signal-confidence,
body.dashboard-shell .signal-reason {
    color: #56697f;
}

body.dashboard-shell .signal-stat {
    background: var(--theme-neutral-soft);
    border: 1px solid rgba(215, 224, 234, 0.96);
}

body.dashboard-shell .compact-grid .card {
    min-height: 198px;
}

body.dashboard-shell .card h3 {
    color: #6c8097;
    font-family: var(--mono);
    font-size: 0.74em;
    letter-spacing: 0.14em;
}

body.dashboard-shell .card .value,
body.dashboard-shell .stat-value,
body.dashboard-shell .trade-pnl,
body.dashboard-shell .trending-volume {
    color: var(--text);
    font-family: var(--mono);
}

body.dashboard-shell .card .sub,
body.dashboard-shell .stat-label,
body.dashboard-shell .indicator-name,
body.dashboard-shell .trade-info .conf,
body.dashboard-shell .calibration-legend,
body.dashboard-shell .footer,
body.dashboard-shell .inline-note {
    color: var(--muted);
}

body.dashboard-shell #walletPol {
    color: #56697f !important;
}

body.dashboard-shell .green {
    color: #0f7f59;
}

body.dashboard-shell .red {
    color: #b0431c;
}

body.dashboard-shell .yellow {
    color: #9a6a1f;
}

body.dashboard-shell .blue,
body.dashboard-shell .purple {
    color: var(--theme-primary);
}

body.dashboard-shell .progress-bar {
    height: 8px;
    border-radius: 999px;
    background: #e2ebf2;
}

body.dashboard-shell .progress-green {
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-primary-strong));
}

body.dashboard-shell .progress-red {
    background: linear-gradient(90deg, #b0431c, #ea580c);
}

body.dashboard-shell #gaugeCircle {
    stroke: var(--theme-primary);
}

body.dashboard-shell .gauge-text {
    color: var(--text);
}

body.dashboard-shell .prediction-wait {
    color: #9a6a1f;
}

body.dashboard-shell .section-nav {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

body.dashboard-shell .nav-pill {
    border: none;
    background: transparent;
    color: #61758a;
    font-weight: 700;
    font-size: 0.86em;
    letter-spacing: 0.03em;
    padding: 12px 18px;
}

body.dashboard-shell .nav-pill:hover {
    background: var(--theme-primary-soft);
    color: var(--theme-primary);
}

body.dashboard-shell .nav-pill.active {
    background: var(--theme-primary);
    color: #f8fbff;
    box-shadow: 0 12px 28px var(--theme-primary-shadow);
}

body.dashboard-shell .section-title {
    border-bottom: 1px solid rgba(215, 224, 234, 0.94);
}

body.dashboard-shell .section-title h2 {
    color: var(--text);
}

body.dashboard-shell .section-icon {
    background: var(--theme-primary-soft);
    border: 1px solid var(--theme-primary-soft-strong);
    color: var(--theme-primary);
}

body.dashboard-shell .metric-item {
    border-bottom-color: rgba(226, 232, 240, 0.92);
}

body.dashboard-shell .trade-item {
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(215, 224, 234, 0.96);
    border-radius: 18px;
}

body.dashboard-shell .trade-item:hover {
    background: #f8fbfd;
    border-color: var(--theme-primary-soft-strong);
}

body.dashboard-shell .trade-emoji {
    display: none;
}

body.dashboard-shell .trade-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--mono);
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.dashboard-shell .trade-status-win {
    background: rgba(15, 159, 110, 0.1);
    border-color: rgba(15, 159, 110, 0.16);
    color: #0f7f59;
}

body.dashboard-shell .trade-status-loss {
    background: rgba(196, 65, 12, 0.12);
    border-color: rgba(196, 65, 12, 0.16);
    color: #b0431c;
}

body.dashboard-shell .trade-status-pending {
    background: rgba(183, 121, 31, 0.12);
    border-color: rgba(183, 121, 31, 0.16);
    color: #9a6a1f;
}

body.dashboard-shell .trade-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body.dashboard-shell .trade-info .dir {
    color: var(--text);
    font-family: var(--mono);
}

body.dashboard-shell .trade-market,
body.dashboard-shell .trade-sep {
    color: #6f8397;
}

body.dashboard-shell .table-wrapper {
    border: 1px solid rgba(215, 224, 234, 0.96);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.dashboard-shell .trade-table thead th,
body.dashboard-shell .prompt-table thead th {
    background: #f3f7fa;
    color: #61758a;
    border-bottom-color: rgba(215, 224, 234, 0.96);
    font-family: var(--mono);
    letter-spacing: 0.08em;
}

body.dashboard-shell .trade-table td,
body.dashboard-shell .prompt-table td {
    color: var(--text);
    border-bottom-color: rgba(233, 239, 245, 0.92);
}

body.dashboard-shell .trade-table tbody tr:hover,
body.dashboard-shell .prompt-table tbody tr:hover {
    background: #f9fbfd;
}

body.dashboard-shell .equity-chart-container,
body.dashboard-shell .timeline-block {
    background: linear-gradient(180deg, rgba(250, 252, 253, 0.98), rgba(241, 246, 249, 0.98));
    border: 1px solid rgba(215, 224, 234, 0.96);
    border-radius: 20px;
}

body.dashboard-shell .equity-empty {
    color: #6a7d90;
}

body.dashboard-shell .calibration-bar.bar-expected {
    background: var(--theme-primary-soft-strong);
}

body.dashboard-shell .calibration-bar.bar-actual {
    background: rgba(15, 159, 110, 0.72);
}

body.dashboard-shell .trending-grid {
    gap: 18px;
}

body.dashboard-shell .trending-card {
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98));
    border: 1px solid rgba(215, 224, 234, 0.96);
    border-radius: 22px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

body.dashboard-shell .trending-card:hover {
    border-color: var(--theme-primary-soft-strong);
}

body.dashboard-shell .trending-question {
    color: var(--text);
    font-size: 1rem;
}

body.dashboard-shell .trending-price-pill {
    border-radius: 14px;
    background: #f3f7fa;
}

body.dashboard-shell .pill-yes {
    background: rgba(15, 159, 110, 0.08);
    border: 1px solid rgba(15, 159, 110, 0.16);
    color: #0f7f59;
}

body.dashboard-shell .pill-no {
    background: rgba(196, 65, 12, 0.1);
    border: 1px solid rgba(196, 65, 12, 0.14);
    color: #b0431c;
}

body.dashboard-shell .trending-meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(226, 232, 240, 0.94);
}

body.dashboard-shell .trending-tag {
    background: var(--theme-primary-soft);
    border: 1px solid var(--theme-primary-soft-strong);
    color: var(--theme-primary);
}

body.dashboard-shell .trending-link,
body.dashboard-shell .footer a {
    color: var(--theme-link);
    font-weight: 700;
    text-decoration: none;
}

body.dashboard-shell .trending-link:hover,
body.dashboard-shell .footer a:hover {
    text-decoration: underline;
}

body.dashboard-shell .btn {
    border: 1px solid var(--theme-primary-soft-strong);
    background: var(--theme-primary-soft);
    color: var(--theme-primary);
    border-radius: 12px;
    font-family: var(--mono);
}

body.dashboard-shell .btn:hover {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: #f8fbff;
    box-shadow: 0 14px 28px var(--theme-primary-shadow);
}

body.dashboard-shell .footer {
    padding-top: 34px;
    border-top: 1px solid rgba(215, 224, 234, 0.96);
    color: #61758a;
}

body.dashboard-shell .footer .version {
    color: var(--theme-primary);
}

body.dashboard-ops .ops-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 253, 0.96));
}

@media (max-width: 1024px) {
    body.dashboard-shell .decision-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.dashboard-shell .hero-grid,
    body.dashboard-shell .performance-grid {
        grid-template-columns: 1fr;
    }

    body.dashboard-shell .header-meta {
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    body.dashboard-shell .container {
        padding: 18px 14px 34px;
    }

    body.dashboard-shell .context-ribbon {
        flex-direction: column;
    }

    body.dashboard-shell .section-nav {
        width: 100%;
    }

    body.dashboard-shell .nav-pill {
        width: 100%;
        justify-content: center;
    }

    body.dashboard-shell .trade-item {
        flex-direction: column;
    }

    body.dashboard-shell .trade-status-pill {
        min-width: 0;
    }

    body.dashboard-shell .decision-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== PHASE 3 STRUCTURAL LAYOUT REFRESH ===== */
body.dashboard-shell .desk-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.72fr) minmax(320px, 420px);
    gap: 24px;
    align-items: start;
}

body.dashboard-shell .desk-stage,
body.dashboard-shell .panel-stack,
body.dashboard-shell .overview-main,
body.dashboard-shell .overview-side,
body.dashboard-shell .research-main,
body.dashboard-shell .research-side,
body.dashboard-shell .ops-main,
body.dashboard-shell .ops-side,
body.dashboard-shell .compact-stack,
body.dashboard-shell .markets-layout {
    display: grid;
    gap: 20px;
}

body.dashboard-shell .desk-stage {
    min-width: 0;
}

body.dashboard-shell .desk-sidebar {
    position: sticky;
    top: 22px;
    align-self: start;
    display: grid;
    gap: 18px;
}

body.dashboard-shell .sidebar-card {
    min-width: 0;
}

body.dashboard-shell .section-nav-wrap {
    position: sticky;
    top: 16px;
    z-index: 8;
}

body.dashboard-shell .section-nav-wrap .section-nav {
    width: fit-content;
    max-width: 100%;
}

body.dashboard-shell .panel-stack {
    min-width: 0;
}

body.dashboard-shell .overview-layout,
body.dashboard-shell .research-layout,
body.dashboard-shell .ops-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.92fr);
    gap: 22px;
    align-items: start;
}

body.dashboard-shell .overview-main,
body.dashboard-shell .research-main,
body.dashboard-shell .ops-main {
    min-width: 0;
}

body.dashboard-shell .overview-side,
body.dashboard-shell .research-side,
body.dashboard-shell .ops-side {
    min-width: 0;
}

body.dashboard-shell .overview-main .performance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.dashboard-shell .kpi-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

body.dashboard-shell .rail-kpi-card {
    min-height: 148px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

body.dashboard-shell .rail-kpi-card .value {
    font-size: 1.72em;
}

body.dashboard-shell .market-brief {
    overflow: hidden;
}

body.dashboard-shell .market-points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.dashboard-shell .market-updated {
    margin-left: auto;
    color: #6c8097;
    font-size: 0.78em;
    font-family: var(--mono);
}

body.dashboard-shell .market-board {
    padding-top: 20px;
}

body.dashboard-shell .ops-card .section-title {
    margin-bottom: 18px;
}

body.dashboard-shell .ops-main .ops-card:first-child {
    padding-bottom: 24px;
}

body.dashboard-shell .ops-actions {
    margin-top: 16px;
}

body.dashboard-shell .ops-side .metric-stack {
    margin-top: 0;
}

body.dashboard-shell .ops-side .table-wrapper,
body.dashboard-shell .ops-main .table-wrapper,
body.dashboard-shell .research-side .table-wrapper,
body.dashboard-shell .research-main .table-wrapper,
body.dashboard-shell .overview-main .table-wrapper {
    margin-top: 0;
}

body.dashboard-shell .panel[data-panel="markets"] .market-board {
    min-height: 420px;
}

@media (max-width: 1280px) {
    body.dashboard-shell .desk-layout {
        grid-template-columns: 1fr;
    }

    body.dashboard-shell .desk-sidebar {
        position: static;
        top: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.dashboard-shell .desk-sidebar > .card:first-child,
    body.dashboard-shell .desk-sidebar > .card:last-child,
    body.dashboard-shell .desk-sidebar > .compact-stack,
    body.dashboard-shell .desk-sidebar > .kpi-rail {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    body.dashboard-shell .overview-layout,
    body.dashboard-shell .research-layout,
    body.dashboard-shell .ops-layout {
        grid-template-columns: 1fr;
    }

    body.dashboard-shell .overview-main .performance-grid {
        grid-template-columns: 1fr;
    }

    body.dashboard-shell .market-points {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body.dashboard-shell .desk-sidebar {
        grid-template-columns: 1fr;
    }

    body.dashboard-shell .kpi-rail {
        grid-template-columns: 1fr 1fr;
    }

    body.dashboard-shell .section-nav-wrap {
        position: static;
    }
}

@media (max-width: 560px) {
    body.dashboard-shell .kpi-rail {
        grid-template-columns: 1fr;
    }
}

/* ===== PHASE 6 NAVY AURORA / RAINBOW / GOLD ===== */
@keyframes auroraDrift {
    0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.88; }
    50% { transform: translate3d(2%, -1.5%, 0) scale(1.04); opacity: 1; }
    100% { transform: translate3d(-2%, 2%, 0) scale(1.08); opacity: 0.9; }
}

@keyframes rainbowFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 220% 50%; }
}

@keyframes goldSweep {
    0% { transform: translateX(-150%) skewX(-28deg); opacity: 0; }
    16% { opacity: 0; }
    34% { opacity: 0.9; }
    52% { opacity: 0; }
    100% { transform: translateX(150%) skewX(-28deg); opacity: 0; }
}

@keyframes shimmerPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(245, 200, 89, 0); }
    50% { box-shadow: 0 0 36px rgba(245, 200, 89, 0.14); }
}

body.dashboard-shell[data-theme="navy"] {
    --paper: #040b18;
    --paper-strong: #091224;
    --surface: linear-gradient(180deg, rgba(6, 12, 28, 0.94), rgba(8, 15, 34, 0.9));
    --surface-soft: rgba(9, 17, 38, 0.92);
    --surface-strong: rgba(11, 20, 44, 0.96);
    --border: rgba(125, 211, 252, 0.12);
    --border-strong: rgba(245, 200, 89, 0.22);
    --text: #eef5ff;
    --muted: #97a9ca;
    --shadow: 0 28px 64px rgba(2, 6, 23, 0.46);
    --theme-primary: #7dd3fc;
    --theme-primary-strong: #a78bfa;
    --theme-primary-soft: rgba(125, 211, 252, 0.12);
    --theme-primary-soft-strong: rgba(245, 200, 89, 0.24);
    --theme-primary-shadow: rgba(168, 85, 247, 0.26);
    --theme-heading: #fdf6e3;
    --theme-page-start: #020816;
    --theme-page-mid: #071224;
    --theme-page-end: #0b1631;
    --theme-orb-1: rgba(59, 130, 246, 0.18);
    --theme-orb-2: rgba(168, 85, 247, 0.16);
    --theme-orb-3: rgba(245, 200, 89, 0.12);
    --theme-hero-start: #071426;
    --theme-hero-mid: #0b1736;
    --theme-hero-end: #132451;
    --theme-hero-label: #f5d87c;
    --theme-hero-bullet: #f6c453;
    --theme-neutral-soft: rgba(10, 21, 44, 0.74);
    --theme-link: #f5d87c;
}

body.dashboard-shell[data-theme="navy"]::before {
    background:
        radial-gradient(circle at 10% 14%, rgba(56, 189, 248, 0.22), transparent 26%),
        radial-gradient(circle at 84% 10%, rgba(168, 85, 247, 0.18), transparent 24%),
        radial-gradient(circle at 72% 72%, rgba(245, 200, 89, 0.12), transparent 24%),
        radial-gradient(circle at 26% 78%, rgba(244, 114, 182, 0.12), transparent 20%);
    animation: auroraDrift 22s ease-in-out infinite alternate;
    opacity: 1;
}

body.dashboard-shell[data-theme="navy"]::after {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(135deg, rgba(245, 200, 89, 0.08), transparent 30%, transparent 70%, rgba(125, 211, 252, 0.06));
    background-size: 72px 72px, 72px 72px, 100% 100%;
    opacity: 0.34;
}

body.dashboard-shell[data-theme="navy"] .header::after {
    background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.28), rgba(245, 200, 89, 0.48), rgba(244, 114, 182, 0.18), transparent);
}

body.dashboard-shell[data-theme="navy"] .header h1 {
    background: linear-gradient(120deg, #f9f1d0 0%, #7dd3fc 18%, #60a5fa 32%, #a78bfa 50%, #f472b6 67%, #f59e0b 84%, #fff4c2 100%);
    background-size: 240% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    animation: rainbowFlow 13s linear infinite;
}

body.dashboard-shell[data-theme="navy"] .eyebrow,
body.dashboard-shell[data-theme="navy"] .hero-label {
    color: #f5d87c;
}

body.dashboard-shell[data-theme="navy"] .subtitle,
body.dashboard-shell[data-theme="navy"] .refresh-note,
body.dashboard-shell[data-theme="navy"] .card .sub,
body.dashboard-shell[data-theme="navy"] .stat-label,
body.dashboard-shell[data-theme="navy"] .indicator-name,
body.dashboard-shell[data-theme="navy"] .trade-info .conf,
body.dashboard-shell[data-theme="navy"] .calibration-legend,
body.dashboard-shell[data-theme="navy"] .footer,
body.dashboard-shell[data-theme="navy"] .inline-note,
body.dashboard-shell[data-theme="navy"] .decision-meta,
body.dashboard-shell[data-theme="navy"] .ribbon-copy {
    color: #9fb1d4;
}

body.dashboard-shell[data-theme="navy"] .view-badge,
body.dashboard-shell[data-theme="navy"] .theme-switch,
body.dashboard-shell[data-theme="navy"] .mode-badge {
    background: rgba(8, 16, 35, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 28px rgba(2, 6, 23, 0.26);
}

body.dashboard-shell[data-theme="navy"] .view-badge {
    color: #f5d87c;
    border-color: rgba(245, 200, 89, 0.26);
}

body.dashboard-shell[data-theme="navy"] .theme-pill {
    color: #b7c4dc;
}

body.dashboard-shell[data-theme="navy"] .theme-pill.active {
    background: linear-gradient(120deg, rgba(125, 211, 252, 0.28), rgba(168, 85, 247, 0.32), rgba(244, 114, 182, 0.28), rgba(245, 200, 89, 0.28));
    background-size: 220% auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff7dd;
    animation: rainbowFlow 9s linear infinite;
}

body.dashboard-shell[data-theme="navy"] .mode-paper {
    background: rgba(245, 200, 89, 0.12);
    border-color: rgba(245, 200, 89, 0.22);
    color: #f5d87c;
    animation: shimmerPulse 4.2s ease-in-out infinite;
}

body.dashboard-shell[data-theme="navy"] .mode-live {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.22);
    color: #86efac;
    animation: shimmerPulse 4.2s ease-in-out infinite;
}

body.dashboard-shell[data-theme="navy"] .card,
body.dashboard-shell[data-theme="navy"] .card-gradient,
body.dashboard-shell[data-theme="navy"] .card-highlight {
    background: linear-gradient(180deg, rgba(6, 12, 28, 0.9), rgba(8, 15, 34, 0.92));
    border: 1px solid rgba(125, 211, 252, 0.12);
    box-shadow: 0 24px 54px rgba(2, 6, 23, 0.36);
}

body.dashboard-shell[data-theme="navy"] .card:hover {
    border-color: rgba(245, 200, 89, 0.3);
    box-shadow: 0 30px 66px rgba(2, 6, 23, 0.5), 0 0 0 1px rgba(125, 211, 252, 0.06);
    transform: translateY(-4px);
}

body.dashboard-shell[data-theme="navy"] .context-ribbon {
    background: linear-gradient(135deg, rgba(7, 16, 36, 0.92), rgba(10, 20, 46, 0.9));
    border-left: 5px solid #f5d87c;
}

body.dashboard-shell[data-theme="navy"] .data-pill {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: #cfe0ff;
}

body.dashboard-shell[data-theme="navy"] .data-pill.good {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

body.dashboard-shell[data-theme="navy"] .data-pill.warn {
    background: rgba(245, 200, 89, 0.12);
    color: #f5d87c;
}

body.dashboard-shell[data-theme="navy"] .data-pill.bad {
    background: rgba(244, 114, 182, 0.12);
    color: #f9a8d4;
}

body.dashboard-shell[data-theme="navy"] .hero-card,
body.dashboard-shell[data-theme="navy"] .signal-card {
    position: relative;
    overflow: hidden;
}

body.dashboard-shell[data-theme="navy"] .hero-card {
    background: linear-gradient(145deg, rgba(6, 14, 32, 0.96) 0%, rgba(9, 19, 43, 0.95) 45%, rgba(14, 28, 58, 0.94) 100%);
    border-color: rgba(125, 211, 252, 0.16);
}

body.dashboard-shell[data-theme="navy"] .hero-card::before {
    display: block;
    height: 100%;
    top: 0;
    background:
        radial-gradient(circle at 16% 14%, rgba(125, 211, 252, 0.28), transparent 22%),
        radial-gradient(circle at 82% 18%, rgba(168, 85, 247, 0.24), transparent 22%),
        radial-gradient(circle at 74% 78%, rgba(245, 200, 89, 0.18), transparent 24%);
    opacity: 0.88;
    filter: blur(0);
    animation: auroraDrift 18s ease-in-out infinite alternate;
}

body.dashboard-shell[data-theme="navy"] .hero-card::after,
body.dashboard-shell[data-theme="navy"] .signal-card::after {
    display: block;
    content: '';
    position: absolute;
    top: -30%;
    left: -10%;
    width: 40%;
    height: 160%;
    background: linear-gradient(90deg, transparent, rgba(255, 247, 201, 0.1), rgba(245, 200, 89, 0.46), rgba(255, 247, 201, 0.12), transparent);
    filter: blur(2px);
    pointer-events: none;
    animation: goldSweep 8s ease-in-out infinite;
}

body.dashboard-shell[data-theme="navy"] .hero-card > *,
body.dashboard-shell[data-theme="navy"] .signal-card > * {
    position: relative;
    z-index: 1;
}

body.dashboard-shell[data-theme="navy"] .hero-card .summary-point,
body.dashboard-shell[data-theme="navy"] .signal-stat {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: #edf5ff;
}

body.dashboard-shell[data-theme="navy"] .hero-card .summary-point::before {
    background: #f5d87c;
}

body.dashboard-shell[data-theme="navy"] .decision-card {
    background: linear-gradient(180deg, rgba(7, 16, 36, 0.92), rgba(9, 19, 43, 0.9));
    border: 1px solid rgba(125, 211, 252, 0.12);
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.32);
}

body.dashboard-shell[data-theme="navy"] .decision-card::before {
    width: 100%;
    height: 3px;
    inset: 0 0 auto 0;
    background: linear-gradient(90deg, #7dd3fc 0%, #60a5fa 24%, #a78bfa 48%, #f472b6 72%, #f5d87c 100%);
    background-size: 220% auto;
    animation: rainbowFlow 10s linear infinite;
}

body.dashboard-shell[data-theme="navy"] .decision-label {
    color: #f5d87c;
}

body.dashboard-shell[data-theme="navy"] .decision-value,
body.dashboard-shell[data-theme="navy"] .card .value,
body.dashboard-shell[data-theme="navy"] .stat-value,
body.dashboard-shell[data-theme="navy"] .trade-pnl,
body.dashboard-shell[data-theme="navy"] .trending-volume,
body.dashboard-shell[data-theme="navy"] .section-title h2,
body.dashboard-shell[data-theme="navy"] .trending-question,
body.dashboard-shell[data-theme="navy"] .trade-info .dir {
    color: #eef5ff;
}

body.dashboard-shell[data-theme="navy"] .decision-card.tone-green .decision-value,
body.dashboard-shell[data-theme="navy"] .trade-status-win,
body.dashboard-shell[data-theme="navy"] .prediction-up {
    color: #86efac;
}

body.dashboard-shell[data-theme="navy"] .decision-card.tone-yellow .decision-value,
body.dashboard-shell[data-theme="navy"] .trade-status-pending,
body.dashboard-shell[data-theme="navy"] .prediction-wait {
    color: #f5d87c;
}

body.dashboard-shell[data-theme="navy"] .decision-card.tone-red .decision-value,
body.dashboard-shell[data-theme="navy"] .trade-status-loss,
body.dashboard-shell[data-theme="navy"] .prediction-down {
    color: #f9a8d4;
}

body.dashboard-shell[data-theme="navy"] .signal-card {
    background: linear-gradient(160deg, rgba(7, 16, 36, 0.94), rgba(11, 25, 54, 0.94), rgba(20, 18, 58, 0.92));
    border-color: rgba(245, 200, 89, 0.16);
}

body.dashboard-shell[data-theme="navy"] .signal-confidence,
body.dashboard-shell[data-theme="navy"] .signal-reason {
    color: #b7c7e4;
}

body.dashboard-shell[data-theme="navy"] .section-nav {
    background: rgba(8, 16, 35, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 28px rgba(2, 6, 23, 0.22);
}

body.dashboard-shell[data-theme="navy"] .nav-pill {
    color: #b5c3dc;
}

body.dashboard-shell[data-theme="navy"] .nav-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff7dd;
}

body.dashboard-shell[data-theme="navy"] .nav-pill.active {
    background: linear-gradient(120deg, #60a5fa 0%, #7c3aed 34%, #ec4899 68%, #f59e0b 100%);
    background-size: 220% auto;
    color: #fffdf4;
    box-shadow: 0 14px 30px rgba(168, 85, 247, 0.24);
    animation: rainbowFlow 9s linear infinite;
}

body.dashboard-shell[data-theme="navy"] .section-title,
body.dashboard-shell[data-theme="navy"] .metric-item,
body.dashboard-shell[data-theme="navy"] .trending-meta {
    border-color: rgba(255, 255, 255, 0.08);
}

body.dashboard-shell[data-theme="navy"] .section-icon,
body.dashboard-shell[data-theme="navy"] .trending-tag {
    background: rgba(125, 211, 252, 0.1);
    border-color: rgba(125, 211, 252, 0.18);
    color: #9fe1ff;
}

body.dashboard-shell[data-theme="navy"] .progress-bar,
body.dashboard-shell[data-theme="navy"] .trending-price-pill,
body.dashboard-shell[data-theme="navy"] .table-wrapper,
body.dashboard-shell[data-theme="navy"] .equity-chart-container,
body.dashboard-shell[data-theme="navy"] .timeline-block {
    background: rgba(7, 16, 36, 0.74);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dashboard-shell[data-theme="navy"] .trade-item,
body.dashboard-shell[data-theme="navy"] .trending-card {
    background: linear-gradient(180deg, rgba(7, 16, 36, 0.82), rgba(9, 19, 43, 0.84));
    border-color: rgba(125, 211, 252, 0.1);
}

body.dashboard-shell[data-theme="navy"] .trending-card {
    position: relative;
    overflow: hidden;
}

body.dashboard-shell[data-theme="navy"] .trending-card::before {
    display: block;
    opacity: 1;
    height: 3px;
    background: linear-gradient(90deg, #60a5fa 0%, #a78bfa 33%, #f472b6 66%, #f5d87c 100%);
    background-size: 220% auto;
    animation: rainbowFlow 10s linear infinite;
}

body.dashboard-shell[data-theme="navy"] .trade-item:hover,
body.dashboard-shell[data-theme="navy"] .trending-card:hover {
    background: linear-gradient(180deg, rgba(10, 21, 46, 0.9), rgba(13, 26, 58, 0.92));
    border-color: rgba(245, 200, 89, 0.22);
}

body.dashboard-shell[data-theme="navy"] .pill-yes {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

body.dashboard-shell[data-theme="navy"] .pill-no {
    background: rgba(244, 114, 182, 0.1);
    border-color: rgba(244, 114, 182, 0.18);
    color: #f9a8d4;
}

body.dashboard-shell[data-theme="navy"] .trade-table thead th,
body.dashboard-shell[data-theme="navy"] .prompt-table thead th {
    background: rgba(7, 16, 36, 0.94);
    color: #f5d87c;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dashboard-shell[data-theme="navy"] .trade-table td,
body.dashboard-shell[data-theme="navy"] .prompt-table td {
    color: #e4edff;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.dashboard-shell[data-theme="navy"] .trade-table tbody tr:hover,
body.dashboard-shell[data-theme="navy"] .prompt-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

body.dashboard-shell[data-theme="navy"] .btn {
    background: linear-gradient(120deg, rgba(125, 211, 252, 0.12), rgba(168, 85, 247, 0.12));
    border-color: rgba(125, 211, 252, 0.2);
    color: #dff4ff;
}

body.dashboard-shell[data-theme="navy"] .btn:hover {
    background: linear-gradient(120deg, #60a5fa 0%, #7c3aed 34%, #ec4899 68%, #f59e0b 100%);
    background-size: 220% auto;
    border-color: rgba(255, 255, 255, 0.12);
    color: #fffdf4;
    box-shadow: 0 16px 30px rgba(168, 85, 247, 0.24);
    animation: rainbowFlow 8s linear infinite;
}

body.dashboard-shell[data-theme="navy"] .footer .version,
body.dashboard-shell[data-theme="navy"] .trending-link,
body.dashboard-shell[data-theme="navy"] .footer a {
    color: #f5d87c;
}
