/* Embraced:Fully Learner Explorer — static design system.
   Palette follows the validated dataviz reference (sequential blue ramp,
   blue/orange categorical pair) with Embraced:Fully navy as chrome. */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --brand: #29465e;
  --brand-deep: #12283f;
  --accent: #eb6834;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --seq-0: #f0efec;
  --seq-1: #cde2fb;
  --seq-2: #86b6ef;
  --seq-3: #3987e5;
  --seq-4: #1c5cab;
  --seq-5: #0d366b;
  --good-text: #006300;
  --radius: 12px;
}

/* Scoped to .ef-le so the explorer can render inside the WordPress theme
   without leaking styles either direction. Standalone pages wrap their body
   content in .ef-le too. */
.ef-le, .ef-le * { box-sizing: border-box; }
body { margin: 0; }
.ef-le {
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
.ef-le h1, .ef-le h2, .ef-le h3, .ef-le p, .ef-le table, .ef-le button, .ef-le a { font-family: inherit; }
.ef-le a { color: var(--brand); }
.ef-le h1, .ef-le h2 { color: var(--ink); }
.page-stamp { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.masthead {
  background: var(--brand);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.masthead-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.masthead a.wordmark {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.2px;
}
.masthead .app-name {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
}
.masthead .stamp {
  margin-left: auto;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 56px; }

.page-title { margin: 30px 0 4px; font-size: 30px; line-height: 1.15; letter-spacing: -0.3px; }
.page-sub { margin: 0 0 8px; color: var(--ink-2); font-size: 15.5px; max-width: 62ch; }
.crumb { margin: 26px 0 -18px; font-size: 14px; }
.crumb a { text-decoration: none; color: var(--brand); font-weight: 600; }
.crumb a:hover { text-decoration: underline; }

h2.section { margin: 40px 0 6px; font-size: 20px; letter-spacing: -0.2px; }
p.section-note { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; max-width: 72ch; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

/* KPI tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 22px 0 6px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  min-width: 0;
}
.tile .label { font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
.tile .value { font-size: 30px; font-weight: 600; margin-top: 3px; line-height: 1.1; }
.tile .delta { font-size: 12.5px; margin-top: 3px; color: var(--good-text); }
.tile .delta.neutral { color: var(--muted); }
.tile.spark { position: relative; }
.tile svg.sparkline { position: absolute; right: 12px; bottom: 10px; opacity: 0.9; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .chips-label { font-size: 13px; color: var(--ink-2); margin-right: 2px; }
.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
}
.chip:hover { background: #f2f1ee; }
.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.toggle-row input { accent-color: var(--brand); width: 16px; height: 16px; }

/* Maps */
.map-card { padding: 16px 18px 14px; }
.map-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 10px; }
.map-svg { width: 100%; height: auto; max-height: 620px; display: block; margin: 0 auto; }
.map-svg a { cursor: pointer; }
.map-svg path.geo {
  stroke: var(--surface);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: filter 80ms linear;
}
.map-svg path.geo:hover, .map-svg a:focus-visible path.geo { filter: brightness(0.86); }
.map-svg a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.map-svg path.mesh { fill: none; stroke: var(--surface); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-svg circle.fac {
  fill: var(--series-2);
  fill-opacity: 0.8;
  stroke: var(--surface);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.map-svg circle.fac-hit { fill: transparent; cursor: pointer; }
.map-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-top: 10px; }
.map-note { font-size: 12.5px; color: var(--muted); }

/* Legend */
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; color: var(--ink-2); }
.legend .swatch { display: inline-flex; align-items: center; gap: 5px; }
.legend .swatch i {
  width: 16px; height: 12px; border-radius: 3px; display: inline-block;
  border: 1px solid var(--border);
}
.legend .swatch.dot i { width: 11px; height: 11px; border-radius: 50%; background: var(--series-2); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }

/* Tables */
.table-scroll { overflow-x: auto; max-height: 560px; overflow-y: auto; border-radius: var(--radius); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
}
table.data th, table.data td { padding: 8px 12px; text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th {
  position: sticky; top: 0;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--baseline);
  z-index: 1;
}
table.data tbody td { border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
table.data tbody tr:hover td { background: #f4f3f0; }
table.data td.dim, table.data tr.dim td { color: var(--muted); }
table.data a { font-weight: 600; text-decoration: none; }
table.data a:hover { text-decoration: underline; }

/* Horizontal bars */
.bars { display: grid; gap: 12px; margin-top: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 64px; align-items: center; gap: 12px; }
.bar-row .bar-label { font-size: 14px; color: var(--ink); line-height: 1.3; }
.bar-row .bar-track { height: 18px; position: relative; }
.bar-row .bar-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--series-1);
  border-radius: 0 4px 4px 0;
  min-width: 2px;
}
.bar-row .bar-val { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bar-row .bar-pct { color: var(--muted); font-weight: 400; font-size: 12px; }

/* Two-up layout */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }

/* Line chart */
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--series-1); opacity: 0.1; }
.chart-grid { stroke: var(--grid); stroke-width: 1; }
.chart-axis-text { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart-end-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart-end-label { font-size: 12px; font-weight: 600; fill: var(--ink); }
.chart-cross { stroke: var(--baseline); stroke-width: 1; opacity: 0; }
.chart-hover-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; opacity: 0; }

/* Tooltip */
.viz-tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  line-height: 1.45;
  max-width: 260px;
  box-shadow: 0 6px 20px rgba(11, 11, 11, 0.25);
  opacity: 0;
  transition: opacity 60ms linear;
}
.viz-tip .tip-title { font-weight: 700; font-size: 13px; }
.viz-tip .tip-row { display: flex; justify-content: space-between; gap: 14px; }
.viz-tip .tip-row .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-tip .tip-row .k { color: rgba(255, 255, 255, 0.75); }

/* State link grid */
.state-links { columns: 4; column-gap: 18px; font-size: 14px; margin-top: 8px; }
@media (max-width: 860px) { .state-links { columns: 3; } }
@media (max-width: 640px) { .state-links { columns: 2; } }
.state-links a { display: block; padding: 3px 0; text-decoration: none; }
.state-links a:hover { text-decoration: underline; }
.state-links .n { color: var(--muted); font-size: 12.5px; }

/* Footer */
.cta-band {
  margin-top: 48px;
  background: var(--brand);
  border-radius: var(--radius);
  color: #fff;
  padding: 26px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}
.cta-band .cta-text { font-size: 17px; font-weight: 600; max-width: 46ch; line-height: 1.4; }
.cta-band a.btn {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 8px;
  white-space: nowrap;
}
.cta-band a.btn:hover { filter: brightness(1.07); }
.foot {
  margin-top: 26px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  max-width: 86ch;
}
.foot a { color: var(--ink-2); }

@media (max-width: 640px) {
  .page-title { font-size: 24px; margin-top: 22px; }
  .tile .value { font-size: 24px; }
  .tile svg.sparkline { display: none; }
  .card { padding: 14px 14px; }
  .bar-row { grid-template-columns: minmax(110px, 150px) 1fr 58px; gap: 8px; }
  .masthead .stamp { display: none; }
}
