/* Trade Reports — headline combination-code panels.
 *
 * Layered on tokens.css + app.css + country.css: the shell, rail, panel and
 * chart furniture are the country dashboard's; this file adds only the panel
 * grid and the family tints.
 *
 * The tints keep the printed chart-sheet convention: green-coffee panels on
 * a soft green, roasted on a soft brown, soluble on a soft grey. The dark
 * theme keeps the hue at low opacity. */

.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: var(--sp-16);
  padding: var(--sp-24);
}
@media (max-width: 560px) { .code-grid { grid-template-columns: 1fr; padding: var(--sp-12); } }

.code-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: var(--sp-16);
}

/* The total spans the grid and is read first: every code summed in green
   bean equivalent. It takes no family tint — it is all of them at once. */
.code-card.total-card { grid-column: 1 / -1; }

.code-card .code-tag {
  display: inline-block;
  font: 600 var(--fs-cap) var(--font-mono);
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  margin-right: var(--sp-6);
}

/* Panel family tints (light) */
.fam-green { background: #f1f7ec; }
.fam-roasted { background: #f7f0e6; }
.fam-soluble { background: #f3f3f2; }

/* Panel family tints (dark) — same hues, theatre lighting */
[data-theme="dark"] .fam-green { background: rgba(104, 146, 82, 0.10); }
[data-theme="dark"] .fam-roasted { background: rgba(164, 124, 76, 0.10); }
[data-theme="dark"] .fam-soluble { background: rgba(160, 160, 160, 0.08); }

.code-card .chart.empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 180px;
  color: var(--ink-faint);
  font: 400 var(--fs) var(--font-ui);
  font-style: italic;
}

.rep-notes { padding: 0 var(--sp-24) var(--sp-24); }

/* ---------- flow switch + partner pin in the rail ---------- */
.flow-pills { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-6); }
.flow-pills button {
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--panel-strong); color: var(--ink-dim);
  font: 500 var(--fs-cap-lg) var(--font-ui); padding: 7px 4px; cursor: pointer;
}
.flow-pills button:hover { color: var(--ink); }
.flow-pills button.on {
  background: var(--ink); border-color: var(--ink); color: var(--bg);
  font-weight: 600;
}
.flow-pills button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.partner-sel {
  width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--panel-strong); color: var(--ink);
  font: 400 var(--fs) var(--font-ui); padding: 7px var(--sp-8);
}
.partner-sel:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* The pin reads as active state, same ink-on-paper flip as the pills. */
.partner-sel.pinned { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- how-to-read key in the rail ---------- */
.howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-8); }
.howto li {
  display: grid; grid-template-columns: 26px 1fr; gap: var(--sp-8); align-items: start;
  font: 400 var(--fs-cap-lg) var(--font-ui); color: var(--ink-dim); line-height: 1.45;
}
.howto i { height: 12px; margin-top: 3px; border-radius: 2px; }
.howto .k-band { background: var(--ink-mute); opacity: 0.25; }
.howto .k-prev { height: 0; border-top: 1.5px solid var(--ink-faint); margin-top: 8px; }
.howto .k-curr { height: 0; border-top: 3px solid var(--viz-origin); margin-top: 7px; border-radius: 2px; }
