:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #17202c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px;
}

.topbar,
.summary-grid,
.layout,
.output-panel {
  background: #fff;
  border: 1px solid #d9dee7;
  border-radius: 8px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #516071;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.language-switch {
  display: flex;
  gap: 6px;
}

button,
.status {
  border: 1px solid #c8d0dc;
  border-radius: 6px;
  background: #fff;
  color: #17202c;
  padding: 9px 12px;
  cursor: pointer;
}

button:hover {
  background: #edf2f7;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.language-button.active,
.status.ready,
#validation-state.ready {
  border-color: #1e7f58;
  background: #e7f6ef;
  color: #0e5c3d;
}

#validation-state.blocked {
  border-color: #b84545;
  background: #fff0f0;
  color: #8a1f1f;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 16px;
}

.summary-grid > div {
  padding: 18px;
  border-right: 1px solid #e3e7ee;
  min-width: 0;
}

.summary-grid > div:last-child {
  border-right: 0;
}

.summary-grid span,
.field span,
.control-panel label {
  display: block;
  color: #647184;
  font-size: 12px;
  margin-bottom: 6px;
}

.summary-grid strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  margin-top: 16px;
}

.control-panel {
  padding: 18px;
  border-right: 1px solid #e3e7ee;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-panel select,
.field input,
.field textarea {
  width: 100%;
  border: 1px solid #c8d0dc;
  border-radius: 6px;
  padding: 10px;
  color: #17202c;
  background: #fff;
}

.owner-meta,
.boundary-note,
.manual-note {
  padding: 12px;
  border-radius: 6px;
  background: #f5f7fa;
  color: #445366;
  font-size: 13px;
  line-height: 1.45;
}

.boundary-note {
  background: #fff7e8;
}

.form-panel {
  padding: 22px;
}

.fields-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field.full {
  grid-column: 1 / -1;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.inline-button {
  margin-top: 8px;
}

.output-panel {
  margin-top: 16px;
  padding: 18px;
}

.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#validation-state {
  border: 1px solid #c8d0dc;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}

#validation-output {
  min-height: 48px;
  padding: 12px;
  background: #f5f7fa;
  border-radius: 6px;
  overflow: auto;
}

#json-output {
  width: 100%;
  min-height: 360px;
  border: 1px solid #c8d0dc;
  border-radius: 6px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .layout {
    display: block;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid > div,
  .control-panel {
    border-right: 0;
    border-bottom: 1px solid #e3e7ee;
  }

  .fields-grid {
    grid-template-columns: 1fr;
  }
}
