/* ────────────────────────────────────────────────────────────
   Styles for charts emitted by /js/wr-chart-render.js.
   Neutral cream-paper theme — works inside the student-facing
   exam panel AND the admin preview pane without conflict.
   ──────────────────────────────────────────────────────────── */

.wcr-title {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: .95rem;
  color: #2A1F12;
  margin-bottom: .6rem;
  text-align: center;
  line-height: 1.25;
}

/* ── Process diagram ────────────────────────────────────── */
.wcr-process { font-family: "Inter", system-ui, sans-serif; }
.wcr-process-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.wcr-process-step {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.wcr-process-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #B57A2E;
  color: #FFFCF4;
  font-weight: 700;
  font-size: .82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.wcr-process-body { flex: 1; min-width: 0; padding-top: .2rem; }
.wcr-process-label {
  font-weight: 600;
  color: #2A1F12;
  font-size: .94rem;
  line-height: 1.35;
}
.wcr-process-note {
  font-size: .82rem;
  color: rgba(74, 58, 38, 0.65);
  font-style: italic;
  line-height: 1.35;
  margin-top: .1rem;
}

/* ── Pie chart ──────────────────────────────────────────── */
.wcr-pie { font-family: "Inter", system-ui, sans-serif; }
.wcr-pie-body {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  justify-content: center;
}
.wcr-pie-svg {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
}
.wcr-pie-legend {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

/* ── Shared legend item (pie + axis charts) ──────────────── */
.wcr-legend-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .86rem;
  color: #2A1F12;
}
.wcr-legend-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}
.wcr-legend-label { flex: 1; }
.wcr-legend-val {
  font-weight: 700;
  color: rgba(74, 58, 38, 0.85);
  font-variant-numeric: tabular-nums;
}

/* ── Bar / Line charts ──────────────────────────────────── */
.wcr-bar,
.wcr-line { font-family: "Inter", system-ui, sans-serif; }
.wcr-bar-svg,
.wcr-line-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 360px;
}
.wcr-axis-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: .5rem;
}
.wcr-axis-legend .wcr-legend-item {
  font-size: .82rem;
  gap: .35rem;
}

/* ── Table ──────────────────────────────────────────────── */
.wcr-table { font-family: "Inter", system-ui, sans-serif; }
.wcr-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  background: transparent;
}
.wcr-table thead th {
  background: rgba(181, 122, 46, 0.10);
  color: #2A1F12;
  font-weight: 700;
  text-align: left;
  padding: .6rem .8rem;
  border-bottom: 2px solid rgba(74, 58, 38, 0.20);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.wcr-table tbody td {
  padding: .55rem .8rem;
  border-bottom: 1px solid rgba(74, 58, 38, 0.08);
  color: rgba(74, 58, 38, 0.88);
  font-variant-numeric: tabular-nums;
  vertical-align: top;
}
.wcr-table tbody tr:last-child td { border-bottom: none; }

/* ── Mixed (stack sub-charts) ───────────────────────────── */
.wcr-mixed {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
.wcr-mixed > * + * {
  padding-top: 1.2rem;
  border-top: 1px dashed rgba(74, 58, 38, 0.15);
}

/* ── Mobile tightening ──────────────────────────────────── */
@media (max-width: 640px) {
  .wcr-pie-body { gap: 1rem; }
  .wcr-pie-svg  { width: 160px; height: 160px; }
  .wcr-pie-legend { min-width: 0; }
  .wcr-process-num { width: 24px; height: 24px; font-size: .76rem; }
  .wcr-table table { font-size: .82rem; }
  .wcr-table thead th { padding: .5rem .6rem; }
  .wcr-table tbody td { padding: .45rem .6rem; }
}
