:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172334;
  background: #f7f5f0;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: #194d83; }
a:hover { color: #0c3157; }
:focus-visible { outline: 3px solid #5b92d1; outline-offset: 2px; }

.shell { max-width: 1140px; padding: 48px 28px 36px; margin: 0 auto; }
.page-header, .section-heading, .editor-heading, .summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.page-header { align-items: flex-start; margin-bottom: 32px; }
.eyebrow { margin: 0 0 9px; color: #8b5525; font-size: .79rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 500; line-height: 1.12; }
.intro { max-width: 650px; margin: 13px 0 0; color: #516073; }
.text-link { white-space: nowrap; margin-top: 8px; }
.card, .advanced details { border: 1px solid #d9e0e7; background: #fff; border-radius: 14px; box-shadow: 0 5px 24px #14273c0b; }
.card { padding: 26px; }
h2 { margin: 0; font-size: 1.15rem; }
.local-note, .hint { color: #667589; font-size: .88rem; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr) minmax(0, 1.35fr); align-items: end; gap: 12px; margin: 22px 0; }
.controls label, .detail-body label { display: grid; gap: 7px; font-size: .86rem; font-weight: 650; }
select, textarea { border: 1px solid #b9c5d2; border-radius: 8px; background: #fff; color: #172334; }
select { width: 100%; min-height: 43px; padding: 7px 10px; }
textarea { display: block; width: 100%; padding: 15px; resize: vertical; }
.swap { width: 43px; height: 43px; border: 1px solid #b9c5d2; border-radius: 8px; color: #194d83; background: #f5f9fc; font-size: 1.45rem; }
.swap:hover, .small-button:hover { background: #e8f2fb; }
.preset-info { margin: -4px 0 22px; padding: 12px 15px; border-left: 3px solid #7c9fc3; border-radius: 4px; background: #f3f7fb; color: #3f5269; font-size: .9rem; }
.preset-info p { margin: 0 0 5px; }
.preset-info p:last-child { margin-bottom: 0; }
.editors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.editor-heading { min-height: 40px; margin-bottom: 8px; font-weight: 650; }
.editor-heading select { width: auto; max-width: 65%; min-height: 34px; font-size: .83rem; font-weight: 400; }
.editor textarea { min-height: 220px; font-size: 1.15rem; line-height: 1.7; }
#output { background: #f7f9fb; }
.small-button { padding: 6px 12px; border: 1px solid #b9c5d2; border-radius: 7px; background: #fff; color: #194d83; font-size: .83rem; }
.small-button:disabled, .swap:disabled { opacity: .5; cursor: not-allowed; }
.summary { align-items: flex-start; margin-top: 17px; flex-wrap: wrap; }
#status { margin: 0; color: #37664c; font-size: .92rem; }
#status.error { color: #a02837; }
.check { display: flex; align-items: flex-start; gap: 8px; max-width: 360px; color: #3f5269; font-size: .88rem; }
.check input { margin: 4px 0 0; accent-color: #194d83; }
.diagnostics { margin-top: 15px; padding: 12px 16px; border-radius: 8px; background: #fff8eb; color: #5c4730; font-size: .9rem; }
.diagnostics ul { margin: 7px 0 0; padding-left: 21px; }
.diagnostics li + li { margin-top: 5px; }
.advanced { display: grid; gap: 10px; margin-top: 16px; }
.advanced details { box-shadow: none; }
.advanced summary { padding: 13px 20px; cursor: pointer; font-weight: 650; }
.detail-body { padding: 0 20px 19px; }
.detail-body label .hint { font-weight: 400; }
.detail-body > a { display: inline-block; margin-top: 8px; font-size: .88rem; }
.json-editor { min-height: 115px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88rem; }
pre { overflow: auto; max-height: 320px; padding: 13px; border-radius: 8px; background: #f3f5f7; font-size: .82rem; }
footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; color: #667589; font-size: .83rem; }

@media (max-width: 760px) {
  .shell { padding: 28px 16px; }
  .page-header { display: block; }
  .page-header .text-link { display: inline-block; margin-top: 15px; }
  .card { padding: 18px; }
  .controls { grid-template-columns: minmax(0, 1fr) 43px minmax(0, 1fr); }
  .controls label:last-child { grid-column: 1 / -1; }
  .editors { grid-template-columns: 1fr; }
  .editor textarea { min-height: 160px; }
  .local-note { display: none; }
}
