:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe3ee;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #15803d;
  --danger: #dc2626;
  --warning-bg: #fff7ed;
  --warning-border: #fb923c;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.container {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: white;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  top: 12px;
  z-index: 100;
  margin-bottom: 28px;
  border: 1px solid rgba(219, 227, 238, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.app-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 8px;
}

.brand,
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #2563eb, #0f3e99);
  color: white;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.brand strong,
.auth-brand strong {
  display: block;
  line-height: 1.15;
}

.brand small,
.auth-brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.current-user {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.menu-toggle {
  display: none;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.top-nav a,
.nav-logout-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.top-nav a:hover,
.nav-logout-btn:hover {
  background: #eef2f7;
}

.top-nav a.active {
  background: #e8efff;
  color: var(--primary-dark);
}

.nav-logout-btn {
  margin-left: auto;
  color: var(--danger);
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 4px 24px;
}

.page-heading > p {
  max-width: 560px;
  margin: 0 0 4px;
  color: var(--muted);
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 2px 0 0;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

h3 {
  margin: 0;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.box,
.stat-box,
.product-card,
.filters-bar {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.box {
  margin-bottom: 22px;
  padding: clamp(18px, 3vw, 26px);
  border-radius: var(--radius);
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 2px 0 0;
}

.add-box,
.history-search-box,
.categories-box,
.history-box,
.history-empty-box,
.restock-box,
.reports-table-box,
.scanner-page-box {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

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

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

label,
.filters-bar label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: white;
  color: var(--text);
  font-size: 16px;
  font-weight: 450;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

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

button {
  touch-action: manipulation;
}

.primary-btn,
.secondary-btn,
.success-btn,
.danger-btn,
#addBtn,
#exportCsvBtn,
#loadHistoryBtn,
#createWorkerBtn,
#changeAdminPasswordBtn,
#addCategoryBtn,
#confirmMovementBtn,
#cancelMovementBtn,
#startScanBtn,
#stopScanBtn {
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.primary-btn,
#addBtn,
#exportCsvBtn,
#loadHistoryBtn,
#createWorkerBtn,
#changeAdminPasswordBtn,
#addCategoryBtn,
#confirmMovementBtn,
#startScanBtn {
  background: var(--primary);
  color: white;
}

.primary-btn:hover,
#addBtn:hover,
#exportCsvBtn:hover,
#loadHistoryBtn:hover,
#createWorkerBtn:hover,
#changeAdminPasswordBtn:hover,
#addCategoryBtn:hover,
#confirmMovementBtn:hover,
#startScanBtn:hover {
  background: var(--primary-dark);
}

.secondary-btn,
#cancelMovementBtn,
#stopScanBtn {
  border-color: var(--border);
  background: #eef2f7;
  color: #334155;
}

.success-btn {
  background: var(--success);
  color: white;
}

.danger-btn {
  background: var(--danger);
  color: white;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.full-width,
#addBtn,
#exportCsvBtn,
#createWorkerBtn,
#changeAdminPasswordBtn {
  width: 100%;
  margin-top: 14px;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 12px;
}

.grow {
  flex: 1 1 auto;
}

.filters-bar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(210px, 1fr);
  gap: 14px;
  max-width: 920px;
  margin: 0 auto 24px;
  padding: 16px;
  border-radius: var(--radius);
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-box {
  min-width: 0;
  padding: 18px;
  border-radius: 14px;
}

.stat-box h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-box p {
  margin: 9px 0 0;
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  font-weight: 850;
  line-height: 1.1;
}

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

.chart-card {
  min-width: 0;
  min-height: 320px;
  padding: 18px;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: var(--surface-soft);
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.chart-card canvas {
  width: 100% !important;
  height: 260px !important;
}

#restockList,
#historyList,
.category-report-list,
.analytics-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

#restockList li,
.category-report-list li,
.analytics-list li,
.history-list-modern li {
  margin: 10px 0;
  padding: 14px 15px;
  border-radius: 11px;
  background: var(--surface-soft);
}

#restockList li {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}

.category-report-list li,
.analytics-list li,
.history-list-modern li {
  border-left: 4px solid var(--primary);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.product-card {
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.11);
}

.product-card-low {
  border-color: #fdba74;
  background: #fffaf5;
}

.product-title {
  margin-bottom: 7px;
  font-size: 1.08rem;
  font-weight: 800;
}

.product-code,
.product-stock {
  margin: 5px 0;
  color: #475569;
  font-size: 14px;
}

.product-category {
  display: inline-flex;
  margin: 5px 0 9px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8efff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 750;
}

.low-stock {
  color: #b91c1c;
  font-weight: 800;
}

.actions-row,
.edit-row,
.scanner-actions,
.movement-shortcuts,
.modal-actions,
.scan-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.product-card button,
.category-item-actions button {
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #eef2f7;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.product-card button:hover,
.category-item-actions button:hover {
  background: #e2e8f0;
}

.movement-box {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.movement-box h4 {
  margin: 0;
  font-size: 14px;
}

.stock-input {
  width: 110px;
  margin: 0;
}

.scanned-highlight {
  outline: 4px solid rgba(21, 128, 61, 0.35);
}

.history-line-1 {
  margin-bottom: 5px;
  font-weight: 800;
}

.history-line-2,
.history-line-3,
.history-line-4 {
  margin-top: 4px;
  color: #475569;
  font-size: 13px;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.reports-card {
  margin-bottom: 0;
}

.reports-card > p,
.help-text {
  color: var(--muted);
}

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

.report-stat-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border: 1px solid #e6edf5;
  border-radius: 11px;
  background: var(--surface-soft);
}

.report-stat-item span {
  color: var(--muted);
  font-size: 12px;
}

.report-stat-item strong {
  font-size: 1.15rem;
}

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

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #e6edf5;
  border-left: 4px solid var(--primary);
  border-radius: 11px;
  background: var(--surface-soft);
}

.category-item-name {
  min-width: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.category-item-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

#reader {
  width: 100%;
  min-height: 280px;
  overflow: hidden;
  border: 1px dashed #94a3b8;
  border-radius: 14px;
  background: #e2e8f0;
}

#reader video {
  width: 100% !important;
  object-fit: cover;
}

.scanner-actions > button,
.modal-actions > button,
.scan-choice-grid > button {
  flex: 1 1 160px;
}

.status-message {
  min-height: 24px;
  color: #334155;
  font-weight: 700;
}

.movement-product-box {
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.movement-product-box p {
  margin: 0;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.62);
}

.hidden {
  display: none !important;
}

.modal-content {
  width: min(100%, 500px);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.modal-content h3 {
  margin-bottom: 14px;
}

.security-warning {
  max-width: 920px;
  margin: -8px auto 22px;
  padding: 13px 15px;
  border: 1px solid var(--warning-border);
  border-radius: 12px;
  background: var(--warning-bg);
  color: #9a3412;
}

.security-warning a {
  color: inherit;
  font-weight: 800;
}

.empty-box,
.history-empty-box {
  text-align: center;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 3000;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 10px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #0f172a;
  color: white;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.success {
  background: #166534;
}

.toast.error {
  background: #991b1b;
}

.toast-hide {
  transform: translateY(8px);
  opacity: 0;
}

.app-footer {
  padding: 12px 4px 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.login-body {
  background:
    radial-gradient(circle at 12% 18%, rgba(37, 99, 235, 0.16), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(15, 62, 153, 0.12), transparent 35%),
    var(--bg);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 440px);
  padding: clamp(24px, 5vw, 36px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

.auth-brand {
  margin-bottom: 28px;
}

.auth-card h1 {
  margin-bottom: 8px;
}

.auth-card > p:not(.eyebrow):not(.auth-message) {
  margin: 0 0 22px;
  color: var(--muted);
}

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

.auth-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: #b91c1c;
  font-weight: 700;
}

@media (max-width: 1080px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 20px, 1240px);
    padding-top: 10px;
  }

  .app-header {
    top: 6px;
    margin-bottom: 20px;
  }

  .app-header-row {
    padding: 10px 11px;
  }

  .current-user {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .top-nav {
    display: none;
    max-height: calc(100vh - 100px);
    flex-direction: column;
    align-items: stretch;
    padding: 0 10px 11px;
    overflow-y: auto;
  }

  .top-nav.nav-open {
    display: flex;
  }

  .top-nav a,
  .nav-logout-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-logout-btn {
    margin-left: 0;
  }

  .page-heading {
    display: block;
    margin-bottom: 20px;
  }

  .page-heading > p {
    margin-top: 10px;
  }

  .form-grid.two-columns,
  .filters-bar,
  .charts-grid,
  .reports-grid,
  .report-stats {
    grid-template-columns: 1fr;
  }

  .chart-card-wide {
    grid-column: auto;
  }

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

  .stat-box {
    padding: 14px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form > button {
    width: 100%;
  }

  .category-item {
    align-items: stretch;
    flex-direction: column;
  }

  .category-item-actions {
    width: 100%;
  }

  .category-item-actions button {
    flex: 1 1 0;
  }

  .actions-row button,
  .movement-shortcuts button {
    flex: 1 1 120px;
  }

  .edit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .stock-input {
    width: 100%;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  #reader {
    min-height: 240px;
  }

  .toast-container {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }
}

@media (max-width: 430px) {
  .brand small {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat-box:last-child {
    grid-column: 1 / -1;
  }

  .box,
  .product-card,
  .filters-bar {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Role-aware rendering: protected controls stay hidden until authentication is resolved. */
[data-role="admin"] {
  display: none !important;
}

html.auth-loading body {
  visibility: hidden;
}

html.auth-loading::before {
  content: "Chargement de Garage Stock…";
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  visibility: visible;
  background: var(--bg);
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
}

.scanner-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.scanner-toolbar .grow {
  flex: 1 1 auto;
}

.scanner-toolbar button {
  flex: 0 0 auto;
}

#reader:empty::before {
  content: none;
  min-height: 278px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #64748b;
  text-align: center;
}

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

.scanner-fallback-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
}

.scanner-fallback-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.file-scan-label {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: white;
  color: #334155;
  text-align: center;
  cursor: pointer;
}

.file-scan-label:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.file-scan-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 760px) {
  .scanner-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .scanner-toolbar button {
    width: 100%;
  }

  .scanner-fallbacks {
    grid-template-columns: 1fr;
  }
}

/* Prototype 1.3 camera preview and diagnostics */
.camera-reader {
  position: relative;
  display: grid;
  min-height: 280px;
  place-items: center;
  background: #0f172a;
}

.camera-reader video {
  display: none;
  width: 100% !important;
  min-height: 280px;
  max-height: 520px;
  object-fit: cover;
  background: #0f172a;
}

.camera-reader video.camera-active {
  display: block;
}

.camera-reader.is-running {
  border-style: solid;
  border-color: #334155;
}

.camera-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  width: min(78%, 420px);
  height: min(38%, 180px);
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.camera-reader.is-running .camera-frame {
  display: block;
}

.camera-placeholder {
  padding: 28px;
  color: #cbd5e1;
  font-weight: 700;
  text-align: center;
}

.camera-diagnostics {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.camera-diagnostics summary {
  cursor: pointer;
  color: #334155;
  font-weight: 800;
}

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

.camera-diagnostic-grid > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
}

.camera-diagnostic-grid span {
  color: var(--muted);
  font-size: 12px;
}

.camera-diagnostic-grid strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.technical-error {
  margin: 10px 0 0;
  color: #b91c1c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .camera-reader,
  .camera-reader video {
    min-height: 240px;
  }

  .camera-diagnostic-grid {
    grid-template-columns: 1fr;
  }
}

/* Prototype 1.5 operations and import tools */
.admin-section {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.admin-stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.button-link {
  text-decoration: none;
}

.table-scroll {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table .row-error,
.row-error td {
  background: #fff1f2;
  color: #9f1239;
}

.danger-zone {
  border-color: #fecaca;
  background: #fffafa;
}

.compact-list li {
  padding: 10px 12px;
  font-size: 13px;
}

.user-item {
  align-items: center;
}

.product-location {
  margin-top: 4px;
  font-weight: 700;
  color: #334155;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

@media (max-width: 760px) {
  .admin-section .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-section .section-heading > button {
    width: 100%;
  }

  .scanner-actions {
    position: sticky;
    bottom: 8px;
    z-index: 20;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
  }

  .user-item,
  .user-item .category-item-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .user-item .category-item-actions button {
    width: 100%;
  }
}

/* Prototype 1.5: assistant and integrations */
.assistant-shell {
  max-width: 960px;
  margin-right: auto;
  margin-left: auto;
}

.assistant-toolbar,
.integration-actions,
.integration-key-form,
.secret-reveal {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.read-only-badge {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}

.assistant-suggestions button {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.assistant-suggestions button:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.assistant-messages {
  display: flex;
  min-height: 340px;
  max-height: 58vh;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
}

.assistant-message {
  max-width: min(82%, 720px);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.assistant-message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.assistant-message p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.assistant-message-user {
  align-self: flex-end;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.assistant-message-bot {
  align-self: flex-start;
}

.assistant-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
  align-items: stretch;
}

.assistant-form textarea {
  min-height: 58px;
  resize: vertical;
}

.integration-stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.integration-stats small,
.integration-key-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.integration-key-form {
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.integration-key-form > label {
  min-width: 220px;
  flex: 1;
}

.integration-key-form fieldset {
  display: flex;
  min-width: min(100%, 500px);
  flex: 2;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.integration-key-form legend {
  padding: 0 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.integration-key-form fieldset label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.integration-key-form input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.secret-reveal {
  margin: 14px 0;
  padding: 14px;
  flex-wrap: wrap;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
}

.secret-reveal code {
  max-width: 100%;
  padding: 8px;
  overflow-wrap: anywhere;
  user-select: all;
}

.integration-key-item {
  gap: 16px;
}

.integration-key-item > div {
  min-width: 0;
}

.integration-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.small-btn {
  padding: 6px 9px;
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .assistant-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .assistant-message {
    max-width: 94%;
  }

  .assistant-form {
    grid-template-columns: 1fr;
  }

  .assistant-form button,
  .integration-actions button,
  .integration-key-form > button {
    width: 100%;
  }

  .integration-key-form {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-key-form > label,
  .integration-key-form fieldset {
    min-width: 0;
    width: 100%;
  }

  .secret-reveal {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Pilot 1.6 — mobile/desktop operational UX */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --text: #101828;
  --muted: #667085;
  --border: #d9e0ea;
  --primary: #1d5fd1;
  --primary-dark: #174ca6;
  --primary-soft: #eaf1ff;
  --success: #11864b;
  --danger: #d92d20;
  --warning: #dc6803;
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 20px 60px rgba(16, 24, 40, 0.14);
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(29, 95, 209, 0.06), transparent 28%),
    var(--bg);
}

.container {
  width: min(1320px, calc(100% - 32px));
}

.app-header {
  border-color: rgba(217, 224, 234, 0.85);
  box-shadow: 0 6px 24px rgba(16, 24, 40, 0.08);
}

.brand-mark {
  background: linear-gradient(145deg, #2875ea, #163f91);
  box-shadow: 0 8px 20px rgba(29, 95, 209, 0.25);
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #087443;
  font-size: 12px;
  font-weight: 800;
}

.connection-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.12);
}

.connection-status.is-offline {
  color: #b42318;
}

.connection-status.is-offline::before {
  background: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.12);
}

.top-nav a,
.nav-logout-btn {
  font-size: 13px;
}

.page-heading {
  align-items: center;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.quick-action {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.quick-action:hover {
  transform: translateY(-2px);
  border-color: #b9c9df;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.1);
}

.quick-action-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #1d5fd1, #16469d);
  color: white;
}

.quick-action-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  background: rgba(29, 95, 209, 0.1);
  color: var(--primary);
  font-size: 21px;
  font-weight: 900;
}

.quick-action-primary .quick-action-icon {
  background: rgba(255,255,255,.16);
  color: white;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.quick-action-primary small {
  color: rgba(255,255,255,.78);
}

.stat-box {
  position: relative;
  overflow: hidden;
}

.stat-box::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -28px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(29, 95, 209, .055);
}

.filters-bar-v16 {
  position: sticky;
  top: 116px;
  z-index: 30;
  grid-template-columns: minmax(0, 2fr) minmax(210px, 1fr);
}

.product-results-count {
  grid-column: 1 / -1;
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-grid {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.product-card-v16 {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 19px;
}

.product-card-v16:hover {
  transform: none;
}

.product-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.product-identity {
  min-width: 0;
}

.product-title {
  margin: 0 0 7px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.product-code-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 7px;
  background: #f0f3f8;
  color: #475467;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.product-stock-summary {
  display: grid;
  min-width: 86px;
  justify-items: end;
  text-align: right;
}

.product-stock-summary > strong {
  font-size: 1.75rem;
  line-height: 1;
}

.product-stock-summary > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.stock-badge {
  display: inline-flex;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.stock-badge-ok { background: #eafaf1; color: #087443; }
.stock-badge-low { background: #fff3e8; color: #b54708; }
.stock-badge-out { background: #feeceb; color: #b42318; }

.product-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.product-meta-grid > span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  background: var(--surface-soft);
}

.product-meta-grid small,
.product-meta-grid strong {
  display: block;
}

.product-meta-grid small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.product-meta-grid strong {
  margin-top: 3px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.product-primary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.product-card .product-action {
  min-height: 46px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 800;
}

.product-card .product-action-add {
  background: #eafaf1;
  border-color: #abefc6;
  color: #067647;
}

.product-card .product-action-remove {
  background: #fff0ef;
  border-color: #fecdca;
  color: #b42318;
}

.product-details {
  border-top: 1px solid #edf0f4;
  padding-top: 11px;
}

.product-details summary {
  cursor: pointer;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.product-detail-body {
  display: grid;
  gap: 7px;
  padding-top: 10px;
}

.product-detail-body p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.product-detail-body strong {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.product-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 11px;
}

.product-admin-actions > button {
  flex: 1 1 100px;
}

.product-stock-edit {
  display: flex;
  flex: 1 1 100%;
  gap: 7px;
}

.product-stock-edit input {
  width: 100px;
  min-height: 40px;
}

.product-stock-edit button {
  flex: 1 1 auto;
}

.product-card .product-delete-action {
  border-color: #fecdca;
  background: #fff5f4;
  color: #b42318;
}

.product-empty-state {
  display: grid;
  grid-column: 1 / -1;
  gap: 5px;
  color: var(--muted);
}

.product-empty-state strong {
  color: var(--text);
  font-size: 1.05rem;
}

#restockList .restock-item,
#restockList .restock-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-left-width: 0;
  background: #fffaf0;
}

.restock-item > div,
.restock-empty {
  min-width: 0;
}

.restock-item strong,
.restock-item span,
.restock-empty strong,
.restock-empty span {
  display: block;
}

.restock-item span,
.restock-empty span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.restock-item a {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 8px;
  background: white;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

/* Scanner workspace */
.scanner-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr);
  align-items: start;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto 22px;
}

.scanner-camera-card,
.scanner-side-panel .box {
  max-width: none;
  margin: 0;
}

.scanner-side-panel {
  display: grid;
  gap: 14px;
}

.scanner-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}

.scanner-card-head h2,
.scanner-side-panel h2 {
  margin: 2px 0 0;
}

.scanner-live-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scanner-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: 11px;
  font-weight: 850;
}

.scanner-state-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #98a2b3;
}

.scanner-state-active { background: #eafaf1; color: #067647; }
.scanner-state-active::before { background: #12b76a; box-shadow: 0 0 0 4px rgba(18,183,106,.12); }
.scanner-state-busy { background: #fff7e8; color: #b54708; }
.scanner-state-busy::before { background: #f79009; }

.scan-counter {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.camera-reader {
  aspect-ratio: 16 / 10;
  min-height: 320px;
  border: 0;
  border-radius: 18px;
  background: #070d18;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.camera-reader video {
  min-height: 320px;
  height: 100%;
  max-height: none;
}

.camera-placeholder {
  display: grid;
  gap: 5px;
  color: #98a2b3;
}

.camera-placeholder strong {
  color: #f2f4f7;
  font-size: 1rem;
}

.camera-placeholder span {
  font-size: 12px;
}

.camera-frame {
  width: min(84%, 620px);
  height: min(36%, 190px);
  border: 2px solid rgba(255,255,255,.92);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(7,13,24,.34);
}

.camera-frame::before,
.camera-frame::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: #63e6be;
}

.camera-frame::before {
  top: -3px;
  left: -3px;
  border-top: 4px solid #63e6be;
  border-left: 4px solid #63e6be;
  border-radius: 14px 0 0 0;
}

.camera-frame::after {
  right: -3px;
  bottom: -3px;
  border-right: 4px solid #63e6be;
  border-bottom: 4px solid #63e6be;
  border-radius: 0 0 14px 0;
}

.scan-line {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #63e6be 18%, #63e6be 82%, transparent);
  box-shadow: 0 0 12px rgba(99,230,190,.85);
  animation: scannerLine 2.1s ease-in-out infinite;
}

@keyframes scannerLine {
  0%,100% { transform: translateY(-55px); opacity: .45; }
  50% { transform: translateY(55px); opacity: 1; }
}

.camera-zoom {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.camera-zoom label {
  font-size: 12px;
}

.camera-zoom input {
  min-height: 30px;
  padding: 0;
}

.scanner-primary-actions {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
}

.scan-guidance {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 13px;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f3f7ff;
  color: #344054;
}

.guidance-icon {
  color: var(--primary);
  font-size: 25px;
  line-height: 1;
}

.scan-guidance p {
  margin: 0;
  font-size: 12px;
}

.status-message {
  margin: 13px 0 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: #f2f4f7;
  color: #344054;
  font-size: 13px;
}

.status-message.status-active { background: #eef4ff; color: #1849a9; }
.status-message.status-success { background: #eafaf1; color: #067647; }
.status-message.status-error { background: #fff1f0; color: #b42318; }

.last-scan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: white;
}

.last-scan-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.last-scan-card strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.scanner-manual-card {
  border-color: #b2ccff;
  background: #f5f8ff;
}

.manual-scan-form {
  display: grid;
  gap: 10px;
}

.scanner-side-panel .box {
  padding: 18px;
}

.scanner-help-card ol {
  margin: 0;
  padding-left: 20px;
  color: #475467;
  font-size: 13px;
}

.scanner-help-card li + li {
  margin-top: 7px;
}

.modal-handle {
  display: none;
  width: 44px;
  height: 5px;
  margin: -9px auto 16px;
  border-radius: 999px;
  background: #d0d5dd;
}

/* Mobile app navigation */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  .scanner-workspace {
    grid-template-columns: 1fr;
  }

  .scanner-side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scanner-help-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .container {
    width: min(100% - 16px, 1320px);
  }

  .app-header {
    top: 4px;
    border-radius: 14px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .connection-status {
    font-size: 0;
  }

  .connection-status::before {
    width: 9px;
    height: 9px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .quick-action {
    min-height: 72px;
  }

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

  .filters-bar-v16 {
    position: static;
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

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

  .product-meta-grid > span:last-child {
    grid-column: 1 / -1;
  }

  .product-primary-actions {
    position: sticky;
    bottom: calc(74px + env(safe-area-inset-bottom));
    z-index: 4;
    margin: 0 -4px;
    padding: 6px;
    border-radius: 12px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 24px rgba(16,24,40,.12);
    backdrop-filter: blur(12px);
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 900;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 62px;
    padding: 5px;
    border: 1px solid rgba(217,224,234,.9);
    border-radius: 17px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 18px 48px rgba(16,24,40,.2);
    backdrop-filter: blur(16px);
  }

  .mobile-nav-item {
    display: grid;
    min-width: 0;
    place-items: center;
    gap: 1px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #667085;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-nav-item > span {
    font-size: 21px;
    line-height: 1;
  }

  .mobile-nav-item small {
    font-size: 9px;
    font-weight: 800;
  }

  .mobile-nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
  }

  .mobile-nav-primary {
    margin: -12px 3px 3px;
    border-radius: 15px;
    background: linear-gradient(145deg, #2875ea, #16469d);
    color: white;
    box-shadow: 0 9px 22px rgba(29,95,209,.28);
  }

  .mobile-nav-primary.active {
    background: linear-gradient(145deg, #2875ea, #16469d);
    color: white;
  }

  .scanner-page-heading > p {
    display: none;
  }

  .scanner-camera-card {
    padding: 12px;
    border-radius: 16px;
  }

  .scanner-card-head {
    margin: 4px 3px 12px;
  }

  .scanner-live-status {
    align-items: flex-end;
    flex-direction: column;
  }

  .camera-reader,
  .camera-reader video {
    min-height: 260px;
  }

  .camera-reader {
    aspect-ratio: 4 / 3;
    border-radius: 14px;
  }

  .camera-frame {
    width: 88%;
    height: 34%;
  }

  .scanner-primary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .scanner-primary-actions #startScanBtn {
    grid-column: 1 / -1;
  }

  .scanner-side-panel {
    grid-template-columns: 1fr;
  }

  .scanner-help-card {
    grid-column: auto;
  }

  .modal-handle {
    display: block;
  }

  .scan-action-sheet {
    padding-top: 16px;
  }

  #restockList .restock-item {
    align-items: stretch;
    flex-direction: column;
  }

  .restock-item a {
    text-align: center;
  }
}

@media (max-width: 430px) {
  .page-heading h1 {
    font-size: 1.7rem;
  }

  .product-card-v16 {
    padding: 15px;
  }

  .product-stock-summary > strong {
    font-size: 1.55rem;
  }

  .scanner-state-badge {
    padding: 5px 7px;
  }
}
