/*
 * Ammunition: the low-stock chip, quantity presets, the adjust panel, and the barcode scanner.
 * Linked from views/ammo.ts (index.html carries styles.css only); tokens come from styles.css.
 */

:root {
  --warning: #d3a64b;
  --warning-dim: rgba(211, 166, 75, 0.45);
}

/* Status is text plus an icon, never color alone. */
.chip.low {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  vertical-align: middle;
  color: var(--warning);
  border-color: var(--warning-dim);
}

.chip.low svg {
  flex: none;
}

button.with-icon svg {
  vertical-align: -3px;
  margin-right: 6px;
}

/* Quantity presets under a rounds field. */
.presets {
  margin: -6px 0 14px;
}

/* Add or remove: a two-way switch that reads as pressed, not only tinted. */
.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  background: var(--bg);
}

.segmented button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 18px;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.segmented button + button {
  border-left: 1px solid var(--border);
}

.segmented button[aria-pressed='true'] {
  color: var(--brass);
  background: var(--brass-faint);
  box-shadow: inset 0 -2px 0 var(--brass);
}

.adjust-preview {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
}

.prefill-note {
  color: var(--muted);
  font-size: 13px;
  margin: -8px 0 16px;
}

/* ---------- barcode scanner ---------- */

.scan-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 380px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}

.scan-stage.live {
  border-color: var(--brass-dim);
}

.scan-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-stage .idle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.scan-stage.live .idle {
  display: none;
}

.scan-stage .reticle {
  position: absolute;
  inset: 28px;
  pointer-events: none;
}

.scan-stage .reticle i {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--brass);
}

.scan-stage .reticle .tl {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
}

.scan-stage .reticle .tr {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
}

.scan-stage .reticle .bl {
  bottom: 0;
  left: 0;
  border-right: 0;
  border-top: 0;
}

.scan-stage .reticle .br {
  bottom: 0;
  right: 0;
  border-left: 0;
  border-top: 0;
}

.scan-stage .torch {
  position: absolute;
  right: 8px;
  bottom: 8px;
}

.scan-stage .torch[hidden],
.scan-actions button[hidden] {
  display: none;
}

.scan-status {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
}

.scan-manual input {
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
}

.stepper .count {
  font-family: var(--mono);
  font-size: 18px;
  min-width: 2ch;
  text-align: center;
  color: var(--brass);
}
