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

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

:root {
  --bg: #eef2f6;
  --sidebar-bg: #2f74b5;
  --sidebar-bg-dark: #245a8f;
  --sidebar-fg: #ffffff;
  --panel-bg: #ffffff;
  --panel-fg: #1c2530;
  --border: #d7dee6;
  --muted: #6b7c8f;
  --accent: #2f74b5;
  --danger: #c0392b;
  --ok: #2e7d32;
  --textarea-bg: #fafcfe;
  --status-bg: rgba(0, 0, 0, 0.08);
  --popover-bg: #ffffff;
  --shadow: rgba(15, 23, 42, 0.18);
  --bracket-0: #b45309;
  --bracket-1: #a21caf;
  --bracket-2: #1d4ed8;
  --bracket-3: #047857;
  --bracket-4: #ea580c;
  --bracket-5: #6d28d9;
  --syn-key: #0451a5;
  --syn-str: #a31515;
  --syn-num: #098658;
  --syn-bool: #0000ff;
  --syn-null: #af00db;
  --syn-comment: #008000;
}

body[data-theme="dark"] {
  --bg: #0f172a;
  --sidebar-bg: #0b1220;
  --sidebar-bg-dark: #111827;
  --sidebar-fg: #e2e8f0;
  --panel-bg: #111827;
  --panel-fg: #e5edf9;
  --border: #334155;
  --muted: #94a3b8;
  --accent: #60a5fa;
  --danger: #fca5a5;
  --ok: #86efac;
  --textarea-bg: #0b1220;
  --status-bg: rgba(148, 163, 184, 0.12);
  --popover-bg: #111827;
  --shadow: rgba(2, 6, 23, 0.7);
  --bracket-0: #fbbf24;
  --bracket-1: #e879f9;
  --bracket-2: #60a5fa;
  --bracket-3: #34d399;
  --bracket-4: #fb923c;
  --bracket-5: #a78bfa;
  --syn-key: #9cdcfe;
  --syn-str: #ce9178;
  --syn-num: #b5cea8;
  --syn-bool: #569cd6;
  --syn-null: #c586c0;
  --syn-comment: #6a9955;
}

/* Syntax color schemes ("Cores do JSON"). The light values apply to the
   light theme; the [data-theme="dark"] rule wins in the dark theme. */
body[data-syntax="github"] {
  --syn-key: #116329;
  --syn-str: #0a3069;
  --syn-num: #0550ae;
  --syn-bool: #cf222e;
  --syn-null: #8250df;
  --syn-comment: #6e7781;
}

body[data-theme="dark"][data-syntax="github"] {
  --syn-key: #7ee787;
  --syn-str: #a5d6ff;
  --syn-num: #79c0ff;
  --syn-bool: #ff7b72;
  --syn-null: #d2a8ff;
  --syn-comment: #8b949e;
}

body[data-syntax="monokai"] {
  --syn-key: #0e7c99;
  --syn-str: #7a6f00;
  --syn-num: #7c4dff;
  --syn-bool: #c25e00;
  --syn-null: #d0175a;
  --syn-comment: #8a8670;
}

body[data-theme="dark"][data-syntax="monokai"] {
  --syn-key: #66d9ef;
  --syn-str: #e6db74;
  --syn-num: #ae81ff;
  --syn-bool: #fd971f;
  --syn-null: #f92672;
  --syn-comment: #75715e;
}

body[data-syntax="dracula"] {
  --syn-key: #036a96;
  --syn-str: #846e15;
  --syn-num: #644ac9;
  --syn-bool: #a3144d;
  --syn-null: #a34d14;
  --syn-comment: #6c664b;
}

body[data-theme="dark"][data-syntax="dracula"] {
  --syn-key: #8be9fd;
  --syn-str: #f1fa8c;
  --syn-num: #bd93f9;
  --syn-bool: #ff79c6;
  --syn-null: #ffb86c;
  --syn-comment: #6272a4;
}

body[data-syntax="solarized"] {
  --syn-key: #1f6fb0;
  --syn-str: #1d7f78;
  --syn-num: #b52d70;
  --syn-bool: #627000;
  --syn-null: #ad3f11;
  --syn-comment: #7f8c8d;
}

body[data-theme="dark"][data-syntax="solarized"] {
  --syn-key: #268bd2;
  --syn-str: #2aa198;
  --syn-num: #d33682;
  --syn-bool: #859900;
  --syn-null: #cb4b16;
  --syn-comment: #93a1a1;
}

body[data-syntax="none"] {
  --syn-key: var(--panel-fg);
  --syn-str: var(--panel-fg);
  --syn-num: var(--panel-fg);
  --syn-bool: var(--panel-fg);
  --syn-null: var(--panel-fg);
  --syn-comment: var(--muted);
}

/* "Colchetes coloridos" off: brackets in the text color. Must come after
   the theme rules, which set the same variables with equal specificity. */
body[data-rainbow="off"] {
  --bracket-0: var(--panel-fg);
  --bracket-1: var(--panel-fg);
  --bracket-2: var(--panel-fg);
  --bracket-3: var(--panel-fg);
  --bracket-4: var(--panel-fg);
  --bracket-5: var(--panel-fg);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--panel-fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.app {
  display: flex;
  height: 100vh;
  min-height: 480px;
}

.sidebar {
  width: 260px;
  min-width: 220px;
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-dark));
  color: var(--sidebar-fg);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}

.theme-toggle {
  align-self: flex-start;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: var(--sidebar-fg);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

/* Offers the browser's language when the page is in another one. */
.lang-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  font-size: 12px;
  line-height: 1.4;
}

.lang-hint[hidden] { display: none; }

.lang-hint a {
  flex: 1;
  color: var(--sidebar-fg);
  font-weight: 600;
}

.lang-hint button {
  border: none;
  background: none;
  color: var(--sidebar-fg);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.lang-hint button:hover { opacity: 1; }

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

.field label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

.field select {
  appearance: none;
  background: var(--panel-bg);
  color: var(--panel-fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
}

.syntax-preview {
  margin-top: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--textarea-bg);
  color: var(--panel-fg);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
  accent-color: #ffffff;
}

.help-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  background: transparent;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.2);
}

.format-btn {
  margin-top: auto;
  background: var(--panel-bg);
  color: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.format-btn:hover {
  filter: brightness(1.05);
}

.status {
  font-size: 12px;
  line-height: 1.4;
  background: var(--status-bg);
  border-radius: 6px;
  padding: 8px 10px;
  white-space: pre-wrap;
}

.status.error { border-left: 3px solid #ffb4a8; }
.status.ok { border-left: 3px solid #a8e6a1; }

.history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-fg);
  opacity: 0.96;
  padding: 2px 2px 0;
}

.history-clear-btn {
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-fg);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.history-list::-webkit-scrollbar {
  width: 7px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

.history-item,
.history-empty {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--sidebar-fg);
  line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.history-item {
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.history-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(148, 163, 184, 0.32);
  transform: translateY(-1px);
}

.history-time {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.78);
}

.history-preview {
  font-size: 12px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  word-break: break-word;
  white-space: pre-wrap;
  color: rgba(255,255,255,0.92);
}

.history-empty {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.8);
}

.editor {
  flex: 1;
  padding: 20px;
  display: flex;
}

.panes {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-width: 0;
}

.pane {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.pane header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.copy-btn {
  border: 1px solid var(--border);
  background: var(--panel-bg);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--panel-fg);
}

.copy-btn:hover { filter: brightness(1.08); }

.pane-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

/* Output toolbar: search, then the path of the clicked/found item. */
.output-tools,
.path-bar,
.output-note {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.path-bar[hidden],
.output-note[hidden] { display: none; }

.output-tools select {
  padding: 3px 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-bg);
  color: var(--panel-fg);
  font: inherit;
}

.output-tools input {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--textarea-bg);
  color: var(--panel-fg);
  font: inherit;
}

.output-tools input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.search-count {
  color: var(--muted);
  white-space: nowrap;
}

.path-label {
  color: var(--muted);
  font-weight: 600;
}

.path-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--panel-fg);
}

.output-note {
  color: var(--muted);
  background: var(--status-bg);
}

/* Under each pane: what's selected in it. One line that's always there, so
   the pane doesn't change height while text is being selected. */
.selection-bar {
  flex-shrink: 0;
  padding: 4px 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 18px;
  color: var(--panel-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-bar.empty { color: var(--muted); }

.selection-part + .selection-part::before {
  content: " · ";
  color: var(--muted);
}

textarea,
.json-view,
.input-highlight {
  flex: 1;
  border: none;
  resize: none;
  padding: 14px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  outline: none;
  color: var(--panel-fg);
  background: var(--textarea-bg);
}

/* Input: the textarea text is transparent and .input-highlight, behind it,
   draws the same text with colored brackets. Both must lay out text the
   same way (font, padding, wrapping, tabs). */
.input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--textarea-bg);
}

.input-wrap textarea,
.input-highlight {
  tab-size: 4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  font-variant-ligatures: none;
}

.input-wrap textarea {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: var(--panel-fg);
}

.input-wrap textarea::placeholder { color: var(--muted); }
.input-wrap textarea::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* Over HIGHLIGHT_MAX_CHARS the textarea shows its own text, uncolored. */
.input-wrap.plain textarea { color: var(--panel-fg); }
.input-wrap.plain .input-highlight { display: none; }

/* Over LARGE_INPUT_CHARS the text isn't in the textarea; a summary is shown. */
.input-wrap.large textarea,
.input-wrap.large .input-highlight { display: none; }

.large-input {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.large-input[hidden] { display: none; }

.large-input p { margin: 0; }

.large-input-title {
  font-weight: 700;
  color: var(--panel-fg);
}

.input-wrap.dragging {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.input-highlight {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

.hl-bad {
  border-radius: 2px;
  background: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
}

.json-view {
  /* Own stacking context, so the .jv-cursor bar (z-index -1) sits between
     the background and the text. */
  isolation: isolate;
  overflow: auto;
  padding-left: 30px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}

.json-view:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.jv-line { position: relative; }

.jv-bracket {
  font-weight: 700;
  cursor: pointer;
}

.jv-depth-0 { color: var(--bracket-0); }
.jv-depth-1 { color: var(--bracket-1); }
.jv-depth-2 { color: var(--bracket-2); }
.jv-depth-3 { color: var(--bracket-3); }
.jv-depth-4 { color: var(--bracket-4); }
.jv-depth-5 { color: var(--bracket-5); }

.jv-key { color: var(--syn-key); }
.jv-str { color: var(--syn-str); }
.jv-num { color: var(--syn-num); }
.jv-bool { color: var(--syn-bool); }
.jv-null { color: var(--syn-null); }
.jv-comment { color: var(--syn-comment); }

/* Clicking a key or value shows its path. */
.json-view .jv-key:hover,
.json-view .jv-val:hover {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

/* Keyboard cursor: a bar behind the line's first row only (a .jv-line
   also holds its block's nested lines). */
.jv-cursor::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: -30px;
  right: -14px;
  height: 1.6em;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  pointer-events: none;
}

.json-view:focus-visible .jv-cursor::before {
  box-shadow: inset 2px 0 var(--accent);
}

.jv-match {
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  outline: 1.5px solid var(--accent);
}

/* "Mostrar mais": the rest of a big block, built on request. */
.jv-more { user-select: none; }

.jv-more-btn {
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 0 8px;
  background: var(--status-bg);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.jv-more-btn:hover { color: var(--panel-fg); }

/* The button itself is zero-width and inline so it never adds a line break
   to selected/copied text; only its arrow is drawn, out in the gutter. */
.jv-toggle {
  display: inline;
  width: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  user-select: none;
}

.jv-toggle::before {
  content: "\25BE";
  position: absolute;
  top: 0;
  left: -24px;
  width: 18px;
  height: 1.6em;
  line-height: 1.6em;
  text-align: center;
  border-radius: 3px;
  color: var(--muted);
}

.jv-collapsed > .jv-toggle::before { content: "\25B8"; }

.jv-toggle:hover::before,
.jv-toggle:focus-visible::before {
  color: var(--panel-fg);
  background: var(--status-bg);
}

.jv-toggle:focus-visible { outline: none; }

.jv-summary {
  display: none;
  margin: 0 4px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--status-bg);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}

.jv-collapsed > .jv-summary { display: inline; }
.jv-collapsed > .jv-children,
.jv-collapsed > .jv-close-indent { display: none; }

.popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--popover-bg);
  color: var(--panel-fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px var(--shadow);
  padding: 18px 20px;
  max-width: 340px;
  font-size: 13px;
  line-height: 1.5;
  z-index: 20;
}

.popover ul { margin: 8px 0; padding-left: 18px; }

.popover button {
  margin-top: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}

.json-view.has-error { padding-left: 14px; }

.jv-error {
  display: flex;
  flex-direction: column;
  gap: 10px;
  white-space: normal;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.jv-error-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
}

.jv-error-msg {
  font-size: 13px;
  line-height: 1.5;
}

.jv-error-note {
  font-size: 12px;
  color: var(--muted);
}

.jv-error-code {
  overflow-x: auto;
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-bg);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre;
}

.jv-error-row {
  width: max-content;
  min-width: 100%;
  padding: 0 12px;
}

.jv-error-line { background: color-mix(in srgb, var(--danger) 16%, transparent); }

.jv-error-num {
  margin-right: 14px;
  color: var(--muted);
  user-select: none;
}

.jv-error-char {
  border-radius: 2px;
  background: var(--danger);
  color: var(--panel-bg);
}

.jv-error-insert {
  border-radius: 2px;
  outline: 1.5px dashed var(--danger);
  outline-offset: 1px;
  background: color-mix(in srgb, var(--danger) 22%, transparent);
  color: var(--danger);
  font-weight: 700;
}

.jv-error-caret {
  color: var(--danger);
  font-weight: 700;
}

.jv-error-jump { align-self: flex-start; }

/* Shown above the formatted output when missing closers were added. The
   negative margin cancels the fold-arrow gutter of the output view. */
.jv-warning {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px -16px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  border-left-width: 3px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  white-space: normal;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.jv-warning-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--danger);
}

.jv-warning-hint {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
}

.jv-error-reformatted {
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--status-bg);
  font-size: 12px;
  line-height: 1.45;
}

.jv-error-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.jv-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.jv-error-apply {
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 600;
}

.jv-error-preview-title {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Formatted preview; the left padding is the gutter for the fold arrows. */
.jv-error-preview {
  padding-left: 16px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.jv-unclosed,
.jv-missing {
  border-radius: 2px;
  outline: 1.5px dashed var(--danger);
  outline-offset: 1px;
}

.jv-missing { background: color-mix(in srgb, var(--danger) 22%, transparent); }

.jv-missing-label,
.jv-expanded-label {
  margin-left: 10px;
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--danger);
  user-select: none;
}

.jv-expanded-label { color: var(--accent); }

@media (max-width: 720px) {
  .app { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; }
  .panes { grid-template-columns: 1fr; }
  .editor { padding: 12px; }
}

/* "Apoiar" (donations), at the bottom of the sidebar */
.donate-btn {
  align-self: stretch;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: var(--sidebar-fg);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.donate-btn:hover { background: rgba(255,255,255,0.18); }
.donate-btn[hidden] { display: none; }

/* "Comparar" and "Apoiar" dialogs */
.diff-dialog,
.donate-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--popover-bg);
  color: var(--panel-fg);
  box-shadow: 0 10px 30px var(--shadow);
  font-size: 13px;
}

.diff-dialog::backdrop,
.donate-dialog::backdrop { background: rgba(2, 6, 23, 0.45); }

.diff-dialog h2,
.donate-dialog h2 { margin: 0 0 6px; font-size: 16px; }
.diff-dialog p,
.donate-dialog p { margin: 0 0 10px; color: var(--muted); }

.donate-dialog { width: min(560px, calc(100vw - 32px)); }

.donate-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.donate-dialog.link-first #donateLinkBox { order: -1; }

.donate-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.donate-option[hidden] { display: none; }
.donate-option h3 { margin: 0; font-size: 14px; }
.donate-option p { margin: 0; }

.donate-qr {
  background: #fff;
  border-radius: 6px;
}

.donate-key code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  overflow-wrap: anywhere;
  color: var(--panel-fg);
}

.donate-link {
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.donate-link:hover { filter: brightness(1.08); }

.diff-dialog textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 160px;
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}

.diff-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.diff-run {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.diff-summary { color: var(--panel-fg) !important; }

.diff-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 40vh;
  overflow: auto;
  border-top: 1px solid var(--border);
}

.diff-item button {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  width: 100%;
  padding: 6px 4px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--panel-fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.diff-item button:hover { background: var(--status-bg); }

.diff-kind {
  min-width: 82px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.diff-added .diff-kind { color: var(--ok); }
.diff-removed .diff-kind { color: var(--danger); }
.diff-changed .diff-kind { color: var(--accent); }

.diff-path,
.diff-values {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.diff-values { color: var(--muted); }
