/*
 * Riddle Forest design system.
 *
 * Loaded after shorthandcss, main.css and github-dark, so it wins ties. shorthandcss stays loaded
 * because post HTML stored in the database uses its classes; most of them are !important, which
 * is why a few rules below need !important too. New templates use the rf- classes only.
 *
 * This is a new file rather than an edit to main.css on purpose: collectstatic runs before the
 * Cloud Run deploy, so for a while the old templates are served against the new static files.
 * A file they do not link cannot change them.
 */

/* ---- Tokens ------------------------------------------------------------------------------ */

:root {
  /* Colour: a neutral graphite, with the logo's blue as the one accent. */
  --canvas: #121417;      /* page background; lighter than the logo's black so the hexagon shows */
  --surface: #1A1D21;     /* raised surfaces: inputs, panels, inline code */
  --sunken: #0D0F11;      /* code blocks, darker than the canvas */
  --rule: #2A2E34;        /* hairlines */
  --ink: #E6E8EB;         /* body text, 15.0:1 on --canvas */
  --muted: #9BA1A9;       /* secondary text, 7.1:1 on --canvas */
  --logo-blue: #007ECC;   /* the R in the logo: brand, focus ring, chart series 1 */
  --button: #006BAD;      /* button fill, white text 5.7:1 */
  --button-hover: #005A91;
  --link: #5DB2EA;        /* links, 7.9:1 on --canvas */
  --amber: #E8A93A;       /* chart series 2, pressed state */
  --chart-1: var(--logo-blue);
  --chart-2: var(--amber);

  --display: "Space Grotesk", system-ui, "Segoe UI", sans-serif;          /* headings */
  --text: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;             /* body and interface */
  --mono: "IBM Plex Mono", ui-monospace, Consolas, "Liberation Mono", monospace; /* code, figures */

  /* Type scale on a 17px body: 14 / 16 / 17 / 24 / 30 / 38 / 48 / 60. */
  --fs-xs: 0.875rem;
  --fs-s: 1rem;
  --fs-body: 1.0625rem;
  --fs-m: 1.5rem;
  --fs-l: 1.875rem;
  --fs-xl: clamp(1.875rem, 1.35rem + 1.6vw, 2.375rem);
  --fs-2xl: clamp(2rem, 1.3rem + 2.4vw, 3rem);
  --fs-3xl: clamp(1.75rem, 0.9rem + 3.4vw, 3.75rem);

  --radius: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;     /* native date pickers, selects and scrollbars follow the page */
}

/* main.css hides the caret everywhere, which leaves text fields with no cursor. */
html {
  caret-color: auto;
}

/* ---- Base -------------------------------------------------------------------------------- */

.rf-body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

.rf-body a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness 150ms var(--ease), color 150ms var(--ease);
}

.rf-body a:hover {
  text-decoration-thickness: 2px;
}

/* One focus ring everywhere. shorthandcss sets outline:none on .button/.input/.select:focus and
   main.css on .toolinput:focus-visible, both more specific than a bare :focus-visible. */
:focus-visible,
.button:focus-visible,
.input:focus-visible,
.select:focus-visible,
.toolinput:focus-visible {
  outline: 2px solid var(--logo-blue) !important;
  outline-offset: 2px;
}

.rf-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- Layout ------------------------------------------------------------------------------ */

.rf-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.rf-col {
  max-width: 42rem;
}

.rf-rule {
  border-top: 1px solid var(--rule);
}

/* ---- Components -------------------------------------------------------------------------- */

.rf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--button);
  color: #fff;
  font: 600 var(--fs-s) / 1.2 var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}

.rf-btn:hover {
  background: var(--button-hover);
}

.rf-btn:active {
  transform: scale(0.98);
}

.rf-field {
  box-sizing: border-box;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 400 var(--fs-s) / 1.4 var(--text);
  transition: border-color 150ms var(--ease);
}

.rf-field::placeholder {
  color: var(--muted);
  opacity: 1;
}

.rf-field:focus {
  border-color: var(--logo-blue);
}

.rf-meta {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.rf-body a.rf-tag {
  color: var(--muted);
  text-decoration: none;
}

.rf-body a.rf-tag:hover {
  color: var(--ink);
  text-decoration: underline;
}

.rf-body :is(h1, h2, h3, h4) {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* ---- Header ------------------------------------------------------------------------------ */

.rf-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  min-height: 72px;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.rf-body a.rf-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* The logo is a black hexagon; on the dark canvas it needs an edge to read as a shape. */
.rf-brand img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 1px var(--muted)) drop-shadow(0 0 0.5px var(--muted));
}

.rf-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}

.rf-nav nav {
  display: flex;
  gap: 1.5rem;
}

.rf-body .rf-nav nav a {
  color: var(--ink);
  font-size: 1.0625rem;
  text-decoration: none;
}

.rf-body .rf-nav nav a:hover,
.rf-body .rf-nav nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--logo-blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.rf-search {
  position: relative;
  margin: 0;
}

.rf-search .rf-field {
  width: 15rem;
  padding-right: 2.75rem;
}

.rf-search-go,
.rf-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.rf-search-go {
  position: absolute;
  top: 0;
  right: 0;
}

.rf-search-go:hover,
.rf-menu:hover {
  color: var(--ink);
}

.rf-search-go svg,
.rf-menu svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}

.rf-menu {
  display: none;
  margin-left: auto;
  color: var(--ink);
}

@media (max-width: 47.99em) {
  .rf-menu {
    display: inline-flex;
  }

  .rf-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-left: 0;
    padding-block: 0.5rem 1rem;
  }

  .rf-nav.is-open {
    display: flex;
    animation: rf-drop 200ms var(--ease);
  }

  .rf-nav nav {
    flex-direction: column;
    gap: 0;
  }

  .rf-body .rf-nav nav a {
    padding-block: 0.625rem;
    font-size: var(--fs-body);
  }

  .rf-search .rf-field {
    width: 100%;
  }
}

@keyframes rf-drop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---- Footer ------------------------------------------------------------------------------ */

.rf-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 6rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--fs-s);
}

.rf-footer p {
  margin: 0;
}

.rf-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.rf-body .rf-footer a {
  color: var(--muted);
  text-decoration: none;
}

.rf-body .rf-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---- Pages and lists --------------------------------------------------------------------- */

.rf-page {
  padding-top: clamp(2rem, 5vw, 4rem);
}

.rf-page-title {
  margin: 0 0 0.75rem;
  font-size: var(--fs-2xl);
}

.rf-page-lede {
  max-width: 42rem;
  margin: 0 0 2rem;
  color: var(--muted);
}

/* The home page opens with one sentence, then the questions. */
.rf-intro {
  max-width: 34rem;
  margin: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem);
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

.rf-body .rf-intro a {
  color: var(--ink);
}

/* The riddle index: post titles are questions, so they are the page. */
.rf-index {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.rf-item {
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--rule);
}

.rf-item h2 {
  max-width: 50rem;
  margin: 0;
  font-size: var(--fs-3xl);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.rf-body .rf-item h2 a {
  color: var(--ink);
  text-decoration: none;
}

.rf-body .rf-item h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--logo-blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}

.rf-item-lede {
  max-width: 42rem;
  margin: 0.625rem 0 0;
  color: var(--muted);
}

.rf-item .rf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0.75rem 0 0;
}

/* On a wide screen each row reads as a ledger: the question, and beside it the answer's lede. */
@media (min-width: 64em) {
  .rf-index--reveal .rf-item {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: auto 1fr;
    column-gap: 3.5rem;
  }

  .rf-index--reveal .rf-item h2 {
    grid-row: 1 / span 2;
  }

  .rf-index--reveal .rf-item-lede {
    margin-top: 0.5rem;
  }
}

.rf-index--compact .rf-item h2 {
  font-size: var(--fs-l);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* The one load animation on the site: the questions arrive in order. */
.rf-index--reveal .rf-item {
  animation: rf-rise 500ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes rf-rise {
  from { opacity: 0; transform: translateY(8px); }
}

/* ---- Article ----------------------------------------------------------------------------- */

.rf-article-head {
  max-width: 46rem;
  padding-top: clamp(2rem, 5vw, 4rem);
}

.rf-article-head h1 {
  margin: 0;
  font-size: var(--fs-2xl);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.rf-lede {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1.125rem, 1rem + 0.8vw, 1.3125rem);
  line-height: 1.45;
}

.rf-article-head .rf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 1rem 0 0;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

/* .rf-prose styles the HTML stored in the database: loose text runs split by <br><br>, <h3>
   headings followed by a <br>, shorthandcss classes on links, images and code blocks. */
.rf-prose {
  max-width: 42rem;
  margin-top: 2rem;
  font-size: var(--fs-body);
  line-height: 1.65;
  overflow-wrap: break-word;
}

.rf-prose p {
  margin: 0 0 1.1em;
}

.rf-prose h2,
.rf-prose h3,
.rf-prose h4 {
  margin: 2.25em 0 0.5em;
  font-size: var(--fs-m);
  line-height: 1.25;
}

/* A <br> right before or after a block adds a blank line on top of the block's own margin. */
.rf-prose :is(h2, h3, h4, img, .relative) + br,
.rf-prose br:has(+ :is(h2, h3, h4, p, img, .relative)) {
  display: none;
}

.rf-body .rf-prose a,
.rf-body .rf-prose a.white {
  color: var(--link) !important;
}

.rf-prose b,
.rf-prose strong {
  font-weight: 600;
}

.rf-prose img,
.rf-prose img.py-5 {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  padding: 0 !important;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.rf-prose iframe {
  max-width: 100%;
  border: 0;
  border-radius: var(--radius);
}

.rf-prose .relative {
  margin: 1.5rem 0;
}

.rf-prose pre {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sunken);
  overflow-x: auto;
}

.rf-prose pre code.hljs,
.rf-prose pre code {
  display: block;
  padding: 1.25rem 3.5rem 1.25rem 1.25rem;
  background: var(--sunken);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  line-height: 1.6;
}

.rf-prose :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.85em;
}

/* Code blocks may run wider than the text column on a wide screen. */
@media (min-width: 64em) {
  .rf-prose .relative {
    margin-inline: -2rem;
  }
}

.rf-prose .mono {
  margin-top: 2rem;
  color: var(--muted);
  font-family: var(--text) !important;
}

/* The copy button inside each stored code block. */
.rf-prose [id^="code_copy"] {
  top: 0.5rem;
  right: 0.5rem;
  bottom: auto;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface) !important;
  color: var(--muted);
  opacity: 1;
  transition: color 150ms var(--ease);
}

.rf-prose [id^="code_copy"]:hover {
  color: var(--ink);
  opacity: 1;
}

.rf-prose [id^="code_copy"] svg {
  width: 16px;
  height: 16px;
}

.rf-prose [id^="code_copy"]::after {
  content: "Copied";
  position: absolute;
  right: calc(100% + 0.5rem);
  color: var(--ink);
  font: 400 var(--fs-xs) / 1 var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms var(--ease);
}

.rf-prose [id^="code_copy"][data-copied]::after {
  opacity: 1;
}

/* ---- Feedback and comments --------------------------------------------------------------- */

.rf-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  max-width: 42rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.rf-feedback p {
  margin: 0 0.5rem 0 0;
  color: var(--muted);
}

.rf-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 400 var(--fs-s) / 1 var(--text);
  cursor: pointer;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}

.rf-chip:hover {
  border-color: var(--muted);
}

.rf-chip:active {
  transform: scale(0.98);
}

.rf-chip svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.rf-chip span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

.rf-chip.is-on {
  border-color: var(--amber);
}

.rf-chip.is-on svg {
  color: var(--amber);
}

.rf-chip span.is-changed {
  animation: rf-tick 300ms var(--ease);
}

@keyframes rf-tick {
  from { opacity: 0.2; }
}

.rf-comments {
  scroll-margin-top: 1.5rem;
}

.rf-comments > * {
  max-width: 42rem;
}

.rf-comments h2 {
  margin: 4rem 0 1rem;
  font-size: var(--fs-m);
}

.rf-comment-list {
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
}

.rf-comment-list li {
  padding-block: 1rem;
  border-top: 1px solid var(--rule);
}

.rf-comment-list p {
  margin: 0;
  overflow-wrap: anywhere;
}

.rf-comment-list .rf-meta {
  margin-bottom: 0.25rem;
}

.rf-comment-list .rf-meta b {
  color: var(--ink);
  font-weight: 600;
}

.rf-comment-form {
  display: grid;
  gap: 0.5rem;
}

.rf-comment-form h3 {
  margin: 0 0 0.5rem;
  font-size: var(--fs-body);
}

.rf-comment-form label {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: var(--fs-s);
}

.rf-comment-form textarea.rf-field {
  width: 100%;
  min-height: 8rem;
  resize: vertical;
}

.rf-comment-form input.rf-field {
  width: 100%;
  max-width: 24rem;
}

.rf-comment-form .errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--amber);
  font-size: var(--fs-s);
}

.rf-comment-form .rf-btn {
  margin-top: 0.75rem;
}

/* ---- Home: tools ------------------------------------------------------------------------- */

.rf-tools {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1rem 3rem;
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1.5rem;
}

.rf-tools > h2 {
  margin: 0;
  font-size: var(--fs-m);
}

.rf-tools ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rf-tools h3 {
  margin: 0 0 0.25rem;
  font-size: var(--fs-m);
}

.rf-tools p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 47.99em) {
  .rf-tools,
  .rf-tools ul {
    grid-template-columns: 1fr;
  }
}

/* ---- Tools ------------------------------------------------------------------------------- */

.rf-results {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3.5rem;
  margin: 2rem 0 0;
}

.rf-results dt {
  color: var(--muted);
  font-size: var(--fs-s);
}

.rf-results dt small {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.rf-control label small {
  margin-left: 0.25rem;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.rf-results dd {
  margin: 0.25rem 0 0;
  color: var(--ink);
  font: 600 2rem / 1.1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.rf-panel {
  display: grid;
  gap: 1.75rem 2.5rem;
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

@media (min-width: 64em) {
  .rf-panel--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rf-panel--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rf-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem 1rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rf-control legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0;
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 600;
}

.rf-control label {
  color: var(--ink);
  font-size: var(--fs-s);
}

/* Label and value on one row, the slider under them. */
.rf-control .slider {
  grid-column: 1 / -1;
}

.rf-tool .toolinput,
.rf-tool .rf-value {
  width: 7.5rem;
  padding: 0.25rem 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font: 600 var(--fs-body) / 1.4 var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  transition: border-color 150ms var(--ease);
}

.rf-tool .rf-value {
  border-bottom-color: transparent;
}

.rf-tool .toolinput:focus {
  border-bottom-color: var(--logo-blue);
}

.rf-tool select.rf-field {
  min-width: 7.5rem;
}

/* Range inputs: a hairline track and the logo blue as the handle. */
.rf-tool .slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 0.75rem 0 0.25rem;
  border-radius: 2px;
  background: var(--rule);
  opacity: 1;
  cursor: pointer;
}

.rf-tool .slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--logo-blue);
  box-shadow: 0 0 0 3px var(--surface);
  transition: transform 150ms var(--ease);
}

.rf-tool .slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--logo-blue);
  box-shadow: 0 0 0 3px var(--surface);
}

.rf-tool .slider:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

.rf-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem 1.5rem;
  grid-column: 1 / -1;
}

.rf-dates label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: var(--fs-s);
}

.rf-dates .rf-btn {
  margin-left: auto;
}

.rf-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2.5rem 0 0.5rem;
  color: var(--muted);
  font-size: var(--fs-s);
}

.rf-legend .rf-swatch + .rf-swatch,
.rf-legend .rf-swatch--2 {
  margin-left: 1rem;
}

.rf-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--chart-1);
}

.rf-swatch--2 {
  background: var(--chart-2);
}

.rf-legend .rf-swatch--1 {
  margin-left: 0;
}

.rf-chart {
  margin-top: 2rem;
  color: var(--muted);
}

.rf-legend + .rf-chart {
  margin-top: 0;
}

.rf-chart text {
  font-family: var(--mono);
  font-size: 11px;
}

.rf-chart-tip {
  position: fixed;
  z-index: 10;
  width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 400 var(--fs-xs) / 1.5 var(--text);
  pointer-events: none;
  transition: opacity 150ms var(--ease);
}

.rf-table {
  margin-top: 2rem;
  overflow-x: auto;
}

.rf-table table {
  border-collapse: collapse;
  font: 400 var(--fs-xs) / 1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}

.rf-table th {
  padding: 0.5rem 0.75rem !important;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font: 600 var(--fs-xs) / 1.3 var(--text);
  white-space: nowrap;
}

.rf-table td {
  padding: 0.375rem 0.75rem !important;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

/* Row labels are words, not data. */
.rf-table td.text-left {
  color: var(--muted);
  font: 400 var(--fs-s) / 1.4 var(--text);
}

@media (max-width: 47.99em) {
  .rf-table th,
  .rf-table td {
    padding-inline: 0.4rem !important;
  }
}

.rf-tool > .rf-btn {
  margin-top: 1.5rem;
}

/* ---- Cookie banner ----------------------------------------------------------------------- */

/* cookieconsent.css reads its colours from --cc-* variables; these put it in the site's palette. */
#cc--main {
  --cc-bg: var(--surface);
  --cc-text: var(--ink);
  --cc-btn-primary-bg: var(--button);
  --cc-btn-primary-text: #fff;
  --cc-btn-primary-hover-bg: var(--button-hover);
  --cc-btn-secondary-bg: var(--rule);
  --cc-btn-secondary-text: var(--ink);
  --cc-btn-secondary-hover-bg: #32373E;
  --cc-section-border: var(--rule);
  --cc-overlay-bg: rgba(18, 20, 23, 0.6);
}

.cc_div {
  font-family: var(--text);
}

#cm {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: none;
}

#cc--main .c-bn {
  border-radius: var(--radius);
  font-size: var(--fs-s);
  font-weight: 600;
}

/* ---- Motion ------------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
