.watchlist-dashboard-viewport {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.watchlist-dashboard {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  outline: none;
}

.watchlist-dashboard[data-chart-palette="tao"] {
  --font-mono: "Cera Round Pro", CeraRoundPro, "Nunito Sans", Arial, sans-serif;
  --bg: #141414;
  --surface: #0a0a0a;
  --surface-alt: #141414;
  --surface-hover: #262626;
  --border: #292929;
  --border-strong: #464646;
  --text: #ffffff;
  --muted-strong: #b2b2b2;
  --positive: #26a699;
  --negative: #ef5552;
}

.watchlist-chart[data-chart-palette="tao"] .watchlist-chart__overlay {
  font-family: "Cera Round Pro", CeraRoundPro, "Nunito Sans", Arial, sans-serif;
}

.watchlist-chart[data-chart-palette="tao"] .watchlist-chart__symbol,
.watchlist-chart[data-chart-palette="tao"] .watchlist-chart__timeframe {
  font-size: 12px;
  font-weight: 400;
  border-color: transparent;
}

.watchlist-chart[data-chart-palette="light"] .watchlist-chart__overlay {
  font-family: Arial, sans-serif;
}

.watchlist-workspace.is-seconds {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.watchlist-workspace.is-seconds .watchlist-controls {
  padding-right: 360px;
  flex-wrap: wrap;
}

.watchlist-seconds-form {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.watchlist-seconds-form input {
  width: 165px;
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 11px var(--font-mono);
}

.watchlist-seconds-form button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 750 10px var(--font-mono);
}

.watchlist-seconds-form button:hover { background: var(--surface-hover); }
.watchlist-seconds-form button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.watchlist-seconds-form [role="status"] {
  color: var(--muted-strong);
  font: 10px var(--font-mono);
}

.metascalp-follow { display: flex; align-items: center; gap: 0; min-width: 0; }
.metascalp-follow__toggle, .metascalp-follow__picker > summary {
  min-height: 30px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-size: 10px; cursor: pointer;
}
.metascalp-follow__toggle { padding: 5px 8px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); white-space: nowrap; }
.metascalp-follow__toggle[aria-pressed="true"] { background: var(--accent-soft, #16324a); border-color: var(--accent); }
.metascalp-follow__picker > summary { padding: 5px 8px; border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.metascalp-follow__status { color: var(--muted); font-size: 10px; margin-left: 6px; white-space: nowrap; }
.metascalp-follow[data-state="following"] .metascalp-follow__status { color: var(--positive); }
.metascalp-follow[data-state="error"] .metascalp-follow__status,
.metascalp-follow[data-state="missing"] .metascalp-follow__status { color: var(--negative); }
.metascalp-follow__picker .metascalp-follow__menu {
  width: min(430px, calc(100vw - 28px)); max-height: min(620px, 75dvh);
  overflow-y: auto; padding: 14px; right: 0; font-size: 12px;
}
.metascalp-follow__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metascalp-follow__menu button, .metascalp-follow__menu select {
  min-height: 34px; border: 1px solid var(--border); border-radius: 5px; color: var(--text);
  background: var(--surface); font: inherit; padding: 6px 9px; cursor: pointer;
}
.metascalp-follow__menu button:hover { background: var(--surface-hover); }
.metascalp-follow__menu select { width: 100%; margin-bottom: 10px; }
.metascalp-follow__selected { margin: 9px 0; color: var(--muted-strong); overflow-wrap: anywhere; }
.metascalp-follow__list { max-height: 290px; overflow-y: auto; display: grid; gap: 6px; }
.metascalp-follow__list .metascalp-follow__source { display: grid; gap: 4px; text-align: left; padding: 10px; min-width: 0; }
.metascalp-follow__source strong { font-size: 12px; overflow-wrap: anywhere; }
.metascalp-follow__source span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.metascalp-follow__source[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft, #16324a); }
.metascalp-follow__detail, .metascalp-follow__privacy { line-height: 1.5; color: var(--muted-strong); margin: 10px 0 0; }
.metascalp-follow__privacy { font-size: 10px; color: var(--muted); }
@media (max-width: 760px) {
  .metascalp-follow { order: 3; position: relative; flex-basis: 100%; }
  .metascalp-follow .metascalp-follow__picker { position: static; }
  .metascalp-follow__picker .metascalp-follow__menu { left: 0; right: auto; }
}

.watchlist-grid.watchlist-seconds-grid {
  grid-template-columns: repeat(var(--seconds-columns, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--seconds-rows, 3), minmax(180px, 1fr));
}

.watchlist-seconds-empty {
  grid-column: 1 / -1;
  align-self: center;
  padding: 24px;
  color: var(--muted-strong);
  font: 12px/1.6 var(--font-mono);
  text-align: center;
}

.watchlist-chart.is-seconds .watchlist-chart__symbol { max-width: 100%; }

.watchlist-chart__fullscreen {
  position: absolute; right: 3px; bottom: 3px; z-index: 8;
  display: grid; place-items: center; width: 26px; height: 26px; padding: 4px;
  border: 1px solid transparent; border-radius: 4px;
  background: var(--watchlist-chart-background, var(--surface));
  color: var(--watchlist-chart-text, var(--muted-strong));
}
.watchlist-chart__fullscreen svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; }
.watchlist-chart__fullscreen:hover, .watchlist-chart__fullscreen:focus-visible { color: var(--text); border-color: var(--accent); }
.watchlist-chart:fullscreen { width: 100vw; height: 100vh; min-height: 0; border: 0; border-radius: 0; zoom: var(--dashboard-page-zoom-inverse, 1); }
.watchlist-chart:fullscreen .watchlist-chart__canvas { zoom: 1; transform: none; }
.watchlist-chart:not(:fullscreen) .watchlist-chart__instrument-detail { display: none; }
.watchlist-chart[data-expanded-ticker="true"] .watchlist-chart__instrument-detail { display: inline; }
.watchlist-chart:fullscreen .chart-volume-legend { font-size: 14px; line-height: 20px; }
.watchlist-chart:fullscreen .watchlist-chart__fullscreen { right: 8px; bottom: 6px; width: 34px; height: 34px; }

.watchlist-workspace.is-seconds .watchlist-layout__menu {
  left: 0;
  right: auto;
}

@media (max-width: 760px) {
  .watchlist-workspace.is-seconds .watchlist-controls { padding-right: 6px; }
  body:has(#dashboard-toolbar-panel:not([hidden])) .watchlist-workspace.is-seconds .watchlist-controls { padding-top: 46px; }
  .watchlist-workspace.is-seconds .watchlist-layout__menu { left: auto; right: 0; }
  .watchlist-seconds-form { order: 2; }
  .watchlist-grid.watchlist-seconds-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: 285px; }
  .watchlist-seconds-form [role="status"] { flex-basis: 100%; }
}

.watchlist-controls {
  position: relative;
  z-index: 30;
  display: flex;
  min-width: 0;
  min-height: 36px;
  padding: 3px 205px 3px 8px;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  gap: 8px;
}

.watchlist-mode-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  gap: 2px;
}

.watchlist-mode-switch button {
  min-height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
}

.watchlist-mode-switch button:hover,
.watchlist-mode-switch button:focus-visible {
  color: var(--text);
}

.watchlist-mode-switch button.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.watchlist-current-instrument {
  display: flex;
  flex: 0 1 300px;
  max-width: 30vw;
  min-width: 0;
  align-items: center;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-current-instrument .exchange-label__text {
  color: inherit;
}

.watchlist-market-control {
  display: flex;
  min-width: 0;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  gap: 7px;
}

.watchlist-market-control select {
  width: clamp(190px, 21vw, 300px);
  min-height: 30px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 11px;
}

.watchlist-market-count {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}

.watchlist-view-actions {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: 0;
  align-items: center;
  gap: 4px;
}

.watchlist-layouts {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.watchlist-layout-button {
  display: inline-flex;
  min-width: 70px;
  min-height: 46px;
  padding: 6px 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
  gap: 10px;
}

.watchlist-layout-button .watchlist-layout-icon { width: 24px; height: 24px; gap: 2px; }

.watchlist-layout-button:hover,
.watchlist-layout-button:focus-visible {
  border-color: var(--border-strong);
  color: var(--text);
}

.watchlist-layout-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.watchlist-layout-icon {
  display: grid;
  width: 17px;
  height: 17px;
  grid-template-columns: repeat(var(--layout-columns, 1), 1fr);
  grid-template-rows: repeat(var(--layout-rows, 1), 1fr);
  gap: 1px;
}

.watchlist-layout-icon i {
  min-width: 0;
  min-height: 0;
  border: 1px solid currentcolor;
  border-radius: 1px;
}

.watchlist-layout-button__count {
  min-width: 16px;
  text-align: right;
}

.watchlist-popover {
  position: relative;
  flex: 0 0 auto;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
}

.watchlist-popover > summary {
  display: inline-flex;
  min-height: 30px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  gap: 5px;
  list-style: none;
}

.watchlist-popover > summary::-webkit-details-marker {
  display: none;
}

.watchlist-popover > summary:hover,
.watchlist-popover > summary:focus-visible,
.watchlist-popover[open] > summary {
  border-color: var(--accent);
  color: var(--text);
}

.watchlist-popover__menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 5px);
  right: 0;
  width: max-content;
  max-width: min(92vw, 390px);
  padding: 7px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  box-shadow: 0 14px 34px rgb(0 0 0 / 42%);
}

.watchlist-popover__title {
  padding: 3px 3px 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.watchlist-popover__menu > p {
  max-width: 330px;
  margin: 7px 3px 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.watchlist-layout__menu {
  width: 380px;
  max-width: calc(100vw - 32px);
  padding: 14px;
  border-radius: 10px;
  font-size: 13px;
}

.watchlist-layout__menu .watchlist-popover__title { padding: 0 0 12px; font-size: 15px; }
.watchlist-layout__menu > p { max-width: none; margin: 10px 0 0; font-size: 10px; line-height: 1.5; }

.watchlist-custom-layout {
  display: grid;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.watchlist-custom-layout__heading,
.watchlist-layout-preview,
.watchlist-custom-layout__apply {
  grid-column: 1 / -1;
}

.watchlist-custom-layout__heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.watchlist-custom-layout__heading strong { color: var(--text); font-size: 13px; }
.watchlist-custom-layout__heading > span { color: var(--muted); font-size: 11px; }
.watchlist-custom-layout__field { min-width: 0; }

.watchlist-custom-layout label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted-strong);
  font-size: 12px;
}

.watchlist-layout-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.watchlist-layout-stepper input {
  width: 100%; min-width: 0; min-height: 44px; padding: 0 2px;
  border: 0; border-radius: 5px; background: transparent;
  color: var(--text);
  font: 750 18px var(--font-mono); text-align: center;
  font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield;
}

.watchlist-layout-stepper input::-webkit-inner-spin-button,
.watchlist-layout-stepper input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.watchlist-layout-stepper button {
  min-width: 0; min-height: 44px; padding: 0;
  border: 1px solid var(--border); border-radius: 5px; background: var(--surface-alt);
  color: var(--text); font: 500 24px/1 var(--font-mono);
}
.watchlist-layout-stepper button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.watchlist-layout-stepper button:disabled { opacity: 0.3; cursor: default; }
.watchlist-custom-layout :is(button, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.watchlist-layout-preview { display: flex; min-height: 60px; padding: 9px 12px; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.watchlist-layout-preview > .watchlist-layout-icon { width: 38px; height: 38px; flex-shrink: 0; color: var(--accent); gap: 2px; }
.watchlist-layout-preview > div { display: grid; min-width: 0; gap: 3px; }
.watchlist-layout-preview strong { color: var(--text); font-size: 15px; }
.watchlist-layout-preview span[data-layout-count] { color: var(--muted-strong); font-size: 11px; }
.watchlist-custom-layout__apply {
  min-height: 42px;
  border: 1px solid var(--accent); border-radius: 7px;
  background: var(--accent-soft);
  color: var(--text);
  font: 750 13px var(--font-mono);
}

.watchlist-custom-layout__apply:hover { filter: brightness(1.12); }

.watchlist-map-timeframe-control select {
  min-width: 58px;
  min-height: 30px;
  padding: 0 22px 0 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: 750 10px var(--font-mono);
}

.watchlist-map-pagination {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.watchlist-map-pagination button {
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 17px;
}

.watchlist-map-pagination button:disabled {
  opacity: 0.35;
}

.watchlist-map-pagination span {
  min-width: 42px;
  color: var(--muted-strong);
  font: 750 9px var(--font-mono);
  text-align: center;
}

.watchlist-sort__menu {
  display: grid;
  width: 245px;
  gap: 2px;
  font-size: 12px;
}

.watchlist-sort__menu button {
  display: flex;
  width: 100%;
  min-height: 31px;
  padding: 0 8px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  text-align: left;
}

.watchlist-sort__menu button.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.watchlist-sort__menu button:disabled {
  cursor: default;
  opacity: 0.7;
}

.watchlist-sort__placeholders {
  display: grid;
  gap: 2px;
}

.watchlist-sort__soon {
  color: var(--muted);
  font-size: 8px;
}

.watchlist-sort__menu button,
.watchlist-price-sort > summary {
  min-height: 38px;
}

.watchlist-price-sort { position: relative; }
.watchlist-price-sort > summary {
  display: flex;
  padding: 0 8px;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-sm);
  color: var(--muted-strong);
  cursor: pointer;
  list-style: none;
}
.watchlist-price-sort > summary::-webkit-details-marker { display: none; }
.watchlist-price-sort > summary span:last-child { font-size: 22px; }
.watchlist-price-sort[open] > summary,
.watchlist-price-sort.is-active > summary,
.watchlist-price-sort > summary:hover,
.watchlist-sort__menu button:not(:disabled):hover {
  color: var(--text);
  background: var(--accent-soft);
}
.watchlist-sort__periods {
  position: absolute;
  z-index: 2;
  top: -8px;
  left: calc(100% + 8px);
  width: 160px;
  padding: 7px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  box-shadow: 0 14px 34px rgb(0 0 0 / 42%);
}
.watchlist-sort__periods button { justify-content: flex-start; gap: 8px; }
.watchlist-sort__periods button::before { content: ''; width: 14px; }
.watchlist-sort__periods button.is-active::before { content: '✓'; }
.watchlist-price-sort.opens-left .watchlist-sort__periods { left: auto; right: calc(100% + 8px); }
.watchlist-sort-status { max-width: 140px; color: var(--muted); font: 10px var(--font-mono); }
.watchlist-chart__change {
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--watchlist-chart-control, var(--surface-alt)) 94%, transparent);
  color: var(--watchlist-chart-text, var(--text));
  font: 750 10px var(--font-mono);
}
.watchlist-chart__change[data-direction="up"] { color: var(--positive, #44c878); }
.watchlist-chart__change[data-direction="down"] { color: var(--negative, #ef6870); }

@media (max-width: 1200px) {
  .watchlist-sort__periods,
  .watchlist-price-sort.opens-left .watchlist-sort__periods {
    position: static;
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    margin-top: 4px;
    box-shadow: none;
  }
  .watchlist-sort { position: static; }
  .watchlist-sort__menu { right: 6px; max-height: calc(100dvh - 180px); overflow-y: auto; }
}

.watchlist-workspace {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-columns:
    minmax(0, 1fr)
    8px
    min(var(--watchlist-sidebar-width, 215px), 45%);
  gap: 0;
  overflow: hidden;
}

.watchlist-sidebar-resizer {
  position: relative;
  z-index: 4;
  min-width: 8px;
  min-height: 0;
  cursor: col-resize;
  outline: none;
  touch-action: none;
  user-select: none;
}

.watchlist-sidebar-resizer::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: transparent;
  content: "";
  transform: translateX(-50%);
  transition: background-color 120ms ease;
}

.watchlist-sidebar-resizer:hover::after,
.watchlist-sidebar-resizer:focus-visible::after,
.watchlist-workspace.is-resizing-sidebar .watchlist-sidebar-resizer::after {
  background: var(--accent);
}

.watchlist-workspace.is-resizing-sidebar,
.watchlist-workspace.is-resizing-sidebar * {
  cursor: col-resize !important;
  user-select: none !important;
}

.watchlist-main {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  overflow: hidden;
}

/* Menus may cover the chart/sidebar, but their canvases retain their own clip. */
.watchlist-main:has(#watchlist-sort[open]) { overflow: visible; position: relative; z-index: 35; }

.watchlist-grid {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding-right: 2px;
  grid-template-columns: repeat(
    var(--watchlist-grid-columns, 1), minmax(0, 1fr)
  );
  grid-auto-rows: minmax(180px, 1fr);
  align-content: stretch;
  gap: 6px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.watchlist-chart {
  position: relative;
  isolation: isolate;
  display: grid;
  min-width: 0;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  grid-template-rows: minmax(0, 1fr);
  background: var(--watchlist-chart-background, var(--surface));
  outline: none;
  overflow: hidden;
}

.watchlist-chart:hover,
.watchlist-chart:focus-visible {
  border-color: var(--border-strong);
}

.watchlist-chart.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.watchlist-chart__overlay {
  position: absolute;
  z-index: 20;
  top: 5px;
  left: 5px;
  display: flex;
  max-width: calc(100% - 10px);
  min-width: 0;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  gap: 5px;
  pointer-events: none;
}

.watchlist-chart__timeframe {
  min-width: 52px;
  min-height: 24px;
  padding: 0 20px 0 6px;
  border: 1px solid var(--watchlist-chart-border, var(--border-strong));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--watchlist-chart-control, var(--surface-alt)) 94%, transparent);
  color: var(--watchlist-chart-text, var(--text));
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  pointer-events: auto;
}

.watchlist-chart__symbol {
  max-width: 170px;
  min-height: 24px;
  padding: 4px 6px;
  overflow: hidden;
  border: 1px solid var(--watchlist-chart-border, var(--border-strong));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--watchlist-chart-control, var(--surface-alt)) 94%, transparent);
  color: var(--watchlist-chart-text, var(--text));
  font-family: inherit;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  cursor: copy;
  pointer-events: auto;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-chart__symbol:hover,
.watchlist-chart__symbol:focus-visible {
  border-color: var(--accent);
}

.watchlist-chart__symbol.is-copied,
.watchlist-current-instrument.is-copied,
.watchlist-ticker.is-copied {
  color: var(--positive);
}

.watchlist-current-instrument {
  border: 0;
  background: transparent;
  text-align: left;
  cursor: copy;
}

.watchlist-current-instrument:disabled {
  cursor: default;
  opacity: 1;
}

.watchlist-chart__status {
  max-width: 112px;
  padding: 3px 5px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-alt) 90%, transparent);
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-chart[data-state="error"] .watchlist-chart__status {
  color: var(--negative);
}

.watchlist-chart.is-seconds[data-state="empty"] .watchlist-chart__overlay {
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  align-items: flex-start;
}

.watchlist-chart.is-seconds[data-state="empty"] .watchlist-chart__status {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - 32px);
  max-width: 250px;
  padding: 8px;
  transform: translate(-50%, -50%);
  background: transparent;
  color: var(--watchlist-chart-text, var(--muted-strong));
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
}

.watchlist-chart[data-state="loading"]:not(.has-history) .watchlist-chart__canvas {
  visibility: hidden;
}

.watchlist-chart__canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 125px;
  overflow: hidden;
  zoom: var(--dashboard-page-zoom-inverse, 1);
  transform-origin: top left;
}

@supports not (zoom: 1) {
  .watchlist-chart__canvas {
    zoom: 1;
    transform: scale(var(--dashboard-page-zoom-inverse, 1));
  }
}

.watchlist-sidebar {
  display: grid;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  background: var(--surface);
  overflow: hidden;
}

.watchlist-sidebar__market {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.watchlist-sidebar__market .watchlist-market-control {
  display: grid;
  width: 100%;
  gap: 4px;
}

.watchlist-sidebar__market .watchlist-market-control select {
  width: 100%;
}

.watchlist-sidebar__header {
  display: flex;
  min-height: 42px;
  padding: 6px 8px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.watchlist-sidebar__header > div:first-child {
  display: grid;
  min-width: 0;
}

.watchlist-sidebar__header strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-sidebar__header span {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-sidebar__header .watchlist-market-count {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 9px;
}

.watchlist-search {
  padding: 6px 7px;
  border-bottom: 1px solid var(--border);
}

.watchlist-search input {
  width: 100%;
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-family: var(--font-mono);
  font-size: 10px;
}

.watchlist-ticker-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.watchlist-ticker {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 31px;
  padding: 0 9px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  background: transparent;
  color: var(--muted-strong);
  text-align: left;
  gap: 8px;
}

.watchlist-ticker:hover,
.watchlist-ticker:focus-visible {
  background: var(--surface-hover);
  color: var(--text);
}

.watchlist-ticker.is-open {
  color: var(--text);
}

.watchlist-ticker.is-open::before {
  position: absolute;
  left: 0;
  width: 2px;
  height: 20px;
  border-radius: 0 2px 2px 0;
  background: var(--positive);
  content: "";
}

.watchlist-ticker.is-active {
  background: var(--accent-soft);
}

.watchlist-ticker__symbol {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-empty,
.watchlist-loading {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
}

.watchlist-empty {
  padding: 24px 12px;
}

.watchlist-loading {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  transform: translate(-50%, -50%);
}

.watchlist-retry {
  position: absolute;
  z-index: 5;
  top: calc(50% + 42px);
  left: 50%;
  min-height: 32px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateX(-50%);
}

@media (max-width: 1200px) {
  .watchlist-current-instrument {
    max-width: 34%;
  }

  .watchlist-controls:has(#watchlist-sort:not([hidden])) { padding-right: 6px; flex-wrap: wrap; }
  .watchlist-controls:has(#watchlist-sort:not([hidden])) .watchlist-view-actions { flex: 1 1 100%; flex-wrap: wrap; }
  body:has(#dashboard-toolbar-panel:not([hidden])) .watchlist-controls:has(#watchlist-sort:not([hidden])) { padding-top: 46px; }
  .watchlist-sort > summary { white-space: nowrap; }
}

@media (max-width: 760px) {
  .watchlist-dashboard {
    padding: 5px;
  }

  .watchlist-controls {
    padding-right: 6px;
    flex-wrap: wrap;
  }

  .watchlist-mode-switch {
    order: 1;
  }

  .watchlist-current-instrument {
    order: 3;
    width: 100%;
    max-width: none;
  }

  .watchlist-view-actions {
    order: 2;
  }

  .watchlist-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(320px, 1fr) 285px;
    overflow-y: auto;
  }

  .watchlist-sidebar-resizer {
    display: none;
  }

  .watchlist-main {
    min-height: 320px;
  }

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

  .watchlist-sidebar {
    min-height: 285px;
  }
}

@media (max-width: 430px) {
  .watchlist-workspace.is-seconds .watchlist-mode-switch {
    width: calc(100% - 30px);
    margin-right: 30px;
  }

  .watchlist-mode-switch {
    width: 100%;
  }

  .watchlist-mode-switch button {
    flex: 1 1 50%;
  }

  .watchlist-view-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .watchlist-current-instrument {
    font-size: 9px;
  }

  .watchlist-layout__menu {
    right: -2px;
  }

  .watchlist-chart {
    min-height: 285px;
  }

  .watchlist-grid {
    grid-auto-rows: minmax(285px, 1fr);
  }
}
