.react-grid-layout {
  position: relative;
  transition: height 200ms ease;
}
.react-grid-item {
  transition: all 200ms ease;
  transition-property: left, top, width, height;
}
.react-grid-item img {
  pointer-events: none;
  user-select: none;
}
.react-grid-item.cssTransforms {
  transition-property: transform, width, height;
}
.react-grid-item.resizing {
  transition: none;
  z-index: 1;
  will-change: width, height;
}

.react-grid-item.react-draggable-dragging {
  transition: none;
  z-index: 3;
  will-change: transform;
}

.react-grid-item.dropping {
  visibility: hidden;
}

.react-grid-item.react-grid-placeholder {
  background: red;
  opacity: 0.2;
  transition-duration: 100ms;
  z-index: 2;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;
}

.react-grid-item.react-grid-placeholder.placeholder-resizing {
  transition: none;
}

.react-grid-item > .react-resizable-handle {
  position: absolute;
  width: 20px;
  height: 20px;
}

.react-grid-item > .react-resizable-handle::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-right: 2px solid rgba(0, 0, 0, 0.4);
  border-bottom: 2px solid rgba(0, 0, 0, 0.4);
}

.react-resizable-hide > .react-resizable-handle {
  display: none;
}

.react-grid-item > .react-resizable-handle.react-resizable-handle-sw {
  bottom: 0;
  left: 0;
  cursor: sw-resize;
  transform: rotate(90deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-se {
  bottom: 0;
  right: 0;
  cursor: se-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-nw {
  top: 0;
  left: 0;
  cursor: nw-resize;
  transform: rotate(180deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-ne {
  top: 0;
  right: 0;
  cursor: ne-resize;
  transform: rotate(270deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-w,
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
  top: 50%;
  margin-top: -10px;
  cursor: ew-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-w {
  left: 0;
  transform: rotate(135deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
  right: 0;
  transform: rotate(315deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-n,
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  left: 50%;
  margin-left: -10px;
  cursor: ns-resize;
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-n {
  top: 0;
  transform: rotate(225deg);
}
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
  bottom: 0;
  transform: rotate(45deg);
}
.react-resizable {
  position: relative;
}
.react-resizable-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  background-repeat: no-repeat;
  background-origin: content-box;
  box-sizing: border-box;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+');
  background-position: bottom right;
  padding: 0 3px 3px 0;
}
.react-resizable-handle-sw {
  bottom: 0;
  left: 0;
  cursor: sw-resize;
  transform: rotate(90deg);
}
.react-resizable-handle-se {
  bottom: 0;
  right: 0;
  cursor: se-resize;
}
.react-resizable-handle-nw {
  top: 0;
  left: 0;
  cursor: nw-resize;
  transform: rotate(180deg);
}
.react-resizable-handle-ne {
  top: 0;
  right: 0;
  cursor: ne-resize;
  transform: rotate(270deg);
}
.react-resizable-handle-w,
.react-resizable-handle-e {
  top: 50%;
  margin-top: -10px;
  cursor: ew-resize;
}
.react-resizable-handle-w {
  left: 0;
  transform: rotate(135deg);
}
.react-resizable-handle-e {
  right: 0;
  transform: rotate(315deg);
}
.react-resizable-handle-n,
.react-resizable-handle-s {
  left: 50%;
  margin-left: -10px;
  cursor: ns-resize;
}
.react-resizable-handle-n {
  top: 0;
  transform: rotate(225deg);
}
.react-resizable-handle-s {
  bottom: 0;
  transform: rotate(45deg);
}.flow-container {
  padding: 5px;
  height: calc(100% - 30px);
  overflow-y: auto;
  border-radius: 5px;
  white-space: pre-wrap;
}

.flow-item {
  padding: 5px 0;
  margin-bottom: 3px;
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flow-item:hover {
  background-color: var(--bg-hover) !important;
  color: var(--text);
}

.flow-item-left {
  display: flex;
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50px;
  cursor: pointer;
}

.flow-item-left-color {
  width: 5px;
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
}

.flow-item-content {
  padding-left: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.flow-item-time,
.flow-item-stock-price,
.flow-item-strike,
.flow-item-expiration,
.flow-item-stock {
  flex: 0.75;
}

.flow-item-stock {
  font-weight: bold;
}

.flow-item-tag {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.flow-item-tag span {
  margin-right: 8px;
  font-weight: bold;
  font-size: 12px;
  font-family: "Fira Code", monospace;
  display: inline-block;
  text-align: right;
}

.flow-item-tag span:last-child {
  margin-left: 8px;
  width: 40px;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
}
/* Watchlist Panel Styles */
.watchlist-panel {
  padding: 4px 6px 6px 6px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  font-family: 'Quantico', monospace;
  user-select: none;
}

.watchlist-panel * {
  font-family: inherit;
}

/* Title Bar */
.watchlist-title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  min-width: 0;
  flex-wrap: wrap;
}

.watchlist-dropdown-container {
  position: relative;
}

.watchlist-dropdown-button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.watchlist-dropdown-button:hover {
  background-color: var(--bg-alt);
}

/* Scanner Dropdown Styles */
.scanner-dropdown-container {
  position: relative;
}

/* Consolidated Button Styles */
.watchlist-button {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.watchlist-button:hover {
  background: var(--bg-hover);
}

/* Special button variants */
.watchlist-button--sort {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  min-width: 32px;
  transition: all 0.2s ease;
}

.watchlist-button--sort:hover {
  color: var(--text);
}

.watchlist-button--sort.active {
  background: #4a5568;
  color: var(--text);
  border-color: #718096;
}

.watchlist-button--action {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 1px 2px;
  font-size: 10px;
  transition:
    color 0.2s,
    transform 0.2s;
  border-radius: 1px;
}

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

.watchlist-button--edit:hover {
  color: var(--profit);
}

.watchlist-button--delete:hover {
  color: #ff5c5c;
}

.watchlist-button--remove {
  color: var(--text-muted);
  background: none;
  border: none;
  font-size: 14px;
  padding: 0 2px;
  width: 20px;
  text-align: center;
  transition:
    color 0.2s,
    transform 0.2s;
}

.watchlist-button--remove:hover {
  color: #ff5c5c;
  transform: scale(1.1);
}

.scanner-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 4px;
  z-index: 1000;
  min-width: 120px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scanner-dropdown-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  padding: 4px 8px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.scanner-dropdown-item:hover {
  background-color: var(--bg-hover);
}

.watchlist-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 4px;
  z-index: 1000;
  min-width: 180px;
  max-width: 250px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.watchlist-dropdown-header {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.watchlist-search-input {
  flex: 1;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border-light);
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 12px;
  min-width: 0;
}

.watchlist-search-input:focus {
  outline: none;
  border-color: var(--text);
}

.watchlist-items-container {
  max-height: 60vh;
  overflow-y: auto;
}

.watchlist-no-results {
  padding: 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

.watchlist-item {
  padding: 2px 3px;
  cursor: pointer;
  background: transparent;
  border-radius: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
  font-size: 12px;
  margin-bottom: 1px;
}

.watchlist-item:hover,
.watchlist-item.active {
  background-color: var(--bg-hover);
}

.watchlist-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.watchlist-basket-change {
  font-size: 10px;
  font-weight: 400;
  padding: 1px 4px;
  border-radius: 2px;
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
}

.watchlist-name-text {
  font-weight: 400;
}

.watchlist-matching-symbols {
  color: #6c6c6c;
  font-size: 10px;
  font-weight: 400;
  margin-left: 2px;
  opacity: 0.9;
}

.watchlist-basket-change.positive {
  color: var(--profit);
  background-color: rgba(0, 255, 136, 0.1);
}

.watchlist-basket-change.negative {
  color: #ff5c5c;
  background-color: rgba(255, 92, 92, 0.1);
}

.watchlist-basket-change.neutral {
  color: var(--text-muted);
  background-color: rgba(136, 136, 136, 0.1);
}

.watchlist-item-actions {
  display: flex;
  gap: 1px;
  margin-left: 4px;
  flex-shrink: 0;
}

.watchlist-name-input {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border-light);
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  width: 100px;
  min-width: 0;
}

/* Watchlist Table */
.watchlist-table-container {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.watchlist-table th,
.watchlist-table td {
  padding: 4px 8px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  box-sizing: border-box;
}

.watchlist-table th {
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

/* Sort Icon Styles */
.sort-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  position: relative;
}

.sort-neutral::before,
.sort-neutral::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
}

.sort-neutral::before {
  top: 1px;
  border-bottom: 3px solid var(--text);
}

.sort-neutral::after {
  bottom: 1px;
  border-top: 3px solid var(--text);
}

.sort-asc::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid var(--text);
}

.sort-desc::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--text);
}

.watchlist-table th.sortable {
  min-width: 80px;
}

.watchlist-table tbody tr {
  border-bottom: 1px solid var(--bg-alt);
  transition: background-color 0.2s ease;
}

.watchlist-table tbody tr:hover {
  background-color: var(--bg-alt);
}

.watchlist-row-selected {
  background-color: #2d3748 !important;
  /* border-left: 3px solid #4a9eff !important; */
  /* box-shadow: inset 0 0 0 1px #4a9eff !important; */
  position: relative;
}

.watchlist-row-selected:hover {
  background-color: #2d3748 !important;
}

.watchlist-symbol-cell {
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: left;
}

.watchlist-symbol-cell:hover {
  color: var(--text-dim);
}

.watchlist-price-cell,
.watchlist-volume-cell,
.watchlist-volumenotional-cell,
.watchlist-change-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.watchlist-change-positive {
  color: var(--profit);
}

.watchlist-change-negative {
  color: #ff5c5c;
}

.watchlist-change-neutral {
  color: var(--text);
}

/* Add specific width for the remove button column */
.watchlist-table th:last-child,
.watchlist-table td:last-child {
  width: 24px;
  min-width: 24px;
  max-width: 24px;
  padding: 4px 2px;
  text-align: center;
}

.watchlist-edit-input {
  width: 80px;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border-light);
  padding: 2px 4px;
  border-radius: 2px;
}

.watchlist-add-row {
  color: var(--text-muted);
}

/* Empty State Styles */
.watchlist-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  color: var(--text-muted);
}

.watchlist-empty-message {
  text-align: center;
  max-width: 300px;
}

.watchlist-empty-message h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.watchlist-empty-message p {
  margin: 0 0 16px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}

/* Ticker Description Tooltip */
.ticker-description-tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.4;
  max-width: 300px;
  min-width: 200px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  white-space: normal;
  word-wrap: break-word;
  margin-top: 4px;
  opacity: 0;
  animation: fadeInTooltip 0.2s ease-in-out forwards;
}

.ticker-description-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 8px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--bg-alt);
}

@keyframes fadeInTooltip {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Watchlist Settings Modal Styles */
/* Locate Panel Styles - Following standard design patterns */
.locate-panel-main {
  background-color: var(--bg-base);
  color: var(--text);
  padding: 4px;
  font-family: 'Quantico', sans-serif;
  height: 100%;
  user-select: none;
  overflow: auto;
  font-size: 12px;
}

/* Footer with status info */
.locate-footer {
  margin-top: 4px;
  padding: 4px 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.locate-status-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.locate-messages {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* Connection Status Bar - deprecated, keeping for compatibility */

/* Status Notifications Section */

.locate-connection-status {
  font-weight: 500;
  font-size: 11px;
}

/* Refresh Button */
.locate-refresh-button {
  background: var(--scrollbar);
  color: var(--text);
  border: 1px solid #666;
  padding: 2px 6px;
  font-size: 10px;
  cursor: pointer;
  margin-left: 8px;
}

.locate-refresh-button:hover:not(:disabled) {
  background: var(--border-light);
}

.locate-refresh-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Order ID */

/* Actions Column */
.locate-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  white-space: nowrap;
}

.locate-action-button {
  background: var(--scrollbar);
  color: var(--text);
  border: 1px solid #666;
  padding: 1px 4px;
  font-size: 9px;
  cursor: pointer;
  min-width: 50px;
}

.locate-action-button:hover:not(:disabled) {
  background: var(--border-light);
}

.locate-action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.locate-action-button--accept {
  background: #4ade80;
  border-color: #22c55e;
}

.locate-action-button--accept:hover:not(:disabled) {
  background: #22c55e;
}

.locate-action-button--reject {
  background: #f87171;
  border-color: #ef4444;
}

.locate-action-button--reject:hover:not(:disabled) {
  background: #ef4444;
}

.locate-status-text {
  font-size: 10px;
  color: var(--text-dim);
  font-style: italic;
}

/* Enhanced Status Text Styles */
.locate-status-text--pending {
  color: #fbbf24;
  font-weight: 500;
}

.locate-status-text--submitted {
  color: #60a5fa;
  font-weight: 500;
}

.locate-status-text--accepted {
  color: #22c55e;
  font-weight: 600;
  background: #064e3b;
  padding: 1px 4px;
  border: 1px solid #059669;
}

.locate-status-text--available {
  color: #10b981;
  font-weight: 600;
  background: #064e3b;
  padding: 1px 4px;
  border: 1px solid #059669;
}

.locate-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 10px;
}

/* Section Headers */

/* Price Inquiry Section */
.locate-inquiry-section {
  margin-bottom: 6px;
}

.locate-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.locate-input-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 60px;
}

.locate-input-group label {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.locate-input {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 2px 4px;
  font-size: 10px;
  font-family: 'Quantico', monospace;
  width: 100%;
  min-width: 50px;
  outline: none;
  transition: border-color 0.15s ease;
}

.locate-input:focus {
  border-color: var(--accent);
}

.locate-input::placeholder {
  color: var(--text-muted);
}

.locate-select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 2px 4px;
  font-size: 10px;
  font-family: 'Quantico', monospace;
  width: 100%;
  min-width: 60px;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.15s ease;
}

.locate-select:focus {
  border-color: var(--accent);
}

.locate-button-group {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.locate-button {
  background: var(--bg-button);
  color: var(--text);
  border: 1px solid #1e1e1e;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'Quantico', monospace;
  min-width: 60px;
}

.locate-button:hover:not(:disabled) {
  background: var(--scrollbar);
}

.locate-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.locate-button--inquire {
  background: var(--accent);
  border-color: var(--accent);
}

.locate-button--inquire:hover:not(:disabled) {
  background: #0070cc;
  border-color: #0070cc;
}

/* Inquiry Result */
.locate-inquiry-result {
  background: #00ff88;
  color: #000;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Quantico', monospace;
  margin-top: 2px;
  display: inline-block;
}

/* Account Section */

/* Action Buttons */

/* Batch Section */

/* Unified Locate Section */
.locate-unified-section {
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  margin-bottom: 4px;
  padding: 4px;
  min-height: 150px;
}

/* Locate Requests Table */

.locate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  table-layout: fixed;
  background: var(--bg-base);
}

/* Column widths - more balanced layout */
.locate-table th:nth-child(1),
.locate-table td:nth-child(1) {
  width: 12%;
} /* Symbol */
.locate-table th:nth-child(2),
.locate-table td:nth-child(2) {
  width: 8%;
} /* Qty */
.locate-table th:nth-child(3),
.locate-table td:nth-child(3) {
  width: 8%;
} /* Located */
.locate-table th:nth-child(4),
.locate-table td:nth-child(4) {
  width: 10%;
} /* Cost */
.locate-table th:nth-child(5),
.locate-table td:nth-child(5) {
  width: 8%;
} /* MPID */
.locate-table th:nth-child(6),
.locate-table td:nth-child(6) {
  width: 20%;
} /* Status */
.locate-table th:nth-child(7),
.locate-table td:nth-child(7) {
  width: 12%;
} /* Time */

.locate-table th {
  background: var(--bg-base);
  color: var(--text);
  font-size: 8px;
  font-weight: 600;
  padding: 2px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
  letter-spacing: 0.1px;
  text-transform: uppercase;
}

.locate-table td {
  color: var(--text);
  font-size: 9px;
  padding: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: 'Quantico', monospace;
  white-space: nowrap;
}

.locate-table td.locate-actions {
  overflow: visible;
}

.locate-table-row:hover {
  background-color: var(--bg-alt);
  transition: background-color 0.1s;
}

.locate-symbol-cell {
  font-weight: 600;
  color: #64b5f6;
}

/* Compact Mode Styles */
.locate-panel-main.compact .locate-table th,
.locate-panel-main.compact .locate-table td {
  padding: 2px 4px;
  font-size: 9px;
}

.locate-panel-main.compact .locate-input {
  padding: 2px 16px 2px 4px;
  font-size: 10px;
}

.locate-panel-main.compact .locate-select {
  padding: 2px 16px 2px 4px;
  font-size: 10px;
}

.locate-panel-main.compact .locate-button {
  padding: 2px 6px;
  font-size: 10px;
}

.locate-panel-main.compact .locate-action-button {
  padding: 2px 6px;
  font-size: 10px;
}

/* Scrollbar Styling */
body {
  margin: 0;
  font-family: 'Inter', monospace;
}

.logs-container {
  gap: 4px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-base);
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: auto;
}

.logs-log {
  padding: 8px;
  max-width: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

.logs-log::after {
  content: '';
  display: block;
  height: 16px;
  flex-shrink: 0;
}

.logs-log > .out {
  color: var(--text-dim);
}

.logs-log > .error {
  color: #f44336;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
  min-height: 1.2em;
  width: 100%;
}

.log-timestamp {
  color: #279e06;
  white-space: nowrap;
  font-family: 'Fira Code', monospace;
  flex-shrink: 0;
  margin-right: 8px;
}

.logs-log-message {
  color: var(--text-dim);
  word-wrap: break-word;
  white-space: pre-wrap;
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.log-entry.error .logs-log-message {
  color: #f44336;
}

.log-entry.error .log-timestamp {
  color: #ff6b6b;
}

.logs-log::-webkit-scrollbar {
  width: 8px;
  background: var(--bg-base);
}

.logs-log::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 8px;
}

.logs-log::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

.scroll-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(25, 25, 25, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 0;
  display: flex;
  justify-content: center;
  backdrop-filter: blur(8px);
  z-index: 10;
  pointer-events: all;
}

.scroll-to-bottom-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 2px;
  padding: 2px 8px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'Fira Code', monospace;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.scroll-to-bottom-btn:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.scroll-to-bottom-btn:active {
  color: var(--text-dim);
}
.symbol-search-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.symbol-search-input {
  padding: 6px 8px;
  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: 100%;
  height: 100%;
  transition: border-color 0.2s ease;
}

.symbol-search-input:focus {
  border-color: #4a9eff;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.symbol-search-input::placeholder {
  color: var(--text-muted);
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 400px;
  max-height: 400px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  user-select: none;
}

.suggestions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: 'Quantico', monospace;
}

.suggestions-table th,
.suggestions-table td {
  padding: 2px 6px;
  text-align: left;
  border-bottom: 1px solid var(--bg-alt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestions-table th {
  background: var(--bg-alt);
  color: var(--text);
  position: sticky;
  top: 0;
  font-weight: 600;
  font-size: 10px;
  font-family: 'Quantico', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: 22px;
  cursor: pointer;
}

.suggestions-table tr {
  height: 28px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.suggestions-table tr:hover,
.suggestions-table tr.highlighted {
  background: var(--bg-alt);
}

.suggestions-table td:first-child {
  font-weight: 600;
  color: var(--text);
  font-family: 'Quantico', monospace;
  font-size: 12px;
}

.suggestions-table td:nth-child(2) {
  max-width: 140px;
  font-size: 11px;
  font-family: 'Quantico', monospace;
}

.suggestions-table td:nth-child(3) {
  text-align: right;
  font-family: 'Quantico', monospace;
  color: #bdbdbd;
  font-weight: 700;
  font-size: 12px;
}

.no-suggestions {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-family: 'Quantico', monospace;
  padding: 8px;
}

/* Scrollbar */
.suggestions-dropdown::-webkit-scrollbar {
  width: 8px;
}

.suggestions-dropdown::-webkit-scrollbar-track {
  background: var(--bg-base);
}

.suggestions-dropdown::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 4px;
}

.suggestions-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Sort indicators */
.suggestions-table th::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.3;
}

.suggestions-table th:hover::after {
  opacity: 0.6;
}

/* Loading state */
.suggestions-dropdown.loading {
  opacity: 0.7;
}

.suggestions-dropdown.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid #333;
  border-top: 2px solid #4a9eff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .suggestions-dropdown {
    width: 100vw;
    left: 0;
    right: 0;
  }
}

@media (max-width: 900px) {
  .suggestions-dropdown {
    width: 98vw;
  }
}
.options-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 4px;
  gap: 4px;
  font-family: 'Quantico', sans-serif;
  user-select: none;
}

.options-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  flex-shrink: 0;
}

/* Trade Panel */
.options-trade-panel-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0;
  flex-shrink: 0;
}

.options-trade-panel {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  flex: 0 0 auto;
  min-width: 210px;
  max-width: 350px;
  width: 210px;
  display: flex;
  flex-direction: column;
}

.options-trade-panel-chart {
  flex: 1 1 200px;
  min-width: 150px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  min-height: 300px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.options-trade-panel-chart > * {
  flex: 1;
  min-height: 0;
}

.options-trade-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.options-trade-panel-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.options-trade-panel-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.options-trade-panel-close:hover {
  color: var(--text);
}

.options-trade-panel-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.options-trade-panel-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.options-trade-panel-contract {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  font-family: 'Fira Code', monospace;
}

.options-trade-panel-prices {
  display: flex;
  flex-direction: column;
  font-size: 10px;
}

.options-trade-panel-price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.options-trade-panel-price-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
}

.options-trade-panel-price-value {
  color: var(--text);
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  font-size: 11px;
}

.options-trade-panel-price-value.clickable {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 2px;
  transition: all 0.2s;
}

.options-trade-panel-price-value.clickable:hover {
  background: rgba(100, 100, 255, 0.2);
  color: var(--accent);
}

.options-trade-panel-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.options-trade-panel-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.options-trade-panel-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
}

.options-trade-panel-select,
.options-trade-panel-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  outline: none;
  transition: all 0.2s;
}

.options-trade-panel-select {
  cursor: pointer;
}

.options-trade-panel-select option {
  background: var(--bg-input);
  color: var(--text);
}

.options-trade-panel-select:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.options-trade-panel-select:focus,
.options-trade-panel-input:focus {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.options-trade-panel-input::placeholder {
  color: var(--text-muted);
}

.options-trade-panel-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.options-trade-panel-buy,
.options-trade-panel-sell {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Quantico', sans-serif;
}

.options-trade-panel-buy {
  background: rgba(100, 200, 100, 0.2);
  color: var(--profit);
  border: 1px solid rgba(100, 200, 100, 0.4);
}

.options-trade-panel-buy:hover {
  background: rgba(100, 200, 100, 0.3);
  border-color: rgba(100, 200, 100, 0.6);
}

.options-trade-panel-sell {
  background: rgba(200, 100, 100, 0.2);
  color: var(--loss);
  border: 1px solid rgba(200, 100, 100, 0.4);
}

.options-trade-panel-sell:hover {
  background: rgba(200, 100, 100, 0.3);
  border-color: rgba(200, 100, 100, 0.6);
}

/* Expiration Tabs */
.expiration-tabs-container {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.expiration-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) var(--bg-base);
  padding-bottom: 8px;
}

.expiration-tabs::-webkit-scrollbar {
  height: 8px;
}

.expiration-tabs::-webkit-scrollbar-track {
  background: var(--bg-alt);
  border-radius: 4px;
}

.expiration-tabs::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 4px;
}

.expiration-tabs::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

.expiration-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 90px;
  user-select: none;
}

.expiration-tab:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.expiration-tab.active {
  background: rgba(100, 100, 255, 0.2);
  border-color: var(--accent);
}

.expiration-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.expiration-days {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Controls Bar */
.options-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.options-controls-left {
  display: flex;
  gap: 8px;
  align-items: center;
}

.options-dropdown {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
}

.options-dropdown:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.options-dropdown:focus {
  border-color: var(--accent);
}

/* Options Table */
.options-table-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.options-table-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 4px 4px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 101;
  flex-shrink: 0;
  position: relative;
}

.atm-iv-left {
  position: absolute;
  left: 8px;
  top: 4px;
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
}

.atm-iv-right {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
}

.calls-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.puts-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.strikes-control-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 102;
}

/* Table Subheader */
.options-table-subheader {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(40px, 1fr);
  gap: 2px;
  padding: 2px 4px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
  position: sticky;
  top: 32px;
  z-index: 100;
  text-align: center;
  flex-shrink: 0;
}

/* Table Body */
.options-table-body {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
}

.options-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(40px, 1fr);
  gap: 2px;
  padding: 2px 4px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  font-size: 10px;
  text-align: center;
  align-items: center;
  min-height: 22px;
}

.options-row:hover {
  background: var(--bg-hover);
}

.options-row.selected {
  background: rgba(100, 100, 255, 0.15);
  border: 1px solid rgba(100, 100, 255, 0.3);
}

.strike-price {
  text-align: center;
  font-weight: 600;
  color: var(--text);
  background: rgba(100, 100, 255, 0.15);
  padding: 3px 0;
  border-radius: 2px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Column Styles - Call Columns */
.col-call-volume,
.col-call-bidSize,
.col-call-askSize,
.col-call-impliedVol,
.col-call-delta,
.col-call-theta {
  color: var(--text-dim);
  font-size: 10px;
}

.col-call-bid {
  color: rgba(150, 180, 220, 0.9);
  font-weight: 500;
  font-size: 10px;
}

.col-call-bid.clickable:hover {
  background: rgba(150, 180, 220, 0.15);
  border-radius: 2px;
}

.col-call-ask {
  color: rgba(220, 180, 130, 0.9);
  font-weight: 500;
  font-size: 10px;
}

.col-call-ask.clickable:hover {
  background: rgba(220, 180, 130, 0.15);
  border-radius: 2px;
}

/* Column Styles - Put Columns */
.col-put-volume,
.col-put-bidSize,
.col-put-askSize,
.col-put-impliedVol,
.col-put-delta,
.col-put-theta {
  color: var(--text-dim);
  font-size: 10px;
}

.col-put-bid {
  color: rgba(150, 180, 220, 0.9);
  font-weight: 500;
  font-size: 10px;
}

.col-put-bid.clickable:hover {
  background: rgba(150, 180, 220, 0.15);
  border-radius: 2px;
}

.col-put-ask {
  color: rgba(220, 180, 130, 0.9);
  font-weight: 500;
  font-size: 10px;
}

.col-put-ask.clickable:hover {
  background: rgba(220, 180, 130, 0.15);
  border-radius: 2px;
}

/* No bid/ask styling (when value is -1) */
.col-call-bid.no-bid-ask,
.col-call-ask.no-bid-ask,
.col-put-bid.no-bid-ask,
.col-put-ask.no-bid-ask {
  color: var(--loss) !important;
  font-weight: 600;
}

/* ITM (In The Money) shading */
[class^='col-call-'].itm,
[class*=' col-call-'].itm {
  background: rgba(100, 200, 100, 0.08);
  padding: 3px 0;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

[class^='col-put-'].itm,
[class*=' col-put-'].itm {
  background: rgba(100, 200, 100, 0.08);
  padding: 3px 0;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  .options-table-subheader,
  .options-row {
    font-size: 9px;
  }

  .strike-price {
    font-size: 10px;
  }
}

/* Scrollbar styling for table body */
.options-table-body::-webkit-scrollbar {
  width: 8px;
}

.options-table-body::-webkit-scrollbar-track {
  background: var(--bg-base);
}

.options-table-body::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 4px;
}

.options-table-body::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Quantity Preset Buttons */
.quantity-preset-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.quantity-preset-button {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  line-height: 22px;
  font-family: 'Inter';
  font-weight: 500;
  font-size: 10px;
  padding: 0 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.quantity-preset-button:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.quantity-preset-button:active {
  background-color: var(--bg-hover);
  border-color: var(--border-light);
}

/* Strikes Dropdown */
.strikes-control-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.strikes-control-wrapper:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.strikes-input {
  width: 30px;
  height: 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 11px;
  outline: none;
  text-align: center;
  padding: 0;
  margin: 0;
  line-height: 16px;
  box-sizing: border-box;
}

.strikes-value-display {
  font-size: 11px;
  color: var(--text);
  padding: 0;
  margin: 0;
  cursor: text;
  min-width: 30px;
  width: 30px;
  height: 16px;
  text-align: center;
  display: inline-block;
  line-height: 16px;
  box-sizing: border-box;
}

.strikes-dropdown-button {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0 2px;
  display: flex;
  align-items: center;
  font-size: 9px;
  height: 16px;
  line-height: 16px;
}

.strikes-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 4px;
  padding-right: 4px;
  z-index: 1000;
  min-width: 60px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.strikes-dropdown-item {
  padding-left: 8px;
  padding-right: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  border-radius: 2px;
  transition: background-color 0.2s;
}

.strikes-dropdown-item:first-child {
  padding-top: 0;
}

.strikes-dropdown-item:not(:last-child) {
  padding-bottom: 2px;
}

.strikes-dropdown-item:last-child {
  padding-bottom: 0;
}

.strikes-dropdown-item.selected {
  background-color: rgba(100, 100, 255, 0.3);
}

.strikes-dropdown-item:not(.selected):hover {
  background-color: var(--bg-hover);
}

/* Spread Mode Toggle */
.spread-mode-toggle {
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'Quantico', sans-serif;
  letter-spacing: 0.5px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.spread-mode-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text);
}

.spread-mode-toggle.active {
  background: rgba(180, 130, 255, 0.2);
  border-color: rgba(180, 130, 255, 0.5);
  color: rgb(180, 130, 255);
}

/* Spread Leg Row Indicators */
.options-row.spread-leg-1 {
  background: rgba(100, 180, 255, 0.1);
  border-left: 2px solid rgba(100, 180, 255, 0.6);
}

.options-row.spread-leg-2 {
  background: rgba(255, 170, 100, 0.1);
  border-left: 2px solid rgba(255, 170, 100, 0.6);
}

/* Spread Trade Panel */
.spread-trade-panel {
  background: var(--bg-alt);
  border: 1px solid rgba(180, 130, 255, 0.3);
  border-radius: 4px;
  padding: 6px;
  margin: 4px 0;
  flex-shrink: 0;
}

.spread-trade-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}

.spread-trade-panel-title {
  font-size: 11px;
  font-weight: 600;
  color: rgb(180, 130, 255);
}

/* Spread Legs Display */
.spread-legs-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.spread-leg {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
}

.spread-leg-1-display {
  background: rgba(100, 180, 255, 0.1);
  border: 1px solid rgba(100, 180, 255, 0.3);
}

.spread-leg-2-display {
  background: rgba(255, 170, 100, 0.1);
  border: 1px solid rgba(255, 170, 100, 0.3);
}

.spread-leg-label {
  font-weight: 700;
  font-size: 9px;
  color: var(--text-muted);
  min-width: 16px;
}

.spread-leg-side {
  font-weight: 600;
  font-size: 10px;
  min-width: 28px;
}

.spread-leg-side[data-side='BUY'] {
  color: var(--profit);
}

.spread-leg-side[data-side='SELL'] {
  color: var(--loss);
}

.spread-leg-details {
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.spread-leg-price {
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  color: var(--text);
  font-size: 10px;
}

.spread-leg-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.spread-leg-remove:hover {
  color: var(--loss);
}

/* Spread Trade Controls */
.spread-trade-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
  max-width: 320px;
}

.spread-inputs-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.spread-input-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 80px;
  flex-shrink: 0;
}

.spread-input-label {
  font-size: 8px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.spread-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 6px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.spread-input:focus {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.spread-size-display {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  white-space: nowrap;
  align-self: flex-end;
  padding-bottom: 4px;
}

/* Spread Preset Buttons (override base) */
.spread-trade-controls .quantity-preset-buttons {
  max-width: 320px;
}

/* Spread Body - two column layout */
.spread-body {
  display: flex;
  gap: 8px;
}

.spread-controls-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
  max-width: 320px;
}

/* Spread Payoff Chart */
.spread-payoff-chart {
  flex: 1;
  min-width: 150px;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-base);
  position: relative;
  display: flex;
  flex-direction: column;
}

.spread-payoff-chart canvas {
  flex: 1;
  min-height: 0;
}

.spread-payoff-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  padding: 6px 8px 2px;
}

.spread-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.spread-metric-label {
  font-size: 9px;
  color: var(--text-dim);
  font-weight: 500;
}

.spread-metric-value {
  font-size: 11px;
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  color: var(--text);
}

.spread-metric-value.profit {
  color: var(--profit);
}

.spread-metric-value.loss {
  color: var(--loss);
}

/* Spread Actions */
.spread-actions {
  display: flex;
  gap: 6px;
}
.pnl-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  font-family: 'Quantico', sans-serif;
  background-color: var(--bg-base);
  color: var(--text);
  overflow: hidden;
  user-select: none;
}

.pnl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-alt);
  border-bottom: 1.5px solid #181818;
  height: 36px;
  min-height: 36px;
}

.pnl-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.pnl-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.timeframe-buttons {
  display: flex;
  gap: 2px;
  background: var(--bg-base);
  border-radius: 2px;
  padding: 2px;
  border: 1px solid var(--border);
}

.timeframe-btn {
  padding: 4px 10px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 2px;
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  height: 24px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeframe-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.timeframe-btn.active {
  background: #45b5ff;
  color: #000;
  font-weight: 600;
}

.setup-button {
  padding: 4px 8px;
  background-color: var(--text-muted);
  color: var(--text);
  border: none;
  border-radius: 2px;
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.15s;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.setup-button:hover {
  background-color: var(--text-muted);
}

.clear-button {
  padding: 4px 8px;
  background-color: var(--loss);
  color: var(--text);
  border: none;
  border-radius: 2px;
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 0.15s;
  height: 24px;
}

.clear-button:hover {
  background-color: #ff6020;
}

.broker-select {
  padding: 4px 8px;
  background-color: var(--bg-base);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  cursor: pointer;
  height: 24px;
}

.broker-select:focus {
  outline: none;
  border-color: #45b5ff;
}

.load-button {
  padding: 4px 12px;
  background-color: #45b5ff;
  color: #000;
  border: none;
  border-radius: 2px;
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
  height: 24px;
}

.load-button:hover:not(:disabled) {
  background-color: #5ac5ff;
}

.load-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.symbol-filter-input {
  flex: 1;
  max-width: 200px;
  padding: 4px 8px;
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: #f0f0f0;
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  height: 22px;
}

.symbol-filter-input:focus {
  outline: none;
  border-color: #45b5ff;
}

.symbol-filter-input::placeholder {
  color: var(--text-muted);
}

.min-pnl-filter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.min-pnl-filter label {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.min-pnl-input {
  width: 80px;
  padding: 4px 8px;
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: #f0f0f0;
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  height: 22px;
}

.min-pnl-input:focus {
  outline: none;
  border-color: #45b5ff;
}

.pnl-summary {
  display: flex;
  gap: 20px;
  padding: 8px 12px;
  background-color: var(--bg-alt);
  border-bottom: 1px solid #181818;
  height: 48px;
  min-height: 48px;
  align-items: center;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.summary-value {
  font-size: 13px;
  font-weight: 600;
}

.summary-value.profit {
  color: var(--profit);
}

.summary-value.loss {
  color: var(--loss);
}

.summary-value.commission {
  color: #fffa9f;
}

.pnl-table-container {
  flex: 1;
  overflow: auto;
  background-color: var(--bg-base);
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 11px;
}

.pnl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

.pnl-table thead {
  position: sticky;
  top: 0;
  background-color: var(--bg-base);
  z-index: 1;
}

.pnl-table th {
  padding: 4px 6px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  height: 20px;
}

.pnl-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.pnl-table tbody tr:hover {
  background-color: var(--bg-alt);
  transition: background-color 0.1s;
}

.symbol-cell {
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}

.option-details {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: normal;
  margin-left: 4px;
}

.side-badge {
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 600;
}

.side-badge.buy,
.side-badge.bot {
  color: var(--profit);
}

.side-badge.sell {
  color: #ff5c5c;
}

.pnl-table .commission {
  color: #fffa9f;
  font-size: 10px;
}

.pnl-table .pnl {
  font-weight: 600;
  font-size: 11px;
}

.pnl-table .pnl.profit {
  color: var(--profit);
}

.pnl-table .pnl.loss {
  color: #ff5c5c;
}

.datetime-cell {
  font-size: 10px;
  color: var(--text-muted);
}

/* Setup screen styles */
.pnl-setup {
  padding: 12px;
  max-width: 700px;
  margin: 0 auto;
  overflow-y: auto;
  height: 100%;
}

.setup-instructions {
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
}

.setup-instructions h3 {
  margin-top: 0;
  color: #45b5ff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.setup-instructions ol {
  margin-left: 16px;
  line-height: 1.6;
  font-size: 11px;
}

.setup-instructions ul {
  margin: 4px 0 4px 16px;
  font-size: 10px;
  line-height: 1.5;
}

.setup-instructions a {
  color: #45b5ff;
  text-decoration: none;
}

.setup-instructions a:hover {
  text-decoration: underline;
}

.setup-form {
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.flex-input {
  width: 100%;
  padding: 6px 8px;
  background-color: var(--bg-base);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  height: 28px;
}

.flex-input:focus {
  outline: none;
  border-color: #45b5ff;
}

.save-button {
  width: 100%;
  padding: 8px;
  background-color: #45b5ff;
  color: #000;
  border: none;
  border-radius: 2px;
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
  margin-top: 6px;
  height: 32px;
}

.save-button:hover:not(:disabled) {
  background-color: #5ac5ff;
}

.save-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.setup-form .broker-select {
  width: 100%;
  height: 28px;
}

/* Section Headers */
.pnl-section-header {
  background-color: var(--bg-alt);
  border-bottom: 1px solid #181818;
  padding: 0;
}

.section-toggle-btn {
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.1s;
}

.section-toggle-btn:hover {
  background-color: var(--bg-hover);
}

.section-toggle-btn span:first-child {
  font-size: 9px;
  color: var(--text-muted);
}

/* Metrics Section */
.pnl-metrics {
  background-color: var(--bg-base);
  border-bottom: 1px solid #181818;
  padding: 12px;
}

.metrics-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

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

.metric-card {
  flex: 1;
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-card.long-card {
  flex: 1;
}

.metric-card.short-card {
  flex: 1;
}

.metric-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.metric-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.metric-subtext {
  font-size: 9px;
  color: var(--text-muted);
}

/* Symbol Performance */
.symbol-performance {
  display: flex;
  gap: 12px;
}

.performance-section {
  flex: 1;
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
}

.performance-section h3 {
  margin: 0 0 6px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}

.performance-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.performance-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background-color: var(--bg-base);
  border-radius: 2px;
}

.perf-symbol {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  min-width: 60px;
}

.perf-trades {
  font-size: 9px;
  color: var(--text-muted);
  flex: 1;
}

.perf-pnl {
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.perf-pnl.profit {
  color: var(--profit);
}

.perf-pnl.loss {
  color: #ff5c5c;
}

/* P&L Chart Section */
.pnl-chart-section {
  background-color: var(--bg-base);
  border-bottom: 1px solid #181818;
  padding: 12px;
}

.pnl-chart-container {
  width: 100%;
  height: 300px;
  background-color: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.stock-stop-menu-container,
.stock-close-menu-container,
.option-close-menu-container {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  width: 220px;
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  z-index: 100;
  padding: 4px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-family: 'Quantico', sans-serif;
}

/* Size options styling */
.size-options-sl,
.size-options {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 1px;
}

.size-options-sl span,
.size-options span {
  cursor: pointer;
  padding: 4px 2px;
  background-color: var(--bg-alt);
  flex-grow: 1;
  text-align: center;
  font-size: 0.9em;
  transition: background-color 0.15s ease;
}

.size-options-sl span:hover,
.size-options span:hover {
  background-color: var(--bg-hover);
}

.size-options-sl span:first-child,
.size-options span:first-child {
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
}

.size-options-sl span:last-child,
.size-options span:last-child {
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
}

/* Selected state with gradients */
.size-options span.selected {
  background: linear-gradient(to right, #2c6b95, #3ea3e6);
  color: var(--text);
}

.size-options-sl span.selected {
  background: linear-gradient(to right, rgb(179, 118, 43), #e59024);
  color: var(--text);
}

/* Trade options styling */
.trade-options {
  display: flex;
  gap: 8px;
}

.market-option {
  cursor: pointer;
  padding: 6px;
  background-color: var(--bg-alt);
  color: var(--text);
  text-align: center;
  width: 70px;
  border-radius: 3px;
  transition: background-color 0.15s ease;
}

.market-option:hover {
  background-color: var(--bg-hover);
}

.limit-section {
  flex-grow: 1;
}

/* Option rows styling */
.option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 4px 6px;
  margin: 2px 0;
  border-radius: 3px;
  transition: background-color 0.15s ease;
}

.option:hover {
  background-color: var(--bg-hover);
}

.option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-muted);
}

.option.disabled:hover {
  background-color: var(--bg-hover);
}

.sl-entry {
  color: #e59024;
}

.label {
  font-size: 0.9em;
  color: var(--text-dim);
}

/* Input styling */
.custom-limit-input {
  width: 65px;
  padding: 2px 4px;
  background-color: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  text-align: right;
  font-size: 0.9em;
}

.custom-limit-input:focus {
  outline: none;
  border-color: var(--border-light);
  background-color: var(--bg-hover);
}

.custom-limit-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--bg-base);
  color: var(--text-muted);
}

/* Stop-limit inputs styling */
.stop-limit-inputs {
  display: flex;
  gap: 4px;
}

.stop-limit-inputs .custom-limit-input {
  width: 60px;
}

/* Stop-limit section styling */
.stop-limit-section {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* Button styling */
.trade-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.9em;
  transition: background-color 0.15s ease;
  font-family: 'Quantico', sans-serif;
  cursor: pointer;
}

.trade-sl-button {
  background-color: rgba(229, 144, 36, 0.15);
  color: #e59024;
  border: 1px solid rgba(229, 144, 36, 0.3);
}

.trade-sl-button:hover {
  background-color: rgba(229, 144, 36, 0.25);
}

.trade-close-button {
  background-color: rgba(62, 163, 230, 0.15);
  color: #3ea3e6;
  border: 1px solid rgba(62, 163, 230, 0.3);
}

.trade-close-button:hover {
  background-color: rgba(62, 163, 230, 0.25);
}

.down-arrow-icon {
  width: 10px;
  height: 10px;
  opacity: 0.8;
}

/* Chart Position Menu — right-click overlay */
.chart-position-menu {
  position: fixed;
  z-index: 10000;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px;
  min-width: 210px;
  box-shadow: 0 4px 12px var(--shadow, rgba(0, 0, 0, 0.5));
  font-family: 'Quantico', sans-serif;
  font-size: 11px;
  color: var(--text);
}

.chart-position-menu button {
  font-family: 'Quantico', sans-serif;
}

/* Size selector row */
.cpm-sizes {
  display: flex;
  gap: 2px;
  margin-bottom: 5px;
}

.cpm-size {
  flex: 1;
  padding: 3px 0;
  background: var(--bg-button);
  color: var(--text-dim);
  border: none;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  border-radius: 3px;
  transition: background 0.1s, color 0.1s;
}

.cpm-size:hover {
  background: var(--bg-button-hover);
  color: var(--text);
}

.cpm-size--active {
  background: rgba(62, 163, 230, 0.25);
  color: #6bb8ee;
  font-weight: 700;
}

/* Order buttons row */
.cpm-actions {
  display: flex;
  gap: 3px;
  margin-bottom: 5px;
}

.cpm-btn {
  flex: 1;
  padding: 4px 0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: opacity 0.1s;
}

.cpm-btn:hover {
  opacity: 0.85;
}

.cpm-btn--mkt {
  background: var(--bg-button);
  color: var(--text);
}

.cpm-btn--lmt {
  background: rgba(62, 163, 230, 0.22);
  color: #5eade8;
}

.cpm-btn--sl {
  background: rgba(229, 144, 36, 0.22);
  color: #e59024;
}

/* P&L line */
.cpm-pnl {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 2px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
  font-size: 10px;
  gap: 8px;
}

.cpm-pnl-qty {
  color: var(--text-muted);
  white-space: nowrap;
}

.cpm-pnl-val {
  font-weight: 600;
  font-size: 10px;
  white-space: nowrap;
}

.cpm-pnl-val--pos {
  color: var(--profit, #00ff88);
}

.cpm-pnl-val--neg {
  color: var(--loss, #ff4800);
}

/* Alert button */
.cpm-alert {
  width: 100%;
  padding: 4px 4px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}

.cpm-alert:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.cpm-alert--with-pos {
  /* slightly different when shown below position controls */
}

/* Spread close section */
.spread-close-section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 4px;
}

.spread-close-header {
  font-size: 10px;
  font-weight: 600;
  color: rgb(180, 130, 255);
  padding: 4px 6px 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spread-close-legs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 6px 4px;
  font-size: 11px;
  color: var(--text-dim);
}

.spread-close-leg {
  display: flex;
  align-items: center;
  gap: 4px;
}

.spread-close-leg-side {
  font-weight: 600;
  font-size: 10px;
  min-width: 28px;
}

.spread-close-actions {
  padding: 0 4px;
}

.spread-close-actions .market-option {
  width: 100%;
  background: rgba(180, 130, 255, 0.12);
  color: rgb(180, 130, 255);
  font-weight: 600;
  font-size: 11px;
}

.spread-close-actions .market-option:hover {
  background: rgba(180, 130, 255, 0.22);
}

.spread-close-divider-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
}.position-panel-main {
  background-color: var(--bg-base);
  color: var(--text);
  padding: 0 0 0 0;
  font-family: 'Quantico', sans-serif;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  border: none;
  height: 100%;
  user-select: none;
  overflow: auto;
  /* z-index: 0; */
}

.tabs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  background: var(--bg-alt);
  padding: 0 0 0 0;
  margin: 0;
  border-radius: 0;
  width: 100%;
  height: 28px;
  border-bottom: 1.5px solid var(--bg-base);
  position: static;
  z-index: 1;
}

.tab {
  padding: 0 18px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 0;
  font-size: 13px;
  /* font-family: 'Quantico', sans-serif; */
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  margin: 0;
  transition:
    color 0.15s,
    border-bottom 0.15s;
}

.tab.active {
  color: var(--text);
  border-bottom: 2px solid var(--text);
  background: none;
}

.tab:not(.active):hover {
  color: var(--text);
  background: none;
}

.broker-section {
  margin-left: 0;
  margin-top: 0;
}

.position-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  table-layout: fixed;
  text-align: left;
}

.position-table th,
.position-table td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-base);
  height: 20px;
  letter-spacing: 0.2px;
}

.position-table td {
  color: var(--text);
  font-size: 11px;
  height: 20px;
}

.position-table tr {
  min-height: 20px;
}

.position-table tr:hover {
  background-color: var(--bg-alt);
  transition: background-color 0.1s;
}

.privacy-toggle {
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  height: 28px;
}

.privacy-icon {
  width: 16px;
  height: 16px;
}

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

.position-table td .position-status {
  margin-top: 3px;
  font-size: 0.85em;
}

.position-table td {
  color: var(--text-dim);
  font-size: 0.95em;
}

.equity-row,
.option-row {
  /* cursor: pointer; */
  background-color: var(--bg-alt);
  /* font-weight: 600; */
}

td.combined-size {
  color: var(--text);
  font-size: 1em;
}
.arrow {
  font-size: 11px;
  padding-right: 5px;
}

td.pnl-cell .pnl-percentage {
  color: var(--text-dim);
  font-size: 0.75em;
  margin-top: 5px;
  display: block;
}

.position-status.long {
  color: var(--profit);
}

.position-status.short {
  color: #ff5c5c;
}

.white {
  color: white !important;
}

.sub-info {
  color: var(--text-muted);
  font-size: 0.75em;
}

.broker-badge {
  margin-left: 5px;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  color: var(--text);
}

.broker-badge.clearstreet {
  background-color: #4f00ce; /* Clearstreet purple */
}

.broker-badge.ibkr {
  background-color: #ff0000; /* IBKR red */
}

.pending-orders-table {
  width: 100%;
}

.pending-order-row {
  background: rgba(255, 255, 255, 0.02);
}

.pending-order-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.order-side {
  font-weight: bold;
}

.order-side.buy {
  color: #90ee90;
}

.order-status {
  color: var(--text-muted);
}

.cancel-button {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.2);
  color: #ff6b6b;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-button:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.3);
}

/* History Panel */
.history-list {
  width: 100%;
  overflow: auto;
  height: 90%;
}

.history-header,
.history-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 0.5fr;
  align-items: center;
  min-height: 36px;
  font-family: 'Quantico', 'Fira Code', 'Consolas', monospace;
}

.history-header {
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-base);
  height: 20px;
  letter-spacing: 0.2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.history-header span {
  padding: 4px 6px;
  text-transform: none;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.2px;
}

.history-header span:first-child {
  padding-left: 16px;
}

.history-row {
  color: var(--text);
  font-size: 14px;
  border-radius: 2px;
  margin-bottom: 1px;
  cursor: pointer;
  background: none;
  transition: background 0.15s;
}

.history-row:hover {
  background: var(--bg-alt);
}

.history-col {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  font-family: inherit;
  gap: 6px;
}

.history-symbol {
  /* font-weight: 600; */
  font-size: 15px;
  letter-spacing: 0.5px;
}

.history-side {
  /* font-weight: 600; */
  font-size: 13px;
  margin-left: 0;
  text-transform: capitalize;
  text-align: left;
  width: auto;
}

.history-side.buy {
  color: var(--profit);
}
.history-side.sell {
  color: #ff5c5c;
}

.history-pnl {
  /* font-weight: 700; */
  font-size: 15px;
  font-family: inherit;
}

.history-pnl.positive {
  color: var(--profit);
}
.history-pnl.negative {
  color: #ff5c5c;
}

.history-col.vertical {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.history-row .history-col.vertical:first-child {
  padding-left: 16px;
}

/* Compact Mode Styles */
.position-table.compact th,
.position-table.compact td {
  padding: 2px 6px;
  height: 24px;
  vertical-align: middle;
}

.position-table.compact .equity-row,
.position-table.compact .option-row {
  min-height: 24px;
}

.position-table.compact .position-status {
  display: inline;
  margin-left: 8px;
  font-size: 10px;
}

.position-table.compact .broker-badge {
  margin-left: 4px;
  padding: 1px 3px;
  font-size: 9px;
  vertical-align: middle;
}

.position-table.compact .sub-info {
  display: inline;
  margin-left: 6px;
  font-size: 10px;
  color: var(--text-muted);
}

.position-table.compact .pnl-percentage {
  display: inline;
  margin-left: 6px;
  margin-top: 0;
  font-size: 10px;
}

.position-table.compact .combined-size {
  font-size: 11px;
}

.position-table.compact .pnl-cell {
  font-size: 11px;
}

.position-table.compact .white {
  font-size: 11px;
}

.position-table.compact .button-container {
  gap: 2px;
}

.position-table.compact .trade-button {
  padding: 2px 6px;
  font-size: 10px;
  height: 20px;
  min-width: 28px;
}

.position-table.compact .down-arrow-icon {
  width: 8px;
  height: 8px;
  margin-left: 2px;
}

/* Option symbol styling */
.option-symbol {
  font-weight: normal;
  font-size: 0.85em;
}

/* Compact mode for options */

.position-table.compact td {
  font-size: 10px;
}

.position-table.compact th {
  font-size: 10px;
}

/* Make symbol text more prominent in compact mode */
.position-table.compact td:first-child {
  color: #ffffff !important;
  font-size: 12px !important;
  /* font-weight: 600; */
}

/* Compact mode: Simple left border for long/short with circle indicator for broker */
.position-table.compact .equity-row.long,
.position-table.compact .option-row.long {
  border-left: 3px solid var(--profit);
}

.position-table.compact .equity-row.short,
.position-table.compact .option-row.short {
  border-left: 3px solid #ff5c5c;
}

/* Broker circle indicators */
.broker-circle {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  /* margin-left: 0px; */
  margin-right: 4px;
}

.broker-circle.clearstreet {
  background-color: #9966ff; /* Brighter purple */
}

.broker-circle.ibkr {
  background-color: #ff4444; /* Brighter red */
}

/* Hide position status text in compact mode only */
.position-table.compact .position-status {
  display: none;
}

/* Refresh button animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.refresh-prices-button:hover:not(:disabled) {
  opacity: 0.8;
}

.refresh-prices-button:active:not(:disabled) {
  transform: scale(0.95);
}
.fundamentals-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-base);
  font-family: 'Quantico', monospace;
  user-select: none;
  -webkit-user-select: none;
}

/* Top bar */
.fund-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.fund-tabs {
  display: flex;
  gap: 2px;
}

.fund-tab {
  padding: 3px 10px;
  font-size: 11px;
  font-family: 'Quantico', monospace;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.15s;
}

.fund-tab:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.04);
}

.fund-tab--active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.fund-search-wrapper {
  flex: 1;
  max-width: 220px;
}

.fund-back-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-family: 'Quantico', monospace;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.15s;
}

.fund-back-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.fund-zoom {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.fund-zoom-btn {
  padding: 1px 5px;
  font-size: 9px;
  font-family: 'Quantico', monospace;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.15s;
}

.fund-zoom-btn:hover {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
}

.fund-zoom-btn--active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Screener */
.fund-screener {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.fund-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.fund-filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fund-filter-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.fund-filter-input {
  width: 50px;
  padding: 2px 4px;
  font-size: 10px;
  font-family: 'Quantico', monospace;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  color: var(--text);
  outline: none;
}

.fund-filter-input:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

.fund-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  white-space: nowrap;
}

.fund-filter-checkbox input {
  margin: 0;
  cursor: pointer;
}

.fund-table-wrapper {
  flex: 1;
  overflow: auto;
}

.fund-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.fund-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-input);
  padding: 4px 6px;
  text-align: right;
  font-weight: normal;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
}

.fund-table th:first-child {
  text-align: left;
}

.fund-table th:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: dotted underline rgba(255, 255, 255, 0.3);
}

.fund-table th.fund-sort-active {
  color: var(--text);
}

.fund-sort-arrow {
  font-size: 9px;
  margin-left: 2px;
}

.fund-table td {
  padding: 3px 6px;
  text-align: right;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.fund-table td:first-child {
  text-align: left;
  color: var(--text);
  font-weight: bold;
}

.fund-table tr {
  cursor: pointer;
  transition: background 0.1s;
}

.fund-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.fund-metric-strong {
  color: var(--profit) !important;
}

.fund-metric-positive {
  color: #88cc88 !important;
}

.fund-metric-negative {
  color: #ff5c5c !important;
}

.fund-metric-warn {
  color: #ffc832 !important;
}

.fund-score-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: bold;
}

.fund-score-high {
  background: rgba(0, 255, 136, 0.15);
  color: var(--profit);
}

.fund-score-mid {
  background: rgba(255, 200, 50, 0.15);
  color: #ffc832;
}

.fund-score-low {
  background: rgba(255, 92, 92, 0.1);
  color: rgba(255, 255, 255, 0.4);
}

/* Stock detail */
.fund-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 0 6px 12px;
}

.fund-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
}

.fund-detail-symbol {
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
}

.fund-detail-name {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.fund-detail-badges {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.fund-badge {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
}

.fund-badge--good {
  background: rgba(0, 255, 136, 0.1);
  color: var(--profit);
}

.fund-badge--bad {
  background: rgba(255, 92, 92, 0.1);
  color: #ff5c5c;
}

.fund-badge--warn {
  background: rgba(255, 200, 50, 0.1);
  color: #ffc832;
}

.fund-chart-section {
  height: 280px;
  margin: 6px 0;
  flex-shrink: 0;
}

.fund-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px;
  padding: 4px 0;
}

.fund-card {
  background: var(--bg-alt);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 8px 10px;
}

.fund-card-title {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.fund-card-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fund-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.fund-card-row-label {
  color: rgba(255, 255, 255, 0.45);
}

.fund-card-row-value {
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Quantico', monospace;
}

.fund-quarters-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  margin-top: 6px;
}

.fund-quarters-table th {
  padding: 2px 4px;
  text-align: right;
  font-weight: normal;
  color: rgba(255, 255, 255, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.fund-quarters-table th:first-child {
  text-align: left;
}

.fund-quarters-table td {
  padding: 2px 4px;
  text-align: right;
  color: rgba(255, 255, 255, 0.6);
}

.fund-quarters-table td:first-child {
  text-align: left;
  color: rgba(255, 255, 255, 0.4);
}

.fund-yoy-row td {
  font-size: 9px !important;
  color: rgba(255, 255, 255, 0.35) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

.fund-yoy-row td:first-child {
  color: rgba(255, 255, 255, 0.25) !important;
  padding-left: 8px;
}

.fund-yoy-row td.fund-metric-strong {
  color: var(--profit) !important;
}

.fund-yoy-row td.fund-metric-positive {
  color: #88cc88 !important;
}

.fund-yoy-row td.fund-metric-negative {
  color: #ff5c5c !important;
}

.fund-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
}

.fund-error {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #ff5c5c;
  font-size: 12px;
}

.fund-count {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-left: auto;
  padding-right: 4px;
}

/* AI Analysis section */
.fund-ai-section {
  margin-top: 6px;
}

.fund-ai-content {
  margin-top: 4px;
}

.fund-ai-result {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 0;
}

.fund-ai-result h1,
.fund-ai-result h2,
.fund-ai-result h3 {
  color: rgba(255, 255, 255, 0.9);
  margin: 8px 0 4px;
  font-family: 'Quantico', monospace;
}

.fund-ai-result h1 { font-size: 13px; }
.fund-ai-result h2 { font-size: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); padding-bottom: 2px; }
.fund-ai-result h3 { font-size: 11px; }

.fund-ai-result p {
  margin: 3px 0;
}

.fund-ai-result ul {
  margin: 3px 0;
  padding-left: 14px;
}

.fund-ai-result li {
  margin: 1px 0;
}

.fund-ai-result strong {
  color: rgba(255, 255, 255, 0.95);
}

.fund-ai-result code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 10px;
}

.fund-ai-result pre {
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
  border-radius: 3px;
  overflow-x: auto;
  font-size: 10px;
}

/* Strengths / Concerns side-by-side */
.fund-ai-verdicts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.fund-ai-verdict {
  padding: 6px 8px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.fund-ai-verdict--good {
  background: rgba(0, 255, 136, 0.03);
  border-color: rgba(0, 255, 136, 0.08);
}

.fund-ai-verdict--bad {
  background: rgba(255, 92, 92, 0.03);
  border-color: rgba(255, 92, 92, 0.08);
}

.fund-ai-verdict-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.4);
}

.fund-ai-verdict--good .fund-ai-verdict-title {
  color: var(--profit);
}

.fund-ai-verdict--bad .fund-ai-verdict-title {
  color: #ff5c5c;
}

/* Inline insight under tables */
.fund-ai-inline {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 0 0 3px 3px;
}
.calendar-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-base);
  font-family: 'Quantico', monospace;
  user-select: none;
  -webkit-user-select: none;
}

/* Top bar */
.cal-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-nav-btn {
  padding: 2px 6px;
  font-size: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Quantico', monospace;
}

.cal-nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.cal-month-label {
  font-size: 12px;
  font-weight: bold;
  color: var(--text);
  min-width: 120px;
  text-align: center;
}

.cal-today-btn {
  padding: 2px 8px;
  font-size: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Quantico', monospace;
  margin-left: 4px;
}

.cal-today-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.cal-search {
  flex: 0 0 auto;
}

.cal-search-input {
  width: 110px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: 'Quantico', monospace;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  color: var(--text);
  outline: none;
}

.cal-search-input:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

.cal-search-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.cal-filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-select {
  padding: 2px 4px;
  font-size: 10px;
  font-family: 'Quantico', monospace;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.cal-select option {
  background: var(--bg-input);
  color: var(--text);
}

.cal-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  white-space: nowrap;
}

.cal-filter-checkbox input {
  margin: 0;
  cursor: pointer;
}

.cal-zoom {
  display: flex;
  gap: 2px;
}

.cal-zoom-btn {
  padding: 1px 5px;
  font-size: 9px;
  font-family: 'Quantico', monospace;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.15s;
}

.cal-zoom-btn:hover {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
}

.cal-zoom-btn--active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.cal-count {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-left: auto;
  padding-right: 4px;
  white-space: nowrap;
}

/* Event type filter chips */
.cal-type-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 22px;
}

.cal-type-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  font-size: 9px;
  font-family: 'Quantico', monospace;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.cal-type-chip:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.cal-type-chip--active {
  background: rgba(255, 255, 255, 0.05);
}

.cal-type-chip--excluded {
  background: rgba(255, 92, 92, 0.06);
  opacity: 0.7;
}

.cal-type-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-type-clear {
  padding: 1px 6px;
  font-size: 9px;
  font-family: 'Quantico', monospace;
  background: rgba(255, 92, 92, 0.08);
  border: 1px solid rgba(255, 92, 92, 0.15);
  border-radius: 10px;
  color: #ff5c5c;
  cursor: pointer;
  transition: all 0.15s;
}

.cal-type-clear:hover {
  background: rgba(255, 92, 92, 0.15);
}

/* Body: grid + sidebar */
.cal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.cal-grid-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Day of week header */
.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex-shrink: 0;
}

.cal-dow {
  padding: 3px 4px;
  font-size: 9px;
  text-align: center;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Calendar grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  flex: 1;
  overflow: hidden;
}

.cal-cell {
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding: 1px 3px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: background 0.1s;
  min-height: 0;
}

.cal-cell:hover {
  background: rgba(255, 255, 255, 0.02);
}

.cal-cell--dim {
  opacity: 0.3;
}

.cal-cell--today {
  background: rgba(0, 255, 136, 0.04);
}

.cal-cell--today .cal-cell-day {
  color: var(--profit);
  font-weight: bold;
}

.cal-cell--selected {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1);
}

.cal-cell-day {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.1;
  flex-shrink: 0;
}

.cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.cal-cell-event {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 15px;
  flex-shrink: 0;
  overflow: hidden;
}

.cal-event-logo {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  flex-shrink: 0;
  object-fit: contain;
}

.cal-event-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-event-ticker {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: bold;
}

.cal-cell-more {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  flex-shrink: 0;
  height: 13px;
  line-height: 13px;
}

.cal-cell-count {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.2);
}

/* Sidebar */
.cal-sidebar {
  width: 260px;
  flex-shrink: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-sidebar-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.cal-sidebar-date {
  font-size: 11px;
  color: var(--text);
  font-weight: bold;
}

.cal-sidebar-count {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  margin-left: auto;
}

.cal-sidebar-close {
  padding: 0 4px;
  font-size: 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: color 0.15s;
}

.cal-sidebar-close:hover {
  color: var(--text);
}

.cal-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 0;
}

.cal-sidebar-item {
  padding: 3px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.1s;
}

.cal-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.cal-sidebar-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cal-sidebar-company {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 24px;
}

.cal-sidebar-name {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 24px;
}

.cal-sidebar-logo {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  flex-shrink: 0;
  object-fit: contain;
}

.cal-sidebar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-sidebar-ticker {
  font-size: 12px;
  font-weight: bold;
  color: var(--text);
  min-width: 40px;
}

.cal-sidebar-type {
  font-size: 9px;
}

.cal-sidebar-status {
  font-size: 8px;
  padding: 0 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.4);
}

.cal-sidebar-status--confirmed {
  background: rgba(0, 255, 136, 0.1);
  color: rgba(0, 255, 136, 0.7);
}

.cal-sidebar-mcap {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.45);
  margin-left: auto;
  white-space: nowrap;
}

/* Loading / Error */
.cal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: rgba(255, 255, 255, 0.3);
  font-size: 12px;
}

.cal-error {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #ff5c5c;
  font-size: 12px;
}

/* View toggle button */
.cal-view-toggle {
  padding: 2px 8px;
  font-size: 10px;
  font-family: 'Quantico', monospace;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.cal-view-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.cal-view-toggle--active {
  color: #ffb347;
  border-color: rgba(255, 179, 71, 0.3);
  background: rgba(255, 179, 71, 0.08);
}

.cal-view-toggle--active:hover {
  background: rgba(255, 179, 71, 0.12);
}

/* Weekly Earnings Grid */
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.cal-week-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.cal-week-col:last-child {
  border-right: none;
}

.cal-week-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.cal-week-day-header--today {
  background: rgba(0, 255, 136, 0.04);
}

.cal-week-day-name {
  font-size: 10px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-week-day-header--today .cal-week-day-name {
  color: var(--profit);
}

.cal-week-day-date {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
}

.cal-week-day-header--today .cal-week-day-date {
  color: rgba(0, 255, 136, 0.5);
}

.cal-week-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.cal-week-half + .cal-week-half {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cal-week-half-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 2px 2px;
}

.cal-week-section {
  padding: 3px 4px 2px;
  font-size: 8px;
  font-weight: bold;
  color: rgba(100, 200, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(100, 200, 255, 0.08);
  flex-shrink: 0;
}

.cal-week-section--after {
  color: rgba(255, 179, 71, 0.6);
  border-bottom-color: rgba(255, 179, 71, 0.08);
}

.cal-week-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: background 0.1s;
}

.cal-week-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.cal-week-logo {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  flex-shrink: 0;
  object-fit: contain;
}

.cal-week-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
}

.cal-week-ticker {
  font-size: 11px;
  font-weight: bold;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-week-mcap {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

.cal-week-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.15);
}
/* ── Toolbar ── */
.recap-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.recap-btn {
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-button);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.recap-btn:hover {
  background: var(--bg-button-hover);
  color: var(--text-dim);
}

.recap-btn--afk-active {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}

.recap-btn--afk-active:hover {
  background: rgba(245, 158, 11, 0.25);
}

.recap-btn--subtle {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

.recap-btn--subtle:hover {
  color: var(--text-muted);
  background: var(--bg-button);
}

.recap-btn--generate {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent);
}

.recap-btn--generate:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent);
}

.recap-btn--generate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.recap-btn--loading {
  animation: recapPulse 1.5s ease-in-out infinite;
}

.recap-btn--icon {
  border: none;
  background: transparent;
  padding: 3px;
  display: flex;
  align-items: center;
  opacity: 0.4;
  cursor: pointer;
}

.recap-btn--icon:hover {
  opacity: 0.7;
}

/* ── Status ── */
.recap-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.recap-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.recap-item-count {
  background: var(--bg-hover);
  color: var(--text-muted);
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 500;
  margin-left: 2px;
}

/* ── Body ── */
.recap-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px 12px;
}

.recap-empty {
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  margin-top: 40px;
}

/* ── Raw Items ── */
.recap-raw {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.recap-raw-header {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 10px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.recap-raw-list {
  max-height: 250px;
  overflow-y: auto;
}

.recap-raw-item {
  padding: 4px 10px;
  font-size: 11px;
  line-height: 1.4;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.recap-raw-item--alert {
  background: rgba(248, 113, 113, 0.04);
}

.recap-raw-item--analyzed {
  border-left: 2px solid rgba(99, 102, 241, 0.3);
}

.recap-raw-num {
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
  min-width: 18px;
}

.recap-raw-text {
  color: var(--text-muted);
}

.recap-raw-analysis {
  color: var(--accent);
  font-size: 10px;
  margin-top: 2px;
  font-style: italic;
}

.recap-raw-alert {
  color: var(--loss);
  font-size: 10px;
  flex-shrink: 0;
}

/* ── Recap Content ── */
.recap-content {
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-dim);
}

.recap-content p {
  margin: 0 0 4px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.recap-content p:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

/* Tier headers */
.recap-content h2 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 20px 0 10px 0;
  padding: 0 0 6px 10px;
  border-bottom: none;
}

.recap-content h2:first-child {
  margin-top: 0;
}

.recap-content h2.tier-key {
  color: #fbbf24;
  border-left: 3px solid #fbbf24;
}

.recap-content h2.tier-notable {
  color: var(--accent);
  border-left: 3px solid var(--accent);
}

.recap-content h2.tier-brief {
  color: var(--text-muted);
  border-left: 3px solid var(--border);
}

.recap-content h1 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #fbbf24;
  border-left: 3px solid #fbbf24;
  padding-left: 10px;
  margin: 20px 0 10px 0;
}

.recap-content h1:first-child {
  margin-top: 0;
}

.recap-content h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 10px 0 5px 0;
}

/* Lists */
.recap-content ul {
  margin: 4px 0;
  padding-left: 0;
  list-style-type: none;
}

.recap-content li {
  margin: 8px 0;
  padding-left: 14px;
  position: relative;
}

.recap-content li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* Inline styles */
.recap-content strong {
  font-weight: 600;
  color: var(--text);
}

.recap-content em {
  font-style: normal;
  color: inherit;
}

.recap-content a {
  color: var(--accent);
  text-decoration: none;
}

.recap-content a:hover {
  text-decoration: underline;
}

.recap-content code {
  background: var(--bg-hover);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 11px;
}

.recap-content pre {
  background: var(--bg-alt);
  padding: 8px;
  border-radius: 3px;
  overflow-x: auto;
  margin: 8px 0;
}

.recap-content pre code {
  background: none;
  padding: 0;
}

/* Item references */
.recap-ref {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  transition: color 0.15s;
}

.recap-ref:hover {
  color: var(--text-dim);
}

/* ── Tooltip ── */
.item-tooltip {
  animation: tooltipIn 0.12s ease-out;
}

@keyframes tooltipIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes recapPulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}
.shortcut-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  user-select: none;
}

.shortcut-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
  border-bottom: 1px solid var(--border);
  min-height: 22px;
}

.shortcut-title-bar .sc-gear-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.shortcut-title-bar .sc-gear-btn:hover {
  opacity: 1;
  background: var(--bg-hover);
}

.shortcut-rows {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
}

.shortcut-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Row container */
.sc-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.sc-row:last-child {
  border-bottom: none;
}

/* Section = label + buttons */
.sc-section {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sc-label {
  font-size: 10px;
  font-weight: bold;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 30px;
  flex-shrink: 0;
  cursor: pointer;
}

.sc-label:hover {
  color: var(--text);
}

/* Stock button grid */
.sc-btn-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.sc-btn-row {
  display: flex;
  gap: 2px;
}

.sc-btn {
  flex: 1;
  cursor: pointer;
  background-color: var(--bg-button);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-weight: bold;
  font-size: 11px;
  height: 24px;
  border-radius: 3px;
  transition: background-color 0.1s ease;
}

.sc-btn:hover {
  background-color: var(--bg-button-hover);
}

.sc-btn:active {
  background-color: var(--text-muted);
}

.sc-buy {
  border-color: var(--profit);
}

.sc-buy:hover {
  background-color: var(--bg-button-hover);
}

.sc-sell {
  border-color: var(--loss);
}

.sc-sell:hover {
  background-color: var(--bg-button-hover);
}

/* Options row - calls and puts side by side */
.sc-options-row {
  display: flex;
  gap: 3px;
  flex: 1;
}

/* Single option button group (info + sizes) */
.sc-opt-group {
  display: flex;
  gap: 2px;
  flex: 1;
}

/* Main option info button */
.sc-opt-info {
  flex: 1 1 0%;
  min-width: 0;
  cursor: pointer;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  background-color: var(--bg-button);
  transition: background-color 0.1s ease;
  gap: 4px;
  overflow: hidden;
}

.sc-opt-info:hover {
  background-color: var(--bg-button-hover);
}

.sc-opt-info:active {
  background-color: var(--bg-button-hover);
}

.sc-opt-info.call {
  border-color: var(--profit);
}

.sc-opt-info.put {
  border-color: var(--loss);
}

.sc-opt-text {
  display: flex;
  flex-direction: column;
  font-size: 9px;
  line-height: 1.2;
  overflow: hidden;
}

.sc-opt-strike {
  color: var(--text-dim);
  font-weight: bold;
  white-space: nowrap;
}

.sc-opt-price {
  color: var(--text-muted);
  white-space: nowrap;
}

.sc-opt-size {
  font-size: 10px;
  font-weight: bold;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Additional size buttons for options */
.sc-opt-size-btn {
  flex: 1 1 0%;
  min-width: 0;
  cursor: pointer;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-button);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: bold;
  transition: background-color 0.1s ease;
}

.sc-opt-size-btn:hover {
  background-color: var(--bg-button-hover);
}

.sc-opt-size-btn:active {
  background-color: var(--bg-button-hover);
}

.sc-opt-size-btn.call {
  border-color: var(--profit);
}

.sc-opt-size-btn.put {
  border-color: var(--loss);
}

/* Illiquidity states - background only, never override call/put border */

/* Waiting state */
.sc-waiting {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 4px;
}

/* Blink animation */
.sc-section.blink {
  animation: sc-blink 0.5s ease-in-out;
}

@keyframes sc-blink {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}
/* ── Journal Panel ─────────────────────────────────────────────── */
.journal-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-base);
  color: var(--text);
  font-family: inherit;
  overflow: hidden;
}

.journal-btn {
  background: var(--bg-button);
  color: var(--text);
  border: none;
  border-radius: 3px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.15s;
  white-space: nowrap;
}
.journal-btn:hover { background: var(--bg-button-hover); }
.journal-btn.primary { background: var(--bg-alt); color: var(--profit); }
.journal-btn.primary:hover { background: var(--bg-hover); }
.journal-btn.danger { color: var(--loss); }
.journal-btn.danger:hover { background: var(--bg-hover); }

/* ── Master-Detail layout ──────────────────────────────────────── */
.journal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── List (left pane) ──────────────────────────────────────────── */
.journal-list-pane {
  width: 200px;
  min-width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Draggable divider ───────────────────────────────────────── */
.journal-divider {
  width: 4px;
  flex-shrink: 0;
  cursor: col-resize;
  background: var(--border);
  transition: background 0.15s;
}
.journal-divider:hover { background: var(--border-light); }

.journal-filter-bar {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.journal-search-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

/* ── Smart Search ─────────────────────────────────────────────── */
.journal-smart-search {
  flex: 1;
  min-width: 0;
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}
.journal-smart-search:focus-within { border-color: var(--border-light); }

.journal-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px 5px 0;
}

.journal-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  padding: 1px 5px;
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
}

.chip-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1;
  margin-left: 1px;
}
.chip-remove:hover { color: var(--loss); }

.journal-search-input {
  background: none;
  border: none;
  color: var(--text);
  font-size: 11px;
  padding: 4px 7px;
  flex: 1;
  min-width: 0;
  outline: none;
}
.journal-search-input::placeholder { color: var(--text-muted); }

.journal-search-dropdown {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  z-index: 100;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 3px 3px;
  max-height: 180px;
  overflow-y: auto;
}
.journal-search-dropdown::-webkit-scrollbar { width: 3px; }
.journal-search-dropdown::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }

.journal-search-suggestion {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.08s;
}
.journal-search-suggestion:hover,
.journal-search-suggestion.highlighted {
  background: var(--bg-hover);
}

.suggestion-prefix {
  color: var(--text-dim);
  font-weight: 600;
}

.suggestion-value {
  color: var(--text);
}

.journal-new-btn {
  width: 28px;
  min-width: 28px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  border-radius: 3px;
  flex-shrink: 0;
}

.journal-list-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.journal-list-scroll::-webkit-scrollbar { width: 4px; }
.journal-list-scroll::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }

.journal-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
}

/* ── Entry Card ────────────────────────────────────────────────── */
.journal-card {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.journal-card:hover { background: var(--bg-hover); }
.journal-card.selected { background: var(--bg-hover); border-left: 2px solid var(--border-light); }
.journal-card.multi-selected { background: var(--bg-hover); border-left: 2px solid var(--accent); }

.journal-card-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.journal-card-symbol {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-card-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.journal-card-badge.buy { background: var(--bg-alt); color: var(--profit); }
.journal-card-badge.sell { background: var(--bg-alt); color: var(--loss); }
.journal-card-badge.open { background: var(--bg-alt); color: var(--accent); }

.journal-card-bottom {
  display: flex;
  align-items: center;
  gap: 5px;
}

.journal-card-pnl {
  font-size: 11px;
  font-weight: 600;
  flex: 1;
}
.journal-card-pnl.positive { color: var(--profit); }
.journal-card-pnl.negative { color: var(--loss); }
.journal-card-pnl.neutral { color: var(--text-dim); }

.journal-card-stars {
  font-size: 9px;
  color: #f5a623;
  letter-spacing: -1px;
}

.journal-card-time {
  font-size: 10px;
  color: var(--text-muted);
}

.journal-card-icons {
  display: flex;
  gap: 3px;
  font-size: 10px;
}

.journal-card-badge-news {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--bg-alt);
  color: var(--profit);
  letter-spacing: 0.5px;
}

/* ── Detail pane (right) ───────────────────────────────────────── */
.journal-detail-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.journal-detail-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}
.journal-detail-scroll::-webkit-scrollbar { width: 4px; }
.journal-detail-scroll::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }

.journal-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 12px;
}

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

.journal-detail-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.journal-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.journal-detail-title-input {
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 3px 0;
  flex: 1;
  min-width: 0;
  outline: none;
  cursor: text;
  transition: border-bottom-color 0.15s;
}
.journal-detail-title-input:hover { border-bottom-color: var(--border-light); }
.journal-detail-title-input:focus { border-bottom-color: var(--text-muted); }

.journal-detail-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  margin-top: 4px;
  max-height: 52px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.journal-detail-tags-row::-webkit-scrollbar { width: 3px; }
.journal-detail-tags-row::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }

.journal-detail-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.journal-status-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.journal-status-badge.open { background: var(--bg-alt); color: var(--accent); }
.journal-status-badge.closed { background: var(--bg-alt); color: var(--profit); }

.journal-section {
  margin-bottom: 14px;
  flex-shrink: 0;
}

.journal-section.journal-section-grow {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.journal-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Chart collapse toggle ───────────────────────────────────── */
.journal-chart-toggle {
  cursor: pointer;
  transition: color 0.1s;
}
.journal-chart-toggle:hover { color: var(--text-dim); }

/* ── Trade info table ──────────────────────────────────────────── */
.journal-trade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}

.journal-trade-cell {
  background: var(--bg-alt);
  border-radius: 3px;
  padding: 5px 7px;
}

.journal-trade-cell-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.journal-trade-cell-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.journal-trade-cell-value.positive { color: var(--profit); }
.journal-trade-cell-value.negative { color: var(--loss); }

/* ── Chart ─────────────────────────────────────────────────────── */
.journal-chart-wrapper {
  height: 450px;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

/* ── News section ──────────────────────────────────────────────── */
.journal-news-box {
  background: var(--bg-alt);
  border-radius: 4px;
  padding: 8px 10px;
  border-left: 2px solid var(--border);
}

.journal-news-headline {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.4;
}

.journal-news-analysis {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.journal-news-analysis p {
  margin: 2px 0;
}

.journal-news-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Notes ─────────────────────────────────────────────────────── */
.journal-notes-display {
  background: var(--bg-alt);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  min-height: 40px;
  white-space: pre-wrap;
}

.journal-notes-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Tags ──────────────────────────────────────────────────────── */
.journal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.journal-tag {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 7px;
  font-size: 10px;
  color: var(--text-dim);
  cursor: default;
}

.journal-tag-add {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 2px;
  padding: 2px 7px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.journal-tag-add:hover { border-color: var(--border-light); color: var(--text-dim); }

.journal-tag-input {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  padding: 2px 7px;
  font-size: 10px;
  color: var(--text);
  outline: none;
  width: 80px;
}

/* ── Stars ─────────────────────────────────────────────────────── */
.journal-stars {
  display: flex;
  gap: 4px;
}

.journal-star {
  font-size: 14px;
  cursor: pointer;
  color: var(--border);
  transition: color 0.1s;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}
.journal-star.filled { color: #f5a623; }
.journal-star:hover { color: #f5a623; }

/* ── Overflow Menu (⋯) ───────────────────────────────────────── */
.journal-overflow-menu {
  position: relative;
  display: inline-block;
}

.journal-overflow-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: all 0.1s;
}
.journal-overflow-btn:hover { color: var(--text-dim); border-color: var(--border); }

.journal-overflow-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-top: 2px;
  min-width: 120px;
  overflow: hidden;
}

.journal-overflow-item {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.journal-overflow-item:hover { background: var(--bg-hover); color: var(--text); }
.journal-overflow-item.danger { color: var(--loss); }
.journal-overflow-item.danger:hover { background: var(--bg-hover); }
.journal-overflow-label {
  padding: 4px 10px 2px;
  font-size: 9px;
  font-weight: 700;
  color: var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.journal-overflow-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ── Manual Trade Form ───────────────────────────────────────── */
.journal-manual-trade-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--bg-alt);
  border-radius: 3px;
}

.journal-manual-trade-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.journal-manual-trade-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 50px;
  font-weight: 600;
}

.journal-manual-trade-input,
.journal-manual-trade-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-size: 11px;
  padding: 4px 7px;
  flex: 1;
  min-width: 0;
  outline: none;
}
.journal-manual-trade-input:focus,
.journal-manual-trade-select:focus { border-color: var(--border-light); }

.journal-manual-trade-select {
  cursor: pointer;
}

/* ── Editor ────────────────────────────────────────────────────── */
.journal-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.journal-editor-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.journal-editor-scroll::-webkit-scrollbar { width: 4px; }
.journal-editor-scroll::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }

.journal-editor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.journal-editor-title-input {
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 3px 0;
  width: 100%;
  outline: none;
}
.journal-editor-title-input:focus { border-bottom-color: var(--border-light); }

.journal-field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.journal-textarea {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 8px 10px;
  resize: vertical;
  outline: none;
  line-height: 1.6;
  min-height: 80px;
  width: 100%;
  box-sizing: border-box;
}
.journal-textarea:focus { border-color: var(--border-light); }

.journal-editor-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Orders expand ─────────────────────────────────────────────── */
.journal-orders-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.journal-orders-toggle:hover { color: var(--text-dim); }

.journal-orders-list {
  background: var(--bg-alt);
  border-radius: 3px;
  margin-top: 5px;
  overflow: hidden;
}

.journal-order-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}
.journal-order-row:last-child { border-bottom: none; }
.journal-order-row.buy { color: var(--profit); }
.journal-order-row.sell { color: var(--loss); }

/* ── Tag Autocomplete ─────────────────────────────────────────── */
.journal-tag-autocomplete {
  position: relative;
  display: inline-block;
}

.journal-tag-dropdown {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  min-width: 120px;
  max-height: 160px;
  overflow-y: auto;
}

.journal-tag-dropdown-item {
  padding: 4px 8px;
  font-size: 10px;
  color: var(--text-dim);
  cursor: pointer;
}
.journal-tag-dropdown-item:hover,
.journal-tag-dropdown-item.highlighted {
  background: var(--bg-hover);
  color: var(--text);
}

/* ── TipTap Editor ────────────────────────────────────────────── */
.journal-tiptap-wrapper {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 120px;
}
.journal-tiptap-wrapper:focus-within { border-color: var(--border-light); }

.journal-tiptap-toolbar {
  display: flex;
  gap: 2px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.journal-tiptap-toolbar button {
  background: none;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.1s;
}
.journal-tiptap-toolbar button:hover { color: var(--text-dim); border-color: var(--border); }
.journal-tiptap-toolbar button.is-active { color: var(--text); background: var(--bg-hover); border-color: var(--border-light); }

.journal-tiptap-content {
  padding: 8px 10px;
  min-height: 80px;
  flex: 1;
  overflow-y: auto;
  font-size: 12px;
  color: var(--text);
  line-height: 1.6;
}
.journal-tiptap-content::-webkit-scrollbar { width: 4px; }
.journal-tiptap-content::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }

.journal-tiptap-content .ProseMirror { outline: none; }
.journal-tiptap-content .ProseMirror p { margin: 0 0 4px; }
.journal-tiptap-content .ProseMirror ul,
.journal-tiptap-content .ProseMirror ol { margin: 4px 0; padding-left: 20px; }
.journal-tiptap-content .ProseMirror li { margin-bottom: 2px; }
.journal-tiptap-content .ProseMirror code { background: var(--bg-input); padding: 1px 4px; border-radius: 2px; font-size: 11px; }
.journal-tiptap-content .ProseMirror pre { background: var(--bg-hover); padding: 8px 10px; border-radius: 3px; overflow-x: auto; }
.journal-tiptap-content .ProseMirror pre code { background: none; padding: 0; }
.journal-tiptap-content .ProseMirror mark { background: #4a3a00; color: #ffd700; border-radius: 1px; }
.journal-tiptap-content .ProseMirror hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

/* TipTap placeholder (via Placeholder extension) */
.journal-tiptap-content .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  float: left;
  height: 0;
  pointer-events: none;
}

/* ── Resizable inline images in TipTap ────────────────────────── */
.journal-img-node {
  display: block;
  margin: 6px 0;
}

.journal-img-resizable {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: border-color 0.1s;
}
.journal-img-resizable.hovered { border-color: var(--border); }
.journal-img-resizable.resizing { border-color: var(--accent); }

.journal-img-resizable img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  pointer-events: none;
}

/* ── Image controls (move up/down/delete) ────────────────────── */
.journal-img-controls {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}
.journal-img-resizable.hovered .journal-img-controls { opacity: 1; }

.journal-img-move-btn {
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  color: var(--text-dim);
  font-size: 9px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.1s, color 0.1s;
}
.journal-img-move-btn:hover { background: rgba(0, 0, 0, 0.9); color: var(--text); border-color: var(--text-muted); }
.journal-img-delete-btn:hover { color: var(--loss); border-color: rgba(255, 92, 92, 0.3); }

.journal-img-resize-handle {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 12px;
  height: 12px;
  background: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}
.journal-img-resizable.hovered .journal-img-resize-handle { opacity: 1; }
.journal-img-resize-handle:hover { background: var(--accent); }

/* ── Notes HTML display ───────────────────────────────────────── */
.journal-notes-html ul,
.journal-notes-html ol { margin: 4px 0; padding-left: 20px; }
.journal-notes-html li { margin-bottom: 2px; }
.journal-notes-html code { background: var(--bg-input); padding: 1px 4px; border-radius: 2px; font-size: 11px; }
.journal-notes-html pre { background: var(--bg-hover); padding: 8px 10px; border-radius: 3px; overflow-x: auto; }
.journal-notes-html pre code { background: none; padding: 0; }
.journal-notes-html mark { background: #4a3a00; color: #ffd700; border-radius: 1px; }
.journal-notes-html hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.journal-notes-html p { margin: 0 0 4px; }

/* ── Group Card ───────────────────────────────────────────────── */
.journal-group-card {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  border-left: 2px solid var(--border);
}
.journal-group-card:hover { background: var(--bg-hover); }
.journal-group-card.selected { background: var(--bg-hover); border-left-color: var(--accent); }

.journal-group-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.journal-group-card-meta {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}

.journal-group-card-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.journal-group-card-pnl {
  font-weight: 600;
}
.journal-group-card-pnl.positive { color: var(--profit); }
.journal-group-card-pnl.negative { color: var(--loss); }

.journal-group-card-date {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 10px;
}

/* ── Header dropdown ──────────────────────────────────────────── */
.journal-new-dropdown {
  position: relative;
  display: inline-block;
}

.journal-new-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-top: 2px;
  min-width: 120px;
  overflow: hidden;
}

.journal-new-dropdown-item {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.journal-new-dropdown-item:hover { background: var(--bg-hover); color: var(--text); }

/* ── Group detail ─────────────────────────────────────────────── */
.journal-group-entries-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.journal-group-entry-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--bg-alt);
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.1s;
}
.journal-group-entry-row:hover { background: var(--bg-hover); }

.journal-group-entry-symbol {
  font-weight: 700;
  color: var(--text);
  min-width: 70px;
}

.journal-group-entry-pnl {
  margin-left: auto;
  font-weight: 600;
}
.journal-group-entry-pnl.positive { color: var(--profit); }
.journal-group-entry-pnl.negative { color: var(--loss); }

.journal-group-remove-entry {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 0 2px;
}
.journal-group-remove-entry:hover { color: var(--loss); }

/* ── Group editor entry selector ──────────────────────────────── */
.journal-entry-selector {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px;
}
.journal-entry-selector::-webkit-scrollbar { width: 4px; }
.journal-entry-selector::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 2px; }

.journal-entry-selector-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 2px;
}
.journal-entry-selector-item:hover { background: var(--bg-hover); }

.journal-entry-selector-item input[type="checkbox"] {
  accent-color: var(--profit);
}

/* ── Multi-select action bar ─────────────────────────────────── */
.journal-multiselect-bar {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  flex-shrink: 0;
}

/* ── Non-selectable UI chrome ────────────────────────────────── */
.journal-section-label,
.journal-detail-meta,
.journal-status-badge,
.journal-card,
.journal-btn,
.journal-field-label,
.journal-trade-cell-label,
.journal-group-card,
.journal-orders-toggle,
.journal-star,
.journal-card-badge,
.journal-overflow-btn,
.journal-search-chip {
  user-select: none;
}
@keyframes yt-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
