.error-message {
  color: #ff4d4f;
  margin-top: 3px;
  font-size: 12px;
}

.highlighted {
  background-color: #3a3a3a;
}

.input {
  padding: 4px;
  border-radius: 4px;
  background-color: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
  width: 50%;
}

.trade-panel-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  user-select: none;
  -webkit-user-select: none;
}

.trade-panel-bar input,
.trade-panel-bar textarea {
  user-select: text;
  -webkit-user-select: text;
}

.chart-button-container {
  display: flex;
  gap: 4px;
}

/* Seconds menu styling */
.seconds-button-container {
  position: relative;
  display: inline-block;
}

.seconds-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  z-index: 10;
  margin-bottom: 2px;
  box-shadow: 0 2px 8px var(--shadow);
  user-select: none;
}

.seconds-menu .chart-button {
  width: 100%;
  text-align: center;
  margin: 1px 0;
  border: none;
  border-radius: 2px;
}

.seconds-menu .chart-button:hover {
  background-color: rgba(180, 180, 249, 0.1);
  border-color: rgba(180, 180, 249, 0.25);
}

.seconds-menu .chart-button.selected {
  background-color: rgba(180, 180, 249, 0.15);
  border-color: rgba(180, 180, 249, 0.3);
}

.chart-button-container {
  display: flex;
  gap: 4px;
}

.chart-button {
  display: inline-block;
  cursor: pointer;
  background-color: var(--bg-deep);
  border: 1px solid rgba(180, 180, 249, 0.15);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 26px;
  font-family: 'Inter';
  font-weight: 500;
  font-size: 0.9em;
  padding: 0 4px;
  transition: all 0.2s ease;
  user-select: none;
}

.chart-button.selected {
  background-color: rgba(180, 180, 249, 0.15);
  border-color: rgba(180, 180, 249, 0.3);
  color: var(--text);
  font-weight: 500;
}

.chart-button:hover {
  background-color: rgba(180, 180, 249, 0.1);
  border-color: rgba(180, 180, 249, 0.25);
  color: var(--text);
}

.chart-button-icon {
  height: 1em;
  width: 1em;
  vertical-align: middle;
  display: inline-block;
}

.star-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 0 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.star-button img {
  width: 14px;
  height: 14px;
}

.star-button:hover {
  transform: scale(1.1);
}

.star-button:active {
  transform: scale(0.95);
}

.symbol-search-wrapper {
  /* Symbols are <=10 chars incl. prefixes (xyz:, O:) - no need to hog the
     bar; freed width keeps trade buttons + quote readout on one row */
  flex: 0 1 130px;
  min-width: 90px;
  max-width: 150px;
  margin: 0 8px;
}

.chart-indicators-container {
  position: relative;
  display: inline-block;
  user-select: none;
}

/* ── Shared chart popup styles (indicators, drawing tools, settings) ── */
.chart-popup {
  z-index: 10000;
  min-width: 150px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  background: var(--bg-deep);
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px #000a;
  margin-bottom: 6px;
  user-select: none;
  color: var(--text);
}

.chart-popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
  min-height: 26px;
  padding: 1px 4px;
  border-radius: 4px;
  cursor: default;
}

.chart-popup-row:last-child {
  margin-bottom: 0;
}

.chart-popup-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.chart-popup-row span {
  white-space: nowrap;
}

/* ── Indicator-specific ── */
.indicator-input {
  width: 32px;
  font-size: 12px;
  padding: 2px 3px;
  border-radius: 3px;
  border: 1px solid var(--border-light);
  background: var(--bg-alt);
  color: var(--text);
  text-align: center;
  margin-left: auto;
}

.indicator-plus {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 3px;
  transition:
    color 0.15s,
    background 0.15s;
  min-width: 20px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.indicator-plus:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}
.indicator-plus:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Drawing tool button ── */
.chart-popup-tool-btn {
  background: var(--bg-button);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    border-color 0.15s;
  min-width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.chart-popup-tool-btn:hover {
  background: var(--scrollbar);
  border-color: #777;
}

.chart-popup-tool-btn.selected {
  background: #007acc;
  border-color: #0098ff;
}

.chart-popup-tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Settings toggle ── */
.chart-settings-toggle {
  width: 28px;
  height: 14px;
  border-radius: 7px;
  background: var(--border-light);
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.chart-settings-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.chart-settings-toggle.active {
  background: #007acc;
}

.chart-settings-toggle.active::after {
  transform: translateX(14px);
  background: #fff;
}

/* Legacy aliases so existing class names still resolve */

/* ── Option quick-buy shortcuts under the stock buttons (opt-in) ────────
   Compact variant of the feed's OptionBuyButton pair: shorter, tighter
   type, capped width so the size buttons don't become empty planks. */
.trade-panel-opt-shortcuts {
  display: flex;
  /* Mirror the stock buttons' spacing scheme (margin-right 5px on every
     button incl. the last) so pair edges land EXACTLY on the buy/sell
     seam and the 250K right border. gap would drift 2-5px. */
  gap: 0;
  padding: 3px 0 2px;
  align-items: center;
}

.trade-panel-opt-shortcut {
  flex: 1 1 0;
  min-width: 0;
  margin-right: 5px;
}

.trade-panel-opt-shortcut .option-info-btn,
.trade-panel-opt-shortcut .option-size-btn {
  height: 26px !important;
  padding-top: 1px;
  padding-bottom: 1px;
}

.trade-panel-opt-shortcut .option-text {
  gap: 0;
}

.trade-panel-opt-shortcut .option-strike {
  font-size: 10.5px;
  line-height: 1.15;
}

.trade-panel-opt-shortcut .option-price {
  font-size: 9px;
  line-height: 1.1;
}

.trade-panel-opt-shortcut .option-size {
  font-size: 10px;
}

/* Keep the symbol input its natural height when the bar grows a second
   row (option shortcuts) - stretching it to both rows looks goofy */
.trade-panel-bar .symbol-search-wrapper input {
  height: 32px !important;
}

/* Options-chain shortcut under the symbol search (second bar row) */
.trade-panel-chain-btn {
  height: 26px;
  margin: 3px 8px 0;
  background: var(--bg-button);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.trade-panel-chain-btn:hover {
  background: var(--scrollbar);
  border-color: #777;
}

/* Left column of the trade bar: search on top, chain shortcut below.
   Inside a COLUMN the search wrapper's row flex-basis (130px) would
   become HEIGHT - neutralize it here. */
.trade-panel-left-col {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 146px;
}

.trade-panel-left-col .symbol-search-wrapper {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
}

/* The pair's LAST button carries option-button.css's trailing 5px margin,
   leaving the visible edge 5px shy of the pair box (and the stock button
   seam). The wrapper supplies inter-pair spacing - kill the inner one. */
.trade-panel-opt-shortcut .option-size-btn {
  margin-right: 0;
}
