:root {
  --bg: #f6f1e8;
  --bg-wash: #f4eee4;
  --paper: #ffffff;
  --ink: #1d1916;
  --muted: #6d655c;
  --soft: #9a9186;
  --line: #e4dbcd;
  --line-strong: #d2c6b4;
  --field: #f3ebe0;
  --accent: #c0392b;
  --accent-deep: #9d2418;
  --accent-soft: #f8ece9;
  --focus: #c0392b;
  --ok: #2f6b3a;
  --ok-soft: #e8f4ea;
  --err: #9d2418;
  --err-soft: #f8e8e5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 25, 22, 0.04), 0 10px 28px rgba(29, 25, 22, 0.06);
  --font: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  forced-color-adjust: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 420px at 50% -80px, rgba(192, 57, 43, 0.05), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
}

a:hover { color: var(--accent-deep); }

.lab-banner {
  margin: 0;
  padding: 10px 16px;
  background: #f3dfc4;
  color: #7a4e12;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
}

.site-header {
  padding: 14px 20px 0;
}

.header-bar {
  display: flex;
  justify-content: flex-end;
  max-width: 920px;
  margin: 0 auto;
}

.logout-row {
  margin: 0;
  font-size: 13px;
}

.logout-row a { color: var(--muted); text-decoration: none; }
.logout-row a:hover { color: var(--ink); }

.primary-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}

.primary-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
}

.primary-nav a:hover { color: var(--ink); background: rgba(255, 253, 249, 0.6); }

.primary-nav a[aria-current="page"] {
  color: var(--accent-deep);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  justify-content: center;
  margin: 4px 0 8px;
}

.brand-logo {
  display: block;
  width: min(420px, 78vw);
  height: auto;
  background: transparent;
  mix-blend-mode: multiply;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 20px 96px;
}

.page-intro {
  text-align: center;
  margin: 8px 0 28px;
}

.page-intro h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0 auto 18px;
  max-width: 520px;
  color: var(--muted);
  font-size: 16px;
}

.steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.7);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.steps li span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
}

.panel {
  background: var(--paper);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px 28px;
  margin: 0 0 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.step-num {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.panel-head p,
.section-copy {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

label, .field-label, legend {
  display: block;
  font-weight: 650;
  font-size: 13px;
  color: #3d3833;
  margin: 0 0 6px;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.req { color: var(--accent); font-weight: 700; }

.hint {
  display: block;
  margin-top: 6px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea,
.color-trigger {
  display: block;
  width: 100%;
  margin-top: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background-color: var(--field);
  color: var(--ink);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset 0 0 0 1px #d8ccb8;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236d655c' d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 32px;
}

textarea { min-height: 72px; resize: vertical; }

input:hover, select:hover, textarea:hover, .color-trigger:hover:not(:disabled) {
  background-color: #eee4d4;
}

input:focus, select:focus, textarea:focus, .color-trigger:focus {
  outline: none;
  background-color: #fff;
  box-shadow: inset 0 0 0 1px var(--focus), 0 0 0 4px rgba(192, 57, 43, 0.12);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  align-items: flex-start;
  justify-content: flex-start;
}

.row > label, .row > fieldset, .row > .field { margin: 0; }

.grow { flex: 1 1 220px; }
.field-xs { flex: 0 0 88px; max-width: 88px; }
.field-sm { flex: 0 0 168px; max-width: 188px; }
.field-width { flex: 0 0 188px; max-width: 210px; }
.field-md { flex: 0 0 240px; max-width: 280px; }
.field-email { max-width: 420px; }
.order-type-field { flex: 1.7 1 0; min-width: 280px; }
.tight { margin-top: 16px; }

.order-fields {
  justify-content: space-between;
}

.order-fields > label,
.order-fields > fieldset {
  flex: 1 1 0;
  max-width: none;
  min-width: 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  position: relative;
  margin: 0;
  font-weight: 600;
}

.pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid #d8ccb8;
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  cursor: pointer;
  transition: 0.15s ease;
}

.pill input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12);
}

.pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e2d6c4;
  border-radius: 12px;
  background: var(--field);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice-card input { margin-top: 3px; accent-color: var(--accent); width: auto; }
.choice-card:hover { border-color: var(--line-strong); }
.choice-card:has(input:checked) {
  border-color: #e2b3ac;
  background: var(--accent-soft);
}

.reprint-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-wash);
  border: 1px solid var(--line);
}

.style-card, .placement-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 16px;
}

.style-card {
  margin: 0 0 14px;
  background: var(--paper);
  border-color: var(--line-strong);
}
.placement-card { margin-top: 12px; }

.placement-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.placement-head h5 {
  display: block;
  margin: 0;
}

.placement-method-row {
  flex-wrap: nowrap;
  align-items: flex-end;
  margin: 0 0 22px;
  padding-bottom: 4px;
}

.placement-art-row {
  align-items: flex-start;
  padding-top: 4px;
}

.method-field {
  flex: 0 1 320px;
  min-width: 240px;
  max-width: 360px;
}

.placement-method-row > label.grow {
  flex: 1 1 auto;
  min-width: 200px;
}

.method-tabs {
  display: flex;
  width: 100%;
  gap: 4px;
  margin: 0;
  padding: 3px;
  height: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: #efe8dc;
}

.method-tabs button {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background-color: transparent;
  color: var(--muted);
  padding: 0 16px;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.method-tabs button.is-active {
  background-color: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(29, 25, 22, 0.08);
}

.btn-add-compact {
  margin-top: 10px;
  min-height: 42px;
}

.style-art {
  margin-top: 18px;
  padding-top: 4px;
}

.style-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.style-card-head h3,
.placement-card h5,
.panel h4 {
  margin: 22px 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.panel > h4:first-of-type { margin-top: 0; }

.style-card-head h3 { margin: 0; font-size: 17px; }
.placement-card h5 { margin: 0 0 12px; }

.btn-link, .btn-ghost, .btn-add, .submit {
  font: inherit;
  cursor: pointer;
}

.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-deep);
  font-weight: 650;
}

.btn-link.danger { color: var(--muted); }
.btn-link.danger:hover { color: var(--err); }

.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-weight: 650;
}

.btn-add:hover { background: #fff; border-color: var(--accent); color: var(--accent-deep); }

.size-block { margin-top: 16px; }

.size-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0;
  border-radius: 12px 12px 0 0;
  background: #efe8dc;
}

.size-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.size-tabs button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(29, 25, 22, 0.08);
}

.size-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0 12px 12px 12px;
  background: #fff;
}

.size-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.size-table th, .size-table td {
  border-right: 1px solid var(--line);
  padding: 0;
  text-align: center;
  font-size: 12px;
}

.size-table th:last-child, .size-table td:last-child { border-right: 0; }

.size-table th {
  background: #faf6ef;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 6px;
  letter-spacing: 0.02em;
}

.size-table input {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  padding: 12px 4px;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}

.size-table input::-webkit-outer-spin-button,
.size-table input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.size-table input:focus {
  box-shadow: inset 0 0 0 2px rgba(192, 57, 43, 0.2);
}

.pantone-field .field-label { margin-bottom: 6px; }
.colors-unknown { display: inline-block; margin: 6px 0 0; font-size: 13px; }
.pantone-picker.is-unknown { box-shadow: inset 0 0 0 1px #c4a36a; }

.placement-method-row select,
.placement-art-row select,
.placement-art-row [data-custom-width] input {
  min-height: 44px;
  height: 44px;
}

.pantone-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-height: 44px;
  height: 44px;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px #d8ccb8;
}

.pantone-picker:has(.pantone-pill) {
  height: auto;
}

.pantone-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pantone-pills:empty { display: none; }

.pantone-pill.is-unknown-pill { background: #f3e3c4; color: #7a4e12; cursor: default; }

.pantone-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 6px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.pantone-pill .swatch { width: 16px; height: 16px; flex-basis: 16px; }

.pantone-picker input[data-pantone-input] {
  flex: 1 1 140px;
  width: auto;
  min-width: 120px;
  min-height: 0;
  height: 34px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  box-shadow: none;
  background: transparent;
  font-size: 13px;
}

.pantone-picker input[data-pantone-input]:focus {
  box-shadow: none;
}

.pantone-menu {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.pantone-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.pantone-menu button:last-child { border-bottom: 0; }
.pantone-menu button:hover { background: var(--bg-wash); }

.qty-line {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.qty-line strong {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-align: center;
}

.lookup-wrap, .color-select { position: relative; }

.lookup-results, .color-menu {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.lookup-results button, .color-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}

.lookup-results button:last-child, .color-menu button:last-child { border-bottom: 0; }
.lookup-results button:hover, .color-menu button:hover { background: var(--bg-wash); }

.color-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.color-trigger:disabled { cursor: default; color: var(--soft); background-color: #f6f3ec; }

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #ddd;
  flex: 0 0 18px;
}

.dropzone {
  border: 1.5px dashed #c8bba8;
  background: #fff;
  border-radius: 16px;
  padding: 42px 18px;
  text-align: center;
  cursor: pointer;
  transition: 0.15s ease;
}

.dropzone input { display: none; }
.dropzone strong, .dropzone span { display: block; }
.dropzone strong { font-size: 16px; }
.dropzone span { margin-top: 6px; color: var(--muted); font-size: 13px; }
.dropzone:hover, .dropzone.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-wash);
  font-size: 14px;
}

.file-size { color: var(--muted); }

.form-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.submit {
  min-width: 180px;
  padding: 13px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(192, 57, 43, 0.22);
}

.submit:hover { background: var(--accent-deep); }

.errors, .success {
  padding: 12px 14px;
  margin: 0 0 14px;
  border-radius: 12px;
  font-size: 14px;
}

.errors { background: var(--err-soft); color: var(--err); }
.success { background: var(--ok-soft); color: var(--ok); }
.is-hidden { display: none !important; }

.quiet-note {
  margin: 18px 0 0;
  text-align: center;
  color: var(--soft);
  font-size: 12px;
}

@media (max-width: 740px) {
  .field-xs, .field-sm, .field-md, .field-width, .method-field { max-width: none; flex-basis: 100%; }
  .order-fields > label,
  .order-fields > fieldset { flex-basis: 100%; }
  .placement-method-row { flex-wrap: wrap; }
  .placement-method-row > label.grow { min-width: 0; }
  .panel { padding: 18px 16px 20px; }
  .form-footer { justify-content: stretch; }
  .submit { width: 100%; }
  .size-table { min-width: 560px; }
}
