/* ============================================================
   VALOR TERMINAL — Bloomberg-grade comparison view
   Inherits CSS variables from style.css (cream/green/gold)
   But this page flips to a dark terminal palette overlay.
   ============================================================ */

:root {
  --t-bg: #07090c;
  --t-bg-panel: #0c1014;
  --t-bg-elev: #11161c;
  --t-line: rgba(200,160,66,0.14);
  --t-line-strong: rgba(200,160,66,0.32);
  --t-grid: rgba(244,236,216,0.06);
  --t-text: #F4ECD8;
  --t-text-dim: rgba(244,236,216,0.6);
  --t-text-mute: rgba(244,236,216,0.38);
  --t-gold: #C8A042;
  --t-gold-bright: #E8B66A;
  --t-green: #4ade80;
  --t-red: #ef4444;
  --t-cyan: #38bdf8;
  --t-violet: #a78bfa;
}

.terminal-body {
  margin: 0;
  background: var(--t-bg);
  color: var(--t-text);
  font-family: 'Source Sans 3', -apple-system, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.t-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 28px;
  background: linear-gradient(180deg, #0a0f15 0%, #07090c 100%);
  border-bottom: 1px solid var(--t-line-strong);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
}
.t-brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--t-text);
  font-family: 'Source Serif 4', Georgia, serif;
}
.t-brand__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1.5px solid var(--t-gold);
  color: var(--t-gold-bright);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
}
.t-brand__name {
  font-size: 17px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
}
.t-brand__name em { font-style: italic; font-weight: 400; color: var(--t-gold-bright); letter-spacing: 0.08em; }

.t-topbar__center {
  display: inline-flex; align-items: center; gap: 18px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--t-text-dim); letter-spacing: 0.08em;
}
.t-pill {
  padding: 4px 10px; border: 1px solid var(--t-gold);
  color: var(--t-gold-bright);
  font-size: 10px; letter-spacing: 0.24em; font-weight: 600;
  text-transform: uppercase;
  position: relative;
}
.t-pill::before {
  content:''; display:inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--t-green); margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 10px var(--t-green);
  animation: t-pulse 2s infinite ease-in-out;
}
@keyframes t-pulse { 0%,100% {opacity:1;} 50% {opacity:0.35;} }
.t-clock { color: var(--t-text); font-weight: 600; }
.t-session { color: var(--t-gold-bright); font-weight: 600; }

.t-topbar__right { text-align: right; }
.t-back {
  color: var(--t-text-dim); text-decoration: none;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  transition: color .15s ease;
}
.t-back:hover { color: var(--t-gold-bright); }

/* ============================================================
   TICKER STRIP
   ============================================================ */
.t-ticker {
  background: #0a0f15;
  border-bottom: 1px solid var(--t-line);
  overflow: hidden;
  position: relative;
  height: 38px;
}
.t-ticker__rail {
  display: inline-flex; align-items: center;
  height: 38px;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding-left: 100%;
  animation: t-marquee 90s linear infinite;
}
.t-ticker__rail:hover { animation-play-state: paused; }
@keyframes t-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.t-ticker__item {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 28px;
  border-right: 1px solid var(--t-line);
}
.t-ticker__sym { color: var(--t-gold-bright); font-weight: 700; letter-spacing: 0.08em; }
.t-ticker__price { color: var(--t-text); font-weight: 600; }
.t-ticker__chg { font-weight: 600; }
.t-ticker__chg.up { color: var(--t-green); }
.t-ticker__chg.dn { color: var(--t-red); }
.t-ticker__loading { padding: 0 28px; color: var(--t-text-mute); font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.12em; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.t-main {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1px;
  background: var(--t-line);
  min-height: calc(100vh - 200px);
}

.t-chart-region {
  background: var(--t-bg);
  padding: 20px 24px 24px;
  display: flex; flex-direction: column;
  min-width: 0;
}

.t-side {
  background: var(--t-bg-panel);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  border-left: 1px solid var(--t-line);
}

/* ============================================================
   COMMAND BAR
   ============================================================ */
.t-cmdbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 24px;
  padding: 12px 16px;
  background: var(--t-bg-elev);
  border: 1px solid var(--t-line);
  margin-bottom: 12px;
}
.t-cmdbar__group { display: inline-flex; align-items: center; gap: 12px; }
.t-cmdbar__group--right { margin-left: auto; }
.t-cmdbar__label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--t-text-mute); letter-spacing: 0.24em; font-weight: 600;
}
.t-cmdbar__btns { display: inline-flex; gap: 2px; }
.t-cmdbar__btns button {
  background: transparent;
  border: 1px solid var(--t-line);
  color: var(--t-text-dim);
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all .15s ease;
}
.t-cmdbar__btns button:hover {
  color: var(--t-gold-bright);
  border-color: var(--t-line-strong);
}
.t-cmdbar__btns button.active {
  background: var(--t-gold);
  border-color: var(--t-gold);
  color: #0c1218;
}
.t-updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--t-text); font-weight: 600;
}

/* ============================================================
   ASSET TOGGLES
   ============================================================ */
.t-assets {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.t-asset {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--t-bg-elev);
  border: 1px solid var(--t-line);
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--t-text-dim);
}
.t-asset:hover { border-color: var(--t-line-strong); color: var(--t-text); }
.t-asset.on { color: var(--t-text); border-color: var(--t-line-strong); background: #0e1318; }
.t-asset__dot { width: 9px; height: 9px; border-radius: 0; }
.t-asset.off .t-asset__dot { opacity: 0.25; }
.t-asset__label { font-weight: 700; }
.t-asset__chg { font-weight: 500; color: var(--t-text-mute); }
.t-asset.on .t-asset__chg.up { color: var(--t-green); }
.t-asset.on .t-asset__chg.dn { color: var(--t-red); }

/* ============================================================
   CHART
   ============================================================ */
.t-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 480px;
  background:
    linear-gradient(180deg, #0a0f15 0%, #07090c 100%);
  border: 1px solid var(--t-line);
}
#t-chart { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; -webkit-user-select: none; user-select: none; }

/* Touch hint chip — visible on mobile until first interaction */
.t-touch-hint {
  position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(200,160,66,0.14);
  border: 1px solid rgba(232,182,106,0.55);
  color: var(--t-gold-bright);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 700;
  pointer-events: none;
  z-index: 6;
  border-radius: 2px;
  animation: t-pulse-hint 2.2s ease-in-out infinite;
  white-space: nowrap;
}
.t-touch-hint__icon { font-size: 13px; line-height: 1; }
.t-touch-hint.hidden { display: none !important; animation: none; }
@keyframes t-pulse-hint {
  0%, 100% { opacity: 0.55; box-shadow: 0 0 0 0 rgba(232,182,106,0); }
  50% { opacity: 1; box-shadow: 0 0 14px rgba(232,182,106,0.45); }
}
.t-crosshair {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: rgba(232,182,106,0.45); pointer-events: none;
  display: none;
}
.t-readout {
  position: absolute;
  background: rgba(7,9,12,0.96);
  border: 1px solid var(--t-line-strong);
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  min-width: 200px;
  pointer-events: none;
  display: none;
  z-index: 5;
}
.t-readout__head {
  color: var(--t-gold-bright); font-weight: 700;
  letter-spacing: 0.08em; margin-bottom: 6px;
  padding-bottom: 6px; border-bottom: 1px solid var(--t-line);
}
.t-readout__row {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 8px;
  padding: 2px 0; align-items: center;
}
.t-readout__row .dot { width: 8px; height: 8px; }
.t-readout__row .sym { color: var(--t-text); }
.t-readout__row .val { color: var(--t-text); font-weight: 600; }
.t-readout__row .val.up { color: var(--t-green); }
.t-readout__row .val.dn { color: var(--t-red); }

.t-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--t-text-mute);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 0.16em;
}

/* ============================================================
   AXIS (date labels under chart)
   ============================================================ */
.t-axis {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--t-text-mute);
  letter-spacing: 0.08em;
}

/* ============================================================
   SIDE PANELS
   ============================================================ */
.t-panel {
  background: var(--t-bg-elev);
  border: 1px solid var(--t-line);
}
.t-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: #0a0f15;
  border-bottom: 1px solid var(--t-line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--t-gold);
}
.t-panel__sub { color: var(--t-text-mute); font-weight: 600; letter-spacing: 0.14em; }
.t-panel__pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--t-green);
  box-shadow: 0 0 8px var(--t-green);
  animation: t-pulse 2s infinite ease-in-out;
}
.t-table { padding: 4px 0; }
.t-row {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--t-line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.t-row:last-child { border-bottom: none; }
.t-row__dot { width: 8px; height: 8px; }
.t-row__sym { font-weight: 700; color: var(--t-text); letter-spacing: 0.06em; }
.t-row__sym .sub { display: block; color: var(--t-text-mute); font-weight: 500; font-size: 10px; letter-spacing: 0.02em; margin-top: 2px; }
.t-row__px { color: var(--t-text); font-weight: 600; text-align: right; }
.t-row__chg { font-weight: 700; text-align: right; }
.t-row__chg.up { color: var(--t-green); }
.t-row__chg.dn { color: var(--t-red); }
.t-row__chg.flat { color: var(--t-text-mute); }

/* ============================================================
   NARRATIVE
   ============================================================ */
.t-panel--narrative .t-narrative { padding: 16px 18px; }
.t-narrative p {
  margin: 0 0 12px 0;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--t-text-dim);
  font-style: italic;
}
.t-narrative p:last-child { margin-bottom: 0; }
.t-narrative__cta { font-style: normal !important; padding-top: 8px; }
.t-narrative__cta a {
  color: var(--t-gold-bright);
  text-decoration: none;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease;
}
.t-narrative__cta a:hover { border-bottom-color: var(--t-gold-bright); }

/* ============================================================
   FOOTER
   ============================================================ */
.t-foot {
  border-top: 1px solid var(--t-line-strong);
  padding: 20px 28px;
  background: #050709;
  display: grid; grid-template-columns: auto 1fr; gap: 24px;
}
.t-foot__brand {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 12px;
  color: var(--t-gold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.6;
}
.t-foot__legal {
  font-size: 10.5px;
  color: var(--t-text-mute);
  line-height: 1.7;
  max-width: 80ch;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .t-main { grid-template-columns: 1fr; }
  .t-side { border-left: none; border-top: 1px solid var(--t-line); }
}
@media (max-width: 720px) {
  .t-topbar { grid-template-columns: 1fr auto; padding: 12px 16px; gap: 12px; }
  .t-topbar__center { display: none; }
  .t-brand__name { font-size: 14px; }
  .t-chart-region { padding: 14px; }
  .t-side { padding: 14px; }
  .t-cmdbar { gap: 14px; padding: 10px; }
  .t-cmdbar__group--right { width: 100%; margin-left: 0; justify-content: space-between; }
  .t-foot { grid-template-columns: 1fr; padding: 16px; }
  .t-chart-wrap { min-height: 380px; }

  /* Show the touch hint on mobile only */
  .t-touch-hint { display: inline-flex; }

  /* Boost readout panel on mobile — bigger, more readable, never offscreen */
  .t-readout {
    font-size: 12px;
    min-width: 180px;
    max-width: calc(100vw - 60px);
    padding: 11px 13px;
    background: rgba(7,9,12,0.985);
    border: 1px solid var(--t-gold);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 0 1px rgba(232,182,106,0.18);
  }
  .t-readout__head { font-size: 11px; }
  .t-readout__row { gap: 10px; padding: 3px 0; }
}

/* Pointer-coarse detection (touch devices regardless of width) */
@media (hover: none) and (pointer: coarse) {
  #t-chart { cursor: default; }
  .t-touch-hint { display: inline-flex; }
}
