/* Video analysis (/video_analyses/:id)
   One video read as a set of scored calls. Construction follows the influencer
   profile board: an identity masthead, a hairline scoreboard carrying the
   figure the page exists to report, then the calls themselves as the body of
   the page. The transcript is the receipt, not the content — it sits last,
   folded away, and every quote can jump into it. */

/* ============ Masthead ============ */
.vanalysis-masthead {
  padding: 1.5rem 0 0;
}

.vanalysis-utility {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.25rem;
}

.vanalysis-back {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.1rem;
  transition: color 0.15s ease;
}
.vanalysis-back:hover { color: var(--text-bright); }
.vanalysis-back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-radius: 2px;
}

.vanalysis-identity {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  gap: 1.75rem;
  margin-bottom: 2rem;
}
.vanalysis-identity--bare {
  grid-template-columns: minmax(0, 1fr);
}

/* The still is the video's identity and its way out to the source, so the
   whole frame is the link rather than a caption beneath it. */
.vanalysis-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-highlight);
  transition: border-color 0.15s ease;
}
.vanalysis-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vanalysis-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-bright);
  background: rgba(11, 14, 12, 0.55);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.vanalysis-thumb-play svg {
  width: 2.25rem;
  height: 2.25rem;
}
.vanalysis-thumb:hover { border-color: var(--text-muted); }
.vanalysis-thumb:hover .vanalysis-thumb-play { opacity: 1; }
.vanalysis-thumb:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.vanalysis-thumb:focus-visible .vanalysis-thumb-play { opacity: 1; }

.vanalysis-identity-text {
  min-width: 0;
}

.vanalysis-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  /* A video title runs far longer than the channel name the profile masthead
     carries, so it tops out below .profile-name's 3.4rem. */
  font-size: clamp(2.1rem, 3.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: 0.005em;
  color: var(--text-bright);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.vanalysis-byline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.vanalysis-byline-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-highlight);
}
.vanalysis-byline-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vanalysis-byline-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease;
}
a.vanalysis-byline-name:visited { color: var(--text-bright); }
a.vanalysis-byline-name:hover {
  color: var(--primary);
  border-color: var(--primary);
}
a.vanalysis-byline-name:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow: 0 0 0 3px var(--ring);
}

/* Provenance row: state, source, and when we pulled it — the three things a
   skeptical reader checks before trusting the board below. */
.vanalysis-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.vanalysis-status {
  padding: 0.3rem 0.55rem;
  border-radius: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-surface);
}
.vanalysis-status--analyzed {
  color: var(--success);
  border-color: rgba(93, 169, 122, 0.35);
  background: rgba(93, 169, 122, 0.1);
}
.vanalysis-status--pending,
.vanalysis-status--transcribed {
  color: var(--warning);
  border-color: rgba(201, 164, 92, 0.35);
  background: rgba(201, 164, 92, 0.1);
}
.vanalysis-status--failed,
.vanalysis-status--analysis_failed {
  color: var(--danger);
  border-color: rgba(194, 95, 76, 0.35);
  background: rgba(194, 95, 76, 0.1);
}

.vanalysis-source-link {
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.15s ease;
}
.vanalysis-source-link::after {
  content: ' ↗';
  color: var(--text-muted);
}
.vanalysis-source-link:hover { color: var(--success); }
.vanalysis-source-link:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow: 0 0 0 3px var(--ring);
}

.vanalysis-source-stamp {
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.vanalysis-source-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ============ Scoreboard strip ============ */
.vanalysis-board {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  margin: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.vanalysis-cell {
  padding: 1.1rem 1.25rem;
  border-left: 1px solid var(--border);
  min-width: 0;
}
.vanalysis-cell:first-child {
  padding-left: 0;
  border-left: 0;
}

.vanalysis-cell dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-muted);
}

.vanalysis-cell dd {
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
}

/* The video's return is what the page exists to report; the other cells are
   the evidence standing behind it. */
.vanalysis-cell dd.vanalysis-figure {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  /* pt and fr write the decimal as a comma, and a monospace comma occupies a
     full advance — at display size the separator reads as its own token. */
  letter-spacing: -0.03em;
}
.vanalysis-figure.positive { color: var(--success); }
.vanalysis-figure.negative { color: var(--danger); }
.vanalysis-figure-empty { color: var(--text-dim); }

.vanalysis-split-rule { color: var(--text-dim); margin: 0 0.15rem; }
.vanalysis-split-buy { color: var(--success); }
.vanalysis-split-sell { color: var(--danger); }
/* A side nobody called is an absence, not a loss — it must not read as red. */
.vanalysis-split-none { color: var(--text-dim); }

/* ============ Calls ============ */
.vanalysis-calls {
  background: var(--bg-main);
  padding: 2.75rem 0 0;
}

.vanalysis-calls .board-heading {
  margin-bottom: 0.75rem;
}

.vcalls {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.vcall {
  padding: 1.75rem;
}
.vcall + .vcall {
  border-top: 1px solid var(--border);
}

.vcall-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.vcall-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}
.vcall-index::after {
  content: ' /';
}

.vcall-ticker {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-bright);
  text-decoration: none;
  transition: color 0.15s ease;
}
.vcall-ticker:visited { color: var(--text-bright); }
.vcall-ticker:hover { color: var(--primary); }
.vcall-ticker:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow: 0 0 0 3px var(--ring);
}

.vcall-exchange {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.2rem 0.45rem;
}

.vcall-action {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-radius: 2px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
}
.vcall-action--buy {
  color: var(--success);
  border-color: rgba(93, 169, 122, 0.35);
  background: rgba(93, 169, 122, 0.1);
}
.vcall-action--sell {
  color: var(--danger);
  border-color: rgba(194, 95, 76, 0.35);
  background: rgba(194, 95, 76, 0.1);
}

/* The call's own return closes the row on the right — the number that answers
   whether this pick worked. */
.vcall-move {
  margin-left: auto;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.vcall-move.positive { color: var(--success); }
.vcall-move.negative { color: var(--danger); }

/* Entry, current, result — the receipt behind the percentage above. */
.vcall-prices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.vcall-price {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1.1rem;
  border-left: 1px solid var(--border-light);
  min-width: 0;
}
.vcall-price:first-child { border-left: 0; }

.vcall-price-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.vcall-price-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
}
.vcall-price-value.positive { color: var(--success); }
.vcall-price-value.negative { color: var(--danger); }

.vcall-price-note {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* What was actually said. A hairline rule marks it as quoted material; the
   colour bar this replaced claimed a caution the sentence never carried. */
.vcall-quote {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 1.25rem 0 0;
  padding-left: 1.1rem;
  border-left: 1px solid var(--border);
}
.vcall-quote p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-bright);
  max-width: 68ch;
}
.vcall-quote p::before { content: '“'; }
.vcall-quote p::after { content: '”'; }

.vcall-jump {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.vcall-jump svg {
  width: 0.85rem;
  height: 0.85rem;
  transition: transform 0.15s ease;
}
.vcall-jump:hover {
  background: var(--bg-highlight);
  border-color: var(--text-muted);
  color: var(--text-bright);
}
.vcall-jump:hover svg { transform: translateY(2px); }
.vcall-jump:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.vcall-context {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 72ch;
}
.vcall-context-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-right: 0.5rem;
}

.vanalysis-notice {
  margin: 0;
  padding: 1.75rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}

/* ============ Transcript ============ */
.vanalysis-transcript {
  background: var(--bg-main);
  padding: 2.75rem 0 0;
}

.vtranscript {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.vtranscript-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  color: var(--text-bright);
  transition: background 0.15s ease;
}
.vtranscript-summary::-webkit-details-marker { display: none; }
.vtranscript-summary:hover { background: var(--bg-highlight); }
.vtranscript-summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--primary), 0 0 0 3px var(--ring);
}

.vtranscript-summary-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.vtranscript-chevron {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.vtranscript[open] .vtranscript-chevron { transform: rotate(180deg); }

.vtranscript-body {
  max-height: 520px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}
.vtranscript-body::-webkit-scrollbar { width: 4px; }
.vtranscript-body::-webkit-scrollbar-thumb { background: var(--border); }

/* ============ Discussion ============ */
.vanalysis-discussion {
  background: var(--bg-main);
  padding: 2.75rem 0 4rem;
}
/* The heading is a section opener like any other on this page — it sits on
   the band, and the panels below wrap the content rather than the title. */

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .vanalysis-identity {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.25rem;
  }
  .vanalysis-board {
    grid-template-columns: 1fr 1fr;
  }
  /* The rule is still the gutter — it just runs the other way once the strip
     wraps. */
  .vanalysis-cell:first-child { padding-left: 1.25rem; }
  .vanalysis-cell:nth-child(-n + 2) { border-top: 0; }
  .vanalysis-cell:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .vanalysis-cell:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 768px) {
  .vanalysis-identity {
    grid-template-columns: minmax(0, 1fr);
  }
  .vanalysis-thumb {
    max-width: 320px;
  }
  .vcall {
    padding: 1.25rem;
  }
  .vcall-move {
    margin-left: 0;
    width: 100%;
  }
  .vcall-prices {
    grid-template-columns: minmax(0, 1fr);
  }
  .vcall-price {
    border-left: 0;
    border-top: 1px solid var(--border-light);
  }
  .vcall-price:first-child { border-top: 0; }
  .vcall-quote {
    flex-direction: column;
    gap: 0.9rem;
  }
}

@media (max-width: 480px) {
  .vanalysis-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .vanalysis-cell {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .vanalysis-cell:first-child {
    padding-left: 0;
    border-top: 0;
  }
}
