/* ============================================================================
   ECONOMIC ANATOMY - economic_anatomy.css   (Visual Intelligence / Economic Anatomy lane)
   ----------------------------------------------------------------------------
   Styles for window.EconomicAnatomyView. TOKENS ONLY: every color / type / motion
   value comes from fcp/ui/tokens.css :root variables so the Captain can integrate
   without a restyle. Scientific economic OBSERVATORY: off-white field, deep green /
   navy structure, restrained gold, editorial serif headings, tabular numerals.
   Shallow 2.5D (CSS perspective + translate3d, <=14px apparent z per layer),
   restrained shadows, selection lifts one layer and de-emphasizes the rest.
   Reduced-motion: an equivalent static layout (no depth transform, no animation).
   No tilde / em-dash / en-dash anywhere.
   ========================================================================== */

.eav {
  color: var(--ink);
  font: 15px/1.5 var(--font-data);
  padding: 4px 2px 10px;
}

/* ---- header ---- */
.eav__header { display: flex; align-items: flex-start; gap: 16px; padding: 6px 4px 12px; }
.eav__head-left { flex: 1; min-width: 0; }
.eav__eyebrow { font: 800 10px var(--font-data); letter-spacing: 2px; color: var(--gold); text-transform: uppercase; }
.eav__title { font: italic 27px/1.08 var(--font-serif); color: var(--ink); margin-top: 2px; }
.eav__subtitle { color: var(--muted); font-size: 13px; margin-top: 3px; max-width: 62ch; }
.eav__context { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.eav__kicker { font: 700 10px var(--font-data); letter-spacing: 1.2px; color: var(--faint); text-transform: uppercase; }
.eav__asof { color: var(--faint); font-size: 12px; font-variant-numeric: var(--num); }
.eav__head-right { display: flex; align-items: center; gap: 8px; }

/* ---- shared chip (word + shape, never color alone) ---- */
.eav__chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 10px var(--font-data); letter-spacing: .5px; padding: 2px 9px; border-radius: 6px; white-space: nowrap;
}
.eav__chip.is-observed { background: var(--ep-observed-bg); color: var(--ep-observed-fg); box-shadow: inset 0 0 0 1px var(--ep-observed-line); }
.eav__chip.is-reconstructed { background: transparent; color: var(--ep-recon-fg); box-shadow: inset 0 0 0 1.5px var(--ep-recon-line); }
.eav__chip.is-modeled { background: var(--ep-modeled-bg); color: var(--ep-modeled-fg); box-shadow: inset 0 0 0 1px var(--ep-modeled-line); }
.eav__chip.is-counterfactual { background: var(--ep-cf-bg); color: var(--ep-cf-fg); box-shadow: inset 0 0 0 1px var(--ep-cf-line); }
.eav__chip.is-simulated { background: var(--ep-sim-bg); color: var(--ep-sim-fg); border: 1px dashed var(--ep-sim-line); }
.eav__chip.is-unknown { background: var(--ep-unknown-bg); color: var(--ep-unknown-fg); box-shadow: inset 0 0 0 1px var(--ep-unknown-line); }
.eav__chip.is-gold { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 1.5px var(--gold-light); }
.eav__chip-glyph { width: 8px; height: 8px; flex: 0 0 auto; display: inline-block; }

/* epistemic glyph shapes reinforce state without relying on color (mirror tokens.css badge glyphs) */
.glyph-observed { background: var(--ep-observed-fg); border-radius: 50%; }
.glyph-reconstructed { border: 1.5px solid var(--ep-recon-fg); border-radius: 2px; width: 8px; height: 8px; box-sizing: border-box; }
.glyph-modeled { background: var(--ep-modeled-fg); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.glyph-counterfactual { background: var(--ep-cf-fg); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.glyph-simulated { border: 1.5px dashed var(--ep-sim-fg); border-radius: 50%; width: 8px; height: 8px; box-sizing: border-box; }
.glyph-unknown { border: 1.5px dotted var(--ep-unknown-fg); border-radius: 50%; width: 8px; height: 8px; box-sizing: border-box; }

/* ---- toolbar ---- */
.eav__toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eav__search-in {
  font: 500 13px var(--font-data); color: var(--ink); background: #fff;
  border: 1px solid var(--hairline); border-radius: var(--radius-pill); padding: 6px 14px; min-width: 180px;
}
.eav__search-in:focus { outline: none; border-color: var(--card-line); box-shadow: 0 0 0 3px rgba(23, 122, 67, .1); }
.eav__filter { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.eav__fbtn {
  font: 600 12px var(--font-data); color: var(--muted); background: #fff;
  border: 1px solid var(--hairline); border-radius: var(--radius-pill); padding: 4px 11px; cursor: pointer;
  transition: all var(--dur-hover) var(--ease);
}
.eav__fbtn:hover { color: var(--ink); border-color: var(--card-line); }
.eav__fbtn.is-active { color: var(--ink); background: var(--green-tint); border-color: var(--card-line); font-weight: 700; }
.eav__toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.eav__iso-note { font: 700 11px var(--font-data); color: var(--ep-modeled-fg); letter-spacing: .3px; }

/* ---- buttons ---- */
.eav__btn {
  font: 600 12px var(--font-data); color: #fff; background: var(--green-deep);
  border: 1px solid var(--green-deep); border-radius: var(--radius-pill); padding: 6px 14px; cursor: pointer;
  transition: all var(--dur-hover) var(--ease);
}
.eav__btn:hover { background: var(--survey); border-color: var(--survey); }
.eav__btn.ghost { background: #fff; color: var(--muted); border-color: var(--hairline); }
.eav__btn.ghost:hover { color: var(--ink); border-color: var(--card-line); }

/* ---- reconciliation strip (proof the parts sum to canonical state) ---- */
.eav__recon { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; margin: 12px 4px 4px; border: 1px solid var(--hairline); border-radius: var(--radius); background: #FCFDFB; overflow: hidden; }
.eav__recon-cell { padding: 9px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.eav__recon-cell:last-of-type { border-right: 0; }
.eav__recon-l { font: 700 9px var(--font-data); letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.eav__recon-v { font: 800 16px/1.05 var(--font-data); font-variant-numeric: var(--num); color: var(--ink); }
.eav__recon-cell.is-flag .eav__recon-v { font-size: 13px; color: var(--muted); }
.eav__recon-cell.is-ok .eav__recon-v { color: var(--fern); }
.eav__recon-note { margin-left: auto; align-self: center; padding: 0 16px; font-style: italic; font-family: var(--font-serif); font-size: 13px; color: var(--muted); }

/* ---- body: stage + inspector ---- */
.eav__body { display: flex; gap: 16px; align-items: flex-start; margin-top: 12px; }
.eav__stage { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; perspective: 1400px; perspective-origin: 50% 0%; }
.eav__empty { padding: 40px; text-align: center; color: var(--muted); font-style: italic; font-family: var(--font-serif); font-size: 16px; }

/* ---- 2.5D layer plates ---- */
.eav__layer {
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius-op);
  padding: 12px 14px 14px; box-shadow: 0 1px 3px rgba(22, 37, 28, .05);
  transform-style: preserve-3d; transition: transform var(--dur-drill) var(--ease), opacity var(--dur-tab) var(--ease), box-shadow var(--dur-drill) var(--ease);
}
.eav__layer.is-dimmed { opacity: .3; filter: saturate(.6); }
.eav__layer.is-isolated { box-shadow: 0 10px 28px rgba(14, 43, 29, .16); transform: translate3d(0, 0, 24px) !important; border-color: var(--card-line); }
.eav__layer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.eav__layer-name { font: italic 17px/1 var(--font-serif); color: var(--ink); flex: 1; }
.eav__layer-toggle {
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 6px; border: 1px solid var(--hairline);
  background: #fff; color: var(--muted); cursor: pointer; font: 800 13px var(--font-data); line-height: 1;
}
.eav__layer-iso {
  font: 600 11px var(--font-data); color: var(--muted); background: #fff;
  border: 1px solid var(--hairline); border-radius: var(--radius-pill); padding: 3px 10px; cursor: pointer;
  transition: all var(--dur-hover) var(--ease);
}
.eav__layer-iso:hover { color: var(--ink); border-color: var(--card-line); }
.eav__layer-iso.is-on { color: var(--survey); background: var(--survey-tint); border-color: var(--card-line); }

.eav__plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.eav__plate-empty { color: var(--muted); font-style: italic; font-family: var(--font-serif); font-size: 14px; padding: 6px 2px; }

/* ---- component plate (epistemic grammar: shape + word + style, never color alone) ---- */
.eav__plate {
  position: relative; padding: 10px 12px; border-radius: 10px; background: #fff;
  border: 1px solid var(--hairline); cursor: pointer; min-height: 78px;
  transition: transform var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.eav__plate:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(22, 37, 28, .08); }
.eav__plate:focus-visible { outline: 2px solid var(--survey-deep); outline-offset: 2px; }
.eav__plate.is-observed { border-color: var(--ep-observed-line); background: var(--ep-observed-bg); }
.eav__plate.is-reconstructed { border: 1.5px solid var(--ep-recon-line); background: transparent; }
.eav__plate.is-modeled { border-color: var(--ep-modeled-line); background: var(--ep-modeled-bg); }
.eav__plate.is-counterfactual { border-color: var(--ep-cf-line); background: var(--ep-cf-bg); }
.eav__plate.is-unknown, .eav__plate.is-terminal { border: 1.5px dashed var(--ep-unknown-line); background: var(--ep-unknown-bg); }
.eav__plate.is-primary { box-shadow: inset 0 0 0 1px var(--gold-light); }
.eav__plate.is-selected { box-shadow: 0 6px 18px rgba(20, 26, 27, .16); border-color: var(--survey-deep); transform: translateY(-2px); }
.eav__plate-kicker { font: 700 9px var(--font-data); letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.eav__plate-title { font-weight: 700; color: var(--ink); margin-top: 3px; font-size: 13px; line-height: 1.2; }
.eav__plate-state { display: flex; align-items: center; gap: 6px; margin-top: 6px; font: 700 10px var(--font-data); letter-spacing: .3px; color: var(--muted); }
.eav__plate-val { margin-top: 5px; font: 700 12px var(--font-data); font-variant-numeric: var(--num); color: var(--ink); }
.eav__plate-flag { margin-top: 5px; font: 700 9px var(--font-data); letter-spacing: .6px; text-transform: uppercase; color: var(--gold); }

/* ---- relationship connectors (captioned links; hidden in presentation to reduce clutter) ---- */
.eav__rels { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.eav__rel {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill);
  background: #FCFDFB; border: 1px solid var(--hairline); cursor: pointer; font-size: 11px; color: var(--muted);
  transition: all var(--dur-hover) var(--ease);
}
.eav__rel:hover { color: var(--ink); border-color: var(--card-line); }
.eav__rel.is-selected { border-color: var(--survey-deep); color: var(--ink); }
.eav__rel-arrow { color: var(--faint); font: 700 11px var(--font-data); letter-spacing: -1px; }
.eav__rel-lbl { font-weight: 600; }

/* ---- inspector (Evidence one click away) ---- */
.eav__inspector { flex: 0 0 300px; align-self: stretch; background: #fff; border: 1px solid var(--hairline); border-left: 3px solid var(--gold); border-radius: var(--radius); padding: 14px 16px; position: sticky; top: 8px; }
.eav__insp-kicker { font: 700 10px var(--font-data); letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.eav__insp-title { font: italic 19px/1.2 var(--font-serif); color: var(--ink); margin-top: 3px; }
.eav__insp-state { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.eav__insp-rows { margin-top: 10px; }
.eav__kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); align-items: baseline; }
.eav__kv:first-child { border-top: 0; }
.eav__kv-k { color: var(--faint); font: 700 10px var(--font-data); letter-spacing: .6px; text-transform: uppercase; }
.eav__kv-v { color: var(--ink); font-size: 13px; font-variant-numeric: var(--num); }
.eav__insp-note { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.eav__insp-actions { margin-top: 12px; display: flex; gap: 8px; }
.eav__evidence { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.eav__evidence-claim { font: italic 15px/1.25 var(--font-serif); color: var(--ink); }
.eav__evidence-note { color: var(--muted); font-size: 12px; margin-top: 5px; }

/* ---- legend + disclaimer ---- */
.eav__legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 4px 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.eav__leg { display: inline-flex; align-items: center; gap: 6px; }
.eav__leg-glyph { width: 9px; height: 9px; flex: 0 0 auto; display: inline-block; }
.eav__disclaimer { margin: 12px 4px 0; padding: 8px 12px; background: var(--amber-tint); border: 1px solid rgba(143, 94, 7, .3); border-radius: var(--radius); font-size: 11.5px; color: var(--amber); }

/* presentation mode reads calmer + more spacious (spec 07 rule 11) */
.eav--presentation .eav__layer { padding: 16px 18px 18px; }
.eav--presentation .eav__plates { gap: 12px; }

/* ---- responsive: inspector under the stage on narrow screens ---- */
@media (max-width: 860px) {
  .eav__body { flex-direction: column; }
  .eav__inspector { flex: 1 1 auto; position: static; width: 100%; }
}

/* ---- reduced motion: equivalent static layout, no depth transform, no animation (spec 14) ---- */
@media (prefers-reduced-motion: reduce) {
  .eav__layer, .eav__plate, .eav__rel, .eav__fbtn, .eav__btn { transition: none !important; }
  .eav__stage { perspective: none; }
  .eav__layer, .eav__layer.is-isolated { transform: none !important; }
  .eav__plate:hover, .eav__plate.is-selected { transform: none; }
}
.eav__stage.is-static { perspective: none; }
.eav__stage.is-static .eav__layer { transform: none !important; }
