:root {
  --ink: #101828; --muted: #667085; --line: #e7eaf0; --surface: #ffffff;
  --canvas: #f5f7fb; --navy: #09101f; --blue: #1464f4; --blue-soft: #eaf1ff;
  --green: #087a55; --green-soft: #e7f7f0; --red: #c43d4d; --red-soft: #fcecef;
  --amber: #b36b00; --amber-soft: #fff4df; --shadow: 0 8px 30px rgba(18, 31, 53, .07);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; color: #dce5f5; background: linear-gradient(180deg, #0b1325 0%, #08101e 100%); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; }
.brand-logo-wrap { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 13px; background: white; box-shadow: 0 7px 20px rgba(0,0,0,.18); }
.brand-logo { display: block; width: 35px; height: 35px; object-fit: contain; }
.brand strong { display: block; color: white; letter-spacing: .17em; font-size: 14px; }
.brand small { display: block; margin-top: 4px; font-size: 8px; letter-spacing: .12em; color: #8290a9; }
nav { display: grid; gap: 6px; }
.nav-item { width: 100%; padding: 12px 14px; border: 0; border-radius: 10px; color: #93a2ba; background: transparent; text-align: left; display: flex; align-items: center; gap: 12px; transition: .2s ease; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.08); }
.nav-item.active { box-shadow: inset 3px 0 var(--blue); }
.nav-item span { color: #7194d8; font-size: 18px; }
.side-note { margin-top: auto; display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.035); }
.side-note strong { display: block; font-size: 11px; color: #dce5f5; }
.side-note small { display: block; font-size: 9px; line-height: 1.5; margin-top: 4px; color: #7787a1; }
.live-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #2fd29b; box-shadow: 0 0 0 4px rgba(47,210,155,.12); flex: 0 0 auto; margin-top: 3px; }
main { min-width: 0; }
.topbar { height: 92px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); padding: 18px 34px; display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.topbar h1 { margin: 3px 0 0; font-size: 23px; letter-spacing: -.03em; }
.eyebrow { margin: 0; color: #8a95a6; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.eyebrow span { color: var(--blue); }
.top-actions { margin-left: auto; display: flex; gap: 10px; }
.search { width: 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.search span { color: #8a95a6; font-size: 19px; }
.search input { width: 100%; height: 40px; outline: 0; border: 0; background: transparent; font-size: 13px; }
.refresh-button, .menu-button { border: 1px solid var(--line); border-radius: 10px; background: white; color: #42526b; padding: 0 14px; }
.refresh-button.loading { pointer-events: none; opacity: .65; }
.menu-button { display: none; width: 42px; height: 42px; padding: 0; }
.content { padding: 22px 34px 50px; max-width: 1600px; margin: 0 auto; }
.status-line { display: flex; justify-content: space-between; color: #7b8798; font-size: 11px; margin-bottom: 18px; }
.status-line > span:first-child { display: flex; gap: 9px; align-items: center; color: #405069; font-weight: 700; }
.status-line .live-dot { margin: 0; }
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: .2; transform: translateY(4px); } }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 32px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 4px 18px rgba(18,31,53,.035); }
.kpi-label { color: #7d899a; font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: .1em; }
.kpi-value { font-size: 25px; font-weight: 750; margin: 8px 0 5px; letter-spacing: -.04em; }
.kpi-note { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up { color: var(--green) !important; } .down { color: var(--red) !important; } .flat { color: var(--amber) !important; }
.section-heading, .panel-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.section-heading h2, .panel-title h2, .methodology h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.025em; }
.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.chip { border: 1px solid var(--line); background: white; color: #68758a; border-radius: 100px; padding: 7px 11px; font-size: 11px; }
.chip.active { color: white; border-color: var(--blue); background: var(--blue); }
.market-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.market-card { text-align: left; border: 1px solid var(--line); background: white; border-radius: 14px; padding: 15px; transition: .2s ease; min-width: 0; }
.market-card:hover { transform: translateY(-2px); border-color: #b9caec; box-shadow: var(--shadow); }
.card-top, .price-row, .metric-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.commodity-name { font-size: 13px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category { color: #8a95a6; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.signal-pill { padding: 4px 7px; border-radius: 100px; font-size: 9px; font-weight: 800; }
.signal-pill.bullish { color: var(--green); background: var(--green-soft); }
.signal-pill.bearish { color: var(--red); background: var(--red-soft); }
.signal-pill.mixed { color: var(--amber); background: var(--amber-soft); }
.price-row { margin-top: 18px; align-items: baseline; }
.price { font-size: 20px; font-weight: 780; letter-spacing: -.035em; }
.unit { color: #9aa4b2; font-size: 9px; margin-left: 4px; }
.change { font-size: 12px; font-weight: 750; }
.sparkline { width: 100%; height: 48px; margin: 8px 0 9px; display: block; }
.metric-row { border-top: 1px solid #f0f2f6; padding-top: 10px; font-size: 10px; color: #8490a1; }
.metric-row b { color: #425069; font-weight: 700; }
.panel { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 22px; box-shadow: 0 4px 18px rgba(18,31,53,.035); }
.panel-title { align-items: flex-start; margin-bottom: 24px; }
.panel-title > span { font-size: 10px; color: #8a95a6; }
.heatmap { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.heat-tile { min-height: 108px; border-radius: 10px; padding: 13px; color: white; display: flex; flex-direction: column; justify-content: space-between; border: 0; text-align: left; transition: transform .15s ease; }
.heat-tile:hover { transform: scale(1.02); }
.heat-tile strong { font-size: 13px; }
.heat-tile span { font-size: 20px; font-weight: 800; }
.heat-tile small { opacity: .72; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; font-size: 9px; color: #8a95a6; }
.legend-bar { width: 120px; height: 6px; border-radius: 4px; background: linear-gradient(90deg, #b32e44, #a89c86, #087a55); }
.signals-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); gap: 14px; }
.signal-list { display: grid; gap: 7px; }
.signal-item { display: grid; grid-template-columns: 34px minmax(140px, 1fr) 90px 90px 1.5fr; align-items: center; gap: 12px; padding: 12px; border: 1px solid #edf0f4; border-radius: 10px; }
.rank { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #f1f4f9; color: #66758b; font-size: 11px; font-weight: 800; }
.signal-name strong { display: block; font-size: 12px; }.signal-name small { font-size: 9px; color: #8b96a6; }
.signal-metric { font-size: 11px; color: #67758a; }.signal-metric b { display: block; color: #24324a; margin-bottom: 2px; }
.signal-copy { font-size: 10px; line-height: 1.5; color: #637087; }
.methodology .eyebrow { margin-bottom: 5px; }
.method { padding: 15px 0; border-bottom: 1px solid #edf0f4; }
.method b { font-size: 12px; }.method p { margin: 4px 0 0; color: #6e7b8f; font-size: 11px; line-height: 1.55; }
.disclaimer { margin-top: 18px; background: #f4f7fb; border-radius: 10px; padding: 13px; color: #748196; font-size: 9px; line-height: 1.55; }
.empty { grid-column: 1 / -1; padding: 60px 20px; text-align: center; color: #8a95a6; background: white; border: 1px dashed #d4dae4; border-radius: 14px; }
dialog { width: min(820px, calc(100vw - 28px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(5,10,20,.68); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; right: 16px; top: 13px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f0f3f7; color: #5e6c80; font-size: 20px; z-index: 2; }
.dialog-body { padding: 26px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; padding-right: 45px; }
.dialog-head h2 { font-size: 26px; margin: 4px 0; }.dialog-price { text-align: right; font-size: 25px; font-weight: 800; }
.dialog-chart { width: 100%; height: 240px; margin: 24px 0; border-radius: 12px; background: linear-gradient(180deg,#f7faff,#fff); }
.dialog-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.dialog-stat { padding: 11px; background: #f6f8fb; border-radius: 9px; }.dialog-stat small { display: block; color: #8a95a6; font-size: 9px; }.dialog-stat b { font-size: 13px; }
.insight { margin-top: 16px; padding: 16px; border-left: 3px solid var(--blue); background: var(--blue-soft); font-size: 12px; line-height: 1.6; color: #385072; }
@media (max-width: 1180px) { .market-grid { grid-template-columns: repeat(3, 1fr); }.heatmap { grid-template-columns: repeat(4, 1fr); }.kpi-grid { grid-template-columns: repeat(2, 1fr); }.signal-item { grid-template-columns: 34px minmax(120px, 1fr) 70px 1.4fr; }.signal-item .vol-cell { display:none; } }
@media (max-width: 860px) { .app-shell { display: block; }.sidebar { position: fixed; left: -260px; transition: left .2s ease; width: 248px; }.sidebar.open { left: 0; box-shadow: 20px 0 70px rgba(0,0,0,.28); }.menu-button { display: block; }.topbar { padding: 16px 18px; }.content { padding: 18px; }.topbar .eyebrow { display:none; }.search { width: 190px; }.market-grid { grid-template-columns: repeat(2, 1fr); }.signals-layout { grid-template-columns: 1fr; }.heatmap { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 590px) { .topbar { height: 76px; }.topbar h1 { font-size: 18px; }.search { display:none; }.refresh-button span { display:none; }.status-line { align-items:flex-start; gap:8px; }.kpi-grid { grid-template-columns: 1fr 1fr; gap:8px; }.kpi { padding:14px; }.kpi-value { font-size:20px; }.section-heading { align-items:flex-start; flex-direction:column; }.chips { justify-content:flex-start; overflow:auto; width:100%; flex-wrap:nowrap; padding-bottom:4px; }.market-grid { grid-template-columns:1fr; }.heatmap { grid-template-columns:repeat(2,1fr); }.heat-tile { min-height:96px; }.signal-item { grid-template-columns:30px 1fr 70px; }.signal-copy,.vol-cell { display:none; }.dialog-head { align-items:flex-start; flex-direction:column; }.dialog-price { text-align:left; }.dialog-stats { grid-template-columns:repeat(2,1fr); } }

.home-link { text-decoration: none; white-space: nowrap; }
