:root {
  color-scheme: light;
  font: 15px/1.4 system-ui, sans-serif;
  color: #182423;
  background: #f2f5f2;
  --panel: #fff;
  --line: #d9e2dc;
  --muted: #536461;
  --accent: #074f4d;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 22px;
  gap: 14px;
  min-height: 66px;
  background: #fbfdfa;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 750; text-decoration: none; }
.brand img { width: 29px; height: 29px; }
h1 { margin: 0; font-size: 18px; font-weight: 650; }
h2 { margin: 0; font-size: 14px; font-weight: 720; }
.actions, .section-title, .row-actions { display: flex; align-items: center; gap: 8px; }
.section-title { min-height: 44px; justify-content: space-between; padding-block: 6px; }
button, .button, input, textarea, select {
  font: inherit;
  border: 1px solid #bbc9c3;
  border-radius: 6px;
}
button, .button { cursor: pointer; display: inline-block; padding: 6px 10px; color: #193330; background: #fff; text-decoration: none; }
button:disabled { opacity: .5; cursor: default; }
button:not(:disabled):hover, .button:hover { background: #eaf3ef; }
button[aria-current="true"] { background: #dfefea; border-color: #4d867c; }
button:focus-visible, .button:focus-visible, :focus-visible { outline: 3px solid #32897a; outline-offset: 2px; }
.primary, .primary:hover { color: white; background: var(--accent); border-color: var(--accent); }
.workspace { display: grid; grid-template-columns: 230px minmax(360px, 1fr) 300px; min-height: calc(100dvh - 67px); }
.outline, .properties { min-width: 0; background: var(--panel); padding: 8px 15px 18px; }
.outline { border-right: 1px solid var(--line); }
.properties { border-left: 1px solid var(--line); }
#pages, #blocks { display: grid; gap: 5px; }
#pages button, #blocks button { text-align: left; width: 100%; overflow-wrap: anywhere; }
.block { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 4px; }
.block [draggable] { color: var(--muted); cursor: grab; text-align: center; }
.block.drag-target { outline: 2px solid #32897a; outline-offset: 2px; }
fieldset { margin: 20px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
fieldset button { font-size: 13px; margin: 0 4px 4px 0; }
legend { padding: 0 4px; color: #334741; font-weight: 600; }
.preview-region { min-width: 0; padding: 8px 16px 16px; }
.preview-title { gap: 12px; }
#status { font-size: 13px; color: var(--muted); }
#status[data-error] { color: #902a1d; }
#preview { display: block; width: 100%; height: calc(100dvh - 138px); min-height: 420px; background: #e2e9e5; border: 1px solid #c2d1c9; border-radius: 8px; }
#inspector { display: grid; gap: 10px; }
label.field, .variables label { display: grid; gap: 4px; font-size: 13px; font-weight: 620; color: #334741; }
input:not([type="checkbox"]), textarea, select { width: 100%; min-width: 0; padding: 6px 8px; background: white; color: #182423; }
input[type="checkbox"] { margin-right: auto; }
textarea { resize: vertical; }
.variables { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.variables summary { cursor: pointer; font-weight: 650; margin-bottom: 8px; }
.variables textarea, textarea[data-json] { font-family: ui-monospace, monospace; font-size: 13px; }
.hint { color: var(--muted); margin: 0; font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
label[for="import"]:has(+ input:focus-visible) { outline: 3px solid #32897a; outline-offset: 2px; }
@media (max-width: 980px) {
  .workspace { grid-template-columns: 180px minmax(260px, 1fr) 250px; }
}
@media (max-width: 740px) {
  .top { flex-wrap: wrap; padding: 12px; }
  .actions { flex-wrap: wrap; }
  .workspace { grid-template-columns: 1fr 1fr; }
  .preview-region { grid-row: 2; grid-column: 1 / -1; }
  #preview { height: 70vh; }
}
