:root {
  --ink: #1d2733;
  --steel: #5a6878;
  --line: #d5dbe3;
  --paper: #f3f5f8;
  --panel: #ffffff;
  --accent: #2b6cb0;
  --ok: #2f855a;
  --bad: #c53030;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex; flex-direction: column;
  font: 14px/1.4 var(--font); color: var(--ink); background: var(--paper);
}

.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 16px; background: var(--ink); color: #fff;
}
.brand { margin: 0 8px 0 0; font-size: 17px; font-weight: 600; }
.brace { color: #90cdf4; font-family: Consolas, Menlo, monospace; }
.group { display: flex; gap: 4px; flex-wrap: wrap; }
.group + .group { padding-left: 16px; border-left: 1px solid #3a4756; }

button, select {
  font: inherit; color: #fff; background: #2d3a48; border: 1px solid #3f4e60;
  border-radius: 4px; padding: 5px 11px; cursor: pointer;
}
button:hover, select:hover { background: #3a4a5c; }
button:focus-visible, select:focus-visible { outline: 2px solid #90cdf4; outline-offset: 2px; }

main {
  flex: 1; min-height: 0; display: grid; gap: 0; padding: 12px;
  grid-template-columns: 1fr 36px 1fr;
}
main.code, main.tree { grid-template-columns: 1fr; }
main.code .gutter, main.tree .gutter,
main.code .pane:last-of-type, main.tree .pane:first-of-type { display: none; }

.pane { min-width: 0; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.editor { height: 100%; }
.gutter { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; }
.gutter button { color: var(--ink); background: var(--panel); border-color: var(--line); padding: 6px 8px; }
.gutter button:hover { background: #e6ebf1; }

/* Blend the library chrome with the app */
.jsoneditor { border: 0 !important; }
.jsoneditor-menu { background: var(--accent) !important; border-bottom-color: var(--accent) !important; }

.status {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  padding: 6px 16px; border-top: 1px solid var(--line); background: var(--panel); font-size: 13px;
}
.pill { padding: 2px 8px; border-radius: 10px; color: #fff; font-weight: 600; }
.pill.ok { background: var(--ok); }
.pill.bad { background: var(--bad); }
.muted { color: var(--steel); }
.hint { margin-left: auto; }

.drop {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 50;
  background: rgba(43,108,176,.85); color: #fff; font-size: 28px; font-weight: 600;
  border: 4px dashed #fff;
}
.toast {
  position: fixed; bottom: 48px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 4px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 800px) {
  main { grid-template-columns: 1fr; grid-template-rows: 1fr 36px 1fr; }
  .gutter { flex-direction: row; }
  .gutter #toRight { transform: rotate(90deg); }
  .gutter #toLeft { transform: rotate(90deg); }
  .group + .group { border-left: 0; padding-left: 0; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
