:root {
  --bg: #0b0e0d;
  --panel: #121716;
  --panel-deep: #0e1211;
  --ink: #edf4ec;
  --muted: #87928b;
  --faint: #46524b;
  --line: rgba(229, 244, 231, 0.13);
  --line-strong: rgba(229, 244, 231, 0.24);
  --lime: #d7f36b;
  --lime-soft: rgba(215, 243, 107, 0.14);
  --coral: #ff8069;
  --cyan: #7bd8d5;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "DM Sans", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(229, 244, 231, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(229, 244, 231, 0.022) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  pointer-events: none;
}

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

button {
  border: 0;
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 560px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 14px 18px 24px;
}

.topbar,
.scanner-topline,
.scanner-footer,
.result-heading,
.result-value-row,
.footer-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  min-height: 32px;
}

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

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

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--lime);
  transform: rotate(45deg);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  background: var(--lime);
  content: "";
}

.brand-mark::before {
  width: 7px;
  height: 1px;
}

.brand-mark::after {
  width: 1px;
  height: 7px;
}

.brand-mark span {
  display: block;
  width: 5px;
  height: 5px;
  background: var(--coral);
}

.brand-name,
.status-pill,
.scanner-topline,
.format-pill,
.footer-state,
.result-kicker,
.result-index,
.placeholder-note {
  font-family: var(--mono);
  letter-spacing: 0;
}

.brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-name span {
  color: var(--lime);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.status-pip,
.mini-pip,
.viewport-state-pip {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.status-pill[data-state="live"] {
  border-color: rgba(215, 243, 107, 0.36);
  color: var(--lime);
}

.status-pill[data-state="live"] .status-pip,
.status-pill[data-state="success"] .status-pip {
  background: var(--lime);
  box-shadow: 0 0 0 4px var(--lime-soft);
}

.status-pill[data-state="success"] {
  border-color: rgba(123, 216, 213, 0.4);
  color: var(--cyan);
}

.status-pill[data-state="success"] .status-pip {
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(123, 216, 213, 0.12);
}

.status-pill[data-state="error"] {
  border-color: rgba(255, 128, 105, 0.38);
  color: var(--coral);
}

.status-pill[data-state="error"] .status-pip {
  background: var(--coral);
}

.scanner-dock {
  position: sticky;
  z-index: 12;
  top: env(safe-area-inset-top);
  padding: 8px 0 10px;
  background: var(--bg);
}

.scanner-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 23, 22, 0.87);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.scanner-topline {
  padding: 10px 14px 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.scanner-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.scanner-title svg {
  width: 14px;
  height: 14px;
  color: var(--lime);
}

.scanner-mode {
  color: var(--faint);
}

.scanner-viewport {
  position: relative;
  height: clamp(176px, 52vw, 228px);
  margin: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #070908;
  isolation: isolate;
}

.scanner-viewport::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(130deg, rgba(215, 243, 107, 0.06), transparent 44%, rgba(123, 216, 213, 0.05));
  content: "";
  pointer-events: none;
}

#preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.scanner-viewport.is-live #preview {
  opacity: 0.93;
}

.viewport-placeholder {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px;
  text-align: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.scanner-viewport.is-live .viewport-placeholder {
  opacity: 0;
  visibility: hidden;
}

.scanner-viewport.has-camera-problem .viewport-placeholder {
  gap: 7px;
  padding: 12px;
}

.scanner-viewport.has-camera-problem .placeholder-mark {
  display: none;
}

.placeholder-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(215, 243, 107, 0.32);
}

.placeholder-mark::before,
.placeholder-mark::after {
  position: absolute;
  background: rgba(215, 243, 107, 0.36);
  content: "";
}

.placeholder-mark::before {
  top: 50%;
  right: -8px;
  left: -8px;
  height: 1px;
}

.placeholder-mark::after {
  top: -8px;
  bottom: -8px;
  left: 50%;
  width: 1px;
}

.placeholder-crosshair {
  position: absolute;
  inset: 15px;
  border: 1px solid var(--coral);
  border-radius: 50%;
}

.placeholder-corner {
  position: absolute;
  width: 13px;
  height: 13px;
  border-color: var(--lime);
  border-style: solid;
}

.corner-tl {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.corner-br {
  right: -1px;
  bottom: -1px;
  border-width: 0 2px 2px 0;
}

.placeholder-note {
  font-size: 9px;
}

.placeholder-note {
  color: var(--muted);
}

.camera-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: min(100%, 320px);
  margin: 0;
  padding-left: 10px;
  border-left: 2px solid var(--coral);
  color: #ffc0b3;
  font-size: 10px;
  line-height: 1.55;
  text-align: left;
}

.camera-warning svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
}

.camera-start {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  padding: 0 11px 0 12px;
  border: 1px solid var(--lime);
  border-radius: 3px;
  color: #10140f;
  background: var(--lime);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-capture {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--muted);
  background: rgba(18, 23, 22, 0.76);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.photo-capture:hover,
.photo-capture:active {
  border-color: var(--lime);
  color: var(--lime);
}

.photo-capture.is-primary {
  border-color: var(--lime);
  color: #10140f;
  background: var(--lime);
}

.photo-capture svg {
  width: 15px;
  height: 15px;
}

.camera-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.camera-start:hover,
.camera-start:active {
  box-shadow: 0 8px 28px rgba(215, 243, 107, 0.2);
  transform: translateY(-1px);
}

.camera-start.is-blocked {
  border-color: var(--coral);
  color: var(--coral);
  background: rgba(255, 128, 105, 0.08);
}

.camera-start.is-blocked:hover,
.camera-start.is-blocked:active {
  box-shadow: 0 8px 28px rgba(255, 128, 105, 0.12);
}

.camera-start svg {
  width: 17px;
  height: 17px;
}

.button-arrow {
  margin-left: 4px;
  font-size: 18px;
  line-height: 0;
}

.scan-overlay {
  position: absolute;
  z-index: 3;
  inset: 11% 9%;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.scanner-viewport.is-live .scan-overlay {
  opacity: 1;
}

.scan-corner {
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: var(--lime);
  border-style: solid;
  filter: drop-shadow(0 0 7px rgba(215, 243, 107, 0.3));
}

.scan-corner-tl {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
}

.scan-corner-tr {
  top: 0;
  right: 0;
  border-width: 2px 2px 0 0;
}

.scan-corner-bl {
  bottom: 0;
  left: 0;
  border-width: 0 0 2px 2px;
}

.scan-corner-br {
  right: 0;
  bottom: 0;
  border-width: 0 2px 2px 0;
}

.scan-line {
  position: absolute;
  top: 8%;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--coral) 34%, var(--lime) 66%, transparent);
  box-shadow: 0 0 13px rgba(215, 243, 107, 0.55);
  opacity: 0;
}

.scanner-viewport.is-live .scan-line {
  animation: scan-sweep 2.4s ease-in-out infinite;
}

.viewport-state {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid rgba(237, 244, 236, 0.16);
  border-radius: 2px;
  color: rgba(237, 244, 236, 0.7);
  background: rgba(7, 9, 8, 0.66);
  font-family: var(--mono);
  font-size: 9px;
  backdrop-filter: blur(8px);
}

.scanner-viewport.is-live .viewport-state-pip {
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(215, 243, 107, 0.13);
}

.scanner-viewport.is-success .viewport-state-pip {
  background: var(--cyan);
}

.scanner-footer {
  min-height: 40px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
}

.format-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.format-pill {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--faint);
  font-size: 8px;
  line-height: 1;
}

.format-pill.format-qr {
  border-color: rgba(215, 243, 107, 0.34);
  color: var(--lime);
}

.footer-state {
  gap: 7px;
  color: var(--faint);
  font-size: 9px;
}

.camera-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 7px;
}

.platform-picker {
  margin-bottom: 10px;
}

.platform-tabs,
.mode-tabs {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-deep);
}

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

.mode-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 7px;
}

.platform-tabs button,
.mode-tabs button {
  min-width: 0;
  min-height: 39px;
  padding: 0 6px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.platform-tabs button:last-child,
.mode-tabs button:last-child {
  border-right: 0;
}

.platform-tabs button[aria-selected="true"],
.mode-tabs button[aria-selected="true"] {
  color: #10140f;
  background: var(--lime);
}

.workflow-strip {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(14, 18, 17, 0.78);
}

.workflow-strip > svg {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--faint);
}

.workflow-step span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
}

.workflow-step strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-step.is-active {
  color: var(--ink);
}

.workflow-step.is-active span {
  border-color: var(--lime);
  color: #10140f;
  background: var(--lime);
}

.workflow-step.is-complete span {
  border-color: var(--cyan);
  color: var(--cyan);
}

.manual-scan {
  margin-top: 10px;
}

.manual-scan label,
.batch-state,
.delivery-meta dt,
.progress-copy,
.unmatched-count,
.order-list-block summary {
  font-family: var(--mono);
}

.manual-scan label {
  display: block;
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 9px;
}

.manual-scan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(18, 23, 22, 0.8);
}

.manual-scan-row:focus-within {
  border-color: rgba(215, 243, 107, 0.6);
}

.manual-scan input {
  min-width: 0;
  min-height: 43px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
}

.manual-scan input::placeholder {
  color: var(--faint);
}

.manual-scan button {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  color: var(--lime);
  background: transparent;
  cursor: pointer;
}

.manual-scan button svg {
  width: 16px;
  height: 16px;
}

.control-button,
.action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 43px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(18, 23, 22, 0.8);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.control-button:hover,
.control-button:active,
.action-secondary:hover,
.action-secondary:active {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--panel);
}

.control-button svg,
.action-secondary svg,
.action-primary svg {
  width: 15px;
  height: 15px;
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.control-stop {
  color: var(--coral);
}

.result-panel {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid rgba(123, 216, 213, 0.34);
  border-radius: 8px;
  background: rgba(16, 28, 25, 0.92);
  animation: reveal-up 0.4s ease both;
}

.result-panel[data-state="warning"] {
  border-color: rgba(255, 128, 105, 0.42);
  background: rgba(34, 20, 17, 0.92);
}

.result-panel[data-state="warning"] .result-check,
.result-panel[data-state="warning"] .result-kicker {
  border-color: rgba(255, 128, 105, 0.72);
  color: var(--coral);
}

.result-panel[data-state="loading"] {
  border-color: rgba(215, 243, 107, 0.36);
  background: rgba(25, 28, 16, 0.92);
}

.result-panel[data-state="loading"] .result-check,
.result-panel[data-state="loading"] .result-kicker {
  border-color: rgba(215, 243, 107, 0.7);
  color: var(--lime);
}

.batch-panel {
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.batch-heading,
.progress-copy,
.batch-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.batch-heading h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.batch-state {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 9px;
}

.batch-panel[data-state="active"] .batch-state {
  border-color: rgba(215, 243, 107, 0.35);
  color: var(--lime);
}

.batch-panel[data-state="complete"] .batch-state {
  border-color: rgba(123, 216, 213, 0.42);
  color: var(--cyan);
}

.batch-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}

.reset-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 37px;
  margin-top: 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.reset-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 19px;
  flex: 0 0 34px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-deep);
}

.toggle-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.reset-option input:checked + .toggle-track {
  border-color: var(--lime);
}

.reset-option input:checked + .toggle-track span {
  background: var(--lime);
  transform: translateX(15px);
}

.reset-option input:focus-visible + .toggle-track {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.batch-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  margin-top: 5px;
  padding: 0 2px;
  border-top: 1px solid var(--line);
  color: var(--faint);
}

.batch-empty svg {
  width: 20px;
  height: 20px;
}

.batch-empty p {
  margin: 0;
  font-size: 12px;
}

.batch-content {
  margin-top: 7px;
  border-top: 1px solid var(--line);
}

.delivery-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line);
}

.delivery-meta div {
  min-width: 0;
  padding: 11px 10px;
  background: var(--panel-deep);
}

.delivery-meta div:first-child {
  grid-column: 1 / -1;
}

.delivery-meta dt {
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 8px;
}

.delivery-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
}

.progress-block {
  position: relative;
  padding: 18px 0 20px;
}

.progress-copy {
  color: var(--muted);
  font-size: 10px;
}

.progress-copy strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.progress-track {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--lime);
  transition: width 0.25s ease;
}

.batch-panel[data-state="complete"] .progress-track span {
  background: var(--cyan);
}

.unmatched-count {
  position: absolute;
  right: 0;
  bottom: 2px;
  color: var(--faint);
  font-size: 8px;
}

.unmatched-count strong {
  color: var(--coral);
}

.order-list-block {
  border-top: 1px solid var(--line);
}

.order-list-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  list-style: none;
}

.order-list-block summary::-webkit-details-marker {
  display: none;
}

.order-list-block summary > span:not(.summary-label) {
  min-width: 24px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-align: center;
}

.order-list-block .summary-label {
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  text-align: left;
}

.order-list {
  max-height: 230px;
  margin: 0 0 12px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.order-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid rgba(229, 244, 231, 0.07);
}

.order-list .order-index {
  color: var(--coral);
  font-family: var(--mono);
  font-size: 9px;
}

.order-list strong,
.order-list code {
  display: block;
  overflow-wrap: anywhere;
}

.order-list strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
}

.order-list code {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.duplicate-block .order-index,
.duplicate-block code {
  color: var(--coral);
}

.list-empty {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 11px;
}

.direct-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 14px;
  background: var(--line);
}

.direct-stats > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
  padding: 14px;
  color: var(--muted);
  background: var(--panel-deep);
  font-family: var(--mono);
  font-size: 10px;
}

.direct-stats strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
}

.direct-stats > div:nth-child(2) strong {
  color: var(--coral);
}

.direct-stats p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 11px 14px;
  overflow-wrap: anywhere;
  color: var(--muted);
  background: var(--panel-deep);
  font-size: 11px;
}

.batch-actions {
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.batch-actions .action-primary {
  flex: 1;
}

.batch-actions .action-secondary {
  width: 92px;
  flex: 0 0 92px;
}

.action-primary:disabled,
.action-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.confirm-dialog {
  width: min(360px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #121716;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.confirm-dialog::backdrop {
  background: rgba(4, 6, 5, 0.78);
  backdrop-filter: blur(3px);
}

.confirm-dialog form {
  padding: 22px;
  text-align: center;
}

.dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 13px;
  place-items: center;
  border: 1px solid rgba(215, 243, 107, 0.42);
  border-radius: 50%;
  color: var(--lime);
}

.dialog-icon svg {
  width: 21px;
  height: 21px;
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.confirm-dialog p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.dialog-actions {
  gap: 8px;
}

.dialog-actions button {
  flex: 1;
}

.result-heading {
  justify-content: flex-start;
  gap: 10px;
}

.result-check {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border: 1px solid rgba(123, 216, 213, 0.7);
  border-radius: 50%;
  color: var(--cyan);
}

.result-check svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.result-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--cyan);
  font-size: 9px;
}

.result-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.result-index {
  margin-left: auto;
  color: rgba(123, 216, 213, 0.4);
  font-size: 10px;
}

.result-value-row {
  align-items: stretch;
  gap: 8px;
  margin: 17px 0 13px;
  padding: 11px 12px;
  border: 1px solid rgba(237, 244, 236, 0.13);
  border-radius: 3px;
  background: rgba(7, 9, 8, 0.44);
}

.result-value-row code {
  min-width: 0;
  overflow: auto;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:active {
  border-color: var(--lime);
  color: var(--lime);
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

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

.action-primary,
.action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.action-primary {
  color: #10140f;
  background: var(--lime);
}

.action-primary:hover,
.action-primary:active {
  background: #e5fb80;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  max-width: min(320px, calc(100vw - 36px));
  padding: 11px 13px;
  border: 1px solid rgba(215, 243, 107, 0.45);
  border-radius: 4px;
  color: var(--lime);
  background: rgba(16, 20, 17, 0.96);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes scan-sweep {
  0%,
  100% {
    top: 8%;
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  82% {
    opacity: 1;
  }
  92% {
    top: 90%;
    opacity: 0;
  }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 370px) {
  .app-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .scanner-viewport {
    height: 176px;
  }

  .control-button {
    padding-right: 5px;
    padding-left: 5px;
    font-size: 10px;
  }
}

@media (min-width: 561px) {
  .app-shell {
    padding-right: 22px;
    padding-left: 22px;
  }
}

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