@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Courier+Prime&display=swap");

:root {
  --background: #f7fafc;
  --surface: #ffffff;
  --surface-low: #f1f4f6;
  --surface-high: #e5e9eb;
  --ink: #181c1e;
  --muted: #44474c;
  --line: #c4c6cd;
  --line-soft: #d7dadc;
  --navy: #041627;
  --navy-soft: #1a2b3c;
  --green: #1b6d24;
  --green-bg: #a0f399;
  --red: #ba1a1a;
  --red-bg: #ffdad6;
  --amber: #773200;
  --amber-bg: #ffdbca;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
body::before {
  position: fixed;
  inset: 64px 0 0;
  z-index: -1;
  opacity: .32;
  background-image: radial-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: 24px 24px;
  content: "";
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
  padding: 0 max(16px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.barcode-mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-left: 3px solid var(--navy);
  border-right: 2px solid var(--navy);
  background: repeating-linear-gradient(90deg, var(--navy) 0 2px, transparent 2px 4px);
}
.mode-nav {
  display: flex;
  align-self: stretch;
  gap: 8px;
  margin-left: auto;
}
.nav-button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 600;
}
.nav-button.active {
  border-color: var(--navy);
  color: var(--navy);
}
.studio-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 12px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.studio-link:hover { background: var(--surface-low); }
.status-pill {
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-low);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-pill.working { background: var(--amber-bg); color: var(--amber); }
.status-pill.pass { background: var(--green-bg); color: var(--green); }
.status-pill.fail { background: var(--red-bg); color: var(--red); }

.console {
  max-width: 1120px;
  margin: 0 auto;
  padding: 38px 16px 48px;
}
.tool-panel[hidden] { display: none; }
.mobile-tools,
.mobile-back { display: none; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 32px;
  line-height: 1.25;
}
.page-heading p {
  color: var(--muted);
  font-size: 16px;
}

.comparison-layout,
.narrow-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.upload-workflow { display: grid; gap: 14px; }
.step-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-low);
  padding: 16px;
}
.step-card.compact { gap: 12px; }
.step-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-heading span {
  display: grid;
  flex: 0 0 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.step-heading h2 {
  color: var(--navy);
  font-size: 17px;
  line-height: 1.3;
}
.dropzone {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,.36);
  padding: 20px 12px 15px;
  text-align: center;
}
.dropzone::before {
  display: block;
  color: #74777d;
  font-size: 30px;
  line-height: 1;
  content: "\21E7";
}
.dropzone strong { font-size: 15px; color: var(--navy); }
.dropzone small { max-width: 350px; color: var(--muted); }
.dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.browse {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--muted);
  border-radius: 3px;
  padding: 0 18px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.input-field {
  display: grid;
  gap: 6px;
}
.input-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.input-field input,
.input-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--ink);
}
.input-field input:focus,
.input-field select:focus {
  border-color: var(--navy);
  outline: 1px solid var(--navy);
}
.mono-field input,
code,
.audit-table td.data {
  font-family: "Courier Prime", Consolas, monospace;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.optional {
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: var(--surface);
}
.optional summary {
  padding: 12px;
  color: var(--muted);
  font-weight: 600;
}
.optional .input-field { padding: 0 12px 12px; }
.primary-action {
  min-height: 52px;
  border: 0;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
}
.primary-action:hover { background: var(--navy-soft); }

.result-panel { min-height: 420px; }
.empty-report {
  display: grid;
  min-height: 420px;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 28px;
  color: var(--muted);
  text-align: center;
}
.empty-report strong {
  color: var(--navy);
  font-size: 20px;
}
.result {
  display: grid;
  gap: 14px;
}
.result-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid var(--green);
  border-radius: 3px;
  background: var(--green-bg);
  padding: 18px;
  color: var(--green);
}
.result.fail .result-banner {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
.result-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 25px;
}
.result.fail .result-mark { background: rgba(255,255,255,.18); }
.result-banner h2 { font-size: 25px; }
.result-banner p { opacity: .9; font-size: 15px; }
.audit {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
}
.audit h3 {
  background: var(--navy);
  padding: 12px 14px;
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.audit-table th {
  background: var(--surface-high);
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
}
.audit-table th,
.audit-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 12px;
}
.audit-table tr:last-child td { border-bottom: 0; }
.audit-table tbody tr:nth-child(even) { background: var(--surface-low); }
.audit-table td.changed {
  background: rgba(255,218,214,.55);
  color: var(--red);
  font-weight: 700;
}
.recommendation {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 4px;
  background: var(--surface-low);
  padding: 16px;
}
.result.fail .recommendation { border-left-color: var(--red); }
.recommendation h3 {
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 17px;
}
.recommendation p { color: var(--muted); }
.issues {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.issues li + li { margin-top: 6px; }
.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.proof {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  padding: 10px;
}
.result.fail .proof.candidate { border-color: var(--red); }
.proof strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}
.proof img {
  width: 100%;
  height: 124px;
  object-fit: contain;
  background: var(--surface-low);
}
.proof code {
  display: block;
  overflow: hidden;
  margin-top: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 880px) {
  .appbar { gap: 14px; padding: 12px 16px; }
  .brand { font-size: 22px; }
  .mode-nav { display: none; }
  .status-pill { margin-left: auto; }
  .console { padding-top: 28px; }
  .page-heading h1 { font-size: 26px; }
  .mobile-tools {
    display: block;
    margin: -10px 0 18px;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 12px;
    color: var(--muted);
  }
  .mobile-tools summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
  }
  .mobile-tools div {
    display: flex;
    gap: 8px;
    padding-top: 10px;
  }
  .mobile-tools button,
  .mobile-back {
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--surface);
    padding: 9px 12px;
    color: var(--navy);
    font-weight: 600;
  }
  .mobile-back {
    display: block;
    margin: -10px 0 18px;
  }
  .comparison-layout,
  .narrow-workspace { grid-template-columns: 1fr; }
  .field-grid,
  .proof-grid { grid-template-columns: 1fr; }
  .empty-report { min-height: 220px; }
}
