
/* ═══════════════════════════════════════════════
 * 智策 NexStrat — Design System v2.0
 *  Inspired by Seeking Alpha / TradingView / 富途牛牛
 * ═══════════════════════════════════════════════ */

:root {
    /* ── Brand ── */
    --accent-purple: #7b3ff2;
    --accent-blue: #4a5bff;
    --accent-cyan: #00f5ff;
    --gradient-brand: linear-gradient(135deg, #7b3ff2 0%, #4a5bff 50%, #00f5ff 100%);
    --brand-glow: rgba(0,245,255,0.06);

    /* ── Surfaces ── */
    --canvas-deep: #0a1628;
    --canvas: #1a2742;
    --canvas-alt: #0f1f3a;
    --surface: #1a2742;
    --surface-alt: #0f1f3a;
    --surface-hover: rgba(255,255,255,0.04);

    /* ── Text ── */
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.72);
    --text-muted: rgba(255,255,255,0.50);
    --text-faint: rgba(255,255,255,0.32);

    /* ── Semantic — 信号系统独立于行情色 ── */
    /* 价格：红涨绿跌 (A股) */
    --price-up: #EF4444;
    --price-down: #22C55E;
    /* 信号：看多绿 看空红 (国际惯例) */
    --signal-bull: #22C55E;
    --signal-bear: #EF4444;
    --signal-hold: #94A3B8;
    /* 维度色板 */
    --dim-hard: #00f5ff;       /* 硬信号 — 青色 */
    --dim-soft: #7b3ff2;       /* 软信号 — 紫色 */
    --dim-gate: #4a5bff;       /* 门控 — 蓝色 */
    --dim-dragon: #a855f7;     /* 龙虎榜 — 紫罗兰 */
    --dim-announce: #f59e0b;   /* 公告 — 琥珀 */
    --dim-risk: #f59e0b;       /* 风险 — 琥珀 */

    /* ── Borders ── */
    --border-hair: rgba(255,255,255,0.08);
    --border-soft: rgba(255,255,255,0.14);
    --border-mid: rgba(255,255,255,0.22);

    /* ── Shadows ── */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.45);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);

    /* ── Radius ── */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-full: 9999px;

    /* ── Typography ── */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-cn: 'PingFang SC', 'Microsoft YaHei', var(--font-sans);
    --font-mono: 'SF Mono', 'Cascadia Code', ui-monospace, monospace;

    /* ── Spacing ── */
    --sp-xs: 4px;
    --sp-sm: 8px;
    --sp-md: 12px;
    --sp-lg: 16px;
    --sp-xl: 24px;
    --sp-2xl: 32px;

    /* ── z-index Stack ── */
    --z-header: 100;
    --z-dropdown: 200;
    --z-bottom-nav: 300;
    --z-modal: 400;
    --z-toast: 500;

    /* ── Touch Targets ── */
    --touch: 44px;

    /* ── Page BG ── */
    --page-bg:
        radial-gradient(ellipse 100% 80% at 0% 0%, rgba(123,63,242,0.12), transparent 50%),
        radial-gradient(ellipse 80% 60% at 100% 100%, rgba(0,245,255,0.06), transparent 45%);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-cn);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    background: var(--canvas-deep);
    background-image: var(--page-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { color: var(--accent-blue); }

/* ═══════════════════════════════════════════════
 * MOBILE FIRST — 基础样式 (<=480px)
 * ═══════════════════════════════════════════════ */

/* ── Shell (mobile) ── */
.shell { max-width: 860px; margin: 0 auto; padding: 72px 10px 96px; }
.shell-wide { max-width: 1100px; margin: 0 auto; padding: 72px 10px 96px; }

/* ── Header (mobile) ── */
.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: 56px; padding: 0 12px;
    background: rgba(10,22,40,0.95);
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--border-hair);
    z-index: var(--z-header);
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-svg { width: 28px; height: 28px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.brand-name { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-tagline { display: none; }

.site-nav { display: none; }
.header-meta { display: none; }

/* ── Bottom Navigation (Mobile Only) ── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(10,22,40,0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-hair);
    z-index: var(--z-bottom-nav);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-inner {
    display: flex; justify-content: space-around;
    max-width: 500px; margin: 0 auto;
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 48px; padding: 4px 8px; gap: 2px;
    color: var(--text-muted); font-size: 9px; font-weight: 500;
    transition: color 0.15s ease;
    flex: 1;
}
.bottom-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.bottom-nav a.active { color: var(--accent-cyan); }
.bottom-nav a:active { transform: scale(0.92); }

/* ── Signal Dashboard (mobile) ── */
.signal-dashboard {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.signal-dashboard-head { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 12px; }
.signal-dashboard-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.signal-dashboard-value { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--text-primary); }
.signal-dashboard-change { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.change-up { color: var(--price-up); }
.change-down { color: var(--price-down); }
.signal-score-bull { color: var(--signal-bull); }
.signal-score-bear { color: var(--signal-bear); }
.signal-score-hold { color: var(--signal-hold); }
.signal-bar-bull { background: var(--signal-bull); }
.signal-bar-bear { background: var(--signal-bear); }
.signal-bar-hold { background: var(--signal-hold); }

/* Signal bar */
.signal-bar { display: flex; gap: 4px; height: 6px; border-radius: var(--r-sm); overflow: hidden; margin-bottom: 6px; }
.signal-bar-seg { height: 100%; transition: width 0.3s ease; border-radius: 2px; }
.signal-bar-seg.bull { background: var(--signal-bull); }
.signal-bar-seg.hold { background: var(--signal-hold); }
.signal-bar-seg.bear { background: var(--signal-bear); }

.signal-legend { display: flex; gap: 10px; font-size: 11px; flex-wrap: wrap; }
.signal-legend-item { display: flex; align-items: center; gap: 4px; color: var(--text-secondary); }
.signal-legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.signal-legend-dot.bull { background: var(--signal-bull); }
.signal-legend-dot.hold { background: var(--signal-hold); }
.signal-legend-dot.bear { background: var(--signal-bear); }

/* ── Section Title (mobile) ── */
.section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.section-title .count { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.kbd-hint { display: none; }

/* ── Filter Bar (mobile) ── */
.filter-bar {
    display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px;
    position: static; background: none; padding: 0; margin-top: 0;
}
.filter-bar input[type="search"],
.filter-bar input[type="text"],
.filter-bar input[type="number"] {
    width: 100%; min-height: var(--touch);
    padding: 0 14px; border-radius: var(--r-full);
    background: var(--canvas-alt); border: 1px solid var(--border-soft);
    color: var(--text-primary); font-size: 14px; font-family: var(--font-cn);
    outline: none; transition: border-color 0.15s ease;
}
.filter-bar input[type="search"]:focus,
.filter-bar input[type="text"]:focus,
.filter-bar input[type="number"]:focus { border-color: var(--accent-cyan); }
.filter-bar button[type="submit"] {
    width: 100%; min-height: var(--touch); padding: 0 20px;
    border-radius: var(--r-full); border: 1px solid rgba(123,63,242,0.45);
    background: rgba(123,63,242,0.22); color: var(--text-primary);
    font-size: 14px; font-weight: 600; font-family: var(--font-cn);
    cursor: pointer; transition: background 0.15s ease;
}
.filter-bar button[type="submit"]:hover { background: rgba(123,63,242,0.35); }
.filter-bar select {
    width: 100%; min-height: var(--touch); padding: 0 12px; border-radius: var(--r-full);
    background: var(--canvas-alt); border: 1px solid var(--border-soft);
    color: var(--text-primary); font-size: 13px; font-family: var(--font-cn);
    outline: none; cursor: pointer;
}
.filter-bar .filter-link {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: var(--touch); padding: 0 16px; border-radius: var(--r-full);
    background: rgba(123,63,242,0.15); border: 1px solid rgba(123,63,242,0.3);
    color: var(--accent-purple); font-size: 13px; font-weight: 600;
}

/* ── View Toggle (hidden on mobile) ── */
.view-toggle { display: none; }

/* ── Stock Grid (mobile — single column) ── */
.stock-grid { display: grid; gap: 10px; margin-bottom: 16px; grid-template-columns: 1fr; }

/* ── Stock Card (mobile) ── */
.stock-card-link { color: inherit; text-decoration: none; display: block; }
.stock-card {
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    background: var(--surface);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; gap: 6px; }
.card-stock-code { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--text-primary); }
.card-stock-name { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.stock-select { display: none; }

/* Signal Badge (mobile — compact) */
.signal-badge {
    display: inline-flex; align-items: center;
    padding: 3px 8px; border-radius: var(--r-full);
    font-size: 10px; font-weight: 700;
    max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex-shrink: 1; min-width: 0;
}
.signal-badge.bullish { background: rgba(34,197,94,0.15); color: var(--signal-bull); border: 1px solid rgba(34,197,94,0.3); }
.signal-badge.bearish { background: rgba(239,68,68,0.15); color: var(--signal-bear); border: 1px solid rgba(239,68,68,0.3); }
.signal-badge.hold { background: rgba(148,163,184,0.12); color: var(--signal-hold); border: 1px solid rgba(148,163,184,0.2); }

/* Decision Card (mobile) */
.decision-card {
    background: var(--canvas-alt);
    border-radius: var(--r-sm);
    padding: 10px;
    margin-bottom: 10px;
}
.decision-score-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.decision-score-label { font-size: 11px; color: var(--text-muted); }
.decision-score-value { font-family: var(--font-mono); font-size: 16px; font-weight: 700; }
.decision-bar-track { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.decision-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.decision-confidence { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-muted); }
.conf-dots { display: flex; gap: 2px; }
.conf-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.1); }
.conf-dot.filled { background: var(--accent-cyan); }
.conf-value { margin-left: auto; font-family: var(--font-mono); color: var(--accent-cyan); font-weight: 600; }

/* Metrics Chips (mobile) */
.metrics-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.metric-chip {
    flex: 1; min-width: 60px; padding: 5px 4px;
    background: var(--canvas-alt); border-radius: var(--r-sm);
    text-align: center; border: 1px solid var(--border-hair);
}
.metric-chip-label { display: block; font-size: 9px; font-weight: 500; color: var(--text-faint); margin-bottom: 1px; }
.metric-chip-val { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 600; }

/* Summary & Key Basis (mobile) */
.card-summary { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin: 6px 0 3px; }
.key-basis-list { list-style: none; padding: 0; margin: 0 0 8px; font-size: 11px; color: var(--text-muted); }
.key-basis-list li { padding: 2px 0 2px 8px; border-left: 2px solid var(--border-soft); margin-bottom: 3px; }

/* Accordion (mobile) */
.card-accordion { margin-top: 6px; font-size: 11px; }
.card-accordion summary { cursor: pointer; color: var(--text-muted); padding: 4px 0; list-style: none; }
.card-accordion summary::-webkit-details-marker { display: none; }
.card-accordion-body { padding: 3px 0 6px; color: var(--text-secondary); line-height: 1.5; }
.card-accordion-body p { margin: 0 0 4px; }
.card-detail-link { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--accent-cyan); text-decoration: none; }
.card-detail-link:hover { text-decoration: underline; }

/* Risk (mobile) */
.risk-block { font-size: 11px; color: var(--dim-risk); background: rgba(245,158,11,0.06); padding: 6px 8px; border-radius: var(--r-sm); border-left: 3px solid var(--dim-risk); line-height: 1.5; }

/* ── Compare Panel (hidden on mobile) ── */
.compare-panel { display: none; }

/* ── Table View (hidden on mobile) ── */
.table-view { display: none; }
.stock-grid.table-hidden { display: none; }

/* ── Detail Page (mobile) ── */
.back-link {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--text-muted); margin-bottom: 12px;
    padding: 4px 10px; border-radius: var(--r-full);
    border: 1px solid var(--border-hair);
}
.page-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.page-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }

.detail-grid { display: grid; gap: 12px; margin-bottom: 16px; grid-template-columns: 1fr; }
.detail-section {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-sm);
}
.detail-section-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }

.big-score { text-align: center; margin: 8px 0; }
.big-score-value { font-family: var(--font-mono); font-size: 32px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.big-score-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.big-score-bar { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.big-score-fill { height: 100%; border-radius: 2px; transition: width 0.3s ease; }

.dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dim-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 8px; border-radius: var(--r-sm);
    background: var(--canvas-alt); border: 1px solid var(--border-hair);
}
.dim-card-label { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.dim-card-value { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.dim-card-dot { width: 5px; height: 5px; border-radius: 50%; margin-right: 4px; display: inline-block; }

.llm-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.llm-table td { padding: 6px 0; border-bottom: 1px solid var(--border-hair); vertical-align: top; }
.llm-table tr:last-child td { border-bottom: none; }
.llm-table .dim-icon { width: 28px; text-align: center; font-size: 12px; }
.llm-table .dim-label { font-weight: 600; color: var(--text-secondary); min-width: 48px; }
.llm-table .dim-text { color: var(--text-secondary); line-height: 1.5; }

.dt-block { margin: 6px 0; padding: 8px 10px; background: var(--canvas-alt); border-radius: var(--r-sm); border-left: 3px solid var(--dim-dragon); }
.dt-title { font-size: 10px; font-weight: 600; color: var(--dim-dragon); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.dt-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; margin-bottom: 2px; }

.ann-block { margin: 6px 0; padding: 8px 10px; background: var(--canvas-alt); border-radius: var(--r-sm); border-left: 3px solid var(--dim-announce); }
.ann-title { font-size: 10px; font-weight: 600; color: var(--dim-announce); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.ann-event { display: flex; gap: 4px; align-items: flex-start; font-size: 11px; margin-bottom: 3px; }
.ann-text { color: var(--text-secondary); line-height: 1.4; flex: 1; }
.ann-conf { font-family: var(--font-mono); font-size: 9px; color: var(--text-faint); white-space: nowrap; }

/* ── Tables (mobile) ── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 12px; }
.data-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.data-table th { padding: 8px 6px; text-align: left; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-soft); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table td { padding: 6px 6px; border-bottom: 1px solid var(--border-hair); }
.data-table .stock-cell { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }

/* ── Stats (mobile) ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 10px 8px; text-align: center; }
.stat-value { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── Archive (mobile) ── */
.archive-section { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px; }
.archive-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.archive-pill { font-size: 11px; padding: 3px 8px; border-radius: var(--r-full); border: 1px solid var(--border-soft); color: var(--text-muted); }

/* ── Disclaimer (mobile) ── */
.disclaimer { font-size: 11px; color: var(--text-faint); line-height: 1.6; padding: 10px 12px; background: var(--canvas-alt); border-radius: var(--r-sm); border: 1px solid var(--border-hair); border-left: 3px solid var(--dim-risk); margin-bottom: 16px; }

/* ── Footer (mobile) ── */
.site-footer { text-align: center; padding: 16px 0; color: var(--text-faint); font-size: 10px; border-top: 1px solid var(--border-hair); }

/* ── Empty State (mobile) ── */
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.empty-state-icon { font-size: 28px; margin-bottom: 8px; }
.empty-state-text { font-size: 13px; margin-bottom: 3px; }
.empty-state-sub { font-size: 11px; color: var(--text-faint); }

/* ═══════════════════════════════════════════════
 * TABLET — >=480px
 * ═══════════════════════════════════════════════ */
@media (min-width: 480px) {
    .shell, .shell-wide { padding: 80px 12px 100px; }
    .site-header { height: 60px; padding: 0 16px; }
    .brand-name { font-size: 15px; }
    .brand-tagline { display: none; }
    .brand-svg { width: 30px; height: 30px; }

    .signal-dashboard { padding: 16px; }
    .signal-dashboard-head { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
    .signal-dashboard-value { font-size: 18px; }
    .signal-dashboard-change { font-size: 13px; }
    .signal-legend { gap: 14px; font-size: 12px; }

    .section-title { font-size: 16px; }
    .filter-bar { gap: 8px; margin-bottom: 18px; }
    .filter-bar input[type="search"],
    .filter-bar input[type="text"],
    .filter-bar input[type="number"] { min-width: 140px; }

    .stock-grid { gap: 12px; margin-bottom: 18px; }
    .stock-card { padding: 14px; }
    .card-header { margin-bottom: 10px; gap: 8px; }
    .card-stock-code { font-size: 15px; }
    .card-stock-name { font-size: 12px; }
    .signal-badge { max-width: 160px; font-size: 11px; padding: 4px 8px; }

    .decision-card { padding: 10px; margin-bottom: 10px; }
    .decision-score-value { font-size: 17px; }
    .metrics-row { gap: 6px; }
    .metric-chip { min-width: 64px; padding: 6px 4px; }
    .metric-chip-label { font-size: 10px; }
    .metric-chip-val { font-size: 12px; }

    .detail-grid { gap: 14px; }
    .detail-section { padding: 16px; }
    .big-score-value { font-size: 36px; }
    .dim-grid { gap: 8px; }

    .stats-grid { gap: 10px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 20px; }

    .bottom-nav a { min-height: 52px; font-size: 10px; }
    .bottom-nav a svg { width: 22px; height: 22px; }
}

/* ═══════════════════════════════════════════════
 * SMALL DESKTOP — >=640px
 * ═══════════════════════════════════════════════ */
@media (min-width: 640px) {
    .shell, .shell-wide { padding: 88px 16px 100px; }
    .site-header { height: 64px; padding: 0 max(16px, 5vw); }
    .brand-name { font-size: 16px; }
    .brand-tagline { display: none; }
    .brand-svg { width: 32px; height: 32px; }

    .signal-dashboard { padding: 18px; border-radius: var(--r-lg); }
    .signal-dashboard-value { font-size: 20px; }
    .signal-dashboard-change { font-size: 14px; }

    .stock-grid { grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
    .stock-card { padding: 16px; border-radius: var(--r-lg); }
    .signal-badge { max-width: 180px; }

    .detail-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

    .filter-bar { flex-direction: row; align-items: center; }
    .filter-bar input[type="search"],
    .filter-bar input[type="text"],
    .filter-bar input[type="number"] { flex: 1; }
    .filter-bar select { width: auto; }
    .filter-bar .filter-link { width: auto; }

    .bottom-nav a { min-height: 56px; font-size: 10px; }
    .bottom-nav a svg { width: 22px; height: 22px; }
}

/* ═══════════════════════════════════════════════
 * DESKTOP — >=900px
 * ═══════════════════════════════════════════════ */
@media (min-width: 900px) {
    .shell, .shell-wide { padding: 88px 20px 100px; }

    /* Show top nav, hide bottom nav */
    .site-nav { display: flex; gap: 2px; background: rgba(255,255,255,0.05); border-radius: var(--r-full); padding: 3px; }
    .site-nav a {
        padding: 6px 14px; border-radius: var(--r-full);
        font-size: 12px; font-weight: 600; color: var(--text-muted);
        transition: all 0.15s ease;
    }
    .site-nav a:hover { color: var(--text-primary); }
    .site-nav a.active { background: rgba(255,255,255,0.10); color: var(--text-primary); }
    .header-meta { display: block; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }
    .bottom-nav { display: none; }

    /* Sticky filter bar */
    .filter-bar { position: sticky; top: 72px; z-index: 50; background: var(--canvas-deep); padding: 12px 0; margin-top: -12px; }

    /* View toggle */
    .view-toggle { display: flex; gap: 4px; margin-left: auto; }
    .view-toggle-btn {
        min-height: 36px; padding: 0 12px; border-radius: var(--r-sm);
        border: 1px solid var(--border-soft); background: var(--canvas-alt);
        color: var(--text-muted); cursor: pointer; font-size: 12px; font-weight: 500;
        transition: all 0.15s ease; display: flex; align-items: center; gap: 6px;
    }
    .view-toggle-btn:hover { border-color: var(--border-mid); color: var(--text-primary); }
    .view-toggle-btn.active { background: rgba(123,63,242,0.15); border-color: var(--accent-purple); color: var(--accent-purple); }
    .view-toggle-btn svg { width: 16px; height: 16px; }

    /* Keyboard hints */
    .kbd-hint {
        display: inline-flex; align-items: center; gap: 4px;
        margin-left: 8px; font-size: 10px; color: var(--text-faint);
    }
    .kbd {
        display: inline-block; padding: 1px 5px; border-radius: 3px;
        background: rgba(255,255,255,0.06); border: 1px solid var(--border-hair);
        font-family: var(--font-mono); font-size: 10px; line-height: 1.4;
    }

    /* Table View */
    .table-view.active { display: block; }
    .stock-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; }
    .stock-table thead th {
        position: sticky; top: 72px; z-index: 10;
        background: var(--surface); padding: 10px 8px; text-align: left;
        font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-soft);
        font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
        cursor: pointer; user-select: none; white-space: nowrap;
        overflow: hidden; text-overflow: ellipsis;
    }
    .stock-table thead th:hover { color: var(--text-primary); }
    .stock-table thead th.sorted { color: var(--accent-cyan); }
    .stock-table thead th .sort-icon { margin-left: 4px; opacity: 0.5; font-size: 10px; }
    .stock-table thead th.sorted .sort-icon { opacity: 1; }
    .stock-table tbody tr { transition: background 0.1s ease; cursor: pointer; }
    .stock-table tbody tr:hover { background: var(--surface-hover); }
    .stock-table tbody td { padding: 8px; border-bottom: 1px solid var(--border-hair); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .stock-table .stock-code { font-family: var(--font-mono); color: var(--accent-cyan); font-weight: 600; }
    .stock-table .stock-name { color: var(--text-secondary); font-size: 12px; }
    .stock-table tbody td a { pointer-events: auto; }
    .stock-table .score-mini { min-width: auto; }
    .stock-table .score-mini-val { font-size: 13px; }
    .stock-table td .signal-badge { max-width: 100%; font-size: 11px; padding: 2px 6px; }
    .stock-table .col-code { width: 72px; }
    .stock-table .col-name { width: 80px; }
    .stock-table .col-signal { width: 140px; }
    .stock-table .col-score { width: 80px; }
    .stock-table .col-momentum { width: 64px; }
    .stock-table .col-ma { width: 48px; }
    .stock-table .col-volume { width: 48px; }
    .stock-table .col-pe { width: 48px; }
    .stock-table .col-confidence { width: 56px; }
    .stock-table .col-dragon { width: 40px; }
    .stock-table .col-announce { width: 40px; }

    /* Compare Panel */
    .compare-panel {
        display: none; position: fixed; right: 24px; bottom: 80px;
        width: 320px; background: var(--surface); border: 1px solid var(--border-soft);
        border-radius: var(--r-lg); box-shadow: var(--shadow-lg); z-index: var(--z-modal);
        padding: 16px; max-height: 60vh; overflow-y: auto;
    }
    .compare-panel.active { display: block; }
    .compare-panel-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
    .compare-panel-close { cursor: pointer; color: var(--text-muted); font-size: 18px; line-height: 1; }
    .compare-panel-close:hover { color: var(--text-primary); }
    .compare-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-hair); }
    .compare-item:last-child { border-bottom: none; }
    .compare-item-code { font-family: var(--font-mono); color: var(--accent-cyan); font-weight: 600; }
    .compare-item-remove { cursor: pointer; color: var(--signal-bear); font-size: 12px; opacity: 0.6; }
    .compare-item-remove:hover { opacity: 1; }
    .compare-bar { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; margin-top: 4px; }
    .compare-bar-fill { height: 100%; border-radius: 2px; }

    /* Selection Checkboxes */
    .stock-select {
        display: inline-flex; align-items: center; justify-content: center;
        width: 18px; height: 18px; border: 1px solid var(--border-soft);
        border-radius: 3px; cursor: pointer; margin-right: 8px; flex-shrink: 0;
        transition: all 0.15s ease; background: transparent;
    }
    .stock-select:hover { border-color: var(--accent-purple); }
    .stock-select.checked { background: var(--accent-purple); border-color: var(--accent-purple); }
    .stock-select.checked::after { content: '✓'; color: white; font-size: 12px; line-height: 1; }

    /* Stock card hover effects */
    .stock-card { position: relative; overflow: hidden; }
    .stock-card::before {
        content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
        background: var(--gradient-brand); opacity: 0; transition: opacity 0.2s ease;
    }
    .stock-card:hover::before { opacity: 1; }
    .stock-card:hover { border-color: var(--border-mid); box-shadow: var(--shadow-md); transform: translateY(-1px); }

    /* Phase F responsive */
    .breadth-thermometer { padding: 20px; }
    .breadth-therm-score { font-size: 32px; }
    .breadth-therm-components { grid-template-columns: repeat(6, 1fr); }
    .postmortem-stats { grid-template-columns: repeat(4, 1fr); }
    .contra-impact-row { flex-direction: row; }
}

/* ═══════════════════════════════════════════════
 * LARGE DESKTOP — >=1200px
 * ═══════════════════════════════════════════════ */
@media (min-width: 1200px) {
    .shell { max-width: 1200px; padding: 88px 24px 100px; }
    .shell-wide { max-width: 1400px; padding: 88px 24px 100px; }
    .stock-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ═══════════════════════════════════════════════
 * XL DESKTOP — >=1600px
 * ═══════════════════════════════════════════════ */
@media (min-width: 1600px) {
    .shell { max-width: 1400px; }
    .shell-wide { max-width: 1600px; }
    .stock-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* ═══════════════════════════════════════════════
 * Utility Classes
 * ═══════════════════════════════════════════════ */
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.min-w-sm { min-width: 60px; }
.min-w-md { min-width: 72px; }
.min-w-lg { min-width: 80px; }
.text-faint { color: var(--text-faint); }
.text-muted { color: var(--text-muted); }
.text-dragon { color: var(--dim-dragon); }
.text-announce { color: var(--dim-announce); }
.text-bull { color: var(--signal-bull); }
.text-bear { color: var(--signal-bear); }
.text-hold { color: var(--signal-hold); }
.stock-code-link { text-decoration: none; color: inherit; }
.table-scroll-main { margin-bottom: 24px; }
.archive-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.stock-name-muted { font-weight: 400; color: var(--text-muted); }
.detail-signal-row { margin-bottom: 20px; }
.signal-badge-lg { font-size: 13px; padding: 6px 14px; }
.dim-grid-detail { margin-top: 16px; }
.empty-hint { color: var(--text-muted); font-size: 12px; text-align: center; padding: 16px; }
.compare-item-name { color: var(--text-muted); font-size: 12px; }

/* Dimension dots */
.dot-hard { background: var(--dim-hard); }
.dot-soft { background: var(--dim-soft); }
.dot-gate { background: var(--dim-gate); }
.dot-dragon { background: var(--dim-dragon); }
.dot-announce { background: var(--dim-announce); }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ═══════════════════════════════════════════════
 * Phase F: New UI Elements
 * ═══════════════════════════════════════════════ */

/* ── Market Breadth Thermometer ── */
.breadth-thermometer {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.breadth-therm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.breadth-therm-label { font-size: 13px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.breadth-therm-score { font-family: var(--font-mono); font-size: 28px; font-weight: 800; line-height: 1; }
.breadth-therm-zone { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-full); }
.breadth-therm-track { height: 10px; background: rgba(255,255,255,0.06); border-radius: var(--r-full); overflow: hidden; margin-bottom: 8px; position: relative; }
.breadth-therm-fill { height: 100%; border-radius: var(--r-full); transition: width 0.5s ease; }
.breadth-therm-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-muted); }
.breadth-therm-exposure { font-weight: 600; }
.breadth-therm-components { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.breadth-comp { text-align: center; padding: 6px 4px; background: var(--canvas-alt); border-radius: var(--r-sm); border: 1px solid var(--border-hair); }
.breadth-comp-label { font-size: 10px; color: var(--text-faint); margin-bottom: 2px; }
.breadth-comp-val { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }

/* Zone colors */
.zone-strong { color: #22C55E; }
.zone-healthy { color: #84CC16; }
.zone-neutral { color: #F59E0B; }
.zone-weakening { color: #F97316; }
.zone-critical { color: #EF4444; }
.zone-badge-strong { background: rgba(34,197,94,0.15); color: #22C55E; border: 1px solid rgba(34,197,94,0.3); }
.zone-badge-healthy { background: rgba(132,204,22,0.15); color: #84CC16; border: 1px solid rgba(132,204,22,0.3); }
.zone-badge-neutral { background: rgba(245,158,11,0.15); color: #F59E0B; border: 1px solid rgba(245,158,11,0.3); }
.zone-badge-weakening { background: rgba(249,115,22,0.15); color: #F97316; border: 1px solid rgba(249,115,22,0.3); }
.zone-badge-critical { background: rgba(239,68,68,0.15); color: #EF4444; border: 1px solid rgba(239,68,68,0.3); }

/* ── Contradiction Flag ── */
.contradiction-flag {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(245,158,11,0.2); border: 1px solid rgba(245,158,11,0.4);
    font-size: 12px; cursor: help; position: relative; flex-shrink: 0;
}
.contradiction-flag:hover .contradiction-tooltip { display: block; }
.contradiction-tooltip {
    display: none; position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%); z-index: var(--z-dropdown);
    background: var(--surface); border: 1px solid var(--border-mid);
    border-radius: var(--r-sm); padding: 8px 10px;
    font-size: 11px; color: var(--text-secondary); white-space: nowrap;
    box-shadow: var(--shadow-md); min-width: 140px; max-width: 260px; white-space: normal;
    line-height: 1.5;
}
.contradiction-tooltip::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 6px solid transparent; border-top-color: var(--border-mid);
}
.contra-tag { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 10px; font-weight: 600; margin: 1px 2px; }
.contra-tag-hard { background: rgba(239,68,68,0.15); color: #EF4444; }
.contra-tag-soft { background: rgba(123,63,242,0.15); color: #7b3ff2; }
.contra-tag-gate { background: rgba(74,91,255,0.15); color: #4a5bff; }
.contra-tag-other { background: rgba(148,163,184,0.15); color: #94A3B8; }

/* ── Postmortem Stats ── */
.postmortem-section {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--r-lg); padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.postmortem-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.postmortem-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.pm-stat { text-align: center; padding: 10px 8px; background: var(--canvas-alt); border-radius: var(--r-md); border: 1px solid var(--border-hair); }
.pm-stat-value { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--text-primary); }
.pm-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.outcome-bars { margin-top: 12px; }
.outcome-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.outcome-bar-label { width: 100px; text-align: right; color: var(--text-secondary); flex-shrink: 0; }
.outcome-bar-track { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.outcome-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.outcome-bar-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); width: 32px; flex-shrink: 0; }
.outcome-tp { background: var(--signal-bull); }
.outcome-fp { background: var(--signal-bear); }
.outcome-missed { background: var(--signal-hold); }
.outcome-regime { background: var(--dim-gate); }

/* Contradiction impact */
.contra-impact-row { display: flex; gap: 12px; margin-top: 12px; }
.contra-impact-card { flex: 1; padding: 10px; background: var(--canvas-alt); border-radius: var(--r-sm); border: 1px solid var(--border-hair); text-align: center; }
.contra-impact-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.contra-impact-val { font-family: var(--font-mono); font-size: 16px; font-weight: 700; }

/* ── Contradiction in Table View ── */
.stock-table .col-contradiction { width: 40px; }
.contra-cell { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; }

/* ── Phase F: Breadth Widget (signal-dashboard) ── */
.breadth-widget {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-soft); border-radius: var(--r-md);
}
.breadth-label { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.breadth-score { font-family: var(--font-mono); font-size: 22px; font-weight: 800; line-height: 1; }
.breadth-zone { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-full); background: rgba(255,255,255,0.08); }
.breadth-exposure { font-size: 11px; color: var(--text-muted); }

/* ── Phase F: Contradiction Badge (stock cards) ── */
.contradiction-badge {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 11px; font-weight: 600; color: #F59E0B;
    padding: 2px 8px; border-radius: var(--r-full);
    background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25);
    cursor: help;
}

/* ── Dashboard: Consensus Heatmap ── */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.heatmap-cell {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 12px 8px; border-radius: var(--r-md); border: 2px solid;
    text-decoration: none; color: var(--text-primary);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 90px;
}
.heatmap-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.heatmap-code { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.heatmap-name { font-size: 11px; color: var(--text-muted); margin-top: 2px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heatmap-value { font-family: var(--font-mono); font-size: 16px; font-weight: 800; margin-top: 6px; line-height: 1; }
.heatmap-bar-track { width: 80%; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.heatmap-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.heatmap-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }

/* ── History: Postmortem Returns ── */
.postmortem-returns {
    display: flex; gap: 12px; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border-soft); flex-wrap: wrap;
}
.return-chip {
    font-size: 12px; padding: 4px 12px; border-radius: var(--r-full);
    background: var(--canvas-alt); border: 1px solid var(--border-hair);
}
.return-chip .change-up { color: #22C55E; font-weight: 600; }
.return-chip .change-down { color: #EF4444; font-weight: 600; }

/* ── Phase G: Session Rail + Live Cockpit ── */
.session-rail {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 8px 16px; margin-top: 64px;
    background: var(--canvas-alt); border-bottom: 1px solid var(--border-hair);
    font-size: 13px; color: var(--text-secondary);
}
.session-rail-phase { font-weight: 600; color: var(--accent-cyan); }
.session-rail-cta {
    margin-left: auto; padding: 6px 14px; border-radius: var(--r-full);
    background: rgba(123,63,242,0.2); color: var(--text-primary);
    border: 1px solid rgba(123,63,242,0.4); font-size: 12px; font-weight: 600;
    transition: background 0.15s ease;
}
.session-rail-cta:hover { background: rgba(123,63,242,0.35); }
.live-banner {
    padding: 10px 16px; background: rgba(245,158,11,0.15);
    border-bottom: 1px solid rgba(245,158,11,0.3); color: #F59E0B;
    font-size: 13px; text-align: center;
}
.alert-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px;
    font-size: 10px; font-weight: 700; border-radius: var(--r-full);
    background: var(--accent-cyan); color: var(--canvas-deep);
}
.alert-feed { display: flex; flex-direction: column; gap: 8px; }
.alert-card {
    padding: 12px 14px; border-radius: var(--r-md);
    background: var(--surface); border: 1px solid var(--border-hair);
    border-left-width: 4px; font-size: 13px;
    transition: border-color 0.15s ease;
}
.alert-card.severity-info { border-left-color: var(--signal-hold); }
.alert-card.severity-watch { border-left-color: var(--dim-announce, #F59E0B); }
.alert-card.severity-action { border-left-color: var(--signal-bull); }
.stale-chip { position: relative; }
.stale-chip::after {
    content: "延迟"; position: absolute; top: 6px; right: 6px;
    font-size: 10px; padding: 2px 6px; border-radius: var(--r-full);
    background: rgba(245,158,11,0.2); color: #F59E0B;
}
.pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pool-sector { margin-bottom: 20px; }
.pool-sector h3 { font-size: 15px; margin-bottom: 10px; color: var(--text-primary); }
.symbol-link { text-decoration: none; color: inherit; cursor: pointer; }
.live-cockpit { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1024px) {
    .live-cockpit { flex-direction: row; }
    .live-cockpit-left { flex: 0 0 40%; }
    .live-cockpit-right { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .session-rail-cta, .alert-card, .heatmap-cell { transition: none; }
}

/* ── Cockpit: Journey Hero + Focus/Peek ── */
.cockpit-shell {
    max-width: 1200px;
    padding-top: 72px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}
.tab-pane--hidden { display: none; }

.journey-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 16px 18px; margin-bottom: 12px;
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.journey-hero::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: var(--gradient-brand); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; opacity: 0.45;
}
.journey-hero__phase { font-size: 16px; font-weight: 700; color: var(--accent-cyan); display: block; }
.journey-hero__hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; max-width: 520px; }
.journey-hero__countdown { font-size: 12px; color: var(--text-secondary); margin-top: 6px; display: block; }
.journey-hero__cta {
    padding: 10px 18px; border-radius: var(--r-full); border: 1px solid rgba(123,63,242,0.45);
    background: rgba(123,63,242,0.22); color: var(--text-primary); font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap; font-family: inherit;
}
.journey-hero__cta:hover { background: rgba(123,63,242,0.35); }

.journey-timeline {
    display: flex; align-items: center; gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding: 8px 0 16px; margin-bottom: 8px; scrollbar-width: none;
}
.journey-timeline::-webkit-scrollbar { display: none; }
.journey-timeline__step {
    flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
    min-width: 52px; min-height: 44px; padding: 4px 8px; border: none; background: none;
    color: var(--text-muted); cursor: pointer; font-family: inherit;
}
.journey-timeline__dot {
    width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-mid);
    background: var(--canvas-alt); transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.journey-timeline__label { font-size: 11px; font-weight: 600; white-space: nowrap; }
.journey-timeline__step--active .journey-timeline__dot {
    border-color: var(--accent-cyan); background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0,245,255,0.45);
}
.journey-timeline__step--active .journey-timeline__label { color: var(--text-primary); }
.journey-timeline__connector {
    flex: 1; min-width: 12px; height: 2px; background: var(--border-hair); margin-bottom: 18px;
    pointer-events: none;
}
.journey-timeline__step { position: relative; z-index: 1; }
.cockpit-panel { scroll-margin-top: 140px; }
@media (min-width: 900px) {
    .journey-timeline { overflow: visible; justify-content: space-between; }
    .journey-timeline__step { flex: 1; }
    .journey-timeline__connector { flex: 1; max-width: none; }
}

.cockpit-panels { display: flex; flex-direction: column; gap: 12px; }
.cockpit-panel {
    border: 1px solid var(--border-hair); border-radius: var(--r-md);
    background: var(--surface); overflow: hidden; transition: box-shadow 0.15s, border-color 0.15s;
}
.cockpit-panel--focus {
    border-color: rgba(123,63,242,0.35); box-shadow: var(--shadow-md);
    border-left: 3px solid transparent;
    border-image: var(--gradient-brand) 1;
}
.cockpit-panel--peek .cockpit-panel__peek { display: inline; color: var(--text-secondary); margin-left: 8px; }
.cockpit-panel--peek:not(.cockpit-panel--active) .cockpit-panel__meta > :first-child { display: none; }
.cockpit-panel--nested { border: none; background: transparent; box-shadow: none; border-left: none; }
.cockpit-panel__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; padding: 14px 16px; background: var(--canvas-alt);
    border: none; color: var(--text-primary); font-size: 14px; font-weight: 600;
    cursor: pointer; text-align: left;
}
.cockpit-panel__head:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: -2px; }
.cockpit-panel__meta { font-size: 12px; font-weight: 500; color: var(--text-muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.cockpit-panel__peek { display: none; font-weight: 500; }
.cockpit-panel__body { padding: 16px; }
.cockpit-panel--active .cockpit-panel__head { border-bottom: 1px solid var(--border-hair); }
.cockpit-panel--collapsed .cockpit-panel__head { border-bottom: none; }

.cockpit-pre-row { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 900px) {
    .cockpit-pre-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}

.event-card-grid { display: grid; gap: 8px; margin-bottom: 12px; }
.event-card {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
    background: var(--canvas-alt); border: 1px solid var(--border-hair); border-radius: var(--r-md);
}
.event-card-rank { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent-purple); flex-shrink: 0; }
.event-card-title { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }

.pool-stock-card--compact { display: block; text-decoration: none; color: inherit; padding: 10px; }
.pool-stock-card--compact .decision-bar-track { height: 3px; margin: 6px 0 4px; }

.review-stat-grid { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.hit-rate-ring {
    width: 88px; height: 88px; border-radius: 50%; display: flex; flex-direction: column;
    align-items: center; justify-content: center; position: relative;
    background: conic-gradient(var(--signal-bull) 0deg var(--hit-deg, 0deg), rgba(255,255,255,0.08) var(--hit-deg, 0deg) 360deg);
}
.hit-rate-ring::before {
    content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface);
}
.hit-rate-value, .hit-rate-label { position: relative; z-index: 1; }
.hit-rate-value { font-family: var(--font-mono); font-size: 18px; font-weight: 800; color: var(--text-primary); }
.hit-rate-label { font-size: 10px; color: var(--text-muted); }
.review-stat-cards { display: flex; gap: 12px; }
.review-stat-card {
    padding: 12px 18px; background: var(--canvas-alt); border-radius: var(--r-md);
    border: 1px solid var(--border-hair); text-align: center;
}
.review-stat-num { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 800; color: var(--text-primary); }
.review-stat-label { font-size: 11px; color: var(--text-muted); }
.review-list li { padding: 6px 0; border-bottom: 1px solid var(--border-hair); font-size: 13px; }
.review-list li:last-child { border-bottom: none; }

.pos-list { display: flex; flex-direction: column; gap: 10px; }
.pos-form-mobile {
    margin-bottom: 16px; padding: 14px;
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
}
.pos-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.pos-card-code { font-family: var(--font-mono); font-size: 15px; color: var(--text-primary); }
.pos-card-name { color: var(--text-muted); font-size: 13px; margin-left: 6px; }
.pos-card-detail { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.pos-close {
    padding: 6px 14px; border-radius: var(--r-full); border: 1px solid rgba(239,68,68,0.35);
    background: rgba(239,68,68,0.12); color: #EF4444; font-size: 12px; cursor: pointer; font-family: inherit;
}

.cockpit-mobile-cards { display: flex; flex-direction: column; gap: 8px; }
.cockpit-mobile-card {
    display: block; padding: 12px 14px; border-radius: var(--r-md);
    background: var(--canvas-alt); border: 1px solid var(--border-hair);
    text-decoration: none; color: var(--text-primary); font-size: 13px;
}
.cockpit-desktop-table { width: 100%; }
@media (max-width: 767px) {
    .cockpit-desktop-table { display: none; }
    .cockpit-mobile-cards { display: flex; }
}
@media (min-width: 768px) {
    .cockpit-mobile-cards { display: none; }
}

.filter-bar--collapsible { flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-toggle-btn {
    padding: 8px 14px; border-radius: var(--r-md);
    background: var(--surface); border: 1px solid var(--border-hair);
    color: var(--text-secondary); font-size: 13px; cursor: pointer;
}
.filter-bar__drawer {
    display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding-top: 8px;
}
@media (min-width: 900px) {
    .filter-toggle-btn { display: none; }
    .filter-bar__drawer { display: flex !important; width: auto; padding-top: 0; flex: 1; }
    .filter-bar__drawer[hidden] { display: flex !important; }
    .filter-bar--collapsible { flex-direction: row; flex-wrap: wrap; }
    .filter-bar--collapsible input[type="search"] { flex: 1; min-width: 160px; width: auto; }
    .filter-bar--collapsible select { width: auto; min-width: 120px; }
}

.cockpit-fab {
    display: none; position: fixed; right: 20px; bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--accent-cyan); color: var(--canvas-deep);
    border: none; font-size: 28px; font-weight: 300; line-height: 1;
    box-shadow: var(--shadow-md); cursor: pointer; z-index: 200;
}
@media (max-width: 899px) {
    .cockpit-fab { display: flex; align-items: center; justify-content: center; }
    .pos-form-desktop { display: none; }
    .journey-hero { position: sticky; top: 56px; z-index: 50; margin-top: -8px; }
}
@media (min-width: 900px) {
    .pos-form-mobile, .cockpit-fab { display: none !important; }
    .pos-form-desktop {
        flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px;
    }
    .pos-form-desktop input[type="text"],
    .pos-form-desktop input[type="number"] {
        flex: 1; min-width: 100px; width: auto;
    }
    .pos-form-desktop input#pos-code { flex: 0 1 100px; max-width: 120px; }
    .pos-form-desktop button[type="submit"] { width: auto; flex: 0 0 auto; }
    .mobile-header-badge { display: none; }
    .cockpit-shell { padding-bottom: 100px; }
    .view-toggle { display: flex; }
}
@media (max-width: 899px) {
    .header-badge { display: none; }
    .site-nav { display: none; }
    .live-banner { z-index: 50; }
    .view-toggle { display: none; }
}

.me-links { display: flex; gap: 16px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border-hair); }
.me-links a { color: var(--accent-cyan); font-size: 14px; text-decoration: none; }

#cockpit-root .header-meta { display: flex; align-items: center; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
#cockpit-root .brand-tagline { display: none; }
@media (min-width: 900px) {
    #cockpit-root .brand-tagline { display: block; font-size: 10px; color: var(--text-muted); }
    #cockpit-root .header-meta { display: block; }
}

@media (prefers-reduced-motion: reduce) {
    .journey-timeline__dot, .cockpit-panel, .cockpit-panel__head { transition: none; }
}

