/* ============================================================================
   TIMEPOINT — Viz instrument primitives (TNGF / TTMF / Compare)
   ----------------------------------------------------------------------------
   The structural classes the viz mount partials (partials/viz_tngf.html,
   viz_ttmf.html, viz_compare.html) render into: the instrument panel, the
   canvas, the hard-detent resolution dial, the segmented switch-rail, the
   mono readout. The COLOR tokens (--bg-void / --marble / --gold / --border …)
   are supplied by design-system-v6.css (scoped under body.synthetic-ui), which
   loads on the same page; this sheet only carries the layout/structure so the
   same primitives the /dev/viz demo proves can mount on real surfaces.

   Loaded ONLY alongside the SYNTHETIC_UI flag (the surfaces that mount viz
   include it behind the flag), so the v5.0 light theme is unaffected when OFF.
   Mirrors the inline tokens in viz_demo.html (DESIGN_LANGUAGE_AND_VIZ.md §1.6).
   ============================================================================ */

[x-cloak] { display: none !important; }

/* Instrument panel — flat surface on void, hairline border, hard corners. */
.viz-panel {
  background: var(--bg-surface, var(--bg-panel, #0F1C2E));
  border: 1px solid var(--border, rgba(168, 159, 145, 0.12));
  border-radius: 4px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.viz-panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border, rgba(168, 159, 145, 0.12));
}
.viz-panel-title {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--gold, var(--primary, #D4AF37));
}
.viz-panel-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--marble, var(--text-primary, #A89F91));
  opacity: 0.75;
}
.viz-canvas { width: 100%; min-height: 60px; position: relative; }
.viz-tngf-canvas { height: 480px; }
.viz-ttmf-canvas { min-height: 220px; }
.viz-compare-canvas { padding: 0.75rem; }

/* Resolution dial — hard on/off detent stepper. */
.viz-dial { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.viz-dial-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--selenite, var(--ivory, #F5F0E6));
  min-width: 1.6em;
  text-align: center;
}
.viz-dial-btn {
  background: transparent;
  border: 1px solid var(--border, rgba(168, 159, 145, 0.12));
  color: var(--selenite, var(--ivory, #F5F0E6));
  width: 22px;
  height: 22px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s var(--ease-out, ease), color 0.15s var(--ease-out, ease);
}
.viz-dial-btn:hover:not(:disabled) { border-color: var(--gold, #D4AF37); color: var(--gold, #D4AF37); }
.viz-dial-btn:disabled { opacity: 0.3; cursor: default; }

/* Switch-rail / segmented control — hard on/off states. */
.viz-segrail { display: inline-flex; border: 1px solid var(--border, rgba(168, 159, 145, 0.12)); border-radius: 3px; overflow: hidden; }
.viz-seg {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border, rgba(168, 159, 145, 0.12));
  color: var(--marble, var(--text-primary, #A89F91));
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s var(--ease-out, ease), color 0.15s var(--ease-out, ease);
}
.viz-seg:last-child { border-right: none; }
.viz-seg.is-on { background: rgba(212, 175, 55, 0.14); color: var(--gold, #D4AF37); }

.viz-progress { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--gold, #D4AF37); }
.viz-readout {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid var(--border, rgba(168, 159, 145, 0.12));
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}
.viz-readout-k { color: var(--marble, #A89F91); opacity: 0.7; letter-spacing: 0.1em; font-size: 0.62rem; }
.viz-readout-v { color: var(--selenite, var(--ivory, #F5F0E6)); }
.viz-readout-link { color: var(--gold, #D4AF37); text-decoration: none; margin-left: auto; }
.viz-readout-link:hover { text-decoration: underline; }
.viz-error, .compare-error, .compare-note {
  color: var(--error, #C77B6B);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 0.75rem;
}

/* ============================================================================
   TEMPORAL MAP strip (My Timepoints) + year drill-in drawer.
   The strip composes ONE instrument head: the wrapper partial draws the
   "TEMPORAL MAP" title + moments/years readout, and the included viz_ttmf.html
   contributes only its depth dial — its own head is absolute-positioned into
   the wrapper's head row and its TTMF title/sub chrome suppressed, so the two
   partials read as a single panel without touching viz_ttmf.html.
   ============================================================================ */
.viz-mtp-map-panel { position: relative; }
.viz-mtp-map-head { min-height: 38px; padding-right: 108px; }
.viz-mtp-map-panel .viz-ttmf {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  background: transparent;
}
.viz-mtp-map-panel .viz-ttmf .viz-panel-head {
  position: absolute;
  top: 0;
  right: 0;
  border-bottom: none;
  background: transparent;
}
.viz-mtp-map-panel .viz-ttmf .viz-panel-title,
.viz-mtp-map-panel .viz-ttmf .viz-panel-sub { display: none; }
/* The canvas sizes itself from the visible band count (a slim strip at L6,
   slimmer at the mobile default L3) — drop the demo-page minimum. */
.viz-mtp-map-panel .viz-ttmf-canvas { min-height: 0; }

/* TTMF cells are doors (click drills into that year) — cursor says so. */
.viz-ttmf-canvas canvas { cursor: pointer; }

/* Year drill-in drawer — sits directly beneath the map panel; content is the
   injected partials/viz_year_tngf.html fragment. */
.viz-drawer {
  position: relative;
  background: var(--bg-surface, var(--bg-panel, #0F1C2E));
  border: 1px solid var(--border, rgba(168, 159, 145, 0.12));
  border-radius: 4px;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
}
/* 180ms ease-out fade/translate entry (Alpine x-transition classes). */
.viz-drawer-anim { transition: opacity 0.18s var(--ease-out, ease-out), transform 0.18s var(--ease-out, ease-out); }
.viz-drawer-from { opacity: 0; transform: translateY(-6px); }
.viz-drawer-to { opacity: 1; transform: translateY(0); }
.viz-drawer-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
  background: transparent;
  border: 1px solid var(--border, rgba(168, 159, 145, 0.12));
  color: var(--marble, #A89F91);
  width: 22px;
  height: 22px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s var(--ease-out, ease), color 0.15s var(--ease-out, ease);
}
.viz-drawer-close:hover { border-color: var(--gold, #D4AF37); color: var(--gold, #D4AF37); }
.viz-drawer-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.1rem 2.25rem 0.65rem 0.15rem;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}
.viz-drawer-year {
  color: var(--gold, var(--primary, #D4AF37));
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.viz-drawer-readout {
  color: var(--marble, var(--text-primary, #A89F91));
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}
.viz-drawer .viz-panel { margin-bottom: 0.75rem; }
/* Drawer TNGF is a focus lens, not the 480px demo canvas. */
.viz-drawer .viz-tngf-canvas { height: 380px; }
@media (max-width: 639px) {
  .viz-drawer .viz-tngf-canvas { height: 320px; }
}
/* Solo-cast chip row (mirrors pro_results' .pr-tngf-single idiom). */
.viz-drawer-single {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 0.15rem;
}
.viz-drawer-single-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold, #D4AF37);
  flex: none;
}
.viz-drawer-single-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--selenite, var(--ivory, #F5F0E6));
}
.viz-drawer-single-note {
  font-size: 0.75rem;
  color: var(--marble, #A89F91);
}
.viz-drawer-empty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--marble, #A89F91);
  padding: 0.9rem 0.15rem;
  margin: 0;
}
/* The year's moments — the map is a navigation surface into the gallery. */
.viz-drawer-moments { padding: 0.25rem 0.15rem 0.15rem; }
.viz-drawer-moments-k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--marble, #A89F91);
  opacity: 0.7;
}
.viz-drawer-moment-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.viz-drawer-moment-list a {
  color: var(--selenite, var(--ivory, #F5F0E6));
  font-size: 0.82rem;
  text-decoration: none;
}
.viz-drawer-moment-list a:hover { color: var(--gold, #D4AF37); text-decoration: underline; }

/* Compare sparkline rail. */
.compare-sparkrail { display: flex; flex-direction: column; gap: 0.15rem; }
.compare-spark-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.1rem 0; }
.compare-spark-label { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--marble, #A89F91); min-width: 7em; }
.compare-spark { display: inline-flex; }
.compare-spark-readout { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; margin-left: auto; }
