:root {
  color-scheme: light;
  --ink: #173047;
  --muted: #465c6a;
  --surface: #edf2f4;
  --line: #bdcbd1;
  --teal: #006d69;
  --amber: #7b4600;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #005c76; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, select, input[type="checkbox"] { cursor: pointer; }
button { border: 1px solid #8099a4; background: #fff; color: var(--ink); padding: .52rem .8rem; border-radius: 3px; }
button:hover:not(:disabled) { background: #e0eeed; }
button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
button.primary:hover:not(:disabled) { background: #00534f; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #a44d00; outline-offset: 3px; }
.skip-link { position: absolute; top: -80px; left: 12px; padding: 10px; background: #fff; z-index: 2; }
.skip-link:focus { top: 10px; }
.utility-rail { background: #173047; color: #fff; padding: 1rem 1.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.utility-rail h1 { margin: 0; font-size: 1.35rem; font-weight: 650; }
.utility-rail p { margin: .2rem 0 0; font-size: .85rem; color: #d1e1e8; }
.utility-rail a { color: #fff; }
.rail-meta { font-size: .85rem; text-align: right; }
.toolbar { padding: .85rem 1.4rem; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; border-bottom: 1px solid var(--line); }
.toolbar label { font-weight: 650; }
select, input[type="text"], textarea { border: 1px solid #829aa6; border-radius: 2px; background: #fff; color: var(--ink); padding: .55rem; }
select { max-width: 100%; }
.synthetic { color: var(--amber); border-left: 1px solid #af6900; padding-left: .7rem; font-size: .88rem; }
.workspace { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(350px, 1.25fr) minmax(280px, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.bay { min-width: 0; background: #f8fafb; padding: 1rem; }
.bay-header { min-height: 4.5rem; border-bottom: 2px solid var(--ink); margin-bottom: 1rem; }
.bay h2 { font-size: 1.05rem; margin: 0 0 .35rem; }
.bay-header p { font-size: .86rem; color: var(--muted); margin: 0 0 .6rem; line-height: 1.4; }
.editor-label { display: block; font-size: .86rem; font-weight: 650; margin-bottom: .5rem; }
.json-editor { width: 100%; height: 58vh; min-height: 330px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; line-height: 1.55; tab-size: 2; background: #fff; }
.json-editor[readonly] { background: #e6ecef; }
.editor-help { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.form-description { margin: 0 0 .75rem; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.fields { max-height: 59vh; overflow: auto; padding: 0 .3rem; }
.field { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.field:first-child { padding-top: .2rem; }
.field-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.field-heading > label { font-weight: 650; }
.include-label { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--muted); font-weight: 400 !important; }
.include-label input { accent-color: var(--teal); width: 1rem; height: 1rem; }
.field > input, .field > select, .field > textarea { width: 100%; }
.field > textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; resize: vertical; }
.field-help, .field-error { font-size: .8rem; line-height: 1.45; margin: .4rem 0 0; overflow-wrap: anywhere; }
.field-help { color: var(--muted); }
.field-error { color: var(--amber); font-weight: 600; }
[aria-invalid="true"]:not([type="checkbox"]) { border: 2px solid #9c5700; }
.field > :disabled { background: #e8eef0; color: #526875; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.state { display: inline-block; font-size: .8rem; font-weight: 650; padding: .25rem .5rem; margin-bottom: .8rem; }
.state.valid { color: #00534f; background: #d9edeb; }
.state.invalid { color: #744000; background: #f7e8cd; }
.error-summary { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .7rem; max-height: 240px; overflow: auto; }
.error-summary h3 { margin: 0 0 .5rem; font-size: .9rem; }
.error-summary ul { padding-left: 1.3rem; margin: 0; font-size: .82rem; line-height: 1.5; }
.error-summary li { margin-bottom: .4rem; overflow-wrap: anywhere; }
.empty-state { padding: 1.2rem .4rem; line-height: 1.6; color: var(--muted); }
.status-bar { padding: .8rem 1.4rem; min-height: 3rem; background: #e1eaee; font-size: .87rem; border-bottom: 1px solid var(--line); }
footer { padding: .8rem 1.4rem; font-size: .8rem; color: var(--muted); line-height: 1.5; }
footer a { margin-right: .8rem; }
@media (min-width: 1600px) { .workspace { grid-template-columns: minmax(330px, 1fr) minmax(420px, 1.2fr) minmax(330px, 1fr); } }
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .bay { padding: 1rem 1.4rem; }
  .bay-header { min-height: 0; }
  .json-editor { height: 330px; min-height: 240px; }
  .fields { max-height: none; overflow: visible; }
}
@media (max-width: 480px) {
  .utility-rail { align-items: flex-start; padding: 1rem; }
  .utility-rail h1 { font-size: 1.1rem; }
  .rail-meta { max-width: 100px; }
  .toolbar, .bay, .status-bar, footer { padding-left: 1rem; padding-right: 1rem; }
  .toolbar select { width: 100%; }
  .field-heading { align-items: flex-start; flex-direction: column; }
}
