/* Ore Traceability (V1.44, Client\Apps\Traceability): the circuit's diagram (CircuitDiagram.razor), a pile's figures, layers
   and shares (PilePage.razor, TraceShares.razor), the accountability's chart and table (AccountChart.razor,
   AccountabilityPage.razor) and the settings' editor (SettingsPage.razor). Only the theme's tokens (app.css :root and its
   dark values): light and dark alike. Linked by Components\App.razor after app.css and predictive.css (the pages reuse
   their panel, kpi, table, pdm-input, pdm-bar and pdm-status rules). */

/* ---- The diagram ---- */
.trc-diagram {
  overflow-x: auto;
  padding-bottom: 4px;
}
.trc-diagram svg {
  display: block;
  max-width: none;
}
.trc-link {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  opacity: 0.75;
}
.trc-arrowhead {
  fill: var(--muted);
}
.trc-box {
  fill: var(--panel-2);
  stroke: var(--border);
  stroke-width: 1.2;
}
.trc-node-source .trc-box { fill: var(--gold-soft); }
.trc-node-crusher .trc-box { fill: var(--chip); }
.trc-node-pile .trc-box { fill: var(--accent-soft); stroke: var(--accent); }
.trc-node-mill .trc-box { fill: var(--info-soft); }
.trc-node-link:hover .trc-box,
.trc-node-link:focus .trc-box {
  stroke-width: 2.4;
}
.trc-node-link { cursor: pointer; }
.trc-name {
  fill: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.trc-sub {
  fill: var(--muted);
  font-size: 11.5px;
}
.trc-big {
  fill: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.trc-pill rect { fill: var(--panel); stroke: var(--border); }
.trc-pill text {
  fill: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  text-anchor: middle;
}
.trc-pill-tag rect { stroke: var(--accent); }
.trc-pill-tag text { fill: var(--accent-strong); }
.trc-fill-track { fill: var(--chip); }
.trc-fill { fill: var(--accent); }
.trc-fill-high { fill: var(--warn); }

/* ---- Figures, tables, shares ---- */
.trc-kpis .value { white-space: nowrap; }
.trc-table td.num,
.trc-table th.num { text-align: right; white-space: nowrap; }
.trc-model {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.trc-share-col { min-width: 140px; }
.trc-share {
  display: inline-block;
  width: 90px;
  height: 8px;
  border-radius: 4px;
  background: var(--chip);
  vertical-align: middle;
  overflow: hidden;
}
.trc-share-bar {
  display: block;
  height: 100%;
  background: var(--accent);
}
.trc-share-special { background: var(--faint); }
.trc-share-pct { margin-left: 6px; font-size: 0.85rem; }
.trc-warnings ul { margin: 0; padding-left: 20px; }
.trc-warnings li { margin: 4px 0; }
.trc-warning { color: var(--warn); }
.trc-diff-ok { color: var(--good-text); }
.trc-diff-watch { color: var(--warn); }
.trc-diff-bad { color: var(--bad); font-weight: 700; }

/* ---- A pile ---- */
.trc-pile-head { display: flex; gap: 16px; align-items: flex-start; }
.trc-pile-main { flex: 1; min-width: 0; }
.trc-pile-main h2 { margin: 4px 0 10px; }
.trc-pile-figures { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.trc-pile-figures > div { display: flex; flex-direction: column; }
.trc-pile-figures .label { color: var(--muted); font-size: 0.8rem; }
.trc-pile-figures b { font-size: 1.15rem; }
.trc-whatif {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--note-soft);
  border: 1px solid var(--border);
}
.trc-whatif span { flex: 1; min-width: 200px; }
.trc-model-forms { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-bottom: 12px; }
.trc-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.trc-form-title { width: 100%; font-weight: 700; margin-top: 4px; }
.trc-inline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.trc-num-input { width: 96px; }
.trc-note { min-width: 180px; flex: 1; }
.trc-reclaim { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.trc-stack {
  display: flex;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--chip);
}
.trc-layer {
  min-width: 2px;
  background: color-mix(in srgb, var(--accent) var(--trc-strength, 50%), var(--panel));
  border-right: 1px solid var(--panel);
}
.trc-layer:last-child { border-right: 0; }
.trc-layer-open {
  background-image: repeating-linear-gradient(45deg, transparent 0 6px, var(--panel) 6px 8px);
}
.trc-stack-scale { display: flex; justify-content: space-between; margin: 4px 0 10px; }
.trc-trend-label { margin: 6px 0 2px; }

/* ---- The accountability ---- */
.trc-switch { display: inline-flex; gap: 4px; }
.trc-switch .trc-on { background: var(--os-accent-fill); color: var(--os-on-accent-fill); }
.trc-chart-plot { display: flex; align-items: stretch; gap: 6px; }
.trc-chart svg { display: block; flex: 1; min-width: 0; width: 100%; height: 140px; background: var(--panel-2); border-radius: 8px; }
.trc-chart polyline { fill: none; stroke-width: 2; }
.trc-line-planned { stroke: var(--muted); stroke-dasharray: 5 4; }
.trc-line-estimated { stroke: var(--accent); stroke-width: 2.6; }
.trc-line-assay { stroke: var(--info); }
.trc-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; color: var(--muted); font-size: 0.85rem; }
.trc-key { display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px solid; }
.trc-key.trc-line-planned { border-top: 2px dashed var(--muted); }
.trc-key.trc-line-estimated { border-top-color: var(--accent); border-top-width: 3px; }
.trc-key.trc-line-assay { border-top-color: var(--info); }
.trc-account .trc-group { text-align: center; border-bottom: 1px solid var(--rule); }
.trc-total td { font-weight: 700; border-top: 2px solid var(--border); }

/* ---- The settings ---- */
.trc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; margin-bottom: 10px; }
.trc-grid label,
.trc-streams label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.trc-grid .pdm-input,
.trc-streams .pdm-input { color: var(--text); }
.trc-rows { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.trc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0; }
.trc-short { width: 130px; }
.trc-wide { min-width: 200px; flex: 1; }
.trc-remove { padding: 2px 10px; font-weight: 700; }
.trc-box-edit {
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.trc-edit-pile { border-left: 4px solid var(--accent); }
.trc-edit-mill { border-left: 4px solid var(--info); }
.trc-edit-source { border-left: 4px solid var(--brand-gold); }
.trc-sub-edit { margin: 6px 0 2px 4px; }
.trc-check { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; font-weight: 600; }
.trc-streams { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 14px; margin: 4px 0 6px; }
.trc-dirty { color: var(--warn); font-weight: 700; margin-right: 6px; }

@media (max-width: 700px) {
  .trc-hide-narrow { display: none; }
  .trc-pile-head { flex-direction: column; }
  .trc-short { width: 110px; }
  .trc-wide { min-width: 140px; }
}
