/* Shared symbol picker + header controls (dashboard / charts) */

.header-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  padding: 0.375rem 0 0.5rem;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  align-self: center;
  padding-right: 0.5rem;
  margin-right: 0.125rem;
  border-right: 1px solid #1e2128;
}

.header-tools {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.header-tools-right {
  flex: 1 1 auto;
  min-width: min-content;
  justify-content: flex-end;
}

@media (min-width: 1100px) {
  .header-tools-right {
    flex: 0 1 auto;
    margin-left: auto;
  }
}

.header-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
  align-items: stretch;
}

.header-field-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #55606e;
  white-space: nowrap;
  line-height: 1;
  padding-left: 0.125rem;
}

.header-control {
  height: var(--header-control-h, 2.125rem);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.dashboard-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  width: 100%;
  height: var(--header-control-h, 2.125rem);
  padding: 0 2rem 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  color: #f0f2f5;
  background-color: #0c0d11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2355606e' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem 1rem;
  border: 1px solid #1e2128;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.dashboard-select.select-platform {
  width: 7.25rem;
}

.dashboard-select.select-symbol {
  width: auto;
  min-width: 7.5rem;
  max-width: 10.5rem;
}

.dashboard-select:hover {
  border-color: #262a33;
  background-color: #111318;
}

.dashboard-select:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #38bdf8;
  border-radius: 8px;
  border: 1px solid #1e2128;
  background: #0c0d11;
  min-height: var(--header-control-h, 2.125rem);
  cursor: pointer;
}

.header-btn:hover {
  border-color: #262a33;
  background: rgba(255, 255, 255, 0.04);
}

.header-btn.is-busy {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.header-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem;
  border-radius: 8px;
  border: 1px solid #1e2128;
  background: #0c0d11;
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem;
  height: calc(var(--header-control-h, 2.125rem) - 0.25rem);
  font-size: 0.75rem;
  line-height: 1;
  color: #55606e;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.header-nav a:hover {
  color: #8891a0;
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-select.select-sm {
  width: 4.25rem;
  font-family: inherit;
  padding-right: 1.75rem;
}

.dashboard-select option {
  background: #111318;
  color: #f0f2f5;
  padding: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

.header-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.625rem;
  font-size: 0.75rem;
  line-height: 1;
  min-width: 5.5rem;
  font-family: 'JetBrains Mono', monospace;
  color: #f0f2f5;
  border-radius: 8px;
  border: 1px solid #1e2128;
  background: #0c0d11;
}

.header-vdivider {
  width: 1px;
  align-self: flex-end;
  height: calc(var(--header-control-h, 2.125rem) + 0.85rem);
  background: #1e2128;
  flex-shrink: 0;
  margin: 0 0.125rem;
}

.export-link {
  display: inline-flex;
  align-items: center;
  height: calc(var(--header-control-h, 2.125rem) - 0.25rem);
  padding: 0 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #55606e;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.export-link:hover {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.2);
}

.header-nav a.active {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
}

.symbol-picker {
  position: relative;
  z-index: 1;
}

.symbol-picker.is-open {
  z-index: 200;
}

.symbol-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  text-align: left;
}

.symbol-picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
}

.symbol-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.symbol-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1e2128;
  color: #8891a0;
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
}

.symbol-icon-wrap--trigger,
.symbol-icon-wrap--list {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.symbol-icon-fallback--trigger,
.symbol-icon-fallback--list {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #1e2128;
  color: #8891a0;
  font-size: 9px;
  font-weight: 600;
}

.symbol-icon--trigger,
.symbol-icon--list {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  object-fit: cover;
}

.symbol-icon--failed {
  display: none !important;
}

.symbol-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 210;
  width: 16rem;
  max-height: 22rem;
  padding: 0.375rem;
  border-radius: 8px;
  border: 1px solid #1e2128;
  background: #111318;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.symbol-picker-menu.hidden {
  display: none;
}

.symbol-picker-search {
  width: 100%;
  margin-bottom: 0.375rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  color: #f0f2f5;
  background: #0c0d11;
  border: 1px solid #1e2128;
  border-radius: 6px;
  box-sizing: border-box;
}

.symbol-picker-search:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.symbol-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 17rem;
  overflow-y: auto;
}

.symbol-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
}

.symbol-picker-item-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.symbol-picker-vol {
  flex-shrink: 0;
  font-size: 10px;
  color: #55606e;
  font-family: 'JetBrains Mono', monospace;
}

.symbol-picker-item:hover,
.symbol-picker-item:focus {
  background: rgba(14, 165, 233, 0.1);
  outline: none;
}

.symbol-picker-item.hidden {
  display: none;
}

.symbol-picker-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  color: #8891a0;
  font-size: 0.75rem;
  list-style: none;
}

.symbol-picker-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #1e2128;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: symbol-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes symbol-spin {
  to { transform: rotate(360deg); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
