@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: 14px/1.45 Inter, Arial, sans-serif;
}
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, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 max(16px, calc((100vw - 1280px) / 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;
}
.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);
}
.top-nav { display: flex; align-items: center; gap: 10px; }
.top-nav a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 600;
}
.top-nav .nav-action {
  border: 1px solid var(--navy);
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
}

.workspace {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 16px 48px;
}
.page-heading {
  display: grid;
  gap: 12px;
  max-width: 940px;
  margin-bottom: 30px;
}
.tag, .label {
  width: fit-content;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.tag {
  border-radius: 3px;
  background: var(--green-bg);
  padding: 6px 10px;
}
.page-heading h1 {
  color: var(--navy);
  font-size: clamp(34px, 4.2vw, 47px);
  line-height: 1.1;
}
.intro {
  max-width: 720px;
  color: var(--muted);
  font-size: 17px;
}

.studio-grid {
  display: grid;
  grid-template-columns: 292px minmax(400px, 1fr) 332px;
  gap: 14px;
  align-items: start;
}
.setup-panel,
.canvas-panel,
.proof-panel,
.boundary {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
.setup-panel,
.proof-panel { padding: 16px; }
.setup-panel {
  display: grid;
  gap: 14px;
}
.setup-panel header,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.setup-panel h2,
.panel-head h2 {
  color: var(--navy);
  font-size: 18px;
}
.status-pill {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-low);
  color: var(--muted);
  font-size: 11px;
  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); }
.input-field { display: grid; gap: 6px; }
.input-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.input-field input {
  min-height: 43px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  padding: 0 11px;
}
.input-field input:focus {
  border-color: var(--navy);
  outline: 1px solid var(--navy);
}
.mono input, code { font-family: "Courier Prime", Consolas, monospace; }
.supporting { color: var(--muted); font-size: 12px; }
.dropzone {
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: var(--surface-low);
  padding: 17px 10px 13px;
  text-align: center;
}
.dropzone strong { color: var(--navy); }
.dropzone small { color: var(--muted); font-size: 12px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.browse {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.primary-action {
  min-height: 46px;
  border: 1px solid var(--navy);
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  padding: 0 14px;
  font-weight: 700;
}
.primary-action:disabled {
  border-color: var(--line);
  background: var(--surface-high);
  color: var(--muted);
  cursor: not-allowed;
}
.text-action {
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
}
.text-action:disabled { color: var(--line); cursor: not-allowed; }

.canvas-panel { min-height: 618px; padding: 18px; }
.candidate-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 510px;
  margin-top: 18px;
  place-content: center;
  background: var(--surface-low);
  color: var(--muted);
  text-align: center;
}
.candidate-empty strong { color: var(--navy); font-size: 16px; }
.label-wireframe {
  width: min(340px, 90%);
  border: 1px solid var(--line);
  background: #fff;
  padding: 22px;
}
.wire-title, .wire-meta, .wire-caption {
  border-radius: 3px;
  background: var(--surface-high);
}
.wire-title { height: 18px; width: 48%; margin-bottom: 12px; }
.wire-meta { height: 10px; width: 76%; margin-bottom: 28px; }
.wire-barcode {
  height: 82px;
  background: repeating-linear-gradient(90deg, var(--navy) 0 3px, transparent 3px 7px);
}
.wire-caption { height: 10px; width: 44%; margin: 12px auto 0; }
.candidate-preview {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 510px;
  margin-top: 18px;
  background: var(--surface-low);
  padding: 22px;
  text-align: center;
}
.candidate-preview img {
  max-width: 100%;
  max-height: 430px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: contain;
}
.candidate-preview strong { color: var(--navy); }
.candidate-preview p { color: var(--muted); font-size: 12px; }

.proof-panel { display: grid; gap: 16px; }
.proof-empty, .proof-result {
  border: 1px solid var(--line-soft);
  background: var(--surface-low);
  padding: 15px;
}
.proof-empty { color: var(--muted); }
.proof-empty strong { display: block; color: var(--navy); margin-bottom: 5px; }
.proof-result { display: grid; gap: 12px; }
.proof-result.pass { border-left: 4px solid var(--green); }
.proof-result.fail { border-left: 4px solid var(--red); }
.proof-result h3 { color: var(--navy); font-size: 18px; }
.proof-result.fail h3 { color: var(--red); }
.proof-result p { color: var(--muted); }
.proof-result dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin: 0;
}
.proof-result dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.proof-result dd { margin: 2px 0 0; color: var(--ink); }

.boundary {
  margin-top: 18px;
  padding: 20px;
}
.boundary h2 { color: var(--navy); font-size: 20px; margin-bottom: 15px; }
.boundary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.boundary-grid article {
  border: 1px solid var(--line-soft);
  background: var(--surface-low);
  padding: 14px;
}
.boundary-grid strong { display: block; color: var(--navy); margin-bottom: 5px; }
.boundary-grid p { color: var(--muted); }

@media (max-width: 1050px) {
  .studio-grid { grid-template-columns: 1fr; }
  .setup-panel { order: 1; }
  .canvas-panel { order: 2; }
  .proof-panel { order: 3; }
}
@media (max-width: 680px) {
  .appbar { flex-wrap: wrap; padding-block: 10px; }
  .brand { font-size: 21px; }
  .top-nav a:first-child { display: none; }
  .boundary-grid { grid-template-columns: 1fr; }
}
