:root {
  --ink: #20282e;
  --muted: #65727b;
  --line: #d9e1e6;
  --paper: #f4f7f9;
  --surface: #ffffff;
  --steel: #20282e;
  --steel-deep: #11181d;
  --steel-soft: #eef2f4;
  --brand-blue: #2a93c8;
  --brand-blue-deep: #1478a5;
  --brand-blue-soft: #eaf6fb;
  --gold: #896009;
  --gold-soft: #f6edd7;
  --success-soft: #e5efea;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  line-height: 1.4;
  min-height: 100vh;
}

a {
  color: var(--ink);
}

.app-bar {
  align-items: center;
  background: #12181c;
  border-bottom: 3px solid var(--brand-blue);
  display: flex;
  min-height: 88px;
  justify-content: space-between;
  padding: 10px clamp(20px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  align-items: center;
  color: #fff;
  display: flex;
  gap: 22px;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 66px;
  object-fit: contain;
  width: auto;
}

.brand span {
  border-left: 1px solid rgba(255, 255, 255, 0.32);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.98rem;
  font-weight: 600;
  padding-left: 22px;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 6px;
}

.app-tools,
.language-switch {
  align-items: center;
  display: flex;
  gap: 6px;
}

nav a,
.language-switch a,
.quiet-button,
button {
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

nav a.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
}

.language-switch {
  border-left: 1px solid var(--line);
  margin-left: 8px;
  padding-left: 12px;
}

.language-switch a {
  color: rgba(255, 255, 255, 0.78);
  min-width: 42px;
}

.language-switch a.selected {
  background: #fff;
  border-color: #fff;
  color: var(--steel-deep);
}

.app-bar nav a {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.app-bar .language-switch {
  border-left-color: rgba(255, 255, 255, 0.28);
}

.language-switch a:not(.selected):hover,
.app-bar nav a:hover {
  border-color: rgba(255, 255, 255, 0.32);
  color: white;
}

.workspace,
.offer-sheet {
  margin: 0 auto;
  max-width: 1260px;
  padding: clamp(28px, 4vw, 52px);
}

.upload-workspace {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1080px;
}

.page-head {
  grid-column: 1 / -1;
}

.page-head.compact {
  margin-bottom: 22px;
}

.admin-head-actions {
  margin-top: 14px;
}

.page-head h1,
.offer-header h1,
.error-page h1 {
  color: var(--ink);
  font-size: 2.35rem;
  font-weight: 650;
  line-height: 1.12;
  margin: 7px 0 9px;
}

.page-head p {
  color: var(--muted);
  font-size: 1rem;
  margin: 0;
}

.eyebrow {
  color: var(--brand-blue-deep);
  font-size: 0.74rem;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
}

h2 {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
  margin: 0;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(16px, 2vw, 24px);
}

.upload-form,
.review-form,
.pricing-form {
  display: grid;
  gap: 0;
}

.upload-surface {
  box-shadow: 0 14px 36px rgb(26 42 52 / 8%);
  padding: 0;
}

.form-section {
  padding: clamp(22px, 3vw, 32px);
}

.form-section + .form-section {
  border-top: 1px solid var(--line);
}

.form-section-head {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.section-number {
  align-items: center;
  background: var(--brand-blue);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.request-details {
  border-top: 1px solid var(--line);
}

.notes-field {
  margin-top: 14px;
}

.form-submit {
  align-items: center;
  background: #f8fafb;
  border-radius: 0 0 8px 8px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 20px clamp(22px, 3vw, 32px);
}

.submit-request-button {
  flex: 0 0 auto;
  min-height: 48px;
  padding-left: 24px;
  padding-right: 24px;
}

.privacy-acknowledgement {
  align-items: start;
  color: var(--ink);
  display: grid;
  flex: 1 1 auto;
  font-weight: 400;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  line-height: 1.45;
  max-width: 660px;
}

.privacy-acknowledgement input {
  height: 18px;
  margin: 2px 0 0;
  min-height: 18px;
  padding: 0;
  width: 18px;
}

.privacy-acknowledgement a {
  color: #176d99;
  font-weight: 700;
}

.legal-workspace {
  max-width: 980px;
}

.legal-surface {
  display: grid;
  gap: 25px;
}

.legal-surface section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.legal-surface h2 {
  margin-bottom: 9px;
}

.legal-surface p,
.legal-surface li {
  line-height: 1.58;
}

.legal-surface p {
  margin: 0;
}

.legal-surface ul {
  margin: 10px 0 0;
  padding-left: 22px;
}

.legal-intro {
  color: var(--muted);
  font-size: 1.02rem;
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 0.82rem;
  justify-content: space-between;
  margin: 20px auto 0;
  max-width: 1260px;
  padding: 20px clamp(22px, 4vw, 48px) 28px;
}

.site-footer div {
  display: grid;
  gap: 4px;
}

.site-footer strong {
  color: var(--ink);
}

.site-footer nav {
  gap: 18px;
}

.site-footer nav a {
  border: 0;
  color: var(--muted);
  min-height: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-version {
  bottom: 5px;
  color: var(--muted);
  font-size: 0.6rem;
  left: 7px;
  line-height: 1;
  opacity: 0.58;
  pointer-events: none;
  position: fixed;
  z-index: 20;
}

.form-grid,
.review-form {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.company-search-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.company-autocomplete {
  position: relative;
}

.company-suggestions {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 14px 30px rgb(18 36 46 / 15%);
  left: 0;
  max-height: 280px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 3px);
  z-index: 30;
}

.company-suggestions[hidden] {
  display: none;
}

.company-suggestion {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 11px 13px;
  text-align: left;
  width: 100%;
}

.company-suggestion:last-child {
  border-bottom: 0;
}

.company-suggestion:hover,
.company-suggestion.active {
  background: var(--brand-blue-soft);
}

.company-suggestion strong {
  font-size: 0.92rem;
}

.company-suggestion span,
.company-search-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.company-search-status {
  margin: 0;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.84rem;
  font-weight: 750;
  gap: 7px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #bdc8cf;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 48px;
  padding: 11px 13px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
  width: 100%;
}

input::placeholder,
textarea::placeholder {
  color: #98a3aa;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgb(42 147 200 / 16%);
  outline: 0;
}

.quantity-control {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  width: 100%;
}

.quantity-control input {
  border-right: 0;
  min-height: 48px;
  -moz-appearance: textfield;
}

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

.quantity-buttons {
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.quantity-step {
  align-items: center;
  background: #f7f9fa;
  border: 1px solid #bdc8cf;
  border-radius: 0;
  color: var(--ink);
  display: flex;
  font-size: 1.02rem;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  min-height: 24px;
  padding: 0;
}

.quantity-step + .quantity-step {
  border-top: 0;
}

.quantity-step:hover {
  background: var(--brand-blue-soft);
  color: var(--brand-blue-deep);
}

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

.file-drop {
  background: #f6f6f6;
  border: 1px dashed #8d8d8d;
  border-radius: 2px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 9px;
  justify-content: center;
  min-height: 146px;
  padding: 20px;
  position: relative;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.file-title {
  font-size: 1.05rem;
}

.file-hint,
.empty,
td span {
  color: var(--muted);
}

.file-drop input[type="file"] {
  cursor: pointer;
  height: 100%;
  inset: 0;
  opacity: 0;
  padding: 0;
  position: absolute;
  width: 100%;
}

.admin-file-drop.drag-over,
.admin-file-drop:hover {
  background: var(--brand-blue-soft);
  border-color: var(--brand-blue);
}

.admin-file-drop.has-file {
  background: #f5fbf7;
  border-color: #7aa948;
}

.testing-form.expanded-drag-over,
.upload-part-row.expanded-drag-over {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgb(42 147 200 / 12%);
}

.testing-form.drop-rejected,
.upload-part-row.drop-rejected {
  border-color: #a31d1d;
}

.part-upload-list {
  display: grid;
  gap: 14px;
  padding: clamp(22px, 3vw, 32px);
}

.compact-head {
  margin-bottom: 0;
}

.add-part-button {
  align-items: center;
  background: #f8fafb;
  border-color: #b8c6ce;
  border-style: dashed;
  color: var(--ink);
  display: flex;
  font-size: 0.84rem;
  gap: 9px;
  justify-content: center;
  min-height: 52px;
  padding: 12px 14px;
  width: 100%;
}

.add-part-button:hover {
  background: var(--brand-blue-soft);
  border-color: var(--brand-blue);
  color: var(--brand-blue-deep);
}

.add-part-icon {
  align-items: center;
  background: var(--brand-blue);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 1.15rem;
  font-weight: 500;
  height: 24px;
  justify-content: center;
  line-height: 1;
  width: 24px;
}

.upload-part-row {
  align-items: stretch;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.58fr) 38px;
  padding: 18px;
  position: relative;
}

.upload-part-index {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 7px;
  grid-column: 1 / -1;
  padding-bottom: 13px;
}

.upload-part-index strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1;
}

.upload-part-index span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.upload-file-pair {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upload-file-field {
  background: var(--surface);
  border: 1px dashed #aebdc6;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: start;
  min-height: 136px;
  padding: 15px;
  position: relative;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.upload-file-field:hover {
  background: var(--brand-blue-soft);
  border-color: var(--brand-blue);
}

.file-format {
  background: var(--steel-soft);
  border-radius: 4px;
  color: var(--ink);
  display: inline-flex;
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
  padding: 5px 7px;
  width: fit-content;
}

.step-upload .file-format {
  background: var(--brand-blue);
  color: #fff;
}

.drawing-upload .file-format {
  background: #e9edf0;
  color: #46535b;
}

.upload-file-field input {
  cursor: pointer;
  height: 100%;
  inset: 0;
  opacity: 0;
  padding: 0;
  position: absolute;
  width: 100%;
}

.upload-file-field.drag-over {
  background: var(--brand-blue-soft);
  border-color: var(--brand-blue);
  box-shadow: inset 0 0 0 1px var(--brand-blue), 0 0 0 3px rgb(42 147 200 / 12%);
}

.upload-file-field.has-file {
  background: #f5fbf7;
  border-color: #7aa948;
}

.upload-file-field.drop-rejected {
  background: #fff2f0;
  border-color: #a31d1d;
}

.file-selected {
  color: var(--brand-blue-deep);
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: auto;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.upload-part-meta {
  align-self: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 104px;
}

.compact-file {
  min-height: 94px;
  padding: 14px;
}

.compact-file .file-title {
  font-size: 0.92rem;
}

.compact-file .file-hint {
  font-size: 0.78rem;
}

.remove-part-button {
  align-self: end;
  background: transparent;
  border-color: transparent;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.35rem;
  min-height: 38px;
  min-width: 38px;
  padding: 0;
}

.remove-part-button:not(:disabled):hover {
  background: #fff2f2;
  border-color: #e2b9b9;
  color: #8f1d1d;
}

.remove-part-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.optional-file {
  min-height: 112px;
}

.compact-file.optional-file {
  min-height: 94px;
}

.part-annotation {
  border: 1px solid var(--line);
  display: grid;
  gap: 14px;
  padding: 14px;
}

.annotation-head {
  margin-bottom: 0;
}

.annotation-head .quiet-button {
  font-size: 0.78rem;
  min-height: 34px;
  padding: 7px 10px;
  text-transform: uppercase;
}

.annotation-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.7fr);
}

.viewer-shell {
  background: #f7f7f7;
  border: 1px solid var(--line);
  min-height: 280px;
}

.upload-part-view {
  cursor: crosshair;
  display: block;
  height: auto;
  min-height: 280px;
  touch-action: none;
  width: 100%;
}

.viewer-background {
  fill: #fbfbfb;
}

.part-lines {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
  vector-effect: non-scaling-stroke;
}

.part-marker .marker-leader,
.part-marker .marker-arrow {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.part-marker .marker-dot {
  fill: #b92323;
  stroke: #fff;
  stroke-width: 2;
}

.part-marker rect {
  fill: var(--gold-soft);
  stroke: var(--gold);
  stroke-width: 2;
}

.part-marker text {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 800;
  pointer-events: none;
  text-anchor: middle;
}

.viewer-empty {
  fill: var(--muted);
  font-size: 24px;
  font-weight: 700;
  text-anchor: middle;
}

.marker-tools {
  display: grid;
  gap: 12px;
  align-content: start;
}

.marker-tools p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
}

.marker-list {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.marker-list li {
  align-items: center;
  background: #f6f6f6;
  border: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 8px 9px;
}

.marker-list li.empty {
  color: var(--muted);
  display: block;
}

.marker-list button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
  min-height: 28px;
  padding: 3px 8px;
}

button {
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(42 147 200 / 28%);
  outline-offset: 2px;
}

.primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: white;
  font-size: 0.88rem;
  width: fit-content;
}

.quiet-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.inline-form {
  display: inline;
  margin: 0;
}

.icon-delete-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: inline-flex;
  font-size: 1.35rem;
  height: 30px;
  justify-content: center;
  line-height: 1;
  min-height: 30px;
  padding: 0;
  text-transform: none;
  width: 30px;
}

.icon-delete-button:hover {
  background: #fff5f5;
  border-color: #9b2d2d;
  color: #8f1d1d;
}

.icon-delete-button span {
  transform: translateY(-1px);
}

.danger {
  background: #8f1d1d;
  border-color: #6f1515;
  color: white;
  font-size: 0.86rem;
  text-transform: uppercase;
  width: fit-content;
}

.primary:hover {
  background: var(--brand-blue-deep);
  border-color: var(--brand-blue-deep);
  box-shadow: 0 6px 16px rgb(20 120 165 / 20%);
}

.danger:hover {
  background: #651111;
}

.queue {
  min-width: 0;
}

.section-head,
.detail-head,
.offer-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 15px;
}

.request-table,
.breakdown,
.offer-price {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.request-table th,
.request-table td,
.breakdown th,
.breakdown td,
.offer-price th,
.offer-price td {
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  text-align: left;
  vertical-align: top;
}

.request-table th,
.offer-price th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.request-table td:first-child {
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}

.request-table td:not(:first-child),
.request-table th:not(:first-child) {
  text-align: right;
}

.request-table .location-column {
  text-align: left;
}

.queue-origin-location {
  gap: 7px;
  white-space: normal;
}

.queue-origin-copy {
  display: grid;
  gap: 2px;
  line-height: 1.15;
}

.queue-origin-copy strong {
  font-size: 0.88rem;
}

.queue-origin-copy small,
.queue-location-unavailable {
  color: var(--muted);
  font-size: 0.78rem;
}

.score,
.status {
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  justify-content: center;
  min-width: 44px;
  padding: 5px 9px;
}

.score.calm {
  background: var(--success-soft);
  border-color: #9bc7b8;
}

.score.alert {
  background: var(--gold-soft);
  border-color: #dfb267;
  color: #6e4403;
}

.status {
  background: var(--steel-soft);
  border-color: #c7c7c7;
}

.price-statuses {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.price-confidence {
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  justify-content: center;
  min-width: 58px;
  padding: 5px 9px;
  text-transform: uppercase;
}

.price-confidence-group {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.price-review-alert {
  background: #f8e7e5;
  border: 1px solid #d8a29d;
  border-radius: 2px;
  color: #7a231c;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 7px;
  text-transform: uppercase;
}

.confidence-high {
  background: var(--success-soft);
  border-color: #79b8a1;
  color: #164e3c;
}

.confidence-medium {
  background: var(--gold-soft);
  border-color: #dfb267;
  color: #6e4403;
}

.confidence-low {
  background: #f8e7e5;
  border-color: #d8a29d;
  color: #7a231c;
}

.price-confidence-note {
  border-left: 3px solid var(--brand-blue);
  color: var(--muted);
  font-size: 0.9rem;
  margin: 14px 0 0;
  padding: 7px 10px;
}

.detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(360px, 1fr) minmax(340px, 0.9fr);
  margin-bottom: 18px;
}

.actions,
.offer-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.actions form {
  margin: 0;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.metrics div {
  border-top: 1px solid var(--line);
  min-width: 0;
  padding-top: 9px;
}

dt {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  font-weight: 650;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.origin-location {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.origin-flag {
  font-size: 1.35rem;
  line-height: 1;
}

.warning-list {
  color: #63380a;
  margin-top: 17px;
}

.warning-list p {
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  margin: 8px 0;
  padding: 9px 11px;
}

.breakdown th {
  font-weight: 650;
}

.breakdown td,
.offer-price td:last-child,
.offer-price th:last-child {
  text-align: right;
}

.breakdown tr.total th,
.breakdown tr.total td {
  font-size: 1.08rem;
  font-weight: 850;
}

.review-surface,
.context-surface,
.retention-surface {
  margin-top: 18px;
}

.review-form {
  align-items: end;
  grid-template-columns: 180px 190px 190px minmax(220px, 1fr) auto;
}

.review-form .wide {
  min-width: 0;
}

.retention-note {
  color: #666;
  margin: 0 0 14px;
}

.retention-metrics {
  margin-bottom: 16px;
}

.retention-actions,
.retention-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.retention-form label {
  min-width: min(420px, 100%);
}

.pricing-surface {
  margin-top: 22px;
}

.admin-head-actions form {
  margin: 0;
}

.quiet-button.danger {
  border-color: #9b2d2d;
  color: #9b2d2d;
}

.market-price-surface {
  margin-top: 22px;
}

.market-price-table {
  margin-top: 12px;
}

.market-price-note {
  margin: 12px 0 0;
  color: #6c6c6c;
  font-size: 0.9rem;
}

.testing-surface,
.testing-results {
  margin-top: 18px;
}

.redaction-workspace {
  max-width: 920px;
}

.redaction-surface {
  box-shadow: 0 14px 36px rgb(26 42 52 / 8%);
}

.redaction-form {
  display: grid;
  gap: 22px;
}

.redaction-file-drop {
  align-items: center;
  background: #f8fafb;
  border-color: #9eafb9;
  min-height: 230px;
  padding: 34px;
  text-align: center;
}

.redaction-file-drop .file-title {
  font-size: 1.2rem;
}

.redaction-file-drop .file-selected {
  margin-top: 8px;
}

.selected-file-list {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.selected-file-list[hidden] {
  display: none;
}

.selected-file-list ul {
  border: 1px solid var(--line);
  border-radius: 6px;
  list-style: none;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 0;
  width: 100%;
}

.selected-file-list li {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 6px 12px;
}

.selected-file-list li + li {
  border-top: 1px solid var(--line);
}

.selected-file-list li span {
  overflow-wrap: anywhere;
}

.file-remove {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  flex: none;
  font-size: 1.2rem;
  line-height: 1;
  padding: 2px 6px;
}

.file-remove:hover {
  color: #a31d1d;
}

.redaction-template {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.redaction-template h2,
.redaction-template p {
  margin: 0;
}

.redaction-template p {
  color: var(--muted);
  margin-top: 5px;
}

.redaction-template-controls {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.redaction-template-controls label {
  display: grid;
  gap: 6px;
}

.redaction-template-editor[hidden] {
  display: none;
}

.redaction-template-editor {
  display: grid;
  gap: 12px;
}

.redaction-template-hint {
  font-size: 0.92rem;
}

.redaction-template-canvas {
  background: white;
  border: 1px solid #aebbc3;
  line-height: 0;
  position: relative;
  width: fit-content;
}

.redaction-template-canvas img {
  display: block;
  height: auto;
  max-width: 100%;
  pointer-events: none;
  user-select: none;
}

.redaction-template-overlay {
  cursor: crosshair;
  inset: 0;
  position: absolute;
  touch-action: none;
}

.redaction-template-area {
  background: rgb(204 31 31 / 28%);
  border: 2px solid #c51f1f;
  box-sizing: border-box;
  pointer-events: none;
  position: absolute;
}

.redaction-template-area.is-draft {
  background: rgb(204 31 31 / 16%);
  border-style: dashed;
}

.redaction-template-footer {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.redaction-template-footer > span {
  color: var(--muted);
  font-size: 0.9rem;
}

.redaction-summary {
  border-left: 3px solid var(--brand-blue);
  padding-left: 16px;
}

.redaction-summary p {
  color: var(--muted);
  margin: 5px 0 0;
}

.processing-progress {
  display: grid;
  gap: 9px;
}

.processing-progress[hidden] {
  display: none;
}

.processing-progress-head {
  align-items: baseline;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.processing-progress-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.processing-progress-track {
  background: #dfe6ea;
  height: 12px;
  overflow: hidden;
  position: relative;
}

.processing-progress-track span {
  background: var(--brand-blue);
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms ease;
  width: 100%;
}

.processing-progress-track.is-indeterminate span {
  animation: processing-progress 1.15s ease-in-out infinite;
  transform: translateX(-100%) scaleX(0.38);
}

@keyframes processing-progress {
  50% {
    transform: translateX(80%) scaleX(0.38);
  }

  100% {
    transform: translateX(200%) scaleX(0.38);
  }
}

.redaction-form.is-processing .redaction-file-drop,
.redaction-form.is-processing .redaction-template,
.redaction-form.is-processing .redaction-summary,
.redaction-form.is-processing > .actions {
  opacity: 0.75;
}

@media (max-width: 680px) {
  .redaction-template-controls {
    grid-template-columns: 1fr;
  }

  .redaction-template-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

.testing-form {
  display: grid;
  gap: 15px;
}

.testing-controls {
  max-width: 620px;
}

.testing-results {
  overflow-x: auto;
}

.testing-table {
  min-width: 860px;
}

.testing-file-stack {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.testing-file-stack strong {
  overflow-wrap: anywhere;
}

.testing-file-stack small {
  color: var(--muted);
  display: grid;
  font-size: 0.76rem;
  gap: 2px;
  overflow-wrap: anywhere;
}

.testing-file-stack small span {
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 850;
}

.sourcing-badge {
  display: inline-block;
  max-width: 150px;
  padding: 4px 7px;
  border: 1px solid #c9c9c9;
  color: #303030;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.sourcing-outsource {
  border-color: #c49137;
  background: #f8edcf;
  color: #6d4a12;
}

.expected-price-input {
  min-height: 34px;
  min-width: 110px;
  padding: 6px 8px;
}

.learning-match {
  color: #176b50;
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  margin-top: 4px;
}

.learning-form {
  display: grid;
  gap: 14px;
}

.learning-price-form {
  display: grid;
  gap: 6px;
  width: 100%;
}

.learning-price-form input {
  min-height: 34px;
  min-width: 0;
  padding: 6px 8px;
  width: 100%;
}

.compact-button {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
  width: 100%;
}

.testing-history-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
  width: 100%;
}

.testing-history-table {
  min-width: 1080px;
}

.testing-history-table th:nth-child(1),
.testing-history-table td:nth-child(1) {
  width: 210px;
}

.testing-history-table td:nth-child(1) strong {
  overflow-wrap: anywhere;
}

.testing-history-table td:nth-child(1) small,
.testing-history-table td:nth-child(3) small,
.learning-price-summary small,
.learning-difference-summary small {
  color: var(--muted);
  display: block;
  font-size: 0.75rem;
}

.testing-history-table td:nth-child(1) small {
  white-space: nowrap;
}

.testing-history-table th:nth-child(2),
.testing-history-table td:nth-child(2) {
  width: 115px;
}

.testing-history-table th:nth-child(3),
.testing-history-table td:nth-child(3) {
  width: 90px;
}

.testing-history-table th:nth-child(4),
.testing-history-table td:nth-child(4) {
  width: 160px;
}

.testing-history-table th:nth-child(5),
.testing-history-table td:nth-child(5) {
  width: 175px;
}

.testing-history-table th:nth-child(6),
.testing-history-table td:nth-child(6) {
  width: 135px;
}

.testing-history-table th:nth-child(7),
.testing-history-table td:nth-child(7) {
  width: 140px;
}

.testing-history-table th:nth-child(8),
.testing-history-table td:nth-child(8) {
  width: 55px;
}

.learning-price-summary,
.learning-difference-summary {
  display: grid;
  gap: 4px;
}

.learning-price-summary > strong,
.learning-difference-summary > strong {
  white-space: nowrap;
}

.learning-price-summary .learning-price-form {
  margin-top: 4px;
}

.learning-ok,
.learning-review,
.learning-off {
  font-weight: 800;
}

.learning-ok {
  color: #1f6b42;
}

.learning-review {
  color: #7b5307;
}

.learning-off {
  color: #8f1d1d;
}

.pricing-toggle {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 1.05rem;
  gap: 12px;
  justify-content: space-between;
  text-transform: uppercase;
}

.pricing-toggle::before {
  align-items: center;
  border: 1px solid var(--line);
  content: "+";
  display: inline-flex;
  flex: 0 0 26px;
  font-weight: 700;
  height: 26px;
  justify-content: center;
}

.pricing-toggle span {
  margin-right: auto;
}

.pricing-toggle small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.pricing-surface[open] .pricing-toggle::before {
  content: "-";
}

.pricing-surface[open] .pricing-toggle {
  border-bottom: 1px solid var(--line);
  margin-bottom: 15px;
  padding-bottom: 15px;
}

.pricing-groups {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pricing-form fieldset {
  border: 1px solid var(--line);
  margin: 0;
  min-width: 0;
  padding: 15px;
}

.pricing-form legend {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0 6px;
  text-transform: uppercase;
}

.parameter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.material-parameter-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.material-parameter-table th,
.material-parameter-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
}

.material-parameter-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.material-parameter-table tbody th {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.offer-sheet {
  background: var(--surface);
  min-height: calc(100vh - 110px);
}

.offer-lines {
  border-top: 2px solid var(--ink);
  display: grid;
  gap: 28px;
  padding-top: 28px;
}

.offer-document-head {
  align-items: center;
  display: flex;
  gap: 20px;
  min-width: 0;
}

.offer-document-logo {
  align-items: center;
  background: var(--steel-deep);
  display: flex;
  flex: 0 0 auto;
  height: 92px;
  justify-content: center;
  padding: 7px 14px;
  width: 158px;
}

.offer-document-logo img {
  display: block;
  height: 78px;
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.offer-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.drawing-sheet {
  border: 1px solid var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(280px, 0.9fr);
  min-height: 560px;
}

.drawing-field {
  border-right: 1px solid var(--ink);
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: clamp(16px, 2.2vw, 28px);
}

.part-figure {
  display: grid;
  gap: 12px;
  margin: 0;
  min-height: 0;
}

.part-figure figcaption {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 9px;
}

.part-figure figcaption span {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
}

.part-figure figcaption strong {
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.part-preview {
  display: block;
  height: auto;
  width: 100%;
}

.part-preview g {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
  vector-effect: non-scaling-stroke;
}

.part-preview.envelope g {
  stroke-dasharray: 7 5;
}

.part-preview .part-annotation-markers {
  fill: none;
  stroke: none;
}

.part-preview .part-annotation-markers .marker-leader,
.part-preview .part-annotation-markers .marker-arrow {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.part-preview .part-annotation-markers .marker-dot {
  fill: #b92323;
  stroke: #fff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.part-preview .part-annotation-markers rect {
  fill: var(--gold-soft);
  stroke: var(--gold);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.part-preview .part-annotation-markers text {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 800;
  stroke: none;
  text-anchor: middle;
}

.offer-annotation-legend {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.offer-annotation-legend ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
}

.offer-annotation-legend li {
  overflow-wrap: anywhere;
}

.part-view-grid {
  align-items: stretch;
  display: grid;
  gap: 12px 24px;
  grid-template-areas:
    "main end"
    "top iso";
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.72fr);
  min-height: 390px;
}

.part-view {
  align-content: center;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.part-view span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.part-view-main {
  grid-area: main;
}

.part-view-top {
  grid-area: top;
}

.part-view-end {
  grid-area: end;
}

.part-view-iso {
  grid-area: iso;
}

.part-preview-empty {
  align-items: center;
  border: 1px dashed var(--line);
  color: var(--muted);
  display: flex;
  justify-content: center;
  min-height: 310px;
}

.uploaded-drawing-preview {
  border: 1px solid var(--line);
  min-height: 390px;
}

.uploaded-drawing-preview object {
  display: block;
  height: 520px;
  width: 100%;
}

.drawing-price-note {
  align-self: end;
  color: #bd2424;
  font-weight: 700;
  margin: 0;
}

.drawing-title-block {
  align-content: end;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.drawing-title-block div {
  border-bottom: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  min-width: 0;
  padding: 11px 12px;
}

.drawing-title-block div:nth-child(2n),
.drawing-title-block .wide {
  border-right: 0;
}

.drawing-title-block .wide {
  grid-column: 1 / -1;
}

.drawing-title-block div:first-child,
.drawing-title-block div:nth-child(2) {
  border-top: 1px solid var(--ink);
}

.assumptions {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding-top: 18px;
}

.assumptions h2 {
  color: var(--ink);
}

.error-page {
  max-width: 720px;
}

.login-page,
.message-page {
  max-width: 720px;
}

.login-form {
  display: grid;
  gap: 13px;
  margin-top: 20px;
  max-width: 360px;
}

.form-alert {
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  margin: 14px 0;
  padding: 10px 12px;
}

.message-page .surface {
  display: grid;
  gap: 14px;
}

.message-page h1,
.login-page h1 {
  margin-bottom: 0;
}

.message-metrics {
  margin: 8px 0;
}

@media (max-width: 860px) {
  .detail-head,
  .offer-header,
  .offer-document-head {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
  }

  .app-bar {
    align-items: center;
    flex-direction: row;
    padding-bottom: 12px;
    padding-top: 12px;
  }

  .app-tools {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .language-switch {
    margin-left: 0;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .upload-workspace,
  .detail-grid,
  .form-grid,
  .upload-part-row,
  .pricing-groups,
  .parameter-grid,
  .annotation-layout,
  .review-form,
  .metrics,
  .offer-meta,
  .drawing-sheet {
    grid-template-columns: 1fr;
  }

  .drawing-field {
    border-bottom: 1px solid var(--ink);
    border-right: 0;
  }

  .upload-part-index {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    grid-template-columns: auto 1fr;
    justify-items: start;
    padding-bottom: 10px;
    padding-right: 0;
  }

  .remove-part-button {
    position: absolute;
    right: 14px;
    top: 12px;
  }

  .part-view-grid {
    grid-template-areas:
      "main"
      "top"
      "end"
      "iso";
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .request-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .app-bar {
    min-height: 72px;
    padding: 8px 14px;
  }

  .brand {
    gap: 0;
  }

  .brand img {
    height: 54px;
  }

  .brand span {
    display: none;
  }

  .app-tools {
    flex-wrap: nowrap;
    gap: 2px;
    margin-left: auto;
  }

  .app-bar nav a,
  .language-switch a {
    font-size: 0.72rem;
    min-height: 36px;
    padding: 7px 9px;
  }

  .language-switch {
    margin-left: 3px;
    padding-left: 6px;
  }

  .workspace,
  .offer-sheet {
    padding: 24px 14px 36px;
  }

  .page-head h1,
  .offer-header h1,
  .error-page h1 {
    font-size: 2rem;
  }

  .form-section,
  .part-upload-list {
    padding: 20px 16px;
  }

  .upload-part-row {
    padding: 15px;
  }

  .upload-file-pair,
  .upload-part-meta {
    grid-template-columns: 1fr;
  }

  .form-submit {
    align-items: stretch;
    flex-direction: column;
    padding: 18px 16px;
  }

  .submit-request-button {
    width: 100%;
  }

  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media print {
  @page {
    margin: 10mm;
    size: A3 landscape;
  }

  .app-bar,
  .offer-actions,
  .site-footer,
  .app-version {
    display: none;
  }

  body,
  .offer-sheet {
    background: white;
  }

  .offer-sheet {
    max-width: none;
    padding: 0;
  }

  .offer-lines {
    gap: 5mm;
    padding-top: 5mm;
  }

  .offer-document-logo {
    height: 24mm;
    padding: 2mm 4mm;
    width: 41mm;
  }

  .offer-document-logo img {
    height: 20mm;
  }

  .drawing-sheet {
    break-inside: avoid;
    min-height: 150mm;
  }

  .drawing-field {
    padding: 5mm;
  }

  .part-preview {
    max-height: 112mm;
  }

  .part-view-grid {
    min-height: 105mm;
  }
}

/* ------------------------------------------------------------------
   Customer configurator: drawing-sheet stage with live STEP preview
   ------------------------------------------------------------------ */

:root {
  --graphite: #0d141a;
  --graphite-raised: #141e26;
  --graphite-line: rgb(255 255 255 / 9%);
  --wire-front: #8fd6ff;
  --wire-mid: #47aee2;
  --wire-back: #2a6f93;
  --radius-lg: 16px;
  --radius-md: 10px;
}

input,
select,
textarea {
  border-color: #c9d3d9;
  border-radius: var(--radius-md);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9fb0ba;
}

.primary {
  border-radius: var(--radius-md);
  box-shadow: 0 6px 16px rgb(20 120 165 / 24%);
}

.primary:hover {
  background: var(--brand-blue-deep);
  border-color: var(--brand-blue-deep);
}

.surface {
  border-radius: var(--radius-lg);
}

.upload-surface {
  box-shadow: 0 1px 2px rgb(13 20 26 / 6%), 0 24px 60px rgb(13 20 26 / 10%);
  overflow: hidden;
}

.configurator {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 1fr);
}

.configurator-side {
  border-left: 1px solid var(--line);
  min-width: 0;
}

.configurator .part-upload-list {
  align-content: start;
}

.configurator .upload-part-row {
  border-radius: 12px;
  cursor: default;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 34px;
  padding: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.configurator .upload-part-index {
  grid-column: 1;
  padding-bottom: 10px;
}

.configurator .upload-file-pair,
.configurator .upload-part-meta {
  grid-column: 1 / -1;
}

.configurator .remove-part-button {
  grid-column: 2;
  grid-row: 1;
  min-height: 30px;
  min-width: 30px;
}

.configurator .upload-file-field {
  min-height: 108px;
  padding: 13px;
}

.configurator .upload-part-meta {
  align-self: stretch;
  grid-template-columns: minmax(0, 1fr) 112px;
}

.upload-part-row.is-previewed {
  background: #fff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgb(42 147 200 / 14%);
}

.upload-part-row.is-previewed .upload-part-index strong {
  color: var(--brand-blue-deep);
}





/* Stage */

.part-viewer {
  background-color: var(--graphite);
  background-image:
    linear-gradient(rgb(42 147 200 / 16%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 147 200 / 16%) 1px, transparent 1px),
    linear-gradient(rgb(42 147 200 / 7%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 147 200 / 7%) 1px, transparent 1px);
  background-position: -1px -1px;
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  color: #fff;
  min-width: 0;
}

/* The stage follows the page while a long parts list scrolls past. */
.viewer-frame {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: min(640px, calc(100vh - 120px));
  min-height: 460px;
  position: sticky;
  top: 100px;
}

.request-details .company-search-field {
  grid-column: 1 / -1;
}

.viewer-stage {
  background-color: var(--graphite);
  background-image:
    linear-gradient(rgb(42 147 200 / 16%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 147 200 / 16%) 1px, transparent 1px),
    linear-gradient(rgb(42 147 200 / 7%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 147 200 / 7%) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 45%, rgb(42 147 200 / 18%), transparent 65%);
  background-position: -1px -1px;
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px, 100% 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
  transition: box-shadow 160ms ease;
}

.viewer-stage.drag-over {
  box-shadow: inset 0 0 0 3px var(--brand-blue);
}

.viewer-stage.drop-rejected {
  box-shadow: inset 0 0 0 3px #d64545;
}

.viewer-canvas {
  cursor: default;
  display: block;
  height: 100%;
  inset: 0;
  position: absolute;
  touch-action: none;
  width: 100%;
}

.viewer-stage.has-model .viewer-canvas {
  cursor: grab;
}

.viewer-stage.has-model .viewer-canvas:active {
  cursor: grabbing;
}

.viewer-edge {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.viewer-edge-0 {
  filter: drop-shadow(0 0 3px rgb(143 214 255 / 55%));
  stroke: var(--wire-front);
  stroke-width: 1.6;
}

.viewer-edge-1 {
  stroke: var(--wire-mid);
  stroke-opacity: 0.8;
  stroke-width: 1.2;
}

.viewer-edge-2 {
  stroke: var(--wire-back);
  stroke-opacity: 0.55;
  stroke-width: 1;
}

.viewer-corner {
  border-color: rgb(255 255 255 / 38%);
  border-style: solid;
  height: 18px;
  pointer-events: none;
  position: absolute;
  width: 18px;
}

.viewer-corner-tl { border-width: 2px 0 0 2px; left: 14px; top: 14px; }
.viewer-corner-tr { border-width: 2px 2px 0 0; right: 14px; top: 14px; }
.viewer-corner-bl { border-width: 0 0 2px 2px; bottom: 14px; left: 14px; }
.viewer-corner-br { border-width: 0 2px 2px 0; bottom: 14px; right: 14px; }

.viewer-empty {
  align-content: center;
  color: rgb(255 255 255 / 72%);
  display: grid;
  gap: 8px;
  inset: 40px;
  justify-items: center;
  pointer-events: none;
  position: absolute;
  text-align: center;
}

.viewer-empty[hidden] {
  display: none;
}

.viewer-empty strong {
  color: #fff;
  font-size: 1.15rem;
}

.viewer-message {
  font-size: 0.86rem;
  max-width: 340px;
}

/* An isometric cube outline drawn with borders. */
.viewer-empty-icon {
  border: 2px solid var(--wire-mid);
  border-radius: 4px;
  height: 46px;
  margin-bottom: 8px;
  position: relative;
  transform: rotate(45deg) skew(-8deg, -8deg);
  width: 46px;
}

.viewer-empty-icon::after {
  border: 2px dashed rgb(143 214 255 / 60%);
  border-radius: 4px;
  content: "";
  inset: 8px -12px -12px 8px;
  position: absolute;
}

.viewer-tag {
  align-items: center;
  background: rgb(13 20 26 / 78%);
  border: 1px solid var(--graphite-line);
  border-radius: 999px;
  display: flex;
  font-size: 0.78rem;
  gap: 10px;
  left: 44px;
  margin: 0;
  max-width: calc(100% - 88px);
  padding: 6px 14px;
  position: absolute;
  top: 26px;
}

.viewer-tag[hidden],
.viewer-hint[hidden] {
  display: none;
}

.viewer-tag span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-size {
  color: var(--wire-front);
  flex: none;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.viewer-hint {
  bottom: 22px;
  color: rgb(255 255 255 / 48%);
  font-size: 0.74rem;
  margin: 0;
  pointer-events: none;
  position: absolute;
  right: 44px;
}

.viewer-toolbar {
  align-items: center;
  background: var(--graphite-raised);
  border-top: 1px solid var(--graphite-line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 14px;
}

.viewer-views,
.viewer-actions {
  display: flex;
  gap: 4px;
}

.viewer-toolbar button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgb(255 255 255 / 78%);
  font-size: 0.8rem;
  min-height: 34px;
  min-width: 36px;
  padding: 6px 11px;
}

.viewer-toolbar button:not(:disabled):hover {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}

.viewer-toolbar button.is-active,
.viewer-toolbar button[aria-pressed="true"] {
  background: rgb(42 147 200 / 22%);
  border-color: rgb(42 147 200 / 55%);
  color: #fff;
}

.viewer-toolbar button:disabled {
  cursor: default;
  opacity: 0.35;
}

/* Material */














/* Submit bar */

.form-submit {
  flex-wrap: wrap;
}

.request-summary {
  background: var(--steel-soft);
  border-radius: 999px;
  color: var(--muted);
  flex-basis: 100%;
  font-size: 0.86rem;
  font-weight: 650;
  margin: 0;
  padding: 9px 16px;
  width: fit-content;
}

.request-summary.is-ready {
  background: var(--brand-blue-soft);
  color: var(--brand-blue-deep);
}

@media (max-width: 980px) {
  .configurator {
    grid-template-columns: 1fr;
  }

  .configurator-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .viewer-frame {
    height: auto;
    min-height: 0;
    position: static;
  }

  .viewer-stage {
    aspect-ratio: 4 / 3;
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  .configurator .upload-part-meta {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .viewer-tag {
    left: 24px;
    max-width: calc(100% - 48px);
    top: 20px;
  }

  .viewer-hint {
    display: none;
  }

  .viewer-toolbar {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
}

/* ------------------------------------------------------------------
   One-screen layout: stage left, all inputs right, parts as carousel
   ------------------------------------------------------------------ */

.visually-hidden {
  clip: rect(0 0 0 0);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.upload-workspace {
  max-width: 1480px;
  padding-bottom: 18px;
  padding-top: 18px;
}

.configurator {
  grid-template-columns: minmax(0, 1.3fr) minmax(400px, 1fr);
  height: calc(100vh - 88px - 36px);
  min-height: 560px;
}

.configurator-side {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.part-viewer {
  height: 100%;
}

.viewer-frame {
  height: 100%;
  min-height: 0;
  position: static;
}

.configurator-side .part-upload-list,
.configurator-side .form-section {
  padding: 16px 22px;
}

.configurator-side .form-section-head {
  margin-bottom: 12px;
}

.configurator-side .section-number {
  font-size: 0.74rem;
  height: 24px;
  width: 24px;
}

.part-carousel {
  gap: 10px;
}

.part-carousel .form-section-head {
  margin-bottom: 0;
}

.part-nav {
  align-items: center;
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.part-nav[hidden] {
  display: none;
}

.part-nav span {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 46px;
  text-align: center;
}

.part-nav button {
  background: var(--steel-soft);
  border-radius: 8px;
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  min-height: 32px;
  min-width: 32px;
  padding: 0 0 3px;
}

.part-nav button:not(:disabled):hover {
  background: var(--brand-blue-soft);
  color: var(--brand-blue-deep);
}

.part-nav button:disabled {
  cursor: default;
  opacity: 0.35;
}

.part-carousel .upload-part-row:not(.is-current) {
  display: none;
}

.part-carousel .upload-part-row {
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  padding: 12px;
}

.part-carousel .upload-part-row.is-previewed {
  box-shadow: none;
}

.part-carousel .upload-part-index {
  display: none;
}

/* In the carousel the part is removed from the 3D stage; the row button stays for the shared row logic. */
.part-carousel .remove-part-button {
  display: none;
}

.part-carousel .upload-file-field {
  gap: 3px;
  min-height: 82px;
  padding: 10px 12px;
}

.part-carousel .upload-file-pair {
  padding-right: 30px;
}

.part-carousel .file-title {
  font-size: 0.9rem;
}

.part-carousel .file-hint {
  font-size: 0.74rem;
}

.part-carousel .upload-part-meta {
  gap: 8px 10px;
}

.part-carousel .upload-part-meta input {
  min-height: 40px;
}

.part-carousel .quantity-control input {
  min-height: 40px;
}

.part-carousel .quantity-step {
  min-height: 20px;
}

.part-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.part-add-actions > * {
  flex: 1 1 160px;
}

.part-carousel .add-part-button,
.add-files-button {
  font-size: 0.8rem;
  min-height: 40px;
  padding: 8px 12px;
}

.add-files-button {
  align-items: center;
  background: var(--brand-blue-soft);
  border: 1px dashed var(--brand-blue);
  color: var(--brand-blue-deep);
  cursor: pointer;
  display: flex;
  font-weight: 700;
  gap: 9px;
  justify-content: center;
  position: relative;
}

.add-files-button input {
  cursor: pointer;
  inset: 0;
  min-height: 0;
  opacity: 0;
  position: absolute;
}

.add-files-button:hover {
  background: #dff0f8;
}

.part-limit-notice {
  color: #8f1d1d;
  font-size: 0.78rem;
  margin: 0;
}

.part-limit-notice[hidden] {
  display: none;
}






.configurator-side .form-grid {
  gap: 10px 12px;
}

.configurator-side label {
  font-size: 0.78rem;
  gap: 5px;
}

.configurator-side input,
.configurator-side select {
  min-height: 40px;
  padding: 8px 11px;
}

.configurator-side .notes-field {
  margin-top: 10px;
}

.configurator-side textarea {
  min-height: 58px;
  padding: 8px 11px;
}

.configurator-side .form-submit {
  border-radius: 0;
  gap: 10px 16px;
  margin-top: auto;
  padding: 14px 22px;
}

.configurator-side .request-summary {
  font-size: 0.8rem;
  padding: 7px 14px;
}

.configurator-side .privacy-acknowledgement {
  font-size: 0.8rem;
}

.configurator-side .submit-request-button {
  min-height: 44px;
}

/* Carousel arrows and counter on the stage */

.viewer-arrow {
  align-items: center;
  background: rgb(13 20 26 / 70%);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 1.8rem;
  height: 48px;
  justify-content: center;
  line-height: 1;
  min-height: 48px;
  padding: 0 0 4px;
  position: absolute;
  top: calc(50% - 24px);
  width: 48px;
  z-index: 2;
}

.viewer-arrow[hidden] {
  display: none;
}

.viewer-arrow-prev {
  left: 22px;
}

.viewer-arrow-next {
  right: 22px;
}

.viewer-arrow:not(:disabled):hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.viewer-arrow:disabled {
  cursor: default;
  opacity: 0.3;
}

.viewer-counter {
  background: rgb(13 20 26 / 78%);
  border: 1px solid var(--graphite-line);
  border-radius: 999px;
  bottom: 22px;
  color: #fff;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  left: 50%;
  margin: 0;
  padding: 5px 14px;
  position: absolute;
  transform: translateX(-50%);
}

.viewer-counter[hidden] {
  display: none;
}

.viewer-facts {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  text-align: left;
}

.viewer-facts li {
  align-items: baseline;
  color: rgb(255 255 255 / 82%);
  display: flex;
  font-size: 0.84rem;
  gap: 10px;
}

.viewer-facts span {
  color: var(--wire-front);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.08em;
}

@media (max-width: 980px) {
  .configurator {
    height: auto;
    min-height: 0;
  }

  .configurator-side {
    overflow: visible;
  }

  .part-viewer,
  .viewer-frame {
    height: auto;
  }
}

@media (max-width: 640px) {

  .viewer-arrow {
    height: 40px;
    min-height: 40px;
    top: calc(50% - 20px);
    width: 40px;
  }

  .viewer-arrow-prev {
    left: 12px;
  }

  .viewer-arrow-next {
    right: 12px;
  }
}

/* Compact enough for a laptop screen (about 800 px of usable height). */
.app-bar {
  min-height: 68px;
  padding-bottom: 6px;
  padding-top: 6px;
}

.brand img {
  height: 52px;
}

.configurator {
  height: calc(100vh - 68px - 32px);
}

.upload-workspace {
  padding-bottom: 16px;
  padding-top: 16px;
}

.configurator-side .part-upload-list,
.configurator-side .form-section {
  padding: 12px 20px;
}

.configurator-side .form-section-head {
  margin-bottom: 10px;
}

.part-carousel .upload-file-field {
  min-height: 70px;
  padding: 8px 11px;
}

.part-carousel .file-format {
  font-size: 0.6rem;
  padding: 4px 6px;
}

.configurator-side textarea {
  min-height: 42px;
}

.configurator-side .form-submit {
  padding: 12px 20px;
}

.configurator-side .request-summary {
  flex-basis: auto;
}

.configurator-side .privacy-acknowledgement {
  flex-basis: 100%;
  max-width: none;
  order: -1;
}

.configurator-side .submit-request-button {
  margin-left: auto;
}

@media (max-width: 980px) {
  .configurator {
    height: auto;
  }
}

.configurator {
  grid-template-columns: minmax(0, 1.15fr) minmax(440px, 1fr);
}

.configurator-side .request-details .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.configurator-side .request-details .company-search-field {
  grid-column: auto;
}

.configurator-side .section-number {
  height: 22px;
  width: 22px;
}

.configurator-side h2 {
  font-size: 0.92rem;
}

.part-carousel .upload-file-field {
  min-height: 64px;
}

.part-carousel .file-hint {
  font-size: 0.7rem;
  line-height: 1.25;
}

.configurator-side .form-submit {
  gap: 8px 14px;
}

@media (max-width: 1180px) {
  .configurator-side .request-details .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .configurator-side .request-details .company-search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .configurator-side .request-details .form-grid {
    grid-template-columns: 1fr;
  }
}


.part-carousel .upload-part-row {
  gap: 8px;
  padding: 10px;
}


.configurator-side .part-upload-list,
.configurator-side .form-section {
  padding-bottom: 10px;
  padding-top: 10px;
}

.configurator-side textarea {
  min-height: 36px;
}

.configurator-side .form-submit {
  padding-bottom: 10px;
  padding-top: 10px;
}

/* Must follow the desktop rules above. */
@media (max-width: 980px) {
  .configurator {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }

  .configurator-side {
    overflow: visible;
  }
}

/* Thumbnail strip: jump straight to any part */

.viewer-frame {
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.viewer-strip {
  background: var(--graphite-raised);
  border-top: 1px solid var(--graphite-line);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  scrollbar-width: thin;
}

.viewer-strip[hidden] {
  display: none;
}

.strip-tile {
  align-items: flex-end;
  background: var(--graphite);
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 8px;
  color: rgb(255 255 255 / 80%);
  display: flex;
  flex: none;
  height: 52px;
  justify-content: flex-start;
  min-height: 52px;
  padding: 3px 6px;
  position: relative;
  width: 76px;
}

.strip-tile:hover {
  border-color: rgb(42 147 200 / 70%);
}

.strip-tile.is-current {
  background: rgb(42 147 200 / 20%);
  border: 2px solid var(--brand-blue);
}

.strip-thumbnail {
  height: 40px;
  left: 6px;
  pointer-events: none;
  position: absolute;
  top: 3px;
  width: 64px;
}

.strip-thumbnail path {
  fill: none;
  stroke: var(--wire-mid);
  stroke-width: 0.8;
}

.strip-number {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  position: relative;
}

.strip-tile.is-missing::after {
  background: #e24b4a;
  border-radius: 50%;
  content: "";
  height: 8px;
  position: absolute;
  right: 5px;
  top: 5px;
  width: 8px;
}

/* PDF pairing notice */

.drawing-notice {
  background: #fff8ec;
  border: 1px solid #ecd3a3;
  border-radius: 10px;
  display: grid;
  font-size: 0.78rem;
  gap: 6px;
  padding: 8px 10px;
}

.drawing-notice[hidden] {
  display: none;
}

.drawing-notice p {
  color: #7a5310;
  font-weight: 650;
  margin: 0;
}

.drawing-notice ul {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  max-height: 96px;
  overflow-y: auto;
  padding: 0;
}

.drawing-notice li {
  align-items: center;
  display: flex;
  gap: 8px;
}

.drawing-notice li span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawing-notice li button {
  background: #fff;
  border: 1px solid #d7b878;
  border-radius: 6px;
  color: #7a5310;
  flex: none;
  font-size: 0.74rem;
  min-height: 26px;
  padding: 2px 9px;
}

.drawing-notice li .drawing-dismiss {
  border-color: transparent;
  font-size: 1rem;
  padding: 0 6px;
}

.strip-tile.has-drawing::before {
  background: rgb(255 255 255 / 85%);
  border-radius: 3px;
  color: var(--graphite);
  content: "PDF";
  font-size: 0.55rem;
  font-weight: 800;
  left: 4px;
  padding: 0 3px;
  position: absolute;
  top: 4px;
  z-index: 1;
}

/* Submit progress and inline error */

.submit-progress {
  flex-basis: 100%;
}

.submit-progress .processing-progress-head strong {
  font-size: 0.82rem;
}

.submit-error {
  background: #fff2f0;
  border: 1px solid #e8b4ae;
  border-radius: 8px;
  color: #8f1d1d;
  flex-basis: 100%;
  font-size: 0.8rem;
  margin: 0;
  padding: 8px 12px;
}

.submit-error[hidden] {
  display: none;
}

.upload-form.is-submitting .configurator-side {
  cursor: progress;
}

.part-add-actions > .drawing-notice,
.part-add-actions > .part-limit-notice {
  flex-basis: 100%;
}

.part-add-actions > .quiet-button {
  white-space: nowrap;
}

/* ------------------------------------------------------------------
   Confirmation page after sending a request
   ------------------------------------------------------------------ */

.submitted-workspace {
  max-width: 1120px;
}

.submitted-card {
  box-shadow: 0 1px 2px rgb(13 20 26 / 6%), 0 24px 60px rgb(13 20 26 / 10%);
  overflow: hidden;
  padding: 0;
}

.submitted-head {
  align-items: center;
  background-color: var(--graphite);
  background-image:
    linear-gradient(rgb(42 147 200 / 14%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 147 200 / 14%) 1px, transparent 1px);
  background-size: 24px 24px;
  color: #fff;
  display: grid;
  gap: 18px 24px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 30px 32px;
}

.submitted-check {
  background: var(--brand-blue);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgb(42 147 200 / 22%);
  height: 60px;
  position: relative;
  width: 60px;
}

.submitted-check::after {
  border-bottom: 4px solid #fff;
  border-right: 4px solid #fff;
  content: "";
  height: 26px;
  left: 22px;
  position: absolute;
  top: 12px;
  transform: rotate(45deg);
  width: 13px;
}

.submitted-intro .eyebrow {
  color: var(--wire-front);
  letter-spacing: 0.1em;
}

.submitted-intro h1 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 760;
  letter-spacing: -0.01em;
  margin: 4px 0 6px;
}

.submitted-intro p {
  color: rgb(255 255 255 / 78%);
  margin: 0;
}

.submitted-intro .mail-status {
  background: rgb(42 147 200 / 18%);
  border: 1px solid rgb(42 147 200 / 45%);
  border-radius: 8px;
  color: #fff;
  display: inline-block;
  font-size: 0.86rem;
  margin-top: 10px;
  padding: 6px 12px;
}

.submitted-actions {
  display: grid;
  gap: 8px;
}

.submitted-actions a {
  justify-content: center;
  text-align: center;
  text-decoration: none;
  width: auto;
}

.submitted-actions .primary {
  font-size: 0.92rem;
  min-height: 46px;
  padding: 12px 22px;
}

.submitted-actions .quiet-button {
  background: transparent;
  border-color: rgb(255 255 255 / 30%);
  color: #fff;
  font-size: 0.82rem;
}

.submitted-actions .quiet-button:hover {
  background: rgb(255 255 255 / 10%);
}

.submitted-facts {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
}

.submitted-facts div {
  padding: 16px 22px;
}

.submitted-facts div + div {
  border-left: 1px solid var(--line);
}

.submitted-facts dt,
.submitted-terms dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.submitted-facts dd {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.submitted-parts {
  padding: 8px 22px;
}

.submitted-part-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.submitted-part-list li {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  padding: 10px 0;
}

.submitted-part-list li + li {
  border-top: 1px solid var(--line);
}

.submitted-thumb-frame {
  align-items: center;
  background-color: var(--graphite);
  border-radius: 10px;
  display: flex;
  height: 64px;
  justify-content: center;
  overflow: hidden;
  width: 96px;
}

.submitted-thumb {
  height: 100%;
  width: 100%;
}

.submitted-thumb line {
  stroke: var(--wire-mid);
  stroke-linecap: round;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.submitted-thumb-empty {
  border: 1px dashed rgb(255 255 255 / 30%);
  border-radius: 6px;
  height: 28px;
  width: 40px;
}

.submitted-part-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.submitted-part-text strong {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.submitted-part-text span {
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.submitted-part-text span:empty {
  display: none;
}

.submitted-part-badges {
  align-items: center;
  display: flex;
  gap: 8px;
}

.submitted-qty {
  background: var(--brand-blue-soft);
  border-radius: 999px;
  color: var(--brand-blue-deep);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  padding: 5px 12px;
  white-space: nowrap;
}

.submitted-pdf {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 6px;
}

.submitted-terms {
  background: #f7f9fb;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.submitted-terms div {
  padding: 14px 22px;
}

.submitted-terms dd {
  font-weight: 650;
  margin: 3px 0 0;
}

.submitted-terms a {
  color: var(--brand-blue-deep);
}

@media (max-width: 860px) {
  .submitted-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .submitted-actions {
    grid-column: 1 / -1;
  }

  .submitted-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .submitted-facts div + div {
    border-left: 0;
  }

  .submitted-facts div {
    border-top: 1px solid var(--line);
  }

  .submitted-terms {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .submitted-head {
    padding: 24px 18px;
  }

  .submitted-check {
    height: 48px;
    width: 48px;
  }

  .submitted-check::after {
    height: 20px;
    left: 17px;
    top: 9px;
    width: 10px;
  }

  .submitted-part-list li {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .submitted-thumb-frame {
    height: 48px;
    width: 72px;
  }

  .submitted-part-badges {
    grid-column: 2;
  }
}

/* Quantity read from the drawing */

.quantity-source {
  color: var(--brand-blue-deep);
  font-size: 0.72rem;
  font-weight: 650;
  grid-column: 1 / -1;
  margin: -2px 0 0;
}

.quantity-source[hidden] {
  display: none;
}

.quantity-source::before {
  content: "\2713  ";
}

.quantity-source.is-reading {
  color: var(--muted);
}

.quantity-source.is-reading::before {
  animation: quantity-source-spin 0.9s linear infinite;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  content: "";
  display: inline-block;
  height: 8px;
  margin-right: 6px;
  vertical-align: -1px;
  width: 8px;
}

@keyframes quantity-source-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .quantity-source.is-reading::before {
    animation: none;
  }
}

/* Problems found before uploading: marked on the part card and in the thumbnail strip. */
.part-problem {
  align-items: center;
  background: #fff4f2;
  border: 1px solid #f1c4bd;
  border-radius: 6px;
  color: #a1281e;
  display: flex;
  font-size: 0.8rem;
  font-weight: 650;
  gap: 8px;
  grid-column: 1 / -1;
  margin: 0;
  padding: 7px 10px;
}

.part-problem::before {
  background: #c0362c;
  border-radius: 50%;
  color: #fff;
  content: "!";
  display: inline-grid;
  flex: none;
  font-size: 0.7rem;
  font-weight: 800;
  height: 17px;
  place-items: center;
  width: 17px;
}

.part-problem[hidden] {
  display: none;
}

.upload-part-row.has-problem {
  border-color: #e7a59c;
}

.strip-tile.has-problem {
  border-color: #e0574c;
}

.strip-tile.has-problem.is-current {
  background: rgb(192 54 44 / 22%);
}

.strip-tile.has-problem::after {
  display: none;
}


/* Summary line with "start over" beside it. */
.request-summary-row {
  align-items: center;
  display: flex;
  flex-basis: 100%;
  gap: 12px;
  justify-content: space-between;
}

.request-summary-row .request-summary {
  flex: 0 1 auto;
}

.reset-request-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  flex: none;
  font-size: 0.8rem;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
}

.reset-request-button[hidden] {
  display: none;
}

.reset-request-button svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 300ms ease;
  width: 15px;
}

.reset-request-button:hover {
  background: var(--steel-soft);
  color: var(--ink, #0d141a);
}

.reset-request-button:hover svg {
  transform: rotate(-120deg);
}

/* Short notice at the bottom of the window, with an action such as undo. */
.toast {
  align-items: center;
  background: var(--graphite);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  bottom: 24px;
  box-shadow: 0 14px 36px rgb(13 20 26 / 28%);
  color: #fff;
  display: flex;
  font-size: 0.86rem;
  gap: 6px;
  left: 50%;
  max-width: calc(100vw - 32px);
  opacity: 0;
  padding: 6px 6px 6px 20px;
  position: fixed;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 220ms ease;
  z-index: 50;
}

.toast[hidden] {
  display: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-message {
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-action {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--wire-front);
  flex: none;
  font-size: 0.84rem;
  margin-left: 8px;
  min-height: 34px;
  padding: 0 12px;
}

.toast-action[hidden] {
  display: none;
}

.toast-action:hover {
  background: rgb(143 214 255 / 14%);
}

.toast-close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: rgb(255 255 255 / 60%);
  flex: none;
  font-size: 1.2rem;
  height: 34px;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.toast-close:hover {
  background: rgb(255 255 255 / 10%);
  color: #fff;
}

@media (max-width: 640px) {
  /* The empty stage is small on phones: keep the invitation, drop the three-step list. */
  .viewer-empty {
    gap: 6px;
    inset: 24px 20px 52px;
  }

  .viewer-empty-icon {
    height: 34px;
    margin-bottom: 4px;
    width: 34px;
  }

  .viewer-empty strong {
    font-size: 1rem;
  }

  .viewer-message {
    font-size: 0.8rem;
  }

  .viewer-facts {
    display: none;
  }

  .toast {
    border-radius: 14px;
    bottom: 16px;
    width: calc(100vw - 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .reset-request-button svg {
    transition: none;
  }
}

/* Thumbnail strip with "remove all" at its end; the bar takes over the strip's frame. */
.viewer-strip-bar {
  align-items: center;
  background: var(--graphite-raised);
  border-top: 1px solid var(--graphite-line);
  display: flex;
  gap: 8px;
  min-width: 0;
  padding-right: 12px;
}

.viewer-strip-bar[hidden] {
  display: none;
}

.viewer-strip-bar .viewer-strip {
  background: transparent;
  border-top: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.strip-clear {
  align-items: center;
  background: transparent;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 8px;
  color: rgb(255 255 255 / 72%);
  flex: none;
  font-size: 0.74rem;
  gap: 6px;
  height: 52px;
  min-height: 52px;
  padding: 0 12px;
}

.strip-clear svg {
  fill: none;
  flex: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  width: 15px;
}

.strip-clear:hover,
.strip-clear:focus-visible {
  background: #c0362c;
  border-color: #e0574c;
  color: #fff;
}

@media (max-width: 640px) {
  .strip-clear {
    justify-content: center;
    padding: 0;
    width: 44px;
  }

  .strip-clear span {
    display: none;
  }
}

/* Remove a part straight from its thumbnail: a small badge sitting on the tile's top-right corner,
   half outside, so it does not read as part of the drawing. The strip's padding leaves room for it. */
.strip-item {
  flex: none;
  position: relative;
}

.strip-remove {
  align-items: center;
  background: var(--graphite-raised);
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgb(0 0 0 / 45%);
  color: rgb(255 255 255 / 85%);
  display: flex;
  font-size: 0.78rem;
  height: 18px;
  justify-content: center;
  line-height: 1;
  min-height: 18px;
  padding: 0 0 1px;
  position: absolute;
  right: -6px;
  top: -6px;
  width: 18px;
  z-index: 1;
}

.strip-remove:hover,
.strip-remove:focus-visible {
  background: #c0362c;
  border-color: #e0574c;
  color: #fff;
}

/* Problem and missing-file marks move to the bottom corner, away from the badge. */
.strip-tile.is-missing::after {
  bottom: 5px;
  top: auto;
}

/* Overview of all parts between the part card and the contact details; it takes the free height. */
.part-overview {
  border-top: 1px solid var(--line);
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 170px;
  padding: 12px 20px 8px;
}

.part-overview[hidden] {
  display: none;
}

.part-overview-head,
.overview-select {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 24px minmax(0, 1fr) minmax(64px, 112px) 62px;
}

.part-overview-head {
  /* Last column: the row's right padding plus its remove button, minus one gap. */
  grid-template-columns: minmax(0, 1fr) minmax(64px, 112px) 62px 29px;
  margin-bottom: 6px;
}

.part-overview-head h2 {
  align-items: center;
  display: flex;
  font-size: 0.92rem;
  gap: 8px;
  margin: 0;
}

.part-overview-count {
  background: var(--steel-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  padding: 1px 8px;
}

.part-overview-columns {
  display: contents;
}

.part-overview-columns span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.part-overview-columns span:last-child {
  text-align: right;
}

.part-overview-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  flex: 1 1 0;
  list-style: none;
  margin: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
}

.overview-line {
  align-items: center;
  display: flex;
}

.overview-line + .overview-line {
  border-top: 1px solid var(--line);
}

.overview-line.is-current {
  background: rgb(42 147 200 / 8%);
  box-shadow: inset 3px 0 0 var(--brand-blue);
}

.overview-line.has-problem {
  background: #fff6f4;
  box-shadow: inset 3px 0 0 #c0362c;
}

.overview-select {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  flex: 1 1 auto;
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 40px;
  min-width: 0;
  padding: 6px 4px 6px 10px;
  text-align: left;
}

.overview-select:hover {
  background: rgb(42 147 200 / 6%);
}

.overview-number {
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: right;
}

.overview-name,
.overview-material {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-material {
  color: var(--ink);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.overview-material.is-empty,
.overview-material.is-reading {
  color: var(--muted);
  font-weight: 500;
}

.overview-material.is-reading {
  font-style: italic;
}

.overview-quantity {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.overview-remove {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  flex: none;
  font-size: 1.1rem;
  height: 28px;
  justify-content: center;
  margin-right: 6px;
  min-height: 28px;
  padding: 0 0 2px;
  width: 28px;
}

.overview-remove:hover,
.overview-remove:focus-visible {
  background: #fdeceb;
  color: #a1281e;
}

@media (max-width: 980px) {
  .part-overview {
    flex: none;
    min-height: 0;
  }

  .part-overview-list {
    flex: none;
    max-height: 300px;
  }
}

@media (max-width: 640px) {
  .part-overview {
    padding: 12px 16px 8px;
  }

  .part-overview-head,
  .overview-select {
    gap: 8px;
    grid-template-columns: 20px minmax(0, 1fr) minmax(56px, 84px) 52px;
  }

  .part-overview-head {
    grid-template-columns: minmax(0, 1fr) minmax(56px, 84px) 52px 31px;
  }
}

/* Contact fields: keep inputs at their own height when the company address makes the row taller. */
.configurator-side .request-details .form-grid {
  align-items: start;
}

.configurator-side .request-details label {
  align-content: start;
}

/* Typed values look the same in every field, whatever the label around them. */
.configurator-side input,
.configurator-side textarea {
  font-size: 0.88rem;
  font-weight: 500;
}

.configurator-side input::placeholder,
.configurator-side textarea::placeholder {
  color: #8f9ba3;
  font-weight: 500;
}

.configurator-side .company-search-status {
  font-size: 0.74rem;
  line-height: 1.35;
}

/* The checkbox is not a text field: no field height, aligned with the first line of its text. */
.configurator-side .privacy-acknowledgement {
  align-items: start;
}

.configurator-side .privacy-acknowledgement input {
  height: 18px;
  margin: 1px 0 0;
  min-height: 18px;
  padding: 0;
  width: 18px;
}

/* Prices on the confirmation page: line total, unit price for several pieces, totals below the list. */
.submitted-part-list li {
  grid-template-columns: 96px minmax(0, 1fr) auto minmax(112px, auto);
}

.submitted-price {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

.submitted-price strong {
  color: var(--ink);
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.submitted-price span {
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.submitted-totals {
  border-top: 2px solid var(--ink);
  display: grid;
  gap: 6px;
  margin: 6px 0 12px auto;
  max-width: 360px;
  padding-top: 12px;
}

.submitted-totals div {
  align-items: baseline;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.submitted-totals dt {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.submitted-totals dd {
  font-variant-numeric: tabular-nums;
  margin: 0;
  white-space: nowrap;
}

.submitted-totals .submitted-grand-total {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
}

.submitted-totals .submitted-grand-total dt {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.submitted-totals .submitted-grand-total dd {
  color: var(--brand-blue-deep);
  font-size: 1.2rem;
  font-weight: 800;
}

@media (max-width: 560px) {
  .submitted-part-list li {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .submitted-part-badges,
  .submitted-price {
    grid-column: 2;
  }

  .submitted-price {
    justify-items: start;
    text-align: left;
  }

  .submitted-totals {
    max-width: none;
  }
}

/* Shaded 3D preview: faces are painted into a canvas behind the wireframe lines. */
.viewer-stage {
  -webkit-user-select: none;
  user-select: none;
}

.viewer-shade {
  filter: drop-shadow(0 16px 22px rgb(0 0 0 / 50%));
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.viewer-stage.is-shaded .viewer-edge-0 {
  filter: none;
  stroke: #c4ebff;
  stroke-opacity: 0.9;
  stroke-width: 1.1;
}

.viewer-stage.is-shaded .viewer-edge-2 {
  stroke: var(--wire-mid);
  stroke-opacity: 0.2;
  stroke-width: 1;
}

/* Confirmation page: shaded thumbnails drawn in the browser replace the line drawings. */
.submitted-thumb-shaded {
  display: block;
  filter: drop-shadow(0 3px 4px rgb(0 0 0 / 45%));
}

/* Overview heading: numbered like the other sections, with the part count as quiet plain text. */
.part-overview-head h2 {
  font-size: 0.92rem;
  gap: 10px;
}

.part-overview-count {
  background: none;
  font-weight: 600;
  padding: 0;
}

/* Admin price test: the customer's part card and overview without the 3D view and contact form. */
.admin-configurator {
  grid-template-columns: minmax(0, 1fr);
  height: auto;
  max-width: 760px;
  min-height: 0;
}

.admin-configurator .configurator-side {
  border-left: 0;
  border-top: 0;
  overflow: visible;
}

.admin-configurator .part-overview {
  flex: none;
  min-height: 0;
}

.admin-configurator .part-overview-list {
  flex: none;
  max-height: 360px;
}

.admin-test-submit {
  align-items: end;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  padding: 14px 20px 6px;
}

/* Price test results: the correct price sits right next to the proposal and saves itself. */
.testing-correct-hint {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 12px;
}

.testing-price strong,
.testing-price span {
  display: block;
}

.testing-price span {
  color: var(--muted);
  font-size: 0.78rem;
}

.testing-correction .expected-price-input {
  min-width: 0;
  width: 100%;
}

.testing-correction .expected-price-input {
  border-color: var(--brand-blue);
  font-weight: 700;
}

.autosave-state {
  display: block;
  font-size: 0.74rem;
  min-height: 1.1em;
  padding-top: 3px;
}

.autosave-state.is-saving {
  color: var(--muted);
}

.autosave-state.is-saved {
  color: #176b50;
}

.autosave-state.is-failed {
  color: #c0362c;
}

/* Fixed column widths: the file name and route share the first column, deviation and status the last. */
.testing-col-file {
  width: 25%;
}

.testing-col-qty {
  width: 6%;
}

.testing-col-score {
  width: 7%;
}

.testing-col-bounds {
  width: 13%;
}

.testing-col-hours {
  width: 8%;
}

.testing-col-price {
  width: 13%;
}

.testing-col-correction {
  width: 14%;
}

.testing-col-diff {
  width: 14%;
}

.testing-table .sourcing-badge {
  justify-self: start;
  max-width: 100%;
}

.testing-table .testing-file-stack {
  min-width: 0;
}

.testing-diff > * {
  display: block;
}

.testing-diff span {
  font-size: 0.8rem;
}

/* Shown next to the submit button while quantities are still being read from the drawings. */
.quantity-wait {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
}

/* Quiet thumbnail strip: a small head line with the part count and "remove all" as a text link,
   tiles that only show the picture and the number. The remove badge shows on hover, on keyboard
   focus and on the current part; touch screens always show it. A drawing is a short blue line
   under the number, a problem or missing file a red frame. */
.viewer-strip-bar {
  align-items: stretch;
  flex-direction: column;
  gap: 0;
  padding-right: 0;
}

.viewer-strip-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 8px 14px 0;
}

.viewer-strip-count {
  color: rgb(255 255 255 / 62%);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.strip-clear,
.strip-clear:hover,
.strip-clear:focus-visible {
  background: transparent;
  border: 0;
}

.strip-clear {
  color: rgb(255 255 255 / 62%);
  font-size: 0.74rem;
  font-weight: 600;
  height: auto;
  min-height: 0;
  padding: 2px 0;
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 30%);
  text-underline-offset: 3px;
}

.strip-clear:hover,
.strip-clear:focus-visible {
  color: #ff8a80;
  text-decoration-color: currentColor;
}

.viewer-strip-bar .viewer-strip {
  gap: 8px;
  padding: 8px 14px 10px;
}

.strip-tile {
  align-items: flex-end;
  height: 60px;
  justify-content: center;
  min-height: 60px;
  padding: 0 0 7px;
  width: 64px;
}

.strip-thumbnail {
  height: 36px;
  left: 4px;
  top: 4px;
  width: 56px;
}

.strip-number {
  color: rgb(255 255 255 / 70%);
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1;
}

.strip-tile.is-current .strip-number {
  color: #fff;
}

.strip-tile.has-drawing::before {
  background: var(--brand-blue);
  border-radius: 1px;
  bottom: 3px;
  content: "";
  height: 2px;
  left: 50%;
  padding: 0;
  top: auto;
  transform: translateX(-50%);
  width: 16px;
}

.strip-tile.is-missing {
  border-color: #e0574c;
}

.strip-tile.is-missing::after {
  display: none;
}

.strip-tile.has-problem .strip-number,
.strip-tile.is-missing .strip-number {
  color: #ff8a80;
}

.strip-remove {
  opacity: 0;
  transition: opacity 120ms ease, background 140ms ease, border-color 140ms ease;
}

.strip-item:hover .strip-remove,
.strip-item:focus-within .strip-remove,
.strip-tile.is-current + .strip-remove {
  opacity: 1;
}

@media (hover: none) {
  .strip-remove {
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .strip-clear {
    padding: 2px 0;
    width: auto;
  }
}

/* Zoom im Schwärzungstool */
.redaction-template-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
}

.redaction-template-toolbar .redaction-template-hint {
  margin: 0;
}

.redaction-template-zoom {
  align-items: center;
  display: flex;
  gap: 6px;
}

.redaction-template-zoom [data-template-zoom-in],
.redaction-template-zoom [data-template-zoom-out] {
  font-size: 1.1rem;
  min-width: 38px;
  padding-inline: 0;
}

.redaction-template-zoom [data-template-zoom-level] {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: center;
}

.redaction-template .redaction-template-zoom-hint {
  font-size: 0.84rem;
  margin: -6px 0 0;
}

.redaction-template-viewport {
  background: #e9eef1;
  border: 1px solid #aebbc3;
  max-height: 75vh;
  overflow: auto;
  overscroll-behavior: contain;
}

.redaction-template-viewport .redaction-template-canvas {
  border: 0;
  margin: 0 auto;
  max-width: none;
}

.redaction-template-viewport .redaction-template-canvas img {
  max-width: none;
  width: 100%;
}

.redaction-template-overlay.is-pan-ready {
  cursor: grab;
}

.redaction-template-overlay.is-panning {
  cursor: grabbing;
}

/* Admin offer tool: review page. Recipient and header, one row per position like on the PDF, totals,
   folded texts and terms, and an action bar with the grand total that stays in view. */
.offer-editor-form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.offer-editor-section {
  display: grid;
  gap: 16px;
}

.offer-editor-section .form-section-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.offer-section-hint {
  color: var(--muted);
  font-size: 0.84rem;
  margin-left: auto;
}

.offer-editor-grid {
  display: grid;
  gap: 12px 14px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.offer-editor-wide {
  grid-column: 1 / -1;
}

.offer-editor-form input,
.offer-editor-form textarea {
  font-weight: 400;
  min-height: 40px;
  padding: 8px 11px;
}

.offer-editor-form textarea {
  min-height: 60px;
}

.offer-head-grid {
  align-items: start;
  display: grid;
  gap: 14px 20px;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
}

.offer-recipient textarea {
  min-height: 136px;
}

.offer-head-fields {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.offer-rows {
  border-top: 1px solid var(--line);
  display: grid;
  list-style: none;
  margin: 0;
  padding: 0;
}

.offer-row {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: 112px minmax(0, 1fr) 92px 190px 130px;
  padding: 14px 8px 14px 0;
}

.offer-row.is-price-changed {
  background: linear-gradient(90deg, var(--gold-soft), transparent 40%);
  box-shadow: inset 3px 0 0 var(--gold);
}

.offer-row-picture {
  align-items: center;
  aspect-ratio: 3 / 2;
  display: flex;
  justify-content: center;
  position: relative;
}

.offer-row-number {
  background: var(--steel);
  border-radius: 999px;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  left: 0;
  line-height: 1;
  min-width: 22px;
  padding: 4px 6px;
  position: absolute;
  text-align: center;
  top: 0;
  z-index: 1;
}

.offer-picture-frame {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.76rem;
  height: 100%;
  justify-content: center;
  padding: 6px;
  text-align: center;
  width: 100%;
}

.offer-picture {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.offer-row-main {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr);
  min-width: 0;
}

.offer-row-files {
  color: var(--muted);
  font-size: 0.76rem;
  grid-column: 1 / -1;
  margin: -2px 0 0;
  overflow-wrap: anywhere;
}

.offer-row-extra {
  grid-column: 1 / -1;
}

.offer-row-extra summary {
  color: var(--brand-blue-deep);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  width: max-content;
}

.offer-row-extra textarea {
  margin-top: 8px;
  width: 100%;
}

.offer-row-quantity input {
  text-align: right;
}

.offer-row-price {
  display: grid;
  gap: 6px;
}

.offer-row-price input {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.offer-row-calculated,
.offer-price-note {
  font-size: 0.8rem;
  margin: 0;
}

.offer-row-calculated {
  color: var(--muted);
  text-align: right;
}

.offer-price-note {
  color: var(--gold);
  font-weight: 700;
}

.offer-row-reset {
  background: none;
  border: 0;
  color: var(--brand-blue-deep);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  justify-self: end;
  padding: 0;
  text-decoration: underline;
}

.offer-row-reset[hidden] {
  display: none;
}

.offer-row-total {
  display: grid;
  font-variant-numeric: tabular-nums;
  gap: 7px;
  margin: 0;
  text-align: right;
}

.offer-row-total > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.offer-row-total strong {
  font-size: 1.02rem;
  line-height: 40px;
}

.offer-rows-foot {
  align-items: start;
  display: grid;
  gap: 18px 32px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
}

.offer-sums {
  display: grid;
  gap: 6px;
  margin: 0;
}

.offer-sums div {
  display: flex;
  justify-content: space-between;
}

.offer-sums dt,
.offer-sums dd {
  color: var(--ink);
  font-size: 0.92rem;
  letter-spacing: 0;
  margin: 0;
  text-transform: none;
}

.offer-sums dd {
  font-variant-numeric: tabular-nums;
}

.offer-grand-total {
  border-bottom: 3px double var(--ink);
  border-top: 1px solid var(--ink);
  font-weight: 800;
  padding: 6px 0;
}

.offer-terms summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.offer-terms summary::-webkit-details-marker {
  display: none;
}

.offer-terms-title {
  font-size: 1rem;
  font-weight: 750;
}

.offer-terms summary small {
  color: var(--muted);
}

.offer-terms:not([open]) {
  gap: 0;
}

.offer-actionbar {
  align-items: center;
  background: rgb(255 255 255 / 96%);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  bottom: 12px;
  box-shadow: 0 12px 30px rgb(26 42 52 / 14%);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 16px;
  position: sticky;
  z-index: 20;
}

.offer-actionbar-total {
  display: grid;
  margin: 0;
}

.offer-actionbar-total > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.offer-actionbar-total strong {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.offer-picture-status {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
}

.offer-actionbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

@media (max-width: 1100px) {
  .offer-row {
    grid-template-columns: 96px minmax(0, 1fr) 92px;
  }

  .offer-row-price {
    grid-column: 2;
  }

  .offer-row-total {
    grid-column: 3;
  }
}

@media (max-width: 760px) {
  .offer-head-grid,
  .offer-rows-foot,
  .offer-row-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .offer-row {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .offer-row-quantity,
  .offer-row-price,
  .offer-row-total {
    grid-column: 2;
  }

  .offer-row-total {
    text-align: left;
  }

  .offer-actionbar {
    bottom: 6px;
    gap: 8px;
    padding: 10px 12px;
  }

  .offer-actionbar-buttons {
    margin-left: 0;
    width: 100%;
  }

  .offer-actionbar-buttons button {
    flex: 1 1 0;
    font-size: 0.86rem;
    min-height: 42px;
    padding: 8px 10px;
  }
}

/* Overview: the quantity is a small field of its own between the part and its remove button; parts without
   a material on the drawing show the default (hardened steel) in a quieter tone. */
.part-overview-head {
  grid-template-columns: minmax(0, 1fr) minmax(64px, 112px) 78px 29px;
}

.overview-select {
  grid-template-columns: 24px minmax(0, 1fr) minmax(64px, 112px);
}

.overview-quantity {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex: none;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 4px;
  justify-content: flex-end;
  width: 78px;
}

.overview-quantity input {
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-height: 30px;
  padding: 3px 6px;
  text-align: right;
  width: 52px;
  -moz-appearance: textfield;
}

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

.overview-material.is-default {
  color: var(--muted);
  font-weight: 500;
}

/* Wished delivery date with its check, in the request details and in the overview. */
.delivery-date-field {
  display: grid;
  gap: 7px;
}

.delivery-date-field label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.delivery-date-field input {
  cursor: pointer;
}

.delivery-date-status {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0;
}

.delivery-date-status.is-ok,
.delivery-badge.is-ok {
  color: #2f7a4d;
}

.delivery-date-status.is-check,
.delivery-badge.is-check {
  color: var(--gold);
}

.delivery-badge {
  font-size: 0.86em;
  font-weight: 700;
  margin-left: 6px;
}

.overview-delivery {
  align-items: baseline;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  font: inherit;
  font-size: 0.8rem;
  gap: 4px 8px;
  justify-content: flex-start;
  margin-top: 8px;
  padding: 4px 2px;
  text-align: left;
  width: 100%;
}

.overview-delivery[hidden] {
  display: none;
}

.overview-delivery strong {
  color: #2f7a4d;
}

.overview-delivery.is-check strong {
  color: var(--gold);
}

@media (max-width: 640px) {
  .part-overview-head {
    grid-template-columns: minmax(0, 1fr) minmax(56px, 84px) 70px 31px;
  }

  .overview-select {
    grid-template-columns: 20px minmax(0, 1fr) minmax(56px, 84px);
  }

  .overview-quantity {
    width: 70px;
  }
}

/* The add buttons are hidden on the part cards (files come by drop or by the STEP field). */
.part-add-actions[hidden] {
  display: none;
}

/* Offer history: saved offers below the upload, and one page per offer with offer, delivery note and invoice. */
.offer-history {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

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

.offer-history-head span,
.offer-history-intro,
.offer-history-empty {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
}

.offer-history-scroll {
  overflow-x: auto;
}

.offer-history-table td,
.offer-history-table th {
  white-space: nowrap;
}

.offer-history-number {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.offer-history-done {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.offer-history-open {
  color: var(--muted);
}

.offer-history-notice {
  background: var(--success-soft);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  margin: 8px 0 0;
  padding: 8px 12px;
}

.offer-history-notice.is-frozen {
  background: var(--gold-soft);
}

.offer-documents {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.offer-document {
  align-content: start;
  display: grid;
  gap: 10px;
}

.offer-document.is-done {
  box-shadow: inset 0 3px 0 var(--brand-blue);
}

.offer-document h2,
.offer-document p {
  margin: 0;
}

.offer-document p {
  color: var(--muted);
  font-size: 0.86rem;
}

.offer-document .offer-document-kind {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.offer-document .primary {
  justify-self: start;
}

.offer-invoice-form {
  display: grid;
  gap: 10px;
}

.offer-invoice-form input,
.offer-invoice-form textarea {
  font-weight: 400;
  min-height: 40px;
  padding: 8px 11px;
}

.offer-invoice-form textarea {
  min-height: 72px;
}

.offer-history-positions {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.offer-history-positions .offer-sums {
  justify-self: end;
  max-width: 340px;
  width: 100%;
}

.offer-history-delete {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .offer-documents {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* History table: headers may wrap so that neighbouring columns never overlap. */
.offer-history-table th {
  text-align: left;
  white-space: normal;
}

.offer-history-table th.offer-history-number {
  text-align: right;
}

/* History tables have their own layout (the queue table treats its first column specially). */
.offer-history-table {
  border-collapse: collapse;
  width: 100%;
}

.offer-history-table th,
.offer-history-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: middle;
}

.offer-history-table th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.offer-history-table td {
  font-size: 0.9rem;
}

.offer-history-table td.offer-history-number {
  text-align: right;
}

.offer-history-table .quiet-button {
  min-height: 34px;
  padding: 6px 12px;
}

/* PDF links on the history page look like the buttons next to them. */
.offer-document a.primary {
  align-items: center;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  text-decoration: none;
}

/* Offer review: switch for learning the unit prices changed by hand. */
.offer-learn-toggle {
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 0.82rem;
  font-weight: 650;
  gap: 6px;
}

.offer-learn-toggle input[type="checkbox"] {
  min-height: 0;
  width: auto;
}

/* Offer history: name, material and unit price are edited right in the positions table. */
.offer-history-table td.offer-history-edit {
  padding-bottom: 6px;
  padding-top: 6px;
}

.offer-history-table input {
  font-size: 0.88rem;
  font-weight: 500;
  min-height: 36px;
  padding: 6px 9px;
}

.offer-history-table input[data-history-price] {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  max-width: 130px;
  text-align: right;
}

.offer-history-save {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: flex-end;
}

.offer-history-save p {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0 auto 0 0;
}

/* ------------------------------------------------------------------
   Traido brand: cube mark and name in the header (all pages)
   ------------------------------------------------------------------ */

.app-bar .brand {
  gap: 14px;
}

.brand .brand-mark {
  display: block;
  flex: none;
  height: 34px;
  width: 34px;
}

.brand .brand-mark path {
  fill: none;
  stroke: var(--wire-front);
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.brand span.brand-name {
  border-left: 0;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  padding-left: 0;
}

.brand span.brand-tool {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding-left: 16px;
}

/* ------------------------------------------------------------------
   Traido look for the customer pages: light and neutral (near-white page, white cards, slate text) with one
   clear blue for actions and highlights. The 3D stage is deep slate with light-blue wires as the eye-catcher.
   Admin pages do not carry the class and keep their own look.
   ------------------------------------------------------------------ */

body.theme-traido {
  --ink: #0f172a;
  --muted: #5b6577;
  --line: #e2e8f0;
  --paper: #f4f6f9;
  --surface: #ffffff;
  --steel: #0f172a;
  --steel-deep: #0b1220;
  --steel-soft: #f1f5f9;
  --brand-blue: #2563eb;
  --brand-blue-deep: #1d4ed8;
  --brand-blue-soft: #eef4ff;
  --success-soft: #ecfdf5;
  --graphite: #0f172a;
  --graphite-raised: #1e293b;
  --graphite-line: rgb(255 255 255 / 10%);
  background: var(--paper);
  color: var(--ink);
}

body.theme-traido .upload-surface {
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%), 0 16px 40px rgb(15 23 42 / 7%);
}

body.theme-traido input,
body.theme-traido select,
body.theme-traido textarea {
  background: #ffffff;
  border-color: #d5dce6;
  color: var(--ink);
}

body.theme-traido input:hover,
body.theme-traido select:hover,
body.theme-traido textarea:hover {
  border-color: #94a3b8;
}

body.theme-traido input:focus,
body.theme-traido select:focus,
body.theme-traido textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 15%);
  outline: none;
}

body.theme-traido input[type="checkbox"],
body.theme-traido input[type="range"] {
  accent-color: var(--brand-blue);
}

body.theme-traido .primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  box-shadow: 0 6px 16px rgb(37 99 235 / 24%);
  color: #ffffff;
}

body.theme-traido .primary:hover {
  background: var(--brand-blue-deep);
  border-color: var(--brand-blue-deep);
}

body.theme-traido main a:not(.primary):not(button),
body.theme-traido .privacy-acknowledgement a {
  color: var(--brand-blue-deep);
}

body.theme-traido .upload-part-row.is-previewed {
  box-shadow: 0 0 0 3px rgb(37 99 235 / 12%);
}

body.theme-traido .overview-line.is-current {
  background: rgb(37 99 235 / 6%);
}

body.theme-traido .form-submit {
  background: #f8fafc;
}

/* Customer pages have no top bar: on wide screens the configurator gets the whole window height. */
@media (min-width: 981px) {
  body.theme-traido .configurator {
    height: calc(100vh - 32px);
  }
}

/* Footer of the customer pages: Traido mark (five quick clicks open the admin login), company, links, language. */
body.theme-traido .site-footer {
  flex-wrap: wrap;
  gap: 16px 28px;
}

.footer-brand {
  align-items: center;
  cursor: default;
  display: flex;
  gap: 10px;
  user-select: none;
  -webkit-user-select: none;
}

.footer-brand .brand-mark {
  display: block;
  height: 26px;
  width: 26px;
}

.footer-brand .brand-mark path {
  fill: none;
  stroke: var(--brand-blue);
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.footer-brand .brand-name {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.theme-traido .site-footer .language-switch {
  border-left: 1px solid var(--line);
  display: flex;
  margin-left: 0;
}

body.theme-traido .site-footer .language-switch a {
  color: var(--muted);
  text-decoration: none;
}

body.theme-traido .site-footer .language-switch a.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

/* Start page: the 3D stage and the input column are two cards with the same gap between them as around them. */
body.theme-traido {
  --edge: 20px;
}

body.theme-traido .upload-workspace {
  padding: var(--edge);
}

body.theme-traido .upload-surface {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

body.theme-traido .upload-surface .configurator {
  gap: var(--edge);
}

body.theme-traido .upload-surface .part-viewer,
body.theme-traido .upload-surface .configurator-side {
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%), 0 16px 40px rgb(15 23 42 / 7%);
  overflow: hidden;
}

body.theme-traido .upload-surface .part-viewer {
  border-color: transparent;
}

body.theme-traido .upload-surface .configurator-side {
  background: var(--surface);
}

@media (min-width: 981px) {
  body.theme-traido .upload-surface .configurator {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    height: calc(100vh - 2 * var(--edge));
  }

  body.theme-traido .upload-surface .configurator-side {
    overflow-y: auto;
  }
}

/* ------------------------------------------------------------------
   Modern Traido look (customer pages): soft tinted background instead of plain white, a frosted glass card,
   filled rounded fields without hard frames, pill buttons with a steel-blue gradient, larger radii.
   ------------------------------------------------------------------ */

body.theme-traido {
  --paper: #cdd6e3;
  --line: rgb(15 23 42 / 8%);
  --glass: rgb(255 255 255 / 36%);
  --field: rgb(255 255 255 / 72%);
  --field-hover: rgb(255 255 255 / 88%);
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  background:
    radial-gradient(1100px 680px at 95% -10%, rgb(30 64 175 / 34%), transparent 62%),
    radial-gradient(1000px 620px at -10% 110%, rgb(15 23 42 / 28%), transparent 60%),
    radial-gradient(800px 500px at 60% 55%, rgb(14 116 144 / 12%), transparent 70%),
    #cdd6e3;
  background-attachment: fixed;
}

/* Cards: rounder; the input card is frosted glass over the tinted background. */
body.theme-traido .upload-surface .part-viewer,
body.theme-traido .upload-surface .configurator-side {
  border-radius: 24px;
}

body.theme-traido .upload-surface .configurator-side {
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  background: var(--glass);
  border: 1px solid rgb(255 255 255 / 75%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 70%) inset, 0 24px 60px -18px rgb(30 41 59 / 22%);
}

body.theme-traido .upload-surface .part-viewer {
  background-color: #0b1220;
  background-image:
    radial-gradient(circle at 50% 38%, rgb(59 130 246 / 22%), transparent 58%),
    linear-gradient(rgb(148 163 184 / 9%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(148 163 184 / 9%) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  box-shadow: 0 24px 60px -18px rgb(15 23 42 / 45%);
}

body.theme-traido .viewer-stage {
  background-color: transparent;
}

/* Sections inside the card: separated by space and a hairline, not by boxes. */
body.theme-traido .configurator-side .form-section + .form-section,
body.theme-traido .configurator-side .part-upload-list + .form-section {
  border-top: 1px solid var(--line);
}

body.theme-traido .section-number {
  background: var(--accent-gradient);
  box-shadow: 0 4px 10px -2px rgb(30 58 138 / 45%);
  color: #ffffff;
}

/* Fields: filled, rounded, no hard frame; a soft ring on focus. */
body.theme-traido input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
body.theme-traido select,
body.theme-traido textarea {
  background: var(--field);
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

body.theme-traido input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):hover,
body.theme-traido select:hover,
body.theme-traido textarea:hover {
  background: var(--field-hover);
  border-color: transparent;
}

body.theme-traido input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
body.theme-traido select:focus,
body.theme-traido textarea:focus {
  background: #ffffff;
  border-color: rgb(37 99 235 / 55%);
  box-shadow: 0 0 0 4px rgb(37 99 235 / 14%);
}

body.theme-traido label {
  color: #334155;
}

/* The part being edited: a soft tinted panel instead of a blue frame. */
body.theme-traido .configurator-side .upload-part-row,
body.theme-traido .configurator-side .upload-part-row.is-previewed {
  background: rgb(255 255 255 / 34%);
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 18px;
  box-shadow: 0 8px 24px -12px rgb(30 41 59 / 18%);
}

/* File drop tiles: tinted, rounded, no dashed Windows frame. */
body.theme-traido .upload-file-field {
  background: rgb(255 255 255 / 55%);
  border: 1px solid rgb(37 99 235 / 12%);
  border-radius: 14px;
  transition: background 140ms ease, border-color 140ms ease;
}

body.theme-traido .upload-file-field:hover,
body.theme-traido .upload-file-field.drag-over {
  background: rgb(37 99 235 / 9%);
  border-color: rgb(37 99 235 / 30%);
}

body.theme-traido .upload-file-field.has-file {
  background: rgb(16 185 129 / 8%);
  border-color: rgb(16 185 129 / 32%);
}

body.theme-traido .file-format {
  border-radius: 6px;
  letter-spacing: 0.04em;
}

body.theme-traido .step-upload .file-format {
  background: var(--accent-gradient);
  color: #ffffff;
}

body.theme-traido .drawing-upload .file-format {
  background: rgb(15 23 42 / 7%);
  color: #475569;
}

/* Quantity: one rounded field with quiet arrows instead of grey boxes. */
body.theme-traido .quantity-control {
  background: var(--field);
  border-radius: 12px;
  grid-template-columns: minmax(0, 1fr) 36px;
  overflow: hidden;
}

body.theme-traido .quantity-control input {
  background: transparent !important;
}

body.theme-traido .quantity-step {
  background: transparent;
  border: 0;
  color: #64748b;
  font-size: 0.7rem;
}

body.theme-traido .quantity-step:hover {
  background: rgb(37 99 235 / 10%);
  color: #1d4ed8;
}

/* Submit area: transparent with the summary as a soft pill. */
body.theme-traido .form-submit {
  background: transparent;
  border-top: 1px solid var(--line);
}

body.theme-traido .request-summary {
  background: rgb(37 99 235 / 8%);
  color: #1e3a8a;
}

/* Main button: pill with gradient and a soft coloured glow. */
body.theme-traido .primary {
  background: var(--accent-gradient);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 26px -10px rgb(30 58 138 / 60%);
  font-weight: 650;
  padding-left: 26px;
  padding-right: 26px;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

body.theme-traido .primary:hover {
  background: var(--accent-gradient);
  box-shadow: 0 16px 30px -10px rgb(30 58 138 / 70%);
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* 3D toolbar: a floating dark glass bar instead of a flat strip. */
body.theme-traido .viewer-toolbar {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgb(15 23 42 / 55%);
  border-top: 1px solid rgb(255 255 255 / 6%);
}

body.theme-traido .viewer-toolbar button {
  border-radius: 999px;
}

body.theme-traido .viewer-toolbar button.is-active,
body.theme-traido .viewer-toolbar button[aria-pressed="true"] {
  background: rgb(37 99 235 / 30%);
  border-color: rgb(96 165 250 / 55%);
}

body.theme-traido .site-footer {
  border-top-color: var(--line);
}

/* Section numbers count only the visible sections: 1 and 2 before a part is added, 1, 2 and 3 once the
   parts overview appears (a hidden section does not count). */
body.theme-traido .configurator-side {
  counter-reset: traido-section;
}

body.theme-traido .configurator-side .section-number {
  counter-increment: traido-section;
  font-size: 0;
}

body.theme-traido .configurator-side .section-number::before {
  content: counter(traido-section);
  font-size: 0.74rem;
}

/* Footer text a touch darker so it stays readable on the darker tinted background. */
body.theme-traido .site-footer,
body.theme-traido .site-footer a,
body.theme-traido .site-footer .language-switch a {
  color: #3b4657;
}

body.theme-traido .site-footer .language-switch a.selected {
  color: #ffffff;
}

/* ------------------------------------------------------------------
   "Wow" start: the empty 3D stage greets with a headline, a live milling scene and one clear action;
   a slowly drifting light in the background, cards that glide in, buttons that shine on hover.
   ------------------------------------------------------------------ */

body.theme-traido {
  isolation: isolate;
  position: relative;
}

body.theme-traido::before {
  animation: traido-aurora 26s ease-in-out infinite alternate;
  background:
    radial-gradient(38% 32% at 78% 18%, rgb(37 99 235 / 26%), transparent 70%),
    radial-gradient(34% 30% at 18% 82%, rgb(14 116 144 / 20%), transparent 70%),
    radial-gradient(28% 26% at 52% 48%, rgb(30 64 175 / 12%), transparent 70%);
  content: "";
  inset: -20%;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

@keyframes traido-aurora {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(-4%, 3%, 0) rotate(4deg); }
  100% { transform: translate3d(3%, -2%, 0) rotate(-3deg); }
}

/* Cards glide in on load. */
@keyframes traido-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

body.theme-traido .upload-surface .part-viewer {
  animation: traido-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

body.theme-traido .upload-surface .configurator-side {
  animation: traido-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) 120ms both;
}

/* Empty stage: centred welcome with headline, milling scene, action and the three facts. */
body.theme-traido .viewer-empty {
  align-content: center;
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  inset: 28px;
  justify-content: center;
  text-align: center;
}

body.theme-traido .viewer-empty > * {
  animation: traido-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

body.theme-traido .viewer-empty > :nth-child(2) { animation-delay: 180ms; }
body.theme-traido .viewer-empty > :nth-child(3) { animation-delay: 280ms; }
body.theme-traido .viewer-empty > :nth-child(4) { animation-delay: 400ms; }
body.theme-traido .viewer-empty > :nth-child(5) { animation-delay: 520ms; }
body.theme-traido .viewer-empty > :nth-child(6) { animation-delay: 600ms; }
body.theme-traido .viewer-empty > :nth-child(7) { animation-delay: 680ms; }

body.theme-traido .viewer-empty-icon {
  display: none;
}

.hero-title {
  color: #ffffff;
  font-size: clamp(30px, 3.3vw, 52px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 0;
}

.hero-title span {
  -webkit-background-clip: text;
  background-clip: text;
  background-image: linear-gradient(90deg, #7dd3fc 0%, #60a5fa 55%, #3b82f6 100%);
  color: transparent;
  display: block;
}

/* Milling scene: steel block, pocket outline, growing milled trail, cutter with a glowing tip. */
.hero-scene {
  display: block;
  filter: drop-shadow(0 24px 40px rgb(2 6 23 / 55%));
  height: auto;
  margin: 2px 0 4px;
  max-height: 34vh;
  transition: transform 300ms ease;
  width: min(420px, 74%);
}

.hero-face {
  stroke: rgb(191 230 255 / 55%);
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.hero-face-top { fill: rgb(148 163 184 / 20%); }
.hero-face-left { fill: rgb(30 58 138 / 40%); }
.hero-face-right { fill: rgb(15 23 42 / 60%); }

.hero-pocket {
  fill: rgb(2 6 23 / 30%);
  stroke: rgb(143 214 255 / 40%);
  stroke-dasharray: 4 3;
  stroke-width: 1;
}

.hero-trail {
  animation: hero-trail 7s linear infinite;
  fill: none;
  stroke: rgb(96 165 250 / 80%);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 8;
}

@keyframes hero-trail {
  0% { opacity: 1; stroke-dashoffset: 1; }
  86% { opacity: 1; stroke-dashoffset: 0; }
  97% { opacity: 0; stroke-dashoffset: 0; }
  100% { opacity: 0; stroke-dashoffset: 1; }
}

.hero-tool-shank { fill: #cbd5e1; }

.hero-tool-flutes {
  fill: none;
  stroke: #e2e8f0;
  stroke-linecap: round;
  stroke-width: 2;
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-cta {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 14%), 0 14px 34px -10px rgb(37 99 235 / 85%);
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  overflow: hidden;
  padding: 14px 30px;
  pointer-events: auto;
  position: relative;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hero-cta:hover {
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 20%), 0 18px 40px -10px rgb(37 99 235 / 95%);
  transform: translateY(-1px);
}

.hero-cta:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

body.theme-traido .hero-actions strong {
  color: rgb(203 213 225 / 85%);
  font-size: 0.82rem;
  font-weight: 500;
}

body.theme-traido .viewer-message {
  color: rgb(203 213 225 / 72%);
  font-size: 0.8rem;
  max-width: 380px;
}

/* The three facts as small glass chips in one row. */
body.theme-traido .viewer-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 6px 0 0;
}

body.theme-traido .viewer-facts li {
  align-items: center;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 999px;
  font-size: 0.76rem;
  gap: 8px;
  padding: 6px 12px 6px 8px;
}

body.theme-traido .viewer-facts span {
  background: rgb(143 214 255 / 14%);
  border-radius: 999px;
  padding: 2px 6px;
}

/* A thin scan line sweeps over the empty stage. */
body.theme-traido .viewer-stage:has(> .viewer-empty:not([hidden]))::after {
  animation: hero-scan 5.5s ease-in-out infinite;
  background: linear-gradient(180deg, transparent, rgb(96 165 250 / 14%) 45%, rgb(147 197 253 / 30%) 50%, rgb(96 165 250 / 14%) 55%, transparent);
  content: "";
  height: 120px;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: -120px;
  z-index: 0;
}

@keyframes hero-scan {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(calc(100vh + 120px)); opacity: 0; }
}

/* Dragging files over the stage: it lights up. */
body.theme-traido .viewer-stage.drag-over {
  box-shadow: inset 0 0 0 2px #60a5fa, inset 0 0 80px rgb(96 165 250 / 30%);
}

body.theme-traido .viewer-stage.drag-over .hero-scene {
  transform: scale(1.05);
}

/* Buttons shine once when the pointer passes over them. */
body.theme-traido .primary {
  overflow: hidden;
  position: relative;
}

body.theme-traido .primary::after,
.hero-cta::after {
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 38%) 50%, transparent 70%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-120%);
  transition: transform 650ms ease;
}

body.theme-traido .primary:hover::after,
.hero-cta:hover::after {
  transform: translateX(120%);
}

/* Small screens and low windows: keep the welcome compact. */
@media (max-width: 980px) {
  body.theme-traido .hero-scene,
  body.theme-traido .viewer-facts {
    display: none;
  }

  body.theme-traido .viewer-empty {
    gap: 10px;
    inset: 20px;
  }
}

@media (max-height: 760px) {
  body.theme-traido .viewer-facts {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-traido::before,
  body.theme-traido .upload-surface .part-viewer,
  body.theme-traido .upload-surface .configurator-side,
  body.theme-traido .viewer-empty > *,
  body.theme-traido .viewer-stage::after,
  .hero-trail {
    animation: none !important;
  }

  .hero-trail {
    stroke-dashoffset: 0;
  }

  .hero-tool,
  body.theme-traido .viewer-stage::after {
    display: none;
  }
}

/* The welcome sits above the scan line. */
body.theme-traido .viewer-empty {
  z-index: 2;
}

body.theme-traido .hero-cta {
  color: #ffffff;
}

/* Phones: a compact welcome that fits the shorter stage. */
@media (max-width: 980px) {
  body.theme-traido .viewer-empty {
    gap: 8px;
    inset: 24px 20px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-cta {
    padding: 12px 24px;
  }

  body.theme-traido .hero-actions strong {
    display: none;
  }

  body.theme-traido .viewer-message {
    font-size: 0.72rem;
  }
}

/* The three steps as a picture: icon + two words, joined by arrows. */
body.theme-traido .viewer-facts {
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

body.theme-traido .viewer-facts li {
  background: transparent;
  border: 0;
  color: #e2e8f0;
  flex-direction: column;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 8px;
  padding: 0 4px;
  width: 104px;
}

body.theme-traido .viewer-facts svg {
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(143 214 255 / 22%);
  border-radius: 14px;
  box-sizing: border-box;
  fill: none;
  height: 48px;
  padding: 12px;
  stroke: #8fd6ff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 48px;
}

body.theme-traido .viewer-facts li + li::before {
  border-right: 2px solid rgb(143 214 255 / 45%);
  border-top: 2px solid rgb(143 214 255 / 45%);
  content: "";
  height: 7px;
  left: -10px;
  position: absolute;
  top: 20px;
  transform: rotate(45deg);
  width: 7px;
}

body.theme-traido .viewer-facts li {
  position: relative;
}

body.theme-traido .viewer-message {
  font-size: 0.74rem;
}

@media (max-width: 980px) {
  body.theme-traido .viewer-facts {
    display: none;
  }
}
