/* ==========================================================================
   Views: journey, dimensions, problems, entity pages, capital stack,
   status ladder, evidence
   ========================================================================== */

/* ------------------------------------------------------------------ hero */
.hero { max-width: 760px; margin-bottom: var(--s7); }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.3rem + 2.6vw, var(--fs-3xl));
  letter-spacing: -0.02em; line-height: 1.06;
  margin: var(--s3) 0 var(--s4);
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--accent-wash) 62%);
  padding: 0 2px;
}
.hero p { font-size: var(--fs-md); color: var(--ink-soft); line-height: 1.56; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }

/* --------------------------------------------------------------- journey */
.journey { position: relative; margin: var(--s5) 0 0; }
.journey-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(96px, 1fr);
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}
.journey-step {
  position: relative;
  border: 0; cursor: pointer; text-align: left;
  background: var(--panel);
  padding: var(--s4) var(--s3) var(--s4) 14px;
  display: flex; flex-direction: column; gap: 4px;
  transition: background var(--t) var(--ease), transform var(--t) var(--ease);
}
.journey-step::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: transparent;
  transition: background var(--t) var(--ease);
}
.journey-step:hover { background: var(--panel-alt); }
.journey-step.is-active { background: var(--forest); }
.journey-step.is-active::before { background: var(--solar); }
.journey-step.is-active .journey-num { color: var(--solar); }
.journey-step.is-active .journey-name { color: var(--ink-invert); }
.journey-num { font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.08em; color: var(--ink-muted); }
.journey-name {
  font-family: var(--serif); font-size: var(--fs-sm); font-weight: 600; line-height: 1.2;
  letter-spacing: 0.005em;
}
.journey-step[data-milestone="true"] .journey-name::after {
  content: "◆"; font-size: 0.5rem; color: var(--solar); margin-left: 5px; vertical-align: 2px;
}

.journey-detail {
  margin-top: var(--s4);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  padding: var(--s5) var(--s6);
  animation: fade-up var(--t-slow) var(--ease);
}
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .journey-detail { animation: none; } }

.journey-detail-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s3); margin-bottom: var(--s3); }
.journey-detail-head h3 { font-family: var(--serif); font-size: var(--fs-lg); }
.journey-detail-lede { color: var(--ink-soft); max-width: var(--measure); margin-bottom: var(--s5); }

.fid-warning {
  display: flex; gap: var(--s4); align-items: center;
  margin: var(--s5) 0 0;
  padding: var(--s4) var(--s5);
  border: 1px solid var(--accent-line);
  background: var(--accent-wash);
  border-radius: var(--radius);
}
.fid-warning .fid-eq {
  font-family: var(--serif); font-size: var(--fs-lg); font-weight: 700; color: var(--accent-ink);
  white-space: nowrap;
}
.fid-warning p { font-size: var(--fs-sm); color: var(--ink-soft); margin: 0; }

/* ------------------------------------------------------------ dimensions */
.dimensions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s3); }
.dimension {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: var(--s4);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.dimension:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dimension-lens {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--emerald);
  position: relative;
}
.dimension-lens::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: var(--emerald); opacity: 0.16;
}
.dimension:nth-child(4) .dimension-lens, .dimension:nth-child(5) .dimension-lens { border-color: var(--solar); }
.dimension:nth-child(4) .dimension-lens::after, .dimension:nth-child(5) .dimension-lens::after { background: var(--solar); opacity: 0.3; }
.dimension h3 { font-family: var(--serif); font-size: var(--fs-base); }
.dimension-q { font-size: var(--fs-sm); font-weight: 600; color: var(--emerald); }
.dimension p { font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.5; margin: 0; }
.dimension ul { list-style: none; display: flex; flex-direction: column; gap: 3px; margin-top: auto; padding-top: var(--s3); }
.dimension li { font-size: var(--fs-xs); color: var(--ink-muted); padding-left: 12px; position: relative; }
.dimension li::before { content: "–"; position: absolute; left: 0; }

/* ---------------------------------------------------------- problem cards */
.problem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: var(--s3); }
.problem-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: var(--s4) var(--s4) var(--s4) 18px;
  text-align: left; cursor: pointer; position: relative;
  font-size: var(--fs-sm); font-weight: 500; line-height: 1.45;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.problem-card::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 2px 2px 0; background: var(--line-strong);
  transition: background var(--t) var(--ease), top var(--t) var(--ease), bottom var(--t) var(--ease);
}
.problem-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.problem-card:hover::before { background: var(--emerald); top: 6px; bottom: 6px; }
.problem-card.is-selected { border-color: var(--forest); background: var(--panel-alt); }
.problem-card.is-selected::before { background: var(--solar); top: 4px; bottom: 4px; }

/* ------------------------------------------------------------ route chain */
.chain { display: flex; flex-direction: column; gap: 0; margin: var(--s5) 0; }
.chain-step {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: var(--s4) var(--s5);
}
.chain-arrow { align-self: center; color: var(--line-strong); font-size: 1rem; line-height: 1; padding: 6px 0; }
.chain-label {
  font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-muted); margin-bottom: 5px;
}

.route {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: hidden;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.route:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.route-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
}
.route-name { font-family: var(--serif); font-size: var(--fs-md); font-weight: 600; }
.route-name a { text-decoration: none; }
.route-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.route-body { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.route-why { font-size: var(--fs-sm); color: var(--ink-soft); }
.route-providers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.provider-chip {
  font-size: var(--fs-xs); text-decoration: none;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-alt); color: var(--ink-soft);
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.provider-chip:hover { border-color: var(--emerald); color: var(--emerald); }

/* --------------------------------------------------------- entity detail */
.detail-head { margin-bottom: var(--s6); }
.detail-title {
  font-family: var(--serif); font-size: var(--fs-2xl); letter-spacing: -0.014em;
  margin: var(--s3) 0 var(--s4); max-width: 22ch;
}
.detail-one-liner {
  font-size: var(--fs-md); line-height: 1.5; color: var(--ink);
  max-width: var(--measure);
  border-left: 3px solid var(--solar); padding-left: var(--s4);
}
.detail-meta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); align-items: center; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 274px; gap: var(--s7); align-items: start; }
.detail-aside { position: sticky; top: calc(var(--topbar-h) + var(--s5)); display: flex; flex-direction: column; gap: var(--s4); }

.sect { margin-bottom: var(--s6); }
.sect h3 {
  font-size: var(--fs-xs); letter-spacing: 0.11em; text-transform: uppercase;
  font-weight: 700; color: var(--emerald); margin-bottom: var(--s3);
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.sect p { max-width: var(--measure); color: var(--ink-soft); }
.sect-warn h3 { color: var(--warn); }
.sect-verify h3 { color: var(--warn); }
.sect ul { list-style: none; display: flex; flex-direction: column; gap: 7px; max-width: var(--measure); }
.sect li { position: relative; padding-left: 18px; font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.5; }
.sect li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--emerald); opacity: 0.55;
}
.sect-verify li::before { background: var(--warn); border-radius: 1px; }

.pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s3); }
.pair {
  border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4);
  background: var(--panel-alt);
}
.pair-label {
  font-size: 0.625rem; letter-spacing: 0.11em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-muted); margin-bottom: 6px;
}
.pair-value { font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.5; }
.pair:nth-child(4) { border-color: var(--stop); background: var(--stop-wash); }
.pair:nth-child(4) .pair-label { color: var(--stop); }

.aside-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: var(--s4); }
.aside-box h4 {
  font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 700; margin-bottom: var(--s3);
}
.aside-meaning {
  font-size: var(--fs-xs); color: var(--ink-muted); line-height: 1.45;
  margin: -4px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.rel-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.rel-list a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 6px 8px; margin: 0 -8px; border-radius: var(--radius-sm);
  text-decoration: none; font-size: var(--fs-sm); color: var(--ink-soft);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.rel-list a:hover { background: var(--panel-alt); color: var(--ink); }
.rel-fit { font-size: 0.5938rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--fit-ink, var(--unknown)); white-space: nowrap; }

/* --------------------------------------------------------- status ladder */
.ladder { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.ladder-track h4 {
  font-size: var(--fs-xs); letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 700; margin-bottom: var(--s4);
}
.ladder-steps { list-style: none; position: relative; padding-left: var(--s5); }
.ladder-steps::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--line);
}
.ladder-step { position: relative; padding-bottom: var(--s4); }
.ladder-step::before {
  content: ""; position: absolute; left: calc(-1 * var(--s5) + 2px); top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--line-strong);
}
.ladder-step.is-reached::before { background: var(--emerald); border-color: var(--emerald); }
.ladder-step.is-unknown::before { border-style: dashed; }
.ladder-name { font-size: var(--fs-sm); font-weight: 600; }
.ladder-step:not(.is-reached) .ladder-name { color: var(--ink-muted); }
.ladder-note { font-size: var(--fs-xs); color: var(--ink-muted); line-height: 1.5; margin-top: 2px; }

.signed-not-operational {
  margin-top: var(--s5); display: flex; gap: var(--s4); align-items: center;
  padding: var(--s4) var(--s5); border-radius: var(--radius);
  background: var(--forest); color: var(--ink-invert);
}
.signed-not-operational strong { color: var(--warm-yellow); font-family: var(--serif); font-size: var(--fs-md); white-space: nowrap; }
.signed-not-operational p { margin: 0; font-size: var(--fs-sm); color: rgba(243,240,230,0.82); }

/* ----------------------------------------------------------- capital stack */
.stack-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.stack-viz { display: flex; flex-direction: column; gap: 3px; }
.stack-axis {
  display: flex; justify-content: space-between; font-size: var(--fs-xs);
  color: var(--ink-muted); font-weight: 600; letter-spacing: 0.04em;
  padding: 0 2px var(--s2);
}
.stack-layer {
  --h: 60px;
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  min-height: var(--h);
  border: 1px solid var(--line); border-left: 4px solid var(--emerald);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: var(--s3) var(--s4);
  cursor: pointer; text-align: left; width: 100%;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
.stack-layer:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.stack-layer.is-active { background: var(--forest); border-color: var(--forest); border-left-color: var(--solar); }
.stack-layer.is-active .stack-layer-name { color: var(--ink-invert); }
.stack-layer.is-active .stack-layer-amount { color: var(--warm-yellow); }
.stack-layer.is-active .stack-layer-sub { color: rgba(243,240,230,0.7); }
.stack-layer[data-off="1"] { border-style: dashed; border-left-style: solid; border-left-color: var(--solar); background: var(--panel-alt); }
.stack-layer-name { font-family: var(--serif); font-size: var(--fs-base); font-weight: 600; }
.stack-layer-sub { font-size: var(--fs-xs); color: var(--ink-muted); }
.stack-layer-amount { font-family: var(--mono); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }

.stack-scale {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--fs-xs); color: var(--ink-muted); margin: var(--s3) 0;
}
.stack-riskbar {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-muted);
}

.stack-detail { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: var(--s5); position: sticky; top: calc(var(--topbar-h) + var(--s5)); }
.stack-detail h3 { font-family: var(--serif); font-size: var(--fs-lg); margin-bottom: var(--s2); }
.stack-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s4) 0; }
.stack-fact { border-top: 1px solid var(--line); padding-top: 7px; }
.stack-fact dt { font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; }
.stack-fact dd { margin: 3px 0 0; font-size: var(--fs-sm); color: var(--ink-soft); }

.waterfall { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.waterfall li {
  display: flex; align-items: center; gap: var(--s3);
  padding: 7px var(--s3); border-radius: var(--radius-sm); background: var(--panel-alt);
  font-size: var(--fs-sm); color: var(--ink-soft);
}
.waterfall-num {
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 700;
  color: var(--emerald); min-width: 16px; flex: none;
}

/* ------------------------------------------------------------------ table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 620px; }
table.data th {
  text-align: left; font-size: 0.625rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 700; padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line); background: var(--panel-alt); white-space: nowrap;
}
table.data td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background var(--t) var(--ease); }
table.data tbody tr:hover { background: var(--panel-alt); }
table.data a { font-weight: 600; text-decoration: none; color: var(--ink); }
table.data a:hover { color: var(--emerald); }

/* --------------------------------------------------------------- evidence */
.claim {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius);
  background: var(--panel); padding: var(--s4);
  display: flex; flex-direction: column; gap: 7px;
}
.claim[data-claim="fact"]       { border-left-color: var(--ok); }
.claim[data-claim="assessment"] { border-left-color: var(--emerald); }
.claim[data-claim="hypothesis"] { border-left-color: var(--warn); }
.claim[data-claim="to-verify"]  { border-left-color: var(--stop); }
.claim-type {
  font-size: 0.5938rem; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 700;
}
.claim[data-claim="fact"] .claim-type       { color: var(--ok); }
.claim[data-claim="assessment"] .claim-type { color: var(--emerald); }
.claim[data-claim="hypothesis"] .claim-type { color: var(--warn); }
.claim[data-claim="to-verify"] .claim-type  { color: var(--stop); }
.claim-text { font-size: var(--fs-sm); line-height: 1.55; }
.claim-meta { font-size: var(--fs-xs); color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: var(--s3); }

.evidence-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s3); }
.legend-item { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); background: var(--panel); }
.legend-item b { display: block; font-size: var(--fs-sm); margin-bottom: 3px; }
.legend-item span { font-size: var(--fs-xs); color: var(--ink-muted); line-height: 1.45; }

/* -------------------------------------------------------------- timelines */
.timeline { list-style: none; position: relative; padding-left: var(--s5); }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding-bottom: var(--s4); }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1 * var(--s5) + 1px); top: 6px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line-strong);
}
.timeline li[data-kind="announced"]::before { border-color: var(--warn); }
.timeline li[data-kind="contracted"]::before { border-color: var(--emerald); background: var(--emerald); }
.timeline li[data-kind="operational"]::before { border-color: var(--ok); background: var(--ok); }
.timeline li[data-kind="did-not-happen"]::before { border-color: var(--stop); border-style: dashed; }
.timeline-label { font-size: var(--fs-sm); font-weight: 600; }
.timeline li[data-kind="did-not-happen"] .timeline-label { color: var(--stop); text-decoration: line-through; text-decoration-thickness: 1px; }
.timeline-note { font-size: var(--fs-xs); color: var(--ink-muted); line-height: 1.5; margin-top: 2px; }
.timeline-kind {
  font-size: 0.5625rem; letter-spacing: 0.11em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-muted); margin-left: 8px;
}

/* --------------------------------------------------------------- explain */
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: var(--panel-alt);
  padding: var(--s7) var(--s5);
  text-align: center;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.dropzone.is-over { border-color: var(--emerald); background: var(--ok-wash); }
.dropzone h3 { font-family: var(--serif); font-size: var(--fs-lg); margin-bottom: var(--s2); }
.dropzone p { font-size: var(--fs-sm); color: var(--ink-muted); max-width: 46ch; margin: 0 auto var(--s4); }

/* ------------------------------------------------------------ mini charts */
.bar-row { display: flex; align-items: center; gap: var(--s3); margin-bottom: 6px; font-size: var(--fs-sm); }
.bar-label { min-width: 132px; color: var(--ink-soft); }
.bar-track { flex: 1; height: 7px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--emerald); border-radius: 4px; transition: width var(--t-slow) var(--ease); }
.bar-value { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-muted); min-width: 30px; text-align: right; }

/* --------------------------------------------------------------- login */
.auth-card { max-width: 380px; margin: var(--s8) auto; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1040px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .detail-aside > * { flex: 1 1 260px; }
  .stack-layout { grid-template-columns: minmax(0, 1fr); }
  .stack-detail { position: static; }
}

@media (max-width: 880px) {
  .journey-track { grid-auto-flow: row; grid-auto-columns: auto; }
  .journey-step { flex-direction: row; align-items: baseline; gap: 10px; padding: 11px var(--s4); }
  .ladder { grid-template-columns: 1fr; gap: var(--s5); }
  .journey-detail { padding: var(--s5) var(--s4); }
  .fid-warning { flex-direction: column; align-items: flex-start; gap: var(--s2); }
  .signed-not-operational { flex-direction: column; align-items: flex-start; gap: var(--s2); }
}
