:root {
  --bg: #0c0e12;
  --panel: #141820;
  --panel-2: #1a1f2a;
  --border: #2a3140;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --accent: #f97316;
  --accent-dim: rgba(249, 115, 22, 0.15);
  --ok: #34d399;
  --bad: #f87171;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* Match tools site chrome (pill nav + large wordmark) */
.site-header {
  margin: 0 0 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.site-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.site-brand:hover {
  text-decoration: none;
}

.site-brand-logo {
  height: 44px;
  width: auto;
  display: block;
}

.site-product {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 0.75rem;
  line-height: 1.1;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  border-color: var(--accent);
  text-decoration: none;
  background: transparent;
}

.site-nav a.active {
  color: var(--accent);
}

/* Legacy aliases if any old templates remain */
header.site {
  margin: 0 0 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  display: block;
  height: 44px;
  width: auto;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.lede {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 0.98rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Section heads (market snapshot vs personal watchlist) */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin: 0 0 0.35rem;
}

.section-title {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
}

.section-sub {
  margin: 0.15rem 0 0;
  padding: 0;
}

.market-snapshot {
  margin-bottom: 1.5rem;
}

/* Ticker strip — market snapshot only (not the personal watchlist) */
.ticker-strip {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0.75rem 0;
  margin-bottom: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  white-space: nowrap;
}

.ticker-strip .quote {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.ticker-strip a.quote:hover {
  color: inherit;
  text-decoration: none;
}

.ticker-strip a.quote:hover .sym {
  color: var(--accent);
}

.ticker-strip .sym {
  font-weight: 700;
}

.ticker-strip .muted-note {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.4rem 0;
}

.muted-note {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.4rem 0;
}

/* Watchlist (/watchlist) — add-symbol form + table with sparkline trend */
.wl-add-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  max-width: 24rem;
}

.wl-add-form input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
  text-transform: uppercase;
}

.wl-add-form button {
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.wl-add-form button:hover {
  filter: brightness(1.08);
}

.wl-error {
  color: var(--bad);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.wl-table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.wl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.wl-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.wl-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.wl-table th.num,
.wl-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.wl-table a {
  color: var(--text);
  text-decoration: none;
}

.wl-table a:hover strong {
  color: var(--accent);
}

.wl-name {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.wl-spark {
  width: 5.5rem;
  height: 1.6rem;
  display: block;
}

.wl-remove {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  width: 1.6rem;
  height: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.wl-remove:hover {
  color: var(--bad);
  border-color: var(--bad);
}

.wl-count {
  color: var(--muted);
  font-size: 0.85rem;
  margin: -0.5rem 0 0.85rem;
}

.wl-empty {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  margin: 0.75rem 0 1.5rem;
}

.wl-empty-lede {
  margin: 0 0 0.4rem;
  font-weight: 700;
  font-size: 0.98rem;
}

.wl-start-btn {
  display: inline-block;
  margin-top: 0.75rem;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

a.wl-start-btn:hover,
.wl-start-btn:hover {
  filter: brightness(1.08);
  color: #111;
  text-decoration: none;
}

.wl-defaults-hint {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  word-break: break-word;
}

/* Home page personal watchlist panel */
.home-wl {
  margin: 0 0 1.75rem;
  padding: 1rem 0 0.25rem;
}

.home-wl-head {
  margin-bottom: 0.65rem;
}

.home-wl-manage {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.home-wl-manage:hover {
  text-decoration: underline;
}

.home-wl-empty {
  margin-top: 0.35rem;
}

.home-wl-foot {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
}

.home-wl-foot a {
  color: var(--accent);
  font-weight: 700;
}

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.panel .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.panel .row:last-child {
  border-bottom: none;
}

.panel .row .label {
  color: var(--muted);
}

.panel .row .value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.change-up {
  color: var(--ok);
}

.change-down {
  color: var(--bad);
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.card h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.card .source {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Stock detail: related headlines under the price summary */
.stock-news {
  margin-top: 1.75rem;
}

.stock-news h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.stock-news > .muted-note {
  margin: 0 0 0.85rem;
}

.stock-nav {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

footer.site,
.site-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer a {
  color: #71717a;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer-brand {
  margin-left: auto;
  color: #3f3f46;
  font-weight: 600;
  letter-spacing: -0.02em;
}
