*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

html,
body,
#root {
  height: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-ui);
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Suppresses transitions for the frame in which the scheme flips. */
.no-transitions *,
.no-transitions *::before,
.no-transitions *::after {
  transition: none !important;
  animation: none !important;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 500;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: currentColor;
}

button {
  font: inherit;
  color: inherit;
}

:where(a, button, [tabindex], input, select, summary):where(:focus-visible) {
  outline: 2px solid var(--lit);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--lit-wash);
  color: var(--ink);
}

/* .sr-only is the family markup's name for the same thing (docs/family.md). */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -48px;
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  background: var(--ink);
  color: var(--ground);
  border-radius: var(--radius-s);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-2);
}

/* A quiet control: text with a hairline, never a filled slab. */
.control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--rule-control);
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-ui);
  line-height: 1;
  cursor: pointer;
  transition:
    background-color var(--t-press) var(--ease-out),
    border-color var(--t-press) var(--ease-out),
    transform var(--t-press) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}

.control:hover {
  border-color: var(--ink-3);
  background: color-mix(in oklab, var(--ink) 4%, transparent);
}

.control:active {
  transform: scale(0.97);
}

.control[aria-pressed="true"],
.control[aria-current="page"],
.control[aria-selected="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ground);
}

.control--plain {
  border-color: transparent;
}

.control--plain:hover {
  border-color: transparent;
}

.kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 1px 5px;
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-s);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  line-height: 1.3;
  color: var(--ink-2);
  text-align: center;
}

.lean {
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-variant-ligatures: none;
}

/* Region identity: a dot in the region's ink, always beside a word. */
.region-dot {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  background: var(--region, var(--ink-3));
  flex: none;
}

[data-region="support"] {
  --region: var(--region-support);
  --field: var(--field-support);
}
[data-region="scalar"] {
  --region: var(--region-scalar);
  --field: var(--field-scalar);
}
[data-region="circuit"] {
  --region: var(--region-circuit);
  --field: var(--field-circuit);
}

/* Shared vocabulary. One visual channel per meaning; DESIGN.md has the rules. */

/* A record's kind, in words: CLAIM, ASSUMPTION, LEAN DECLARATION, MAIN RESULT. */
.caps {
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--ink-3);
}

/* Where a record comes from: a small square in its source colour, always beside the source's name. */
.src-sq {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  border-radius: 2px;
  background: var(--cat, var(--src-0));
  flex: none;
}
[data-slot="1"] {
  --cat: var(--src-1);
}
[data-slot="2"] {
  --cat: var(--src-2);
}
[data-slot="3"] {
  --cat: var(--src-3);
}

/* How an account treats a record: a shape and a word, never colour alone.
   own: a passage of its own · relied: used without a passage · outside: not in its selection. */
.cov-mark {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  flex: none;
  border-radius: 50%;
  background: var(--ink-2);
}
.cov-mark--relied {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink-2);
}
.cov-mark--outside {
  border-radius: 1px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--ink-3);
  background-image: linear-gradient(var(--ink-3), var(--ink-3));
  background-size: 60% 1.5px;
  background-position: center;
  background-repeat: no-repeat;
}

/* A relation's line pattern, for keys and lists. Same patterns as the map. */
.rel-sample {
  display: inline-block;
  width: 26px;
  height: 0;
  flex: none;
  vertical-align: middle;
  border-top: 2px solid var(--rel-supports);
}
.rel-sample--assumes {
  border-top-style: dotted;
  border-top-width: 2.5px;
  border-top-color: var(--rel-assumes);
}
.rel-sample--formalizes {
  border-top-style: dashed;
  border-top-color: var(--rel-formalizes);
}
.rel-sample--lit {
  border-top-color: var(--rel-supports-lit);
}
.rel-sample--lit.rel-sample--assumes {
  border-top-color: var(--rel-assumes-lit);
}
.rel-sample--lit.rel-sample--formalizes {
  border-top-color: var(--rel-formalizes-lit);
}

/* A recorded outcome, in its own words. Only a recorded failure is coloured. */
.outcome {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.outcome--failed {
  color: var(--fail);
  font-weight: 600;
}
.outcome--passed {
  color: var(--ink);
  font-weight: 600;
}
.outcome--unavailable,
.outcome--not_run {
  color: var(--ink-2);
}

.muted {
  color: var(--ink-2);
}

.faint {
  color: var(--ink-3);
}

.num {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
