:root {
  --navy: #020816;
  --navy-deep: #061529;
  --indigo: #081633;
  --glass: rgba(13, 27, 58, 0.7);
  --border: rgba(122, 169, 255, 0.22);
  --white: #f7faff;
  --muted: #b7c4dd;
  --muted-deep: #8293b2;
  --accent: #5ec9ff;
  --green: #70e1ba;
  --danger: #ff8f70;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--white); background: var(--navy); font-family: 'Vazirmatn', Tahoma, sans-serif; text-rendering: optimizeLegibility; }
button, a { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.khabardar-app { min-height: 100vh; overflow: hidden; background: radial-gradient(circle at 78% 3%, rgba(83, 113, 255, 0.2), transparent 24rem), radial-gradient(circle at 10% 15%, rgba(49, 188, 255, 0.12), transparent 22rem), radial-gradient(ellipse at 50% 42%, rgba(105, 76, 255, 0.12), transparent 32rem), linear-gradient(180deg, #070e21 0%, #020715 54%, #061832 100%); }
.khabardar-app::before { position: fixed; inset: 0; z-index: 0; pointer-events: none; content: ''; opacity: .22; background-image: linear-gradient(rgba(155, 193, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(155, 193, 255, .04) 1px, transparent 1px); background-size: 54px 54px; mask-image: linear-gradient(to bottom, black, transparent 75%); }
.topbar, .page-shell, .site-footer { position: relative; z-index: 1; }

.topbar { border-bottom: 1px solid rgba(122, 169, 255, .14); background: rgba(2, 8, 22, .58); backdrop-filter: blur(18px); }
.topbar-inner, .footer-inner { display: flex; align-items: center; width: min(1240px, calc(100% - 40px)); margin: 0 auto; }
.topbar-inner { position: relative; justify-content: center; min-height: 76px; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; filter: drop-shadow(0 8px 18px rgba(84, 133, 255, .2)); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { color: var(--white); font-size: 1.18rem; font-weight: 900; letter-spacing: -.04em; }
.brand-copy small { color: var(--muted-deep); font-size: .68rem; }
.topbar-brand { position: absolute; inset-inline-start: 0; }
.topnav { display: flex; align-items: center; gap: 6px; margin-inline: auto; }
.topnav-link { padding: 9px 14px; border: 1px solid transparent; border-radius: 11px; color: var(--muted); font-size: .86rem; transition: 180ms ease; }
.topnav-link:hover, .topnav-link.active { color: var(--white); border-color: var(--border); background: rgba(255, 255, 255, .05); }
.topbar-actions { position: absolute; inset-inline-end: 0; display: flex; align-items: center; gap: 8px; }
.install-button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 12px; border: 1px solid rgba(94, 201, 255, .26); border-radius: 11px; color: var(--accent); background: rgba(94, 201, 255, .07); font-size: .76rem; transition: 180ms ease; white-space: nowrap; }
.install-button:hover { border-color: rgba(94, 201, 255, .55); background: rgba(94, 201, 255, .14); }
.install-notice { max-width: 280px; color: var(--muted); font-size: .68rem; line-height: 1.6; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(112, 225, 186, .24); border-radius: 999px; color: var(--green); background: rgba(112, 225, 186, .08); font-size: .74rem; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(112, 225, 186, .1), 0 0 16px rgba(112, 225, 186, .8); }

.page-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 72px; }
.hero-panel { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; min-height: 254px; padding: 36px 42px; overflow: hidden; border: 1px solid var(--border); border-radius: 28px; background: linear-gradient(120deg, rgba(16, 39, 82, .92), rgba(8, 19, 44, .66) 65%, rgba(57, 36, 116, .64)); box-shadow: 0 25px 70px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .07); }
.hero-panel::after { position: absolute; width: 360px; height: 360px; top: -200px; right: 20%; border: 1px solid rgba(94, 201, 255, .18); border-radius: 50%; content: ''; box-shadow: 0 0 0 24px rgba(94, 201, 255, .03), 0 0 0 48px rgba(94, 201, 255, .025); }
.hero-copy { position: relative; z-index: 1; align-self: center; }
.eyebrow, .section-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: -.01em; }
.hero-copy h1 { max-width: 100%; margin: 14px 0 10px; color: var(--white); font-size: clamp(2.15rem, 5vw, 4rem); font-weight: 900; letter-spacing: -.065em; line-height: 1.25; white-space: nowrap; }
.hero-copy h1 em { color: var(--accent); font-style: normal; text-shadow: 0 0 30px rgba(94, 201, 255, .32); }
.hero-copy p { max-width: 630px; margin: 0; color: var(--muted); font-size: 1.01rem; line-height: 2; }
.hero-signal { position: relative; display: grid; align-content: center; justify-items: center; min-height: 205px; color: var(--white); }
.hero-signal > span { position: relative; z-index: 3; margin-top: 18px; font-size: .9rem; font-weight: 800; }
.hero-signal > small { position: relative; z-index: 3; margin-top: 2px; color: var(--muted-deep); font-size: .72rem; }
.hero-brand { position: relative; z-index: 3; display: grid; justify-items: center; gap: 8px; }
.hero-brand .brand-mark { width: 86px; height: 86px; }
.hero-brand .brand-copy { justify-items: center; text-align: center; }
.hero-brand .brand-copy strong { font-size: 1.55rem; }
.hero-brand .brand-copy small { margin: 0; color: var(--muted); font-size: .72rem; }
.signal-core { position: relative; z-index: 2; display: grid; width: 76px; height: 76px; place-items: center; border: 1px solid rgba(255, 255, 255, .28); border-radius: 24px; color: var(--navy-deep); background: linear-gradient(135deg, var(--accent), #a4b7ff); box-shadow: 0 12px 40px rgba(94, 201, 255, .28); }
.signal-orbit { position: absolute; top: 28px; width: 150px; height: 150px; border: 1px solid rgba(94, 201, 255, .26); border-radius: 50%; }
.orbit-two { width: 210px; height: 210px; border-color: rgba(142, 88, 255, .22); }

.stats-row { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 14px; margin: 18px 0; }
.stat-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 14px; min-height: 84px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 17px; background: rgba(10, 24, 51, .7); }
.stat-card span { color: var(--muted); font-size: .82rem; }
.stat-card strong { color: var(--white); font-size: 1.65rem; font-weight: 900; letter-spacing: -.05em; }
.stat-card small { grid-column: 1 / -1; color: var(--muted-deep); font-size: .68rem; }
.stat-source strong { color: var(--accent); font-size: 1.2rem; }
.stat-source strong a { color: inherit; }

.market-filter-panel, .news-card, .state-card { border: 1px solid var(--border); background: var(--glass); box-shadow: 0 18px 42px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .035); }
.market-filter-panel { padding: 24px; border-radius: 22px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading.compact { align-items: center; }
.section-heading h2 { margin: 5px 0 0; color: var(--white); font-size: 1.42rem; font-weight: 900; letter-spacing: -.04em; }
.filter-count { padding: 7px 12px; border: 1px solid rgba(94, 201, 255, .23); border-radius: 999px; color: var(--accent); background: rgba(94, 201, 255, .08); font-size: .77rem; }
.market-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.market-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 43px; padding: 8px 14px; border: 1px solid rgba(122, 169, 255, .2); border-radius: 12px; color: var(--muted); background: rgba(255, 255, 255, .035); transition: 180ms ease; }
.market-chip:hover { color: var(--white); border-color: rgba(94, 201, 255, .46); background: rgba(94, 201, 255, .09); transform: translateY(-1px); }
.market-chip.active { color: var(--navy-deep); border-color: transparent; background: linear-gradient(135deg, var(--accent), #a4b7ff); box-shadow: 0 8px 20px rgba(94, 201, 255, .16); }

.news-section { padding-top: 54px; }
.refresh-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid rgba(94, 201, 255, .24); border-radius: 11px; color: var(--accent); background: rgba(94, 201, 255, .07); font-size: .8rem; transition: 180ms ease; }
.refresh-button:hover:not(:disabled) { border-color: rgba(94, 201, 255, .55); background: rgba(94, 201, 255, .14); }
.refresh-button:disabled { cursor: wait; opacity: .6; }
.spin { animation: spin 850ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.source-note { display: flex; align-items: center; gap: 8px; margin: -5px 0 20px; color: var(--muted-deep); font-size: .76rem; }
.source-note svg { flex-shrink: 0; color: var(--green); }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.news-card { position: relative; display: flex; height: 520px; min-height: 520px; flex-direction: column; padding: 22px; overflow: hidden; border-radius: 20px; }
.news-card::before { position: absolute; inset: 0 0 auto; height: 2px; content: ''; background: linear-gradient(90deg, transparent, var(--card-tone), transparent); opacity: .9; }
.news-card-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 17px; }
.market-tag, .date-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .73rem; }
.market-tag { color: var(--card-tone); font-weight: 800; }
.date-tag { color: var(--muted-deep); }
.news-card h3, .news-summary { font-size: 1.04rem; font-weight: 700; line-height: 1.85; }
.news-card h3 { display: -webkit-box; margin: 0 0 12px; overflow: hidden; color: var(--white); letter-spacing: -.025em; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.news-summary { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.full-report { margin-top: 19px; border-top: 1px solid rgba(122, 169, 255, .14); }
.full-report summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 0; color: var(--accent); cursor: pointer; font-size: .78rem; font-weight: 800; list-style: none; }
.full-report summary::-webkit-details-marker { display: none; }
.full-report summary svg { transition: transform 180ms ease; }
.full-report[open] summary svg { transform: rotate(180deg); }
.report-body { padding-bottom: 8px; color: var(--muted); font-size: .82rem; line-height: 2; }
.report-lead, .report-paragraph, .report-note { margin: 0 0 14px; }
.report-lead { color: var(--white); font-weight: 600; }
.short-term-report { padding: 15px; border: 1px solid rgba(122, 169, 255, .14); border-radius: 15px; background: rgba(2, 8, 22, .28); }
.report-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.report-kicker { display: block; margin-bottom: 4px; color: var(--muted-deep); font-size: .67rem; }
.report-heading h3 { margin: 0; font-size: .94rem; line-height: 1.7; }
.report-timeframe { display: block; color: var(--muted-deep); font-size: .69rem; }
.score-badge { display: grid; flex-shrink: 0; min-width: 48px; padding: 6px; border: 1px solid rgba(112, 225, 186, .23); border-radius: 11px; text-align: center; color: var(--green); background: rgba(112, 225, 186, .08); }
.score-badge strong { font-size: 1.05rem; line-height: 1.15; }
.score-badge span { color: var(--muted-deep); font-size: .56rem; }
.factor-list { display: grid; gap: 8px; margin: 14px 0; }
.factor-row { padding: 9px 10px; border: 1px solid rgba(122, 169, 255, .1); border-radius: 10px; background: rgba(255, 255, 255, .025); }
.factor-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--white); font-size: .75rem; }
.factor-title span { color: var(--accent); font-size: .68rem; }
.factor-row p { margin: 5px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.9; }
.balance-grid { display: grid; gap: 9px; }
.balance-box { padding: 11px 12px; border-radius: 11px; }
.balance-box.positive { border: 1px solid rgba(112, 225, 186, .15); background: rgba(112, 225, 186, .05); }
.balance-box.negative { border: 1px solid rgba(255, 143, 112, .16); background: rgba(255, 143, 112, .05); }
.balance-box h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 7px; color: var(--white); font-size: .75rem; }
.balance-box.positive h4 { color: var(--green); }
.balance-box.negative h4 { color: var(--danger); }
.balance-box ul { display: grid; gap: 4px; margin: 0; padding: 0 17px 0 0; color: var(--muted); font-size: .72rem; }
.report-note { margin-top: 13px; padding: 10px 12px; border-right: 2px solid rgba(255, 215, 107, .5); color: var(--muted-deep); font-size: .7rem; line-height: 1.9; }
.news-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 18px; color: var(--muted-deep); font-size: .7rem; }
.source-label, .news-card-footer a { display: inline-flex; align-items: center; gap: 5px; }
.source-label svg { color: var(--green); }
.news-card-footer a { color: var(--accent); }
.news-card-footer a:hover { color: var(--white); }
.general-news-meta, .general-factors { display: flex; flex-wrap: wrap; gap: 7px; }
.general-news-meta { margin: 15px 0 9px; }
.general-news-meta span, .general-factors span { padding: 5px 8px; border: 1px solid rgba(122, 169, 255, .14); border-radius: 999px; color: var(--muted-deep); background: rgba(255, 255, 255, .025); font-size: .66rem; }
.general-news-meta span:first-child { color: var(--accent); border-color: rgba(94, 201, 255, .2); background: rgba(94, 201, 255, .06); }
.general-factors span { color: var(--muted); }

.state-card { display: flex; align-items: center; gap: 14px; min-height: 112px; padding: 22px; border-radius: 18px; }
.state-icon { display: grid; flex-shrink: 0; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(94, 201, 255, .24); border-radius: 13px; color: var(--accent); background: rgba(94, 201, 255, .08); }
.state-card h3 { margin: 0 0 4px; font-size: .96rem; }
.state-card p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.8; }
.error-state .state-icon { color: var(--danger); border-color: rgba(255, 143, 112, .25); background: rgba(255, 143, 112, .08); }
.error-state .refresh-button { margin-inline-start: auto; }
.empty-state { color: var(--muted); }
.loading-card { gap: 14px; }
.skeleton { display: block; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.13), rgba(255,255,255,.06)); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton-short { width: 30%; height: 14px; }
.skeleton-title { width: 95%; height: 22px; margin-top: 8px; }
.skeleton-title.short { width: 70%; margin-top: -5px; }
.skeleton-line { width: 100%; height: 12px; margin-top: 6px; }
.skeleton-line.medium { width: 80%; }
.skeleton-button { width: 38%; height: 26px; margin-top: auto; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.site-footer { border-top: 1px solid rgba(122, 169, 255, .13); background: rgba(2, 8, 22, .45); }
.footer-inner { justify-content: space-between; gap: 18px; min-height: 88px; }
.footer-inner p { margin: 0; color: var(--muted-deep); font-size: .76rem; }
.footer-inner > a { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: .76rem; }

@media (max-width: 900px) {
  .hero-panel { grid-template-columns: minmax(0, 1fr) 180px; padding: 30px; }
  .hero-signal { transform: scale(.86); }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .topbar-inner, .footer-inner, .page-shell { width: min(100% - 28px, 1240px); }
  .topbar-inner { justify-content: space-between; min-height: 68px; gap: 12px; }
  .topnav { display: none; }
  .topbar-brand, .topbar-actions { position: static; }
  .topbar-actions { margin-inline-start: 0; }
  .install-notice { position: absolute; top: 60px; inset-inline: 0; max-width: none; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: rgba(6, 21, 41, .96); text-align: center; }
  .hero-panel { display: block; min-height: unset; padding: 28px 23px 24px; }
  .hero-copy h1 { font-size: clamp(1.25rem, 6.4vw, 2.25rem); letter-spacing: -.085em; }
  .hero-copy p { font-size: .9rem; }
  .hero-signal { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-card.stat-source { grid-column: 1 / -1; }
  .section-heading, .section-heading.compact { align-items: flex-start; flex-direction: column; gap: 12px; }
  .refresh-button { width: 100%; justify-content: center; }
  .filter-count { align-self: flex-start; }
  .news-grid { grid-template-columns: 1fr; }
  .news-card { height: auto; min-height: 0; }
  .source-note { align-items: flex-start; line-height: 1.8; }
  .state-card { align-items: flex-start; flex-wrap: wrap; }
  .error-state .refresh-button { width: 100%; margin-inline-start: 0; }
  .footer-inner { align-items: flex-start; flex-direction: column; padding: 21px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
