:root {
  font: 15px/1.5 "Instrument Sans", system-ui, sans-serif;
  color: #22252b;
  background: #f2efe8;
  --ink: #22252b;
  --muted: #555c68;
  --paper: #fffefa;
  --line: #d8d5ce;
  --accent: #293f89;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.topbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; min-height: 73px; padding: 12px clamp(16px, 4vw, 54px); background: var(--paper); border-bottom: 1px solid var(--line); }
.wordmark { text-decoration: none; color: var(--ink); font: 400 35px/.95 "Instrument Serif", Georgia, serif; letter-spacing: -.06em; }
.wordmark span { color: var(--accent); }
.toolbar, .field-actions { display: flex; flex-wrap: wrap; gap: 8px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 7px 12px; color: var(--ink); background: var(--paper); border: 1px solid #9b9faa; border-radius: 7px; font: inherit; font-weight: 620; cursor: pointer; }
button:hover, .button:hover { background: #eef0fa; }
button:disabled { opacity: .5; cursor: default; }
button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
button.primary:hover { background: #1d2e69; }
button.danger { color: #9e3127; }
button.plain { background: transparent; border-color: transparent; padding-inline: 0; color: var(--accent); }
:focus-visible, .file-button:focus-within { outline: 3px solid #5874d5; outline-offset: 2px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.workspace { max-width: 1550px; margin: 0 auto; padding: 29px clamp(14px, 4vw, 54px) 40px; }
.intro h1 { margin: 0; font: 400 clamp(42px, 6vw, 72px)/1 "Instrument Serif", Georgia, serif; letter-spacing: -.055em; }
.intro p { color: var(--muted); margin: 11px 0 0; }
.editor-status { margin: 6px 0 4px; min-height: 24px; color: var(--accent); overflow-wrap: anywhere; }
.editor-status.error { color: #9e3127; }
.layout { display: grid; grid-template-columns: minmax(165px, .78fr) minmax(225px, 1fr) minmax(270px, 1.65fr); gap: 13px; align-items: start; }
.field-panel, .edit-panel, .preview-panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.field-panel, .edit-panel { padding: 18px; }
.field-panel-header, .preview-header { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.field-panel-header h2, .edit-panel > h2, .preview-header h2 { font-size: 16px; margin: 0; }
.field-panel-header button { min-height: 33px; font-size: 13px; padding: 4px 8px; }
#field-list { display: grid; gap: 5px; padding: 0; margin: 14px 0 8px; list-style: none; }
#field-list button { width: 100%; justify-content: flex-start; text-align: left; overflow-wrap: anywhere; border-color: transparent; background: #f4f3ee; }
#field-list [aria-current="true"] { color: var(--accent); border-color: #b3bde2; background: #eaedfb; }
.edit-panel form { display: grid; gap: 12px; margin-top: 15px; }
.edit-panel label { display: grid; gap: 5px; font-weight: 620; }
.edit-panel label.check { display: flex; align-items: center; font-weight: 450; }
.edit-panel input:not([type="checkbox"]), .edit-panel select, .edit-panel textarea { width: 100%; min-width: 0; min-height: 41px; border-radius: 7px; border: 1px solid #9096a3; color: var(--ink); background: var(--paper); padding: 7px 9px; font: inherit; font-weight: 450; }
.edit-panel textarea { resize: vertical; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-actions button { font-size: 13px; min-height: 36px; }
.preview-panel { padding: clamp(15px, 2.6vw, 34px); background: #f9f9ff; border-color: #c9d1ec; }
.preview-header { gap: 10px; padding-bottom: 13px; margin-bottom: 19px; border-bottom: 1px solid #c9d1ec; }
.preview-header span { font-size: 13px; color: var(--muted); }
#payload-panel { margin-top: 15px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--accent); }
[hidden] { display: none !important; }
@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(135px, .72fr) minmax(210px, 1fr); }
  .preview-panel { grid-column: 1 / -1; }
}
@media (max-width: 495px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .toolbar { gap: 6px; }
  .toolbar > * { min-height: 38px; padding-inline: 8px; font-size: 13px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
}
