:root {
  color-scheme: dark;
  --bg: #080a0d;
  --bg-rail: #0d1117;
  --panel: #11161d;
  --panel-raised: #161c24;
  --panel-soft: #1c232d;
  --text: #f3f5f0;
  --muted: #9da8a1;
  --line: #2b3433;
  --line-strong: #3d4a45;
  --money: #00c07a;
  --money-quiet: rgba(0, 192, 122, 0.14);
  --caution: #d79a2b;
  --loss: #e45f5f;
  --focus: #8aa4ff;
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(0, 192, 122, 0.06), transparent 240px),
    linear-gradient(135deg, #080a0d 0%, #101318 48%, #0b0d10 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(8, 10, 13, 0.94);
  border-bottom: 1px solid rgba(0, 192, 122, 0.18);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(0, 192, 122, 0.42);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(0, 192, 122, 0.28), rgba(138, 164, 255, 0.13));
  color: #dbfff0;
}

.nav-links {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.nav-links a,
button,
.secondary-button {
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #121820;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-links a:hover,
button:hover,
.secondary-button:hover {
  border-color: rgba(0, 192, 122, 0.58);
  background: #17211f;
  color: #eafff5;
}

button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.page-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 34px 18px 58px;
}

.page-heading {
  position: relative;
  margin-bottom: 18px;
  padding: 22px 0 4px;
}

.page-heading::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 72px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--money), var(--focus));
}

.inline-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--money);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 920px;
  margin-bottom: 10px;
  font-size: clamp(2.25rem, 7vw, 4.7rem);
  line-height: 0.96;
}

.section-title {
  margin: 30px 0 12px;
  color: #dce6df;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.market-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 18px;
}

.market-strip div {
  min-height: 86px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(28, 35, 45, 0.96), rgba(17, 22, 29, 0.96));
  box-shadow: 0 18px 34px var(--shadow);
}

.market-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.market-strip strong {
  font-size: 1.7rem;
}

.card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.stack {
  display: grid;
  gap: 14px;
}

.event-card,
.article-card,
.watchlist-panel,
.empty-panel,
.tool-panel,
.settings-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(22, 28, 36, 0.98), rgba(14, 18, 24, 0.98));
  box-shadow: 0 18px 38px var(--shadow);
}

.event-card,
.article-card,
.empty-panel,
.tool-panel {
  padding: 16px;
}

.event-card,
.article-card {
  position: relative;
  overflow: hidden;
}

.event-card::after,
.article-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.event-card h2,
.article-card h3 {
  margin: 13px 0 8px;
  font-size: 1.04rem;
  line-height: 1.25;
}

.event-card p,
.article-card p {
  color: #c5cec8;
  line-height: 1.55;
}

.card-topline,
.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.metric-row {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-row strong {
  color: var(--text);
}

.badge,
.ticker-chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: capitalize;
}

.ticker-chip {
  border: 1px solid rgba(0, 192, 122, 0.38);
  background: var(--money-quiet);
  color: #baf9dc;
}

.impact-high,
.verdict-important,
.quality-high {
  border: 1px solid rgba(0, 192, 122, 0.34);
  background: var(--money-quiet);
  color: #6dffbd;
}

.impact-medium,
.verdict-monitor,
.quality-medium {
  border: 1px solid rgba(215, 154, 43, 0.34);
  background: rgba(215, 154, 43, 0.13);
  color: #ffd18a;
}

.impact-low,
.verdict-ignore,
.quality-low {
  border: 1px solid rgba(157, 168, 161, 0.22);
  background: rgba(157, 168, 161, 0.1);
  color: #cbd6cf;
}

.ticker-form {
  margin: 0;
}

.ticker-form label {
  display: block;
  margin-bottom: 8px;
  color: #ccd6cf;
  font-weight: 900;
}

.form-row {
  display: flex;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1116;
  color: var(--text);
  padding: 11px 12px;
  font-size: 1rem;
  outline: none;
}

input:focus {
  border-color: rgba(0, 192, 122, 0.62);
  box-shadow: 0 0 0 3px rgba(0, 192, 122, 0.12);
}

.watchlist-panel {
  margin-top: 16px;
  padding: 8px 14px;
}

.watchlist-grid {
  display: grid;
  gap: 0;
}

.watchlist-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.watchlist-row:last-child {
  border-bottom: 0;
}

.ticker-pill {
  display: grid;
  gap: 2px;
  min-width: 120px;
}

.ticker-pill strong {
  font-size: 1.08rem;
}

.ticker-pill span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.danger-button {
  color: #ffd3d3;
  border-color: rgba(228, 95, 95, 0.32);
  background: rgba(228, 95, 95, 0.08);
}

.danger-button:hover {
  border-color: rgba(228, 95, 95, 0.62);
  background: rgba(228, 95, 95, 0.15);
}

.source-link {
  display: inline-flex;
  margin-top: 4px;
  color: #9db1ff;
  font-weight: 900;
}

.source-link:hover {
  color: #c8d3ff;
}

.alert {
  margin-bottom: 12px;
  border: 1px solid rgba(138, 164, 255, 0.38);
  border-radius: 8px;
  background: rgba(138, 164, 255, 0.12);
  color: #d6ddff;
  padding: 10px 12px;
  font-weight: 800;
}

.alert.error {
  border-color: rgba(228, 95, 95, 0.52);
  background: rgba(228, 95, 95, 0.12);
  color: #ffd3d3;
}

.empty-panel h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.settings-list {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.settings-list div:last-child {
  border-bottom: 0;
}

.settings-list span {
  color: var(--muted);
}

.settings-list strong {
  color: #f6fff9;
}

.footer {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 760px) {
  .market-strip {
    grid-template-columns: 1fr;
  }

  .inline-heading,
  .form-row,
  .watchlist-row,
  .settings-list div {
    flex-direction: column;
    align-items: stretch;
  }

  .top-nav {
    align-items: stretch;
  }

  .nav-links {
    width: 100%;
  }

  .nav-links a {
    flex: 1 0 auto;
    text-align: center;
  }
}
