/* ---------- Watchlist panel ---------- */

.watchlist-toggle-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.watchlist-panel {
  width: 220px;
  flex-shrink: 0;
  background: #111318;
  border-left: 1px solid #1e2330;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.22s ease, opacity 0.18s ease, border-color 0.22s ease;
}

.chart-page-shell.watchlist-collapsed .watchlist-panel {
  width: 0;
  opacity: 0;
  border-left-color: transparent;
  pointer-events: none;
}

.wl-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px;
  white-space: nowrap;
}

.wl-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13.5px;
}

.wl-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wl-list-select-wrap select {
  padding: 5px 24px 5px 10px;
  font-size: 11px;
  max-width: 100px;
}

.icon-btn-sm {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.icon-btn-sm:hover {
  border-color: var(--text-faint);
  color: var(--text);
}

/* ---------- Tabs ---------- */

.wl-tabs {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 10px;
  overflow-x: auto;
  white-space: nowrap;
}

.wl-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wl-tab:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

.wl-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.wl-tab-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
}

.wl-tab.renaming {
  padding: 0;
  background: none;
  border: none;
}

.wl-tab-rename-input {
  width: 88px;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 999px;
  outline: none;
}

/* ---------- Add symbol ---------- */

.wl-toolbar {
  flex-shrink: 0;
  padding: 0 12px 10px;
  position: relative;
}

.wl-add-search {
  margin-top: 8px;
  position: relative;
}

.wl-add-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  outline: none;
}

.wl-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  z-index: 40;
}

.wl-suggestions.open {
  display: block;
}

.wl-suggestion {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  cursor: pointer;
}

.wl-suggestion:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ---------- Rows ---------- */

.wl-rows {
  flex: 1;
  overflow-y: auto;
  padding: 2px 6px 10px;
}

.wl-empty {
  padding: 16px 10px;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
}

.wl-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.wl-row:hover {
  background: var(--surface);
}

.wl-row.active {
  background: var(--accent-dim);
}

.wl-row-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.wl-symbol {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text);
}

.wl-row.active .wl-symbol {
  color: var(--accent);
}

.wl-badge {
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}

.wl-badge-pm {
  background: var(--amber-dim);
  color: var(--amber);
}

.wl-badge-am {
  background: var(--purple-dim);
  color: var(--purple);
}

.wl-row-quote {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.wl-price {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

.wl-change {
  font-size: 10px;
  font-weight: 600;
}

.wl-change.up {
  color: var(--accent);
}

.wl-change.down {
  color: var(--red);
}

.wl-remove-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
}

.wl-row:hover .wl-remove-btn {
  display: flex;
}

.wl-row:hover .wl-row-quote {
  margin-right: 22px;
}

/* ---------- Context menu ---------- */

.wl-context-menu {
  position: fixed;
  z-index: 200;
  min-width: 190px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 6px;
  display: none;
}

.wl-context-menu.visible {
  display: block;
}

.wl-context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.wl-context-menu button:hover {
  background: var(--surface);
}

.wl-context-menu button.danger {
  color: var(--red);
}

.wl-context-menu button.danger:hover {
  background: var(--red-dim);
}

.wl-context-submenu {
  display: none;
  margin: 2px 0 2px 10px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.wl-context-submenu.open {
  display: block;
}

.wl-context-empty {
  display: block;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-faint);
}
