:root {
  color: #102a43;
  background: #eee7da;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
.masthead {
  padding: clamp(2rem, 7vw, 6rem) max(1.25rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid #102a43;
  background: #f7f1e5;
}
.masthead-meta {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}
.version-picker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font:
    700 0.72rem/1 ui-monospace,
    monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.version-picker select {
  padding: 0.45rem 0.65rem;
  border: 1px solid #102a43;
  background: #f7f1e5;
  color: #102a43;
  font: inherit;
}
.eyebrow,
.section-number {
  margin: 0 0 0.8rem;
  color: #bd412d;
  font:
    700 0.72rem/1 ui-monospace,
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}
h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3.5rem, 10vw, 8.5rem);
  line-height: 0.82;
  letter-spacing: -0.065em;
}
h2 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
}
.lede {
  max-width: 720px;
  margin: 2rem 0 0 auto;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.5;
}
.example-nav {
  border-bottom: 1px solid #102a43;
  background: #102a43;
}
.example-tabs {
  display: flex;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
}
.example-tabs button {
  flex: 0 1 auto;
  min-width: 135px;
  padding: 1rem 1.2rem;
  border: 0;
  border-right: 1px solid #476477;
  background: #102a43;
  color: #dbeafe;
  font:
    700 0.76rem/1.1 ui-monospace,
    monospace;
  letter-spacing: 0.03em;
}
.example-tabs button[aria-selected="true"] {
  background: #f7f1e5;
  color: #102a43;
  box-shadow: inset 0 -5px 0 #bd412d;
}
.example-tabs button:focus-visible {
  outline: 3px solid #facf9b;
  outline-offset: -4px;
}
.example-tabs button:disabled {
  opacity: 0.72;
}
main {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.4fr);
  max-width: 1180px;
  margin: 0 auto;
  border-inline: 1px solid #102a43;
}
.controls,
.result,
.limits {
  padding: clamp(1.25rem, 4vw, 3rem);
}
.controls {
  border-right: 1px solid #102a43;
}
.result {
  background: #f7f1e5;
}
.limits {
  grid-column: 1 / -1;
  border-top: 1px solid #102a43;
  background: #173f4f;
  color: #f7f1e5;
}
form {
  margin-top: 2rem;
}
.requirement {
  padding: 0.7rem 0.8rem;
  border-left: 4px solid #bd412d;
  background: #f7f1e5;
  font-size: 0.82rem;
  font-weight: 700;
}
.mode-switch {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.mode-switch label {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid currentColor;
}
.file-grid {
  display: grid;
  gap: 0.7rem;
}
.file-grid label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
}
input[type="file"],
input[type="text"],
select {
  width: 100%;
  padding: 0.65rem;
  border: 1px solid #102a43;
  border-radius: 0;
  background: #f7f1e5;
  color: inherit;
}
.actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}
button,
.download {
  padding: 0.9rem 1rem;
  border: 1px solid #102a43;
  border-radius: 0;
  background: #bd412d;
  color: white;
  font: 700 0.82rem/1 inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button.secondary {
  background: transparent;
  color: #102a43;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.warning {
  margin-top: 2rem;
  padding: 1rem;
  border-left: 5px solid #bd412d;
  background: #e4d7c4;
  font-size: 0.88rem;
  line-height: 1.5;
}
.result-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}
.result-head label {
  min-width: 155px;
  font-size: 0.75rem;
  font-weight: 700;
}
progress {
  width: 100%;
  height: 6px;
  border: 0;
  background: #d7cbbb;
}
progress::-moz-progress-bar {
  background: #bd412d;
}
#status {
  min-height: 3rem;
  font:
    0.82rem/1.5 ui-monospace,
    monospace;
}
.download {
  display: block;
  margin-bottom: 1rem;
}
.download[hidden] {
  display: none;
}
iframe {
  width: 100%;
  min-height: 570px;
  border: 1px solid #102a43;
  background: #d7cbbb;
}
details {
  margin-top: 1rem;
}
summary {
  cursor: pointer;
  font-weight: 700;
}
pre {
  overflow: auto;
  max-height: 330px;
  padding: 1rem;
  background: #102a43;
  color: #f7f1e5;
  font-size: 0.72rem;
}
.limits p {
  max-width: 850px;
  line-height: 1.6;
}
.limits code {
  color: #facf9b;
}

@media (max-width: 800px) {
  main {
    display: block;
    border-inline: 0;
  }
  .controls {
    border-right: 0;
    border-bottom: 1px solid #102a43;
  }
  .result-head {
    align-items: start;
    flex-direction: column;
  }
  iframe {
    min-height: 440px;
  }
  .example-tabs button {
    min-width: 125px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  button,
  .download {
    transition:
      background-color 150ms ease,
      color 150ms ease;
  }
  button:not([role="tab"]):hover,
  .download:hover {
    background: #102a43;
  }
}
