:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171717;
  background: #f5f5f3;
  line-height: 1.5;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: #f5f5f3;
  color: #171717;
}

button, textarea, input { font: inherit; }

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

.hero { max-width: 850px; margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #5b5b57;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.05; letter-spacing: -.035em; }
h2 { margin-bottom: 6px; font-size: 1rem; letter-spacing: -.01em; }
.lead { margin-bottom: 0; max-width: 760px; color: #51514d; font-size: 1.05rem; }

.integrity,
.panel,
.traceability {
  background: #fff;
  border: 1px solid #d8d8d2;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

.integrity {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.integrity p { margin-bottom: 0; color: #5b5b57; }
.integrity p.ready { color: #176b3a; font-weight: 700; }
.integrity p.failed { color: #a32626; font-weight: 700; }

.versions { display: flex; gap: 12px; margin: 0; }
.versions div {
  min-width: 92px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f5f5f3;
  text-align: center;
}
.versions dt { font-size: .72rem; color: #666660; }
.versions dd { margin: 2px 0 0; font-weight: 750; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.panel { min-width: 0; overflow: hidden; }
.panel-heading {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e5df;
}
.panel-heading p { margin-bottom: 0; color: #6a6a65; font-size: .82rem; }

.secondary-actions, .primary-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.primary-actions { padding: 0 16px 16px; }

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: .88rem;
}
.button:focus-visible, textarea:focus-visible, pre:focus-visible {
  outline: 3px solid #73736d;
  outline-offset: 2px;
}
.button.secondary { background: #f4f4f1; border-color: #d7d7d0; color: #282826; }
.button.secondary:hover { background: #eaeae5; }
.button.primary { min-width: 120px; background: #181817; color: #fff; }
.button.primary:hover:not(:disabled) { background: #343431; }
.button:disabled { opacity: .45; cursor: not-allowed; }

#file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

textarea {
  width: 100%;
  min-height: 480px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  padding: 18px;
  background: #111210;
  color: #f0f0ec;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  tab-size: 2;
}
textarea::selection { background: #4f5148; }

.help { margin: 12px 16px; color: #6a6a65; font-size: .8rem; }

.output-heading { justify-content: flex-start; }
.state { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: .78rem !important; font-weight: 750; }
.state.neutral { background: #eeeeea; color: #5c5c56; }
.state.ok { background: #e6f4eb; color: #176b3a; }
.state.error { background: #f8e8e8; color: #9a2626; }

pre {
  min-height: 480px;
  max-height: 680px;
  overflow: auto;
  margin: 0;
  padding: 18px;
  background: #fafaf8;
  color: #20201e;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.traceability { margin-top: 18px; padding: 16px 18px; }
.traceability dl { margin: 10px 0 0; display: grid; gap: 8px; }
.traceability dl div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.traceability dt { color: #686863; font-size: .82rem; }
.traceability dd { margin: 0; min-width: 0; font-size: .82rem; }
.traceability code { overflow-wrap: anywhere; }

.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: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .integrity { align-items: flex-start; flex-direction: column; }
  .versions { width: 100%; }
  .versions div { flex: 1; }
  textarea, pre { min-height: 360px; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 28px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .versions { flex-direction: column; }
  .traceability dl div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-color-scheme: dark) {
  :root, body { background: #111210; color: #ecece7; }
  .lead, .eyebrow { color: #b7b7b0; }
  .integrity, .panel, .traceability { background: #191a18; border-color: #373832; }
  .integrity p, .panel-heading p, .help, .traceability dt { color: #b4b4ad; }
  .versions div, .button.secondary { background: #242521; border-color: #40413b; color: #ecece7; }
  .button.secondary:hover { background: #30312c; }
  .button.primary { background: #ecece7; color: #181817; }
  .button.primary:hover:not(:disabled) { background: #d3d3cc; }
  .panel-heading { border-color: #373832; }
  pre { background: #151614; color: #e8e8e2; }
  .state.neutral { background: #2b2c28; color: #d0d0ca; }
  .state.ok { background: #183a27; color: #a9e0bd; }
  .state.error { background: #442020; color: #f0b3b3; }
}
