/* site.css: stat.tw layout. Colours, type and parts come from endfield.css
   (ef- classes, --ef-* variables); this file only places things, plus the few
   site parts the kit does not have (top bar, map, sortable table head). */

/* ---------- frame ---------- */

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--ef-signal);
  color: var(--ef-on-signal);
  font-weight: 700;
}
.skip:focus {
  left: 0;
}

/* Top bar: brand, three sections, the theme switch. The current section is a
   filled block with one corner cut, like the kit's side rail lying down. */
.site-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding: 0.6rem var(--ef-pad);
  border-bottom: 1px solid var(--ef-rule);
}
.site-bar .brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-stretch: var(--ef-wider);
  font-weight: 800;
  letter-spacing: 0.08em;
}
.site-bar nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.site-bar nav a {
  display: inline-flex;
  flex-direction: column;
  min-height: 2.75rem;
  justify-content: center;
  padding: 0.2rem calc(0.8rem + var(--ef-cut)) 0.2rem 0.8rem;
  color: var(--ef-ink-2);
  font-weight: 700;
  line-height: 1.2;
}
.site-bar nav a small {
  font-size: 0.6rem;
  font-stretch: var(--ef-wider);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-bar nav a:hover {
  color: var(--ef-ink);
}
.site-bar nav a[aria-current] {
  color: var(--ef-on-signal);
  background: linear-gradient(-45deg, transparent calc(var(--ef-cut) - 0.5px), var(--ef-signal) var(--ef-cut));
}
@media (max-width: 560px) {
  .site-bar [data-theme-toggle] {
    margin-left: auto;
  }
  .site-bar nav {
    flex-basis: 100%;
    order: 1;
  }
}

.site-foot {
  padding: 1.5rem var(--ef-pad) 2.5rem;
  border-top: 1px solid var(--ef-rule);
}

/* A white sheet across the page, content held to a readable width. */
.sheet {
  background: var(--ef-panel);
  border-bottom: 1px solid var(--ef-rule);
}
.sheet > .in,
.band > .in {
  max-width: 84rem;
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 3rem) var(--ef-pad) clamp(2.5rem, 5vw, 4rem);
}
.band > .in {
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
}

.page-head .ef-eyebrow {
  margin: 0 0 0.5rem;
}
.page-head .ef-facts {
  margin-top: 0.9rem;
}
.page-head h1 {
  font-size: clamp(var(--ef-t-title), 5vw, var(--ef-t-h1));
}

.section-head {
  margin: 2.75rem 0 0;
}
.section-head .ef-eyebrow {
  margin: 0 0 0.25rem;
}
.section-head + * {
  margin-top: 1rem;
}

/* Records with three columns: tag / name / field. */
.ef-records.three .ef-record {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
@media (max-width: 719px) {
  .ef-records.three .ef-record .name {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .ef-records.three .ef-record > .ef-field:last-child {
    grid-column: 2 / -1;
    grid-row: 1;
  }
}

/* ---------- home ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  grid-template-rows: auto 1fr auto;
  column-gap: clamp(1.5rem, 4vw, 4rem);
  max-width: 84rem;
  margin: 0 auto;
  padding: 1.25rem var(--ef-pad) 0;
}
.hero > .meta {
  grid-column: 1;
  margin: 0;
}
.hero > .meta > * + *::before {
  content: '/';
  margin-inline: 0.75em;
  color: var(--ef-rule);
}
.hero .ef-wordmark {
  grid-column: 1;
  align-self: end;
  margin: 3rem 0 0;
  --ef-wordmark: clamp(4rem, 13vw, 10rem);
}
.hero .copy {
  grid-column: 1;
  padding: 1.75rem 0 2.5rem;
}
.hero .copy p {
  margin: 0;
}
.hero .claim {
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
}
.hero .copy .ef-actions {
  margin-top: 1.5rem;
}
.hero .ef-frame {
  grid-column: 2;
  grid-row: 1 / 4;
  aspect-ratio: 400 / 500;
  margin: 0 0 2.5rem;
}
.hero .ef-frame .window {
  display: grid;
  place-items: center;
  padding: 0.75rem;
}
.hero .ef-frame svg {
  width: 100%;
  height: 100%;
}
@media (max-width: 859px) {
  .hero .ef-wordmark {
    --ef-wordmark: clamp(4rem, 24vw, 8rem);
    margin-top: 2rem;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }
  .hero .ef-frame {
    grid-column: 1;
    grid-row: auto;
    width: min(100%, 26rem);
    margin: 0 1rem 2.5rem 0;
  }
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
}

/* ---------- the epicentre map ---------- */

.quake-map {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--ef-font-ui);
}
.quake-map .land path {
  fill: var(--ef-chip);
  stroke: var(--ef-rule);
  stroke-width: 0.6;
}
.quake-map .other path {
  fill: var(--ef-chip);
  opacity: 0.55;
}
.quake-map .grid line {
  stroke: var(--ef-rule);
  stroke-width: 0.6;
}
.quake-map text {
  fill: var(--ef-ink-2);
  font-size: 9px;
  font-stretch: var(--ef-wide);
}
.quake-map .dots rect,
.quake-map .legend rect:not(.plate) {
  fill: none;
  stroke: var(--ef-ink);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.quake-map .legend .plate {
  fill: var(--ef-panel);
  stroke: var(--ef-rule);
}
.quake-map .dots rect.is-out {
  display: none;
}
/* the row being pointed at: its square filled in the colour of "here" */
.quake-map .dots rect.is-here {
  fill: var(--ef-signal);
  stroke: var(--ef-ink);
  stroke-width: 2;
}

/* ---------- data page ---------- */

.data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: 2rem clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  margin-top: 2rem;
}
.data-layout > aside {
  position: sticky;
  top: 1rem;
}
.data-layout > aside figure {
  margin: 0;
  border: 1px solid var(--ef-rule);
  background: var(--ef-panel);
}
.data-layout > aside figcaption {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--ef-rule);
}
@media (max-width: 1179px) {
  .data-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  /* narrow screens: the table first, the map after it */
  .data-layout > aside {
    position: static;
    max-width: 24rem;
  }
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.filter-label {
  margin: 0;
}
.shown {
  margin: 1.25rem 0 0.5rem;
}

/* sortable head: the whole cell is a button; the arrow shows the order */
.ef-table th[aria-sort] {
  padding: 0;
}
.ef-table th .sort {
  display: flex;
  align-items: center;
  justify-content: inherit;
  gap: 0.35rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
}
.ef-table th.num .sort {
  justify-content: flex-end;
}
.ef-table th .sort::after {
  content: '↕';
  opacity: 0.45;
  letter-spacing: 0;
}
.ef-table th[aria-sort='ascending'] .sort,
.ef-table th[aria-sort='descending'] .sort {
  color: var(--ef-ink);
}
.ef-table th[aria-sort='ascending'] .sort::after {
  content: '▲';
  opacity: 1;
}
.ef-table th[aria-sort='descending'] .sort::after {
  content: '▼';
  opacity: 1;
}
.ef-table th .sort:hover {
  color: var(--ef-ink);
}
.quake-table :is(th, td) {
  white-space: nowrap;
}
.quake-table td,
.quake-table th:not([aria-sort]) {
  padding-inline: 0.55rem;
}
.quake-table th .sort {
  padding-inline: 0.55rem;
}
.ef-table td .ef-tag {
  font-size: 0.75rem;
}
.ef-table .t {
  font-stretch: var(--ef-wide);
  font-variant-numeric: tabular-nums;
}
.ef-table .m {
  font-weight: 800;
}
.ef-table-wrap {
  border-bottom: 1px solid var(--ef-rule);
}
.ef-table tbody tr[hidden] {
  display: none;
}

.notes {
  max-width: 48rem;
}
.notes dl {
  margin: 0;
  border-top: 1px solid var(--ef-rule);
}
.notes dl > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--ef-rule);
}
.notes dt {
  font-weight: 700;
}
.notes dd {
  margin: 0;
  line-height: 1.8;
}
.notes a {
  border-bottom: 1px solid var(--ef-ink-2);
}
@media (max-width: 559px) {
  .notes dl > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- tools ---------- */

.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem clamp(1.5rem, 4vw, 4rem);
  align-items: start;
  margin-top: 2rem;
}
@media (max-width: 899px) {
  .tool {
    grid-template-columns: minmax(0, 1fr);
  }
}
.tool .ef-form {
  display: grid;
  gap: 1.1rem;
}
.ef-form .field {
  align-content: start;
}
.ef-form .field small {
  line-height: 1.6;
}
.ef-form [hidden] {
  display: none !important;
}
.ef-form .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
}
.ef-form textarea {
  min-height: 9rem;
  resize: vertical;
  font-family: var(--ef-font-ui);
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}
.ef-form .ef-seg {
  max-width: 100%;
}
.tool .ef-actions {
  margin: 0;
}

.result h2 {
  margin: 0 0 0.75rem;
}
.result .ef-ledger li > span:first-child {
  color: var(--ef-ink-2);
}
.result .ef-ledger .v {
  font-stretch: var(--ef-wide);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}
.result .ef-ledger .v small {
  color: var(--ef-ink-2);
  font-weight: 400;
}
.result .big {
  margin: 0 0 1rem;
  font-size: var(--ef-t-ui);
}
.result .big b {
  margin-right: 0.35rem;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-stretch: var(--ef-wide);
  font-weight: 800;
  line-height: 1;
}
.result .group {
  margin: 1.5rem 0 0.25rem;
  font-weight: 700;
}
.result .group:first-of-type {
  margin-top: 0;
}
.result .ef-notice {
  margin: 0 0 1rem;
}
.result .ef-empty {
  margin: 0;
}

.formula {
  max-width: 48rem;
  margin-top: 3rem;
}
.formula .ef-prose {
  font-size: 0.95rem;
}
.formula code {
  overflow-wrap: anywhere;
}

/* the contingency table editor */
.grid-input {
  border-collapse: collapse;
}
.grid-input th {
  padding: 0.25rem 0.5rem;
  color: var(--ef-ink-2);
  font-weight: 600;
  font-size: 0.8rem;
}
.grid-input td {
  padding: 0.2rem;
}
.grid-input input {
  width: 5.5rem;
  text-align: right;
}

/* small plots in the tools: grey marks, the line in the colour of "here" */
.plot {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 1.5rem;
  border: 1px solid var(--ef-rule);
  background: var(--ef-panel);
  font-family: var(--ef-font-ui);
}
.plot .axis {
  stroke: var(--ef-rule);
}
.plot text {
  fill: var(--ef-ink-2);
  font-size: 10px;
  font-stretch: var(--ef-wide);
}
.plot .pt {
  fill: none;
  stroke: var(--ef-ink);
  stroke-width: 1.2;
}
.plot .fit,
.plot .curve {
  fill: none;
  stroke: var(--ef-trace);
  stroke-width: 2;
}
.plot .area {
  fill: var(--ef-signal);
  opacity: 0.65;
}

/* number tags that are links: endfield.css lets `.ef a` (color: inherit)
   win over .ef-tag, which leaves ink text on an ink tag */
.ef a.ef-tag {
  color: var(--ef-tag-fg);
}
.ef a.ef-tag:is(:hover, :focus-visible) {
  --fill: var(--ef-signal);
  color: var(--ef-on-signal);
}

/* row labels inside a data table read as plain labels, not as the head */
.ef-table tbody th {
  border-bottom: 1px solid var(--ef-rule);
  color: var(--ef-ink-2);
  font-size: var(--ef-t-field);
  font-stretch: 100%;
  letter-spacing: 0;
  white-space: nowrap;
}
.grid-input th {
  white-space: nowrap;
}

/* a segmented choice of four lies in two rows on a phone */
@media (max-width: 560px) {
  .ef-seg:has(label:nth-child(4)) {
    grid-auto-flow: row;
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- more data pages ---------- */

/* other years of the same record */
.year-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.year-nav a {
  min-height: 2rem;
}

.table-block {
  margin-top: 2.5rem;
}
.table-block > .ef-group-head {
  margin-top: 0;
}
.pop-table :is(th, td),
.year-table :is(th, td) {
  white-space: nowrap;
}
.pop-table td,
.pop-table th:not([aria-sort]) {
  padding-inline: 0.55rem;
}
.pop-table th .sort {
  padding-inline: 0.55rem;
}
.pop-table tfoot :is(th, td) {
  font-weight: 700;
  border-top: 2px solid var(--ef-ink);
}

.more {
  margin: 0.75rem 0 0;
}
.more a {
  border-bottom: 1px solid var(--ef-rule);
}
.more a:hover {
  border-bottom-color: var(--ef-ink);
}

/* ---------- age pyramid ---------- */

/* the two series: blue for men, orange for women, each stepped for its
   surface (checked for colour-blind separation on both) */
:root {
  --viz-male: #257de0;
  --viz-female: #f47230;
}
:root[data-theme='dark'] {
  --viz-male: #338ced;
  --viz-female: #e76624;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --viz-male: #338ced;
    --viz-female: #e76624;
  }
}

.pyramid-figure {
  position: relative;
  max-width: 46rem;
  margin: 1rem 0 0;
  padding: 0.75rem 0.75rem 0;
  border: 1px solid var(--ef-rule);
  background: var(--ef-panel);
}
.pyramid-figure figcaption {
  margin-top: 0.25rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--ef-rule);
}
.pyramid {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--ef-font-ui);
}
.pyramid text {
  fill: var(--ef-ink-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.pyramid .legend text {
  fill: var(--ef-ink);
  font-size: 12px;
  font-weight: 700;
}
.pyramid .grid line {
  stroke: var(--ef-rule);
  stroke-width: 0.6;
}
.pyramid .m {
  fill: var(--viz-male);
}
.pyramid .f {
  fill: var(--viz-female);
}
.pyramid .hit {
  fill: transparent;
}
/* the whole row answers the pointer, not just the painted bar */
.pyramid .row :is(path, text) {
  pointer-events: none;
}
.pyramid .row {
  outline: none;
}
.pyramid .row.is-here .hit {
  fill: color-mix(in srgb, var(--ef-ink) 7%, transparent);
}
.pyramid .row:focus-visible .hit {
  stroke: var(--ef-ink);
  stroke-width: 1;
}
.pyramid .row.is-here .age {
  fill: var(--ef-ink);
  font-weight: 700;
}
.pyramid-tip {
  position: absolute;
  z-index: 2;
  min-width: 9rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--ef-ink);
  background: var(--ef-panel);
  font-family: var(--ef-font-ui);
  font-size: 0.8rem;
  line-height: 1.45;
  pointer-events: none;
}
.pyramid-tip p {
  margin: 0;
}
.pyramid-tip .age {
  color: var(--ef-ink-2);
}
.pyramid-tip :is(.m, .f) {
  color: var(--ef-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pyramid-tip :is(.m, .f)::before {
  content: '';
  display: inline-block;
  width: 0.9rem;
  height: 2px;
  margin-right: 0.45rem;
  vertical-align: middle;
  background: var(--viz-male);
}
.pyramid-tip .f::before {
  background: var(--viz-female);
}
.table-view {
  max-width: 46rem;
  margin-top: 0.75rem;
}
.table-view summary {
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  cursor: pointer;
}
.table-view .ef-table-wrap {
  margin-top: 0.5rem;
}

/* ---------- tests ---------- */

/* the reference sample in gray, the reader's own score in the accent blue
   (both at least 3:1 on the sheet, checked for colour-blind separation) */
:root {
  --viz-accent: #257de0;
  --viz-muted: #8d969d;
}
:root[data-theme='dark'] {
  --viz-accent: #338ced;
  --viz-muted: #6e777e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --viz-accent: #338ced;
    --viz-muted: #6e777e;
  }
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.instructions {
  max-width: var(--ef-measure);
  margin-top: 0.75rem;
}

.q-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.q {
  min-width: 0;
  margin: 0;
  padding: 0.9rem 0 1rem;
  border: 0;
  border-top: 1px solid var(--ef-rule);
}
.q legend {
  display: flex;
  gap: 0.75rem;
  float: left;
  width: 100%;
  margin-bottom: 0.6rem;
  padding: 0;
  font-weight: 600;
  line-height: 1.5;
}
.q legend + * {
  clear: both;
}
.q .no {
  flex: none;
  min-width: 1.6rem;
  color: var(--ef-ink-2);
  font-family: var(--ef-font-ui);
  font-variant-numeric: tabular-nums;
}
.q-scale {
  max-width: 40rem;
  background: var(--ef-panel);
}
.q-scale label {
  min-height: 3rem;
  padding: 0.3rem 0.25rem;
  font-size: var(--ef-t-field);
  line-height: 1.25;
  text-align: center;
}
.likert .q-scale label {
  grid-template-rows: auto auto;
  align-content: center;
  gap: 0.1rem;
}
.likert .q-scale label b {
  font-family: var(--ef-font-ui);
  font-size: 0.95rem;
}
.likert .q-scale label span {
  font-weight: 500;
}
.q-scale label + label {
  border-left: 1px solid var(--ef-rule);
}
.q.is-missing .q-scale {
  outline: 2px solid var(--ef-danger);
  outline-offset: 2px;
}
.q.is-missing .no {
  color: var(--ef-danger);
}

/* two phrases with the scale between them */
.bipolar .q legend {
  margin-bottom: 0.5rem;
}
.bipolar .pair {
  display: grid;
  flex: 1;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 40rem;
}
.bipolar .pair .r {
  text-align: right;
}
.bipolar .q-scale label {
  font-size: 1rem;
}
@media (max-width: 560px) {
  /* the five answers stay in one row */
  .q .ef-seg.q-scale {
    grid-auto-flow: column;
    grid-template-columns: none;
  }
  .likert .q-scale label span {
    font-size: 0.72rem;
    letter-spacing: -0.02em;
  }
}

.quiz-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--ef-ink);
  background: var(--ef-panel);
}
.quiz-bar p {
  margin: 0;
}
.quiz-bar b {
  font-variant-numeric: tabular-nums;
}
.quiz-bar .progress {
  flex: 1;
  min-width: 6rem;
  height: 4px;
  background: var(--ef-chip);
}
.quiz-bar .progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ef-ink);
  transition: width 0.2s var(--ef-ease);
}
.quiz-msg {
  margin: 0.5rem 0 0;
  color: var(--ef-danger);
  font-weight: 600;
}

.quiz-result:focus {
  outline: none;
}
.type-code {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 1rem 0 0.25rem;
}
.type-code b {
  color: var(--ef-ink);
  font-family: var(--ef-font-ui);
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-stretch: var(--ef-wide);
  letter-spacing: 0.08em;
  line-height: 1;
}
.result-table {
  max-width: 52rem;
}
.result-table :is(th, td) {
  white-space: nowrap;
}
.result-table td[data-score] {
  font-weight: 700;
}
.option-line {
  margin: 0.25rem 0 0;
}

/* one scale between its two letters, the reader's score as a dot */
.bipolar-list {
  display: grid;
  gap: 0.25rem;
  max-width: 40rem;
  margin: 0.75rem 0 1rem;
  padding: 0;
  list-style: none;
}
.bipolar-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr 5.5rem;
  grid-template-areas: 'l track r' '. val .';
  align-items: center;
  column-gap: 0.75rem;
}
.bipolar-list .end {
  font-weight: 600;
  white-space: nowrap;
}
.bipolar-list .end.l {
  grid-area: l;
}
.bipolar-list .end.r {
  grid-area: r;
  text-align: right;
}
.bipolar-list .end b {
  font-family: var(--ef-font-ui);
}
.bipolar-list .track {
  position: relative;
  grid-area: track;
  height: 4px;
  margin: 0 6px;
  background: var(--ef-rule);
}
.bipolar-list .cut {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 1px;
  height: 16px;
  background: var(--ef-ink-2);
}
.bipolar-list .dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ef-panel);
  border-radius: 50%;
  background: var(--viz-accent);
  transform: translate(-50%, -50%);
}
.bipolar-list .val {
  grid-area: val;
  text-align: center;
}

.share {
  max-width: 40rem;
  margin-top: 1.25rem;
}
.share .field {
  display: grid;
  gap: 0.35rem;
}
.share input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0 0.6rem;
  border: 1px solid var(--ef-rule);
  background: var(--ef-paper);
  color: var(--ef-ink);
  font: 0.8rem var(--ef-font-mono);
}
.share .ef-actions {
  margin-top: 0.75rem;
}

/* score distributions */
.hist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.hist-figure {
  min-width: 0;
  margin: 0;
  padding: 0.75rem 0.75rem 0;
  border: 1px solid var(--ef-rule);
  background: var(--ef-panel);
}
.hist-figure h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
.hist-figure h3 small {
  margin-left: 0.35rem;
  color: var(--ef-ink-2);
  font-weight: 500;
}
.hist-figure figcaption {
  padding: 0.5rem 0;
  border-top: 1px solid var(--ef-rule);
}
.hist-figure .table-view {
  margin: 0 0 0.5rem;
}
.hist-figure .table-view .ef-table-wrap {
  max-height: 20rem;
  overflow: auto;
}
.hist {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--ef-font-ui);
}
.hist text {
  fill: var(--ef-ink-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.hist .grid line {
  stroke: var(--ef-rule);
  stroke-width: 1;
}
.hist .grid line.base {
  stroke: var(--ef-ink-2);
}
.hist .bin path {
  fill: var(--viz-muted);
  pointer-events: none;
}
.hist .bin.you path {
  fill: var(--viz-accent);
}
.hist .hit {
  fill: transparent;
}
.hist .bin {
  outline: none;
}
.hist .bin.is-here .hit,
.hist .bin:focus-visible .hit {
  fill: color-mix(in srgb, var(--ef-ink) 7%, transparent);
}
.hist .you-label {
  fill: var(--ef-ink);
  font-size: 12px;
  font-weight: 700;
}
.ef-table tr.you :is(th, td) {
  background: color-mix(in srgb, var(--viz-accent) 14%, transparent);
  font-weight: 700;
}
.hist-tip {
  position: absolute;
  z-index: 5;
  min-width: 7rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--ef-ink);
  background: var(--ef-panel);
  font-family: var(--ef-font-ui);
  font-size: 0.8rem;
  line-height: 1.45;
  pointer-events: none;
}
.hist-tip p {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.hist-tip .score {
  color: var(--ef-ink-2);
}
.hist-tip p + p {
  font-weight: 700;
}

.key-view {
  max-width: none;
}
.key-note {
  margin: 0.5rem 0 0;
}
.key-table td:nth-child(2) {
  min-width: 16rem;
}
.key-table :is(td, th):is(:nth-child(3), :nth-child(4)) {
  white-space: nowrap;
}

.test-table :is(th, td):is(:nth-child(1), :nth-child(2), :nth-child(4), :nth-child(6), :nth-child(7)) {
  white-space: nowrap;
}
.test-table td:nth-child(3) {
  min-width: 14rem;
}

/* ---------- exams ---------- */

.std-table {
  max-width: 52rem;
}
.std-table :is(th, td) {
  white-space: nowrap;
}
.std-table td b {
  font-size: 1.05rem;
}
.std-table td small {
  margin-left: 0.3rem;
  color: var(--ef-ink-2);
  font-size: var(--ef-t-field);
}
.hist-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
}
.hist-figure .mark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hist-figure .mark select {
  min-height: 2.25rem;
  padding: 0 0.4rem;
  border: 1px solid var(--ef-rule);
  background: var(--ef-panel);
  color: var(--ef-ink);
  font: inherit;
}
.hist-figure output {
  font-variant-numeric: tabular-nums;
}
