/* ==========================================================================
   JSON Bench
   The single stylesheet. Every value that repeats is a custom property, and
   every colour pair in here is checked against WCAG 2.1 AA (4.5:1 for body
   text) by an automated test - see test/run-tests.mjs.

   The registered palette, type scale and spacing ladder are documented in
   docs/frontend.md. Do not invent new values here without adding them there.
   ========================================================================== */

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

:root {
  color-scheme: dark;

  /* Surfaces, darkest to lightest */
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2431;
  --surface-3: #253041;
  --border: #303a4a;
  --border-strong: #43506380;

  /* Text, three levels */
  --text: #e8eef5;
  --text-2: #b3c0cd;
  --text-3: #94a3b3;

  /* Accent and state */
  --accent: #6cc6ff;
  --accent-strong: #2f81f7;
  --accent-contrast: #06121f;
  --ok: #55d36a;
  --warn: #e9c46a;
  --err: #ff8b82;
  --added: #55d36a;
  --removed: #ff8b82;
  --changed: #e9c46a;

  /* Type badges */
  --t-string: #a5d6a7;
  --t-number: #9fc7ff;
  --t-boolean: #e0b0ff;
  --t-null: #b3c0cd;
  --t-object: #ffd08a;
  --t-array: #86dcd0;

  /* Spacing ladder, 4px base */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  /* Radii */
  --r1: 4px;
  --r2: 8px;
  --r3: 12px;

  /* Elevation - three levels, no more */
  --e1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --e2: 0 4px 14px rgba(0, 0, 0, 0.35);
  --e3: 0 16px 48px rgba(0, 0, 0, 0.55);

  /* Type */
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", "JetBrains Mono", "Fira Code",
    "Cascadia Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 28px;

  --header-h: 52px;
  --row-h: 26px;
  --speed: 160ms;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #f5f7fa;
  --surface-2: #eceff4;
  --surface-3: #e2e7ee;
  --border: #ccd4de;
  --border-strong: #9aa7b6;

  --text: #10161e;
  --text-2: #414d5a;
  --text-3: #55616e;

  --accent: #0a58ac;
  --accent-strong: #0a58ac;
  --accent-contrast: #ffffff;
  --ok: #1a7f37;
  --warn: #7a5a00;
  --err: #b3261e;
  --added: #1a7f37;
  --removed: #b3261e;
  --changed: #7a5a00;

  --t-string: #1a6f3c;
  --t-number: #0d4f9c;
  --t-boolean: #6a2f9e;
  --t-null: #55616e;
  --t-object: #8a5000;
  --t-array: #0f6b6b;

  --e1: 0 1px 2px rgba(16, 22, 30, 0.08);
  --e2: 0 4px 14px rgba(16, 22, 30, 0.10);
  --e3: 0 16px 48px rgba(16, 22, 30, 0.18);
}

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

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* Monospace everywhere, as specified. */
  font-family: var(--mono);
  font-size: var(--fs-md);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0;
  font-weight: 600;
}

h1 {
  font-size: var(--fs-2xl);
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--fs-xl);
}

h3 {
  font-size: var(--fs-lg);
}

p {
  margin: 0 0 var(--s3);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

code,
kbd,
pre,
samp {
  font-family: var(--mono);
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--r1);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

/* One visible focus treatment for the whole app. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r1);
}

.skip-link {
  position: absolute;
  left: var(--s3);
  top: -60px;
  z-index: 60;
  padding: var(--s2) var(--s4);
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--r2);
  text-decoration: none;
  transition: top var(--speed) ease;
}

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

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

.shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s5);
}

@media (max-width: 768px) {
  .shell {
    padding: 0 var(--s4);
  }
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--text);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 22px;
  height: 22px;
}

.brand-mark {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
}

/* --------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  width: auto;
  flex: none;
  min-width: 44px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--speed) ease, border-color var(--speed) ease;
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  color: var(--err);
  border-color: color-mix(in srgb, var(--err) 45%, transparent);
}

.field {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.field > select,
.field > input[type="text"],
.field > input[type="number"] {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r1);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
}

/* Short inputs stay short - an indent picker is not a 1200px control. */
.field > select {
  width: auto;
  min-width: 92px;
  max-width: 200px;
}

.field-name > input[type="text"] {
  width: 100%;
  max-width: 220px;
}

.field-query {
  display: flex;
  width: 100%;
}

.field-query > input[type="text"] {
  width: 100%;
  max-width: 720px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
}

.switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: var(--s5) 0 var(--s4);
}

.hero h1 {
  margin-bottom: var(--s2);
}

.lede {
  max-width: 68ch;
  color: var(--text-2);
  font-size: var(--fs-md);
}

.lede strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-height: 760px) {
  .hero {
    padding: var(--s4) 0 var(--s3);
  }

  :root {
    --fs-2xl: 24px;
  }
}

/* --------------------------------------------------------------------------
   Workbench
   -------------------------------------------------------------------------- */

.workbench {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s3);
  /* Follows the viewport rather than being locked to a fixed box, so the whole
     tool stays visible at 1366x768 without the page scrolling. Two declarations,
     not @supports: dvh tracks the mobile address bar as it collapses, and a
     browser that does not know the unit simply keeps the vh line above it. */
  height: clamp(430px, calc(100vh - 250px), 760px);
  height: clamp(430px, calc(100dvh - 250px), 760px);
  min-height: 430px;
  margin-bottom: var(--s6);
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--s1);
  flex: none;
  overflow-x: auto; /* layout-check: allow - tab strip scrolls sideways on narrow phones */
  overflow-y: hidden;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}

.tab {
  width: auto;
  flex: none;
  padding: 8px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
}

.panel[data-active="true"] {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  flex: none;
}

.toolbar-spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  flex: 1 1 auto;
  min-height: 0;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
}

.pane {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--surface);
  overflow: hidden;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex: none;
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.pane-title {
  font-weight: 600;
  color: var(--text);
}

.pane-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Holds either the formatted output or the diagnostic block; height comes
   from the pane, which comes from the workbench, which follows the viewport. */
.pane-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--s3);
  overflow: auto; /* layout-check: allow - code output, scrolls in both directions */
}

.pane-body > .code-area {
  padding: 0;
}

.pane-body > .empty-state {
  margin: auto;
}

/* The editor and the read-only output are the code-block case from the
   layout rules: they scroll on both axes and their height comes from the
   workbench, which follows the viewport. */
.code-area {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: var(--s3);
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.55;
  tab-size: 2;
  resize: none;
  white-space: pre;
  overflow: auto; /* layout-check: allow - code editor, scrolls in both directions */
}

.code-area:focus-visible {
  outline-offset: -2px;
}

.drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

/* --------------------------------------------------------------------------
   Status line and diagnostics
   -------------------------------------------------------------------------- */

.status {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  flex: none;
  min-height: 22px;
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.status-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--text-3);
}

.status[data-state="ok"] .status-dot {
  background: var(--ok);
}

.status[data-state="error"] .status-dot {
  background: var(--err);
}

.status[data-state="busy"] .status-dot {
  background: var(--warn);
}

.diagnostic {
  flex: none;
  padding: var(--s3);
  border: 1px solid color-mix(in srgb, var(--err) 40%, var(--border));
  border-left-width: 3px;
  border-radius: var(--r2);
  background: color-mix(in srgb, var(--err) 8%, var(--surface));
}

.diagnostic-title {
  margin: 0 0 var(--s1);
  color: var(--err);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.diagnostic-where {
  color: var(--text-2);
  font-size: var(--fs-xs);
}

.diagnostic p {
  margin: var(--s2) 0 0;
  color: var(--text);
  font-size: var(--fs-sm);
}

.caret-block {
  margin: var(--s2) 0 0;
  padding: var(--s2) var(--s3);
  border-radius: var(--r1);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.4;
  white-space: pre;
  overflow-x: auto; /* layout-check: allow - code excerpt, horizontal only */
}

.notice {
  flex: none;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-xs);
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--s5);
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Tree
   -------------------------------------------------------------------------- */

.tree-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto; /* layout-check: allow - virtualized long list, the whole point of the panel */
  contain: strict;
}

.tree-sizer {
  position: relative;
  width: 100%;
}

.tree-rows {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  height: var(--row-h);
  padding: 0 var(--s3);
  white-space: nowrap;
  cursor: default;
}

.tree-row:hover,
.tree-row[data-selected="true"] {
  background: var(--surface-2);
}

.tree-toggle {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: var(--r1);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-xs);
  line-height: 1;
  cursor: pointer;
}

.tree-toggle:hover {
  background: var(--surface-3);
  color: var(--text);
}

.tree-toggle[data-leaf="true"] {
  visibility: hidden;
  cursor: default;
}

.tree-key {
  flex: none;
  color: var(--text);
  font-size: var(--fs-sm);
}

.tree-key[data-index="true"] {
  color: var(--text-3);
}

.tree-preview {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.tree-meta {
  flex: none;
  margin-left: auto;
  padding-left: var(--s3);
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.tree-copy {
  flex: none;
  width: auto;
  min-width: 0;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--r1);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
  opacity: 0;
}

.tree-row:hover .tree-copy,
.tree-copy:focus-visible {
  opacity: 1;
}

.badge {
  flex: none;
  padding: 0 6px;
  border-radius: var(--r1);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  line-height: 18px;
}

.badge[data-kind="string"] { color: var(--t-string); }
.badge[data-kind="number"] { color: var(--t-number); }
.badge[data-kind="boolean"] { color: var(--t-boolean); }
.badge[data-kind="null"] { color: var(--t-null); }
.badge[data-kind="object"] { color: var(--t-object); }
.badge[data-kind="array"] { color: var(--t-array); }

.tree-more {
  display: flex;
  align-items: center;
  height: var(--row-h);
  padding: 0 var(--s3);
}

/* The paging button has to fit inside one virtualized row, so it opts out of
   the normal control height rather than pushing the row taller. */
.tree-more .btn {
  min-height: 20px;
  padding: 0 8px;
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------------------
   Query
   -------------------------------------------------------------------------- */

.query-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto; /* layout-check: allow - result list, unbounded length */
}

.query-hit {
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--border);
}

.query-hit:last-child {
  border-bottom: 0;
}

.query-path {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--accent);
  font-size: var(--fs-xs);
}

.query-path button {
  width: auto;
  min-width: 0;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--r1);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
}

.query-value {
  margin: var(--s1) 0 0;
  color: var(--text);
  font-size: var(--fs-sm);
  white-space: pre-wrap;
  word-break: break-word;
}

.query-help {
  flex: none;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.query-help code {
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Diff
   -------------------------------------------------------------------------- */

.diff-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  flex: none;
  font-size: var(--fs-sm);
}

.diff-count {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  color: var(--text-2);
}

.diff-count b {
  font-weight: 600;
}

.diff-count[data-kind="added"] b { color: var(--added); }
.diff-count[data-kind="removed"] b { color: var(--removed); }
.diff-count[data-kind="changed"] b { color: var(--changed); }

/* The two source editors take a fixed share of the panel; the result list
   takes whatever is left, so the panel never grows past the workbench. */
.diff-inputs {
  flex: 0 1 38%;
  min-height: 120px;
}

.diff-output {
  flex: 1 1 auto;
  min-height: 0;
}

.diff-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto; /* layout-check: allow - virtualized diff list */
  contain: strict;
}

.diff-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  height: var(--row-h);
  padding: 0 var(--s3);
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.diff-row[data-status="added"] {
  border-left-color: var(--added);
  background: color-mix(in srgb, var(--added) 10%, transparent);
}

.diff-row[data-status="removed"] {
  border-left-color: var(--removed);
  background: color-mix(in srgb, var(--removed) 10%, transparent);
}

.diff-row[data-status="changed"] {
  border-left-color: var(--changed);
  background: color-mix(in srgb, var(--changed) 10%, transparent);
}

.diff-sign {
  flex: none;
  width: 14px;
  text-align: center;
  font-size: var(--fs-sm);
}

.diff-row[data-status="added"] .diff-sign { color: var(--added); }
.diff-row[data-status="removed"] .diff-sign { color: var(--removed); }
.diff-row[data-status="changed"] .diff-sign { color: var(--changed); }

.diff-values {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.diff-values del {
  color: var(--removed);
  text-decoration: line-through;
}

.diff-values ins {
  color: var(--added);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Command palette
   -------------------------------------------------------------------------- */

.palette {
  width: min(560px, 92vw);
  max-height: min(70dvh, 520px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r3);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--e3);
}

.palette::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.palette-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-height: inherit;
}

.palette-input {
  width: 100%;
  padding: var(--s4);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-lg);
}

.palette-list {
  margin: 0;
  padding: var(--s2);
  list-style: none;
  overflow-y: auto; /* layout-check: allow - command list, capped against the viewport above */
  max-height: min(52dvh, 400px);
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-radius: var(--r1);
  cursor: pointer;
  font-size: var(--fs-sm);
}

.palette-item[data-active="true"] {
  background: var(--surface-3);
}

.palette-item .hint {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------------------
   Prose sections
   -------------------------------------------------------------------------- */

.prose {
  max-width: 70ch;
  padding-bottom: var(--s6);
  color: var(--text-2);
}

/* The privacy and terms pages have no hero, so their h1 lives in the prose. */
.prose h1 {
  margin: var(--s5) 0 var(--s3);
  color: var(--text);
  font-size: var(--fs-2xl);
}

.prose h2 {
  margin: var(--s6) 0 var(--s3);
  color: var(--text);
}

.prose h3 {
  margin: var(--s4) 0 var(--s2);
  color: var(--text);
}

.prose ol,
.prose ul {
  margin: 0 0 var(--s3);
  padding-left: var(--s5);
}

.prose li {
  margin-bottom: var(--s2);
}

.prose li::marker {
  color: var(--text-3);
}

.prose strong {
  color: var(--text);
}

.section-divider {
  height: 1px;
  margin: var(--s6) 0 0;
  border: 0;
  background: var(--border);
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s5) 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.site-footer .shell {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3) var(--s5);
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --------------------------------------------------------------------------
   Toast

   A short confirmation ("JSONPath copied") that appears over the page and
   leaves on its own. It is a live region rather than a dialog: it never takes
   focus and never blocks a keyboard user.
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--s5);
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(560px, 92vw);
  padding: var(--s2) var(--s4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r2);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-sm);
  box-shadow: var(--e2);
}

.toast[hidden] {
  display: none;
}

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

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