[hidden] { display: none !important; }
:root {
  --bg: #0b0d17; --bg2: #11152a; --surface: #161b33; --surface2: #1d2342; --line: #2a3158;
  --fg: #eef0ff; --muted: #8e95bf; --dim: #555d8c;
  --holo: linear-gradient(135deg, #7c5cff 0%, #3fc1ff 50%, #44f0c3 100%);
  --accent: #7c5cff; --accent2: #3fc1ff;
  --ok: #3ee08f; --miss: #ffb547; --gold: #ffd45c; --danger: #ff5c7a;
  --radius: 18px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 Inter, system-ui, -apple-system, sans-serif; }
body { min-height: 100vh; background:
  radial-gradient(1200px 500px at 10% -10%, rgba(124, 92, 255, .22), transparent 60%),
  radial-gradient(900px 400px at 110% 10%, rgba(63, 193, 255, .14), transparent 60%), var(--bg); background-attachment: fixed; }
main { max-width: 860px; margin: 0 auto; padding: 0 16px calc(120px + var(--safe-b)); }
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -.02em; margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* ---------- Barra superior ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 0 10px; }
.topbar .title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.icon-btn { width: 42px; height: 42px; flex: none; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; text-decoration: none; font-size: 18px; }
.icon-btn svg { width: 20px; height: 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.pill.on .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; }
.btn.primary { border: 0; background: var(--holo); color: #0b0d17; box-shadow: 0 8px 24px -8px rgba(124, 92, 255, .7); }
.btn.ok { border: 0; background: var(--ok); color: #062615; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: rgba(255, 92, 122, .4); color: var(--danger); }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:disabled { opacity: .5; }

/* ---------- Inicio ---------- */
.hero { margin: 8px 0 22px; padding: 20px; border-radius: 24px; background: linear-gradient(160deg, var(--surface2), var(--surface));
  border: 1px solid var(--line); display: flex; gap: 18px; align-items: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: var(--holo); opacity: .08; pointer-events: none; }
.hero .big { font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1; }
.hero .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; flex: 1; }
.hero .stats span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.coll-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.coll { position: relative; display: block; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); transition: transform .15s; }
.coll:active { transform: scale(.98); }
.coll .cover { height: 130px; background-size: cover; background-position: center 30%; position: relative; }
.coll .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11,13,23,0) 30%, var(--surface) 100%); }
.coll .cover.empty { background: var(--holo); opacity: .55; }
.coll .info { display: flex; align-items: center; gap: 14px; padding: 0 16px 16px; margin-top: -34px; position: relative; z-index: 1; }
.coll h3 { font-size: 19px; }
.coll .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ring { flex: none; position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .val { position: absolute; font-family: var(--display); font-weight: 700; }
.empty-state { text-align: center; padding: 48px 20px; border: 1.5px dashed var(--line); border-radius: 24px; color: var(--muted); }
.empty-state .emoji { font-size: 48px; }

/* ---------- Colección ---------- */
.summary { display: flex; gap: 18px; align-items: center; padding: 18px; border-radius: 24px; background: var(--surface);
  border: 1px solid var(--line); margin-bottom: 14px; }
.album-desc { margin: -4px 4px 14px; color: var(--muted); font-size: 14px; line-height: 1.5; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.album-desc.open { display: block; -webkit-line-clamp: unset; }
.summary .chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; flex: 1; }
.chip-stat { padding: 10px; border-radius: 14px; background: var(--bg2); text-align: center; }
.chip-stat b { display: block; font-family: var(--display); font-size: 22px; }
.chip-stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chip-stat.ok b { color: var(--ok); } .chip-stat.miss b { color: var(--miss); } .chip-stat.gold b { color: var(--gold); }
.toolbar { position: sticky; top: 0; z-index: 5; margin: 0 -16px 6px; padding: 10px 16px; background: rgba(11, 13, 23, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.search { display: flex; gap: 8px; }
.search input { flex: 1; }
.seg { display: flex; gap: 4px; padding: 4px; margin-top: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.seg button, .seg a { flex: 1; text-align: center; text-decoration: none; white-space: nowrap; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button.on, .seg a.on { background: var(--surface2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.seg button small { opacity: .7; margin-left: 4px; }
.quick { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { left: 21px; background: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.tile { position: relative; aspect-ratio: 63 / 88; border-radius: 12px; cursor: pointer; overflow: hidden; border: 0; padding: 0;
  background: var(--surface); transition: transform .12s; text-align: left; }
.tile:active { transform: scale(.95); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .8s ease; }
.tile.missing img, img.gray { filter: grayscale(1) brightness(.62) contrast(1.05); }
.tile.missing:has(img) { background: var(--bg2); }
.tile.owned.pop img { animation: colorize 1.1s ease; }
@keyframes colorize { from { filter: grayscale(1) brightness(.62); } to { filter: none; } }
.tile .art { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 22px; }
.tile.owned .art { background: var(--holo); color: rgba(11,13,23,.75); }
.tile.owned { box-shadow: 0 0 0 1.5px rgba(124, 92, 255, .6), 0 6px 18px -8px rgba(63, 193, 255, .6); }
.tile.missing { background: repeating-linear-gradient(135deg, var(--bg2) 0 8px, #0e1224 8px 16px); box-shadow: inset 0 0 0 1.5px var(--line); }
.tile.missing .art { color: var(--dim); }
.tile .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 7px 6px; font-size: 11px; line-height: 1.2;
  background: linear-gradient(transparent, rgba(5, 6, 14, .92)); }
.tile .label b { display: block; font-family: var(--display); font-size: 13px; }
.tile .label span { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.missing .label { background: none; }
.tile.missing .num { color: var(--muted); }
.tile .num { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 8px; font-family: var(--display); font-weight: 700; font-size: 12px;
  background: rgba(5, 6, 14, .82); color: var(--fg); backdrop-filter: blur(4px); }
.tile .badge { position: absolute; top: 6px; right: 6px; min-width: 24px; padding: 2px 7px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: var(--gold); color: #2b2000; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.tile .check { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: #062615;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.tile.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.08); } }

/* ---------- Botón de escanear ---------- */
.fab { position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 16px 28px; border-radius: 99px; border: 0; background: var(--holo); color: #0b0d17; font-family: var(--display); font-weight: 700;
  font-size: 18px; cursor: pointer; box-shadow: 0 12px 40px -6px rgba(124, 92, 255, .8), 0 0 0 6px rgba(11, 13, 23, .7); }
.fab svg { width: 24px; height: 24px; }

/* ---------- Hojas inferiores ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(4, 5, 12, .7); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 26px 26px 0 0; padding: 10px 20px calc(24px + var(--safe-b)); animation: up .25s cubic-bezier(.2, .9, .3, 1.1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-size: 22px; margin-bottom: 4px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, textarea { font: inherit; width: 100%; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); outline: none; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .25); }
textarea { resize: vertical; }
.hint { font-size: 12px; color: var(--dim); font-weight: 400; }

.detail-img { display: block; width: 62%; max-width: 260px; margin: 6px auto 14px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 16px;
  box-shadow: 0 20px 50px -14px rgba(124, 92, 255, .6); }
.detail-ph { width: 62%; max-width: 260px; margin: 6px auto 14px; aspect-ratio: 63 / 88; border-radius: 16px; display: grid; place-items: center;
  font-family: var(--display); font-size: 40px; font-weight: 700; }
.detail-ph.owned { background: var(--holo); color: rgba(11,13,23,.7); }
.detail-ph.missing { background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--bg2) 10px 20px); border: 1.5px dashed var(--line); color: var(--dim); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 8px; border-radius: 18px; background: var(--surface); }
.stepper button { width: 52px; height: 52px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface2); font-size: 24px; cursor: pointer; }
.stepper .n { font-family: var(--display); font-size: 34px; font-weight: 700; min-width: 50px; text-align: center; }
.stepper .n small { display: block; font-size: 11px; color: var(--muted); font-family: Inter, sans-serif; font-weight: 500; }

/* ---------- Resultado del escaneo ---------- */
.verdict { text-align: center; padding: 6px 0 4px; }
.verdict .icon { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 12px; font-size: 36px; }
.verdict h2 { font-size: 30px; }
.verdict.owned .icon { background: rgba(62, 224, 143, .15); box-shadow: 0 0 40px rgba(62, 224, 143, .45); }
.verdict.owned h2 { color: var(--ok); }
.verdict.missing .icon { background: rgba(255, 181, 71, .15); box-shadow: 0 0 40px rgba(255, 181, 71, .45); }
.verdict.missing h2 { color: var(--miss); }
.verdict.unknown .icon, .verdict.not_in_catalog .icon, .verdict.choose .icon { background: var(--surface); }
.compare { display: flex; gap: 12px; justify-content: center; margin: 16px 0; }
.compare figure { margin: 0; width: 46%; max-width: 180px; text-align: center; font-size: 12px; color: var(--muted); }
.compare img, .compare .ph { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 12px; display: grid; place-items: center; background: var(--surface); }
.read { text-align: center; font-size: 14px; color: var(--muted); }
.read b { color: var(--fg); font-family: var(--display); font-size: 18px; }
.conf { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface); margin-left: 6px; }
.scanning { text-align: center; padding: 40px 0 30px; }
.scanning .beam { width: 140px; height: 196px; margin: 0 auto 18px; border-radius: 14px; border: 2px solid var(--accent2); position: relative; overflow: hidden;
  background-size: cover; background-position: center; }
.scanning .beam::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--accent2); box-shadow: 0 0 16px var(--accent2); animation: beam 1.4s ease-in-out infinite; }
@keyframes beam { 0%, 100% { top: 4%; } 50% { top: 94%; } }

/* ---------- Nueva colección ---------- */
.step { padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.step-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-h .num { width: 28px; height: 28px; border-radius: 50%; background: var(--holo); color: #0b0d17; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.step-h h3 { font-size: 17px; }
.drop { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; border: 1.5px dashed var(--line); cursor: pointer; background: var(--bg2); }
.drop .thumb { width: 64px; height: 88px; border-radius: 10px; background: var(--surface2) center/cover; display: grid; place-items: center; font-size: 24px; flex: none; }
.preview-list { font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 12px; background: var(--bg2); }
.preview-list b { color: var(--fg); }

#toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 99px;
  background: var(--fg); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: up .2s; white-space: nowrap; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; }
  .overlay { align-items: center; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--line); }
}

/* ---- Zona del número ---- */
.zone-editor { position: relative; max-width: 360px; margin: 0 auto; border-radius: 14px; overflow: hidden; touch-action: none; user-select: none; cursor: crosshair; box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.zone-editor img { display: block; width: 100%; pointer-events: none; }
.zone-box, .zone-thumb span { position: absolute; border: 2px solid #44f0c3; background: rgba(68, 240, 195, .18); box-shadow: 0 0 0 9999px rgba(5, 8, 20, .45); border-radius: 4px; pointer-events: none; }
.example-row { display: flex; gap: 14px; align-items: flex-start; }
.zone-thumb { position: relative; flex: 0 0 96px; border-radius: 10px; overflow: hidden; display: block; }
.zone-thumb img { display: block; width: 100%; }
.zone-thumb span { border-width: 1.5px; }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; margin-top: 12px; }
.cand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 12px; border: 1px solid var(--line, #2a3158); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.cand img, .cand .ph { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 8px; }
.cand .ph { display: grid; place-items: center; background: #1a2040; font-weight: 800; font-size: 20px; }
.cand small { color: var(--muted); font-size: 11px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cand:active { transform: scale(.97); }

/* ---- Acceso ---- */
.auth { max-width: 380px; margin: 9vh auto 0; text-align: center; }
.auth .logo { display: block; width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 22px; box-shadow: 0 0 60px rgba(124, 92, 255, .45); }
.top-logo { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; }
.empty-logo { width: 88px; height: 88px; border-radius: 20px; box-shadow: 0 0 40px rgba(124, 92, 255, .35); }
.auth h1 { font-size: 34px; margin: 4px 0 6px; }
.auth p { margin: 0 0 22px; }
.icon-btn.avatar, .avatar { font-family: var(--display); font-weight: 700; color: #0b0d17; background: var(--holo); border: 0; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 17px; }

/* ---- Administración ---- */
.admin-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.admin-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.admin-row.flat { background: transparent; border: 0; padding: 8px 0; cursor: default; }
.admin-row .grow, .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-row .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-sm { width: 46px; height: 64px; flex: none; border-radius: 8px; background: var(--surface2) center / cover; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; margin-left: 4px; border-radius: 99px; background: rgba(124, 92, 255, .2); color: #b9a8ff; vertical-align: middle; }
.tag.off { background: rgba(255, 92, 122, .15); color: var(--danger); }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.check-row input { width: 20px; height: 20px; padding: 0; flex: none; accent-color: var(--accent); }
.panel { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.panel h3 { margin: 0 0 6px; }
.panel p { margin: 0 0 12px; font-size: 14px; }
.panel .ver { font-family: var(--display); font-size: 40px; font-weight: 700; background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.warn { color: var(--miss); font-size: 13px; margin: 10px 0 0; }
code { font-size: 12px; padding: 1px 5px; border-radius: 6px; background: var(--bg2); }
.pkg { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.notes { font-size: 13px; color: var(--muted); white-space: pre-line; line-height: 1.5; }
.notes b { color: var(--fg); }
.backup { display: block; font-size: 13px; padding: 6px 0; color: var(--accent2); word-break: break-all; }
.log { font-size: 13px; padding: 5px 0; border-top: 1px solid var(--line); }
.spinner { width: 54px; height: 54px; margin: 10px auto 18px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent2); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tag.ok { background: rgba(62, 224, 143, .15); color: var(--ok); }
.tag.warn { background: rgba(255, 181, 71, .15); color: var(--miss); }
.ok-msg { color: var(--ok); font-size: 14px; margin: 8px 0 0; }
.seg { scrollbar-width: none; }
.fab-group { position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 12px; }
.fab-group .fab { position: static; transform: none; }
.fab.mini { padding: 15px; background: var(--surface2); color: var(--fg); border: 1px solid var(--line); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side { display: flex; flex-direction: column; gap: 8px; }
.side img, .side-ph { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 10px; display: block; }
.side-ph { display: grid; place-items: center; border: 1px dashed var(--line); color: var(--dim); font-size: 13px; }
.side-pick { display: flex; flex-direction: column; gap: 2px; }
.side-pick .seg { margin-top: 4px; }
.field .tag { align-self: flex-start; }

/* ---- Cámara con marco ---- */
.cam { position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden; touch-action: none; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.cam-frame { position: absolute; border-radius: 4.5% / 3.2%; box-shadow: 0 0 0 200vmax rgba(5, 7, 15, .45); pointer-events: none;
  transition: box-shadow .2s; }
.cam-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid rgba(255, 255, 255, .7); transition: border-color .2s; }
.cam-frame i:nth-child(1) { left: -4px; top: -4px; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.cam-frame i:nth-child(2) { right: -4px; top: -4px; border-left: 0; border-bottom: 0; border-top-right-radius: 16px; }
.cam-frame i:nth-child(3) { left: -4px; bottom: -4px; border-right: 0; border-top: 0; border-bottom-left-radius: 16px; }
.cam-frame i:nth-child(4) { right: -4px; bottom: -4px; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }
.cam-frame.ok i { border-color: var(--ok); }
.cam-top, .cam-hint, .cam-bottom { z-index: 2; }
.cam-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px; color: #fff; }
.cam-top b { flex: 1; text-align: center; font-family: var(--display); font-size: 17px; }
.cam-hint { position: absolute; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); bottom: calc(var(--safe-b) + 128px); text-align: center; color: #fff;
  background: rgba(5, 7, 15, .55); padding: 8px 16px; border-radius: 999px; white-space: nowrap; font-size: 16px;
  font-weight: 600; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-around;
  padding: 18px 24px calc(var(--safe-b) + 22px); }
.cam-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .16); color: #fff; font: 600 13px/1 Inter, sans-serif; backdrop-filter: blur(6px); }
.cam-btn svg { width: 22px; height: 22px; }
.cam-btn.on { background: #fff; color: #0b0d17; }
.cam-btn[hidden] { display: none; }
.cam-shutter { position: relative; width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, .25); cursor: pointer; }
.cam-shutter span { position: absolute; inset: -9px; border-radius: 50%; --p: 0; pointer-events: none;
  background: conic-gradient(var(--ok) calc(var(--p) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 41px, #000 42px); mask: radial-gradient(circle, transparent 41px, #000 42px); }
.cam-shutter:active { transform: scale(.94); background: #fff; }
.cam.busy .cam-shutter { opacity: .5; }
.cam.flash::after { content: ""; position: absolute; inset: 0; z-index: 3; background: #fff; animation: camflash .35s ease-out forwards; }
@keyframes camflash { from { opacity: .9; } to { opacity: 0; } }
.side-btns { display: flex; gap: 8px; justify-content: center; }
.side > small { text-align: center; }
.side-btns .btn svg { width: 18px; height: 18px; }
.from-album { text-align: center; margin: 4px 0 -4px; color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.from-album b { color: var(--fg); }
