/* ─────────────────────────────────────────────────────────────────────────────
   Reusable components. View-specific layout lives in views.css.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-3);
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--plane);
}
.btn--primary:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}
:root[data-theme='dark'] .btn--primary:hover {
  background: #fff;
  border-color: #fff;
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
}
.btn--danger {
  background: var(--crit);
  border-color: var(--crit);
  color: #fff;
}
.btn--danger:hover {
  background: var(--crit-ink);
  border-color: var(--crit-ink);
}
.btn--sm {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 13.5px;
}
.btn--lg {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 16px;
}
.btn--block {
  width: 100%;
}
.btn--icon {
  width: 40px;
  padding: 0;
}
.btn--icon.btn--sm {
  width: 32px;
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}
.card--flush {
  padding: 0;
  overflow: hidden;
}
.card--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.card--link:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.card--soon {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
}
.card--sunken {
  background: var(--surface-2);
  border-color: transparent;
}
.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 14px;
}
.card__title {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
}
.card__foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ── badges, dots, chips ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font: 600 11.5px/1.5 var(--font);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge--live {
  background: var(--good-wash);
  border-color: transparent;
  color: var(--good-ink);
}
.badge--live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
}
.badge--soon {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
}
.badge--demo {
  background: var(--demo-bg);
  border-color: transparent;
  color: var(--demo-ink);
}
.badge--official {
  background: var(--accent-wash);
  border-color: transparent;
  color: var(--accent-strong);
}
.badge--ai {
  background: var(--surface-3);
  border-color: transparent;
  color: var(--ink);
}
.dot {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-3);
}
.dot[data-group='stem'] {
  background: var(--series-1);
}
.dot[data-group='humanities'] {
  background: var(--series-2);
}
.dot[data-group='languages'] {
  background: var(--series-3);
}
.dot[data-group='applied'] {
  background: var(--series-4);
}
.dot[data-group='creative'] {
  background: var(--series-5);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
}
.chip:hover {
  border-color: var(--ink-3);
  background: var(--surface-2);
}
.chip.is-on,
.chip[aria-pressed='true'],
.chip[aria-checked='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--plane);
}
.chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chip__count {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ── tabs & segmented control ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  flex: none;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover {
  color: var(--ink);
}
.tab.is-active,
.tab[aria-selected='true'] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg__opt {
  min-height: 32px;
  padding: 5px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
}
.seg__opt:hover {
  color: var(--ink);
}
.seg__opt.is-on,
.seg__opt[aria-checked='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.seg__opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── forms ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field__label {
  font-weight: 600;
  font-size: 14px;
}
.field__hint {
  font-size: 13px;
  color: var(--ink-2);
}
.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-3);
}
.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
.input--sm {
  min-height: 32px;
  padding: 4px 10px;
}
.input--num {
  width: 84px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.searchbox {
  position: relative;
  flex: 1 1 200px;
}
.searchbox .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.searchbox .input {
  padding-left: 34px;
}
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}
.check input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  accent-color: var(--ink);
}
.form-error {
  color: var(--crit-ink);
  font-weight: 550;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  padding: 0;
}

/* ── banners, empty & loading states ── */
.banner {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.banner > .icon {
  margin-top: 2px;
}
.banner__body {
  flex: 1;
  min-width: 0;
}
.banner--info {
  background: var(--accent-wash);
  border-color: transparent;
}
.banner--info > .icon {
  color: var(--accent-strong);
}
.banner--warn {
  background: var(--warn-wash);
  border-color: transparent;
}
.banner--warn > .icon {
  color: var(--warn-ink);
}
.banner--error {
  background: var(--crit-wash);
  border-color: transparent;
}
.banner--error > .icon {
  color: var(--crit-ink);
}
.banner--demo {
  background: var(--demo-bg);
  border-color: transparent;
  color: var(--demo-ink);
}
.banner--demo a,
.banner--demo .linkbtn {
  color: inherit;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 44px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty__icon {
  color: var(--ink-3);
}
.empty__title {
  font-size: 16.5px;
  font-weight: 650;
}
.empty__text {
  color: var(--ink-2);
  max-width: 52ch;
  margin-bottom: 6px;
}
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 80px 20px;
  color: var(--ink-2);
}
.loading__spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── status: RAG, difficulty, meters ── */
.rag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.rag[data-rag='green'] .icon {
  color: var(--good);
}
.rag[data-rag='amber'] .icon {
  color: var(--warn);
}
.rag[data-rag='red'] .icon {
  color: var(--crit);
}
.rag[data-rag='none'] .icon {
  color: var(--line-strong);
}
.diff {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.diff__pips {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.diff__pips i {
  width: 3px;
  border-radius: 1px;
  background: var(--line-strong);
}
.diff__pips i:nth-child(1) {
  height: 5px;
}
.diff__pips i:nth-child(2) {
  height: 7px;
}
.diff__pips i:nth-child(3) {
  height: 9.5px;
}
.diff__pips i:nth-child(4) {
  height: 12px;
}
.diff[data-level='1'] i:nth-child(-n + 1),
.diff[data-level='2'] i:nth-child(-n + 2),
.diff[data-level='3'] i:nth-child(-n + 3),
.diff[data-level='4'] i:nth-child(-n + 4) {
  background: var(--ink);
}
.meter {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter__fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--ink-3);
  min-width: 2px;
}
.meter:has(.meter__fill[data-rag='green']) {
  background: var(--good-wash);
}
.meter:has(.meter__fill[data-rag='amber']) {
  background: var(--warn-wash);
}
.meter:has(.meter__fill[data-rag='red']) {
  background: var(--crit-wash);
}
.meter__fill[data-rag='green'] {
  background: var(--good);
}
.meter__fill[data-rag='amber'] {
  background: var(--warn);
}
.meter__fill[data-rag='red'] {
  background: var(--crit);
}
.meter__fill[data-rag='accent'] {
  background: var(--accent);
}
.meterlist {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(80px, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
}
.meterlist__name {
  font-weight: 550;
  min-width: 0;
}
.meterlist__value {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
@media (max-width: 620px) {
  /* narrow screens: name and figure on one line, the bar underneath */
  .meterlist {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-auto-flow: row dense;
    gap: 6px 12px;
  }
  .meterlist__name {
    grid-column: 1;
  }
  .meterlist__value {
    grid-column: 2;
  }
  .meterlist > .meter {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }
}

/* ── stat tiles ── */
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat__label {
  font-size: 13px;
  color: var(--ink-2);
}
.stat__value {
  font-size: 30px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.stat__note {
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ── tables ── */
.table-wrap {
  position: relative; /* keeps visually-hidden header text inside the scroll area */
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table td.num,
.table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table--compact th,
.table--compact td {
  padding: 6px 10px;
}

/* ── dialogs & toasts ── */
.modal {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.modal--wide {
  width: min(820px, calc(100vw - 24px));
}
.modal::backdrop {
  background: rgba(11, 11, 11, 0.45);
}
.modal__box {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 26px);
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px 20px;
}
.modal__title {
  font-size: 18px;
  font-weight: 650;
}
.modal__body {
  padding: 4px 20px 16px;
  overflow-y: auto;
}
.modal__error {
  margin: 0 20px 12px;
  color: var(--crit-ink);
  font-weight: 550;
}
.modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}
.modal--coverage .modal__foot > .btn {
  max-width: 100%;
  white-space: normal;
}
.toasts {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--plane);
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
}
.toast .icon {
  margin-top: 2px;
}
.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ── specification tree ── */
.tree__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.tree__count {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tree__section + .tree__section {
  margin-top: 18px;
}
.tree__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 0 2px 6px;
  border-bottom: 1px solid var(--line);
}
.tree__topic {
  border-bottom: 1px solid var(--line);
}
.tree__topic > summary {
  display: grid;
  grid-template-columns: 16px 20px auto minmax(0, 1fr);
  align-items: start;
  gap: 3px 8px;
  padding: 10px 2px;
  cursor: pointer;
  list-style: none;
}
.tree__topic > summary::-webkit-details-marker {
  display: none;
}
.tree__topic > summary:hover {
  background: var(--surface-2);
}
.tree__caret {
  flex: none;
  color: var(--ink-3);
  transition: transform 0.15s;
  margin-top: 3px;
}
.tree__topic[open] > summary .tree__caret {
  transform: rotate(90deg);
}
.tree__check {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--ink);
}
.tree__topic > summary .tree__check { margin-top: 3px; }
.tree__code {
  flex: none;
  min-width: 2.2em;
  font: 500 12.5px/1.6 var(--font-mono);
  color: var(--ink-3);
}
.tree__title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.tree__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 4px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tree__topic > summary .tree__meta { grid-column: 4; }
.filter-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.filter-reset { min-height: 44px; background: var(--surface); color: var(--ink); border: 2px solid var(--ink); }
.filter-reset:hover { background: var(--surface-2); }
.filter-reset:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.tree__points {
  padding: 0 0 8px 29px;
}
.tree__point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 2px;
  border-radius: 6px;
}
.tree__point label {
  display: grid;
  grid-template-columns: 20px auto minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.tree__point .tree__check {
  margin-top: 3px;
}
.tree__point .tree__title {
  font-weight: 450;
}
.tree__point.is-disabled label {
  color: var(--ink-3);
  cursor: not-allowed;
}
.tree__point:hover {
  background: var(--surface-2);
}
.tree mark {
  background: var(--highlight);
  color: inherit;
  border-radius: 2px;
}

/* ── question content (rendered question_html / mark_scheme_html) ── */
.qcontent {
  font: 17px/1.62 var(--font);
  overflow-wrap: anywhere;
}
.qcontent > * + * {
  margin-top: 12px;
}
.qcontent img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}
.qcontent ul {
  padding-left: 22px;
  list-style: disc;
}
.qcontent ol {
  padding-left: 22px;
  list-style: decimal;
}
.qcontent li + li {
  margin-top: 4px;
}
.qcontent blockquote {
  padding: 12px 16px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}
.qcontent sup,
.qcontent sub {
  font-size: 0.72em;
  line-height: 0;
}
.q-part,
.q-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.q-part--sub {
  margin-left: 28px;
}
.q-part__label {
  flex: none;
  min-width: 1.9em;
  font-weight: 600;
}
.q-part__body,
.q-line__text {
  flex: 1;
  min-width: 0;
}
.q-marks {
  flex: none;
  font-weight: 700;
  white-space: nowrap;
}
.ms-codes {
  flex: none;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-2);
  font: 600 12.5px/1.8 var(--font-mono);
  color: var(--ink-2);
  white-space: nowrap;
}
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 2px;
  font-size: 0.86em;
  line-height: 1.25;
  text-align: center;
}
.frac__n {
  padding: 0 4px 1px;
  border-bottom: 1.5px solid currentColor;
}
.frac__d {
  padding: 1px 4px 0;
}
.q-table {
  border-collapse: collapse;
  font: 14.5px/1.4 var(--font);
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
.q-table th,
.q-table td {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  text-align: left;
}
.q-table th {
  background: var(--surface-2);
  font-weight: 650;
}
.q-code {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  font: 13.5px/1.55 var(--font-mono);
  overflow-x: auto;
}
.qcontent code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}
.ms {
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  background: var(--surface);
}
.ms .qcontent {
  font: 15px/1.55 var(--font);
}
.ms .qcontent > * + * {
  margin-top: 8px;
}
.ms .q-marks {
  font-weight: 600;
  color: var(--ink-2);
}

/* ── question cards (lists) ── */
.qlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qcard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.qcard.is-selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.qcard.is-locked {
  background: transparent;
  border-style: dashed;
}
.qcard__select {
  padding-top: 3px;
}
.qcard__ref {
  font-size: 12.5px;
  color: var(--ink-2);
}
.qcard__text {
  font: 15.5px/1.5 var(--font);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qcard__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 8px;
}
.qcard__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}
.marks-pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 6px;
  background: linear-gradient(transparent 12%, var(--highlight) 12%, var(--highlight) 88%, transparent 88%);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}
:root[data-theme='dark'] .marks-pill {
  color: #fff;
}
@media (max-width: 620px) {
  .qcard {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .qcard__side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ── charts ── */
.chart {
  position: relative;
}
.chart__svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.chart__svg text {
  font: 11.5px var(--font);
  fill: var(--ink-3);
}
.chart__svg .tick-num {
  font-variant-numeric: tabular-nums;
}
.chart__svg .direct-label {
  fill: var(--ink);
  font-weight: 600;
}
.chart__hit {
  fill: transparent;
  cursor: default;
}
.chart__bar {
  transition: opacity 0.1s;
}
.chart__hit:hover + .chart__bar,
.chart__hit:focus + .chart__bar {
  opacity: 0.78;
}
.chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--plane);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip strong {
  font-size: 14px;
}
.chart-tip__key {
  display: inline-block;
  width: 12px;
  height: 2px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 1px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend__key {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}
.chart-table {
  margin-top: 10px;
}
.chart-table > summary {
  display: inline-block;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.chart-table .table {
  margin-top: 8px;
}
