:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

body.camera-active {
  overflow: hidden;
  background: #000;
}

body.camera-active .app-header,
body.camera-active main {
  visibility: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border-bottom: 1px solid #d9e2dd;
}

.eyebrow {
  margin: 0;
  color: #587064;
  font-size: 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 26px;
}

h2 {
  font-size: 21px;
}

main {
  display: grid;
  gap: 14px;
  max-width: 920px;
  margin: 0 auto;
  padding: 14px;
}

.panel {
  background: #ffffff;
  border: 1px solid #dce5df;
  border-radius: 8px;
  padding: 14px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 700;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 54px;
  border: 1px solid #b8c5bd;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 19px;
}

button {
  min-height: 58px;
  border: 0;
  border-radius: 6px;
  padding: 13px 16px;
  background: #166534;
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
}

button.secondary {
  background: #9a3412;
}

button.ghost {
  background: #eef4f0;
  color: #17442a;
}

.route-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.history-restart {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  background: #9a3412;
  font-size: 16px;
}

.admin-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #d6e0da;
}

.admin-details summary {
  min-height: 54px;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  opacity: 0.65;
}

.quick-test-panel {
  border: 2px solid #15803d;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.quick-test-panel h2 {
  margin: 8px 0;
  font-size: 24px;
}

.quick-test-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 10px;
  background: #166534;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.quick-start {
  width: 100%;
  min-height: 68px;
  margin-top: 4px;
  font-size: 21px;
}

.quick-start-status {
  min-height: 22px;
  margin: 9px 0 0;
  color: #365a45;
  font-size: 14px;
  font-weight: 700;
}

.test-mode-notice {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #854d0e;
  font-weight: 900;
  line-height: 1.5;
}

.route-tabs button:not(.active) {
  background: #e8eee9;
  color: #17442a;
}

.status-pill {
  border-radius: 999px;
  padding: 8px 10px;
  background: #fef3c7;
  color: #854d0e;
  font-weight: 700;
  white-space: nowrap;
}

.storage-status {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #d6e0da;
  border-radius: 6px;
  background: #f8fafc;
  color: #172033;
}

.storage-status.warning {
  border-color: #f59e0b;
  background: #fffbeb;
}

.unsynced-details {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  background: #fffbeb;
}

.unsynced-details summary {
  min-height: 38px;
  cursor: pointer;
  color: #854d0e;
  font-weight: 800;
}

.unsynced-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
}

.unsynced-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #f5d58a;
  border-radius: 6px;
  background: #ffffff;
  font-size: 14px;
}

.unsynced-card strong {
  font-size: 16px;
}

.unsynced-error {
  color: #b91c1c;
  font-weight: 700;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.product-list,
.history-list {
  display: grid;
  gap: 10px;
}

.diagnostic-export {
  width: 100%;
  margin-top: 12px;
  background: #92400e;
  color: #fff;
}

.secondary-diagnostic {
  margin-top: 8px;
  background: #6b7280;
}

.diagnostic-help {
  margin-top: 8px;
  margin-bottom: 8px;
}

.product-card,
.history-card,
.step-card {
  border: 1px solid #d6e0da;
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfb;
}

.product-card {
  color: #172033;
  text-align: left;
}

.product-card span {
  display: block;
  margin-top: 4px;
  color: #647469;
}

.product-schedule {
  padding-top: 6px;
  color: #385648 !important;
  font-size: 14px;
  line-height: 1.5;
}

.route-product-exclusion-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid #d6e0da;
}

.route-product-exclusion-panel h3 {
  margin: 0 0 8px;
}

.inspection-step-override-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #d6e0da;
}

.inspection-step-override-panel h4 {
  margin: 0 0 8px;
  font-size: 18px;
}

.route-product-exclusion-status {
  min-height: 24px;
  margin: 8px 0;
  color: #9a3412;
  font-weight: 800;
}

.route-product-exclusion-list {
  display: grid;
  gap: 8px;
}

.route-product-exclusion-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d6e0da;
  border-radius: 8px;
  background: #fbfdfb;
}

.route-product-exclusion-row span {
  display: block;
  color: #647469;
  font-size: 14px;
}

.route-product-exclusion-row button {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 15px;
}

.route-product-exclusion-row button.remove-product {
  background: #9a3412;
}

.route-product-exclusion-row.excluded-product {
  background: #f3f4f6;
}

.product-card strong {
  display: block;
  font-size: 22px;
}

.product-card.pending {
  border-color: #d6a500;
  background: #fff8d9;
  opacity: 1;
}

.product-card.pending .product-status {
  color: #7a5a00;
  font-weight: 800;
}

.product-card.ng {
  border: 2px solid #c62828;
  background: #fff1f1;
}

.product-card.ng strong,
.product-card.ng .product-status {
  color: #b71c1c;
  font-weight: 900;
}

.product-card.hold {
  border: 2px solid #d06b00;
  background: #fff4e5;
}

.product-card.hold strong,
.product-card.hold .product-status {
  color: #a84b00;
  font-weight: 900;
}

.empty-list {
  margin: 0;
  padding: 16px;
  border: 1px solid #d6e0da;
  border-radius: 8px;
  background: #fbfdfb;
  color: #647469;
  font-weight: 700;
}

.muted {
  color: #647469;
}

.hidden {
  display: none;
}

.drop-zone {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  padding: 18px;
  border: 2px dashed #8aa59a;
  border-radius: 8px;
  background: #f7fbf8;
  text-align: center;
}

.drop-zone strong {
  font-size: 22px;
}

.drop-zone span {
  color: #647469;
  font-weight: 700;
}

.drop-zone.dragging {
  border-color: #166534;
  background: #ecfdf3;
}

.drop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.file-drop {
  min-height: 150px;
  margin: 0;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.file-drop:hover,
.file-drop:focus {
  border-color: #0f5132;
  outline: none;
  transform: translateY(-1px);
}

.file-drop.loading {
  border-color: #d97706;
  background: #fff7ed;
}

.file-drop.loaded {
  border-color: #15803d;
  background: #ecfdf3;
}

.master-update-status {
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid #bbd2c4;
  border-radius: 8px;
  background: #ecfdf3;
  color: #14532d;
  font-size: 14px;
  line-height: 1.55;
}

.master-update-status.loading {
  border-color: #f5c26b;
  background: #fff7ed;
  color: #7c2d12;
}

.master-update-status.warning,
.admin-master-recovery {
  border-color: #f5c26b;
  background: #fff7ed;
  color: #7c2d12;
}

.admin-master-recovery {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #f5c26b;
  border-radius: 8px;
}

.admin-master-recovery p {
  margin: 6px 0 10px;
}

.master-update-status.error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #7f1d1d;
}

.master-update-status strong {
  font-weight: 900;
}

.file-drop.error {
  border-color: #b91c1c;
  background: #fef2f2;
}

.file-drop small {
  display: block;
  min-height: 22px;
  overflow-wrap: anywhere;
  color: #304238;
  font-weight: 800;
}

#publishMaster {
  width: 100%;
  margin-top: 14px;
  font-size: 20px;
}

.master-import-review {
  margin-top: 18px;
  padding: 16px;
  border: 2px solid #86b49a;
  border-radius: 8px;
  background: #f7fbf8;
}

.master-import-review h3 {
  margin: 0 0 8px;
}

.review-error {
  color: #991b1b;
  font-weight: 800;
}

.review-warning {
  color: #9a5b00;
  font-weight: 800;
}

.review-table-wrap {
  overflow-x: auto;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.review-table th,
.review-table td {
  padding: 10px;
  border: 1px solid #cbd8d0;
  text-align: left;
  white-space: nowrap;
}

.review-table th {
  background: #e7f1ea;
}

.review-ok td:last-child {
  color: #166534;
  font-weight: 800;
}

.review-ng {
  background: #fef2f2;
}

.review-ng td:last-child {
  color: #991b1b;
  font-weight: 800;
}

.review-warning-row {
  background: #fff8e6;
}

.review-warning-row td:last-child {
  color: #9a5b00;
  font-weight: 800;
}

.review-confirm {
  margin-top: 14px;
  font-weight: 800;
}

.employee-code-admin {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #f7faf8;
}

.employee-code-admin h3,
.registration-candidate h3 {
  margin-top: 0;
}

.employee-code-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.visual-reference-reset-entry {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.employee-code-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.employee-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d6e0da;
  border-radius: 6px;
  background: #fff;
}

.danger-outline {
  width: auto;
  padding: 8px 12px;
  color: #991b1b;
  background: #fff;
  border: 1px solid #fca5a5;
}

body.mode-inspection #adminPanel {
  display: none;
}

body.mode-admin #setupPanel,
body.mode-admin #quickTestPanel,
body.mode-admin #listPanel,
body.mode-admin #inspectionPanel,
body.mode-admin #historyPanel,
body.mode-admin .status-pill {
  display: none;
}

body.mode-admin main {
  max-width: 860px;
}

@media (max-width: 760px) {
  .drop-grid {
    grid-template-columns: 1fr;
  }
}

.step-card {
  margin-bottom: 12px;
}

.inspection-step-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0 12px;
}

.inspection-step-progress button {
  min-height: 54px;
  padding: 6px 4px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #f4f7f5;
  color: #52635a;
  font-size: 12px;
  font-weight: 800;
}

.inspection-step-progress button span {
  display: block;
  margin-bottom: 2px;
  font-size: 16px;
}

.inspection-step-progress button.active {
  border-color: #166534;
  background: #dcfce7;
  color: #14532d;
}

.inspection-step-progress button.complete {
  background: #166534;
  color: #fff;
}

.step-note-details {
  margin-top: 10px;
}

.retry-instruction {
  display: block;
  margin-top: 8px;
}

.camera-guide {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 14px;
  border: 2px dashed #15803d;
  border-radius: 8px;
  background: #f0fdf4;
  text-align: center;
}

.camera-guide strong {
  font-size: 18px;
}

.camera-guide span {
  color: #496155;
  font-size: 14px;
}

.camera-capture-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 15px;
  border-radius: 8px;
  background: #166534;
  color: #fff;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.primary-inspection-capture {
  min-height: 64px;
  margin: 0 0 10px;
  font-size: 22px;
  box-shadow: 0 3px 0 #0b4722;
}

.inspection-camera-dialog {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #08110d;
  color: #fff;
  overflow: hidden;
}

.inspection-camera-dialog::backdrop {
  background: rgb(0 0 0 / 86%);
}

.inspection-camera-panel {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
}

.inspection-camera-header {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  left: max(8px, env(safe-area-inset-left));
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.camera-close {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #26352e;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  pointer-events: auto;
}

.camera-target-label {
  max-width: calc(100vw - 72px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgb(0 0 0 / 72%);
  color: #fff;
  font-size: clamp(16px, 3.2vw, 22px);
  line-height: 1.1;
  text-align: right;
}

.camera-video-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  margin: 0;
  border-radius: 0;
  background: #000;
}

.camera-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  transition: transform 120ms ease-out;
}

.camera-capture-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  box-sizing: border-box;
  border: 3px solid rgb(250 204 21 / 94%);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgb(0 0 0 / 12%), inset 0 0 0 1px rgb(255 255 255 / 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.camera-capture-frame-label-code {
  width: min(98vw, 1480px);
  height: 95dvh;
}

.camera-capture-frame-film-print {
  width: min(97vw, 1380px);
  height: 95dvh;
}

.camera-capture-frame-name-sticker {
  width: min(97vw, 1380px);
  height: 95dvh;
}

.camera-capture-frame-sticker {
  width: min(92vw, 1100px);
  height: 90dvh;
}

.camera-actions {
  position: absolute;
  right: 0;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.camera-actions .camera-shutter {
  width: 86px;
  height: 86px;
  min-height: 86px;
  padding: 5px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: transparent;
  pointer-events: auto;
}

.camera-actions .camera-shutter:disabled {
  opacity: 0.45;
}

.camera-shutter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #facc15;
}

@media (orientation: landscape) and (max-height: 560px) {
  .camera-actions {
    right: max(10px, env(safe-area-inset-right));
    bottom: 0;
    left: auto;
    top: 0;
    align-items: center;
  }

  .camera-actions .camera-shutter {
    width: 82px;
    height: 82px;
    min-height: 82px;
  }
}

.camera-capture-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.capture-preview {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  margin-top: 10px;
  border-radius: 6px;
  background: #ecf1ee;
}

.sticker-text {
  margin-top: 10px;
}

.step-note {
  margin-top: 10px;
}

.step-note textarea {
  min-height: 78px;
  resize: vertical;
}

.auto-status {
  margin-top: 10px;
  margin-bottom: 0;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #d6e0da;
  font-weight: 700;
}

.auto-status span {
  font-weight: 500;
}

.auto-status.ok {
  background: #ecfdf3;
  border-color: #86efac;
  color: #14532d;
}

.auto-status.ng {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

.auto-status.hold,
.auto-status.pending {
  background: #fff7ed;
  border-color: #fdba74;
  color: #7c2d12;
}

.result-box {
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #d8e0e7;
}

.install-app-card {
  margin: 10px 0 16px;
  padding: 12px;
  border: 1px solid #86b99b;
  border-radius: 10px;
  background: #f0fdf4;
}

.install-app-button {
  width: 100%;
  min-height: 48px;
  background: #14532d;
  color: #fff;
  font-weight: 800;
}

.install-app-card p {
  margin: 8px 0 0;
}

.registration-candidate {
  margin: 18px 0;
  padding: 16px;
  border: 2px solid #166534;
  border-radius: 8px;
  background: #f0fdf4;
}

.candidate-capture {
  display: block;
  margin-top: 12px;
  font-weight: 800;
}

#saveRegistrationCandidate {
  width: 100%;
  margin-top: 12px;
}

@media (max-width: 620px) {
  .row,
  .route-tabs,
  .action-row {
    grid-template-columns: 1fr;
  }

  .employee-code-entry {
    grid-template-columns: 1fr;
  }

  .visual-reference-reset-entry {
    grid-template-columns: 1fr;
  }

  .route-product-exclusion-row {
    grid-template-columns: 1fr;
  }

  .route-product-exclusion-row button {
    width: 100%;
  }
}


.v2-panel {
  border: 2px solid #1d6f42;
}

.v2-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.v2-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.v2-badge-ok {
  background: #dcfce7;
  color: #166534;
}

.v2-badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.v2-badge-muted {
  background: #e5e7eb;
  color: #374151;
}

.v2-section-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #d6e0da;
}

.v2-summary {
  font-weight: 700;
  margin: 10px 0;
}

.v2-product-list {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.v2-product-card {
  padding: 12px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #fbfdfb;
}

.v2-product-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.v2-meta {
  margin: 4px 0;
  font-size: 13px;
}

.v2-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.v2-thumb-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d6e0da;
  border-radius: 6px;
  background: #fff;
}

.v2-thumb-box img {
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

.v2-inline-field {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.v2-warning-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #92400e;
  font-size: 13px;
}

.v2-detail-box {
  margin-top: 8px;
  font-size: 13px;
}


.v2-badge-ng {
  background: #fee2e2;
  color: #991b1b;
}

.v2-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.v2-camera-wrap {
  margin: 12px 0;
}

.v2-camera-stage {
  position: relative;
  width: 100%;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.v2-camera-stage video {
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
}

.v2-guide-overlay {
  position: absolute;
  inset: 6% 5%;
  border: 3px solid #facc15;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 6px;
  pointer-events: none;
}

.v2-guide-cell {
  border: 1.5px dashed rgba(250, 204, 21, 0.85);
  border-radius: 4px;
  color: #fef08a;
  font-weight: 700;
  font-size: 13px;
  padding: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.v2-canvas-wrap {
  margin: 10px 0;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.v2-crate-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: manipulation;
}

.v2-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.v2-toolbar button {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.v2-active-mode {
  border-color: #1d6f42 !important;
  background: #dcfce7 !important;
  color: #166534 !important;
  font-weight: 700;
}

.v2-text-ok {
  color: #166534;
  font-weight: 700;
}

.v2-text-warn {
  color: #92400e;
  font-weight: 700;
}

.v2-verdict-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0;
  font-weight: 700;
}

.v2-review-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #f8faf9;
}

.v2-reason-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.v2-reason-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #cbd8d0;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}


.v2-closeup-bar {
  margin-top: 8px;
}

.v2-closeup-result {
  margin-top: 6px;
  padding: 6px 8px;
  border-left: 3px solid #1d6f42;
  background: #f0fdf4;
  border-radius: 4px;
}


body.v2-camera-open {
  overflow: hidden;
}

.v2-camera-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  margin: 0;
  background: #000;
  display: flex;
  flex-direction: column;
}

.v2-camera-fullscreen .v2-camera-stage {
  flex: 1;
  min-height: 0;
  border-radius: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.v2-camera-fullscreen .v2-camera-stage video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  transform-origin: center center;
}

.v2-camera-fullscreen .v2-guide-overlay {
  inset: 3% 2.5%;
}

.v2-camera-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
}

.v2-camera-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 700;
}

.v2-camera-zoom-pill {
  background: #1d6f42;
  color: #fff;
}

.v2-camera-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px max(16px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.9);
}

.v2-shutter-primary {
  flex: 1 1 200px;
  padding: 16px 18px;
  font-size: 18px;
  font-weight: 800;
  background: #16a34a;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  box-shadow: 0 4px 0 #14532d;
  transition: transform 80ms ease, background-color 120ms ease, box-shadow 80ms ease;
}

.v2-shutter-primary:active {
  transform: scale(0.96) translateY(2px);
  background: #15803d;
  box-shadow: 0 1px 0 #14532d;
}

.v2-shutter-primary:disabled,
.v2-shutter-primary.is-capturing {
  background: #ca8a04;
  box-shadow: none;
  opacity: 0.92;
}

.v2-camera-close-btn {
  flex: 0 1 auto;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.v2-camera-postshot {
  background: rgba(0, 0, 0, 0.94);
  color: #fff;
  padding-top: 10px;
}

.v2-postshot-summary {
  margin: 0 14px 4px;
  font-size: 14px;
  font-weight: 700;
  color: #fef08a;
}

.v2-guide-closeup {
  inset: 14% 10% !important;
  border-color: #38bdf8 !important;
}

.v2-closeup-target {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  color: #e0f2fe;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.v2-master-ready-banner {
  background: #ecfdf5 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}


.v2-shot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.v2-shot-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #fff;
}

.v2-shot-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #d6e0da;
}

.v2-shot-placeholder {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1.5px dashed #cbd8d0;
  border-radius: 6px;
  background: #f8faf9;
  color: #4b5563;
  font-size: 12px;
  text-align: center;
}

.v2-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.v2-firstday-box {
  margin: 12px 0;
  padding: 12px;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
}

.v2-camera-guide-banner {
  padding: 8px 14px;
  background: rgba(20, 83, 45, 0.92);
  color: #fef08a;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.v2-single-guide-box {
  inset: 8% 6% !important;
  border: 3px solid #facc15 !important;
  border-radius: 12px;
}

.v2-secondary-details > summary {
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

.v2-shutter-flash {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease-out;
}

.v2-shutter-flash.is-flashing {
  opacity: 0.9;
  transition: none;
}

.v2-camera-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 25;
  transform: translate(-50%, 10px);
  max-width: calc(100% - 28px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.96);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

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

.v2-camera-toast.is-warn {
  background: rgba(217, 119, 6, 0.96);
}

.v2-camera-thumb-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 12px 2px;
  background: rgba(0, 0, 0, 0.9);
}

.v2-camera-thumb-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  font-size: 11px;
  font-weight: 700;
  min-height: 44px;
}

.v2-camera-thumb-slot.is-current {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.18);
  color: #fef08a;
}

.v2-camera-thumb-slot.is-done {
  border-color: #4ade80;
  background: rgba(22, 163, 74, 0.24);
  color: #dcfce7;
}

.v2-camera-thumb-slot img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.v2-busy-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 2px solid #16a34a;
  background: #ecfdf5;
  color: #14532d;
  font-size: 14px;
  font-weight: 800;
}

.v2-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #bbf7d0;
  border-top-color: #16a34a;
  border-radius: 50%;
  flex-shrink: 0;
  animation: v2-spin 0.8s linear infinite;
}

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

.v2-sync-box {
  margin: 10px 0 4px;
  padding: 12px;
  border: 1.5px solid #86efac;
  border-radius: 8px;
  background: #f0fdf4;
}

.v2-sync-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.v2-sync-row input {
  flex: 1 1 200px;
  margin: 0;
}

.v2-sync-row button {
  flex: 0 0 auto;
  width: auto;
}

.v2-autosync-toggle {
  margin: 6px 0 10px;
}

.v2-session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid #cbd8d0;
  background: #f8faf9;
}

.v2-session-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.v2-session-bar button {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.v2-badge-running {
  background: #dbeafe;
  color: #1e40af;
}

.v2-product-grid-wrap {
  margin: 10px 0 6px;
}

.v2-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin: 6px 0 10px;
}

.v2-product-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 2px solid #cbd8d0;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  text-align: left;
  cursor: pointer;
  transition: transform 80ms ease, background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.v2-product-tile:active {
  transform: scale(0.98);
}

.v2-product-tile.is-selected {
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
  background: #f0fdf4;
}

.v2-product-tile.is-status-ok {
  background: #d1d5db;
  border-color: #6b7280;
  color: #374151;
  opacity: 0.72;
}

.v2-product-tile.is-status-ok.is-selected {
  opacity: 0.92;
  border-color: #15803d;
}

.v2-product-tile.is-status-running {
  background: #eff6ff;
  border-color: #3b82f6;
}

.v2-product-tile.is-status-hold {
  background: #fffbeb;
  border-color: #f59e0b;
}

.v2-product-tile.is-status-ng {
  background: #fef2f2;
  border-color: #dc2626;
}

.v2-tile-head {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.v2-tile-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.v2-tile-meta {
  font-size: 11px;
  color: #4b5563;
}

.v2-queue-card {
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.v2-queue-card:hover {
  border-color: #16a34a;
}

.v2-queue-card.is-active-detail {
  border: 2px solid #16a34a;
  background: #f0fdf4;
}

.v2-setup-date-card {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid #cbd8d0;
  border-radius: 10px;
  background: #f8faf9;
}

.v2-setup-date-options {
  margin-top: 8px;
}

.v2-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.v2-date-chip {
  width: auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #86b99b;
  background: #ffffff;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.v2-date-chip.is-active {
  background: #166534;
  color: #ffffff;
}

.v2-route-start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.v2-route-start-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 76px;
  padding: 14px 12px;
  border-radius: 12px;
  background: #15803d;
  color: #ffffff;
  font-size: 16px;
  text-align: center;
}

.v2-route-start-btn span {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.92;
}

.v2-route-start-btn.v2-route-start-y {
  background: #1d4ed8;
}

.v2-route-start-btn.is-complete {
  background: #4b5563;
  opacity: 0.85;
}

.v2-setup-footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.v2-setup-footer-row button {
  flex: 1 1 160px;
  font-size: 13px;
  padding: 9px 10px;
}

.v2-capture-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d6e0da;
}

.v2-nav-btn {
  width: auto !important;
  padding: 7px 10px !important;
  font-size: 12px !important;
  white-space: nowrap;
}

.v2-route-pill-group {
  display: inline-flex;
  border: 1.5px solid #cbd8d0;
  border-radius: 999px;
  overflow: hidden;
  background: #f3f4f6;
}

.v2-route-pill {
  width: auto !important;
  min-height: 32px;
  padding: 5px 11px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}

.v2-route-pill.is-active {
  background: #15803d;
  color: #ffffff;
}

.v2-route-pill[data-route="Y"].is-active {
  background: #1d4ed8;
  color: #ffffff;
}

.v2-autoswitch-banner {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #22c55e;
  background: #dcfce7;
  color: #14532d;
  font-size: 13px;
  font-weight: 800;
}

.v2-capture-card {
  margin-top: 8px;
  padding: 12px;
  border: 1.5px solid #cbd8d0;
  border-radius: 10px;
  background: #fbfdfb;
}

.v2-primary-capture-btn {
  min-height: 54px;
  font-size: 17px !important;
  font-weight: 800 !important;
}

.v2-compact-options {
  margin-top: 10px;
}

.v2-panel.hidden,
.v2-panel .hidden,
.v2-view.hidden,
.v2-autoswitch-banner.hidden,
.v2-camera-fullscreen.hidden,
.v2-camera-controls.hidden,
.v2-camera-postshot.hidden,
.v2-workspace.hidden,
.v2-busy-banner.hidden {
  display: none !important;
}
