/* ═══════════════════════════════════════════════════════════════════════
   SkyCash — Dev Terminal Styles v3.2
   Single-scroll: Status · Positions · Trades · Architecture
   Updated Apr 29 2026 — Conviction-Ranked Single Brackets.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --bg: #080c18;
    --glass: rgba(22,28,52,0.75);
    --glass-border: rgba(255,255,255,0.18);
    --glass-hover: rgba(255,255,255,0.06);
    --text: #e8ecf4;
    --text-2: #8b95b0;
    --text-3: #4f5a74;
    --accent: #6c7cff;
    --accent-dim: rgba(108,124,255,0.14);
    --green: #34d399;
    --green-dim: rgba(52,211,153,0.12);
    --red: #f87171;
    --red-dim: rgba(248,113,113,0.12);
    --amber: #fbbf24;
    --amber-dim: rgba(251,191,36,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --mono: 'JetBrains Mono', monospace;
    --blur: blur(32px);
}

/* Pro-specific styles */
.pro-section { display: grid; gap: 20px; margin-top: 20px; }
.pro-card { padding: 20px; }
.pro-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.pro-table th, .pro-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--glass-border); }
.pro-table th { background: rgba(108,124,255,0.1); font-weight: 600; }
.event-item { padding: 12px; border-left: 3px solid var(--accent); background: rgba(108,124,255,0.05); margin-bottom: 8px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { padding: 32px; max-width: 400px; width: 90%; text-align: center; }
.input-field { width: 100%; padding: 12px; margin: 16px 0; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); background: rgba(255,255,255,0.05); color: var(--text); }
.btn-secondary { background: var(--text-3); color: var(--text); padding: 8px 16px; border: none; border-radius: var(--radius-sm); margin-left: 8px; cursor: pointer; }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Animated gradient mesh background ── */
.bg-mesh { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-mesh::before, .bg-mesh::after {
    content: ''; position: absolute; border-radius: 50%;
    filter: blur(120px); opacity: 0.5;
}
.bg-mesh::before {
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(108,124,255,0.35), transparent 70%);
    top: -200px; left: -150px;
    animation: meshDrift1 20s ease-in-out infinite alternate;
}
.bg-mesh::after {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.3), transparent 70%);
    bottom: -100px; right: -100px;
    animation: meshDrift2 25s ease-in-out infinite alternate;
}
.bg-orb {
    position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.3;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(6,182,212,0.3), transparent 70%);
    top: 40%; left: 50%; transform: translate(-50%,-50%);
    animation: meshDrift3 22s ease-in-out infinite alternate;
}
@keyframes meshDrift1 { 0%{transform:translate(0,0) scale(1);}      100%{transform:translate(80px,60px) scale(1.15);} }
@keyframes meshDrift2 { 0%{transform:translate(0,0) scale(1);}      100%{transform:translate(-60px,-80px) scale(1.2);} }
@keyframes meshDrift3 { 0%{transform:translate(-50%,-50%) scale(1);} 100%{transform:translate(-40%,-40%) scale(1.1);} }

/* ── App shell ── */
.app {
    position: relative; z-index: 1;
    max-width: 720px; margin: 0 auto;
    padding: 20px 24px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: calc(84px + env(safe-area-inset-bottom)); /* room for slim nav */
}
@media (min-width: 880px) {
    .app { max-width: 880px; padding-bottom: 48px; }
}

/* ── Glass cards ── */
.glass {
    background: rgba(22,28,52,0.75);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 6px 30px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
    background-image: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%, rgba(108,124,255,0.04) 100%);
    position: relative; overflow: hidden;
}
.glass:hover { border-color: rgba(255,255,255,0.22); box-shadow: 0 8px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1); }
.glass::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
    opacity: 0; transition: opacity 0.4s ease;
    pointer-events: none; border-radius: inherit;
}
.glass:hover::after { opacity: 1; }

.glass-inner {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    background-image: linear-gradient(160deg, rgba(255,255,255,0.03) 0%, transparent 40%, rgba(108,124,255,0.02) 100%);
    position: relative; overflow: hidden;
}
.glass-inner::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.05) 50%, transparent 60%);
    opacity: 0; transition: opacity 0.35s ease;
    pointer-events: none; border-radius: inherit;
}
.glass-inner:hover::after { opacity: 1; }
.glass-inner:hover { border-color: rgba(255,255,255,0.14); }

/* Kalshi ladder role badge (cooler/middle/warmer from weather.py calculations) */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    margin-right: 6px;
}

/* Temperature type badge (High / Low) */
.type-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
    margin-right: 4px;
}
.type-high {
    background: rgba(248,113,113,0.12);
    color: #f87171;
}
.type-low {
    background: rgba(96,165,250,0.12);
    color: #60a5fa;
}

/* ── Shared animations ── */
@keyframes fadeIn  { from{opacity:0;}                      to{opacity:1;} }
@keyframes slideUp { from{opacity:0;transform:translateY(14px);} to{opacity:1;transform:translateY(0);} }
@keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }
@keyframes pulse {
    0%,100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(52,211,153,0.5); }
    50%     { opacity: 0.6; box-shadow: 0 0 0 6px rgba(52,211,153,0); }
}

/* ══════════════════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════════════════ */
.top-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 12px 16px; margin-bottom: 18px;
    position: sticky; top: 8px; z-index: 50;
    animation: fadeIn 0.5s ease;
}
.bar-left { display: flex; align-items: center; gap: 8px; }
.bar-center { display: flex; align-items: center; gap: 8px; justify-self: center; }
.bar-right { display: flex; align-items: center; justify-self: end; }
.balance-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
}
.balance-pill.bal-stale {
    background: var(--amber-dim);
    color: var(--amber);
}
.balance-pill.bal-off {
    background: var(--red-dim);
    color: var(--red);
}
.bal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s ease-in-out infinite;
}
.bal-off .bal-dot { animation: none; opacity: 0.5; }
.bal-stale .bal-dot { animation: none; }
.brand-logo {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, #6c7cff 0%, #a78bfa 50%, #06b6d4 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; box-shadow: 0 4px 14px rgba(108,124,255,0.3);
}
.brand-name {
    font-size: 1.05rem; font-weight: 800; letter-spacing: -0.3px;
    background: linear-gradient(135deg, #e8ecf4, #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Mode segmented pill */
.mode-seg {
    margin-left: auto;
    display: flex;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    overflow: hidden;
    transition: opacity 0.3s;
}
.mode-seg.cooldown {
    opacity: 0.4;
    pointer-events: none;
}
.seg-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--text-3);
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.seg-btn:first-child { border-radius: 9px 0 0 9px; }
.seg-btn:last-child  { border-radius: 0 9px 9px 0; }
#segScan.active {
    background: rgba(108, 124, 255, 0.2);
    color: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
#segTrade.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--green);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.seg-btn:hover:not(.active) {
    background: rgba(255,255,255,0.05);
    color: var(--text-2);
}

/* Live/stale/offline status pill */
.live-pill {
    display: flex; align-items: center; gap: 6px;
    background: var(--green-dim); color: var(--green);
    padding: 6px 14px; border-radius: 50px;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.5px;
    border: 1px solid rgba(52,211,153,0.15);
    transition: background 0.4s, color 0.4s, border-color 0.4s;
}
.live-pill.stale        { background: var(--amber-dim); color: var(--amber); border-color: rgba(251,191,36,0.2); }
.live-pill.disconnected { background: var(--red-dim);   color: var(--red);   border-color: rgba(248,113,113,0.2); }
.live-dot {
    width: 7px; height: 7px; background: currentColor;
    border-radius: 50%; animation: pulse 2s ease-in-out infinite;
}
.live-pill.disconnected .live-dot { animation: none; opacity: 0.5; }

/* ══════════════════════════════════════════════════════════════════════════
   TAB PANEL SHELL
   ══════════════════════════════════════════════════════════════════════════ */
.tab-panel { animation: fadeSlideIn 0.35s ease both; }
.tab-panel.hidden { display: none; }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════════
   HOME TAB
   ══════════════════════════════════════════════════════════════════════════ */

.hero { 
    padding: 44px 24px 28px; 
    text-align: center; 
    max-width: 640px; 
    margin: 0 auto 32px; 
}
.hero-title {
    font-size: 1.7rem; font-weight: 800; letter-spacing: -0.6px;
    line-height: 1.15; color: var(--text); margin-bottom: 16px;
}
.hero-accent {
    background: linear-gradient(135deg, #a78bfa, #06b6d4);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-ticker {
    font-family: var(--mono); font-size: 0.72rem;
    color: var(--text-3); font-weight: 500; letter-spacing: 0.2px;
    display: inline-block;
}
.hero-ticker span { color: var(--text-2); }
@media (min-width: 640px) {
    .hero { padding: 48px 24px 32px; }
    .hero-title { font-size: 2.55rem; letter-spacing: -1.1px; line-height: 1.1; }
    .hero-ticker { font-size: 0.82rem; }
}

.info-card {
    padding: 24px 20px; margin-bottom: 28px;
    animation: slideUp 0.6s ease both;
}
.info-card:nth-of-type(2) { animation-delay: 0.15s; }
.info-card:nth-of-type(3) { animation-delay: 0.3s; }
.info-card:nth-of-type(4) { animation-delay: 0.45s; }
.info-label {
    font-size: 0.62rem; text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--accent); font-weight: 700; margin-bottom: 12px;
}
.info-body {
    font-size: 0.95rem; line-height: 1.65; color: var(--text-2); margin-bottom: 12px; text-align: center;
}
.info-body:last-of-type { margin-bottom: 0; }
.info-body b { color: var(--text); font-weight: 700; }

/* Bracket-strip diagram */
.bracket-strip {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 4px; margin-top: 16px; margin-bottom: 6px;
}
.bracket {
    padding: 10px 4px; text-align: center;
    font-size: 0.62rem; font-weight: 600; color: var(--text-3);
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    border-radius: 8px; letter-spacing: 0.3px;
}
.bracket.highlighted         { color: var(--text); font-weight: 700; background: rgba(108,124,255,0.08); border-color: rgba(108,124,255,0.3); }
.bracket.highlighted.cooler  { background: rgba(96,165,250,0.1);  border-color: rgba(96,165,250,0.35);  color: #93c5fd; }
.bracket.highlighted.middle  { background: rgba(52,211,153,0.1);  border-color: rgba(52,211,153,0.35);  color: #6ee7b7; }
.bracket.highlighted.warmer  { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.35); color: #fca5a5; }
.bracket-caption {
    font-size: 0.68rem; color: var(--text-3); text-align: center; margin-top: 6px;
}

/* Scanning card */
.scan-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; justify-items: center;
}
.scan-stat { text-align: center; position: relative; padding: 6px 4px; }
.scan-stat:not(:last-child)::after {
    content: ''; position: absolute; right: 0; top: 18%; height: 64%;
    width: 1px; background: var(--glass-border);
}
.scan-big {
    font-family: var(--mono); font-size: 1.5rem; font-weight: 600;
    color: var(--text); line-height: 1;
}
.scan-sub {
    font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-3); font-weight: 600; margin-top: 6px;
}

/* City chips */
.city-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; justify-content: center; }
.city-chip {
    background: rgba(108,124,255,0.08); color: var(--text-2);
    padding: 5px 10px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 600;
    border: 1px solid rgba(108,124,255,0.15);
}

/* CTA button */
.cta-button {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; margin-top: 6px;
    padding: 18px 20px; border-radius: 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff; font-family: 'Inter', sans-serif;
    font-size: 1rem; font-weight: 700; letter-spacing: 0.2px;
    border: none; cursor: pointer; text-decoration: none;
    box-shadow: 0 8px 24px rgba(16,185,129,0.3),
                inset 0 1px 0 rgba(255,255,255,0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta-button:hover  { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(16,185,129,0.4), inset 0 1px 0 rgba(255,255,255,0.2); }
.cta-button:active { transform: translateY(0); }
.cta-arrow { font-size: 1.1rem; transition: transform 0.2s ease; }
.cta-button:hover .cta-arrow { transform: translateX(4px); }

.trust-line {
    text-align: center; font-size: 0.68rem; color: var(--text-3);
    margin-top: 10px; letter-spacing: 0.2px;
}

/* ══════════════════════════════════════════════════════════════════════════
   ACTIVITY TAB
   ══════════════════════════════════════════════════════════════════════════ */

.panel-head { padding: 10px 4px 18px 4px; }
.panel-title {
    font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px;
    color: var(--text); margin-bottom: 4px;
}
.panel-sub { font-size: 0.8rem; color: var(--text-3); font-weight: 500; }

.activity-summary {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
    padding: 16px 0; margin-bottom: 14px;
}
.sum-item { text-align: center; position: relative; }
.sum-item:not(:last-child)::after {
    content: ''; position: absolute; right: 0; top: 18%; height: 64%;
    width: 1px; background: var(--glass-border);
}
.sum-num {
    font-family: var(--mono); font-size: 1.4rem; font-weight: 600;
    color: var(--text); line-height: 1;
}
.sum-item:nth-child(2) .sum-num { color: var(--green); }
.sum-item:nth-child(3) .sum-num { color: var(--red); }
.sum-label {
    font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.9px;
    color: var(--text-3); font-weight: 600; margin-top: 6px;
}

.activity-list { display: grid; gap: 8px; }
.activity-row {
    padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
    transition: transform 0.15s ease, background 0.15s;
}
.activity-row:hover { transform: translateX(2px); }
.act-left { flex: 1; min-width: 0; }
.act-city {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.95rem; font-weight: 700; color: var(--text);
}
.act-emoji { font-size: 1.1rem; }
.act-detail {
    font-size: 0.72rem; color: var(--text-3); font-weight: 500;
    margin-top: 3px; letter-spacing: 0.1px;
}
.act-right { text-align: right; margin-left: 14px; }
.act-pct {
    font-family: var(--mono); font-size: 1.05rem; font-weight: 600; line-height: 1;
}
.act-pct.positive { color: var(--green); }
.act-pct.negative { color: var(--red); }
.act-pct.neutral  { color: var(--amber); }
.act-age {
    font-size: 0.6rem; color: var(--text-3); margin-top: 5px;
    font-weight: 500; letter-spacing: 0.3px;
}

.shimmer-row {
    height: 58px; border-radius: var(--radius-sm); margin-bottom: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite;
}

.empty-activity { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty-activity .empty-ico { font-size: 2rem; opacity: 0.5; margin-bottom: 10px; }
.empty-activity p { font-size: 0.85rem; line-height: 1.6; }
.empty-activity .empty-sub { font-size: 0.72rem; margin-top: 6px; }

.redacted-note {
    margin-top: 18px; padding: 12px 14px;
    background: rgba(108,124,255,0.04); border: 1px solid rgba(108,124,255,0.1);
    border-radius: var(--radius-sm);
    font-size: 0.7rem; color: var(--text-3); text-align: center; line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════════
   ALERTS TAB
   ══════════════════════════════════════════════════════════════════════════ */

.alerts-hero {
    padding: 36px 24px 28px 24px;
    text-align: center;
    animation: slideUp 0.5s ease both;
}
.alerts-icon {
    font-size: 2.4rem; margin-bottom: 14px;
    display: inline-block;
    animation: bellSwing 2.4s ease-in-out infinite;
    transform-origin: 50% 0;
}
@keyframes bellSwing {
    0%,100% { transform: rotate(0deg); }
    10%     { transform: rotate(12deg); }
    20%     { transform: rotate(-10deg); }
    30%     { transform: rotate(8deg); }
    40%     { transform: rotate(-4deg); }
    50%     { transform: rotate(0deg); }
}
.alerts-title {
    font-size: 1.8rem; font-weight: 800; letter-spacing: -0.6px; margin-bottom: 6px;
    background: linear-gradient(135deg, #e8ecf4, #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.alerts-sub {
    font-size: 0.92rem; color: var(--text-2); margin-bottom: 24px; line-height: 1.5;
}
.alerts-list {
    list-style: none; text-align: left; margin: 0 auto 24px auto; padding: 0;
    max-width: 340px;
}
.alerts-list li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 0; font-size: 0.9rem; color: var(--text-2); font-weight: 500;
}
.alerts-list .check {
    color: var(--green); font-weight: 800; font-size: 1rem;
    flex-shrink: 0; line-height: 1.3;
}

.price-block {
    margin: 10px 0 24px 0; padding: 20px; border-radius: 14px;
    background: rgba(108,124,255,0.06); border: 1px solid rgba(108,124,255,0.2);
}
.price-amount {
    font-family: var(--mono); font-size: 2.4rem; font-weight: 700;
    color: var(--text); line-height: 1;
}
.price-period {
    font-size: 0.8rem; color: var(--text-3); margin-top: 4px;
    text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600;
}

/* Architecture Flow Timeline (professional clean steps adapted from DEV_NOTES thorough ASCII) */
.flow-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
}
.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.timeline-step:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(108,124,255,0.15);
}
.step-icon {
    width: 32px; height: 32px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.step-content {
    flex: 1;
    min-width: 0;
}
.step-content strong {
    display: block;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 0.95rem;
    letter-spacing: -0.2px;
}
.step-desc {
    font-size: 0.81rem;
    color: var(--text-3);
    line-height: 1.45;
}

.chart-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 20px;
}
@media (min-width: 768px) {
    .chart-container { grid-template-columns: 1fr 1fr; }
}
.chart-container canvas {
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.2);
    padding: 8px;
}

/* Live Portfolio Card */
.portfolio-card { border: 1px solid rgba(108,124,255,0.15); }
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
}
.port-stat { text-align: center; }
.port-num {
    font-family: var(--mono);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}
.port-num.positive { color: var(--green); }
.port-num.negative { color: var(--red); }
.port-num.live-glow {
    color: var(--accent);
    text-shadow: 0 0 12px rgba(108,124,255,0.4);
}
.port-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-3);
    font-weight: 600;
    margin-top: 2px;
}
.port-caption {
    font-size: 0.72rem;
    color: var(--text-3);
    line-height: 1.5;
    margin: 8px 0 0 0;
    text-align: center;
}

/* Blurred numbers (non-Pro) */
.blurred-num {
    filter: blur(5px);
    user-select: none;
    transition: filter 0.3s ease;
    cursor: pointer;
}
.blurred-num:hover { filter: blur(3px); }

/* Unlock hint */
.unlock-hint {
    font-size: 0.65rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.unlock-hint:hover { opacity: 1; }

/* "Just missed it" banner */
.missed-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid rgba(52,211,153,0.2);
    background: rgba(52,211,153,0.05);
    border-radius: var(--radius-sm);
}
.missed-icon { font-size: 1.1rem; }
.missed-text {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-2);
}
.missed-text b { color: var(--green); }
.missed-link {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

/* Inline CTA card */
.inline-cta {
    padding: 16px;
    margin: 8px 0;
    text-align: center;
    border: 1px dashed rgba(108,124,255,0.2);
    background: rgba(108,124,255,0.03);
    border-radius: var(--radius-sm);
}
.inline-cta-text {
    font-size: 0.82rem;
    color: var(--text-2);
    margin: 0 0 8px 0;
}
.inline-cta-btn {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}

/* Legal disclaimer footer */
.footer-disclaimer {
    font-size: 0.6rem;
    color: var(--text-3);
    line-height: 1.6;
    max-width: 480px;
    margin: 6px auto 0;
    text-align: center;
    opacity: 0.7;
}
.footer-link {
    color: var(--text-3);
    text-decoration: underline;
    text-decoration-style: dotted;
}

/* ═══ Ladder Playing Cards ═══ */
.ladders-section {
    margin-bottom: 16px;
    padding: 16px;
}
.ladders-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 14px 0;
    color: var(--text);
}
#ladderCards, #openPositionsCards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
}

/* Single card — playing-card portrait ratio */
.lc-card {
    display: flex;
    flex-direction: column;
    padding: 14px 10px 10px;
    border-radius: var(--radius);
    aspect-ratio: 9 / 13;
    border-top: 2px solid var(--type-color, rgba(255,255,255,0.1));
    transition: border-color 0.3s, box-shadow 0.3s;
}
.lc-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.lc-done {
    border-top-color: var(--green) !important;
}

/* Card top: centered emoji + city */
.lc-card-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 14px;
    gap: 2px;
}
.lc-card-emoji { font-size: 1.6rem; line-height: 1; }
.lc-card-city {
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.15;
}

/* 3 role columns */
.lc-card-cols {
    display: flex;
    gap: 3px;
    flex: 1;
    overflow: hidden;
}
.lc-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 6px 2px;
    border-radius: 5px;
    gap: 4px;
    min-width: 0;
    transition: all 0.3s ease;
}

/* States: on=filled (BOLD), wait=resting (pulse), pending/off=dim */
.lc-on {
    background: rgba(52,211,153,0.18);
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(52,211,153,0.15);
}
.lc-on .lc-col-icon { font-size: 1.3rem; filter: drop-shadow(0 0 4px rgba(52,211,153,0.4)); }
.lc-col-check {
    font-size: 0.6rem;
    font-weight: 900;
    color: var(--green);
    line-height: 1;
    letter-spacing: -0.02em;
}
.lc-wait {
    opacity: 0.35;
    animation: pulse-resting 2s ease-in-out infinite;
}
.lc-pending {
    opacity: 0.25;
}
.lc-off {
    opacity: 0.12;
}

/* Role icon */
.lc-col-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Temp bracket */
.lc-col-temp {
    font-size: 0.6rem;
    font-family: var(--mono);
    color: var(--text-3);
    font-weight: 600;
    white-space: nowrap;
    min-height: 14px;
}
.lc-on .lc-col-temp { color: var(--green); font-weight: 800; }
.lc-wait .lc-col-temp { color: var(--text-3); }
.lc-off .lc-col-temp { visibility: hidden; }

/* Entry price under bracket */
.lc-col-price {
    font-size: 0.72rem;
    font-family: var(--mono);
    font-weight: 700;
    color: var(--text-2);
    min-height: 14px;
}
.lc-on .lc-col-price { color: var(--text); }
.lc-off .lc-col-price { visibility: hidden; }

/* Footer */
.lc-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.lc-foot-fill {
    font-size: 0.62rem;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text-2);
}
.lc-done .lc-foot-fill { color: var(--green); }
.lc-foot-time {
    font-size: 0.55rem;
    color: var(--text-3);
    font-family: var(--mono);
}

@keyframes pulse-resting {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Empty state for ladder cards */
.empty-state {
    text-align: center;
    color: var(--text-3);
    font-size: 0.78rem;
    font-style: italic;
    padding: 24px 12px;
    opacity: 0.7;
}

/* Trade history collapsible toggle */
.history-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    user-select: none;
}
.history-toggle:hover {
    background: rgba(255,255,255,0.04);
}
.history-toggle-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-2);
}
.history-toggle-count {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-3);
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 10px;
}
.history-toggle-arrow {
    margin-left: auto;
    color: var(--text-3);
    font-size: 0.9rem;
    transition: transform 0.2s;
}

/* Algorithm ASCII decision tree */
.algo-ascii {
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--text-2);
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 12px 0 16px;
    overflow-x: auto;
    white-space: pre;
}

/* Pro enriched trade rows */
.pro-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    flex: 1 1 300px;
    padding: 4px 0;
}
.pro-metric {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 48px;
}
.pm-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-3);
    font-weight: 600;
}
.pm-val {
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}
.pm-val.positive { color: var(--green); }
.pm-val.negative { color: var(--red); }
.pm-val.neutral  { color: var(--amber); }

/* Pro table cell coloring */
.pro-table td.positive { color: var(--green); font-weight: 600; }
.pro-table td.negative { color: var(--red); font-weight: 600; }

/* Search bar */
.search-bar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 12px;
}
.search-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
}
.search-input::placeholder { color: var(--text-3); }
.search-btn {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(108,124,255,0.3);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Pro sub-navigation */
.pro-subnav {
    display: flex;
    gap: 4px;
    padding: 6px;
    margin-bottom: 16px;
}
.subnav-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--text-3);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}
.subnav-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
}
.subnav-btn:hover:not(.active) {
    background: rgba(255,255,255,0.04);
    color: var(--text-2);
}

/* Table controls */
.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.table-controls select {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
}
.table-controls span {
    font-size: 0.75rem;
    color: var(--text-3);
    font-weight: 600;
}
.cta-subscribe { max-width: 340px; margin: 0 auto; }
.alerts-footnote {
    font-size: 0.72rem; color: var(--text-3); line-height: 1.6; margin-top: 18px;
}

/* ── Event feed ─────────────────────────────────────────── */
.events-section { margin-top: 16px; padding: 16px; }
.event-feed { display: flex; flex-direction: column; gap: 6px; }
.event-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: 8px;
    background: rgba(255,255,255,0.03);
    font-size: 0.82rem; color: var(--text-2);
}
.event-icon { font-size: 0.9rem; flex-shrink: 0; }
.event-body { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-age { font-size: 0.72rem; color: var(--text-3); flex-shrink: 0; }

/* TAB NAV — full-width pill (almost page-wide), buttons perfectly centered */
.tab-nav {
    position: fixed;
    bottom: 16px;
    left: 0;
    right: 0;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: var(--glass);
    backdrop-filter: blur(32px);
    border-radius: 9999px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    z-index: 100;
    width: calc(100% - 3rem);
    max-width: 380px;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 6px;
    border: none;
    background: transparent;
    color: var(--text-3);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.nav-icon {
    font-size: 1.25rem;
}

.nav-label {
    font-size: 0.65rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.nav-btn.active {
    background: var(--accent-dim);
    color: var(--accent);
    box-shadow: 0 0 0 1px rgba(108,124,255,0.3);
}

.nav-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav-icon {
    font-size: 1.4rem;
    line-height: 1;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.nav-btn:hover .nav-icon,
.nav-btn.active .nav-icon {
    transform: scale(1.1);
}

.nav-btn.active {
    color: var(--accent);
    background-color: var(--accent-dim);
    box-shadow: 0 1px 3px rgb(108 124 255 / 0.2);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nav-btn,
    .nav-icon {
        transition: none;
    }
}

/* ── Footer ── */
.footer {
    margin: 28px 0 12px 0; text-align: center;
    font-size: 0.68rem; color: var(--text-3);
}
.footer-line { margin: 3px 0; font-family: var(--mono); letter-spacing: 0.2px; }
.footer-line:first-child { color: var(--text-2); }

/* Best-practice scroll shrink (top-bar only) + retained subtle effects */
.top-bar.shrunk {
    transform: scale(0.96);
    padding-block: 0.5rem;
    box-shadow: 0 4px 20px rgb(0 0 0 / 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle live indicators (used by .live-pill and activity rows) */
@keyframes subtleFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
  50% { box-shadow: 0 0 0 12px rgba(52,211,153,0.25); }
}
@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.live-pill { animation: gentlePulse 4s ease-in-out infinite; }
.activity-row.new { animation: subtleFlash 1.6s ease-out forwards; }

.strategy-card {
    padding: 24px 20px;
    margin-bottom: 20px;
    animation: slideUp 0.6s ease both;
}
.strategy-card p {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-2);
    margin-bottom: 12px;
}
.strategy-card p:last-child { margin-bottom: 16px; }
.strategy-card b { color: var(--text); font-weight: 700; }
.strategy-strip {
    margin: 16px 0;
}

/* Hero polish: natural scroll, centered */
.hero {
    min-height: 80vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 6vw, 64px) clamp(16px, 4vw, 32px);
    animation: fadeIn 0.8s ease;
}
@media (min-width: 880px) {
    .hero { padding: 64px 48px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   DESKTOP TOP NAV (sticky, horizontal)
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 880px) {
    .tab-nav {
        position: sticky !important;
        top: 72px; /* below top-bar */
        bottom: auto !important;
        left: 0;
        right: 0;
        margin: 0 auto;
        max-width: 640px;
        padding: 12px 24px !important;
        border-radius: 24px;
        box-shadow: 0 12px 48px rgba(0,0,0,0.4);
        width: calc(100% - 4rem);
        gap: 20px;
        justify-content: space-evenly;
    }
    .tab-nav .nav-btn {
        flex: none !important;
        max-width: none;
        padding: 14px 24px;
        border-radius: 16px;
        gap: 8px;
    }
    .nav-icon { font-size: 1.2rem; margin: 0; }
    .nav-label { font-size: 0.85rem; font-weight: 700; }
    .app {
        padding-top: 160px; /* top-bar + top-nav + margin */
        padding-bottom: 80px;
    }
    .top-bar {
        position: sticky;
        top: 8px;
        z-index: 110;
    }
    .footer { margin-top: 40px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Position Cards (v3.2 single bracket display)
   ══════════════════════════════════════════════════════════════════════════ */
.position-card {
    padding: 16px 18px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--type-color, var(--accent));
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.position-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.pos-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.pos-emoji {
    font-size: 1.4rem;
}
.pos-city {
    flex: 1;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}
.pos-type {
    font-size: 1.1rem;
}
.pos-bracket {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
}
.pos-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 10px;
}
.pos-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pos-metric label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-3);
}
.pos-metric value {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}
.pos-metric value.positive {
    color: var(--green);
}
.pos-footer {
    font-size: 0.7rem;
    color: var(--text-3);
    font-family: var(--mono);
    text-align: right;
}

@media (max-width: 480px) {
    .pos-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}
