/* FilmScan — the SwiftUI look in CSS.
 *
 * The app is `.preferredColorScheme(.dark)` with `.tint(.orange)`, so the
 * palette below is the iOS system dark palette and SwiftUI's `.orange`.
 * `.ultraThinMaterial` becomes a blurred translucent panel; the iOS type
 * scale (largeTitle, headline, subheadline, caption, caption2) is kept as
 * named sizes so the screens read the same as the Swift source.
 */

:root {
  --orange: #ff9500;
  --green: #34c759;
  --yellow: #ffd60a;
  --red: #ff453a;

  --label: #fff;
  --secondary: rgba(235, 235, 245, 0.6);
  --tertiary: rgba(235, 235, 245, 0.3);

  --bg: #000;
  --grouped: #1c1c1e;
  --separator: rgba(84, 84, 88, 0.65);

  --material: rgba(32, 32, 34, 0.72);
  --material-strong: rgba(44, 44, 46, 0.86);
  --fill: rgba(255, 255, 255, 0.10);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui,
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.icon { display: block; flex: none; }

.missing {
  margin: auto;
  color: var(--secondary);
  font-size: 15px;
  text-align: center;
  padding: 24px;
}

/* ============================ Buttons ============================ */

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  color: var(--label);
  font: inherit;
  font-size: 17px;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.btn:disabled { opacity: 0.4; cursor: default; }
.btn:active:not(:disabled) { opacity: 0.7; }

.btn.prominent {
  background: var(--orange);
  color: #000;
  font-weight: 600;
}

.btn.bordered { background: rgba(255, 149, 0, 0.16); color: var(--orange); }

.btn.plain {
  background: none;
  padding: 6px 8px;
  color: var(--orange);
  font-size: 17px;
}

.btn.plain.strong { font-weight: 600; }
.btn.plain.subtle { color: var(--orange); font-size: 15px; }

.btn.big { font-size: 20px; font-weight: 700; padding: 16px; width: 100%; }
.btn.wide { width: 100%; padding: 12px 16px; font-size: 17px; font-weight: 600; }

.btn.capsule {
  border-radius: 999px;
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  color: var(--label);
  font-size: 17px;
  font-weight: 600;
  padding: 8px 14px;
}

.btn.round {
  border-radius: 999px;
  padding: 10px;
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  color: var(--label);
}

.btn.round.on { color: var(--orange); }

.label { display: inline-flex; align-items: center; gap: 6px; }

/* ============================ Segmented picker ============================ */

.segmented {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: rgba(118, 118, 128, 0.24);
}

.segment {
  appearance: none;
  border: 0;
  flex: 1;
  min-width: 0;
  border-radius: 7px;
  background: none;
  color: var(--label);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment.on {
  background: #636366;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ============================ Slider ============================ */

.slider {
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 28px;
  background: none;
  cursor: pointer;
}

.slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(120, 120, 128, 0.36);
}

.slider::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(120, 120, 128, 0.36);
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ============================ Spinner & progress ============================ */

.spinner {
  width: 26px;
  height: 26px;
  margin: auto;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.progress { width: 100%; padding: 0 16px; }
.progress-caption { font-size: 12px; color: var(--secondary); margin-bottom: 6px; }

.progress-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(120, 120, 128, 0.36);
  overflow: hidden;
}

.progress-fill { height: 100%; background: var(--orange); transition: width 0.2s ease; }

/* ============================ Sheets, alerts ============================ */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sheet-backdrop.open { opacity: 1; }

.sheet {
  width: 100%;
  max-height: 62vh;
  overflow-y: auto;
  background: var(--grouped);
  border-radius: 14px 14px 0 0;
  padding: 8px 16px calc(20px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
}

.sheet.large { max-height: 92vh; }
.sheet-backdrop.open .sheet { transform: translateY(0); }

.sheet-grip {
  width: 36px;
  height: 5px;
  margin: 0 auto 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
}

.alert-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.alert-backdrop.open { opacity: 1; }

.alert, .confirm {
  width: 100%;
  max-width: 300px;
  border-radius: 14px;
  background: var(--material-strong);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  padding: 20px 16px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-title, .confirm-title { font-size: 17px; font-weight: 600; }
.alert-message { font-size: 13px; color: var(--secondary); }

.confirm-action {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  background: var(--fill);
  color: var(--orange);
  font-size: 17px;
}

.confirm-action.destructive { color: var(--red); }
.confirm-action.cancel { font-weight: 600; color: var(--label); }

/* ============================ Forms (sheet content) ============================ */

.form { display: flex; flex-direction: column; gap: 18px; }

.nav-title {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  padding-bottom: 2px;
}

.form-section { display: flex; flex-direction: column; gap: 10px; }

.form-header {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary);
}

.form-footer, .form-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--secondary);
}

.form-row { display: flex; align-items: center; gap: 10px; }
.form-row.stepper { justify-content: space-between; font-size: 15px; }
.form-tag { font-size: 12px; color: var(--secondary); white-space: nowrap; }

.stepper-buttons { display: flex; gap: 1px; border-radius: 8px; overflow: hidden; }

.stepper-button {
  appearance: none;
  border: 0;
  width: 44px;
  height: 32px;
  background: var(--fill);
  color: var(--label);
  font-size: 20px;
  cursor: pointer;
}

.stepper-button:disabled { opacity: 0.3; }

.toggle-row {
  appearance: none;
  border: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  background: none;
  color: var(--label);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.switch {
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.32);
  position: relative;
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.toggle-row.on .switch { background: var(--green); }
.toggle-row.on .switch::after { transform: translateX(20px); }

/* ============================ Home ============================ */

.home {
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);
  gap: 24px;
  overflow: hidden;
}

.home-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 32px;
  text-align: center;
}

.home-header .icon { color: var(--orange); }

.home-title { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.4px; }
.home-subtitle { margin: 0; font-size: 15px; color: var(--secondary); }

.home-actions { display: flex; flex-direction: column; gap: 10px; }
.home-actions .btn.bordered { padding: 12px; font-size: 17px; font-weight: 600; }
.home-caption { margin: 0; font-size: 12px; color: var(--secondary); text-align: center; }

.roll-list-host { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  padding: 24px;
  text-align: center;
}

.empty-title { margin: 0; font-size: 17px; color: var(--secondary); }
.empty-caption { margin: 0; font-size: 12px; color: var(--tertiary); max-width: 34ch; }

.list { list-style: none; margin: 0; padding: 0; }

.list-header {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary);
  padding: 8px 4px;
}

.list-row {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--grouped);
  margin-bottom: 8px;
}

.row-open {
  appearance: none;
  border: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--grouped);
  color: var(--label);
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease;
}

.list-row.swiped .row-open { transform: translateX(-84px); }

.row-thumb {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 8px;
  background: #262626;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--secondary);
}

.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.row-title {
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-caption { font-size: 12px; color: var(--secondary); }
.row-status { font-size: 11px; }
.row-status.green { color: var(--green); }
.row-status.orange { color: var(--orange); }
.row-open > .icon { color: var(--tertiary); }

.row-delete {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 84px;
  border-radius: 0;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  flex-direction: column;
  gap: 2px;
}

.row-delete .label { flex-direction: column; gap: 2px; }

/* ============================ Intro ============================ */

.intro { display: flex; flex-direction: column; gap: 20px; padding-bottom: 8px; }

.intro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 24px 8px;
  min-height: 46vh;
  justify-content: center;
}

.intro-card .icon { color: var(--orange); }
.intro-title { margin: 0; font-size: 22px; font-weight: 700; }
.intro-text { margin: 0; font-size: 17px; color: var(--secondary); max-width: 34ch; }

.intro-dots { display: flex; gap: 7px; justify-content: center; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.dot.on { background: #fff; }

/* ============================ Nav bar ============================ */

.nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 6px) 8px 6px;
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 0.5px solid var(--separator);
  flex: none;
}

.nav-bar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-back { flex: none; }

/* ============================ Darkroom ============================ */

.darkroom-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.frame-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }

.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.frame-cell {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--label);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cell-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  background: #1f1f1f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--secondary);
}

.cell-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cell-check {
  position: absolute;
  top: 4px;
  right: 4px;
  color: var(--green);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
}

.cell-caption { font-size: 11px; color: var(--secondary); text-align: center; }

.export-bar {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-top: 0.5px solid var(--separator);
}

.export-row { display: flex; align-items: center; gap: 16px; }
.export-size { font-size: 12px; color: var(--secondary); }

/* ============================ Import overlay ============================ */

.import-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
}

.import-overlay[hidden] { display: none; }

.import-overlay .spinner { margin: 0; }

.import-text {
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 16px;
  background: var(--material-strong);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

/* ============================ Frame editor ============================ */

.editor { background: #000; }

.editor-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.editor-preview, .result-preview {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.result-preview { padding: 10px; }

.editor-panel {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 12px calc(12px + var(--safe-bottom));
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  transition: opacity 0.15s ease;
}

.slider-row { display: flex; align-items: center; gap: 10px; }

.slider-name {
  width: 72px;
  flex: none;
  font-size: 12px;
  color: var(--label);
}

.tool-row { display: flex; gap: 6px; }

.tool-button {
  appearance: none;
  border: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px;
  border-radius: 10px;
  background: var(--fill);
  color: #fff;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.tool-button.active { background: rgba(255, 149, 0, 0.28); color: var(--orange); }

/* ============================ Full-screen tools ============================ */

.tool-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.tool-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }

.tool-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
}

.tool-content { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }

.tool-footer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.tool-hint { margin: 0; font-size: 12px; color: var(--secondary); text-align: center; }
.tool-controls { display: flex; flex-direction: column; gap: 10px; }
.tool-actions { display: flex; gap: 8px; }
.tool-sliders { display: flex; flex-direction: column; gap: 8px; }

/* The Color tool: the measured film base, and where it was taken from. */
.base-row { display: flex; align-items: center; gap: 8px; }

.base-swatch {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.base-label { font-size: 12px; color: var(--secondary); }

.pick-view { cursor: crosshair; }

.pick-marker {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.6), 0 0 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.pick-marker[hidden] { display: none; }

.tool-action {
  appearance: none;
  border: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px;
  border-radius: 10px;
  background: rgba(255, 149, 0, 0.16);
  color: var(--orange);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

/* ============================ Quad / crop views ============================ */

.quad-view {
  position: relative;
  flex: 1;
  min-height: 0;
  align-self: stretch;
  touch-action: none;
  overflow: hidden;
}

.quad-image { position: absolute; display: block; }
.quad-overlay { position: absolute; inset: 0; pointer-events: none; }

.loupe {
  position: absolute;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  border: 3px solid #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
  background: #000;
}

.loupe[hidden] { display: none; }
.loupe-canvas { display: block; width: 100%; height: 100%; }

.loupe-cross {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent calc(50% - 0.5px), rgba(255, 149, 0, 0.9) calc(50% - 0.5px), rgba(255, 149, 0, 0.9) calc(50% + 0.5px), transparent calc(50% + 0.5px)) center / 32px 1px no-repeat,
    linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(255, 149, 0, 0.9) calc(50% - 0.5px), rgba(255, 149, 0, 0.9) calc(50% + 0.5px), transparent calc(50% + 0.5px)) center / 1px 32px no-repeat;
}

.loupe-target {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 1.5px solid var(--orange);
  border-radius: 50%;
}

/* ============================ Scanner ============================ */

.scanner { background: #000; overflow: hidden; }

.camera-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.camera-preview[hidden] { display: none; }

.guide-layer, .live-quad-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.focus-square {
  position: absolute;
  width: 72px;
  height: 72px;
  border: 1.5px solid var(--yellow);
  border-radius: 4px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.focus-square[hidden] { display: none; }

.capture-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease-out;
}

.scanner-chrome {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.scanner-chrome > * { pointer-events: auto; }
.scanner-chrome .spacer { flex: 1; pointer-events: none; }
.hide-with-chrome { transition: opacity 0.15s ease; }

.scanner-top {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 8px) 16px 0;
}

.frame-counter {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.top-buttons { display: flex; gap: 8px; flex: none; }

.ae-lock {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #000;
  background: var(--yellow);
  border-radius: 999px;
  padding: 4px 10px;
}

.bubble-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-bottom: 4px;
}

.bubble {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bubble-inner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.bubble-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--yellow);
  transition: transform 0.1s linear;
}

.bubble-dot.centered { background: var(--green); }

.bubble-caption {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 3px 8px;
}

.zoom-presets {
  display: flex;
  gap: 8px;
  padding: 5px;
  margin-bottom: 4px;
  border-radius: 999px;
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.zoom-button {
  appearance: none;
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.zoom-button.on { background: rgba(0, 0, 0, 0.45); color: var(--orange); }

.exposure-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 48px);
  margin-bottom: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.ev-value { width: 40px; font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }

.coach-line {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  margin-bottom: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--material);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  font-size: 15px;
  font-weight: 500;
}

.steady-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--red);
}

.steady-dot.steady { background: var(--green); }

.scanner-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px calc(24px + var(--safe-bottom));
}

.shutter {
  appearance: none;
  border: 0;
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 50%;
  background: none;
  box-shadow: inset 0 0 0 4px #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.shutter:disabled { opacity: 0.5; }

.shutter-inner {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #fff;
  transition: background 0.1s ease;
}

.shutter.busy .shutter-inner { background: #8e8e93; }

.roll-strip {
  width: 96px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.strip-thumb {
  appearance: none;
  border: 0;
  padding: 0;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #262626;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.strip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip-caption { font-size: 11px; color: var(--secondary); }

.strip-count {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
}

.strip-empty { width: 56px; height: 56px; }

.bottom-right {
  width: 96px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.bottom-right-row { display: flex; gap: 8px; }

.auto-toggle {
  appearance: none;
  border: 0;
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(255, 149, 0, 0.16);
  color: var(--orange);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auto-toggle.on { background: var(--orange); color: #000; }

.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  pointer-events: none;
}

.scanner-overlay > * { pointer-events: auto; }

.permission-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  border-radius: 20px;
  background: var(--material-strong);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  text-align: center;
}

.permission-denied .icon { color: var(--yellow); }
.permission-denied h2 { margin: 0; font-size: 17px; font-weight: 600; }
.permission-denied p { margin: 0; font-size: 15px; color: var(--secondary); max-width: 30ch; }

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