/* ── Sub-page Styles ─────────────────────────────────────────────────────────── */
.subpage-content {
  max-width: 860px;
  margin: 28px auto;
  padding: 0 var(--sp-18);
}

.subpage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: var(--sp-18);
  box-shadow: var(--shadow);
}

.subpage-card h2 {
  color: var(--teal-bright);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--sp-18);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.subpage-card label {
  display: block;
  margin-bottom: 5px;
  font-size: var(--fs-082);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
}

.subpage-card input,
.subpage-card select {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.subpage-card input:focus,
.subpage-card select:focus {
  outline: none;
  border-color: var(--teal-bright);
  box-shadow: 0 0 0 3px rgba(58,175,186,0.12);
}

.subpage-card select option { background: var(--bg-card); }

.btn-primary {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: var(--sp-10) 24px;
  font-size: var(--fs-090);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover  { background: var(--teal-hover); }
.btn-primary:active { transform: scale(0.97); }

.btn-danger {
  background: #7f1d1d;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: var(--sp-10) 24px;
  font-size: var(--fs-090);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-danger:hover  { background: #991b1b; }
.btn-danger:active { transform: scale(0.97); }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--teal);
  color: #fff;
  padding: 11px 20px;
  border-radius: 7px;
  font-size: var(--fs-088);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Full news list (sub-pages) ──────────────────────────────────────────────── */
.news-full-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-full-list li {
  padding: 13px 0;
  border-bottom: 1px solid rgba(44,62,80,0.5);
}
.news-full-list li:last-child { border-bottom: none; }

.news-full-list a {
  display: block;
  font-size: var(--fs-090);
  font-weight: 600;
  color: #fca5a5;
  line-height: 1.45;
  transition: color 0.15s;
}
.news-full-list.good a { color: #86efac; }
.news-full-list a:hover { color: #fecaca; }
.news-full-list.good a:hover { color: #bbf7d0; }

.news-full-list small {
  display: inline-block;
  margin-top: 5px;
  font-size: var(--fs-072);
  color: var(--text-muted);
  background: var(--tint-teal-10);
  border: 1px solid var(--tint-teal-20);
  border-radius: 3px;
  padding: 1px var(--sp-6);
}

/* ── Stocks table (stocks page) ──────────────────────────────────────────────── */
.stocks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-088);
}

.stocks-table th {
  text-align: left;
  padding: var(--sp-10) var(--sp-14);
  border-bottom: 2px solid var(--teal);
  color: var(--teal-bright);
  text-transform: uppercase;
  font-size: var(--fs-075);
  letter-spacing: 0.07em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.stocks-table th:hover { color: #fff; }
.stocks-table th::after { content: ' ↕'; opacity: 0.4; }

.stocks-table td {
  padding: var(--sp-10) var(--sp-14);
  border-bottom: 1px solid rgba(44,62,80,0.4);
}

.stocks-table tr:hover td { background: var(--tint-teal-06); }
.stocks-table .negative { color: var(--red); font-weight: 700; }
.stocks-table .positive { color: var(--green); font-weight: 700; }

/* ── Scrollbar (WebKit) ──────────────────────────────────────────────────────── */
.scroll-panel::-webkit-scrollbar { width: 5px; }
.scroll-panel::-webkit-scrollbar-track { background: transparent; }
.scroll-panel::-webkit-scrollbar-thumb {
  background: var(--tint-teal-40);
  border-radius: 3px;
}

/* ── News Mode Toggle Switch (Task 3) ────────────────────────────────────────── */
#newsModeToggle { display: flex; align-items: center; }

.nmt-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px var(--sp-10);
  cursor: pointer;
  font-size: var(--fs-078);
  font-weight: 600;
  transition: border-color 0.3s;
  user-select: none;
  color: var(--text-muted);
}
.nmt-switch:hover       { border-color: var(--teal-bright); }
.nmt-switch:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; }

.nmt-track {
  width: 34px;
  height: 18px;
  background: var(--red);
  border-radius: 9px;
  position: relative;
  transition: background 0.3s ease;
  flex-shrink: 0;
}
.nmt-switch.good .nmt-track { background: var(--teal); }

.nmt-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
}
.nmt-switch.good .nmt-knob { transform: translateX(16px); }

.nmt-label-bad  { color: var(--red);   transition: color 0.3s; }
.nmt-label-good { color: var(--green); transition: color 0.3s; }
.nmt-switch.good .nmt-label-bad       { color: var(--text-muted); }
.nmt-switch:not(.good) .nmt-label-good { color: var(--text-muted); }

/* Good-news tint for home page news items */
.news-item.good a       { color: #86efac; }
.news-item.good a:hover { color: #bbf7d0; }

/* Exact-value utilities replacing repeated template inline declarations. */
.u-text-dim    { color: #888 !important; }
.u-text-muted  { color: var(--text-muted) !important; }
.u-text-danger { color: var(--red) !important; }
.u-text-teal   { color: var(--teal) !important; }
.u-fs-072 { font-size: var(--fs-072) !important; }
.u-fs-078 { font-size: var(--fs-078) !important; }
.u-fs-080 { font-size: var(--fs-080) !important; }
.u-fs-082 { font-size: var(--fs-082) !important; }
.u-fs-085 { font-size: var(--fs-085) !important; }
.u-fs-088 { font-size: var(--fs-088) !important; }
.u-fs-090 { font-size: var(--fs-090) !important; }
.u-btn-compact {
  padding: var(--sp-6) var(--sp-18) !important;
  font-size: var(--fs-085) !important;
}
