:root {
  color-scheme: light;
  --page: #f3f5fa;
  --surface: #fff;
  --surface-soft: #f9fafc;
  --surface-raised: #fff;
  --field: #f6f7fb;
  --edge: #e0e5ee;
  --edge-strong: #d5dce8;
  --text: #20243c;
  --muted: #565f76;
  --soft: #67738b;
  --gutter: #68748d;
  --accent: #5049c5;
  --accent-hover: #423ab4;
  --accent-soft: #eeedff;
  --on-accent: #fff;
  --focus: #6b63e3;
  --valid: #187151;
  --valid-bg: #eaf7ef;
  --invalid: #a83443;
  --invalid-bg: #fff0f1;
  --key: #454eb9;
  --string: #167354;
  --number: #a24b12;
  --literal: #a02f79;
  --code: #313951;
  --shadow: 0 14px 34px -24px rgb(39 48 98 / 30%), 0 1px 2px rgb(41 52 99 / 5%);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #111420;
  --surface: #191e2d;
  --surface-soft: #161b28;
  --surface-raised: #1e2435;
  --field: #252b40;
  --edge: #303951;
  --edge-strong: #414c66;
  --text: #eff0fa;
  --muted: #bbc2d7;
  --soft: #a1abc6;
  --gutter: #96a1bd;
  --accent: #a69dff;
  --accent-hover: #bdb6ff;
  --accent-soft: #302951;
  --on-accent: #171234;
  --focus: #b8afff;
  --valid: #80deb0;
  --valid-bg: #1b382f;
  --invalid: #ffa5ae;
  --invalid-bg: #432631;
  --key: #a9b4ff;
  --string: #7bd9b4;
  --number: #f0af7d;
  --literal: #ed9bd0;
  --code: #d8def0;
  --shadow: 0 18px 42px -28px rgb(0 0 0 / 60%);
}

* {
  box-sizing: border-box;
}

:root [hidden] {
  display: none;
}

html {
  min-width: 280px;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 1rem / 1.5 var(--font);
}

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

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .46;
}

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

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.workspace {
  display: flex;
  height: 100vh;
  height: 100svh;
  min-height: 240px;
  flex-direction: column;
  background: var(--surface);
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: .875rem;
  font-weight: 620;
  line-height: 1.2;
  white-space: nowrap;
}

.button--quiet {
  color: var(--muted);
}

.button--quiet:not(:disabled):hover,
.button--icon:not(:disabled):hover {
  background: var(--field);
  color: var(--text);
}

.button--secondary,
.button--icon {
  border-color: var(--edge-strong);
  background: var(--surface);
  color: var(--text);
}

.button--secondary:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.button--primary:not(:disabled):hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button--icon {
  width: 36px;
  padding: 0;
}

.workbench {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  background: var(--surface);
}

.validation {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--field);
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 680;
  white-space: nowrap;
}

.validation .icon {
  width: 15px;
  height: 15px;
}

.validation[data-state='valid'] {
  background: var(--valid-bg);
  color: var(--valid);
}

.validation[data-state='failed'],
.validation[data-state='invalid'] {
  background: var(--invalid-bg);
  color: var(--invalid);
}

.validation[data-state='empty'] .icon,
.validation[data-state='pending'] .icon {
  display: none;
}

.validation[data-state='empty'] {
  display: none;
}

.type-toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .875rem;
  white-space: nowrap;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap select {
  min-height: 32px;
  padding: 3px 30px 3px 10px;
  appearance: none;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 580;
}

.select-wrap .icon {
  position: absolute;
  right: 9px;
  width: 13px;
  height: 13px;
  color: var(--soft);
}

.button[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent);
}

.editors {
  --splitter-size: 5px;
  display: grid;
  min-width: 0;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, var(--pane-first, 1fr)) var(--splitter-size) minmax(0, var(--pane-last, 1fr));
}

.editors[data-layout='stacked'] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, var(--pane-first, 1fr)) var(--splitter-size) minmax(0, var(--pane-last, 1fr));
}

.editor-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.editor-panel[data-pane='source'] {
  grid-area: 1 / 1;
}

.editor-panel[data-pane='output'] {
  grid-area: 1 / 3;
}

.splitter {
  position: relative;
  z-index: 1;
  min-width: var(--splitter-size);
  min-height: var(--splitter-size);
  padding: 0;
  grid-area: 1 / 2;
  border: 0;
  background: var(--edge);
  cursor: col-resize;
  touch-action: none;
}

.splitter:hover,
.splitter:focus-visible,
.splitter:active {
  background: var(--accent);
  outline: 0;
}

.editors[data-layout='stacked'] > .splitter {
  grid-area: 2 / 1;
  cursor: row-resize;
}

.editors[data-layout='stacked'] > .editor-panel[data-pane='output'] {
  grid-area: 3 / 1;
}

.pane-toolbar,
.pane-query {
  display: flex;
  min-width: 0;
  flex: none;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-inline: 7px;
  border-bottom: 1px solid var(--edge);
  scrollbar-width: none;
}

.pane-toolbar {
  min-height: 37px;
  background: var(--surface-soft);
}

.pane-query {
  min-height: 36px;
  background: var(--surface);
}

.pane-toolbar .pane-actions,
.pane-query .pane-actions,
.footer-group,
.footer-settings {
  display: flex;
  min-width: 0;
  flex: none;
  align-items: center;
  gap: 2px;
}

.toolbar-divider {
  width: 1px;
  height: 17px;
  flex: none;
  background: var(--edge-strong);
}

.tool-button {
  display: inline-grid;
  width: 31px;
  min-width: 31px;
  height: 29px;
  min-height: 29px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}

.tool-button .icon {
  width: 16px;
  height: 16px;
}

.tool-button:not(:disabled):hover {
  border-color: var(--edge);
  background: var(--field);
  color: var(--text);
}

.tool-button[aria-expanded='true'],
.tool-button[aria-pressed='true'],
.tool-button:has(:checked) {
  border-color: var(--edge);
  background: var(--accent-soft);
  color: var(--accent);
}

.view-tabs {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
}

.view-tab {
  min-height: 27px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 590;
  line-height: 1.25;
  white-space: nowrap;
}

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

.view-tab[aria-selected='true'] {
  border-color: var(--edge);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 730;
}

.result-body,
.result-view {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.result-view {
  overflow: auto;
}

.editor-surface {
  --gutter-min: 48px;
  --gutter-width: var(--gutter-min);
  --editor-inset: 9px;
  --row-height: var(--editor-line-height, 23px);
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  color: var(--code);
  font-family: var(--mono);
  font-size: var(--editor-font-size, 14px);
  font-variant-ligatures: none;
  line-height: var(--row-height);
  tab-size: 4;
}

.editor-gutter {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--gutter-width);
  overflow: hidden;
  border-right: 1px solid var(--edge);
  background: var(--surface-soft);
  color: var(--gutter);
  pointer-events: none;
  text-align: right;
  user-select: none;
}

.editor-gutter-lines {
  padding-right: 11px;
  font-size: .75rem;
}

.editor-gutter-lines div {
  height: var(--row-height);
}

.editor-gutter-lines .gutter-error {
  background: var(--invalid-bg);
  color: var(--invalid);
  font-weight: 700;
}

.editor-highlight,
.editor-input {
  position: absolute;
  inset: 0 0 0 var(--gutter-width);
  display: block;
  width: calc(100% - var(--gutter-width));
  height: 100%;
  margin: 0;
  padding: var(--editor-inset) 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-variant-ligatures: inherit;
  letter-spacing: inherit;
  tab-size: inherit;
  white-space: pre;
}

.editor-highlight {
  overflow: hidden;
  pointer-events: none;
}

.editor-input {
  overflow: auto;
  color: var(--code);
  outline: 0;
  resize: none;
}

.editor-input:focus-visible {
  box-shadow: inset 0 0 0 2px var(--focus);
  outline: 0;
}

.editor-input::placeholder {
  color: var(--soft);
}

.editor-surface[data-highlight='true'] .editor-input {
  color: transparent;
  caret-color: var(--code);
}

.editor-input::selection {
  background: rgb(119 109 237 / 28%);
}

.syntax-key,
.tree-key,
.graph-key {
  color: var(--key);
}

.syntax-string,
[data-kind='string'] {
  color: var(--string);
}

.syntax-number,
[data-kind='number'] {
  color: var(--number);
}

.syntax-literal,
[data-kind='boolean'],
[data-kind='null'] {
  color: var(--literal);
}

.error-detail {
  display: flex;
  min-height: 34px;
  flex: none;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border: 0;
  border-top: 1px solid var(--edge);
  background: var(--invalid-bg);
  color: var(--invalid);
  font-size: .8125rem;
  text-align: left;
}

.error-detail .icon {
  width: 15px;
  height: 15px;
}

.pane-query .error-detail {
  min-width: 0;
  min-height: 27px;
  max-width: min(44%, 340px);
  flex: 0 1 auto;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--edge);
  border-radius: 5px;
  white-space: nowrap;
}

.pane-query .error-detail span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pane-query:has(.error-detail:not([hidden])) .validation {
  display: none;
}

.panel-empty {
  display: flex;
  min-height: 140px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  color: var(--soft);
  font-size: .875rem;
  text-align: center;
}

.panel-empty p {
  margin: 0;
  color: var(--text);
  font-size: .975rem;
  font-weight: 680;
}

.empty-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 7px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-icon .icon {
  width: 21px;
  height: 21px;
}

.type-toolbar {
  display: flex;
  flex: none;
  padding: 8px 13px;
  border-bottom: 1px solid var(--edge);
}

.workspace-footer {
  display: flex;
  min-height: 37px;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 7px;
  border-top: 1px solid var(--edge);
  background: var(--surface-soft);
  color: var(--soft);
  font-size: .8125rem;
  scrollbar-width: none;
}

.footer-group,
.footer-settings {
  gap: 5px;
  white-space: nowrap;
}

.footer-settings {
  margin-inline-start: auto;
}

.footer-select {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 4px;
  padding-inline: 5px 2px;
  border: 1px solid var(--edge);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
}

.footer-select .icon {
  width: 15px;
  height: 15px;
}

.footer-select select {
  min-height: 25px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: .8125rem;
  cursor: pointer;
}

.privacy-note {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--valid);
  white-space: nowrap;
}

.privacy-note .icon {
  width: 15px;
  height: 15px;
}

.workspace-guide {
  width: min(100% - 48px, 760px);
  margin-inline: auto;
  padding-block: 48px 36px;
  overflow-wrap: anywhere;
}

.workspace-guide h1 {
  margin: 0 0 11px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.25;
}

.workspace-guide h2 {
  margin-block: 24px 8px;
  font-size: 1.125rem;
}

.workspace-guide p,
.workspace-guide ul {
  margin-block: 8px;
  color: var(--muted);
}

.workspace-guide details {
  padding: 11px 0;
  border-bottom: 1px solid var(--edge);
}

.workspace-guide summary {
  cursor: pointer;
  font-weight: 650;
}

.guide-footer {
  margin-top: 30px;
  color: var(--soft);
  font-size: .8125rem;
}

kbd {
  min-width: 20px;
  padding: 1px 4px;
  border: 1px solid var(--edge-strong);
  border-radius: 4px;
  background: var(--surface);
  font: .75rem / 1.25 var(--mono);
  text-align: center;
}

.drop-cover {
  position: absolute;
  z-index: 2;
  inset: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 2px dashed var(--accent);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  pointer-events: none;
  text-align: center;
}

.drop-cover .icon {
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
}

.dialog {
  width: min(480px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: 0;
  border: 1px solid var(--edge-strong);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 24px 65px -20px rgb(9 15 42 / 32%);
  color: var(--text);
}

.dialog::backdrop {
  background: rgb(25 29 51 / 38%);
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--edge);
}

.dialog-heading h2 {
  margin: 0;
  font-size: 1.125rem;
}

.dialog-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .875rem;
}

.history-drawer {
  z-index: 3;
  display: flex;
  width: 208px;
  min-width: 0;
  min-height: 0;
  flex: none;
  flex-direction: column;
  border-right: 1px solid var(--edge);
  background: var(--surface-raised);
}

.history-toolbar {
  display: flex;
  min-height: 37px;
  flex: none;
  align-items: center;
  gap: 2px;
  padding-inline: 5px;
  border-bottom: 1px solid var(--edge);
  background: var(--surface-soft);
}

.history-toolbar .tool-button:last-child {
  margin-inline-start: auto;
}

.history-intro {
  padding: 10px 9px;
  border-bottom: 1px solid var(--edge);
  background: var(--accent-soft);
}

.history-intro h2 {
  margin: 0;
  color: var(--accent);
  font-size: .9375rem;
}

.history-intro p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.history-items {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow: auto;
  padding: 7px;
}

.history-items > p {
  margin: auto;
  color: var(--muted);
  font-size: .875rem;
  text-align: center;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.history-entry {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.history-entry:hover {
  background: var(--field);
}

.history-entry > span {
  min-width: 0;
  flex: 1;
}

.history-entry strong,
.history-entry small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-entry strong {
  font-size: .875rem;
}

.history-entry small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .75rem;
}

.history-item > .button {
  margin-right: 4px;
}

.dialog-footer,
.share-content {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
}

.dialog-footer {
  justify-content: end;
  border-top: 1px solid var(--edge);
}

.share-url {
  min-width: 0;
  flex: 1;
  padding-inline: 9px;
  border: 1px solid var(--edge-strong);
  border-radius: 7px;
  background: var(--field);
  color: var(--text);
  font: .875rem var(--mono);
}

.toast {
  position: fixed;
  z-index: 4;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  padding: 11px 15px;
  border: 1px solid var(--edge-strong);
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: 0 8px 28px -16px rgb(18 24 59 / 45%);
  color: var(--text);
  font-size: .875rem;
}

.tree-view,
.graph-view,
.table-view {
  padding: 13px 15px;
}

.tree-view,
.graph-view,
.table-value {
  font: .875rem / 1.6 var(--mono);
}

.tree-row,
.graph-heading,
.table-preview > summary {
  min-width: 0;
}

.tree-row {
  display: flex;
  min-height: 27px;
  align-items: baseline;
  gap: 6px;
  padding-inline: 6px;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

summary.tree-row,
summary.graph-card,
.table-preview > summary {
  cursor: pointer;
}

summary.tree-row:hover,
summary.graph-card:hover {
  background: var(--field);
}

.tree-disclosure {
  width: 11px;
  flex: none;
  color: var(--soft);
}

.tree-branch > .tree-row .tree-disclosure::before,
summary.graph-card .graph-heading::before {
  color: var(--accent);
  content: '›';
  font-weight: 700;
}

.tree-branch[open] > .tree-row .tree-disclosure::before,
.graph-branch[open] > summary.graph-card .graph-heading::before {
  display: inline-block;
  transform: rotate(90deg);
}

.tree-meta,
.tree-punctuation,
.table-note,
.table-footer,
.table-missing,
.table-type,
.graph-kind {
  color: var(--soft);
}

.tree-children {
  margin-left: 12px;
  padding-left: 10px;
  border-left: 1px solid var(--edge);
}

.tree-table > .table-view {
  padding: 5px 0 8px;
}

.tree-more,
.table-page-button,
.graph-more {
  padding: 3px 8px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: .8125rem;
}

.tree-more:hover,
.table-page-button:not(:disabled):hover,
.graph-more:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: 8px;
}

.table-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  text-align: left;
}

.table-grid th,
.table-grid td {
  min-width: 52px;
  max-width: 320px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--edge);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.table-grid thead {
  background: var(--surface-soft);
}

.table-grid tbody tr:last-child > * {
  border-bottom: 0;
}

.table-index,
.table-footer,
.table-note {
  font-size: .8125rem;
}

.table-index {
  color: var(--muted);
}

.table-footer,
.table-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-footer {
  justify-content: space-between;
  margin-top: 8px;
}

.table-note {
  margin: 0 0 8px;
}

.graph-view {
  padding: 17px;
}

.graph-card {
  display: block;
  width: fit-content;
  min-width: min(220px, 100%);
  max-width: 100%;
  margin-bottom: 9px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: var(--surface-soft);
}

.graph-card > .graph-value {
  display: block;
  padding: 0 9px 7px;
  overflow-wrap: anywhere;
}

.graph-content {
  margin: 0 0 8px 8px;
}

.graph-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.graph-path {
  font-weight: 720;
}

.graph-kind {
  font-size: .75rem;
}

.graph-fields {
  margin: 0;
  padding: 5px 9px;
  border-top: 1px solid var(--edge);
}

.graph-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  overflow-wrap: anywhere;
}

.graph-field dd {
  margin: 0;
}

.graph-value {
  margin: 0;
}

.graph-children {
  margin: 0 0 6px 8px;
  padding-left: 14px;
  border-left: 1px solid var(--edge-strong);
}

.query-form {
  display: flex;
  min-width: 80px;
  flex: 1;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: .8125rem;
}

.query-label {
  display: inline-flex;
  flex: none;
  align-items: center;
  margin-inline: 1px 3px;
}

.query-label .icon {
  width: 15px;
  height: 15px;
}

.query-submit {
  border-color: var(--edge);
  background: var(--field);
}

.comment-toggle {
  position: relative;
  cursor: pointer;
}

.comment-toggle:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.comment-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  clip-path: inset(50%);
}

.utility-input {
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid var(--edge-strong);
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--text);
  font: .8125rem / 1.4 var(--mono);
}

.query-form input {
  min-height: 27px;
  flex: 1;
}

.shortcut-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 15px 20px 20px;
}

.shortcut-list > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 12px;
}

.shortcut-list dd {
  margin: 0;
  color: var(--muted);
}

.compare-dialog {
  width: min(650px, calc(100% - 28px));
}

.compare-form {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 14px 20px;
}

.compare-input {
  width: 100%;
  min-height: 106px;
  resize: vertical;
}

.compare-result {
  max-height: min(34vh, 360px);
  overflow: auto;
  padding: 0 20px;
}

.compare-result:not(:empty) {
  margin-bottom: 15px;
}

.compare-result p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .875rem;
}

.compare-result ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compare-result li {
  display: grid;
  gap: 3px;
  padding: 5px 8px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.compare-result code {
  color: var(--code);
  font: .8125rem / 1.5 var(--mono);
}

.compare-result li:has([data-change='added']) {
  background: var(--valid-bg);
}

.compare-result li:has([data-change='removed']) {
  background: var(--invalid-bg);
}

@media (max-width: 760px) {
  .history-drawer {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(250px, calc(100% - 24px));
    box-shadow: var(--shadow);
  }

  .privacy-note span,
  .desktop-only {
    display: none;
  }

  .workspace-footer {
    justify-content: start;
  }

  .pane-toolbar,
  .pane-query {
    gap: 3px;
    padding-inline: 4px;
  }

  .tool-button {
    width: 29px;
    min-width: 29px;
  }

  .view-tab {
    padding-inline: 5px;
  }

  .editor-surface {
    --gutter-min: 38px;
  }

  .editor-gutter-lines {
    padding-right: 7px;
  }

  .editor-input,
  .editor-highlight {
    padding-inline: 9px;
  }
}

@media (max-width: 420px) {
  .workspace-guide {
    width: calc(100% - 28px);
    padding-block: 30px;
  }

  .validation {
    min-height: 24px;
    gap: 3px;
    padding-inline: 4px;
    font-size: .75rem;
  }

  .validation .icon {
    width: 12px;
    height: 12px;
  }
}

.clipboard-scratch {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}
