:root {
  --ink: #111827;
  --paper: #efece3;
  --blue: #20c7c7;
  --yellow: #ffd84d;
  --red: #ff6b5e;
  --white: #fffdf8;
  --muted: #5d6570;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }

.topbar {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 20px;
  background: var(--blue);
  border-bottom: 3px solid var(--ink);
}
.brand {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -.04em;
  text-transform: uppercase;
}
.lede {
  margin: 0;
  font-size: .82rem;
  font-weight: 650;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: minmax(420px, 1fr) auto;
  gap: 14px;
  width: min(1180px, calc(100% - 28px));
  margin: 16px auto 8px;
  min-height: calc(100vh - 92px);
}
.form-panel { grid-row: 1 / 3; align-self: start; }
.viewer-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.result-panel { grid-column: 2; }

.panel {
  border: 3px solid var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
}

form {
  display: grid;
  gap: 7px;
  padding: 12px;
}
.field {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 2px solid transparent;
  cursor: pointer;
}
.field > span:first-child {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.field.is-active {
  border-color: var(--ink);
  background: #e7ffff;
}
.input-wrap { position: relative; display: block; }
input, select {
  width: 100%;
  height: 40px;
  padding: 0 42px 0 10px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fff;
  font-weight: 750;
}
select { padding-right: 8px; }
input:focus, select:focus { outline: 2px solid var(--blue); }
.input-wrap em {
  position: absolute;
  right: 10px;
  top: 50%;
  translate: 0 -50%;
  font-size: .68rem;
  font-style: normal;
  font-weight: 800;
  color: var(--muted);
}
button {
  height: 42px;
  border: 3px solid var(--ink);
  background: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
button:active { translate: 3px 3px; box-shadow: none; }
.second-landing {
  display: grid;
  gap: 7px;
  padding-top: 7px;
  border-top: 2px dashed var(--ink);
}
.second-landing[hidden],
.single-landing-only[hidden],
.landing-only[hidden] { display: none; }

.viewer-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 3px solid var(--ink);
  background: var(--blue);
  font-size: .78rem;
}
.viewer-head strong { font-size: .82rem; }
.viewer-head span { color: var(--ink); opacity: .75; }
#viewer {
  position: relative;
  flex: 1;
  min-height: 380px;
  background: #d4f1ee;
  cursor: grab;
  touch-action: none;
}
#viewer:active { cursor: grabbing; }
#viewer canvas { display: block; width: 100%; height: 100%; }
.label3d {
  padding: 3px 6px;
  border: 2px solid #111827;
  background: #ffd84d;
  color: #111827;
  font: 700 .68rem Inter, sans-serif;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.step-num {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1.5px solid #111827;
  border-radius: 50%;
  background: #fffdf8;
  color: #111827;
  font: 800 .6rem Inter, sans-serif;
  pointer-events: none;
}

.result-panel {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: stretch;
}
.verdict {
  display: grid;
  place-items: center;
  padding: 10px 6px;
  border-right: 3px solid var(--ink);
  background: var(--blue);
  font-size: .85rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}
.verdict.warn { background: var(--yellow); }
.verdict.bad { background: var(--red); }
.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}
.metrics div {
  padding: 10px 8px;
  border-right: 2px solid var(--ink);
  min-width: 0;
}
.metrics div:last-child { border-right: 0; }
.metrics small {
  display: block;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
}
.metrics b {
  display: block;
  margin-top: 2px;
  font-size: .95rem;
  letter-spacing: -.03em;
}
#checks {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 12px 10px 28px;
  border-top: 3px solid var(--ink);
  font-size: .78rem;
  line-height: 1.4;
}
#checks:empty { display: none; }

.disclaimer {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: .72rem;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    min-height: 0;
  }
  .form-panel, .result-panel { grid-row: auto; grid-column: auto; }
  #viewer { flex: none; height: 360px; min-height: 320px; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metrics div:nth-child(3) { border-right: 0; }
  .metrics div:nth-child(-n + 3) { border-bottom: 2px solid var(--ink); }
  .lede { display: none; }
}
