@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg-deep: #06080f;
  --bg-card: rgba(15, 23, 42, 0.65);
  --border: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(148, 163, 184, 0.25);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --accent-dim: rgba(45, 212, 191, 0.15);
  --positive: #34d399;
  --negative: #f87171;
  --glow: rgba(45, 212, 191, 0.35);
  --radius-lg: 1.25rem;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Syne", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg-deep); }
.font-display { font-family: var(--font-display); }

.app-body { min-height: 100vh; position: relative; overflow-x: hidden; }

.app-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(45, 212, 191, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(56, 189, 248, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 0% 100%, rgba(99, 102, 241, 0.06), transparent),
    var(--bg-deep);
}

.app-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

.app-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float-orb 20s ease-in-out infinite;
}

.app-bg-orb-1 { width: 420px; height: 420px; background: rgba(45, 212, 191, 0.15); top: -120px; right: -80px; }
.app-bg-orb-2 { width: 320px; height: 320px; background: rgba(56, 189, 248, 0.1); bottom: 10%; left: -100px; animation-delay: -8s; }

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, 30px); }
}

.app-shell { position: relative; z-index: 1; }

.app-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 8, 15, 0.75);
  backdrop-filter: blur(16px);
}

.app-nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--glow);
}

.logo-mark svg { width: 1.125rem; height: 1.125rem; color: #06080f; }

.logo-accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }

.nav-link {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.nav-link-active { color: var(--accent) !important; background: var(--accent-dim) !important; }

.nav-logout {
  margin-left: 0.25rem;
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.nav-logout:hover { color: var(--text); }

.app-main { max-width: 72rem; margin: 0 auto; padding: 2rem 1rem 3rem; }

.page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .page-header { flex-direction: row; align-items: center; justify-content: space-between; }
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-subtitle { color: var(--text-muted); font-size: 0.9375rem; margin-top: 0.25rem; }

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.glass-card-padded { padding: 1.5rem; }

.stat-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.5));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.4), transparent);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.375rem;
  letter-spacing: -0.02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  color: #06080f;
  box-shadow: 0 4px 24px rgba(45, 212, 191, 0.25);
}

.btn-primary:hover { box-shadow: 0 6px 32px rgba(45, 212, 191, 0.4); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-hover);
}

.btn-secondary:hover { border-color: var(--accent); background: var(--accent-dim); }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; border-radius: 0.875rem; }

.input-field {
  width: 100%;
  background: rgba(6, 8, 15, 0.8);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.625rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input-field::placeholder {
  color: #64748b;
}

/* Select — единый стиль с input (убираем нативный вид) */
select.input-field {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 2.75rem;
  background-color: rgba(6, 8, 15, 0.8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 1.125rem;
}

select.input-field:hover {
  border-color: var(--border-hover);
}

select.input-field:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232dd4bf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

select.input-field option {
  background: #0f172a;
  color: var(--text);
  padding: 0.5rem;
}

.select-wrap {
  position: relative;
  width: 100%;
}

.select-wrap select.input-field {
  width: 100%;
}

/* Custom select (замена native dropdown) */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  cursor: pointer;
}

.custom-select-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
  transition: transform 0.2s, color 0.2s;
}

.custom-select.open .custom-select-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.custom-select-menu {
  display: none;
  position: absolute;
  z-index: 100;
  top: calc(100% + 0.375rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.375rem;
  list-style: none;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-hover);
  border-radius: 0.75rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(16px);
  max-height: 14rem;
  overflow-y: auto;
}

.custom-select.open .custom-select-menu {
  display: block;
  animation: select-menu-in 0.15s ease;
}

@keyframes select-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.custom-select-option:hover {
  background: rgba(45, 212, 191, 0.1);
  color: var(--accent);
}

.custom-select-option.is-selected {
  background: var(--accent-dim);
  color: var(--accent);
}

.custom-select-check {
  width: 1rem;
  font-size: 0.75rem;
  opacity: 0;
  color: var(--accent);
}

.custom-select-option.is-selected .custom-select-check {
  opacity: 1;
}

.form-label { display: block; font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.375rem; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; position: relative; }
.auth-card { width: 100%; max-width: 26rem; position: relative; z-index: 1; }

.text-positive { color: var(--positive) !important; }
.text-negative { color: var(--negative) !important; }
.link-accent { color: var(--accent); text-decoration: none; }
.link-accent:hover { text-decoration: underline; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-live { background: rgba(52, 211, 153, 0.15); color: var(--positive); border: 1px solid rgba(52, 211, 153, 0.3); }
.badge-ai { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(45, 212, 191, 0.3); }
.section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem 0.375rem 0.5rem;
  border-radius: 9999px;
  background: var(--accent-dim);
  border: 1px solid rgba(45, 212, 191, 0.25);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-badge-dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--positive);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 1024px) {
  .landing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
}

.mock-dashboard {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(6, 8, 15, 0.9));
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 1.25rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(45, 212, 191, 0.08);
}

.mock-chart-line {
  stroke: url(#chartGradient);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: draw-line 2.5s ease forwards 0.5s;
}

@keyframes draw-line { to { stroke-dashoffset: 0; } }

.mock-chart-area { fill: url(#areaGradient); opacity: 0; animation: fade-in 1s ease forwards 1.5s; }
@keyframes fade-in { to { opacity: 1; } }

.ticker-strip { overflow: hidden; mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent); margin: 2rem 0; }
.ticker-strip-inner { display: flex; gap: 0.75rem; animation: marquee 30s linear infinite; width: max-content; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.ticker-pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 600;
}

.ticker-up { color: var(--positive); }
.ticker-down { color: var(--negative); }

.feature-grid { display: grid; gap: 1.25rem; margin-top: 4rem; }
@media (min-width: 768px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.feature-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 212, 191, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 3rem; height: 3rem;
  border-radius: 0.875rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-icon-teal { background: linear-gradient(135deg, rgba(45, 212, 191, 0.2), rgba(45, 212, 191, 0.05)); color: var(--accent); }
.feature-icon-blue { background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.05)); color: var(--accent-2); }
.feature-icon-violet { background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(167, 139, 250, 0.05)); color: #a78bfa; }

.landing-cta {
  margin-top: 5rem;
  padding: 3rem 2rem;
  border-radius: 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(56, 189, 248, 0.08)), var(--bg-card);
  border: 1px solid rgba(45, 212, 191, 0.2);
  position: relative;
}

.landing-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.floating-chip {
  position: absolute;
  padding: 0.5rem 0.875rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: float-chip 6s ease-in-out infinite;
}

.floating-chip-1 { top: 8%; right: 0; }
.floating-chip-2 { bottom: 15%; left: 0; animation-delay: -2s; }

@keyframes float-chip {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 1023px) { .floating-chip { display: none; } }

/* Charts */
.chart-section { margin-bottom: 1.5rem; }

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chart-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}

.chart-range-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 0.625rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
}

.chart-range-tab {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.chart-range-tab:hover { color: var(--text); }

.chart-range-tab.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.chart-change {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.chart-change.positive { color: var(--positive); }
.chart-change.negative { color: var(--negative); }

.chart-wrap {
  position: relative;
  height: 280px;
}

.chart-wrap-sm { height: 200px; }

.chart-wrap canvas,
.chart-wrap-sm canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-gauge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chart-gauge-wrap {
  position: relative;
  width: 100%;
  max-width: 180px;
  height: 120px;
  margin: 0 auto;
}

.chart-gauge-label {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.chart-grid-2 {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .chart-grid-2 { grid-template-columns: 1fr 1fr; }
}

.daily-summary-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .daily-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.daily-tile {
  min-width: 0;
  padding: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.34);
}

.daily-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.daily-value {
  margin-top: 0.35rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
}

.daily-sub {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.daily-insights {
  display: grid;
  gap: 0.6rem;
}

.daily-insight {
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.05);
}

.daily-insight.warning {
  border-color: rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.06);
}

.daily-insight.ok {
  border-color: rgba(52, 211, 153, 0.24);
  background: rgba(52, 211, 153, 0.06);
}

.daily-insight-title {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.daily-insight-msg {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.chart-grid-analysis {
  display: grid;
  gap: 1.5rem;
}

.analysis-meta-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .analysis-meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.quality-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.quality-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.quality-pill-ok {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.08);
  color: var(--positive);
}

.quality-pill-missing {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.07);
  color: #fbbf24;
}

.news-grid {
  display: grid;
  gap: 0.85rem;
}

.news-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0.7rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.42)),
    rgba(15, 23, 42, 0.52);
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}

.news-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.75;
}

.news-card:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 212, 191, 0.28);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(8, 13, 26, 0.58)),
    rgba(15, 23, 42, 0.62);
}

.news-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.news-source {
  min-width: 0;
  max-width: 68%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.1);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.news-date {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.news-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.28;
}

.news-summary {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.news-summary-muted {
  color: rgba(148, 163, 184, 0.7);
}

.news-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition: color 0.15s, gap 0.15s;
}

.news-link:hover {
  gap: 0.55rem;
  color: var(--accent-2);
}

.earnings-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .earnings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.earnings-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(2, 6, 23, 0.42)),
    rgba(15, 23, 42, 0.52);
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}

.earnings-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #38bdf8, #a78bfa);
  opacity: 0.75;
}

.earnings-card:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.28);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(8, 13, 26, 0.58)),
    rgba(15, 23, 42, 0.62);
}

.earnings-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.earnings-period {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.earnings-date {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.earnings-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.earnings-metric {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(6, 8, 15, 0.35);
}

.earnings-metric-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.earnings-metric-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.earnings-metric-muted {
  color: rgba(148, 163, 184, 0.85);
}

.earnings-surprise {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.earnings-surprise-positive {
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.1);
  color: var(--positive);
}

.earnings-surprise-negative {
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.1);
  color: var(--negative);
}

.earnings-surprise-neutral {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted);
}

.investment-conclusion {
  display: grid;
  gap: 1rem;
}

.conclusion-verdict {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.14), rgba(56, 189, 248, 0.06)),
    rgba(15, 23, 42, 0.55);
}

.conclusion-label,
.conclusion-point-label {
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.conclusion-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text-main);
}

.conclusion-confidence {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 700;
}

.conclusion-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.conclusion-point {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.34);
}

.conclusion-point p {
  color: var(--text-main);
  font-size: 0.93rem;
  line-height: 1.55;
}

.conclusion-muted {
  color: var(--text-muted);
}

@media (min-width: 1024px) {
  .chart-grid-analysis { grid-template-columns: 1fr 200px; }
}

@media (max-width: 760px) {
  .news-card {
    padding: 0.9rem;
  }

  .news-card-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .news-source {
    max-width: 100%;
  }

  .conclusion-verdict {
    display: grid;
  }

  .conclusion-confidence {
    width: fit-content;
  }

  .conclusion-points {
    grid-template-columns: 1fr;
  }
}

/* Sparklines in cards */
.card-with-sparkline {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-with-sparkline .card-body {
  flex: 1;
  min-width: 0;
}

.card-with-sparkline .card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}

.sparkline-wrap {
  width: 112px;
  height: 44px;
  flex-shrink: 0;
  position: relative;
}

.sparkline-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.sparkline-wrap.sparkline-empty::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: var(--border);
}

@media (max-width: 480px) {
  .card-with-sparkline {
    flex-wrap: wrap;
  }
  .sparkline-wrap {
    width: 100%;
    height: 40px;
    order: 3;
  }
  .card-with-sparkline .card-actions {
    margin-left: auto;
  }
}

/* Risk alerts */
.risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.risk-ok { background: rgba(52, 211, 153, 0.15); color: var(--positive); border: 1px solid rgba(52, 211, 153, 0.3); }
.risk-low { background: rgba(56, 189, 248, 0.12); color: var(--accent-2); border: 1px solid rgba(56, 189, 248, 0.25); }
.risk-medium { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.risk-high { background: rgba(248, 113, 113, 0.12); color: var(--negative); border: 1px solid rgba(248, 113, 113, 0.3); }

.risk-alerts { max-height: 280px; overflow-y: auto; }

.risk-alert {
  padding: 0.75rem 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
}

.risk-alert-danger { border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.06); }
.risk-alert-warning { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.06); }
.risk-alert-info { border-color: rgba(56, 189, 248, 0.25); background: rgba(56, 189, 248, 0.05); }

.risk-alert-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.risk-alert-danger .risk-alert-title { color: var(--negative); }
.risk-alert-warning .risk-alert-title { color: #fbbf24; }
.risk-alert-info .risk-alert-title { color: var(--accent-2); }

.risk-alert-msg {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.sector-bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.5rem;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.75rem;
}

.sector-bar-track {
  height: 6px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.sector-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
