:root {
  --bg: #f4f7fb;
  --bg-accent: #e8f1ff;
  --card: #ffffff;
  --line: #d9e2ef;
  --text: #142033;
  --muted: #5f6f86;
  --primary: #0d5fd8;
  --primary-strong: #0848a7;
  --danger: #b42318;
  --shadow: 0 14px 34px rgba(14, 30, 62, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(13, 95, 216, 0.12), transparent 44%),
    radial-gradient(circle at 0% 100%, rgba(24, 150, 117, 0.12), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
}

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

.admin-shell {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.scan-chrome-toggle {
  position: fixed;
  right: 10px;
  top: 10px;
  z-index: 3400;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid #c8d7ee;
  background: #eef4ff;
  color: #183765;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(14, 30, 62, 0.16);
}

.scan-chrome-toggle:active {
  transform: translateY(1px);
}

body.scan-chrome-collapsed .hero {
  display: none;
}

body.scan-chrome-collapsed #sectionScanCard .toolbar {
  display: none;
}

body.scan-chrome-collapsed #sectionScanCard .card-head {
  margin-bottom: 6px;
}

body.scan-chrome-collapsed .admin-shell {
  padding-top: 8px;
}

.hero {
  display: grid;
  gap: 12px;
  align-items: start;
  background: linear-gradient(135deg, #f9fcff, #edf4ff 58%, #f0fbf7);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 2px 0 6px;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.05;
}

.hero-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  max-width: 64ch;
}

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

.layout {
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.form-card {
  position: relative;
}

.form-card input,
.form-card select,
.form-card textarea {
  min-height: 33px;
  padding: 7px 9px;
}

.form-card label {
  gap: 4px;
  font-size: 0.78rem;
}

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

.card-head h2 {
  margin: 2px 0 0;
  font-size: 1.1rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #c8d7ee;
  background: #eef4ff;
  color: #183765;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.muted {
  background: #f4f6fa;
  border-color: #dfe5ef;
  color: #5e6b80;
}

.field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.dims-grid {
  margin-top: 10px;
}

.marker-grid {
  margin-top: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.check-field {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: #35506f;
}

.check-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.check-field.compact {
  background: #f6f9ff;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  padding: 8px 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c9d6e8;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  min-height: 44px;
  padding: 10px 12px;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 95, 216, 0.14);
}

.media-card {
  margin-top: 12px;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff, #f7fbff);
  padding: 12px;
}

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

.media-head h3 {
  margin: 2px 0 0;
  font-size: 1rem;
  color: var(--text);
}

.media-grid {
  display: grid;
  gap: 10px;
}

.upload-tile {
  border: 1px dashed #9cb8e7;
  background: #f3f8ff;
  border-radius: 14px;
  padding: 14px;
  min-height: 94px;
  align-content: center;
  cursor: pointer;
  position: relative;
}

.upload-tile input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-title {
  display: block;
  color: #123869;
  font-size: 0.96rem;
  font-weight: 800;
}

.upload-sub {
  display: block;
  margin-top: 3px;
  color: #4e6486;
  font-size: 0.8rem;
  font-weight: 600;
}

.preview-wrap {
  margin-top: 12px;
}

.preview-box {
  width: 100%;
  min-height: 160px;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
  background:
    linear-gradient(45deg, #f0f4fb 25%, transparent 25%) -8px 0 / 16px 16px,
    linear-gradient(-45deg, #f0f4fb 25%, transparent 25%) -8px 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, #f0f4fb 75%) -8px 0 / 16px 16px,
    linear-gradient(-45deg, transparent 75%, #f0f4fb 75%) -8px 0 / 16px 16px,
    #fff;
  display: grid;
  place-items: center;
  color: #6a7890;
  overflow: hidden;
  text-align: center;
  padding: 8px;
}

.preview-box img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}

.helper {
  margin: 8px 0 0;
  color: #5a6a80;
  font-size: 0.78rem;
  line-height: 1.35;
}

.helper-inline {
  color: #5a6a80;
  font-size: 0.82rem;
}

.helper-inline.pending {
  color: #0d5fd8;
  font-weight: 800;
}

.form-actions {
  position: sticky;
  bottom: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding: 8px;
  border: 1px solid #dbe5f4;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}

.primary-btn,
.ghost-btn,
.inline-btn {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.primary-btn {
  background: linear-gradient(180deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.ghost-btn {
  background: #fff;
  border-color: #d1dced;
  color: #17365f;
}

.primary-btn:hover,
.ghost-btn:hover,
.inline-btn:hover {
  filter: brightness(0.98);
}

.toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.toolbar.toggles {
  grid-template-columns: 1fr;
  margin-top: -2px;
}

.toolbar.secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

body.section-edit-mode .toolbar.secondary #saveAllListBtn,
body.section-edit-mode .toolbar.secondary #pendingChangesSummary,
body.section-edit-mode .result-actions [data-action="edit"],
body.section-edit-mode .result-actions [data-action="delete"] {
  display: none;
}

.stats {
  display: flex;
  gap: 8px;
}

.stat {
  min-width: 82px;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
  background: #f8fbff;
}

.stat span {
  display: block;
  font-size: 1.1rem;
  font-weight: 900;
  color: #123869;
}

.stat small {
  color: #5c6e87;
  font-size: 0.7rem;
  font-weight: 700;
}

.results-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 300px);
  overflow: auto;
  padding-right: 2px;
}

.section-scan-list {
  display: grid;
  gap: 8px;
  justify-items: center;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  overflow-x: hidden;
}

body.scan-chrome-collapsed .section-scan-list {
  max-height: calc(100vh - 90px);
}

.section-scan-card {
  width: min(75vw, 420px);
  max-width: 100%;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

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

.scan-title {
  font-weight: 900;
  font-size: 14px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-remove-btn {
  min-height: 24px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid #f0b8b0;
  background: #fff5f4;
  color: #9a2b1e;
  cursor: pointer;
}

.scan-meta {
  font-size: 12px;
  color: #4b607d;
  line-height: 1.3;
}

.scan-meta-select {
  max-width: 210px;
  border: 0;
  border-bottom: 1px dashed #9db0cc;
  border-radius: 0;
  background: transparent;
  color: #17365f;
  font: inherit;
  font-weight: 800;
  padding: 0 18px 0 0;
}

.scan-fields-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.scan-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scan-label {
  font-size: 11px;
  font-weight: 700;
  color: #4b607d;
}

.scan-field {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-field.editable {
  cursor: pointer;
}

.scan-inline-input {
  width: 100%;
  min-width: 0;
  max-width: 70px;
  height: 24px;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 8px;
  border: 1px solid #d2ddee;
}

.scan-need-wrap {
  align-self: end;
}

.scan-need-check {
  margin: 0;
  min-height: 24px;
}

.scan-need-check span {
  display: none;
}

.scan-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.scan-image-stack {
  min-width: 0;
}

.scan-update-btn {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.scan-find-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.catalog-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 251, 255, 0.74);
  backdrop-filter: blur(2px);
}

.catalog-loading-overlay.hidden {
  display: none;
}

.catalog-loading-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: #17365f;
  font-weight: 900;
}

.catalog-loading-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  animation: catalogLogoSpin 1.1s linear infinite;
}

@keyframes catalogLogoSpin {
  to { transform: rotate(360deg); }
}

.scan-image-box {
  width: 100%;
  height: 70px;
  border: 1px dashed #9db0cc;
  border-radius: 8px;
  background: #f8fbff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.scan-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#scanAckFlash {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  opacity: 0;
  pointer-events: none;
  z-index: 3200;
  transition: opacity 0.06s ease-in-out;
}

#scanAckFlash.active {
  opacity: 1;
}

.result-card {
  border: 1px solid #dbe5f4;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}

.result-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
}

.thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px solid #dbe5f4;
  background: #f6f9ff;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #6e7f96;
  font-size: 0.72rem;
  text-align: center;
  padding: 4px;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-main {
  min-width: 0;
}

.result-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.15;
  color: #12233d;
}

.result-meta {
  margin-top: 4px;
  color: #596b83;
  font-size: 0.78rem;
  line-height: 1.3;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.chip {
  border: 1px solid #dbe5f4;
  background: #f7faff;
  border-radius: 999px;
  padding: 3px 8px;
  color: #375170;
  font-size: 0.72rem;
  font-weight: 700;
}

.chip.warn {
  background: #fff5e6;
  border-color: #f2d39f;
  color: #7a4b00;
}

.quick-edit-grid {
  margin-top: 8px;
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: #fbfdff;
}

.quick-edit-grid label {
  gap: 4px;
  font-size: 0.74rem;
}

.quick-edit-grid input,
.quick-edit-grid select {
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 10px;
}

.quick-edit-grid .tiny-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  border: 1px solid #dbe5f4;
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
}

.quick-edit-grid .tiny-check input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.inline-btn {
  min-height: 36px;
  font-size: 0.82rem;
  flex: 1;
}

.inline-btn.save {
  background: #e8f8ed;
  border-color: #b8e6c6;
  color: #185f33;
}

.inline-btn.edit {
  background: #eef5ff;
  border-color: #cbdbf5;
  color: #163e73;
}

.inline-btn.delete {
  background: #fff3f2;
  border-color: #f3d0cc;
  color: var(--danger);
}

.result-card.has-pending {
  border-color: #8db3f1;
  box-shadow: 0 0 0 2px rgba(13, 95, 216, 0.12);
}

.chip.pending {
  background: #eef4ff;
  border-color: #c7dafb;
  color: #15427c;
}

.empty {
  border: 1px dashed #c7d7ec;
  border-radius: 14px;
  padding: 18px;
  color: #5e6f86;
  background: #f9fbff;
  text-align: center;
}

.status-error {
  color: var(--danger);
}

.scanner-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 34, 0.56);
  z-index: 3000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
}

.scanner-modal.open {
  display: flex;
}

.scanner-card {
  width: min(392px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #dbe5f4;
  box-shadow: var(--shadow);
  padding: 12px;
  margin: auto 0;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

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

#scannerVideo {
  width: 100%;
  height: min(40vh, 238px);
  background: #091425;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #dbe5f4;
}

.scanner-fallback-host {
  width: 100%;
  min-height: min(40vh, 238px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #dbe5f4;
  background: #091425;
}

.scanner-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lookup-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 34, 0.82);
  z-index: 3050;
  display: none;
  align-items: stretch;
  justify-content: center;
}

.lookup-modal.open {
  display: flex;
}

.lookup-shell {
  width: min(100%, 980px);
  height: 100%;
  overflow: auto;
  background: #eef3fb;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lookup-hidden {
  display: none !important;
}

.lookup-head,
.lookup-section-head,
.lookup-actions,
.lookup-zoom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lookup-head h2,
.lookup-section-head h2 {
  margin: 0;
}

#planogramLookupStatus {
  margin: 6px 0 0;
  color: #4b5f83;
  font-size: 0.86rem;
}

.lookup-tools {
  display: grid;
  gap: 12px;
}

.lookup-scanner-host {
  min-height: 220px;
  display: none;
}

.lookup-manual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.lookup-match-card {
  border: 1px solid #d4def0;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.lookup-match-title {
  font-size: 15px;
  font-weight: 900;
  color: #1b3157;
}

.lookup-match-meta {
  font-size: 12px;
  color: #4b6288;
  line-height: 1.4;
}

.lookup-metric-controls {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d6dfef;
  border-radius: 10px;
  background: #f7faff;
}

.lookup-metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.lookup-metric-row label {
  display: inline-flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #1f355b;
  border: 1px solid #d3ddef;
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  min-height: 38px;
}

.lookup-metric-row label input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.lookup-image-scroll {
  overflow: auto;
  border: 1px solid #d6dfef;
  border-radius: 12px;
  background: #f7faff;
  min-height: 260px;
  max-height: 58vh;
  padding: 12px;
  touch-action: pan-x pan-y;
}

.lookup-touch-note {
  color: #506685;
  font-size: 0.78rem;
  font-weight: 700;
}

.lookup-image-stage {
  transform-origin: top left;
  width: max-content;
}

.lookup-image-stage img {
  display: none;
  max-width: none;
  width: auto;
  height: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(17, 38, 78, 0.12);
}

.lookup-detail-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.lookup-detail-list {
  display: grid;
  gap: 6px;
}

.lookup-detail-row {
  border: 1px solid #d6dfef;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  font-size: 12px;
  color: #233958;
}

.lookup-detail-location {
  font-size: 11px;
  font-weight: 900;
  color: #4d6382;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.lookup-detail-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.lookup-detail-description {
  font-size: 13px;
  font-weight: 900;
  color: #12233d;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lookup-detail-upc {
  font-size: 11px;
  color: #5b708f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lookup-detail-metrics {
  font-size: 11px;
  color: #24405f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lookup-detail-row.lookup-match-hit {
  border-color: #3eb56a;
  box-shadow: 0 0 0 3px rgba(62, 181, 106, 0.22), 0 10px 18px rgba(23, 90, 46, 0.12);
  background: linear-gradient(180deg, #f8fff9, #ffffff);
}

.lookup-detail-row.section {
  grid-template-columns: 1fr;
  font-weight: 900;
  background: #edf3ff;
}

.scanner-actions label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #35506f;
  font-weight: 700;
}

#scanImageCropCanvas {
  touch-action: none;
}

.scan-row-flash {
  animation: scanRowFlash 0.65s ease;
}

@keyframes scanRowFlash {
  0% { box-shadow: 0 0 0 0 rgba(13,95,216,0.75); }
  100% { box-shadow: 0 0 0 14px rgba(13,95,216,0); }
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

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

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

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

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

  .toolbar.toggles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (min-width: 1100px) {
  .layout {
    grid-template-columns: minmax(380px, 520px) minmax(0, 1fr);
    align-items: start;
  }

  .form-card {
    position: sticky;
    top: 12px;
  }

  .results-list {
    max-height: calc(100vh - 260px);
  }
}

@media (max-width: 760px) {
  .lookup-head,
  .lookup-section-head,
  .lookup-actions,
  .lookup-zoom-row,
  .lookup-manual-row {
    flex-direction: column;
    align-items: stretch;
  }

  .lookup-detail-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

@media (max-height: 760px) {
  .scanner-modal {
    padding: 8px;
  }

  .scanner-card {
    max-height: calc(100vh - 16px);
  }

  #scannerVideo,
  .scanner-fallback-host {
    min-height: 180px;
    height: min(30vh, 200px);
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
