/* Finradar Web (/app): a trading terminal in TradingView's dark palette.
   Standalone: the marketing stylesheet isn't loaded on this page. */

:root {
  --bg: #0f1218;
  --chart: #131722;
  --panel: #161a25;
  --panel-2: #1e222d;
  --hover: #2a2e39;
  --border: #2a2e39;
  --text: #d1d4dc;
  --strong: #f0f3fa;
  --muted: #787b86;
  --accent: #ffd700;
  --accent-hover: #ffe24d;
  --accent-ink: #131722;
  --accent-soft: rgba(255, 215, 0, 0.13);
  --accent-line: rgba(255, 215, 0, 0.45);
  --accent-text: #ffd700;
  --link: #ffd54a;
  --flame: #ffab40;
  --line-soft: rgba(42, 46, 57, 0.6);
  --line-strong: #363a45;
  --line-hover: #4a4f5c;
  --logo-dark: #2a2e39;
  --backdrop: rgba(5, 7, 10, 0.72);
  --fs: 1;
  --up: #089981;
  --up-soft: rgba(8, 153, 129, 0.14);
  --down: #f23645;
  --down-soft: rgba(242, 54, 69, 0.14);
  --gold: #f5c518;
  --radius: 6px;
  --top: 48px;
  --side: 340px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Light theme, from the Display menu (data-theme on <html>). */
:root[data-theme='light'] {
  --bg: #eef1f6;
  --chart: #ffffff;
  --panel: #ffffff;
  --panel-2: #f3f5f9;
  --hover: #e8ecf3;
  --border: #e0e3eb;
  --text: #2a2e39;
  --strong: #131722;
  --muted: #6a6d78;
  --accent: #f0b400;
  --accent-hover: #ffc61a;
  --accent-soft: rgba(240, 180, 0, 0.16);
  --accent-line: rgba(200, 140, 0, 0.5);
  --accent-text: #9a6700;
  --link: #9a6700;
  --flame: #f57c00;
  --gold: #c99200;
  --up-soft: rgba(8, 153, 129, 0.1);
  --down-soft: rgba(242, 54, 69, 0.1);
  --line-soft: #edf0f5;
  --line-strong: #d1d4dc;
  --line-hover: #b2b5be;
  --backdrop: rgba(19, 23, 34, 0.4);
  color-scheme: light;
}


*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: calc(13px * var(--fs));
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

input {
  font: inherit;
  color: var(--strong);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.num {
  font-variant-numeric: tabular-nums;
}

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

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

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

/* ---------- shell ---------- */

.tv {
  display: grid;
  grid-template-rows: var(--top) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.tv-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.tv-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--strong);
  font-weight: 700;
  font-size: calc(15px * var(--fs));
  letter-spacing: -0.01em;
  flex: none;
}

.tv-brand img {
  border-radius: 6px;
}

.tv-nav {
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tv-nav::-webkit-scrollbar {
  display: none;
}

.tv-nav button {
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.tv-nav button:hover {
  color: var(--text);
  background: var(--hover);
}

.tv-nav button.is-on {
  color: var(--strong);
  background: var(--panel-2);
}

.tv-spacer {
  flex: 1;
}

.tv-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  min-height: 0;
}

.tv-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(220px, 34%);
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--border);
}

.tv-main.is-page {
  grid-template-rows: minmax(0, 1fr);
  overflow-y: auto;
}

.tv-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
}

/* ---------- search ---------- */

.tv-search {
  position: relative;
  width: 220px;
  flex: none;
}

.tv-search input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
}

.tv-search input::placeholder {
  color: var(--muted);
}

.tv-search svg {
  position: absolute;
  left: 9px;
  top: 9px;
  color: var(--muted);
}

.tv-search-results {
  position: absolute;
  top: 36px;
  left: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 50;
  overflow: hidden;
}

.tv-search-results button {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  align-items: center;
}

.tv-search-results button:hover,
.tv-search-results button.is-active {
  background: var(--hover);
}

.tv-search-results b {
  color: var(--strong);
}

.tv-search-results span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-pro {
  background: var(--gold);
  color: #131722;
}

.btn-pro:hover {
  background: #ffd43b;
}

.btn-secondary {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--strong);
}

.btn-secondary:hover {
  background: var(--hover);
}

.btn-block {
  width: 100%;
  height: 40px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  border-radius: var(--radius);
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  font-size: calc(14px * var(--fs));
}

.btn-google:hover {
  background: #f1f3f4;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  color: var(--muted);
}

.icon-btn:hover {
  color: var(--strong);
  background: var(--hover);
}

.icon-btn.is-on {
  color: var(--gold);
}

/* ---------- account ---------- */

.acct {
  position: relative;
  flex: none;
}

.acct-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px 3px 3px;
  border-radius: 999px;
}

.acct-btn:hover {
  background: var(--hover);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--strong);
  overflow: hidden;
  flex: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pro-tag {
  font-size: calc(10px * var(--fs));
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #131722;
  background: var(--gold);
  border-radius: 4px;
  padding: 1px 5px;
}

.acct-menu {
  position: absolute;
  right: 0;
  top: 40px;
  width: 260px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 60;
  padding: 6px;
}

.acct-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.acct-menu-head b {
  display: block;
  color: var(--strong);
  overflow: hidden;
  text-overflow: ellipsis;
}

.acct-menu a,
.acct-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  text-decoration: none;
}

.acct-menu a:hover,
.acct-menu button:hover {
  background: var(--hover);
}

/* ---------- symbol bar + chart ---------- */

.symbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 8px 12px;
  background: var(--chart);
  border-bottom: 1px solid var(--border);
}

.symbar-id {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.symbar-id h1 {
  font-size: calc(17px * var(--fs));
  color: var(--strong);
  font-weight: 700;
}

.symbar-id span {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.symbar-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.symbar-price b {
  font-size: calc(17px * var(--fs));
  color: var(--strong);
}

.symbar-stats {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: calc(12px * var(--fs));
}

.symbar-stats b {
  color: var(--text);
  font-weight: 500;
}

.tfs {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.tfs button {
  min-width: 34px;
  height: 26px;
  padding: 0 6px;
  border-radius: 4px;
  color: var(--muted);
  font-weight: 600;
  font-size: calc(12px * var(--fs));
}

.tfs button:hover {
  color: var(--text);
  background: var(--hover);
}

.tfs button.is-on {
  color: var(--accent-text);
  background: var(--accent-soft);
  color: var(--link);
}

.chart-wrap {
  position: relative;
  min-height: 0;
  background: var(--chart);
}

.tv-chart {
  position: absolute;
  inset: 0;
}

.chart-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  z-index: 2;
  pointer-events: none;
  text-align: center;
  padding: 16px;
}

.chart-legend {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: calc(12px * var(--fs));
  color: var(--muted);
  pointer-events: none;
}

.chart-legend b {
  font-weight: 500;
}

/* ---------- bottom panel ---------- */

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  flex: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs button {
  position: relative;
  padding: 10px 10px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.tabs button:hover {
  color: var(--text);
}

.tabs button.is-on {
  color: var(--strong);
}

.tabs button.is-on::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.tabs .count {
  margin-left: 6px;
  font-size: calc(11px * var(--fs));
  color: var(--muted);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 0 6px;
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
}

.panel-empty {
  color: var(--muted);
  padding: 18px 4px;
}

/* trade plan */

.plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.plan-head h2 {
  font-size: calc(15px * var(--fs));
  color: var(--strong);
}

.levels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.level {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.level span {
  display: block;
  font-size: calc(11px * var(--fs));
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.level b {
  display: block;
  font-size: calc(15px * var(--fs));
  color: var(--strong);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.level small {
  color: var(--muted);
  font-size: calc(11px * var(--fs));
}

.level.is-stop b {
  color: var(--down);
}

.level.is-tp b {
  color: var(--up);
}

.prose {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prose h3 {
  font-size: calc(11px * var(--fs));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 4px;
}

.prose p {
  color: var(--text);
}

.prose a {
  color: var(--link);
}

/* badges */

.side-badge {
  display: inline-block;
  font-size: calc(10px * var(--fs));
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 4px;
  padding: 2px 6px;
}

.side-badge.buy {
  color: var(--up);
  background: var(--up-soft);
}

.side-badge.sell {
  color: var(--down);
  background: var(--down-soft);
}

.side-badge.live {
  color: var(--gold);
  background: rgba(245, 197, 24, 0.12);
}

.chip {
  display: inline-block;
  font-size: calc(11px * var(--fs));
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.chip.is-active {
  color: var(--link);
  border-color: var(--accent-line);
}

/* ---------- side list (watchlist style) ---------- */

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px;
}

.side-head h2 {
  font-size: calc(12px * var(--fs));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.list-cols,
.row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 8px;
  align-items: center;
  padding: 0 12px;
}

.list-cols {
  height: 28px;
  font-size: calc(11px * var(--fs));
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}

.list-cols span:not(:first-child),
.row > span:not(:first-child) {
  text-align: right;
}

.row {
  width: 100%;
  min-height: 46px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

.row:hover {
  background: var(--panel-2);
}

.row.is-on {
  background: var(--accent-soft);
}

.row-sym {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.row-sym b {
  color: var(--strong);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.row-sym small {
  color: var(--muted);
  font-size: calc(11px * var(--fs));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row small.num {
  display: block;
  color: var(--muted);
  font-size: calc(11px * var(--fs));
}

.row.is-locked {
  cursor: pointer;
}

.blur {
  filter: blur(5px);
  user-select: none;
}

.lock-note {
  margin: 12px;
  padding: 12px;
  border: 1px solid rgba(245, 197, 24, 0.3);
  background: rgba(245, 197, 24, 0.06);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lock-note p {
  color: var(--text);
}

.side-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: calc(11px * var(--fs));
}

/* ---------- full-page views (scanner, movers, news, record) ---------- */

.page {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.page > * {
  flex-shrink: 0; /* boxes keep their height; the page scrolls instead */
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.page-head h1 {
  font-size: calc(18px * var(--fs));
  color: var(--strong);
}

.page-head p {
  color: var(--muted);
}

.seg {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}

.seg button {
  padding: 5px 12px;
  border-radius: 4px;
  color: var(--muted);
  font-weight: 600;
}

.seg button.is-on {
  background: var(--hover);
  color: var(--strong);
}

.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.tbl {
  width: 100%;
  border-collapse: collapse;
}

.tbl th,
.tbl td {
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-soft);
}

.tbl th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  color: var(--muted);
  font-size: calc(11px * var(--fs));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tbl td.r,
.tbl th.r {
  text-align: right;
}

.tbl tbody tr {
  cursor: pointer;
}

.tbl tbody tr:hover {
  background: var(--panel-2);
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl .sym {
  color: var(--strong);
  font-weight: 600;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 10px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat span {
  display: block;
  font-size: calc(11px * var(--fs));
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat b {
  display: block;
  font-size: calc(20px * var(--fs));
  color: var(--strong);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.news-item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.news-item:last-child {
  border-bottom: 0;
}

.news-item h3 {
  font-size: calc(14px * var(--fs));
  color: var(--strong);
  font-weight: 600;
  margin: 3px 0 4px;
}

a.news-item:hover h3 {
  color: var(--link);
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: calc(11px * var(--fs));
  color: var(--muted);
}

.news-item p {
  color: var(--text);
  font-size: calc(13px * var(--fs));
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 197, 24, 0.3);
  background: rgba(245, 197, 24, 0.06);
}

.banner p {
  color: var(--text);
}

.notice {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.skeleton {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--panel-2) 0%, var(--hover) 50%, var(--panel-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- dialogs ---------- */

.dlg-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 16px;
}

.dlg {
  width: 100%;
  max-width: 400px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.dlg-wide {
  max-width: 480px;
}

.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 0 20px;
}

.dlg-head h2 {
  font-size: calc(17px * var(--fs));
  color: var(--strong);
}

.dlg-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dlg-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: calc(12px * var(--fs));
}

.dlg-or::before,
.dlg-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.dlg-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dlg-form label {
  font-weight: 600;
  color: var(--strong);
  font-size: calc(12px * var(--fs));
}

.dlg-form input {
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: calc(12px * var(--fs));
  width: 100%;
}

.dlg-hint,
.dlg-legal {
  color: var(--muted);
  font-size: calc(12px * var(--fs));
}

.dlg-legal a {
  color: var(--text);
}

.dlg-error {
  color: #ff8a93;
  background: var(--down-soft);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.up-benefits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.up-benefits li {
  position: relative;
  padding-left: 22px;
}

.up-benefits li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 4px;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--up);
  border-bottom: 2px solid var(--up);
  transform: rotate(-45deg);
}

.up-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.up-plan {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.up-plan.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.up-plan-label {
  color: var(--muted);
  font-weight: 600;
  font-size: calc(12px * var(--fs));
}

.up-plan-price {
  font-size: calc(20px * var(--fs));
  font-weight: 700;
  color: var(--strong);
}

.up-plan-price small {
  font-size: calc(12px * var(--fs));
  color: var(--muted);
  font-weight: 500;
}

.up-plan-note {
  font-size: calc(11px * var(--fs));
  color: var(--up);
}

.up-link {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.up-link-row {
  display: flex;
  gap: 8px;
}

.up-link-row .btn {
  height: 38px;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  :root {
    --side: 300px;
  }
  .tv-search {
    width: 170px;
  }
}

@media (max-width: 900px) {
  .tv {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto auto;
  }
  .tv-top {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 12px;
    row-gap: 8px;
  }
  .tv-search {
    order: 4;
    flex: none;
    width: 100%;
  }
  .tv-nav {
    order: 5;
    width: 100%;
  }
  .tv-body {
    grid-template-columns: 1fr;
  }
  .tv-main {
    grid-template-rows: auto 56vh auto;
    border-right: 0;
  }
  .tv-main.is-page {
    grid-template-rows: auto;
  }
  .panel-body {
    max-height: none;
  }
  .tv-side {
    border-top: 1px solid var(--border);
  }
  .list {
    max-height: 70vh;
  }
  .tfs {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
  }
  .symbar-stats {
    display: none;
  }
}

/* ---------- track record calendar ---------- */

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-dow {
  font-size: calc(11px * var(--fs));
  color: var(--muted);
  text-align: center;
  padding-bottom: 2px;
}

.cal-day {
  min-height: 52px;
  border-radius: 4px;
  background: var(--panel-2);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cal-day small {
  color: var(--muted);
  font-size: calc(11px * var(--fs));
}

.cal-day b {
  font-size: calc(12px * var(--fs));
  font-weight: 600;
  text-align: right;
}

.cal-day.is-up {
  background: var(--up-soft);
}

.cal-day.is-up b {
  color: var(--up);
}

.cal-day.is-down {
  background: var(--down-soft);
}

.cal-day.is-down b {
  color: var(--down);
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 90;
  cursor: pointer;
}

.link-btn {
  color: var(--link);
  text-decoration: underline;
  font-size: inherit;
}

.row > span {
  white-space: nowrap;
}

.level b {
  white-space: nowrap;
}

@media (max-width: 520px) {
  .level b {
    white-space: normal;
  }
}

/* ---------- desk (dockable windows, screens wider than 900px) ---------- */

.desk {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.desk-loading {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.desk .dockview-theme-finradar {
  --dv-group-view-background-color: var(--panel);
  --dv-tabs-and-actions-container-background-color: var(--bg);
  --dv-tabs-and-actions-container-height: calc(32px * var(--fs));
  --dv-tabs-and-actions-container-font-size: calc(12px * var(--fs));
  --dv-activegroup-visiblepanel-tab-background-color: var(--panel);
  --dv-activegroup-visiblepanel-tab-color: var(--strong);
  --dv-activegroup-hiddenpanel-tab-background-color: var(--bg);
  --dv-activegroup-hiddenpanel-tab-color: var(--muted);
  --dv-inactivegroup-visiblepanel-tab-background-color: var(--panel);
  --dv-inactivegroup-visiblepanel-tab-color: var(--text);
  --dv-inactivegroup-hiddenpanel-tab-background-color: var(--bg);
  --dv-inactivegroup-hiddenpanel-tab-color: var(--muted);
  --dv-tab-divider-color: var(--border);
  --dv-separator-border: var(--border);
  --dv-paneview-header-border-color: var(--border);
  --dv-drag-over-background-color: var(--accent-soft);
  --dv-drag-over-border-color: var(--accent);
  --dv-edge-dock-indicator-color: var(--accent);
  --dv-active-sash-color: var(--accent);
  --dv-icon-hover-background-color: var(--hover);
  --dv-floating-border: 1px solid var(--line-strong);
  --dv-floating-box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
  --dv-tabs-container-scrollbar-color: var(--line-strong);
  font-family: var(--font);
}

.desk .dv-tab {
  font-weight: 600;
  padding: 0 10px;
}

.desk .dv-tab.dv-active-tab {
  box-shadow: inset 0 2px 0 var(--accent);
}

.desk .dv-groupview:not(.dv-active-group) .dv-tab.dv-active-tab {
  box-shadow: inset 0 2px 0 var(--line-hover);
}

.dock-actions {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 4px;
  gap: 2px;
}

.dock-actions button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: var(--muted);
}

.dock-actions button:hover {
  color: var(--strong);
  background: var(--hover);
}

.dock-empty {
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 4px;
  color: var(--text);
}

/* Panel bodies fill their window and scroll inside it. */
.dock-page {
  height: 100%;
  overflow: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dock-page > * {
  flex-shrink: 0;
}

.dock-page .tbl-wrap {
  border-radius: 4px;
}

.dock-page .tbl th,
.dock-page .tbl td {
  padding: 6px 10px;
}

.dock-list {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
}

.dock-chart {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--chart);
}

.dock-detail {
  height: 100%;
  display: flex;
  min-height: 0;
}

.dock-detail .panel {
  flex: 1;
  border-top: 0;
}

.page-head.is-docked {
  justify-content: flex-start;
}

.page-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.page-head.is-docked .page-tools {
  width: 100%;
}

.page-head.is-docked .page-tools .bell {
  margin-left: auto;
}

.tiny {
  font-size: calc(11px * var(--fs));
}

.select {
  height: 28px;
  padding: 0 26px 0 9px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%23787b86' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 9px center;
  color: var(--strong);
  font: inherit;
  font-size: calc(12px * var(--fs));
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}

.select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: calc(12px * var(--fs));
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  accent-color: var(--accent);
}

.icon-btn.bell.is-on {
  color: var(--gold);
}

/* ---------- ticker logos ---------- */

.tlogo {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: #f0f3fa;
  vertical-align: middle;
}

.tlogo img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.tlogo.is-letter {
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

.sym-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  min-width: 0;
}

.sym-cell .sym {
  color: var(--strong);
  font-weight: 600;
}

.sym-co {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.symbar-id {
  align-items: center;
}

.tv-search-results button .tlogo {
  margin-right: 2px;
}

.tick-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px 0 3px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--strong);
  font-size: calc(11px * var(--fs));
  font-weight: 600;
}

.tick-chip:hover {
  border-color: var(--line-hover);
}

/* ---------- tables: sorting and new rows ---------- */

.tbl th.sortable {
  cursor: pointer;
  user-select: none;
}

.tbl th.sortable:hover,
.tbl th.is-sorted {
  color: var(--strong);
}

.sort-arrow {
  font-size: calc(8px * var(--fs));
  margin-left: 4px;
  vertical-align: 1px;
}

.cell-clip {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-clip a {
  text-decoration: none;
}

.cell-clip a:hover {
  color: var(--link);
}

@keyframes fr-flash {
  0% {
    background: rgba(245, 197, 24, 0.28);
  }
  100% {
    background: rgba(245, 197, 24, 0.06);
  }
}

.tbl tbody tr.is-new,
.row.is-new,
.news-item.is-new {
  animation: fr-flash 2.4s ease-out;
  background: rgba(245, 197, 24, 0.06);
}

.tbl-compact td {
  padding: 5px 8px;
}

.tbl-compact tbody tr {
  cursor: default;
}

.tbl tbody tr.is-next {
  background: var(--accent-soft);
}

.list-cols-end {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.list-cols-end .icon-btn {
  width: 22px;
  height: 22px;
}

/* ---------- key stats ---------- */

.quote-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quote-head h2 {
  font-size: calc(17px * var(--fs));
  color: var(--strong);
}

.quote-price {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
}

.quote-price b {
  font-size: calc(17px * var(--fs));
  color: var(--strong);
}

.qgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 6px;
}

.qstat {
  background: var(--panel-2);
  border-radius: 4px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qstat span {
  font-size: calc(11px * var(--fs));
  color: var(--muted);
}

.qstat b {
  font-size: calc(13px * var(--fs));
  color: var(--strong);
  font-weight: 600;
}

.qstat small {
  color: var(--muted);
  font-weight: 500;
}

.qrange {
  display: grid;
  grid-template-columns: 64px auto minmax(60px, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: calc(12px * var(--fs));
}

.range-bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--down), var(--line-hover) 50%, var(--up));
  opacity: 0.85;
}

.range-bar i {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--strong);
  border: 2px solid var(--panel);
  transform: translate(-50%, -50%);
}

.qsub {
  font-size: calc(11px * var(--fs));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 4px;
}

.qcat a {
  color: var(--strong);
  text-decoration: none;
  font-weight: 600;
}

.qcat a:hover {
  color: var(--link);
}

.qlive {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--strong);
  text-align: left;
}

/* ---------- analyst actions and calendar ---------- */

.chip.action-up {
  color: var(--up);
  background: var(--up-soft);
  border-color: transparent;
}

.chip.action-down {
  color: var(--down);
  background: var(--down-soft);
  border-color: transparent;
}

.impact {
  display: inline-flex;
  gap: 2px;
}

.impact i {
  width: 6px;
  height: 10px;
  border-radius: 1px;
  background: var(--line-strong);
}

.impact-1 i.on {
  background: #787b86;
}

.impact-2 i.on {
  background: #f7a600;
}

.impact-3 i.on {
  background: var(--down);
}

.cal-group h3 {
  font-size: calc(12px * var(--fs));
  color: var(--strong);
  margin: 4px 0 6px;
}

/* ---------- desk menus ---------- */

.desk-nav {
  overflow: visible;
}

.desk-menu {
  position: relative;
}

.desk-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
}

.desk-menu-btn:hover,
.desk-menu-btn.is-on {
  background: var(--panel-2);
  color: var(--strong);
}

.desk-menu-list {
  left: 0;
  right: auto;
  min-width: 220px;
}

.desk-menu-group + .desk-menu-group {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 4px;
}

.desk-menu-head {
  display: block;
  padding: 6px 12px 2px;
  font-size: calc(10px * var(--fs));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.desk-menu-sep {
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.desk-menu-hint {
  display: block;
  padding: 6px 12px 8px;
  font-size: calc(11px * var(--fs));
  color: var(--muted);
  max-width: 240px;
}

/* The top bar's dropdowns open over floating windows. */
.tv.is-desk .tv-top {
  position: relative;
  z-index: 1200;
}

.tv-search-results button {
  grid-template-columns: 18px 64px minmax(0, 1fr) auto;
}

.tv-search-results .tlogo {
  overflow: hidden;
}

.news-item h3 a {
  text-decoration: none;
}

.news-item h3 a:hover {
  color: var(--link);
}

/* Tighter tabs so three fit in a 340px column beside the window buttons. */
.desk .dv-tab {
  padding: 0 8px;
}

.desk .dv-default-tab {
  gap: 4px;
}

.dock-actions button {
  width: 22px;
}

/* Narrow windows drop company names first. */
.dock-page {
  container-type: inline-size;
}

@container (max-width: 620px) {
  .sym-co {
    display: none;
  }
  .page-tools .tiny {
    display: none;
  }
}

.tlogo.is-light {
  background: var(--logo-dark);
}

.page {
  container-type: inline-size;
}

/* Docked, the trade plan's boxes size to their numbers (entry zones are long). */
.dock-detail .levels {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.dock-detail .level b {
  font-size: calc(14px * var(--fs));
  white-space: normal;
}

/* ---------- icons ---------- */

.ico {
  flex: none;
  display: inline-block;
  vertical-align: -3px;
}

.fr-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.fr-tab .ico {
  color: var(--muted);
}

.dv-active-tab .fr-tab .ico {
  color: var(--accent-text);
}

.dv-groupview:not(.dv-active-group) .dv-active-tab .fr-tab .ico {
  color: var(--text);
}

.fr-tab .dv-default-tab {
  padding: 0;
}

.desk-menu-btn .ico {
  color: var(--muted);
}

.desk-menu-btn:hover .ico,
.desk-menu-btn.is-on .ico {
  color: var(--strong);
}

.acct-menu a,
.acct-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
}

.acct-menu a .ico,
.acct-menu button .ico {
  color: var(--muted);
}

.acct-menu a:hover .ico,
.acct-menu button:hover .ico {
  color: var(--strong);
}

.tv-nav button,
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tabs button .ico {
  color: var(--muted);
}

.tabs button.is-on .ico {
  color: var(--accent-text);
}

.tv-nav button .ico {
  opacity: 0.85;
}

.page-head h1 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-head h1 .ico {
  color: var(--accent-text);
}

.qsub {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qsub .ico {
  color: var(--gold);
}

.banner {
  flex-wrap: nowrap;
}

.banner p {
  flex: 1;
}

.banner-ico {
  color: var(--gold);
}

.lock-note .ico {
  color: var(--gold);
  margin-bottom: 6px;
}

.dock-empty .ico {
  margin: 0 auto 6px;
  color: var(--muted);
}

@media (max-width: 520px) {
  .banner {
    flex-wrap: wrap;
  }
}

/* ---------- headlines on the chart (bottom row, like TradingView's events) ---------- */

.chart-events {
  position: absolute;
  left: 0;
  height: 0;
  z-index: 4;
  pointer-events: none;
}

.chart-event {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  pointer-events: auto;
}

.chart-event-dot {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--hover);
  border: 1px solid var(--line-hover);
  color: var(--strong);
  font-size: calc(10px * var(--fs));
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: background 0.12s, border-color 0.12s;
}

.chart-event:hover .chart-event-dot,
.chart-event.is-open .chart-event-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* The card sits above its marker; the padding bridges the gap so the
   pointer can travel from the marker into the card. */
.chart-event-card {
  position: absolute;
  bottom: 100%;
  left: -12px;
  padding-bottom: 8px;
  width: 300px;
  max-width: 70vw;
  display: flex;
  flex-direction: column;
}

.chart-event-card.is-left {
  left: auto;
  right: -12px;
}

.chart-event-item,
.chart-event-more {
  display: block;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 0;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--text);
}

.chart-event-item:first-child {
  border-radius: 6px 6px 0 0;
}

.chart-event-item:last-child,
.chart-event-more {
  border-bottom-width: 1px;
  border-radius: 0 0 6px 6px;
}

.chart-event-item:only-child {
  border-radius: 6px;
}

.chart-event-item span {
  display: block;
  font-size: calc(11px * var(--fs));
  color: var(--muted);
  margin-bottom: 2px;
}

.chart-event-item b {
  font-size: calc(12.5px * var(--fs));
  font-weight: 600;
  color: var(--strong);
  line-height: 1.35;
}

a.chart-event-item:hover b {
  color: var(--link);
}

.chart-event-more {
  font-size: calc(11px * var(--fs));
  color: var(--muted);
}

.chart-event-card {
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

/* ---------- the app's news-catalyst flame ---------- */

.flame {
  flex: none;
  display: inline-block;
  vertical-align: -2px;
  color: var(--flame);
  transform-origin: 50% 85%;
  animation: fr-flame 0.8s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 3px rgba(255, 140, 0, 0.35));
}

@keyframes fr-flame {
  from {
    transform: scale(0.85);
  }
  to {
    transform: scale(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flame {
    animation: none;
  }
}

.chip.chip-hot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--flame);
  border-color: rgba(255, 140, 0, 0.45);
  background: rgba(255, 140, 0, 0.1);
}

.tick-chip.is-hot {
  border-color: rgba(255, 140, 0, 0.5);
}

.hot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px 1px 5px;
  border-radius: 4px;
  font-size: calc(10px * var(--fs));
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--flame);
  background: rgba(255, 140, 0, 0.12);
  border: 1px solid rgba(255, 140, 0, 0.35);
}

.quote-head h2 {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Display menu ---------- */

.display-btn {
  width: 32px;
  height: 32px;
}

.display-btn.is-on {
  color: var(--accent-text);
  background: var(--panel-2);
}

.display-panel {
  width: 280px;
  right: 0;
  left: auto;
  padding: 6px 10px 12px;
}

.seg.seg-full {
  display: flex;
  width: 100%;
  margin-bottom: 4px;
}

.seg.seg-full button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  font-size: calc(12px * var(--fs));
}

.seg.seg-full button.is-on {
  color: var(--accent-ink);
  background: var(--accent);
}

.display-toggle {
  margin-top: 10px;
  gap: 8px;
}

.display-toggle .ico {
  color: var(--muted);
}

:root[data-theme='light'] .tlogo:not(.is-letter):not(.is-light) {
  box-shadow: 0 0 0 1px var(--border);
}

/* ---------- headline heat: the flame's colour says how hot a story is ---------- */

.flame.heat-1 {
  color: #ffc400;
  --flame-core: #fff3c4;
  filter: drop-shadow(0 0 3px rgba(255, 196, 0, 0.35));
}

.flame.heat-2 {
  color: #ff9100;
  --flame-core: #ffe082;
  filter: drop-shadow(0 0 4px rgba(255, 145, 0, 0.45));
}

.flame.heat-3 {
  color: #ff3d00;
  --flame-core: #ffab40;
  filter: drop-shadow(0 0 6px rgba(255, 61, 0, 0.55));
  animation-duration: 0.6s;
}

.flame.heat-4 {
  color: #ff1744;
  --flame-core: #ff9e80;
  filter: drop-shadow(0 0 9px rgba(255, 23, 68, 0.7));
  animation-duration: 0.45s;
}

.news-full {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: start;
  padding: 14px 0;
}

.news-heat {
  display: grid;
  place-items: start center;
  width: 36px;
}

.news-full .news-body {
  min-width: 0;
}

.news-full h3 {
  margin: 0 0 4px;
  font-size: calc(14.5px * var(--fs));
  line-height: 1.35;
}

.news-full .news-meta {
  margin-bottom: 6px;
}

.news-full p {
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.5;
}

.news-tickers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.news-thumb {
  display: block;
  width: 112px;
  height: 74px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.heat-label {
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  font-size: calc(10px * var(--fs));
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.heat-label.heat-1 {
  color: #b38900;
  background: rgba(255, 196, 0, 0.14);
}

:root:not([data-theme='light']) .heat-label.heat-1 {
  color: #ffc400;
}

.heat-label.heat-2 {
  color: #ff9100;
  background: rgba(255, 145, 0, 0.14);
}

.heat-label.heat-3 {
  color: #ff3d00;
  background: rgba(255, 61, 0, 0.14);
}

.heat-label.heat-4 {
  color: #ff1744;
  background: rgba(255, 23, 68, 0.15);
}

/* The hottest stories carry a coloured edge. */
.news-full.heat-3,
.news-full.heat-4 {
  margin-left: -12px;
  padding-left: 10px;
  border-left: 2px solid;
}

.news-full.heat-3 {
  border-left-color: rgba(255, 61, 0, 0.7);
}

.news-full.heat-4 {
  border-left-color: rgba(255, 23, 68, 0.85);
  background: linear-gradient(90deg, rgba(255, 23, 68, 0.07), transparent 60%);
}

@container (max-width: 520px) {
  .news-thumb {
    display: none;
  }
  .news-full {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

/* ---------- P&L (month and days, in percent) ---------- */

.pnl {
  gap: 10px;
}

.pnl-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.pnl-month {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.pnl-month span {
  font-size: calc(12px * var(--fs));
  font-weight: 600;
  color: var(--muted);
}

.pnl-month b {
  font-size: calc(26px * var(--fs));
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pnl-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: calc(11px * var(--fs));
  color: var(--muted);
}

.pnl-stats b {
  color: var(--strong);
  font-weight: 600;
}

.pnl-stats b.down {
  color: var(--down);
}

.pnl-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.pnl-dow {
  text-align: center;
  font-size: calc(10px * var(--fs));
  color: var(--muted);
  padding-bottom: 2px;
}

.pnl-day {
  min-height: 40px;
  padding: 3px 4px;
  border-radius: 4px;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.pnl-day small {
  font-size: calc(9.5px * var(--fs));
  color: var(--muted);
}

.pnl-day b {
  font-size: calc(10.5px * var(--fs));
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.pnl-day.is-up {
  background: var(--up-soft);
}

.pnl-day.is-up b {
  color: var(--up);
}

.pnl-day.is-down {
  background: var(--down-soft);
}

.pnl-day.is-down b {
  color: var(--down);
}

.pnl-day.is-today {
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---------- Settings: integrations and the webhook dialog ---------- */

.display-link {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
  text-align: left;
}

.display-link .muted {
  grid-column: 2;
  font-size: calc(11px * var(--fs));
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: calc(12px * var(--fs));
  gap: 6px;
}

.wh-intro {
  margin-bottom: 12px;
}

.wh-intro a {
  color: var(--link);
}

.wh-form {
  gap: 9px;
}

.wh-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.wh-test {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.wh-ok {
  color: var(--up);
  font-size: calc(11.5px * var(--fs));
}

.wh-err {
  color: var(--down);
  font-size: calc(11.5px * var(--fs));
  max-width: 220px;
  text-align: right;
}

.wh-label {
  font-weight: 600;
  color: var(--strong);
  font-size: calc(12px * var(--fs));
}

.wh-events {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.wh-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font-size: calc(12.5px * var(--fs));
}

.wh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.wh-status.is-on .wh-dot {
  background: var(--up);
  box-shadow: 0 0 0 3px var(--up-soft);
}

.wh-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.wh-form .select {
  width: 100%;
  height: 36px;
}

/* ---------- P&L readout in the top bar ---------- */

.tb-pnl-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.tb-pnl-btn:hover,
.tb-pnl-btn.is-on {
  border-color: var(--line-hover);
}

.tb-pnl-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.tb-pnl-item small {
  font-size: calc(9.5px * var(--fs));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.tb-pnl-item b {
  font-size: calc(13px * var(--fs));
  font-weight: 700;
}

.tb-pnl-day {
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.tb-pnl-pop {
  width: 330px;
  right: 0;
  left: auto;
  padding: 0;
}

.tb-pnl-pop .dock-page {
  height: auto;
  overflow: visible;
}

@media (max-width: 520px) {
  .tb-pnl-day {
    display: none;
  }
  .tb-pnl-btn {
    padding: 0 9px;
  }
}

.tb-pnl-pop {
  width: 392px;
  max-width: calc(100vw - 24px);
}

@media (max-width: 520px) {
  .tv-brand-word {
    display: none;
  }
}

@media (max-width: 520px) {
  .tv-top {
    column-gap: 6px;
  }
  .tv-top .btn {
    padding: 0 10px;
  }
  .tv-top .btn .ico {
    display: none;
  }
}

.dlg-form .toggle input {
  width: auto;
  height: auto;
  padding: 0;
}
