:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182019;
  background: #f2f5ef;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 0%, rgba(185, 217, 167, 0.34), transparent 35rem),
    #f2f5ef;
}

button,
textarea {
  font: inherit;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 40px;
}

.hero {
  max-width: 760px;
  margin-bottom: 28px;
}

.eyebrow,
.step {
  margin: 0 0 8px;
  color: #55714c;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

h2,
.summary-title {
  margin-bottom: 0;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 680px;
  color: #536056;
  font-size: 1.05rem;
  line-height: 1.7;
}

.panel {
  margin-bottom: 20px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(59, 76, 61, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 252, 0.92);
  box-shadow: 0 18px 60px rgba(48, 66, 51, 0.08);
  backdrop-filter: blur(12px);
}

.editor-panel {
  padding-bottom: 22px;
}

.section-heading,
.actions,
.button-row,
.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 18px;
}

.editor-heading {
  align-items: flex-end;
}

.button-row {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 0 0 14px;
  border: 0;
  padding: 0;
  color: #4d5a4f;
  font-size: 0.9rem;
}

.options legend {
  margin-right: 8px;
  color: #35453a;
  font-weight: 750;
}

.option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.drawio-frame {
  display: block;
  width: 100%;
  height: max(620px, 72vh);
  border: 1px solid #bcc8b9;
  border-radius: 14px;
  background: #fff;
}

.drawio-frame.is-busy {
  pointer-events: none;
  opacity: 0.72;
}

.status-row {
  justify-content: space-between;
  min-height: 44px;
  margin-top: 10px;
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid #cbd4c8;
  border-radius: 14px;
  padding: 16px;
  color: #172019;
  background: #fbfcfa;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  tab-size: 2;
}

textarea:focus,
button:focus-visible,
.file-button:focus-within,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(54, 116, 69, 0.32);
  outline-offset: 3px;
}

.output {
  min-height: 180px;
  margin-top: 18px;
}

.actions {
  margin-top: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 17px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  color: #fff;
  background: #244b2e;
  box-shadow: 0 8px 24px rgba(36, 75, 46, 0.2);
}

.button-quiet {
  border-color: #c8d2c5;
  color: #314735;
  background: #f7faf5;
}

.file-button {
  user-select: none;
}

.status {
  margin: 0;
  color: #687269;
  font-size: 0.9rem;
}

.status[data-kind="success"] {
  color: #2e6a3c;
}

.status[data-kind="error"] {
  color: #aa2f2f;
}

details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::after {
  content: "+";
  color: #55714c;
  font-size: 1.8rem;
  line-height: 1;
}

details[open] > summary::after {
  content: "−";
}

.summary-help,
.help {
  color: #6f796f;
  font-size: 0.86rem;
  line-height: 1.6;
}

.summary-help {
  margin-left: auto;
}

.source-content {
  padding-top: 20px;
}

.preview,
.preview-empty {
  width: 100%;
  min-height: 220px;
  border: 1px dashed #c5cec2;
  border-radius: 14px;
  background-color: #fff;
}

.preview {
  display: block;
  max-height: 720px;
  padding: 16px;
  object-fit: contain;
}

.preview[hidden] {
  display: none;
}

.preview-empty {
  display: grid;
  place-items: center;
  padding: 24px;
  color: #7a847a;
  text-align: center;
}

footer {
  padding: 8px 4px;
  color: #667067;
  font-size: 0.86rem;
  line-height: 1.6;
}

footer p {
  margin-bottom: 0;
}

a {
  color: #315e3d;
  text-underline-offset: 0.18em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 32px;
  }

  .section-heading,
  .editor-heading,
  .status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row {
    width: 100%;
    justify-content: flex-start;
  }

  .drawio-frame {
    height: 70vh;
    min-height: 520px;
  }

  .summary-help {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}
