/* ── Shared navigation bar ────────────────────────────────────────────── */

#main-nav {
  border-bottom: 1px solid #1f2937;
  background: #030712;
  margin-bottom: 1.5rem;
}

.nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: #f3f4f6;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-logo:hover {
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.3rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #9ca3af;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: #e5e7eb;
  background: rgba(55, 65, 81, 0.4);
}

.nav-link-active {
  color: #f3f4f6;
  background: #1f2937;
}

.nav-search {
  position: relative;
  flex-shrink: 1;
  min-width: 0;
}

.nav-search input {
  width: 200px;
  max-width: 100%;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: #e5e7eb;
  outline: none;
  transition: border-color 0.15s ease;
}

.nav-search input::placeholder {
  color: #6b7280;
}

.nav-search input:focus {
  border-color: #6b7280;
}

.nav-search-spinner {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
}

.nav-search-error {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
}

.nav-search-dropdown {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  overflow: hidden;
  z-index: 50;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.nav-search-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #e5e7eb;
  cursor: pointer;
  transition: background 0.1s ease;
}

.nav-search-dropdown-item:hover {
  background: #374151;
}

.nav-search-dropdown-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #6b7280;
}

@media (max-width: 640px) {
  .nav-inner {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }
  .nav-links {
    gap: 0.125rem;
  }
  .nav-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  .nav-search input {
    width: 140px;
  }
}

/* ── Journal page ────────────────────────────────────────────────────── */

.journal-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.journal-controls input[type="date"] {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: #e5e7eb;
  outline: none;
  transition: border-color 0.15s ease;
}

.journal-controls input[type="date"]:focus {
  border-color: #6b7280;
}

.journal-controls button {
  padding: 0.375rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #1f2937;
  color: #e5e7eb;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.journal-controls button:hover {
  border-color: #6b7280;
  background: #374151;
}

.journal-entry {
  border: 1px solid #1f2937;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: rgba(17, 24, 39, 0.3);
  transition: border-color 0.15s ease;
}

.journal-entry:hover {
  border-color: #374151;
}

.journal-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.journal-date {
  font-size: 0.8125rem;
  color: #9ca3af;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.journal-type-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid;
}

.badge-pre-market {
  color: #93c5fd;
  border-color: #1e40af;
  background: rgba(30, 64, 175, 0.2);
}

.badge-after-close {
  color: #c4b5fd;
  border-color: #5b21b6;
  background: rgba(91, 33, 182, 0.2);
}

.regime-badge-sm {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.journal-narrative {
  line-height: 1.75;
  color: #d1d5db;
}

.journal-narrative p {
  margin-bottom: 1rem;
}

.journal-narrative p:last-child {
  margin-bottom: 0;
}

.journal-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1f2937;
}

/* Skeleton loading animation */
.skeleton {
  background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Narrative paragraph spacing */
.narrative p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.narrative p:last-child {
  margin-bottom: 0;
}

/* Period toggle buttons */
.period-btn {
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1px solid #374151;
  background: transparent;
  color: #9ca3af;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.period-btn:hover {
  border-color: #6b7280;
  color: #e5e7eb;
}

.period-btn.active {
  background: #1f2937;
  border-color: #6b7280;
  color: #f3f4f6;
}

/* Asset cards */
.asset-card {
  border: 1px solid #374151;
  background: rgba(17, 24, 39, 0.5);
  border-radius: 0.5rem;
  padding: 0.875rem;
  transition: border-color 0.15s ease;
  cursor: pointer;
}

.asset-card:hover {
  border-color: #6b7280;
}

/* Sparkline container */
.sparkline-container {
  width: 80px;
  height: 32px;
  flex-shrink: 0;
  position: relative;
}

/* Info tooltip */
.info-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.info-btn:hover {
  color: #9ca3af;
}

.info-tooltip {
  border-top: 1px solid #374151;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .max-w-4xl {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  header h1 {
    font-size: 1.25rem;
  }
}

/* ── Chart page ───────────────────────────────────────────────────────── */

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #374151;
  align-items: center;
}

.toggle-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #374151;
  background: transparent;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.toggle-btn:hover {
  border-color: #6b7280;
  color: #d1d5db;
  background: rgba(55, 65, 81, 0.3);
}

.toggle-btn.active {
  background: #1f2937;
  border-color: #6b7280;
  color: #f3f4f6;
}

/* MA color dot in toggle button */
.ma-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Zoom buttons */
.zoom-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  border: 1px solid #374151;
  background: transparent;
  color: #9ca3af;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.zoom-btn:hover {
  border-color: #6b7280;
  color: #e5e7eb;
  background: rgba(55, 65, 81, 0.3);
}

/* OHLC label styling */
.ohlc-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ohlc-label {
  color: #6b7280;
  font-size: 0.6875rem;
}

.crosshair-ohlc {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.8125rem;
  color: #d1d5db;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  min-height: 1.5rem;
  align-items: center;
}

.chart-box {
  border: 1px solid #374151;
  border-radius: 0.5rem;
  overflow: hidden;
}

#chart-container {
  height: 500px;
}

.rsi-box {
  margin-top: 0.5rem;
  height: 150px;
}

.price-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid #374151;
}

.price-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.price-stats .stat-label {
  font-size: 0.6875rem;
  color: #6b7280;
  text-transform: uppercase;
}

.price-stats .stat-value {
  font-size: 0.875rem;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (max-width: 640px) {
  #chart-container {
    height: 350px;
  }
  .rsi-box {
    height: 120px;
  }
  .chart-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
}
