:root {
  --bg: #000000;
  --surface: #111315;
  --surface-soft: #1a1d20;
  --ink: #f5f7f8;
  --body: #d2d8dc;
  --muted: #9aa5aa;
  --line: #2a3034;
  --green: #28c47c;
  --red: #ff5a5f;
  --market-up: var(--red);
  --market-down: var(--green);
  --amber: #f7b955;
  --button-text: #ff9f1c;
  --blue: #67a8ff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--body);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  padding-bottom: 78px;
}

body.modal-open {
  overflow: hidden;
}

button,
select,
table {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.topbar,
.news-ticker,
.status-row,
.monitor,
.news-panel,
.top10-panel,
.site-footer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.topbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
}

.news-ticker {
  position: sticky;
  top: 8px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
}

.news-ticker.hidden {
  display: none;
}

.news-ticker-label {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--red);
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.site-footer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: min(560px, calc(100vw - 36px));
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.92rem;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.site-footer strong {
  color: var(--amber);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.site-footer small {
  color: var(--muted);
}

.news-ticker-viewport {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.news-ticker-track {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.news-ticker-track.is-static {
  transform: translate3d(0, 0, 0);
}

.news-ticker-group {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
}

.news-ticker-item {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

a.news-ticker-item:hover,
a.news-ticker-item:focus-visible {
  color: var(--blue);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .news-ticker-track {
    white-space: normal;
  }
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  color: var(--ink);
  font-size: 1.1rem;
}

h3 {
  color: var(--ink);
  font-size: 1rem;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.weather-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 160px;
  min-height: 54px;
  border: 1px solid rgba(247, 185, 85, 0.36);
  border-radius: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(247, 185, 85, 0.14), rgba(103, 168, 255, 0.08));
}

.weather-icon {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  font-size: 1.35rem;
  line-height: 1;
}

.weather-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.weather-copy strong {
  color: var(--ink);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.weather-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subscribe-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface-soft);
  color: var(--button-text);
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
}

.subscribe-button:hover,
.subscribe-button:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.language-control,
.ranking-mode-control {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.language-control select,
.ranking-mode-control select {
  min-width: 116px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 34px 0 12px;
  background: var(--surface-soft);
  color: var(--button-text);
  font-weight: 800;
}

.language-control select:focus,
.ranking-mode-control select:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(103, 168, 255, 0.22);
}

.ranking-mode-control {
  min-width: 160px;
}

.segments {
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment,
.icon-button {
  min-height: 42px;
  border: 0;
  background: var(--surface-soft);
  color: var(--button-text);
  font-weight: 750;
}

.segment {
  min-width: 68px;
  padding: 0 12px;
}

.segment.active {
  background: var(--surface);
  color: var(--button-text);
}

.icon-button {
  width: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.2rem;
}

.status-row {
  display: none !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  background: var(--line);
}

.metric {
  min-height: 92px;
  padding: 20px;
  background: var(--surface);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.6rem;
}

.alert-metric strong {
  color: var(--amber);
}

.monitor {
  margin-top: 16px;
  padding: 24px;
}

.top10-panel {
  margin-top: 16px;
  padding: 24px;
}

.news-panel {
  margin-top: 16px;
  padding: 24px;
}

.admin-panel {
  margin-top: 16px;
  padding: 24px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.admin-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface-soft);
  color: var(--button-text);
  font: inherit;
  font-weight: 850;
}

.admin-tab.active {
  background: var(--surface);
}

.release-notes-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface-soft);
}

.release-notes-list {
  display: grid;
  gap: 12px;
}

.release-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.release-note-header {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.release-note-header time,
.release-note-header span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.release-note h4 {
  margin-top: 4px;
  font-size: 1.05rem;
}

.release-note p {
  max-width: 860px;
  color: var(--body);
  font-weight: 700;
  line-height: 1.55;
}

.release-note ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--body);
  font-weight: 750;
  line-height: 1.45;
}

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ranking-card {
  min-width: 0;
}

.ranking-card-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ranking-card-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ranking-card-heading a {
  color: var(--button-text);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.ranking-card-heading a:hover,
.ranking-card-heading a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-live-video {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-soft);
}

.news-live-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  aspect-ratio: 16 / 9;
}

.news-live-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading p {
  max-width: 620px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

.market-hero {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.market-hero.hidden {
  display: none;
}

.market-video-frame {
  position: relative;
  min-height: 210px;
  background: #101820;
}

.market-video-frame iframe,
.market-video-frame img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 210px;
  border: 0;
  object-fit: cover;
}

.market-video-placeholder {
  display: grid;
  min-height: 210px;
  place-items: center;
  padding: 18px;
  color: #dbe4e7;
  font-weight: 800;
  text-align: center;
}

.market-hero-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 20px 20px 20px 0;
}

.market-hero-copy h3 {
  font-size: 1.28rem;
  line-height: 1.35;
}

.market-hero-copy p:last-child {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.market-video-link {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--button-text);
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
}

.market-video-link:hover,
.market-video-link:focus-visible {
  border-color: var(--blue);
  color: var(--button-text);
}

.watchlist-form {
  display: grid;
  grid-template-columns: auto minmax(260px, 420px) minmax(180px, 1fr);
  gap: 10px 12px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.watchlist-form label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.watchlist-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.quick-symbol-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--button-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.watchlist-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.watchlist-controls input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.watchlist-controls input:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(103, 168, 255, 0.22);
}

.add-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--surface);
  color: var(--button-text);
  font-weight: 800;
}

.add-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.form-status {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.form-status[data-level="ok"] {
  color: var(--green);
}

.form-status[data-level="error"] {
  color: var(--red);
}

.notice,
.loader {
  border-radius: 8px;
  padding: 14px 16px;
  background: #2a1618;
  color: var(--red);
}

.loader {
  background: var(--surface-soft);
  color: var(--muted);
}

.hidden {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

th:first-child,
td.drag-cell {
  width: 48px;
  padding-right: 6px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

tbody tr.highlight td:first-child {
  box-shadow: inset 4px 0 0 var(--amber);
}

tbody tr.dragging {
  opacity: 0.5;
}

tbody tr.drag-over td {
  background: #16243a;
}

.drag-handle {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.symbol {
  display: grid;
  gap: 3px;
}

.symbol-cell {
  display: block;
}

.symbol-with-inline-chart {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 360px;
}

.inline-k-chart-button {
  display: grid;
  grid-template-columns: 44px minmax(0, 168px);
  align-items: center;
  gap: 8px;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 7px;
  background: linear-gradient(135deg, rgba(255, 157, 45, 0.12), rgba(19, 28, 33, 0.96));
  color: var(--amber);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
}

.inline-k-chart-button span {
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

.inline-k-chart-button:hover,
.inline-k-chart-button:focus-visible {
  border-color: rgba(255, 157, 45, 0.58);
  box-shadow: 0 0 0 3px rgba(255, 157, 45, 0.12);
}

.inline-k-chart {
  width: 100%;
  max-width: 168px;
  height: 64px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}

.symbol strong {
  color: var(--ink);
}

.symbol span {
  color: var(--muted);
  font-size: 0.82rem;
}

.symbol-button {
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--button-text);
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.symbol-button:hover,
.symbol-button:focus-visible {
  color: var(--button-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.remove-symbol-button {
  margin-left: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 800;
}

.remove-symbol-button:hover,
.remove-symbol-button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.price {
  color: var(--ink);
  font-weight: 800;
}

.dividend-amount {
  color: var(--ink);
  font-weight: 850;
}

.dividend-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 300px;
}

.dividend-history-button {
  display: inline-grid;
  gap: 2px;
  min-width: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface-soft);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.dividend-history-button:hover,
.dividend-history-button:focus-visible {
  border-color: rgba(255, 157, 45, 0.52);
  background: #2d2413;
}

.dividend-history time {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.dividend-history strong {
  color: var(--amber);
  font-size: 0.82rem;
}

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

.dividend-modal-panel {
  width: min(820px, 100%);
}

.dividend-status {
  padding: 16px 20px 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.dividend-table-wrap {
  padding: 18px;
}

.dividend-chart-wrap {
  margin: 16px 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.dividend-chart-heading {
  border-bottom: 1px solid #edf1f2;
  padding: 12px 14px;
  background: #f7fafb;
  color: #425057;
  font-size: 0.82rem;
  font-weight: 900;
}

.dividend-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 300px;
}

.dividend-table {
  min-width: 0;
}

.price-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.price-button:hover,
.price-button:focus-visible {
  color: var(--button-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--body);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
}

.pill.ok,
.pill.up,
.pill.buy {
  background: #2d1719;
  color: var(--market-up);
}

.pill.down,
.pill.sell,
.pill.danger {
  background: #102a20;
  color: var(--market-down);
}

.pill.watch {
  background: #2d2413;
  color: var(--amber);
}

.pill.neutral {
  background: #16243a;
  color: var(--blue);
}

.row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.72);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(1120px, 100%);
  max-height: min(88dvh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.62);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  background: var(--surface);
}

.chart-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.chart-summary span {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-summary strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--ink);
  font-size: 1rem;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.chart-summary strong.up {
  color: var(--market-up);
}

.chart-summary strong.down {
  color: var(--market-down);
}

.modal-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 18px 0;
  background: var(--surface);
}

.modal-tabs.hidden,
.holdings-panel.hidden,
.chart-frame.hidden {
  display: none;
}

.modal-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  padding: 0 16px;
  background: var(--surface-soft);
  color: var(--button-text);
  cursor: pointer;
  font-weight: 900;
}

.modal-tab.active {
  border-bottom-color: var(--surface);
  background: var(--surface);
  color: var(--button-text);
}

.holdings-panel {
  padding: 18px;
}

.holdings-status {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.holdings-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.holdings-table {
  min-width: 720px;
}

.holdings-table th,
.holdings-table td {
  height: 58px;
}

.holding-symbol-button {
  text-align: left;
}

.premium-modal-panel {
  width: min(920px, 100%);
}

.subscribe-modal-panel {
  width: min(520px, 100%);
}

.subscribe-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.subscribe-form label,
.subscribe-markets {
  display: grid;
  gap: 8px;
}

.subscribe-form label span,
.subscribe-markets legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.subscribe-form input[type="email"] {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.subscribe-form input[type="email"]:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(103, 168, 255, 0.22);
}

.subscribe-markets {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.subscribe-markets label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
}

.subscribe-submit {
  width: fit-content;
}

.line-subscribe-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.line-subscribe-panel p {
  color: var(--body);
  line-height: 1.55;
}

.line-command-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.line-command-button {
  cursor: copy;
}

.premium-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  background: var(--surface);
}

.premium-toolbar .modal-tab {
  border-radius: 8px;
}

.premium-thresholds {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  background: var(--surface-soft);
}

.premium-thresholds label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.premium-thresholds input {
  width: 72px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.premium-status {
  padding: 14px 18px 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.55;
}

.premium-chart-wrap {
  position: relative;
  margin: 16px 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.premium-chart-wrap[hidden] {
  display: none;
}

.premium-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.premium-chart-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.premium-chart-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

#premiumChart {
  display: block;
  width: 100%;
  height: 320px;
}

.premium-chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(17, 19, 21, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.5;
  pointer-events: none;
}

.premium-chart-tooltip.hidden {
  display: none;
}

.premium-table-wrap {
  margin: 16px 18px 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.premium-table {
  min-width: 640px;
}

.premium-table th,
.premium-table td {
  height: 54px;
}

.chart-frame {
  padding: 18px;
}

.chart-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chart-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chart-toolbar select {
  min-width: 150px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--button-text);
  font: inherit;
  font-weight: 800;
}

.chart-toolbar span[role="status"] {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

#kChart {
  display: block;
  width: 100%;
  height: min(58dvh, 620px);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.top10-grid {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.top10-row {
  display: grid;
  grid-template-columns: 52px minmax(180px, 1.3fr) minmax(110px, 0.7fr) minmax(110px, 0.7fr) minmax(120px, 0.7fr);
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

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

.top10-rank,
.top10-symbol,
.top10-price,
.top10-change,
.top10-volume {
  min-width: 0;
  padding: 12px 14px;
}

.top10-rank {
  height: 100%;
  display: grid;
  place-items: center;
  background: #2b3032;
  color: white;
  font-weight: 900;
}

.top10-symbol {
  display: grid;
  gap: 3px;
}

.top10-symbol strong,
.top10-price {
  color: var(--ink);
  font-weight: 900;
}

.top10-symbol span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top10-change,
.top10-price,
.top10-volume {
  font-weight: 850;
}

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

.top10-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1280px);
    padding: 10px 0;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 14px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
    justify-content: stretch;
  }

  .weather-card {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .segments {
    grid-column: 1 / -1;
    flex: 1;
  }

  .segment {
    width: auto;
  }

  .language-control {
    grid-template-columns: 1fr;
    align-items: center;
  }

  .auto-refresh-control {
    grid-column: auto;
  }

  .status-row {
    grid-template-columns: 1fr;
  }

  .section-heading p {
    text-align: left;
  }

  .market-hero {
    grid-template-columns: 1fr;
  }

  .market-video-frame,
  .market-video-frame iframe,
  .market-video-frame img,
  .market-video-placeholder {
    min-height: auto;
    aspect-ratio: 16 / 10;
  }

  .market-hero-copy {
    padding: 14px;
  }

  .market-hero-copy h3 {
    font-size: 1rem;
  }

  .news-ticker {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .news-ticker-label {
    width: fit-content;
  }

  .watchlist-form {
    grid-template-columns: 1fr;
  }

  .watchlist-controls {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .monitor,
  .news-panel,
  .top10-panel,
  .admin-panel {
    padding: 14px;
  }

  .release-note-header {
    flex-direction: column;
  }

  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .ranking-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  td.drag-cell {
    grid-template-columns: 1fr;
    padding: 8px 12px;
  }

  td.drag-cell::before {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tbody tr {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  tbody tr.highlight td:first-child {
    box-shadow: inset 4px 0 0 var(--amber);
  }

  td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 11px 12px;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  td:first-child {
    grid-template-columns: 1fr;
    padding-top: 14px;
  }

  td:first-child::before {
    display: none;
  }

  td:last-child {
    border-bottom: 0;
  }

  .pill {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }

  .symbol-with-inline-chart {
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
  }

  .inline-k-chart-button {
    width: min(100%, 240px);
  }

  .modal {
    align-items: stretch;
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal-header {
    padding: 14px;
  }

  .chart-summary {
    grid-template-columns: 1fr 1fr;
  }

  .chart-summary span {
    padding: 12px;
  }

  .chart-frame {
    padding: 12px;
  }

  .chart-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-toolbar select {
    width: 100%;
  }

  .modal-tabs {
    padding: 10px 12px 0;
  }

  .modal-tab {
    flex: 1;
  }

  .holdings-panel {
    padding: 12px;
  }

  .holdings-table-wrap {
    overflow: visible;
    border: 0;
  }

  .holdings-table {
    min-width: 0;
  }

  .premium-toolbar {
    padding: 10px 12px;
  }

  .site-footer {
    right: 12px;
    bottom: 12px;
    left: 12px;
    flex-wrap: wrap;
    gap: 6px 10px;
    text-align: center;
  }

  .premium-status {
    padding: 12px 12px 0;
  }

  .premium-thresholds {
    padding: 10px 12px;
  }

  .premium-thresholds label {
    width: 100%;
    justify-content: space-between;
  }

  .premium-chart-wrap {
    margin: 12px;
    padding: 10px;
  }

  #premiumChart {
    height: 300px;
  }

  .premium-table-wrap {
    overflow: visible;
    margin: 12px;
    border: 0;
  }

  .premium-table {
    min-width: 0;
  }

  #kChart {
    height: 58dvh;
    min-height: 360px;
  }

  .top10-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 0;
  }

  .top10-price,
  .top10-volume {
    display: none;
  }

  .top10-change {
    padding-right: 12px;
    text-align: right;
  }

  .top10-symbol {
    padding: 10px 12px;
  }
}

.news-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.news-card:hover,
.news-card:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 1px 0 var(--blue);
  outline: none;
  transform: translateY(-1px);
}

.news-title-link {
  color: inherit;
  text-decoration: none;
}

.news-title-link:hover,
.news-title-link:focus-visible {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.news-source {
  color: var(--blue);
}

.news-title {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.news-summary {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--body);
}

.news-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ticker-chip,
.summary-toggle {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--button-text);
  font-size: 0.78rem;
  font-weight: 800;
}

.ticker-chip:hover,
.ticker-chip:focus-visible,
.summary-toggle:hover,
.summary-toggle:focus-visible {
  border-color: var(--blue);
  color: var(--button-text);
  outline: none;
}

@media (max-width: 760px) {
  .news-panel {
    padding: 18px;
  }

  .news-title {
    font-size: 0.94rem;
  }

  .news-summary {
    overflow: hidden;
    max-height: 2.8em;
  }

  .news-card.expanded .news-summary {
    overflow: visible;
    max-height: none;
  }
}
