/* Today page (home). Layout mirrors the approved redesign mockup. */
#page-today { padding: 28px 40px 48px; }

.today-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.today-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.today-status-dot.is-open { background: var(--accent-green); }
.today-status-dot.is-closed { background: var(--spot); }

.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.today-main, .today-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.today-hero-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 18px; }
.today-spot { margin: 0; font-family: var(--font-mono); font-weight: 500; font-size: 52px; letter-spacing: -0.02em; line-height: 1.1; color: var(--text-primary); }
.today-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.today-chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-hover); color: var(--text-secondary); white-space: nowrap; }
.today-chip-positive { border-color: #2C5A45; color: #8FDDB6; }
.today-chip-warn { border-color: #5A4420; color: #F0C57A; background: #1C1810; }
.today-chip-info { border-color: #2B4466; color: #A9CBFF; }
.today-read { margin: 14px 0 0; max-width: 780px; font-family: var(--font-serif); font-size: 29px; line-height: 1.25; color: var(--text-primary); }
.today-caption { margin: 10px 0 0; font-size: 12px; color: var(--text-muted); }

.today-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.today-card-quiet { background: transparent; }
.today-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.today-card h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.today-link { font-size: 13px; color: var(--spot); text-decoration: none; }
.today-link:hover { text-decoration: underline; }
.today-link-quiet { color: var(--text-muted); }
.today-muted { margin: 0; font-size: 14px; color: var(--text-muted); }
.today-note { margin: 0; font-size: 12px; color: var(--text-muted); }

/* level rail */
.today-rail { padding: 0 8px; }
.today-rail-track { position: relative; height: 4px; margin: 44px 0 64px; border-radius: 2px; background: var(--border-color); }
.today-rail-neg { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gamma-neg); border-radius: 2px 0 0 2px; }
.today-rail-pos { position: absolute; right: 0; top: 0; bottom: 0; background: var(--gamma-pos); border-radius: 0 2px 2px 0; }
.today-rail-tick { position: absolute; top: -10px; width: 2px; height: 24px; margin-left: -1px; background: var(--text-secondary); }
.today-rail-tick.tick-put { background: var(--gamma-neg); }
.today-rail-tick.tick-call, .today-rail-tick.tick-pin { background: var(--gamma-pos); }
.today-rail-tick.tick-flip { background: var(--text-primary); }
.today-rail-label { position: absolute; top: 20px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: 12px; line-height: 1.3; white-space: nowrap; }
.today-rail-label.row-1 { top: 50px; }
.today-rail-label-name { color: var(--text-muted); }
.today-rail-label-value { font-family: var(--font-mono); color: var(--text-primary); }
.today-rail-spot { position: absolute; top: -40px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.today-rail-spot-value { font-family: var(--font-mono); font-size: 13px; font-weight: 500; background: var(--spot); color: #14120D; padding: 2px 8px; border-radius: 6px; }
.today-rail-spot-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--spot); border: 3px solid var(--bg-card); }
.today-rail-bounds { display: flex; justify-content: space-between; margin-top: -52px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); pointer-events: none; }
.today-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--text-muted); margin-top: 28px; }
.today-legend span { display: inline-flex; align-items: center; gap: 6px; }
.today-legend .swatch { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }
.swatch-pos { background: var(--gamma-pos); }
.swatch-neg { background: var(--gamma-neg); }

/* stats */
.today-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.today-stat { border: 1px solid var(--border-color); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.today-stat-label { font-size: 13px; color: var(--text-muted); }
.today-stat-value { font-family: var(--font-mono); font-size: 24px; color: var(--text-primary); overflow-wrap: anywhere; }
.today-stat-value.tone-positive { color: var(--gamma-pos); }
.today-stat-value.tone-negative { color: var(--gamma-neg); }
.today-stat-note { font-size: 12px; color: var(--text-muted); }

/* rows in side cards */
.today-rows { display: flex; flex-direction: column; gap: 10px; }
.today-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.today-row-label { color: var(--text-muted); }
.today-row-value { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); text-align: right; }
.today-row-value.tone-positive { color: var(--accent-green); }
.today-row-value.tone-negative { color: var(--gamma-neg); }
.today-note.tone-warn { color: #F0C57A; }

.today-attention { border: 1px solid #4A3A22; background: #1C1810; border-radius: 16px; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.today-attention[hidden] { display: none; }
.today-attention-body p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; color: #E4D3B5; }
.today-attention-body p.tone-muted { color: var(--text-muted); }

@media (max-width: 1100px) {
    .today-grid { grid-template-columns: minmax(0, 1fr); }
    .today-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    #page-today { padding: 16px 16px 96px; }
    .today-spot { font-size: 38px; }
    .today-read { font-size: 22px; }
    .today-card { padding: 18px 16px; }
    .today-stat-value { font-size: 20px; }
}

.today-lane-counts { display: flex; flex-wrap: wrap; gap: 14px; }
.today-lane-count { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); }
.today-note-lane { display: flex; align-items: center; gap: 8px; }

/* ---- Levels page (page-gex) ---- */
.levels-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 16px; }
.levels-main .gex-strike-profile-section { margin: 0; }
.levels-main .gex-strike-profile-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; }
.levels-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.levels-side .levels-pct { color: var(--text-muted); }
.levels-spot-row .today-row-label, .levels-spot-row .today-row-value { color: var(--spot); }
.today-row-value.tone-gamma-pos { color: var(--gamma-pos); }
.today-row-value.tone-gamma-neg { color: var(--gamma-neg); }
.levels-read { margin: 0; font-family: var(--font-serif); font-size: 21px; line-height: 1.3; color: var(--text-primary); }
.levels-more { margin-top: 28px; border-top: 1px solid var(--border-color); padding-top: 16px; }
.levels-more > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-secondary); padding: 10px 0; list-style: none; }
.levels-more > summary::-webkit-details-marker { display: none; }
.levels-more > summary::before { content: '▸'; display: inline-block; width: 18px; color: var(--text-muted); }
.levels-more[open] > summary::before { content: '▾'; }
.levels-more-hint { font-weight: 400; font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.levels-more[open] > summary { margin-bottom: 16px; }
@media (max-width: 1100px) { .levels-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Books summary (page-positions) ---- */
.books-summary { margin: 8px 0 28px; }
.books-summary-table { width: 100%; }
.books-summary-table td, .books-summary-table th { padding: 12px 14px; text-align: right; }
.books-summary-table td:first-child, .books-summary-table th:first-child,
.books-summary-table td:last-child, .books-summary-table th:last-child { text-align: left; }
.books-summary-table td { font-family: var(--font-mono); font-size: 13px; }
.books-summary-table td:first-child { font-family: var(--font-primary); font-size: 14px; }
.books-name { display: inline-flex; align-items: center; gap: 6px; }
.books-summary-table .tone-positive { color: var(--accent-green); }
.books-summary-table .tone-negative { color: var(--accent-red); }
.books-summary-table .tone-muted { color: var(--text-muted); }
@media (max-width: 768px) {
    /* On a phone the level list reads better than a 20-bar chart: show it first. */
    .levels-side { order: -1; }
    .levels-main .gex-strike-profile-chart { min-height: 0; }
}

/* ---- Patterns (page-screener): patterns only ----
   The GEX tiles, SPY opportunity/charm feeds and P&L cards duplicated Today, Levels,
   Books and the classic desk, and the GEX tiles showed "--" here because this page does
   not load positioning. They are still rendered, just not shown. */
#page-screener .gex-display,
#page-screener #opportunities-section,
#page-screener #charm-signals-section,
#page-screener .stats-grid { display: none !important; }
