:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6f5;
  color: #20282d;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(31, 112, 128, 0.14), rgba(244, 246, 245, 0) 330px),
    #f4f6f5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.phone-shell,
.operator-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 18px;
}

.phone-shell {
  min-height: 100vh;
}

.centered {
  display: grid;
  align-items: center;
}

.mobile-panel,
.serial-card,
.empty-state {
  width: min(100%, 520px);
  margin: 0 auto;
}

.language-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 16px;
}

.language-switch a,
.small-button {
  border: 1px solid #cbd6d9;
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: #20282d;
  font-weight: 800;
  text-decoration: none;
}

.language-switch a[aria-current="page"] {
  border-color: #1f7283;
  background: #e1f1ef;
}

.progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 20px;
}

.progress span {
  width: 34px;
  height: 6px;
  border-radius: 999px;
  background: #ccd8dc;
}

.progress .is-current {
  background: #cb402e;
}

.eyebrow {
  margin: 0 0 6px;
  color: #60717a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 8vw, 2.45rem);
  line-height: 1;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.particle-groups {
  display: grid;
  gap: 38px;
}

.particle-group {
  display: grid;
  gap: 14px;
}

.particle-group + .particle-group {
  margin-top: 4px;
}

.particle-group-header {
  display: grid;
  gap: 6px;
}

.particle-group-header h2,
.particle-group-header p {
  margin: 0;
}

.particle-group-header p {
  color: #60717a;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.particle-group-header h2 {
  color: #20282d;
  font-size: 1.18rem;
  line-height: 1.1;
}

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

.particle-card {
  display: grid;
  align-content: start;
  grid-template-rows: minmax(2.25em, auto) 92px auto;
  gap: 8px;
  min-height: 232px;
  border: 2px solid #d5dee3;
  border-radius: 8px;
  padding: 13px 12px 12px;
  background: #fff;
  color: #20282d;
  text-align: center;
  text-decoration: none;
}

.particle-card:focus,
.particle-card:hover {
  border-color: #1f7283;
  background: #e1f1ef;
}

.particle-card img {
  width: 100%;
  height: 92px;
  object-fit: contain;
}

.particle-card-label,
.particle-card-description {
  overflow-wrap: anywhere;
}

.particle-card-label {
  align-self: end;
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.08;
}

.particle-card-description {
  color: #6a7880;
  font-size: 0.72rem;
  font-weight: 560;
  line-height: 1.32;
}

.particle-card:focus .particle-card-description,
.particle-card:hover .particle-card-description {
  color: #31434b;
}

.selected-particle {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.selected-particle img {
  width: 108px;
  height: 108px;
  object-fit: contain;
}

.selfie-shell {
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  min-height: 100vh;
  min-height: 100svh;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  padding: 12px;
}

.selfie-shell .language-switch {
  margin: 0 0 8px;
}

.selfie-shell .progress {
  margin: 0 0 10px;
}

.selfie-panel {
  flex: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.selfie-context {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.selfie-context img {
  width: 58px;
  height: 58px;
}

.selfie-context h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 6vw, 2rem);
}

.selfie-capture {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.photo-drop {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: #20282d;
  overflow: hidden;
}

.selfie-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-drop img,
.photo-drop video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.photo-drop video {
  transform: scaleX(-1);
}

.photo-drop img.is-visible,
.photo-drop video.is-visible {
  opacity: 1;
}

.photo-copy {
  position: absolute;
  z-index: 4;
  bottom: 108px;
  left: 50%;
  max-width: calc(100% - 32px);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #20282d;
  font-weight: 900;
  opacity: 0;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.photo-drop[data-state="error"] .photo-copy,
.photo-drop[data-state="fallback"] .photo-copy {
  opacity: 1;
}

.camera-button {
  position: absolute;
  z-index: 5;
  display: none;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.camera-start {
  top: 50%;
  left: 50%;
  background: #fff;
  color: #20282d;
  transform: translate(-50%, -50%);
}

.camera-capture {
  bottom: 20px;
  left: 50%;
  background: #cb402e;
  color: #fff;
  transform: translateX(-50%);
}

.photo-drop[data-state="error"] .camera-start,
.photo-drop[data-state="idle"] .camera-start,
.photo-drop[data-state="live"] .camera-capture {
  display: grid;
}

.camera-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.camera-glyph {
  position: relative;
  width: 34px;
  height: 24px;
  border: 3px solid currentColor;
  border-radius: 7px;
}

.camera-glyph::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border: 3px solid currentColor;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.camera-glyph::after {
  content: "";
  position: absolute;
  top: -9px;
  left: 8px;
  width: 14px;
  height: 7px;
  border-radius: 5px 5px 0 0;
  background: currentColor;
}

.capture-review-actions {
  position: absolute;
  z-index: 5;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.photo-drop[data-state="captured"] .capture-review-actions {
  display: grid;
}

.review-button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #20282d;
  font-weight: 900;
}

.review-submit {
  background: #cb402e;
  color: #fff;
}

.fallback-upload {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: none;
  transform: translate(-50%, -50%);
}

.photo-drop[data-state="fallback"] .fallback-upload {
  display: inline-flex;
}

.primary-action {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 15px 18px;
  background: #cb402e;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.serial-card,
.empty-state {
  border: 1px solid #dce4e7;
  border-radius: 8px;
  padding: 22px;
  background: #fff;
}

.serial-number {
  margin: 12px 0 18px;
  color: #cb402e;
  font-size: clamp(4rem, 22vw, 7rem);
  font-weight: 950;
  line-height: 0.9;
}

.receipt-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: center;
}

.receipt-row img,
.rendered-preview img,
.thumbs img,
.detail-media img {
  border-radius: 8px;
  background: #eef3f4;
  object-fit: contain;
}

.receipt-row img {
  width: 84px;
  height: 84px;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: #dce4e7;
  color: #26343b;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-rendered,
.status-printed,
.status-ready,
.lock-released {
  background: #dff0df;
  color: #276332;
}

.status-failed,
.danger-button {
  background: #fde2de;
  color: #8b2f24;
}

.status-processing {
  background: #e1f1ef;
  color: #1f7283;
}

.rendered-preview {
  margin: 18px 0 0;
}

.rendered-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.muted,
.queued-note {
  color: #60717a;
}

.messages {
  position: fixed;
  z-index: 10;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}

.message {
  margin: 0;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(32, 40, 45, 0.18);
  font-weight: 800;
}

.operator-header,
.operator-actions,
.job-title,
.job-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.operator-header {
  justify-content: space-between;
  margin-bottom: 16px;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.metrics span,
.serial-chip {
  border-radius: 8px;
  padding: 8px 10px;
  background: #20282d;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.operator-actions {
  margin-bottom: 14px;
}

.print-form {
  margin: 0;
}

.job-list {
  display: grid;
  gap: 10px;
}

.job-card {
  display: grid;
  grid-template-columns: auto auto 180px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #dce4e7;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.print-select {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
}

.print-select input {
  width: 18px;
  height: 18px;
  margin: 0;
}

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

.print-select[aria-disabled="true"] {
  opacity: 0.35;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  gap: 6px;
}

.thumbs img {
  width: 52px;
  height: 52px;
}

.job-body {
  min-width: 0;
}

.job-error {
  margin: 8px 0 0;
  color: #8b2f24;
  font-weight: 800;
}

.job-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.job-actions form {
  margin: 0;
}

.small-button {
  display: inline-flex;
  cursor: pointer;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
}

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

.detail-media figure,
.detail-panel {
  margin: 0;
  border: 1px solid #dce4e7;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.detail-media img {
  width: 100%;
  aspect-ratio: 1;
}

.detail-media figcaption {
  margin-top: 8px;
  color: #60717a;
  font-weight: 800;
}

.detail-panel dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  margin: 0 0 16px;
}

.detail-panel dt {
  color: #60717a;
  font-weight: 800;
}

.detail-panel dd {
  margin: 0;
}

.detail-actions {
  justify-content: flex-start;
}

@media (max-width: 760px) {
  .operator-header,
  .job-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .job-card,
  .detail-layout,
  .detail-media {
    grid-template-columns: 1fr;
  }

  .job-actions {
    justify-content: flex-start;
  }
}
