@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Keep in sync with src/app/globals.css — this sheet loads in the TradingView iframe. */
  --success: #27de9d;
  --danger: #f24141;
  --primary: #3b82f6;
  --border: #1e221e;
  --tv-color-platform-background: #070a08;
  --tv-color-pane-background: #080b09;
  --tv-color-toolbar-button-background-hover: #101210;
  --tv-color-toolbar-button-background-expanded: #101210;
  --tv-color-toolbar-button-background-active: transparent;
  --tv-color-toolbar-button-background-active-hover: #101210;
  --tv-color-toolbar-button-text: #99a29a;
  --tv-color-toolbar-button-text-hover: #f0f5f1;
  --tv-color-toolbar-button-text-active: #ffffff;
  --tv-color-toolbar-button-text-active-hover: #ffffff;
  --tv-color-item-active-text: #ffffff;
  --tv-color-toolbar-toggle-button-background-active: #8c8a82;
  --tv-color-toolbar-toggle-button-background-active-hover: #a3a3a3;
}

/* Selected interval / toolbar items: keep active text, drop the filled pill. */
button[class*='isActive'][class*='isInteractive']::before,
[role='button'][class*='isActive'][class*='isInteractive']::before {
  background-color: transparent !important;
}

/* Selected timeframe: white + one step heavier than default (400 → 600). */
button[class*='isActive'][class*='isInteractive']:not(.nfa-chart-filter-button):not(.nfa-chart-bubbles-button),
[role='button'][class*='isActive'][class*='isInteractive']:not(.nfa-chart-filter-button):not(.nfa-chart-bubbles-button),
button[aria-checked='true'][class*='isInteractive']:not(.nfa-chart-filter-button):not(.nfa-chart-bubbles-button),
[role='radio'][aria-checked='true'] {
  color: #ffffff !important;
  font-weight: 600 !important;
}

html,
body {
  background: #070a08 !important;
  font-family: 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

button:not(:disabled),
a[href],
[role='button']:not([aria-disabled='true']),
[role='radio']:not([aria-disabled='true']),
[role='option']:not([aria-disabled='true']),
[role='row'][aria-level] {
  cursor: pointer !important;
}

button[data-name='toolbar-drawing-toggle-button'] path[class*='background'] {
  fill: rgba(0, 0, 0, 0.1) !important;
  stroke: var(--border) !important;
}

button[data-name='toolbar-drawing-toggle-button'] path[class*='arrow'] {
  stroke: #ffffff !important;
}

button[data-name='toolbar-drawing-toggle-button']:hover path[class*='arrow'] {
  stroke: var(--primary) !important;
}

[data-name='time-zone-menu'] {
  display: none !important;
}

div:has(> div > [data-name='time-zone-menu'])
  + div:has(> span[class*='separator-']) {
  display: none !important;
}

/* Hide vertical group dividers in the top chart toolbar. */
[class*='innerWrap-'] > [class*='separatorWrap-'],
[class*='innerWrap-'] > div:has(> span[class*='separator-']) {
  display: none !important;
}

/* Desktop: keep the first interval (1m) off the left chart edge. */
@media (min-width: 601px) {
  [class*='innerWrap-'] {
    padding-inline-start: 4px;
  }
}

.nfa-fullscreen-toggle {
  display: flex !important;
  height: 100% !important;
  min-width: 48px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--tv-color-toolbar-button-text) !important;
  cursor: pointer !important;
}

.nfa-fullscreen-toggle:hover {
  background: var(--tv-color-toolbar-button-background-hover) !important;
  color: var(--tv-color-toolbar-button-text-hover) !important;
}

.nfa-fullscreen-toggle[aria-pressed='true'] {
  background: var(--tv-color-toolbar-button-background-active) !important;
  color: var(--tv-color-toolbar-button-text-active) !important;
}

.nfa-hidden-fullscreen-separator {
  display: none !important;
}

.nfa-hidden-native-fullscreen-slot {
  display: none !important;
}

.nfa-fullscreen-overlay-root {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
}

.nfa-fullscreen-modal-host {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  pointer-events: none;
}

.nfa-fullscreen-trade-card,
.nfa-fullscreen-earnings-card {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  color: #f0f5f1;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  backdrop-filter: blur(8px);
}

.nfa-fullscreen-earnings-card {
  width: 300px;
  padding: 12px 14px;
  border: 1px solid #1E221E;
  border-radius: 12px;
  background: rgb(16 18 16 / 0.97);
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  text-align: left;
}

.nfa-earnings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nfa-earnings-card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nfa-earnings-card-avatar {
  position: relative;
  display: inline-flex;
  box-sizing: border-box;
  height: 32px !important;
  width: 32px !important;
  max-height: 32px !important;
  max-width: 32px !important;
  flex: 0 0 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #1E221E;
  border-radius: 9999px;
  background: #131413;
  color: #a7f3d0;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.nfa-earnings-card-avatar img {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  box-sizing: border-box;
  height: 32px !important;
  width: 32px !important;
  max-height: 32px !important;
  max-width: 32px !important;
  object-fit: contain;
}

.nfa-earnings-card-names {
  min-width: 0;
}

.nfa-earnings-card-names strong {
  display: block;
  overflow: hidden;
  color: #edf5ef;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nfa-earnings-card-company {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #8a938c;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nfa-earnings-card-meta {
  flex-shrink: 0;
  text-align: right;
}

.nfa-earnings-card-kicker {
  display: block;
  color: #7e887f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nfa-earnings-card-meta time {
  display: block;
  margin-top: 2px;
  color: #edf5ef;
  font-size: 11px;
  white-space: nowrap;
}

.nfa-earnings-card-results,
.nfa-earnings-card-prediction {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #1E221E;
}

.nfa-earnings-card-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #aab4ad;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.nfa-earnings-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.nfa-earnings-result strong {
  font-weight: 700;
}

.nfa-positive {
  color: var(--success);
}

.nfa-negative {
  color: var(--danger);
}

.nfa-earnings-prediction-hero {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.nfa-earnings-prediction-hero strong {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.nfa-earnings-prediction-hero span {
  color: #edf5ef;
  font-size: 14px;
}

.nfa-earnings-prediction-bar {
  margin-top: 10px;
  height: 6px;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background: #0c0c0c;
}

.nfa-earnings-prediction-bar-fill {
  height: 100%;
  border-radius: 9999px;
}

.nfa-positive-fill {
  background: var(--success);
}

.nfa-negative-fill {
  background: var(--danger);
}

.nfa-earnings-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #7e887f;
  font-size: 10px;
}

.nfa-earnings-card-footer.is-stale {
  color: rgb(252 211 77 / 0.8);
}

.nfa-earnings-card-footer span:last-child {
  text-align: right;
}

.nfa-earnings-card-muted {
  margin-top: 12px;
  color: #7e887f;
  font-size: 10px;
}

.nfa-earnings-card-prediction > .nfa-earnings-card-muted {
  margin-top: 0;
}

.nfa-fullscreen-trade-card {
  padding: 8px 12px;
  border: 1px solid #1E221E;
  border-radius: 6px;
  background: rgb(23 27 36 / 0.95);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  white-space: nowrap;
}

.nfa-fullscreen-trade-card .nfa-long {
  color: var(--success);
}

.nfa-fullscreen-trade-card .nfa-short {
  color: var(--danger);
}

.nfa-fullscreen-trade-card time {
  display: block;
  margin-top: 4px;
  color: #8e96a0;
  font-size: 9px;
}
.nfa-chart-filter-button,
.nfa-chart-bubbles-button {
  align-items: center;
  color: var(--tv-color-toolbar-button-text) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  gap: 7px;
  height: calc(100% - 8px) !important;
  box-sizing: border-box;
  border-radius: 10px;
  margin-block: 4px;
  padding-inline: 10px !important;
  touch-action: manipulation;
  user-select: none;
  white-space: nowrap;
}

.nfa-chart-filter-button span,
.nfa-chart-bubbles-button span {
  color: inherit !important;
  font-weight: inherit !important;
}

.nfa-chart-filter-button:hover,
.nfa-chart-bubbles-button:hover {
  background: var(--tv-color-toolbar-button-background-hover) !important;
  color: var(--tv-color-toolbar-button-text-hover) !important;
}

.nfa-chart-filter-chevron {
  font-size: 11px;
}

.nfa-chart-filter-menu {
  background: #101210;
  border: 1px solid #1E221E;
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
  max-height: min(420px, calc(100vh - 56px));
  max-width: calc(100vw - 16px);
  min-width: 224px;
  overflow-y: auto;
  padding: 5px;
  position: fixed;
  z-index: 10000;
}

.nfa-chart-filter-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: #c5cdc6;
  cursor: pointer;
  display: flex;
  font: 500 13px/1.2 Inter, sans-serif;
  gap: 9px;
  padding: 9px 10px;
  text-align: left;
  touch-action: manipulation;
  user-select: none;
  width: 100%;
}

.nfa-chart-filter-option:hover {
  background: color-mix(in srgb, var(--success) 8%, transparent);
  color: #fff;
}

.nfa-chart-filter-indicator {
  align-items: center;
  border: 1px solid #637068;
  border-radius: 50%;
  color: var(--success);
  display: inline-flex;
  font-size: 9px;
  height: 15px;
  justify-content: center;
  width: 15px;
}

.nfa-chart-filter-option[aria-checked='true'] .nfa-chart-filter-indicator {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
}

@media (max-width: 600px) {
  .nfa-chart-filter-button,
  .nfa-chart-bubbles-button {
    font-size: 12px !important;
    min-height: 36px;
    padding-inline: 4px !important;
  }

  .nfa-chart-filter-button {
    gap: 4px;
  }

  .nfa-chart-bubbles-button {
    gap: 0;
  }

  div:has(> .nfa-chart-filter-button),
  div:has(> .nfa-chart-bubbles-button) {
    min-width: 0 !important;
    padding-inline: 0 !important;
  }

  .nfa-chart-filter-menu {
    left: 8px !important;
    min-width: min(224px, calc(100vw - 16px));
  }

  .nfa-chart-filter-option {
    min-height: 44px;
    padding: 10px 12px;
  }
}

/* Mobile: collapse the TradingView header so host overlay owns chrome. */
html.nfa-hide-header [id='header-toolbar'],
html.nfa-hide-header [data-name='header-toolbar'],
html.nfa-hide-header .layout__area--top,
html.nfa-hide-header [class*='layout__area--top'],
html.nfa-hide-header [class*='innerWrap-'],
html.nfa-hide-header [class*='header-toolbar'] {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  border: 0 !important;
  pointer-events: none !important;
}

/* Mobile: collapse the time-axis row (table cells ignore height:0) and paint leftovers
   with the app background so no gray strip sits between price labels and host chips. */
html.nfa-hide-scales,
html.nfa-hide-scales body {
  background: #050806 !important;
  background-color: #050806 !important;
}

html.nfa-hide-scales .chart-markup-table.time-axis,
html.nfa-hide-scales [class*='timeAxis-'],
html.nfa-hide-scales [class*='time-axis'],
html.nfa-hide-scales [class*='timeAxisWrap-'],
html.nfa-hide-scales [class*='timeAxisStub-'],
html.nfa-hide-scales [class*='priceAxisStub-'] {
  display: none !important;
  height: 0 !important;
  max-height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  color: transparent !important;
  background: #050806 !important;
  background-color: #050806 !important;
}

html.nfa-hide-scales .chart-markup-table.price-axis,
html.nfa-hide-scales [class*='price-axis-container'],
html.nfa-hide-scales [class*='priceAxis-'] {
  background: #050806 !important;
  background-color: #050806 !important;
}
