:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8ece9;
  background: #101211;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #101211; }
button, select, input { font: inherit; }
button, select, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, input:focus-visible, .upload-box:focus-within { outline: 2px solid #72c9a2; outline-offset: 3px; }

.layout {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  width: min(1120px, calc(100% - 64px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
}
.version-footer { grid-column: 1 / -1; justify-self: end; color: #68716b; font-size: 12px; }

.controls { display: grid; gap: 18px; min-width: 0; }
.controls > label:not(.upload-box) { display: grid; gap: 8px; color: #aeb8b2; font-size: 13px; }
select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #343b37;
  border-radius: 7px;
  background: #1a1e1b;
  color: #edf1ee;
}
select:disabled { color: #737d77; }

.upload-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 82px;
  padding: 16px;
  overflow: hidden;
  border: 1px dashed #46534b;
  border-radius: 8px;
  background: #171b18;
  color: #dce3de;
  cursor: pointer;
  font-size: 14px;
}
.upload-box input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-action { flex: none; color: #77d0a6; font-size: 13px; }

button {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: #59b98b;
  color: #0d1711;
  font-weight: 650;
  cursor: pointer;
}
button:disabled { background: #303834; color: #89928c; cursor: not-allowed; }
.output {
  min-width: 0;
  height: min(72vh, 720px);
  min-height: 360px;
  padding: 20px;
  overflow: auto;
  border: 1px solid #292f2b;
  border-radius: 9px;
  background: #151816;
  scrollbar-color: #46534b #151816;
}
.output:empty { background: #131614; }
.output h2 { margin: 0 0 16px; font-size: 17px; font-weight: 600; }
.success-title { color: #81d6a9; }
.failure-title { color: #ff9389; }
.output article { margin: 0 0 12px; padding: 14px; border: 1px solid #493331; border-radius: 7px; background: #1c1918; }
.output h3 { margin: 0 0 10px; color: #f0d3cf; font-size: 14px; font-weight: 600; }
.output-comparison { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.output-comparison section { min-width: 0; }
.output-comparison h4 { margin: 0 0 6px; color: #aeb8b2; font-size: 12px; font-weight: 600; }
.output-comparison pre { width: 100%; min-height: 42px; }
.output-ending { display: block; margin-top: 8px; padding-top: 6px; border-top: 1px solid #343b37; color: #8c9991; font-size: 11px; }
.failure-detail { margin: 10px 0 0; color: #ffb0a8; font-size: 12px; }
.submission-log-warning { color: #e8c777; }
pre { margin: 0 0 8px; padding: 11px; overflow-wrap: anywhere; white-space: pre-wrap; border-radius: 5px; background: #111312; color: #cbd4ce; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
pre:last-child { margin-bottom: 0; }
.error-message { color: #ff9389; }

@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; align-content: center; gap: 24px; width: min(480px, calc(100% - 36px)); padding: 28px 0; }
  .controls { gap: 14px; }
  .output { height: 42vh; min-height: 240px; }
}
