/* Mingle – Zárás-papírok (feature/szkenner, 2026-11-18; web/js/view_scan.js, view_day.js kártya, view_report.js havi panel).
   Látványterv: docs/latvanyterv/Mingle_szkenner_B.png („B” – lépésjelzős varázsló). Csak tokenek (tokens_a.css; világos és sötét);
   a kamera- és az igazítás-mező mindkét módban sötét (fénykép-felület). Sötétben a menta csak a fő gombon és az élő jelzésen. */

/* ---- Napi zárás: Zárás-papírok kártya ---- */
.scan-card { padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); gap: var(--space-3); }
.scan-card-head { display: flex; align-items: flex-start; gap: var(--space-3); }
.scan-card-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); background: var(--surface-2); color: var(--text); }
.scan-card-icon .icon { width: 22px; height: 22px; }
.scan-card-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.scan-card-title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-lg); }
.scan-card-count { padding: 2px 8px; border-radius: var(--radius-xs); box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--ink2); font-size: var(--text-2xs); font-weight: 600; }
.scan-card-text { color: var(--ink2); font-size: var(--text-sm); }
.scan-card-steps { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; color: var(--ink2); font-size: var(--text-xs); }
.scan-card-steps li { display: inline-flex; align-items: center; gap: 6px; }
.scan-card-steps li + li::before { content: ""; width: 14px; height: 1px; background: var(--border-strong); }
.scan-card-no { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: 11px; font-weight: 700; }
.scan-card-btn { background: var(--acc-t); color: var(--acc-l); font-weight: 700; }
.scan-card-btn:hover:not(:disabled) { background: var(--acc-on2); }

/* ---- varázsló ---- */
.scan-view { gap: var(--space-3); max-width: 720px; }
.scan-sub { margin: 0; color: var(--ink2); font-size: var(--text-sm); }
.scan-steps { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.scan-step { display: flex; align-items: center; gap: var(--space-2); flex: 1 1 0; min-width: 0; color: var(--muted); font-size: var(--text-sm); font-weight: 600; }
.scan-step + .scan-step::before { content: ""; flex: 1 1 auto; height: 1px; min-width: 12px; background: var(--border-strong); }
.scan-step-no { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--border-strong); font-size: 13px; }
.scan-step-no .icon { width: 14px; height: 14px; }
.scan-step.is-active { color: var(--text); }
.scan-step.is-active .scan-step-no { background: var(--text); color: var(--bg); box-shadow: none; }
.scan-step.is-done { color: var(--ink2); }
.scan-step.is-done .scan-step-no { color: var(--text); }
.scan-step-label { white-space: nowrap; }
.scan-body { display: flex; flex-direction: column; gap: var(--space-3); }

/* 1. Fotó: kamera-mező */
.scan-cam { position: relative; overflow: hidden; aspect-ratio: 3 / 4; max-height: 56vh; border-radius: var(--radius-lg); background: #0A0A0B; color: #F4F4F5; }
.scan-video, .scan-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-cam-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: var(--space-2); pointer-events: none; }
.scan-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 18px; background: rgba(10, 10, 11, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); color: #F4F4F5; font-size: 13px; font-weight: 600; white-space: nowrap; }
.scan-pill-kind { margin-left: auto; }
.scan-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: #86E5BB; box-shadow: 0 0 0 4px rgba(134, 229, 187, 0.18); }
.scan-cam-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); padding: var(--space-5); text-align: center; color: #A6A6AE; }
.scan-cam-empty .icon { width: 56px; height: 56px; color: #F4F4F5; }
.scan-cam-empty p { margin: 0; max-width: 260px; font-size: var(--text-sm); }
.scan-cam.is-live .scan-cam-empty { display: none; }
.scan-cam-note:empty { display: none; }
.scan-kinds { flex-wrap: wrap; }
.scan-strip-wrap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.scan-strip-head { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--text-xs); }
.scan-strip-count { font-variant-numeric: tabular-nums; }
.scan-strip { display: flex; gap: var(--space-2); overflow-x: auto; }
.scan-strip-item { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 64px; height: 84px;
  border-radius: var(--radius-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); overflow: hidden; color: var(--ink2); font-size: 11px; }
.scan-strip-item.is-missing { background: transparent; box-shadow: none; border: 1px dashed var(--border-strong); }
.scan-strip-item.is-next { border: 1.5px solid var(--text); color: var(--text); }
.scan-strip-img { width: 100%; height: 60px; object-fit: cover; object-position: top; background: #FFFFFF; }
.scan-strip-no { font-size: 15px; color: var(--text); }
.scan-strip-label { max-width: 100%; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* exponáló: a kamera-kép alján középen; a kamera-mező mindkét módban sötét, ezért fix fehér */
.scan-shutter { position: absolute; left: 50%; bottom: 16px; width: 76px; height: 76px; margin-left: -38px; padding: 0; border: 4px solid #FFFFFF; border-radius: 50%;
  background: transparent; box-shadow: inset 0 0 0 4px rgba(10, 10, 11, 0.55), inset 0 0 0 40px #FFFFFF; cursor: pointer; }
.scan-shutter:active { transform: scale(0.96); }
.scan-shutter:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.scan-photo-alt { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* 2. Igazítás */
.scan-stage { position: relative; display: flex; justify-content: center; min-height: 260px; padding: 0; border-radius: var(--radius-lg); background: #0A0A0B; touch-action: none; }
.scan-stage-canvas { display: block; }
.scan-handle { position: absolute; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: grab; touch-action: none; }
.scan-handle-dot { position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 0 0 3px #86E5BB, 0 2px 6px rgba(0, 0, 0, 0.5); }
.scan-handle.is-drag .scan-handle-dot { transform: scale(1.25); }
.scan-handle:focus-visible { outline: 2px solid #86E5BB; outline-offset: 2px; }
.scan-loupe { position: absolute; top: 10px; left: 10px; width: 128px; height: 128px; border-radius: 50%; border: 3px solid #FFFFFF; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); pointer-events: none; }
.scan-loupe.is-right { left: auto; right: 10px; }
.scan-hint { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.scan-hint .icon { flex: none; width: 16px; height: 16px; color: var(--muted); }
.scan-tools { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.scan-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-2); }
.scan-actions-save { grid-template-columns: 1fr; }

/* 3. Mentés */
.scan-pages { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.scan-page { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); }
.scan-page + .scan-page { border-top: 1px solid var(--border); }
.scan-page-thumb { flex: none; width: 48px; height: 64px; border-radius: 4px; background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--border-strong); overflow: hidden; }
.scan-page-img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.scan-page-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.scan-page-title { font-size: var(--text-md); }
.scan-page-sub { color: var(--ink2); font-size: var(--text-xs); }
.scan-page-acts { flex: none; display: flex; gap: 2px; }
.scan-add { border: 1px dashed var(--border-strong); background: transparent; }
.scan-summary { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.scan-summary .icon { flex: none; width: 16px; height: 16px; color: var(--muted); }
.scan-acc-title { margin: var(--space-2) 0 0; }

/* havi PDF (varázsló és Forgalom) */
.scan-month { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); }
.scan-month-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.scan-month-title { font-size: var(--text-md); }
.scan-month-sub { color: var(--ink2); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.scan-month-bar { display: block; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.scan-month-bar-fill { display: block; height: 100%; background: var(--primary); }
.scan-month-dl { flex: none; }
.report-scan { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); }
.scan-month-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.scan-month-select { flex: 1 1 180px; min-width: 0; }
.scan-month-info { display: flex; flex-direction: column; gap: 6px; }
.scan-month-progress { margin: 0; font-variant-numeric: tabular-nums; }
.scan-month-missing { margin: 0; }

@media (min-width: 900px) {
  .scan-view { margin: 0 auto; width: 100%; }
}

/* ---- sötét: a menta csak a fő gombon és az élő jelzésen ---- */
html:root[data-theme="sotet"] .scan-card-btn { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
html:root[data-theme="sotet"] .scan-card-btn:hover:not(:disabled) { background: var(--surface-3); }
html:root[data-theme="sotet"] .scan-month-bar-fill { background: var(--text); }
