:root {
  color-scheme: light;
  --bg: #f2f5f9;
  --panel: #ffffff;
  --field: #ffffff;
  --subpanel: #f7f9fc;
  --elevated: #ffffff;
  --text: #172033;
  --muted: #687386;
  --line: #d8e0eb;
  --line-strong: #c8d2df;
  --accent: #8b7cf6;
  --accent-text: #6b5bd6;
  --accent-soft: #f4f2ff;
  --active-row: #f8f6ff;
  --up: #c2410c;
  --down: #0f766e;
  --warn: #d97706;
  --shadow: 0 12px 30px rgba(20, 30, 50, .08);
  --shadow-soft: 0 1px 2px rgba(20, 30, 50, .06);
}

body.dark {
  color-scheme: dark;
  --bg: #181c22;
  --panel: #222832;
  --field: #1a2029;
  --subpanel: #28303b;
  --elevated: #202731;
  --text: #eef2f7;
  --muted: #a2adbc;
  --line: #3a4656;
  --line-strong: #4a586a;
  --accent: #b8a8ff;
  --accent-text: #e8e2ff;
  --accent-soft: #342f49;
  --active-row: #302c43;
  --up: #f97362;
  --down: #34d399;
  --warn: #fbbf24;
  --shadow: 0 14px 34px rgba(0, 0, 0, .28);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .2);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: .62;
}

header {
  flex: 0 0 auto;
  min-height: 104px;
  padding: 10px 22px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.hot-header-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hot-header-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hot-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

h2,
.control-panel h2,
.result-head h2,
.watch-head h2,
#result h2 {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 750;
}

button.theme-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--subpanel);
  color: var(--muted);
  box-shadow: none;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

button.theme-toggle:hover {
  background: var(--field);
  color: var(--text);
  border-color: var(--line-strong);
}

main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  overflow: hidden;
}

section {
  min-width: 0;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.control-block,
.result-panel,
.watch-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.control-block {
  padding: 9px 10px;
}

.control-block.compact {
  padding-bottom: 11px;
}

.section-head,
.result-head,
.watch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-head {
  margin-bottom: 6px;
}

.section-note,
label,
.status,
.cache-status,
.watch-count,
.watch-meta,
.result-tools,
.render-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

label {
  display: block;
  margin: 4px 0 4px;
}

textarea,
input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

textarea,
input {
  padding: 5px 7px;
}

select {
  padding: 0 28px 0 8px;
}

textarea {
  min-height: 52px;
  line-height: 1.35;
  resize: vertical;
}

input,
select {
  height: 28px;
  font-size: 11px;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.actions {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 6px;
  margin-top: 6px;
}

select.action-mode {
  height: 30px;
}

button:not(.strategy-toggle):not(.theme-toggle):not(.watch-toggle):not(.chart-settings-toggle):not(.hot-sector-item):not(.hot-popover-close) {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  padding: 0 9px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 20%, transparent);
  font-size: 11px;
  font-weight: 700;
}

button:not(.strategy-toggle):not(.theme-toggle):not(.watch-toggle):not(.chart-settings-toggle):not(.hot-sector-item):not(.hot-popover-close):hover {
  filter: brightness(1.04);
}

button.plain-button,
button.watch-delete {
  min-height: 26px !important;
  border: 1px solid var(--line) !important;
  padding: 0 8px !important;
  background: var(--field) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  font-weight: 650 !important;
}

button.plain-button:hover,
button.watch-delete:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line)) !important;
  background: var(--accent-soft) !important;
  color: var(--accent-text) !important;
  filter: none !important;
}

button.plain-button.active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line)) !important;
  background: var(--accent-soft) !important;
  color: var(--accent-text) !important;
}

.strategy-accordion {
  display: grid;
  gap: 6px;
}

.strategy-toggle {
  width: 100%;
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: var(--subpanel);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  font-weight: 750;
  text-align: left;
}

.strategy-toggle.active {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-text);
}

.strategy-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.strategy-toggle.active .strategy-status {
  color: var(--accent-text);
}

.strategy-panel[hidden] {
  display: none;
}

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

.rule {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 7px;
  background: var(--subpanel);
  box-shadow: var(--shadow-soft);
}

.rule:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.rule.simple {
  display: flex;
  align-items: center;
}

.rule.disabled {
  background: color-mix(in srgb, var(--subpanel) 78%, var(--line));
  box-shadow: none;
}

.rule.disabled .rule-title {
  color: var(--muted);
}

.rule.disabled input:not([type="checkbox"]),
.rule.disabled select {
  background: color-mix(in srgb, var(--field) 72%, var(--line));
  color: var(--muted);
}

.rule-title {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.rule.simple .rule-title {
  margin: 0;
}

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

.macd-row {
  grid-template-columns: minmax(0, 1fr) 44px;
}

.bias-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ma-stack-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.input-unit {
  position: relative;
}

.input-unit input {
  padding-right: 25px;
}

.input-unit span {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.status,
.cache-status {
  margin-top: 6px;
  line-height: 1.38;
}

.hot-sector-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: right;
}

.hot-sector-list {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.hot-sector-item {
  flex: 0 0 278px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--subpanel);
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.hot-sector-item:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
}

.hot-sector-item.noise {
  opacity: .72;
}

.hot-sector-top {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
}

.hot-sector-rank {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--field);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.hot-sector-top strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-sector-type {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--field);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.hot-sector-change {
  color: var(--up);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hot-sector-badges {
  margin-top: 5px;
  display: flex;
  gap: 4px;
  overflow: hidden;
}

.hot-sector-badges span {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 999px;
  padding: 1px 6px;
  background: var(--field);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.35;
}

.hot-sector-reason {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-sector-merged {
  margin-top: 3px;
  overflow: hidden;
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 720;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-empty {
  padding: 10px 0;
  font-size: 12px;
}

.hot-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, .16);
}

.hot-popover-backdrop[hidden] {
  display: none;
}

.hot-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 41;
  width: min(660px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 116px));
  transform: translate(-50%, -50%);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: var(--panel);
  box-shadow: 0 20px 50px rgba(20, 30, 50, .18);
}

.hot-popover.dragging,
.hot-popover[data-moved="1"] {
  transform: none;
}

.hot-popover[hidden] {
  display: none;
}

.hot-stocks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  cursor: move;
  font-size: 11px;
  user-select: none;
}

.hot-stocks-head strong {
  color: var(--text);
  font-size: 14px;
}

.hot-popover-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.hot-popover-status {
  padding: 18px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.hot-strength {
  margin: 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.hot-strength span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--field);
}

.hot-strength strong {
  color: var(--text);
}

.hot-stock-list {
  margin-top: 8px;
  display: grid;
  gap: 5px;
}

.hot-stock-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(120px, 1fr) 168px 64px 58px 76px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  background: var(--field);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.hot-stock-row-head {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.hot-stock-row strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-stock-row:not(.hot-stock-row-head) {
  cursor: pointer;
}

.hot-stock-row.core {
  border-color: color-mix(in srgb, var(--up) 28%, var(--line));
  background: color-mix(in srgb, var(--up) 5%, var(--field));
}

.hot-stock-row:not(.hot-stock-row-head):hover,
.hot-stock-row.active {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
}

.hot-stock-row b {
  font-variant-numeric: tabular-nums;
}

.hot-stock-row b.up {
  color: var(--up);
}

.hot-stock-row b.down {
  color: var(--down);
}

.hot-stock-row strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.core-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 1px 5px;
  background: color-mix(in srgb, var(--up) 12%, var(--field));
  color: var(--up);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}

.mini-chart {
  width: 160px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.mini-chart svg {
  width: 160px;
  height: 32px;
  display: block;
}

.hot-daily-block {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--field) 92%, var(--subpanel));
  overflow: hidden;
}

.hot-daily-block .inline-daily {
  padding: 10px;
}

.cache-status strong {
  color: var(--muted);
  font-weight: 650;
}

.cache-status.ok strong {
  color: var(--down);
}

.cache-status.error strong {
  color: var(--up);
}

.status-row {
  margin: 0 0 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subpanel);
  color: var(--muted);
  font-size: 12px;
}

.hot-group-summary {
  margin: 0 0 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subpanel);
  color: var(--muted);
  font-size: 12px;
}

.hot-group-summary strong {
  color: var(--text);
}

.hot-group-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--field);
}

.result-panel {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
}

.result-head {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

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

.result-tools[hidden] {
  display: none;
}

.result-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.result-tools select {
  width: auto;
  height: 30px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(8, minmax(92px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.market-line {
  grid-column: 1 / -1;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subpanel);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.market-line strong {
  color: var(--text);
  font-weight: 750;
}

.pill {
  min-height: 39px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.pill strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.12;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pill.time-pill strong {
  font-size: 12px;
  font-weight: 750;
}

.pill.important {
  border-color: color-mix(in srgb, var(--down) 34%, var(--line));
  background: color-mix(in srgb, var(--down) 8%, var(--field));
}

.pill.important strong {
  color: var(--down);
}

.progress-card {
  grid-column: 1 / -1;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  box-shadow: var(--shadow-soft);
}

.progress-top {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
}

.progress-stage {
  font-weight: 750;
  white-space: nowrap;
}

.progress-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.progress-track {
  height: 7px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--subpanel);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width .2s ease;
}

.progress-stats {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.progress-stats span {
  min-height: 24px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--subpanel);
  color: var(--muted);
  font-size: 12px;
}

.progress-stats strong {
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.progress-steps {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.progress-step {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--field);
  color: var(--muted);
  font-size: 12px;
}

.progress-step.done,
.progress-step.active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-text);
}

.progress-step.active {
  font-weight: 750;
}

.progress-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.result-layout {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 12px;
}

#result {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

#result.empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--subpanel);
  color: var(--muted);
  font-weight: 750;
}

#result h2 {
  margin: 11px 0 8px;
}

#result h2:first-child {
  margin-top: 0;
}

.result-section {
  margin-bottom: 12px;
}

.table-title {
  margin: 11px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.table-title h2 {
  margin: 0 !important;
}

.table-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.board-title {
  margin: 9px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.board-title::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
}

.board-title em {
  color: var(--muted);
  font-style: normal;
  font-weight: 650;
}

.table-wrap {
  width: 100%;
  margin-bottom: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
}

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--field);
  font-size: 13px;
}

th,
td {
  height: 33px;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--subpanel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

td {
  color: var(--text);
  font-size: 13px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

tr.stock-row {
  cursor: pointer;
}

tr.stock-row:hover {
  background: color-mix(in srgb, var(--subpanel) 76%, var(--field));
}

tr.stock-row.active {
  background: var(--active-row);
}

tr.stock-row.passed {
  background: color-mix(in srgb, var(--down) 5%, var(--field));
}

tr.stock-row.passed:hover,
tr.stock-row.passed.active {
  background: color-mix(in srgb, var(--down) 10%, var(--field));
}

td.num,
th.num {
  text-align: center;
}

.name-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.name-main {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.name-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hot-result-tags {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  line-height: 1;
}

.hot-result-tags:empty {
  display: none;
}

.hot-result-label,
.hot-result-extra {
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 760;
}

.hot-result-tag {
  max-width: 62px;
  display: inline-flex;
  align-items: center;
  min-height: 16px;
  padding: 1px 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--field));
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button.watch-toggle {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  line-height: 18px;
  transform: translateY(-1px);
}

button.watch-toggle svg {
  width: 15px;
  height: 15px;
  display: block;
}

button.watch-toggle .mark {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

button.watch-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

button.watch-toggle.active {
  background: transparent;
  color: var(--accent);
}

button.watch-toggle.active .mark {
  fill: currentColor;
}

.reason-row td,
.inline-daily-row td {
  height: auto;
  padding: 0;
  white-space: normal;
}

.reason-line {
  height: auto;
  min-height: 32px;
  padding: 7px 10px !important;
  background: color-mix(in srgb, var(--field) 86%, var(--subpanel));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.reason-content {
  min-height: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.reason-label {
  flex: 0 0 auto;
  color: var(--accent-text);
  font-weight: 750;
}

.reason-tags {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.reason-item {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  color: var(--muted);
  line-height: 1.25;
}

.render-status {
  margin: -2px 0 7px;
}

.empty {
  padding: 26px 0;
  color: var(--muted);
  text-align: center;
  font-weight: 650;
}

.watch-panel {
  align-self: start;
  min-width: 0;
  max-height: calc(100vh - 176px);
  padding: 10px;
  overflow: auto;
  background: var(--field);
}

.watch-head {
  margin-bottom: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

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

.watch-count {
  white-space: nowrap;
}

.watch-item {
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--subpanel);
}

.watch-item-main {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.watch-name {
  min-width: 0;
  color: var(--text);
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-meta {
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.watch-alert {
  margin-top: 5px;
  display: inline-flex;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--up) 26%, var(--line));
  border-radius: 999px;
  padding: 2px 7px;
  background: color-mix(in srgb, var(--up) 8%, var(--field));
  color: var(--up);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.watch-hot {
  margin-top: 5px;
  display: inline-flex;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-daily {
  padding: 12px 14px 14px;
  background: color-mix(in srgb, var(--field) 88%, var(--subpanel));
}

.daily-loading,
.daily-error {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.daily-error {
  justify-content: space-between;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
}

.inline-daily-head {
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.daily-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.inline-daily-head h3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 800;
}

button.chart-settings-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 21px;
  line-height: 1;
}

button.chart-settings-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.inline-daily-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.chart-settings {
  margin: 6px 0 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

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

.chart-settings label {
  margin: 0;
  font-size: 11px;
}

.chart-settings input {
  margin-top: 4px;
  height: 28px;
  font-size: 12px;
}

.chart-settings button {
  min-height: 28px !important;
}

.chart-legend {
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--muted);
  font-size: 11px;
}

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

.chart-legend i {
  width: 15px;
  height: 2px;
  display: inline-block;
  border-radius: 999px;
}

.chart-price-text {
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chart-shell {
  position: relative;
  width: 100%;
  cursor: crosshair;
  touch-action: pan-y;
}

.kline-chart {
  width: 100%;
  height: 370px;
  display: block;
  margin: 0;
  overflow: visible;
}

.chart-hover-zone {
  fill: transparent;
  pointer-events: all;
}

.chart-crosshair {
  pointer-events: none;
}

.chart-crosshair line {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: .75;
}

.chart-crosshair circle {
  fill: var(--field);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 188px;
  max-width: min(260px, calc(100vw - 28px));
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .16);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

body.dark .chart-tooltip {
  box-shadow: 0 14px 28px rgba(0, 0, 0, .35);
}

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

.chart-tip-title {
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.chart-tip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chart-tip-grid span {
  white-space: nowrap;
}

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

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