/* Camera capture view + book status timeline */
.capture-view {
  position: fixed; inset: 0; background: #000; color: #fff;
  display: flex; flex-direction: column; z-index: 30;
}
.capture-video-wrap { flex: 1; position: relative; overflow: hidden; }
.capture-video { width: 100%; height: 100%; object-fit: cover; }
.capture-frame-guide {
  --c: var(--gold); --len: 28px; --w: 2px;
  position: absolute; inset: 8% 6%; pointer-events: none;
  outline: 1px solid var(--gold-faint); outline-offset: -6px;
  background:
    linear-gradient(var(--c) 0 0) left top / var(--len) var(--w), linear-gradient(var(--c) 0 0) left top / var(--w) var(--len),
    linear-gradient(var(--c) 0 0) right top / var(--len) var(--w), linear-gradient(var(--c) 0 0) right top / var(--w) var(--len),
    linear-gradient(var(--c) 0 0) left bottom / var(--len) var(--w), linear-gradient(var(--c) 0 0) left bottom / var(--w) var(--len),
    linear-gradient(var(--c) 0 0) right bottom / var(--len) var(--w), linear-gradient(var(--c) 0 0) right bottom / var(--w) var(--len);
  background-repeat: no-repeat;
}
.capture-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: env(safe-area-inset-top) var(--space-4) 0;
  padding-top: calc(env(safe-area-inset-top) + var(--space-2));
}
.capture-topbar .icon-btn { color: #fff; background: rgba(0,0,0,.35); }
.capture-topbar-title { display: flex; flex-direction: column; align-items: center; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.capture-page-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.capture-topbar-sub { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--gold-soft); }
.capture-thumb-badge {
  position: absolute; left: 0; bottom: 0; right: 0; padding: 1px 2px;
  background: rgba(0,0,0,.65); color: var(--gold-soft); font-size: 10px; text-align: center; white-space: nowrap;
}

.capture-controls {
  background: #000; padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
}
.capture-thumbs { scrollbar-width: thin; scrollbar-color: var(--gold) transparent; display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-3); }
.capture-thumb { position: relative; flex: 0 0 auto; width: 56px; height: 74px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--gold); }
.capture-thumb img { width: 100%; height: 100%; object-fit: cover; }
.capture-thumb-status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); color: #fff; font-size: 11px; text-align: center;
}
.capture-thumb-status--error { background: rgba(161,51,43,.75); cursor: pointer; }
.capture-thumb-remove {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
}

.capture-actionrow { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.capture-shutter {
  width: 72px; height: 72px; border-radius: 50%;
  background: #fff; border: 4px solid rgba(255,255,255,.5);
  box-shadow: 0 0 0 3px #000, 0 0 0 4.5px var(--gold);
  margin: 0 auto;
}
.capture-shutter:active { transform: scale(0.95); }
.capture-side-btn { color: #fff; min-width: 80px; text-align: center; }

.capture-permission {
  position: fixed; inset: 0; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-8) 20px; text-align: center; gap: var(--space-4); z-index: 30;
}
.capture-permission > svg { color: var(--gold); }
.capture-permission .fleuron-rule { width: 200px; margin: 0; }

/* Book status timeline */
.status-timeline { list-style: none; margin: 0; padding: 0; }
.status-step { display: flex; gap: var(--space-3); padding-bottom: var(--space-6); position: relative; }
/* Steps are lozenges on a dotted gilt thread; the diamond is a rotated backdrop so icons stay upright. */
.status-step::before {
  content: ''; position: absolute; left: 12px; top: 30px; bottom: -6px; border-left: 1px dotted var(--gold);
}
.status-step:last-child::before { display: none; }
.status-step-dot {
  --dot-bg: var(--surface-sunken); --dot-rule: var(--gold-soft);
  position: relative; isolation: isolate;
  width: 25px; height: 25px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted); font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.status-step-dot::before {
  content: ''; position: absolute; inset: 4px; z-index: -1; transform: rotate(45deg);
  background: var(--dot-bg); border: 1.5px solid var(--dot-rule);
}
.status-step--done .status-step-dot { --dot-bg: var(--success); --dot-rule: var(--success); color: var(--on-primary); }
.status-step--active .status-step-dot { --dot-rule: var(--primary); color: var(--primary); }
.status-step--failed .status-step-dot { --dot-rule: var(--danger); color: var(--danger); }
.status-step-title { font-weight: 600; }
.status-step-detail { font-size: 14px; color: var(--ink-muted); }
.book-picker-title { font-family: var(--font-display); }

/* Toast sits above the thumbnail strip + shutter (~190px) so it never covers the pages it talks about. */
.capture-view .status-toast { bottom: calc(210px + env(safe-area-inset-bottom)); pointer-events: none; }
