/* online-json.com
 * Warm paper and ink, one vermilion accent, IBM Plex type, hairline rules.
 * Light by default; dark when the visitor picks it ([data-theme="dark"] on <html>). */

:root {
  --bg: #f3f0e8;
  --surface: #fffdf7;
  --surface-2: #f7f4ec;
  --ink: #1c1a16;
  --ink-2: #47433b;
  --muted: #7a7468;
  --line: #e2dccd;
  --line-strong: #cbc2ad;
  --accent: #c2410c;
  --accent-hover: #a3360a;
  --accent-ink: #fffdf7;
  --accent-soft: #f8e3d6;
  --ok: #2d7a4d;
  --err: #b42318;
  --chrome: #1c1a16;
  --chrome-2: #2a2721;
  --chrome-ink: #f3f0e8;
  --chrome-muted: #8f897c;

  --tok-key: #1c1a16;
  --tok-str: #2d7a4d;
  --tok-num: #c2410c;
  --tok-bool: #8a5a00;
  --tok-null: #5b5b9a;
  --gutter-bg: #f7f4ec;
  --gutter-ink: #a39d90;
  --active-line: #f3eee2;
  --selection: #f3d9c8;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 3px;
  --header-h: 56px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #11100e;
  --surface: #191815;
  --surface-2: #201e1a;
  --ink: #ece7dc;
  --ink-2: #c4beb1;
  --muted: #8f897c;
  --line: #2c2924;
  --line-strong: #403b34;
  --accent: #f26b2a;
  --accent-hover: #ff8143;
  --accent-ink: #11100e;
  --accent-soft: #3a2215;
  --ok: #63c08a;
  --err: #f2786b;
  --chrome: #0a0908;
  --chrome-2: #1d1b17;
  --tok-key: #e6e0d4;
  --tok-str: #8fd1a6;
  --tok-num: #ff9a66;
  --tok-bool: #e8c071;
  --tok-null: #a9a6e6;
  --gutter-bg: #151411;
  --gutter-ink: #5f5a50;
  --active-line: #1f1d19;
  --selection: #4a2c1a;
  color-scheme: dark;
}

/* ---------- fonts (self-hosted, OFL; see assets/fonts/OFL.txt) ---------- */
/* font-display: optional: a font that isn't ready within ~100 ms is skipped for that page view
 * (cached for the next), so text never re-flows when it arrives: no layout shift. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url("../../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url("../../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: optional;
  src: url("../../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url("../../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url("../../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

/* Optional editor fonts (Settings). Browsers only download the one in use. Licences: assets/fonts/LICENSE-*.txt */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/fira-code-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fira Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/fira-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/source-code-pro-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Cascadia Code";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/cascadia-code-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/roboto-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Ubuntu Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/ubuntu-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inconsolata";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/inconsolata-latin-400-normal.woff2") format("woff2");
}

/* ---------- base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1 0 auto; }

a { color: inherit; }

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

kbd {
  font: 500 11px/1 var(--mono);
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 100;
  transform: translateY(-200%);
  padding: 8px 12px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.skip-link:focus { transform: none; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand img { display: block; }

.brand-name {
  font: 500 17px/1 var(--mono);
  letter-spacing: -0.02em;
}

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

.tool-nav {
  display: flex;
  align-self: stretch;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tool-nav::-webkit-scrollbar { display: none; }

.tool-nav a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
}

.tool-nav a:hover { color: var(--ink); }

.tool-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-2);
}

.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-right: 4px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.search-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.search-btn i { font-size: 12px; }
.search-btn kbd { margin-left: 8px; }

.menu-btn { display: none; }
.menu-btn .fa-times, .menu-btn[aria-expanded="true"] .fa-bars { display: none; }
.menu-btn[aria-expanded="true"] .fa-times { display: inline-block; }

.theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: inline-block; }


/* ---------- workspace ---------- */

.workspace {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  min-height: 560px;
  padding: 0 20px;
}

/* one pane fills the window (its expand button, or Esc to restore) */
.pane.is-maximized {
  position: fixed;
  inset: 0;
  z-index: 50;
  border: 0;
  border-radius: 0;
}

html.maximized-card { overflow: hidden; }

/* ---------- document bar: the page's main action and its options ---------- */

.docbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0 10px;
}

.docbar-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.docbar-end {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .12s, background-color .12s;
}

.tb-btn i { font-size: 12px; color: var(--muted); }
.tb-btn:hover { border-color: var(--ink); }
.tb-btn:hover i { color: var(--ink); }
.tb-btn.is-quiet { border-color: transparent; background: none; color: var(--ink-2); }
.tb-btn.is-quiet:hover { border-color: var(--line-strong); color: var(--ink); }
.tb-btn.is-icon { width: 48px; height: 48px; padding: 0; justify-content: center; }
.tb-btn.is-icon i { font-size: 16px; color: var(--ink-2); }
.tb-btn .count { background: var(--line); color: var(--ink); }

.tb-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .12s;
}

.tb-primary:hover { background: var(--accent-hover); }
.tb-primary:active { transform: translateY(1px); }
.tb-primary kbd { padding: 0; border: 0; background: none; color: inherit; opacity: .75; }

.tb-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}

.tb-field select,
.tb-field input {
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 500 13px var(--mono);
}

.tb-field input { width: 72px; }
.tb-field.is-wide input { width: 200px; }
.tb-field select:focus,
.tb-field input:focus { outline: none; border-color: var(--accent); }

.docbar .switch { padding: 0; gap: 8px; }
.docbar .switch-label { font: 400 13px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-2); }

/* the name of the JSON being edited: untitled, a saved item, or a shared link */
.doc-name {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  margin-right: 6px;
}

.doc-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 320px;
  height: 32px;
  margin-left: -8px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.doc-title:hover { background: var(--surface-2); }
.doc-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-title-edit { font-size: 11px; color: var(--muted); }
.doc-title-icon { font-size: 12px; color: var(--accent); }

.doc-detach {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
}

.doc-detach:hover { background: var(--surface-2); color: var(--ink); }
.doc-detach[hidden] { display: none; }

/* converter options sit in the bar too; some only show for one choice of another option */
.tb-options [hidden] { display: none; }

/* ---------- panes: each one carries its own view tabs and actions ---------- */

.panes {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
  background: var(--ed-bg);
  container-type: inline-size;
}

.pane-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 6px 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.pane-title {
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.seg {
  display: inline-flex;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.seg button {
  height: 26px;
  padding: 0 10px;
  border: 0;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.pane-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.pane-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.pane-btn i { font-size: 12px; color: var(--muted); }
.pane-btn:hover,
.pane-btn[aria-expanded="true"] { background: var(--line); color: var(--ink); }
.pane-btn:hover i,
.pane-btn[aria-expanded="true"] i { color: var(--ink); }
.pane-btn.is-icon { width: 28px; padding: 0; }
.pane-btn.is-icon i { font-size: 13px; }

.main-editor {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--ed-bg);
  transition: box-shadow .15s;
}

.main-editor.is-drop-target { box-shadow: inset 0 0 0 3px var(--accent); }

/* The sample as plain text, painted with the page (tool.php). It lies over the editor, out of
 * the flow so nothing moves, and tool.js removes it once the editor has painted underneath.
 * Set like the editor: its font and size, 20px lines, a gutter strip. Returning visitors get
 * their own input restored instead, so it stays hidden for them. */
.editor-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0 0 0 52px;
  overflow: hidden;
  font: var(--editor-size)/20px var(--editor-font);
  color: var(--ed-ink);
  white-space: pre;
  background: linear-gradient(to right, var(--ed-gutter-bg) 41px, var(--ed-line) 41px 42px, var(--ed-bg) 42px);
}
.has-saved-input .editor-placeholder { visibility: hidden; }

/* narrow panes keep the icons and drop the words */
@container (max-width: 500px) {
  .pane-btn span { display: none; }
  .pane-btn { width: 28px; padding: 0; }
}

@container (max-width: 400px) {
  .pane-title { display: none; }
}

/* a phone-width input bar: tighter view tabs, and Sample moves into the ⋯ menu (tool.js) */
@container (max-width: 420px) {
  .pane-head .seg button { padding: 0 9px; }
  #sample-json { display: none; }
}
@container (max-width: 380px) {
  .pane-head .seg button { padding: 0 6px; }
}

/* copy back (editor pages) and sync scrolling sit in the gap between the panes */
.pane-gutter {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translate(-50%, -50%);
}

.pane-swap {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11px;
}

.pane-swap:hover { border-color: var(--ink); color: var(--ink); }
.pane-sync[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.pane-sync[aria-pressed="true"]:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: var(--accent-ink); }

/* shown over an empty input */
.pane-empty {
  position: absolute;
  inset: 42px 0 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--ed-muted);
  pointer-events: none;
}

.pane-empty[hidden] { display: none; }
.pane-empty p { margin: 0; }

.pane-empty button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  pointer-events: auto;
}

.pane-empty button:hover { color: var(--accent-hover); }

/* phones show one pane at a time, and a bar with the main action */
.pane-switch,
.mobile-bar { display: none; }

/* ---------- ⋯ menus ---------- */

.menu {
  position: fixed;
  inset: auto;
  z-index: 70;
  min-width: 220px;
  margin: 0;
  padding: 6px 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 36px -16px rgba(20, 18, 14, .4);
}

.menu[hidden] { display: none; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 32px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 13.5px;
  text-align: left;
  white-space: nowrap;
}

.menu-item:hover,
.menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item kbd { margin-left: auto; padding: 0; border: 0; background: none; color: var(--muted); }
.menu-item[role="menuitemcheckbox"]::after { content: ""; width: 1em; margin-left: auto; text-align: right; }
.menu-item[aria-checked="true"]::after { content: "✓"; color: var(--accent); }

.menu-sep { display: block; height: 1px; margin: 6px 0; background: var(--line); }

/* ---------- command palette (Ctrl+K) ---------- */

.palette {
  width: min(560px, calc(100vw - 32px));
  max-height: none;
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px -20px rgba(20, 18, 14, .45);
}

.palette::backdrop { background: rgba(20, 18, 14, .35); }

.palette-search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.palette-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

.palette-list {
  max-height: min(52vh, 420px);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

.palette-item[aria-selected="true"] { background: var(--accent-soft); }
.palette-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-meta { margin-left: auto; font: 400 11.5px var(--mono); color: var(--muted); white-space: nowrap; }
kbd.palette-meta { padding: 1px 6px; }

.palette-empty { margin: 0; padding: 16px 18px; color: var(--muted); }
.palette-empty[hidden] { display: none; }

.palette-foot {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* live toggle */
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 30px;
  height: 16px;
  border-radius: 8px;
  background: var(--line-strong);
  transition: background-color .15s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .15s;
}

.switch input:checked + .switch-track { background: var(--ink); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.switch-label {
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- status line ---------- */

.status {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 40px;
  padding: 8px 2px;
  font: 400 12.5px/1.3 var(--mono);
  color: var(--muted);
}

.status-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.status-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

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

.status-detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-fix {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font: 500 12.5px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
}

.status-fix:hover { background: var(--accent); color: var(--accent-ink); }
.status-fix[hidden],
.mobile-fix[hidden] { display: none; }

.status-meta { white-space: nowrap; }

.status-keys {
  margin-left: auto;
  white-space: nowrap;
}

/* ---------- jsoneditor skin ---------- */

div.jsoneditor {
  border: 0;
  color: var(--ink);
}

/* jsoneditor's own menu bar is replaced by the pane header. Its tree-mode search box floats
 * over the tree while searching (workspace.js adds .is-searching). */
.workspace div.jsoneditor-menu {
  position: relative;
  z-index: 5;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
}

.workspace div.jsoneditor-menu > * { display: none !important; }
.workspace .pane.is-searching div.jsoneditor-menu > .jsoneditor-search { display: flex !important; top: 6px; right: 10px; }
.workspace div.jsoneditor-outer.has-main-menu-bar { margin-top: 0; padding-top: 0; }
.workspace div.jsoneditor-outer.has-main-menu-bar.has-nav-bar { margin-top: -26px; padding-top: 26px; }

.jsoneditor-search .jsoneditor-frame {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--ed-bg);
  box-shadow: 0 8px 20px -10px rgba(20, 18, 14, .35);
}

.jsoneditor-search .jsoneditor-results { color: var(--ed-muted); font-family: var(--mono); font-size: 12px; }

/* Editor palette. Defaults follow the site's light/dark theme; Settings can pick a fixed
 * palette by setting data-editor-theme on <html>. Theme cards in the Settings dialog carry
 * the same attribute so each one previews itself. */
:root,
[data-editor-theme="auto"] {
  --ed-bg: var(--surface);
  --ed-ink: var(--ink);
  --ed-muted: var(--muted);
  --ed-gutter-bg: var(--gutter-bg);
  --ed-gutter-ink: var(--gutter-ink);
  --ed-active: var(--active-line);
  --ed-selection: var(--selection);
  --ed-line: var(--line);
  --ed-panel: var(--surface-2);
  --ed-hover: var(--accent-soft);
  --ed-key: var(--tok-key);
  --ed-str: var(--tok-str);
  --ed-num: var(--tok-num);
  --ed-bool: var(--tok-bool);
  --ed-null: var(--tok-null);
  --ed-cursor: var(--accent);
  --editor-font: var(--mono);
  --editor-size: 15px;
}

[data-editor-theme="github-light"] {
  --ed-bg: #ffffff; --ed-ink: #1f2328; --ed-muted: #6e7781;
  --ed-gutter-bg: #f6f8fa; --ed-gutter-ink: #8c959f; --ed-active: #f6f8fa; --ed-selection: #ddf4ff;
  --ed-line: #d0d7de; --ed-panel: #f6f8fa; --ed-hover: #ddf4ff;
  --ed-key: #0550ae; --ed-str: #0a3069; --ed-num: #116329; --ed-bool: #cf222e; --ed-null: #8250df; --ed-cursor: #0969da;
}

[data-editor-theme="solarized-light"] {
  --ed-bg: #fdf6e3; --ed-ink: #586e75; --ed-muted: #93a1a1;
  --ed-gutter-bg: #eee8d5; --ed-gutter-ink: #93a1a1; --ed-active: #eee8d5; --ed-selection: #e0d9c2;
  --ed-line: #e4ddc8; --ed-panel: #eee8d5; --ed-hover: #e9e2cb;
  --ed-key: #268bd2; --ed-str: #2aa198; --ed-num: #d33682; --ed-bool: #b58900; --ed-null: #6c71c4; --ed-cursor: #cb4b16;
}

[data-editor-theme="one-dark"] {
  --ed-bg: #282c34; --ed-ink: #abb2bf; --ed-muted: #7f848e;
  --ed-gutter-bg: #21252b; --ed-gutter-ink: #495162; --ed-active: #2c313c; --ed-selection: #3e4451;
  --ed-line: #181a1f; --ed-panel: #21252b; --ed-hover: #3a3f4b;
  --ed-key: #e06c75; --ed-str: #98c379; --ed-num: #d19a66; --ed-bool: #56b6c2; --ed-null: #c678dd; --ed-cursor: #528bff;
}

[data-editor-theme="monokai"] {
  --ed-bg: #272822; --ed-ink: #f8f8f2; --ed-muted: #75715e;
  --ed-gutter-bg: #2f3129; --ed-gutter-ink: #90908a; --ed-active: #3e3d32; --ed-selection: #49483e;
  --ed-line: #1e1f1c; --ed-panel: #1e1f1c; --ed-hover: #3e3d32;
  --ed-key: #f92672; --ed-str: #e6db74; --ed-num: #ae81ff; --ed-bool: #66d9ef; --ed-null: #fd971f; --ed-cursor: #f8f8f0;
}

[data-editor-theme="dracula"] {
  --ed-bg: #282a36; --ed-ink: #f8f8f2; --ed-muted: #6272a4;
  --ed-gutter-bg: #21222c; --ed-gutter-ink: #6272a4; --ed-active: #343746; --ed-selection: #44475a;
  --ed-line: #191a21; --ed-panel: #21222c; --ed-hover: #44475a;
  --ed-key: #8be9fd; --ed-str: #f1fa8c; --ed-num: #bd93f9; --ed-bool: #ff79c6; --ed-null: #ffb86c; --ed-cursor: #f8f8f2;
}

[data-editor-theme="nord"] {
  --ed-bg: #2e3440; --ed-ink: #d8dee9; --ed-muted: #616e88;
  --ed-gutter-bg: #2b303b; --ed-gutter-ink: #4c566a; --ed-active: #3b4252; --ed-selection: #434c5e;
  --ed-line: #252a33; --ed-panel: #3b4252; --ed-hover: #434c5e;
  --ed-key: #88c0d0; --ed-str: #a3be8c; --ed-num: #b48ead; --ed-bool: #81a1c1; --ed-null: #d08770; --ed-cursor: #d8dee9;
}

[data-editor-theme="gruvbox-dark"] {
  --ed-bg: #282828; --ed-ink: #ebdbb2; --ed-muted: #928374;
  --ed-gutter-bg: #32302f; --ed-gutter-ink: #7c6f64; --ed-active: #3c3836; --ed-selection: #504945;
  --ed-line: #1d2021; --ed-panel: #32302f; --ed-hover: #3c3836;
  --ed-key: #83a598; --ed-str: #b8bb26; --ed-num: #d3869b; --ed-bool: #fe8019; --ed-null: #fabd2f; --ed-cursor: #ebdbb2;
}

/* native scrollbars match the palette, not the page */
:root:is([data-editor-theme="github-light"], [data-editor-theme="solarized-light"]) .main-editor { color-scheme: light; }
:root:is([data-editor-theme="one-dark"], [data-editor-theme="monokai"], [data-editor-theme="dracula"], [data-editor-theme="nord"], [data-editor-theme="gruvbox-dark"]) .main-editor { color-scheme: dark; }

/* ligatures stay off unless Settings turns them on (Fira Code, JetBrains Mono, Cascadia Code) */
.ace_editor, div.jsoneditor-preview, .settings-preview { font-variant-ligatures: none; }
:root.ed-ligatures :is(.ace_editor, div.jsoneditor-preview, .settings-preview) { font-variant-ligatures: normal; }

/* code mode (ace) */
.ace-jsoneditor.ace_editor,
.ace-jsoneditor .ace_scroller,
.ace-jsoneditor .ace_content { background: var(--ed-bg); color: var(--ed-ink); }
.ace_editor { font-family: var(--editor-font) !important; font-size: var(--editor-size); }
.ace-jsoneditor .ace_gutter { background: var(--ed-gutter-bg); color: var(--ed-gutter-ink); border-right: 1px solid var(--ed-line); }
.ace-jsoneditor .ace_gutter-active-line { background: var(--ed-active); color: var(--ed-ink); }
.ace-jsoneditor .ace_marker-layer .ace_active-line { background: var(--ed-active); }
.ace-jsoneditor .ace_marker-layer .ace_selection { background: var(--ed-selection); }
.ace-jsoneditor .ace_marker-layer .ace_selected-word { border-color: var(--ed-muted); }
.ace-jsoneditor .ace_marker-layer .ace_bracket { border-color: var(--ed-muted); }
/* the Ace theme gives the cursor a black border of its own, so set the border colour too */
.ace_editor.ace-jsoneditor .ace_cursor { color: var(--ed-cursor); border-left-color: var(--ed-cursor); }
.ace-jsoneditor .ace_variable { color: var(--ed-key); }
.ace-jsoneditor .ace_string { color: var(--ed-str); }
.ace-jsoneditor .ace_constant.ace_numeric { color: var(--ed-num); }
.ace-jsoneditor .ace_constant.ace_language.ace_boolean { color: var(--ed-bool); }
.ace-jsoneditor .ace_constant.ace_language { color: var(--ed-null); }
.ace-jsoneditor .ace_paren,
.ace-jsoneditor .ace_punctuation { color: var(--ed-muted); }
.ace-jsoneditor .ace_fold { background-color: var(--ed-cursor); border-color: var(--ed-cursor); }
.ace-jsoneditor .ace_indent-guide { background: none; box-shadow: inset 1px 0 0 var(--ed-line); }
.ace_search { background: var(--surface-2) !important; border-color: var(--line-strong) !important; color: var(--ink); }
.ace_search_field, .ace_searchbtn, .ace_replacebtn { background: var(--surface) !important; color: var(--ink) !important; border-color: var(--line-strong) !important; }

/* tree mode */
div.jsoneditor-tree,
div.jsoneditor-tree-inner { background: var(--ed-bg); }
div.jsoneditor-field, div.jsoneditor-value, div.jsoneditor td, div.jsoneditor th,
div.jsoneditor textarea, div.jsoneditor-readonly { font-family: var(--editor-font); font-size: calc(var(--editor-size) - 1px); }
div.jsoneditor-field { color: var(--ed-key); }
div.jsoneditor-value { color: var(--ed-ink); }
div.jsoneditor-value.jsoneditor-string { color: var(--ed-str); }
div.jsoneditor-value.jsoneditor-number { color: var(--ed-num); }
div.jsoneditor-value.jsoneditor-boolean { color: var(--ed-bool); }
div.jsoneditor-value.jsoneditor-null { color: var(--ed-null); }
div.jsoneditor-readonly { color: var(--ed-muted); }
div.jsoneditor td.jsoneditor-separator { color: var(--ed-muted); }
div.jsoneditor-tree tr.jsoneditor-highlight,
div.jsoneditor-tree tr.jsoneditor-selected { background-color: var(--ed-active); }
div.jsoneditor-field.jsoneditor-highlight, div.jsoneditor-value.jsoneditor-highlight,
div.jsoneditor-field:focus, div.jsoneditor-value:focus,
div.jsoneditor-field:hover, div.jsoneditor-value:hover {
  background-color: var(--ed-hover);
  border-color: var(--ed-muted);
}
div.jsoneditor-navigation-bar {
  background: var(--ed-panel);
  border-bottom: 1px solid var(--ed-line);
  color: var(--ed-muted);
  font-family: var(--mono);
}
div.jsoneditor-treepath-element:hover { color: var(--ed-ink); }
div.jsoneditor-search input { background: var(--ed-bg); color: var(--ed-ink); }
div.jsoneditor-frame { background: var(--ed-bg); }

/* preview mode */
div.jsoneditor-preview { padding: 8px 14px; }

div.jsoneditor-preview,
.jsoneditor pre {
  background: var(--ed-bg);
  color: var(--ed-ink);
  font-family: var(--editor-font);
  font-size: var(--editor-size);
  line-height: 1.5;
}

/* status bar inside the editor */
div.jsoneditor-statusbar {
  background: var(--ed-panel);
  border-top: 1px solid var(--ed-line);
  color: var(--ed-muted);
  font-family: var(--mono);
  font-size: 12px;
}

/* jsoneditor's Sort and Transform dialogs (from the ⋯ menus), in the site palette */
.jsoneditor-modal {
  border: 1px solid var(--line-strong);
  border-radius: 6px !important;
  background-color: var(--surface) !important;
  color: var(--ink-2);
  font-family: var(--sans);
  box-shadow: 0 24px 60px -20px rgba(20, 18, 14, .45);
}

.jsoneditor-modal .pico-modal-header {
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  background: var(--surface-2);
  color: var(--ink);
  font: 600 14px/36px var(--sans);
}

.jsoneditor-modal .pico-close { top: 4px !important; color: var(--muted); }
.jsoneditor-modal a { color: var(--accent); }
.jsoneditor-modal .jsoneditor-jmespath-label { color: var(--ink); }
.jsoneditor-modal .selectr-selected .selectr-tag { background-color: var(--accent); }
.jsoneditor-modal .jsoneditor-button-group.jsoneditor-button-group-value-asc input.jsoneditor-button-asc,
.jsoneditor-modal .jsoneditor-button-group.jsoneditor-button-group-value-desc input.jsoneditor-button-desc { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* parse error list */
div.jsoneditor-text-errors { border-top-color: var(--err); }
div.jsoneditor-text-errors tbody tr { background: var(--ed-hover); color: var(--ed-ink); }

/* ---------- article content ---------- */

.article,
.container > .text-content {
  max-width: 760px;
  margin: 72px auto 96px;
  padding: 0 24px;
  color: var(--ink-2);
  counter-reset: section;
}

.article h1,
.text-content h1 {
  margin: 0 0 20px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.article > .para:first-of-type {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-2);
  padding-bottom: 32px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.text-content h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 48px 0 14px;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.article h2::before {
  counter-increment: section;
  content: counter(section, decimal-leading-zero);
  font: 500 13px/1 var(--mono);
  color: var(--accent);
  transform: translateY(-2px);
}

.text-content h3 {
  margin: 32px 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.text-content p,
.text-content li {
  font-size: 16.5px;
  line-height: 1.75;
}

.text-content p { margin: 0 0 16px; }

.text-content ul {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.text-content li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
}

.text-content li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .8em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.text-content br { display: none; }

.text-content a { color: var(--accent); text-underline-offset: 3px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: 48px 20px 24px;
  font-size: 14px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1080px;
  margin: 0 auto;
}

.footer-brand p {
  max-width: 34ch;
  margin: 12px 0 0;
  color: var(--muted);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col h2 {
  margin: 0 0 4px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer-col a:hover { color: var(--accent); }

.footer-legal {
  max-width: 1080px;
  margin: 40px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font: 400 12px var(--mono);
  color: var(--muted);
}

/* ---------- dialog ---------- */

/* A modal dialog makes the page inert but doesn't stop it scrolling: wheel or touch scrolling over
   a dialog, its backdrop or the end of a list in it would scroll the page behind. The gutter keeps
   the page from shifting when its scrollbar goes. */
html:has(dialog:modal) { overflow: hidden; scrollbar-gutter: stable; }

.dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .35);
}

.dialog::backdrop { background: rgba(20, 18, 14, .45); }

.dialog form { padding: 24px; }

.dialog h2 {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
}

#download_file_name { font-family: var(--mono); }

.field input:focus { outline: none; border-color: var(--accent); }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.btn {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 500;
}

.btn:hover { border-color: var(--ink); }

.btn.is-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

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

/* ---------- toasts ---------- */

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast-region[popover] {
  inset: auto auto 28px 50%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  overflow: visible;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font: 500 13px/1.3 var(--mono);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}

.toast.is-visible { opacity: 1; transform: none; }

.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.toast[data-icon="success"]::before { background: var(--ok); }
.toast[data-icon="error"]::before { background: var(--err); }


/* ---------- saved JSON ---------- */

.count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 11px/1 var(--mono);
}

.count[hidden] { display: none; }

.dialog form > .field + .field { margin-top: 16px; }

.field em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  opacity: .8;
}

.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font: 400 14px/1.5 var(--sans);
  resize: vertical;
}

.field textarea:focus { outline: none; border-color: var(--accent); }

/* share dialog */
.dialog-warn {
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
}

.dialog-warn i { margin-top: 3px; color: var(--accent); }

.share-result { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.share-result[hidden] { display: none; }

.copy-field { display: flex; gap: 8px; }
.field .copy-field { font: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
.copy-field input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }
.copy-field .btn { height: 40px; white-space: nowrap; }

.share-channels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.share-channel {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
}

.share-channel:hover { border-color: var(--ink); color: var(--ink); }

.page-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 20px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink);
}

.page-notice i { color: var(--accent); }

/* feedback */
.feedback-tab {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 20;
  padding: 10px 7px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
  cursor: pointer;
}

.feedback-tab:hover { color: var(--accent); border-color: var(--accent); }
html.maximized-card .feedback-tab,
body:has(.workspace) .feedback-tab { display: none; } /* tool pages use the link in the status line */

.status-feedback {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.status-feedback:hover { color: var(--accent); }

.rating { margin: 0 0 18px; padding: 0; border: 0; }

.rating legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--ink-2);
}

.stars {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}

.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.stars label {
  font-size: 26px;
  line-height: 1;
  color: var(--line-strong);
  cursor: pointer;
  transition: color .1s, transform .1s;
}

.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label { color: var(--accent); }
.stars label:hover { transform: scale(1.1); }
.stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.rating.is-invalid .stars label { color: var(--err); opacity: .5; }

.dialog .field select { width: 100%; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* settings dialog */
.dialog.settings { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.dialog.settings form { display: flex; flex-direction: column; max-height: calc(100vh - 50px); padding: 0; }

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px 24px;
  border-bottom: 1px solid var(--line);
}

.settings-head h2 { margin: 0; }
.settings-body { overflow-y: auto; padding: 4px 24px 8px; }
.settings-group { padding: 18px 0; }
.settings-group + .settings-group { border-top: 1px solid var(--line); }

.settings-group h3 {
  margin: 0 0 12px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 16px;
  align-items: end;
}

.field select,
.toggle select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font: 400 14px var(--sans);
}

.toggle select { height: 32px; }
.field select:focus, .toggle select:focus { outline: none; border-color: var(--accent); }

.set-size span { display: flex; justify-content: space-between; }
.set-size output { color: var(--ink); letter-spacing: 0; text-transform: none; }
.set-size input[type="range"] { height: 40px; padding: 0; border: 0; background: none; accent-color: var(--accent); }

.settings-preview {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--chrome);
  border-radius: var(--radius);
  background: var(--ed-bg);
  color: var(--ed-ink);
  font-family: var(--editor-font);
  font-size: var(--editor-size);
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
}

.settings-preview b { font-weight: inherit; }
.settings-preview .k { color: var(--ed-key); }
.settings-preview .s { color: var(--ed-str); }
.settings-preview .n { color: var(--ed-num); }
.settings-preview .b { color: var(--ed-bool); }
.settings-preview .z { color: var(--ed-null); }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font: 500 12.5px/1.2 var(--sans);
  text-align: left;
}

.theme-card:hover { border-color: var(--ink); }
.theme-card[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--ink); }

.theme-swatch {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
  padding: 7px 8px;
  border-radius: 2px;
  background: var(--ed-bg);
  box-shadow: inset 0 0 0 1px var(--ed-line);
}

.theme-swatch i { display: block; height: 4px; border-radius: 2px; }
.theme-swatch .k { width: 30%; background: var(--ed-key); }
.theme-swatch .s { width: 26%; background: var(--ed-str); }
.theme-swatch .n { width: 14%; background: var(--ed-num); }
.theme-swatch .b { width: 18%; background: var(--ed-bool); }

.toggle-list { display: flex; flex-direction: column; }

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.toggle + .toggle { border-top: 1px dashed var(--line); }
.toggle em { font-style: normal; color: var(--muted); font-size: 12.5px; margin-left: 6px; }

/* checkbox drawn as the same switch used for Live */
.toggle input[type="checkbox"] {
  appearance: none;
  flex: none;
  position: relative;
  width: 30px;
  height: 16px;
  margin: 0;
  border-radius: 8px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background .15s;
}

.toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .15s;
}

.toggle input[type="checkbox"]:checked { background: var(--ink); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(14px); }
.toggle input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.settings-actions {
  justify-content: space-between;
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}

@media (max-width: 560px) {
  .settings-row { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
}

.dialog-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.dialog-text {
  margin: -6px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* Saved JSON: a centred dialog with the saved items and the share links of this browser */
.library {
  width: min(680px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .35);
  flex-direction: column;
}

.library[open] { display: flex; }
.library::backdrop { background: rgba(20, 18, 14, .45); }

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px 20px;
}

.library-head h2 { margin: 0; font-size: 18px; font-weight: 600; }

.library-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.library-tabs [role="tab"] { position: relative; padding: 8px 10px 10px; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.library-tabs [role="tab"]:hover, .library-tabs [role="tab"][aria-selected="true"] { color: var(--ink); }
.library-tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 2px; background: var(--accent); }
.library-tabs .count { margin-left: 4px; }

.library-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 12px; }
.library-panel[hidden] { display: none; }

.library-caution { display: flex; gap: 10px; margin: 0 20px 12px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.library-caution i { margin-top: 3px; color: var(--accent); }

.lib-item > .lib-title, .lib-item > .lib-url, .lib-item > .lib-meta { display: block; }
.lib-url { font: 400 12px/1.4 var(--mono); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item.is-expired { opacity: .6; }

.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 2px; }

.library-search {
  position: relative;
  margin: 0 20px 8px;
}

.library-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
}

.library-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 14px;
}

.library-search input:focus { outline: none; border-color: var(--accent); }

.lib-list {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 0 20px;
  list-style: none;
}

.lib-list:empty { flex: 0 0 auto; }

.lib-item {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.lib-item.is-current { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }

.lib-open {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.lib-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.lib-open:hover .lib-title { color: var(--accent); }

.lib-desc {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lib-meta {
  font: 400 12px/1.4 var(--mono);
  color: var(--muted);
}

.lib-kind.is-invalid { color: var(--err); }

.lib-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  margin-left: -8px;
}

.lib-action {
  padding: 3px 8px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none; /* Open in My links is a link */
}

.lib-action:hover { background: var(--surface-2); color: var(--ink); }
.lib-action.is-danger:hover, .lib-action[data-armed] { color: var(--err); }
.lib-action[data-armed] { background: var(--accent-soft); }

.lib-empty {
  margin: 24px 20px;
  font-size: 14px;
  color: var(--muted);
}

.lib-empty[hidden] { display: none; }

.lib-empty-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--ink);
}

.library-foot {
  margin-top: auto;
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.library-foot .btn { flex: 1; font-size: 13.5px; }
.library-foot .btn i { margin-right: 4px; color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .site-header { gap: 16px; }
  .search-btn-label { display: none; }
  /* keep the document bar on one row: the select already reads "2 spaces" */
  .tb-field.is-indent > span,
  .docbar .tb-primary kbd { display: none; }
}

@media (max-width: 1000px) {
  .search-btn { width: 36px; padding: 0; justify-content: center; }
  .search-btn kbd { display: none; }
}

@media (max-width: 860px) {
  .hide-mobile { display: none !important; }

  /* the tool links move into the menu button */
  .site-header { gap: 8px; padding: 0 8px 0 16px; }
  .tool-nav { display: none; }
  .menu-btn { display: inline-grid; }
  .search-btn { border-color: transparent; }

  .workspace {
    height: auto;
    min-height: 0;
    padding: 0 16px;
  }

  .docbar { padding: 8px 0; gap: 8px 16px; }
  .docbar-start { flex: 1 1 100%; }
  .docbar-end { flex: 1 1 100%; flex-wrap: wrap; gap: 8px 16px; margin-left: 0; }
  .docbar .tb-primary { display: none; }
  .docbar .tb-btn,
  .tb-field select,
  .tb-field input { height: 40px; }
  .is-editor .doc-name { flex: 1; }
  .doc-title { max-width: 100%; }

  .pane-switch {
    display: flex;
    margin-bottom: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    overflow: hidden;
  }

  .pane-switch button {
    flex: 1;
    height: 40px;
    border: 0;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
  }

  .pane-switch button + button { border-left: 1px solid var(--line-strong); }
  .pane-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

  .panes { display: block; }
  .workspace[data-show="1"] #pane-2,
  .workspace[data-show="2"] #pane-1 { display: none; }
  .pane-gutter { display: none; }
  .tb-field.is-wide { flex: 1 1 100%; }
  .tb-field.is-wide input { flex: 1; width: auto; min-width: 0; }
  .pane-title { display: none; }
  .pane-head { height: 48px; gap: 8px; padding-left: 8px; }
  .pane-empty { inset: 48px 0 0; }
  .seg button { height: 32px; padding: 0 12px; font-size: 13px; }
  .pane-btn { height: 36px; }
  .pane-btn.is-icon { width: 30px; } /* packed icons, still 36px tall to tap */

  .main-editor { height: 60vh; min-height: 340px; flex: none; }

  /* Two fixed rows on phones (state and detail; size and Feedback), so the text the scripts
     fill in after load never moves an item onto another line: no layout shift */
  .status {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "state detail fix" "meta meta feedback";
    column-gap: 10px;
    row-gap: 2px;
  }
  .status-state { grid-area: state; }
  .status-detail { grid-area: detail; }
  .status-fix { grid-area: fix; }
  .status-meta { grid-area: meta; }
  .status-feedback { grid-area: feedback; justify-self: end; }

  .mobile-bar {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--bg);
  }

  .mobile-bar .tb-primary { flex: 1; height: 48px; font-size: 16px; }
  .mobile-bar .mobile-fix { height: 48px; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
  .mobile-bar .mobile-fix i { color: inherit; }

  .palette { margin-top: 8vh; }
  .palette-foot,
  kbd.palette-meta { display: none; }

  .article, .container > .text-content { margin: 48px auto 64px; padding: 0 16px; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .tb-label { display: none; }
  .pane-btn { width: 30px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- legal pages ---------- */

.legal-updated { margin-top: -8px; font: 400 13px/1.4 var(--mono); color: var(--muted); }

.legal-summary {
  margin: 28px 0 8px;
  padding: 4px 22px 8px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

.legal-summary h2 { margin-top: 16px; }
.legal .code-sample, .legal code { overflow-wrap: anywhere; }

/* ---------- FAQ ---------- */

.article + .faq { margin-top: -40px; }
.faq h2 { margin-top: 0; }
.faq h2::before { content: none; }

.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-of-type { border-bottom: 1px solid var(--line); }

.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font: 400 20px/1 var(--mono); color: var(--accent); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:hover { color: var(--accent); }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.faq-item p { margin: -4px 0 18px; }

/* ---------- more tools menu ---------- */

.tool-nav .more-tools { gap: 6px; }
.more-tools i { font-size: 9px; transition: transform .15s; }
.more-tools[aria-expanded="true"] { color: var(--ink); }
.more-tools[aria-expanded="true"] i { transform: rotate(180deg); }

.tools-menu {
  position: fixed;
  inset: var(--menu-top) auto auto var(--menu-left); /* under the More tools link (ui.js) */
  margin: 0;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - var(--header-h) - 24px);
  overflow-y: auto;
  padding: 18px 20px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 40px -18px rgba(20, 18, 14, .35);
}

.tools-menu:popover-open {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 20px;
}

.tools-menu-group { display: flex; flex-direction: column; gap: 2px; }
.tools-menu .is-format { display: none; } /* already in the header nav, except on phones */

.tools-menu-title {
  margin: 0 0 6px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tools-menu a {
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
}

.tools-menu a:hover { background: var(--surface-2); color: var(--ink); }
.tools-menu a[aria-current="page"] { color: var(--accent); }

.tools-menu .tools-menu-all {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding: 12px 0 2px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  font-weight: 500;
  color: var(--accent);
}

.tools-menu .tools-menu-all:hover { background: none; color: var(--accent-hover); }
.tools-menu-all i { font-size: 11px; margin-left: 4px; }

/* ---------- tool cards: related tools and the all tools page ---------- */

.related {
  max-width: 1080px;
  margin: 0 auto 88px;
  padding: 40px 24px 0;
  border-top: 1px solid var(--line);
}

.related-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.related-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.related-head a {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.related-head a i { font-size: 11px; margin-left: 4px; }

.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-cards li { margin: 0; padding: 0; }
.tool-cards li::before { content: none; }

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .12s, transform .12s;
}

.tool-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.tool-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tool-card-name { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.tool-card-desc { font-size: 14px; line-height: 1.5; color: var(--muted); }

.tools-index { max-width: 1080px; margin: 64px auto 96px; padding: 0 24px; }

.tools-index h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.tools-index .lead { max-width: 640px; margin: 0 0 8px; font-size: 18px; line-height: 1.6; color: var(--ink-2); }

.tools-group { margin-top: 44px; }

/* ---------- 404 ---------- */

.not-found { text-align: center; }
.not-found-code { margin: 0 0 10px; font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--accent); }
.not-found .lead { margin: 0 auto 24px; }
.not-found-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.not-found-actions .btn { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.not-found-actions .btn.is-primary { color: var(--accent-ink); }
.not-found .tools-group { text-align: left; }

.tools-group h2 {
  margin: 0 0 16px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tools-group-intro { margin: -6px 0 16px; font-size: 15px; color: var(--ink-2); }

/* plain Ace panes (YAML, XML, CSV, text) are the pane itself, without jsoneditor's wrapper */
.main-editor.ace_editor .ace_text-layer { color: var(--ed-ink); }

.text-content code,
.text-content .code-sample {
  font-family: var(--mono);
  font-size: .9em;
}

.text-content code {
  padding: 1px 5px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.text-content .code-sample {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: auto;
}

.text-content ol { margin: 0 0 16px; padding-left: 22px; }
.text-content ol li { padding-left: 6px; }
.text-content ol li::before { content: none; }

/* ---------- compare ---------- */

.status-state[data-diff="yes"] { color: var(--accent); }
.status-state[data-diff="yes"]::before { background: var(--accent); }

.diff-panel {
  scroll-margin-top: calc(var(--header-h) + 8px);
  margin: 0 20px;
  padding: 18px 0 8px;
  border-top: 1px solid var(--line);
}

.diff-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.diff-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.diff-counts { display: flex; flex-wrap: wrap; gap: 6px; }

.diff-chip,
.diff-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font: 500 11.5px/1.3 var(--mono);
  white-space: nowrap;
  --c: var(--muted);
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}

.is-added { --c: var(--ok); }
.is-removed { --c: var(--err); }
.is-changed { --c: var(--accent); }
.is-moved { --c: var(--tok-null); }

.diff-tabs {
  margin-left: auto;
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.diff-tabs button {
  padding: 6px 14px;
  border: 0;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.diff-tabs button + button { border-left: 1px solid var(--line-strong); }
.diff-tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }

#diff-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
#diff-list:has(.diff-none) { border: 0; background: none; }

.diff-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.diff-table th,
.diff-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.diff-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.diff-table tbody tr:last-child > * { border-bottom: 0; }
.diff-table tbody th { font-weight: 500; }
.diff-table code { font-family: var(--editor-font, var(--mono)); font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.diff-table tbody th code { color: var(--ink-2); }
.diff-table tr.is-added td:nth-child(3) code,
.diff-table tr.is-removed td:nth-child(4) code { color: var(--muted); }

.diff-none { margin: 0; padding: 14px 0; color: var(--muted); }

.diff-unchanged { margin-bottom: 10px; }

.diff-visual-body {
  max-height: 60vh;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
}

/* jsondiffpatch html formatter, recoloured to the site palette */
.diff-visual-body .jsondiffpatch-delta,
.diff-visual-body .jsondiffpatch-delta pre { font-family: var(--editor-font, var(--mono)); font-size: 12.5px; color: var(--ink); }
.diff-visual-body .jsondiffpatch-property-name { color: var(--tok-key); }
.diff-visual-body .jsondiffpatch-added .jsondiffpatch-property-name,
.diff-visual-body .jsondiffpatch-added .jsondiffpatch-value pre,
.diff-visual-body .jsondiffpatch-modified .jsondiffpatch-right-value pre,
.diff-visual-body .jsondiffpatch-textdiff-added { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.diff-visual-body .jsondiffpatch-deleted .jsondiffpatch-property-name,
.diff-visual-body .jsondiffpatch-deleted pre,
.diff-visual-body .jsondiffpatch-modified .jsondiffpatch-left-value pre,
.diff-visual-body .jsondiffpatch-textdiff-deleted { background: color-mix(in srgb, var(--err) 18%, transparent); }
.diff-visual-body .jsondiffpatch-moved .jsondiffpatch-moved-destination { background: color-mix(in srgb, var(--tok-null) 22%, transparent); }
.diff-visual-body .jsondiffpatch-unchanged,
.diff-visual-body .jsondiffpatch-movedestination { color: var(--muted); }
.diff-visual-body [hidden] { display: none !important; }

@media (max-width: 860px) {
  /* the menu button opens the tools as a sheet from under the header to the bottom of the screen;
     it scrolls on its own and the page behind stays put */
  .tools-menu {
    inset: var(--header-h) 0 0;
    width: auto;
    height: auto;
    max-height: none;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overscroll-behavior: contain;
  }
  .tools-menu:popover-open { grid-template-columns: 1fr 1fr; align-content: start; row-gap: 20px; }
  html:has(.tools-menu:popover-open) { overflow: hidden; }
  .tools-menu .is-format { display: flex; }
  .diff-panel { margin: 0 16px; }
  .diff-tabs { margin-left: 0; }
  .diff-table { min-width: 600px; }
  .diff-table th, .diff-table td { padding: 7px 8px; }
  .related { padding: 32px 16px 0; margin-bottom: 64px; }
  .tools-index { margin: 44px auto 64px; padding: 0 16px; }
}

@media (max-width: 560px) {
  .tools-menu:popover-open { grid-template-columns: 1fr; }
}

/* the JSON path at the cursor, in a code pane's status bar (workspace.js) */
.oj-path {
  float: right;
  max-width: 60%;
  margin-right: 8px;
  padding: 0 4px;
  overflow: hidden;
  border: 0;
  background: none;
  color: var(--ed-muted);
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: copy;
}

.oj-path:hover { color: var(--ed-ink); }
.oj-path:empty { display: none; }
