/* Charts
 * Trend chart, heatmap, insight bars, word clouds, and the practice panel.
 *
 * Lifted from the prototype's single stylesheet, unchanged apart from
 * indentation. Every colour resolves through a token in tokens.css.
 */

/* ---------- chart cards ---------- */
.chartcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-card); }
.empty { color: var(--ink-faint); font-size: 14.5px; padding: 22px 4px; text-align: center; font-style: italic; }

.trendscroll { overflow-x: auto; }
.trendsvgwrap { position: relative; }
svg.trendsvg { display: block; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--surface);
  font-size: 14.5px; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%);
  opacity: 0; transition: opacity .1s; z-index: 5; line-height: 1.4;
}
.tooltip.show { opacity: 1; }
.legendrow { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 15px; color: var(--ink-soft); }
.legendrow .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.heatscroll { overflow-x: auto; }
table.heatmap { border-collapse: collapse; font-size: 15px; }
table.heatmap th, table.heatmap td { padding: 0; text-align: center; }
table.heatmap th.rowlabel, table.heatmap td.rowlabel {
  text-align: left; padding: 7px 12px 7px 0; font-weight: 600; white-space: nowrap; position: sticky; left: 0;
  background: var(--surface); font-size: 15px;
}
table.heatmap th.collabel { font-weight: 700; color: var(--ink-soft); font-size: 13.5px; padding: 0 3px 8px; white-space: nowrap; font-family: 'Karla', sans-serif; letter-spacing: 0.02em; }
table.heatmap td.cell { width: 40px; height: 36px; }
.cellbox {
  width: 36px; height: 32px; border-radius: 8px; margin: 0 auto; display: flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 700; font-family: 'Karla', sans-serif; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
}
.cellbox.blank { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-faint); font-weight: 400; }

.insightgrid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.insightrow { display: flex; align-items: center; gap: 10px; }
.insightrow .ilabel { width: 120px; flex: none; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ibartrack { flex: 1; height: 12px; background: var(--neutral-bg); border-radius: 6px; position: relative; overflow: hidden; }
.ibarfill { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.ibarzero { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--line-strong); }
.ivalue { width: 48px; text-align: right; font-size: 15px; font-weight: 600; color: var(--ink-soft); font-family: 'Karla', sans-serif; font-variant-numeric: tabular-nums; }
.insight-sentences { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.insight-sentences p { margin: 0; font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); }
.insight-sentences strong { color: var(--ink); }

.chipsrow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-soft);
  border-radius: 999px; padding: 10px 16px; min-height: 44px; font-size: 15px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.cloudpair { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .cloudpair { grid-template-columns: 1fr 1fr; } }
.cloudbox { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.cloudbox .ctitle { font-size: 15px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.cloudbox .ctitle .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.cloudwrap {
  position: relative; height: 250px; border-radius: 999px / 40%; overflow: hidden;
}
.cloudwrap.energized { background: var(--pos-tint); }
.cloudwrap.drained { background: var(--neg-tint); }
.cloudwrap .empty-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 14.5px; font-style: italic; }
.word {
  position: absolute; white-space: nowrap; line-height: 1;
  font-family: 'Karla', sans-serif; font-style: italic; font-weight: 600;
  opacity: 0; transform: scale(.85); transition: opacity .35s ease, transform .35s ease;
}
.word.placed { opacity: 1; transform: scale(1); }
.word.energized { color: var(--pos); }
.word.drained { color: var(--neg); }
@media (prefers-reduced-motion: reduce) { .word { transition: none; } }

details.howto { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 4px 18px; margin-top: 30px; box-shadow: var(--shadow-card); }
details.howto summary { cursor: pointer; padding: 16px 2px; min-height: 24px; font-weight: 700; font-size: 16px; font-family: 'Karla', sans-serif; }
details.howto ol, details.howto ul { margin: 0 0 14px; padding-left: 20px; font-size: 14.5px; color: var(--ink-soft); line-height: 1.75; }
details.howto table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-bottom: 14px; }
details.howto td { padding: 5px 0; border-bottom: 1px solid var(--line); }
details.howto td:first-child { font-weight: 700; width: 60px; font-family: 'Karla', sans-serif; font-variant-numeric: tabular-nums; }

footer.foot { text-align: center; font-size: 14px; color: var(--ink-faint); margin-top: 32px; font-style: italic; line-height: 1.6; }
