:root {
  --btn: #163a6e;
  --btn-hover: #1e4d8c;
  --btn-on: #e8eef8;
  --wait: #163a6e;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
html {
  background-color: var(--bg);
  background-image: none;
}
body {
  font-family: var(--font);
  background: transparent;
  color: var(--text);
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-on);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
.shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 16px clamp(16px, 4vw, 48px) 12px;
  gap: 12px;
}
.brand {
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: -0.04em;
  font-size: 17px;
  text-decoration: none;
}
.nav-quiet {
  color: var(--text-grey);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 11px;
}
.nav-quiet:hover { color: var(--text-light); }
.nav-btn {
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  color: var(--text-grey);
}
.nav-btn.on {
  color: var(--text-light);
  background: var(--bg-surface-alt);
}
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 0;
}
.editor-pane,
.result-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.select,
textarea,
.panel {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.select {
  background: var(--bg-surface-alt);
  color: var(--text-light);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}
textarea {
  flex: 1;
  width: 100%;
  min-height: 280px;
  border: 0;
  resize: none;
  padding: 14px 16px;
  background: transparent;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.55;
  outline: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--btn);
  background: var(--btn);
  color: var(--btn-on);
  box-shadow: var(--btn-sheen);
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn-ghost {
  background: var(--btn);
  color: var(--btn-on);
}
.btn:disabled {
  opacity: 0.45;
  cursor: wait;
}
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-grey);
  border-bottom: 1px solid var(--border);
}
.status.ok { color: var(--text-light); }
.status.err { color: #ff8b8b; }
.wait-icon {
  display: none;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(22, 58, 110, 0.08), var(--wait));
  -webkit-mask: radial-gradient(farthest-side, transparent 56%, #000 58%);
  mask: radial-gradient(farthest-side, transparent 56%, #000 58%);
  animation: wait-spin 0.7s linear infinite;
}
.status.wait .wait-icon { display: inline-block; }
@keyframes wait-spin {
  to { transform: rotate(360deg); }
}
.panel {
  flex: 1;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-light);
  white-space: pre-wrap;
  min-height: 200px;
}
.panel[hidden] { display: none; }
.fine {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  font-size: 12px;
  color: var(--text-grey);
}
.fine a {
  color: var(--text-grey);
  text-decoration: none;
}
.fine a:hover { color: var(--text-light); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
}
