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

:root {
    --bg: #1a1f2e; --card: #242b3d; --card-elevated: #2e3650;
    --border: #3a4263; --text: #f0f2f7; --text-secondary: #b0bdd0; --text-muted: #7885a0;
    /* Alias used by frontend/telegram.css (shared with StrikeRadar, which
       names this --text-primary). Keeps the rest of this file using --text. */
    --text-primary: var(--text);
    --accent: #5b9cf6; --cyan: #22d3ee; --violet: #a78bfa; --rose: #fb7185; --red: #f87171;
    --low: #22d3ee; --moderate: #a78bfa; --high: #fb7185; --critical: #f87171;
    --chart-line: #22d3ee; --chart-fill: rgba(34, 211, 238, 0.1);
    --chart-grid: rgba(58, 66, 99, 0.5); --chart-tick: #7885a0;
    --tooltip-bg: #242b3d; --tooltip-title: #b0bdd0; --tooltip-body: #f0f2f7;
    --modal-overlay: rgba(10,15,25,0.8);
}

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; color: var(--cyan); }
.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(--cyan); }
.live-dot { width: 6px; height: 6px; background: var(--cyan); 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; transition: background 0.2s; }
.icon-btn:active { background: var(--card-elevated); }
.data-quality-badge { font-size: 10px; padding: 3px 8px; border-radius: 4px; font-weight: 600; text-transform: uppercase; background: rgba(6, 182, 212, 0.15); color: var(--cyan); }
.data-quality-badge.partial { background: rgba(139, 92, 246, 0.15); color: var(--violet); }
.data-quality-badge.degraded { background: rgba(244, 63, 94, 0.15); color: var(--rose); }

/* 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; transition: background 0.3s; }
.timestamp-bar .time { color: var(--text); font-weight: 600; }

/* Main gauge card */
.gauge-card { background: var(--card); border-radius: 20px; padding: 24px 20px; text-align: center; margin-bottom: 16px; transition: background 0.3s; }
.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(6, 182, 212, 0.15); color: var(--cyan); }
.status-label.elevated { background: rgba(139, 92, 246, 0.15); color: var(--violet); }
.status-label.high { background: rgba(244, 63, 94, 0.15); color: var(--rose); }
.status-label.critical { 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.low { color: var(--cyan); } .gauge-value.moderate { color: var(--violet); }
.gauge-value.high { color: var(--rose); } .gauge-value.critical { 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; transition: background 0.2s; }
.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; transition: background 0.3s; }
.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; transition: background 0.3s; }
.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; flex-shrink: 0; }
.signal-icon.financial-icon { background: rgba(139, 92, 246, 0.15); }
.signal-icon.executive-icon { background: rgba(168, 85, 247, 0.15); }
.signal-icon.news-icon { background: rgba(59, 130, 246, 0.15); }
.signal-icon.labor-icon { background: rgba(6, 182, 212, 0.15); }
.signal-info { flex: 1; min-width: 0; }
.signal-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
/* Weight % is shown in the info popup and About modal, not on the main card —
   keeps the signal name short and readable; the weight is methodology, not
   day-to-day glance information. */
.signal-name .signal-weight { display: none; }
.signal-detail { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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; transition: background 0.2s; }
.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(--cyan); 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; }

/* Footer */
.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; transition: all 0.2s; }
.show-more-btn:hover { color: var(--text); border-color: var(--accent); }
.footer-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-bottom: 8px; font-size: 12px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text-secondary); text-decoration: underline; }
.footer-separator { color: var(--border); }
.footer-byline { display: flex; justify-content: center; font-size: 12px; color: var(--text-muted); padding-bottom: 12px; }
.footer-text { color: var(--text-muted); }

/* Info Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: var(--modal-overlay); 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; border: 1px solid var(--border); }
.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; }

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

/* Cookie consent banner (consent.js targets #cookieConsent; we use the
   lr- prefix on inner elements so we don't collide with StrikeRadar's
   styles when both pages are open in adjacent tabs of the same SW cache). */
.lr-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #131420;
    border-top: 1px solid #2a2c3a;
    padding: 16px 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    color: #c4c5d4;
    font-family: 'Inter', sans-serif;
}
.lr-consent-text { text-align: center; font-size: 13px; line-height: 1.5; max-width: 600px; }
.lr-consent-text p { margin: 0 0 4px 0; }
.lr-consent-privacy-link { color: #06b6d4; text-decoration: underline; font-size: 12px; }
.lr-consent-buttons { display: flex; gap: 10px; }
.lr-consent-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #2a2c3a;
    background: transparent;
    color: #c4c5d4;
    transition: background 0.2s;
}
.lr-consent-btn:hover { background: #1d1e2c; }
.lr-consent-accept { background: #06b6d4; color: #06070b; border-color: #06b6d4; }
.lr-consent-accept:hover { background: #0891b2; }

@media (min-width: 600px) {
    .lr-consent-banner { flex-direction: row; justify-content: center; gap: 20px; }
    .lr-consent-text { text-align: left; }
}

/* Donate banner — parity with StrikeRadar. */
.donate-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(245, 200, 66, 0.1);
    border: 1px solid rgba(245, 200, 66, 0.3);
    border-radius: 10px;
    margin-bottom: 16px;
    text-decoration: none;
    color: #f5c842;
    transition: background 0.2s, border-color 0.2s;
}
.donate-banner:hover {
    background: rgba(245, 200, 66, 0.18);
    border-color: rgba(245, 200, 66, 0.5);
}
.donate-banner:visited { color: #f5c842; }
.donate-banner-text { font-size: 13px; font-weight: 600; color: inherit; }
.donate-banner-arrow { font-size: 16px; font-weight: 700; color: inherit; }
@media (max-width: 480px) {
    .donate-banner { display: block; text-align: center; padding: 10px 12px; }
    .donate-banner-text { font-size: 12px; }
    .donate-banner-arrow { display: inline; margin-left: 4px; font-size: 14px; }
}

/* Cross-radar segmented pill — mirror of StrikeRadar's. Explicit
   :link / :visited selectors needed to override mobile Safari's default
   purple-and-underline visited-link styling — see the matching block in
   frontend/styles.css for the rationale. */
.nav-segmented {
    display: flex;
    padding: 4px;
    background: var(--card);
    border-radius: 12px;
    margin-bottom: 16px;
}
.nav-segment,
.nav-segment:link,
.nav-segment:visited {
    flex: 1;
    text-align: center;
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}
.nav-segment:hover,
.nav-segment:focus {
    color: var(--text);
    text-decoration: none;
}
.nav-segment.active,
.nav-segment.active:link,
.nav-segment.active:visited {
    background: var(--card-elevated);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* === LinkedIn contact link + auth UI styles ===
   Mirrored from frontend/styles.css so the LayoffRadar header matches
   StrikeRadar exactly. text-primary doesn't exist in this stylesheet's
   token set, so map it to --text. */
.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; }

.auth-signin-btn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--card); border: none; border-radius: 10px; color: var(--text); cursor: pointer; font-size: 12px; font-weight: 600; transition: background 0.2s; }
.auth-signin-btn:hover { background: var(--card-elevated); }
.auth-avatar-wrap { position: relative; }
.auth-avatar { width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--card); cursor: pointer; padding: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.auth-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.auth-avatar-text { font-size: 13px; font-weight: 600; color: var(--text); }
.auth-dropdown { display: none; position: absolute; top: 38px; right: 0; min-width: 200px; background: var(--card); border: 1px solid var(--card-elevated); border-radius: 10px; padding: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.4); z-index: 100; }
.auth-dropdown.open { display: block; }
.auth-dropdown-email { font-size: 12px; color: var(--text-secondary); padding: 4px 8px 8px; word-break: break-all; border-bottom: 1px solid var(--card-elevated); margin-bottom: 6px; }
.auth-dropdown-btn { width: 100%; padding: 8px; background: transparent; border: none; color: var(--text); cursor: pointer; font-size: 13px; text-align: left; border-radius: 6px; }
.auth-dropdown-btn:hover { background: var(--card-elevated); }
