:root {
  --ink: #e8efe4;
  --ink-soft: #b4c4ae;
  --muted: #8a9a84;
  --bg: #142016;
  --paper: #1c2a1f;
  --paper-2: #243528;
  --line: #2f4334;
  --line-strong: #3f5844;
  --green: #2f6b2a;
  --green-deep: #1e4a1c;
  --green-bright: #3d8f35;
  --yellow: #e6b422;
  --yellow-deep: #c99612;
  --yellow-ink: #1a1405;
  --cream: #f2f6ef;
  --danger: #e08a72;
  --radius: 10px;
  --radius-sm: 6px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* —— Hero —— */
.hero {
  margin-bottom: 1.75rem;
  animation: rise 0.7s var(--ease) both;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--cream);
  line-height: 1.05;
}

.hub-back {
  display: inline-block;
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--yellow);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.hub-back:hover,
.hub-back:focus-visible {
  color: var(--cream);
  outline: none;
}

.tagline {
  margin: 0.75rem 0 0;
  max-width: 28rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 400;
}

.health {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--yellow);
  background: rgba(230, 180, 34, 0.1);
  border: 1px solid rgba(230, 180, 34, 0.28);
  border-radius: var(--radius-sm);
}

.health::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}

.health.bad {
  color: #ffd0c4;
  background: rgba(176, 70, 50, 0.22);
  border-color: rgba(224, 138, 114, 0.45);
}

.health.bad::before { background: var(--danger); }

/* —— Panels —— */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.35rem 1.25rem;
  margin-bottom: 1rem;
  animation: rise 0.75s var(--ease) 0.08s both;
}

.panel-main { animation-delay: 0.12s; }

.panel-head {
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.results-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.panel-sub {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.95rem;
}

.field > span:first-child {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cluster-auto-check {
  margin: 0.15rem 0 0.55rem;
}

.cluster-manual-field {
  margin-bottom: 0.35rem;
}

.cluster-manual-field input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mode-presets {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}

.mode-option input {
  margin: 0;
  accent-color: var(--yellow);
}

/* Quiet secondary input — present but low visual weight */
.field-quiet {
  margin-top: -0.25rem;
  margin-bottom: 0.85rem;
  max-width: 200px;
  opacity: 0.88;
}

.field-quiet > span:first-child {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--muted);
}

.field-quiet input {
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
  background: var(--paper-2);
  border-color: var(--line);
}

.field-quiet .hint {
  font-size: 0.75rem;
  color: var(--muted);
}

select,
input[type="file"],
input[type="number"] {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus,
input[type="number"]:focus,
input[type="file"]:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(230, 180, 34, 0.18);
}

.check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.92rem;
  margin: 0.5rem 0 0.85rem;
  color: var(--ink-soft);
}

.check input {
  margin-top: 0.2rem;
  accent-color: var(--yellow);
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

button,
.camera-file-button {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.25rem;
  background: var(--yellow);
  color: var(--yellow-ink);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s var(--ease);
}

button:hover,
.camera-file-button:hover {
  background: var(--yellow-deep);
  color: #fff;
}

button:active,
.camera-file-button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.secondary-button {
  background: var(--green);
  color: #f3faf3;
}

.secondary-button:hover {
  background: var(--green-bright);
  color: #fff;
}

.ghost-button {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}

.ghost-button:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.camera-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.camera-file-button {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.camera-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.camera-panel {
  padding: 0.75rem;
  margin: 0.5rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c120e;
}

#cameraVideo {
  display: block;
  width: 100%;
  max-height: 480px;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  background: #000;
  object-fit: contain;
}

.camera-panel .status {
  color: #d5e0d6;
  margin: 0.35rem 0 0;
}

.status {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.hidden { display: none !important; }

.hint {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.field .hint {
  margin: 0;
}

/* —— Results —— */
.results {
  margin-bottom: 1rem;
  animation: rise 0.5s var(--ease) both;
}

.results-head {
  margin-bottom: 0.65rem;
}

.results-head h2 {
  color: var(--cream);
}

.stats {
  --stats-label-width: 9.25rem;
  margin-top: 0.45rem;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--cream);
  background: rgba(12, 18, 14, 0.72);
  border: 2px solid var(--green-bright);
  border-radius: var(--radius-sm);
  line-height: 1.55;
}

.stats-line + .stats-line,
.stats-line + .stats-group,
.stats-group + .stats-line {
  margin-top: 0.15rem;
}

.stats-line.stats-pair {
  display: grid;
  grid-template-columns: var(--stats-label-width) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
}

.stats-subrows {
  display: grid;
  gap: 0.1rem;
  margin: 0.25rem 0 0.35rem 0.6rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(61, 143, 53, 0.5);
}

.stats-subrows:empty {
  display: none;
}

.stats-subrows .stats-pair {
  grid-template-columns: 3.1rem minmax(0, 1fr);
  gap: 0.5rem;
  font-size: 0.88rem;
}

.stats-label {
  color: var(--ink-soft);
  font-weight: 600;
}

.stats-subrows .stats-label {
  color: var(--muted);
}

.stats-value {
  min-width: 0;
}

.stats-primary,
.stats-primary .stats-label,
.stats-primary .stats-value {
  font-weight: 700;
  color: var(--cream);
}

.results-frame {
  background: #0c120e;
  border-radius: var(--radius);
  padding: 0.5rem;
  border: 1px solid var(--line);
}

#preview {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  background: #121a14;
}

/* —— Advanced —— */
.advanced {
  animation-delay: 0.18s;
}

.advanced summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  user-select: none;
}

.advanced summary::-webkit-details-marker { display: none; }

.summary-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.summary-hint {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
}

.advanced summary::after {
  content: "Show";
  margin-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yellow);
}

.advanced[open] summary::after { content: "Hide"; }

.advanced[open] summary {
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.upload-block {
  display: grid;
  gap: 1rem;
}

.combine-slot {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
}

.combine-slot-title {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.combine-slot .hint {
  margin: 0.35rem 0 0;
}

.combine-preview {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.75rem;
}

.combine-preview img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
}

.combine-preview .hint {
  margin: 0;
  word-break: break-word;
}

/* —— Slider / zoom —— */
.slider-field input[type="range"],
#zoomSlider {
  width: 100%;
  accent-color: var(--yellow);
}

.slider-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.thumb-wrap { margin: 0 0 1rem; }

.scale-zoom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.zoom-btn {
  min-width: 2.35rem;
  padding: 0.4rem 0.65rem;
  font-size: 1.1rem;
  line-height: 1;
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.zoom-btn:hover {
  background: var(--green-deep);
  color: var(--cream);
}

.zoom-reset {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

#zoomSlider {
  flex: 1 1 120px;
  min-width: 100px;
}

.zoom-value {
  min-width: 3.2rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.scale-zoom-hint { margin-bottom: 0.45rem; }

.scale-viewport {
  width: 100%;
  max-height: min(70vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c120e;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.scale-zoom-inner {
  position: relative;
  transform-origin: 0 0;
}

.scale-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  overflow: visible;
  transform-origin: 0 0;
}

.thumb-wrap img,
.scale-stage img {
  max-width: none;
  width: auto;
  max-height: 280px;
  height: auto;
  border-radius: 0;
  border: none;
  background: #ddd;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.scale-bar {
  position: absolute;
  left: 12%;
  top: 12%;
  width: 80px;
  height: 2px;
  background: var(--yellow);
  border: none;
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
  cursor: grab;
  display: block;
  user-select: none;
  touch-action: none;
  z-index: 2;
  transform-origin: 0% 50%;
  will-change: transform;
}

.scale-bar.dragging { cursor: grabbing; }
.scale-bar.dragging[data-mode="rotate"] { cursor: crosshair; }

.scale-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 10px;
  background: var(--yellow);
  border: none;
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.9);
  cursor: ew-resize;
}

.scale-handle-left { left: 0; }
.scale-handle-right { right: 0; }

.scale-move-handle,
.scale-rotate-handle {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  z-index: 3;
  touch-action: none;
}

.scale-move-handle {
  left: 50%;
  top: calc(100% + 14px);
  transform: translateX(-50%);
  background: var(--yellow);
}

.scale-rotate-handle {
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--green);
}

.scale-move-handle::before {
  content: "↔";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 26px;
  color: var(--yellow-ink);
  pointer-events: none;
  font-weight: 700;
}

.scale-rotate-handle::before {
  content: "⟳";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 26px;
  color: #fff;
  pointer-events: none;
}

.scale-move-handle::after,
.scale-rotate-handle::after,
.scale-handle::after {
  content: "";
  position: absolute;
  top: -12px;
  bottom: -12px;
  left: -12px;
  right: -12px;
}

.scale-handle::after {
  left: -14px;
  right: -14px;
}

.scale-check { margin-top: 0.65rem; }

.scale-ref-field {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  max-width: 180px;
}

.scale-ref-field input {
  width: 100%;
  font-size: 1rem;
}

.scale-hint { margin-top: 0.25rem; }

.scale-stage.manual-off .scale-bar,
.scale-bar.hidden {
  display: none !important;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.row .field { margin: 0; min-width: 120px; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 1.5rem 0.9rem 3rem;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .camera-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .camera-file-button,
  .camera-actions button,
  .actions button,
  #advRunBtn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .field-quiet {
    max-width: none;
  }

  .thumb-wrap img,
  .scale-stage img {
    max-height: 220px;
  }

  .scale-viewport {
    max-height: 65vh;
  }

  .scale-move-handle,
  .scale-rotate-handle {
    width: 32px;
    height: 32px;
  }

  .scale-move-handle::before,
  .scale-rotate-handle::before {
    font-size: 15px;
    line-height: 32px;
  }

  .stats {
    font-size: 0.86rem;
  }

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

.cal-list {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.cal-row {
  display: grid;
  grid-template-columns: 56px 1fr 88px;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
}

.cal-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: #101610;
}

.cal-name {
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-count-input {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--cream);
}

.cal-results {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  font-size: 0.9rem;
  line-height: 1.5;
}

.cal-results h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
}

.cal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.65rem;
  font-size: 0.82rem;
}

.cal-table th,
.cal-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.results-actions,
.results-toolbar {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.results-toolbar .check {
  margin: 0;
}

.results-actions .status,
.results-toolbar .status {
  font-size: 0.88rem;
}

.results-actions button:disabled,
.results-toolbar button:disabled {
  cursor: default;
}

.results-head > .status {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.88rem;
}

.file-queue {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}

.file-queue-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  cursor: pointer;
}

.file-queue-item.active {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(230, 180, 34, 0.18);
}

.file-queue-item img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 4px;
  background: #0c120e;
  flex: 0 0 auto;
}

.file-queue-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  color: var(--cream);
}

.file-queue-remove {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
}

.results-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.result-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem;
}

.result-card.is-saved {
  border-color: var(--green-bright);
}

.result-card.is-error {
  border-color: var(--danger);
}

.result-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.result-card-head .check {
  margin: 0;
  min-width: 0;
  flex: 1;
}

.result-card-count {
  font-size: 0.95rem;
  color: var(--cream);
  white-space: nowrap;
}

.result-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.45rem;
}

.result-card-frame {
  background: #0c120e;
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  border: 1px solid var(--line);
}

.result-card-frame img {
  width: 100%;
  display: block;
  border-radius: 4px;
  background: #121a14;
}

.result-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.result-card-status {
  display: block;
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
}

body.box-editor-open {
  overflow: hidden;
}

.box-editor {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0a0f0c;
}

.box-editor.hidden {
  display: none;
}

.box-editor-panel {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #0a0f0c;
}

.box-editor-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 18, 14, 0.96);
}

.box-editor-close {
  min-width: 2.25rem;
  padding: 0.35rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
}

.box-editor-count {
  color: var(--cream);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.box-editor-zoom {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  min-width: 0;
}

.box-editor-zoom .zoom-btn {
  min-width: 2rem;
  padding: 0.25rem 0.45rem;
}

.box-editor-zoom input[type="range"] {
  width: min(8rem, 22vw);
}

.box-editor-zoom .zoom-value {
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 2.8rem;
  text-align: right;
}

.box-editor-viewport {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #060a08;
  touch-action: pan-x pan-y;
  min-height: 0;
}

.box-editor-stage {
  box-sizing: border-box;
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

#boxEditorCanvas {
  display: block;
  cursor: crosshair;
  touch-action: none;
  flex: 0 0 auto;
}

.box-editor-foot {
  padding: 0.45rem 0.65rem 0.55rem;
  border-top: 1px solid var(--line);
  background: rgba(12, 18, 14, 0.96);
}

.box-editor-hint {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.box-editor-foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.box-editor-complete,
.box-editor-select-mode {
  font-size: 0.86rem;
  margin: 0;
}

.box-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.box-editor-status {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .box-editor-foot-row {
    flex-direction: column;
    align-items: stretch;
  }

  .box-editor-actions {
    justify-content: stretch;
  }

  .box-editor-actions button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .panel,
  .results {
    animation: none;
  }

  button:active,
  .camera-file-button:active {
    transform: none;
  }
}
