* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
    --bg: #0a0a0a; --card: #141414; --card-elevated: #1c1c1c;
    --border: #252525; --text: #ffffff; --text-secondary: #999; --text-muted: #666;
    --accent: #3b82f6; --green: #22c55e; --yellow: #eab308; --orange: #f97316; --red: #ef4444;
}
html, body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}
.app { padding: 16px; padding-bottom: 80px; max-width: 100%; }

/* Header */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.logo { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 10px; }
.live-badge { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--green); }
.live-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.icon-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--card); border: none; border-radius: 10px; color: var(--text-secondary); cursor: pointer; }
.icon-btn:active { background: var(--card-elevated); }
.contact-link { display: flex; align-items: center; gap: 4px; padding: 6px 12px; background: var(--card); border-radius: 10px; color: #0a66c2; text-decoration: none; font-size: 12px; font-weight: 500; transition: background 0.2s, color 0.2s; }
.contact-link:hover { background: var(--card-elevated); color: #0077b5; }
.contact-link svg { fill: currentColor; }
.donate-link { color: #f5c842 !important; }
.donate-link:hover { color: #ffd700 !important; }

/* Timestamp bar */
.timestamp-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--card); border-radius: 10px; margin-bottom: 16px; font-size: 12px; }
.timestamp-bar .time { color: var(--text); font-weight: 600; }
.timestamp-bar .tz { color: var(--text-muted); }

/* Main gauge card */
.gauge-card { background: var(--card); border-radius: 20px; padding: 24px 20px; text-align: center; margin-bottom: 16px; }
.gauge-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.gauge-subtitle { font-size: 11px; color: var(--text-muted); margin-bottom: 16px; }
.status-label { display: inline-block; padding: 6px 14px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; }
.status-label.low { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.status-label.elevated { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.status-label.high { background: rgba(249, 115, 22, 0.15); color: var(--orange); }
.status-label.imminent { background: rgba(239, 68, 68, 0.15); color: var(--red); animation: blink 1.5s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.gauge-container { position: relative; width: 200px; height: 115px; margin: 0 auto 12px; }
.gauge-svg { width: 100%; height: 100%; overflow: visible; }
.gauge-track { fill: none; stroke: var(--card-elevated); stroke-width: 20; stroke-linecap: round; }
.gauge-fill { fill: none; stroke-width: 20; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease, stroke 0.5s ease; }
.gauge-value { font-family: 'Space Grotesk', sans-serif; font-size: 52px; font-weight: 700; line-height: 1; }
.gauge-value.green { color: var(--green); } .gauge-value.yellow { color: var(--yellow); }
.gauge-value.orange { color: var(--orange); } .gauge-value.red { color: var(--red); }
.gauge-window { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.gauge-header { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px; }
.gauge-info-btn { width: 20px; height: 20px; border-radius: 50%; background: var(--border); border: none; color: var(--text-muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.gauge-info-btn:hover { background: var(--text-muted); color: var(--bg); }

/* Trend chart */
.trend-section { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.trend-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.trend-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.chart-wrap { height: 140px; position: relative; }

/* Signals */
.signals-section { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 16px; }
.signal-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.signal-item:last-child { border-bottom: none; padding-bottom: 0; }
.signal-item:first-of-type { padding-top: 0; }
.signal-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-right: 12px; font-size: 16px; }
.signal-icon.news { background: rgba(59, 130, 246, 0.15); }
.signal-icon.trends { background: rgba(168, 85, 247, 0.15); }
.signal-icon.flight { background: rgba(34, 197, 94, 0.15); }
.signal-icon.weather { background: rgba(14, 165, 233, 0.15); }
.signal-info { flex: 1; min-width: 0; }
.signal-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.signal-detail { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signal-status { font-size: 9px; padding: 2px 5px; border-radius: 4px; font-weight: 600; }
.signal-status.live { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.signal-status.weak { background: rgba(234, 179, 8, 0.2); color: var(--yellow); }
.info-btn { width: 18px; height: 18px; border-radius: 50%; background: var(--border); border: none; color: var(--text-muted); font-size: 10px; font-weight: 700; cursor: pointer; margin-left: 4px; }
.info-btn:hover { background: var(--text-muted); color: var(--bg); }
.signal-right { display: flex; align-items: center; gap: 10px; }
.signal-value { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 600; text-align: right; color: var(--green); min-width: 40px; }
.signal-sparkline { width: 70px; height: 28px; }
.signal-sparkline svg { width: 100%; height: 100%; }
.sparkline-line { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sparkline-area { opacity: 0.15; }

/* Feed */
.feed-section { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.feed-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.feed-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.feed-list.expanded { max-height: none; }
.feed-item { padding: 10px 12px; background: var(--card-elevated); border-radius: 10px; }
.feed-item.alert { border-left: 3px solid var(--orange); }
.feed-meta { display: flex; justify-content: space-between; margin-bottom: 3px; }
.feed-source { font-size: 10px; font-weight: 600; color: var(--accent); text-transform: uppercase; }
.feed-item.alert .feed-source { color: var(--orange); }
.feed-badge { font-size: 9px; padding: 2px 6px; border-radius: 4px; background: rgba(239, 68, 68, 0.15); color: var(--red); font-weight: 600; }
.feed-time { font-size: 10px; color: var(--text-muted); }
.feed-text { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.feed-item.alert .feed-text { color: var(--text); }
.show-more-btn { width: 100%; padding: 10px; margin-top: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); font-size: 12px; font-weight: 500; cursor: pointer; }
.show-more-btn:hover { color: var(--text); }

/* Info Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--card); border-radius: 16px; padding: 24px; width: 100%; max-width: 360px; max-height: 80vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-shrink: 0; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { width: 28px; height: 28px; border-radius: 8px; background: var(--bg); border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; }
.modal-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; overflow-y: auto; flex: 1; }
.modal-body strong { color: var(--text); }


/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

@media (min-width: 768px) {
    .app { max-width: 480px; margin: 0 auto; padding: 24px; }
    .gauge-container { width: 240px; height: 135px; }
    .gauge-value { font-size: 60px; }
}
