:root {
  color-scheme: light;
  --window: #eeeeee;
  --chrome: #f2f2f2;
  --panel: #ffffff;
  --panel-hover: #f5f5f5;
  --text: #242424;
  --muted: #777777;
  --faint: #a4a4a4;
  --border: #d7d7d7;
  --border-light: #e8e8e8;
  --button: #ffffff;
  --button-hover: #f0f0f0;
  --primary-bg: #eaf3fc;
  --primary-border: #bad5ef;
  --primary-text: #2269aa;
  --accent: #2378c5;
  --valid: #34875c;
  --invalid: #c64b3f;
  --json-key: #246d9f;
  --json-string: #18845d;
  --json-number: #a16a13;
  --json-boolean: #8751a8;
  --json-null: #b34e62;
  --source-bg: #ffffff;
  --source-toolbar: #f2f2f2;
  --source-button: #ffffff;
  --source-button-hover: #ececec;
  --source-border: #d2d2d2;
  --source-text: #202020;
  --source-muted: #5f646b;
  --source-key: #075f9e;
  --source-string: #087444;
  --source-number: #8a5200;
  --source-boolean: #74358f;
  --source-null: #9d3045;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-code: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --window: #202020;
  --chrome: #292929;
  --panel: #1d1d1d;
  --panel-hover: #292929;
  --text: #e7e7e7;
  --muted: #a2a2a2;
  --faint: #737373;
  --border: #414141;
  --border-light: #343434;
  --button: #292929;
  --button-hover: #353535;
  --primary-bg: #20374c;
  --primary-border: #355a79;
  --primary-text: #9bc8f1;
  --accent: #67aef0;
  --valid: #72c498;
  --invalid: #ef8b80;
  --json-key: #79b9e8;
  --json-string: #70cda7;
  --json-number: #e0b46b;
  --json-boolean: #c3a0df;
  --json-null: #e498a7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--text);
  background: var(--window);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button,
select,
textarea {
  font: inherit;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button:disabled {
  cursor: default;
  opacity: 0.4;
}

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

.icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-window {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  gap: 6px;
  padding: 7px 8px 8px;
}

.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 4px;
}

.page-name-control {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pageNameInput {
  width: min(320px, 34vw);
  height: 25px;
  margin: 0;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  text-overflow: ellipsis;
}

#pageNameInput:not([readonly]) {
  border-color: var(--accent);
  background: var(--panel);
  text-overflow: clip;
}

.rename-button {
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 1px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  opacity: 0.65;
}

.rename-button:hover {
  color: var(--text);
  background: var(--button-hover);
  opacity: 1;
}

.rename-button .icon {
  width: 11px;
  height: 11px;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.local-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.local-label > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--valid);
}

.icon-button,
.text-button,
.tool-button,
.view-button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--button-hover);
}

.icon-button:active,
.text-button:active,
.tool-button:active,
.view-button:active {
  transform: translateY(1px);
}

.theme-toggle {
  width: 25px;
  height: 25px;
}

.theme-toggle .icon {
  width: 13px;
  height: 13px;
}

.sun-icon,
html[data-theme='dark'] .moon-icon {
  display: none;
}

html[data-theme='dark'] .sun-icon {
  display: block;
}

.workspace-frame {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 25px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}

.split-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, var(--left-width)) 8px minmax(0, 1fr);
  overflow: hidden;
}

.panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
}

.source-panel {
  background: var(--source-bg);
}

.source-toolbar {
  color: var(--source-text);
  border-bottom-color: var(--source-border);
  background: var(--source-toolbar);
}

.source-toolbar .tool-button,
.source-toolbar .text-button {
  color: var(--source-text);
  border-color: var(--source-border);
  background: var(--source-button);
}

.source-toolbar .tool-button:hover,
.source-toolbar .text-button:hover {
  background: var(--source-button-hover);
}

.source-toolbar .tool-button-primary {
  color: #155f99;
  border-color: #b5d0e8;
  background: #e8f2fb;
}

.source-toolbar .text-button,
.source-toolbar .source-icon-button {
  color: var(--source-muted);
}

.source-toolbar .source-icon-button:hover {
  color: var(--source-text);
  border-color: var(--source-border);
  background: var(--source-button-hover);
}

.search-bar {
  height: 32px;
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--source-border);
  color: var(--source-muted);
  background: #f7f7f7;
}

.search-bar[hidden] {
  display: none;
}

.search-bar > .icon {
  width: 13px;
  height: 13px;
}

#searchInput {
  width: min(260px, 45%);
  height: 23px;
  padding: 0 7px;
  border: 1px solid var(--source-border);
  border-radius: 4px;
  outline: 0;
  color: #202020;
  background: #ffffff;
  font-family: var(--font-ui);
  font-size: 10px;
}

#searchInput:focus {
  border-color: var(--accent);
}

#searchInput::-webkit-search-cancel-button {
  display: none;
}

.search-count {
  min-width: 38px;
  color: #626262;
  font-family: var(--font-code);
  font-size: 8px;
  text-align: center;
}

.search-nav-button {
  width: 23px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #555555;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.search-nav-button:hover {
  border-color: var(--source-border);
  color: #111111;
  background: #ffffff;
}

.search-close-button {
  margin-left: 2px;
  font-size: 16px;
}

.panel-toolbar {
  position: relative;
  z-index: 3;
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-bottom: 1px solid var(--border);
  background: var(--chrome);
}

.panel-label {
  flex: 0 0 auto;
  margin: 0 3px 0 0;
  font-size: 11px;
  font-weight: 600;
}

.toolbar-actions,
.result-actions {
  display: flex;
  align-items: center;
}

.toolbar-actions {
  gap: 4px;
}

.utility-actions,
.result-actions {
  margin-left: auto;
}

.tool-button,
.text-button {
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  background: var(--button);
  font-size: 10px;
  white-space: nowrap;
}

.tool-button:hover,
.text-button:hover {
  background: var(--button-hover);
}

.tool-button .icon,
.text-button .icon {
  width: 12px;
  height: 12px;
}

.tool-button-primary {
  color: var(--primary-text);
  border-color: var(--primary-border);
  background: var(--primary-bg);
}

.tool-button-primary:hover,
.tool-button.is-running {
  background: color-mix(in srgb, var(--primary-bg) 78%, var(--accent));
}

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

.view-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--button);
}

.view-button {
  height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
}

.view-button .icon {
  width: 11px;
  height: 11px;
}

.view-button:hover {
  color: var(--text);
  background: var(--button-hover);
}

.view-button.active {
  color: var(--text);
  background: var(--panel-hover);
}

.indent-control {
  position: relative;
  flex: 0 0 auto;
}

.indent-control select {
  height: 27px;
  padding: 0 23px 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: 0;
  color: var(--text);
  background: var(--button);
  font-size: 9px;
  appearance: none;
  cursor: pointer;
}

.indent-control .icon {
  position: absolute;
  top: 7px;
  right: 6px;
  width: 11px;
  height: 11px;
  color: var(--muted);
  pointer-events: none;
}

.result-actions {
  gap: 2px;
}

.result-actions .icon-button {
  width: 27px;
  height: 27px;
}

.copy-button {
  margin-left: 2px;
}

.editor-shell {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: var(--source-bg);
}

.editor-code-area {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.highlight-layer,
#jsonInput {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 12px 16px 24px;
  border: 0;
  border-radius: 0;
  font-family: var(--font-code);
  font-size: 12px;
  font-weight: 500;
  font-variant-ligatures: none;
  line-height: 18px;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
  scrollbar-gutter: stable;
}

.highlight-layer {
  z-index: 1;
  width: calc(100% - 9px);
  overflow: hidden;
  color: var(--source-text);
  background: var(--source-bg);
  pointer-events: none;
}

.highlight-layer code {
  min-height: 100%;
  display: block;
  font: inherit;
  will-change: transform;
}

.highlight-layer .token-key { color: var(--source-key); }
.highlight-layer .token-string { color: var(--source-string); }
.highlight-layer .token-number { color: var(--source-number); }
.highlight-layer .token-boolean { color: var(--source-boolean); }
.highlight-layer .token-null { color: var(--source-null); font-style: italic; }
.highlight-layer .token-brace,
.highlight-layer .token-punctuation { color: var(--source-muted); }

.search-match {
  padding: 0;
  border-radius: 2px;
  color: #1f1f1f;
  background: #ffe28a;
}

.search-match.is-current {
  background: #ffb64d;
  box-shadow: 0 0 0 1px #d88a20;
}

#jsonInput {
  z-index: 2;
  resize: none;
  outline: 0;
  color: transparent;
  background: transparent;
  caret-color: #111111;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-text-fill-color: transparent;
}

#jsonInput::selection {
  color: transparent;
  background: rgba(111, 168, 220, 0.3);
  -webkit-text-fill-color: transparent;
}

#jsonInput::-webkit-scrollbar,
.tree-view::-webkit-scrollbar,
.code-view::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

#jsonInput::-webkit-scrollbar-track,
.tree-view::-webkit-scrollbar-track,
.code-view::-webkit-scrollbar-track {
  background: transparent;
}

#jsonInput::-webkit-scrollbar-thumb,
.tree-view::-webkit-scrollbar-thumb,
.code-view::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 8px;
  background: var(--faint);
  background-clip: padding-box;
}

.editor-watermark {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: none;
  flex-direction: column;
  gap: 6px;
  transform: translate(-50%, -50%);
  color: var(--source-muted);
  text-align: center;
  pointer-events: none;
}

.editor-watermark.visible {
  display: flex;
}

.editor-watermark strong {
  color: var(--source-text);
  font-size: 12px;
  font-weight: 500;
}

.editor-watermark span {
  font-size: 9px;
}

.drop-overlay {
  position: absolute;
  z-index: 8;
  inset: 40px 0 0;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(3px);
}

.drop-overlay.visible {
  visibility: visible;
  opacity: 1;
}

.source-panel .drop-overlay {
  background: rgba(255, 255, 255, 0.9);
}

.drop-overlay > div {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 24px;
  border: 1px dashed var(--accent);
  border-radius: 5px;
  color: var(--source-text);
  border-color: #6f7d8c;
  background: var(--source-toolbar);
  font-size: 11px;
}

.drop-overlay .icon {
  color: var(--accent);
}

.splitter {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
  background: var(--chrome);
}

.splitter-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--border);
}

.splitter-handle {
  position: relative;
  width: 7px;
  height: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--button);
}

.splitter-handle i {
  width: 1px;
  height: 1px;
  border-radius: 50%;
  background: var(--muted);
}

.splitter:hover .splitter-handle,
.splitter:focus-visible .splitter-handle,
body.is-resizing .splitter-handle {
  border-color: var(--accent);
}

body.is-resizing,
body.is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.result-canvas {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: var(--panel);
}

.result-view {
  position: absolute;
  inset: 0;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.result-view.active {
  display: block;
}

.tree-view {
  padding: 8px 14px 20px 9px;
  font-family: var(--font-code);
  font-size: 11px;
  line-height: 18px;
}

.tree-node {
  margin: 0;
}

.tree-node > summary {
  position: relative;
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: calc(var(--depth, 0) * 14px);
  padding: 1px 5px 1px 18px;
  border-radius: 3px;
  list-style: none;
  cursor: pointer;
}

.tree-node > summary::-webkit-details-marker {
  display: none;
}

.tree-node > summary::before {
  content: '';
  position: absolute;
  left: 6px;
  width: 5px;
  height: 5px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: rotate(-45deg);
}

.tree-node[open] > summary::before {
  transform: rotate(45deg) translate(-1px, -1px);
}

.tree-node > summary:hover,
.tree-leaf:hover,
.output-line:hover {
  background: var(--panel-hover);
}

.tree-children {
  position: relative;
}

.tree-children::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 4px;
  left: calc(var(--depth, 0) * 14px + 11px);
  width: 1px;
  background: var(--border-light);
}

.tree-leaf {
  min-height: 20px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-left: calc(var(--depth, 0) * 14px);
  padding: 1px 5px 1px 24px;
  border-radius: 3px;
}

.tree-closing {
  min-height: 18px;
  display: flex;
  align-items: center;
  margin-left: calc(var(--depth, 0) * 14px);
  padding: 0 5px 0 24px;
  color: var(--muted);
}

.tree-empty {
  color: var(--muted);
  font-style: italic;
}

.tree-key {
  min-width: 0;
  flex: 0 1 auto;
  color: var(--json-key);
  overflow-wrap: anywhere;
}

.tree-key.root-key,
.tree-colon,
.tree-comma,
.tree-bracket {
  color: var(--muted);
}

.tree-comma {
  padding-left: 1px;
}

.tree-type {
  margin-left: 2px;
  padding: 0 4px;
  border-radius: 3px;
  color: var(--muted);
  background: var(--panel-hover);
  font-family: var(--font-ui);
  font-size: 7px;
  line-height: 14px;
}

.tree-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tree-value.string { color: var(--json-string); }
.tree-value.number { color: var(--json-number); }
.tree-value.boolean { color: var(--json-boolean); }
.tree-value.null { color: var(--json-null); font-style: italic; }

.code-view {
  padding: 8px 0 20px;
  color: var(--text);
  font-family: var(--font-code);
  font-size: 11px;
  line-height: 18px;
}

.output-line {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: 18px;
}

.output-line-number {
  padding-right: 11px;
  color: var(--faint);
  text-align: right;
  user-select: none;
}

.output-line-code {
  min-width: 0;
  padding-right: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.code-view .token-key { color: var(--json-key); }
.code-view .token-string { color: var(--json-string); }
.code-view .token-number { color: var(--json-number); }
.code-view .token-boolean { color: var(--json-boolean); }
.code-view .token-null { color: var(--json-null); font-style: italic; }
.code-view .token-brace,
.code-view .token-punctuation { color: var(--muted); }

.empty-result,
.error-result {
  position: absolute;
  inset: 0;
  display: none;
  align-content: center;
  justify-items: center;
  padding: 24px;
  color: var(--muted);
  background: var(--panel);
  text-align: center;
}

.empty-result.visible,
.error-result.visible {
  display: grid;
}

.empty-braces {
  margin-bottom: 10px;
  color: var(--faint);
  font-family: var(--font-code);
  font-size: 20px;
}

.empty-result strong,
.error-result strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.empty-result p,
.error-result p {
  max-width: 440px;
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.5;
}

.error-icon {
  width: 22px;
  height: 22px;
  margin-bottom: 10px;
  color: var(--invalid);
}

.error-result strong,
.error-result .error-location {
  color: var(--invalid);
}

.error-location {
  margin-top: 9px;
  font-family: var(--font-code);
  font-size: 9px;
}

.error-location:empty {
  display: none;
}

.statusbar {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 0 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: var(--chrome);
  font-size: 8px;
}

.validation-status,
.document-stats,
.privacy-note {
  display: flex;
  align-items: center;
}

.validation-status {
  gap: 6px;
  font-weight: 500;
}

.status-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.validation-status.is-valid {
  color: var(--valid);
}

.validation-status.is-valid .status-indicator {
  background: var(--valid);
}

.validation-status.is-invalid {
  color: var(--invalid);
}

.validation-status.is-invalid .status-indicator {
  background: var(--invalid);
}

.document-stats {
  gap: 8px;
  white-space: nowrap;
}

.document-stats i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--faint);
}

.privacy-note {
  justify-self: end;
  gap: 4px;
  white-space: nowrap;
}

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

.cursor-position {
  padding-left: 10px;
  border-left: 1px solid var(--border);
  font-family: var(--font-code);
  white-space: nowrap;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  visibility: hidden;
  opacity: 0;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 10px;
  transform: translateY(5px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.toast.visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  color: #ffffff;
  background: var(--valid);
}

.toast-icon .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.toast.is-error .toast-icon {
  background: var(--invalid);
}

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

@media (max-width: 1180px) {
  .panel-toolbar {
    gap: 5px;
    padding-inline: 6px;
  }

  .tool-button,
  .text-button {
    padding-inline: 6px;
  }

  .tool-button .icon,
  .text-button .icon {
    display: none;
  }

  .tree-control {
    display: none;
  }
}

@media (max-width: 900px) {
  .panel-label {
    display: none;
  }

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

  .copy-button span {
    display: none;
  }

  .copy-button {
    width: 27px;
    padding: 0;
  }

  .privacy-note {
    display: none;
  }

  .statusbar {
    grid-template-columns: 1fr auto auto;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-window {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-rows: 34px auto;
    padding: 6px;
  }

  .titlebar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--window);
  }

  .local-label {
    display: none;
  }

  .workspace-frame {
    grid-template-rows: auto 27px;
    overflow: visible;
  }

  .split-workspace {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .panel {
    height: 58vh;
    min-height: 430px;
    flex: none;
  }

  .result-panel {
    border-top: 1px solid var(--border);
  }

  .splitter {
    display: none;
  }

  .panel-toolbar {
    height: auto;
    min-height: 40px;
    flex-basis: auto;
    flex-wrap: wrap;
    padding: 6px;
  }

  .panel-label {
    display: block;
    order: 1;
  }

  .utility-actions {
    order: 2;
  }

  .primary-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    order: 3;
  }

  .tool-button {
    padding-inline: 5px;
  }

  .tool-button .icon,
  .text-button .icon {
    display: block;
  }

  .result-toolbar .panel-label {
    display: none;
  }

  .result-toolbar .view-switch {
    margin-right: auto;
  }

  .tree-control {
    display: inline-flex;
  }

  .document-stats {
    display: none;
  }

  .statusbar {
    grid-template-columns: 1fr auto;
  }

  .cursor-position {
    justify-self: end;
  }
}

@media (max-width: 420px) {
  #pageNameInput {
    width: min(230px, 58vw);
    font-size: 10px;
  }

  .tool-button {
    gap: 3px;
    font-size: 9px;
  }

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

  .result-toolbar {
    gap: 4px;
  }

  .view-button {
    font-size: 8px;
  }

  .indent-control select {
    padding-left: 6px;
    font-size: 8px;
  }
}

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