/**
 * VAULT OS · vault_core.css
 * Daylight Gallery / Brutalist — shared palette, typography tokens,
 * hairlines, and mono control hovers. Per-dashboard grids, Driver.js,
 * and layout rules remain in each HTML file.
 */

:root {
  /* INK — ground */
  --ink:            #1a1610;
  --ink-deeper:     #0f0c08;
  --ink-soft:       #4a3f2e;
  --ink-dim:        #6e6045;

  /* VERDUN / MOSS — troughs */
  --verdun:         #2c3a18;
  --verdun-deep:    #1f2912;
  --verdun-lit:     #3a4a28;
  --moss:           #485b34;
  --moss-shade:     #3a4a28;
  --moss-deep:      #2f3b21;

  /* PARCHMENT */
  --parchment:      #f0e9d6;
  --parchment-deep: #e2d6b8;
  --parchment-soft: #f7f1e0;
  --bone:           #d8cdb0;

  /* TOBACCO — warmth */
  --tobacco:        #c9a57b;
  --tobacco-deep:   #a07242;
  --tobacco-glow:   #d39556;
  --tobacco-lit:    var(--tobacco-deep);

  /* DEEP BLUE — deliberate accent */
  --deep-blue:      #1f3a5f;
  --deep-blue-lit:  #2d527f;
  --deep-blue-glow: #3d6a9c;

  /* OLIVE — showroom greens */
  --olive:          #8a9b4a;
  --olive-soft:     #b6c07a;

  /* SEMANTIC */
  --abort:          #b04030;
  --reject:         #b04030;
  --approve:        #5a9e62;
  --approve-glow:   #7bc484;
  --hold:           #8a7a5a;

  /* HAIRLINES — default ink-mode (tobacco); dashboards may override --hairline */
  --hairline-tobacco:        rgba(201, 165, 123, 0.18);
  --hairline-tobacco-strong: rgba(201, 165, 123, 0.35);
  --hairline-blue:           rgba(31, 58, 95, 0.18);
  --hairline-blue-soft:      rgba(31, 58, 95, 0.10);
  --hairline:                var(--hairline-tobacco);
  --hairline-strong:         var(--hairline-tobacco-strong);

  /* ATMOSPHERE */
  --shadow-warm:    rgba(115, 77, 38, 0.16);
  --shadow-deep:    rgba(31, 58, 95, 0.14);
  --glass-bg:       rgba(247, 241, 224, 0.78);

  /* TYPE */
  --mono:    'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --display: 'Fraunces', 'EB Garamond', Georgia, serif;
  --body:    'EB Garamond', Georgia, serif;

  /* PLEASURE / MUSIC LAB aliases */
  --paper:      var(--parchment);
  --paper-soft: var(--parchment-deep);
  --paper-dim:  var(--ink-dim);
}

/* ─── Brutalist mono controls (Market Center, shared ink surfaces) ─── */
.btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 14px;
  border: 1px solid var(--hairline-strong);
  background: var(--verdun-deep);
  color: var(--parchment);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}

.btn:hover {
  border-color: var(--tobacco);
  background: var(--verdun);
}

.btn-primary {
  border-color: var(--tobacco);
  color: var(--tobacco-glow);
}

.btn-tour {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--hairline-strong);
  background: var(--verdun-deep);
  color: var(--parchment);
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}

.btn-tour:hover {
  border-color: var(--tobacco);
  color: var(--tobacco-glow);
  background: var(--verdun);
}

.btn-tour:focus-visible {
  outline: 1px solid var(--tobacco-glow);
  outline-offset: 2px;
}

/* ─── Sprint 053 · Dynamic Dictionary (Briefing Room + Workshop) ─── */
.glossary-term {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--tobacco);
  text-decoration: none;
  color: inherit;
}

.glossary-term::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 10000;
  display: block;
  min-width: 140px;
  max-width: 250px;
  padding: 10px 12px;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: normal;
  color: var(--parchment-soft);
  background: var(--ink-deeper);
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 6px 18px var(--shadow-warm);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease, visibility 120ms ease;
}

.glossary-term:hover::after,
.glossary-term:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.glossary-term:focus-visible {
  outline: 1px solid var(--tobacco-glow);
  outline-offset: 2px;
}

/* ─── Sprint 066–067c · Visual Autopsy Calendar thumbnails (no meta popovers) ─── */
.cal-day {
  min-height: 80px;
}

.cal-day.has-autopsy {
  padding: 4px 5px 5px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: center;
}

.cal-day.has-autopsy .cal-day-num {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 2px;
  opacity: 0.85;
}

.cal-day-tint-win {
  background: rgba(90, 158, 98, 0.14);
  border-color: rgba(90, 158, 98, 0.45);
}

.cal-day-tint-loss {
  background: rgba(176, 64, 48, 0.14);
  border-color: rgba(176, 64, 48, 0.42);
}

.cal-day-tint-neutral {
  background: rgba(138, 122, 90, 0.12);
  border-color: rgba(138, 122, 90, 0.35);
}

.cal-day.has-autopsy.cal-day-tint-win:hover {
  background: rgba(90, 158, 98, 0.22);
  border-color: var(--approve-glow);
}

.cal-day.has-autopsy.cal-day-tint-loss:hover {
  background: rgba(176, 64, 48, 0.22);
  border-color: var(--reject);
}

.cal-day.has-autopsy.cal-day-tint-neutral:hover {
  background: rgba(138, 122, 90, 0.2);
  border-color: var(--hold);
}

.cal-day-thumb {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 0;
  margin-top: auto;
}

.cal-day-metric {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 1.65em;
  font-size: clamp(10px, 1.35vw, 13px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  padding: 5px 3px;
  border: 1px solid transparent;
  background: rgba(15, 12, 8, 0.45);
  text-align: center;
  white-space: nowrap;
}

.cal-day-metric.cal-day-metric-rr {
  font-size: clamp(11px, 1.5vw, 14px);
  letter-spacing: 0.06em;
}

.cal-day-metric.win-val {
  color: var(--approve-glow);
  border-color: rgba(90, 158, 98, 0.25);
}

.cal-day-metric.rr-pos {
  color: var(--approve-glow);
  border-color: rgba(90, 158, 98, 0.2);
}

.cal-day-metric.rr-neg {
  color: var(--reject);
  border-color: rgba(176, 64, 48, 0.25);
}

.cal-day-metric.neutral-val {
  color: var(--hold);
  border-color: rgba(138, 122, 90, 0.25);
}

.cal-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--hairline-strong);
  flex-shrink: 0;
}

.cal-legend-swatch.win-tint {
  background: rgba(90, 158, 98, 0.14);
  border-color: rgba(90, 158, 98, 0.45);
}

.cal-legend-swatch.loss-tint {
  background: rgba(176, 64, 48, 0.14);
  border-color: rgba(176, 64, 48, 0.42);
}

.cal-legend-swatch.neutral-tint {
  background: rgba(138, 122, 90, 0.12);
  border-color: rgba(138, 122, 90, 0.35);
}

.lesson-glossary-intro {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--tobacco-glow);
  margin-bottom: 10px;
}

.lesson-section-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tobacco-glow);
  margin-bottom: 8px;
}

.lesson-plan-block {
  margin-bottom: 14px;
}

.lesson-plan-raw {
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  background: rgba(15, 12, 8, 0.55);
}

.lesson-raw-line {
  font-size: 11px;
  line-height: 1.65;
  color: var(--parchment-soft);
  margin: 0 0 8px;
}

.lesson-raw-line:last-child {
  margin-bottom: 0;
}

.lesson-raw-line em {
  font-style: italic;
  color: var(--parchment-soft);
}

.lesson-means-block {
  margin-top: 4px;
}

.lesson-glossary-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lesson-glossary-item {
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  background: rgba(201, 165, 123, 0.06);
  border-left: 3px solid var(--tobacco);
}

.lesson-glossary-item.win-context {
  border-left-color: var(--approve);
}

.lesson-glossary-item.loss-context {
  border-left-color: var(--reject);
}

.lesson-glossary-term {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--parchment-soft);
  margin-bottom: 4px;
}

.lesson-glossary-def {
  font-size: 11px;
  line-height: 1.65;
  color: var(--parchment-soft);
  margin: 0;
}

.detail-block > .detail-block-title {
  margin-bottom: 8px;
}

/* ─── Sprint 070 · Testing Range Dashboard Block ─── */
.range-dashboard {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--hairline-strong);
  background: linear-gradient(180deg, rgba(15, 12, 8, 0.96), rgba(26, 22, 16, 0.92));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .range-dashboard {
    grid-template-columns: 1fr;
    margin-top: 12px;
    padding: 12px;
  }
}

.dashboard-trend-panel,
.dashboard-lessons-panel {
  border: 1px solid var(--hairline);
  background: rgba(15, 12, 8, 0.72);
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.range-panel-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tobacco-glow);
}

/* Sprint 074 · Chart.js cumulative win % line */
.range-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 200px;
  height: 220px;
}

#range-win-chart {
  width: 100% !important;
  height: 100% !important;
}

.range-data-context {
  font-size: 11px;
  line-height: 1.65;
  color: var(--parchment-soft);
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  background: rgba(90, 158, 98, 0.05);
  margin-top: 4px;
}

.range-data-context strong {
  color: var(--approve-glow);
}

/* Sprint 074 · Inline historical map (main column) */
.historical-map-panel {
  margin-top: 14px;
  border: 1px solid var(--hairline-strong);
  background: var(--ink-deeper);
  display: grid;
  gap: 0;
}

.historical-map-head-inline {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-strong);
  background: var(--verdun-deep);
}

.historical-map-inline-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tobacco-glow);
}

.historical-map-inline-sub {
  font-size: 10px;
  color: var(--moss);
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.historical-map-legend-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 8px 14px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--moss);
  border-bottom: 1px solid var(--hairline);
}

.historical-map-legend-inline span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 18px;
  height: 0;
  border-top: 2px dashed currentColor;
}

.legend-swatch.asian-low,
.legend-swatch.asian-high {
  border-top-style: solid;
  border-top-width: 3px;
}
.legend-swatch.asian-low { color: #7eb8d4; }
.legend-swatch.asian-high { color: #d4a57e; }
.legend-swatch.asian-box {
  width: 14px;
  height: 10px;
  border: 1px solid rgba(126, 184, 212, 0.35);
  border-top: none;
  background: rgba(126, 184, 212, 0.12);
}
.legend-swatch.entry { color: var(--approve-glow); }
.legend-swatch.stop { color: var(--reject); }
.legend-swatch.target { color: var(--tobacco-glow); }
.legend-swatch.partition-trigger {
  width: 0;
  height: 16px;
  border-top: none;
  border-left: 2px dashed rgba(201, 165, 123, 0.75);
}

.legend-swatch.partition-entry {
  width: 0;
  height: 16px;
  border-top: none;
  border-left: 3px solid var(--approve-glow);
}

.legend-swatch.execution-gap {
  width: 14px;
  height: 10px;
  border: none;
  border-top: none;
  background: rgba(90, 158, 98, 0.18);
}

.historical-map-chart-wrap-inline {
  position: relative;
  min-height: 360px;
  border-bottom: 1px solid var(--hairline);
}

.historical-map-asian-box {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(212, 165, 126, 0.1) 0%,
    rgba(126, 184, 212, 0.14) 48%,
    rgba(126, 184, 212, 0.1) 100%
  );
  border-left: 1px solid rgba(126, 184, 212, 0.28);
  border-right: 1px solid rgba(212, 165, 126, 0.22);
  box-sizing: border-box;
}

.historical-map-asian-box::before {
  content: 'ASIAN TRAP ZONE';
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 7px;
  letter-spacing: 0.14em;
  color: rgba(201, 165, 123, 0.75);
  white-space: nowrap;
}

.historical-map-trigger-panel {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(15, 12, 8, 0.72);
}

.historical-map-trigger-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tobacco-glow);
  margin: 0 0 8px;
}

.historical-map-trigger-body {
  font-size: 11px;
  line-height: 1.55;
  color: var(--parchment);
  letter-spacing: 0.02em;
  margin: 0;
  font-family: 'Source Serif 4', Georgia, serif;
}

.historical-map-sequence-list {
  margin: 0;
  padding: 0 0 0 1.1em;
  list-style: disc;
}

.historical-map-sequence-list li {
  margin-bottom: 0.65em;
}

.historical-map-sequence-list li:last-child {
  margin-bottom: 0;
}

.historical-map-sequence-list strong {
  color: var(--tobacco-glow);
  font-weight: 600;
}

.historical-map-governor-note {
  font-size: 10px;
  line-height: 1.5;
  color: var(--moss);
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 2px solid rgba(201, 165, 123, 0.55);
  background: rgba(201, 165, 123, 0.06);
}

.historical-map-governor-note em {
  font-style: normal;
  color: var(--tobacco-glow);
  letter-spacing: 0.06em;
}

.governor-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--tobacco-glow);
  white-space: nowrap;
}

.historical-map-execution-gap {
  position: absolute;
  top: 0;
  bottom: 28px;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
    90deg,
    rgba(201, 165, 123, 0.06) 0%,
    rgba(90, 158, 98, 0.16) 50%,
    rgba(90, 158, 98, 0.08) 100%
  );
  border-left: 1px dashed rgba(201, 165, 123, 0.35);
  border-right: 1px solid rgba(90, 158, 98, 0.45);
  box-sizing: border-box;
}

.historical-map-execution-gap::before {
  content: 'REACTION GAP';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  letter-spacing: 0.14em;
  color: rgba(90, 158, 98, 0.85);
  white-space: nowrap;
}

#historical-map-chart {
  width: 100%;
  height: 360px;
}

.historical-map-partition {
  position: absolute;
  top: 0;
  bottom: 28px;
  pointer-events: none;
  transform: translateX(-1px);
}

.historical-map-partition-trigger {
  width: 0;
  border-left: 2px dashed rgba(201, 165, 123, 0.72);
  z-index: 5;
}

.historical-map-partition-trigger::after {
  content: none;
}

.historical-map-partition-entry::after {
  content: none;
}

.historical-map-partition-label {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: rgba(201, 165, 123, 0.9);
  white-space: nowrap;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.historical-map-partition-entry .historical-map-partition-label {
  font-weight: 700;
  color: var(--approve-glow);
}

.historical-map-partition-entry {
  width: 2px;
  background: rgba(90, 158, 98, 0.98);
  box-shadow: 0 0 12px rgba(90, 158, 98, 0.55);
  z-index: 6;
}

.historical-map-inline-status {
  font-size: 10px;
  color: var(--moss);
  padding: 10px 14px 12px;
  letter-spacing: 0.05em;
}

.historical-map-inline-status.error {
  color: var(--reject);
}

.lesson-glossary-details {
  margin-top: 8px;
  border: 1px solid var(--hairline);
  background: rgba(15, 12, 8, 0.55);
}

.lesson-glossary-details > summary {
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tobacco-glow);
  padding: 10px 12px;
  list-style: none;
}

.lesson-glossary-details > summary::-webkit-details-marker {
  display: none;
}

.lesson-glossary-details[open] > summary {
  border-bottom: 1px solid var(--hairline);
}

.lesson-glossary-details .lesson-glossary-list {
  padding: 10px 12px 12px;
}

.range-timeline-caption {
  font-size: 10px;
  color: var(--moss);
  line-height: 1.45;
  letter-spacing: 0.05em;
}

.range-summary-text {
  font-size: 12px;
  line-height: 1.7;
  color: var(--parchment-soft);
}
