/* PASHOKKIE — mobile-first, light warm-neutral, monochrome accent. */
@font-face { font-family: 'Manrope'; src: url(/fonts/manrope-latin-wght-normal.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url(/fonts/instrument-serif-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url(/fonts/instrument-serif-latin-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #F4F1EC; --bg-2: #EAE6DF; --surface: #FFFFFF;
  --ink: #151412; --ink-2: #6B675F; --ink-3: #A29D93;
  --line: rgba(21, 20, 18, .08); --line-2: rgba(21, 20, 18, .16);
  --accent: #151412; --on-accent: #F7F4EE;
  --ok: #1E8E5A; --ok-bg: #E4F2E9; --warn: #B8791C; --warn-bg: #F7EBD6; --err: #C8392B; --err-bg: #F8E4E0;
  --r-xl: 24px; --r-lg: 18px; --r-md: 14px;
  --tab-h: 62px; --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
img { display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, h4, p { margin: 0; }
h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.sub { font-size: 13px; color: var(--ink-2); }
.sub.tips { margin-top: 12px; }
.empty { font-size: 14px; color: var(--ink-2); padding: 18px 0; }
.wordmark, .cam-brand { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; }
.wordmark em, .cam-brand em { font-style: italic; }
.scroll { scrollbar-width: none; } .scroll::-webkit-scrollbar { display: none; }
::selection { background: var(--ink); color: var(--on-accent); }

/* ---------- screens ---------- */
.screen { display: none; position: fixed; inset: 0; }
.screen.on { display: flex; animation: screen-in .22s var(--ease); }
.page { flex-direction: column; background: var(--bg); }
.page.push.on { animation: push-in .28s var(--ease); }
.page-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 20px; overscroll-behavior: contain; }
.tab .page-body { padding-bottom: calc(var(--tab-h) + var(--sab) + 28px); }
#s-fit .page-body { padding-bottom: 150px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: calc(var(--sat) + 8px) 12px 8px; min-height: 52px; }
.topbar h2 { flex: 1; font-size: 17px; font-weight: 700; text-align: center; }
.topbar.big { flex-direction: column; align-items: flex-start; padding: calc(var(--sat) + 22px) 20px 14px; }
.topbar.big h2 { font: 400 34px/1.05 var(--serif); letter-spacing: -.02em; text-align: left; }
.topbar-sub { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.block { padding: 18px 0 6px; }
.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head .sub { margin-top: 2px; }
.row { display: flex; gap: 10px; margin-top: 14px; } .row > .btn { flex: 1; }
.danger-zone { padding-top: 26px; }

/* ---------- buttons, chips, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: .005em; border: 1px solid transparent; transition: transform .12s var(--ease), opacity .15s, background .15s; white-space: nowrap; }
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn-lg { height: 58px; font-size: 17px; width: 100%; }
.btn-lg small { font-size: 13px; font-weight: 600; opacity: .6; margin-left: 2px; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-glass { background: rgba(21, 20, 18, .55); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn-pill { height: 44px; padding: 0 18px; }
.btn.danger, .danger { color: var(--err); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: transform .12s var(--ease); flex: 0 0 auto; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.glass { background: rgba(21, 20, 18, .42); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.icon-btn.lg { width: 54px; height: 54px; }
.chips { display: flex; gap: 8px; }
.chips.scroll { overflow-x: auto; padding: 2px 20px 4px; margin: 0 -20px; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-weight: 600; font-size: 14px; color: var(--ink); transition: background .15s, color .15s, transform .12s var(--ease); }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip svg { width: 16px; height: 16px; }
.chip.add { border-style: dashed; color: var(--ink-2); background: transparent; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.chip.on .dot { background: #3CD37A; }
.input, .field input { width: 100%; height: 50px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 0 16px; font: 500 16px var(--font); outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
.input:focus, .field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 20, 18, .08); }
.input::placeholder, .field input::placeholder { color: var(--ink-3); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.form-err { color: var(--err); font-size: 14px; font-weight: 600; min-height: 1.3em; margin: 2px 0 12px; }
.form-msg { font-size: 14px; min-height: 1.3em; margin: 0 0 12px; color: var(--ink-2); }
.form-msg.ok { color: var(--ok); } .form-msg.err { color: var(--err); }
.status-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(21, 20, 18, .42); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.status-chip i, .gpu-text i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.status-chip.on i, .gpu-text.on i { background: #2FCF74; box-shadow: 0 0 0 3px rgba(47, 207, 116, .25); }
.status-chip.dark { background: var(--bg-2); color: var(--ink); backdrop-filter: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-weight: 700; font-size: 13px; }
.badge svg { width: 14px; height: 14px; stroke-width: 3; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.pill.run { background: var(--ok-bg); color: var(--ok); } .pill.wait { background: var(--warn-bg); color: var(--warn); } .pill.err { background: var(--err-bg); color: var(--err); }
.seg { display: flex; background: var(--bg-2); border-radius: 999px; padding: 3px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--ink-2); transition: background .15s, color .15s; }
.seg button.on { background: var(--accent); color: var(--on-accent); }

/* ---------- login ---------- */
.login { flex-direction: column; justify-content: center; padding: 0 28px calc(var(--sab) + 24px);
  background: radial-gradient(120% 80% at 50% -10%, #FFFFFF 0%, var(--bg) 60%); }
.lang-pill { position: absolute; top: calc(var(--sat) + 14px); right: 20px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-weight: 800; font-size: 12px; letter-spacing: .06em; color: var(--ink-2); }
.login-hero { margin-bottom: 40px; }
.login-hero .wordmark { font-size: 58px; line-height: 1; }
.tagline { color: var(--ink-2); font-size: 16px; margin-top: 12px; }
.login-form { width: 100%; max-width: 420px; }

/* ---------- camera ---------- */
.cam { position: fixed; inset: 0; background: #0C0C0B; color: #fff; z-index: 10; overflow: hidden; }
.cam.overlay { z-index: 30; }
#cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#cam-video.mirror { transform: scaleX(-1); }
.cam-frame { position: absolute; left: 50%; top: 50%; width: min(76vw, 60vh * .75); aspect-ratio: 3 / 4; transform: translate(-50%, -56%); pointer-events: none; opacity: .9; }
.cam.home .cam-frame { transform: translate(-50%, -50%) translateY(calc(var(--tab-h) * -.35)); }
.cam-frame i { position: absolute; width: 30px; height: 30px; border: 2.5px solid #fff; border-radius: 4px; }
.cam-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.cam-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.cam-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.cam-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(var(--sat) + 12px) 14px 14px;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent); z-index: 2; }
.cam-brand { flex: 1; font-size: 24px; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.cam.overlay .cam-brand { font-size: 18px; text-align: center; }
.cam-guide { position: absolute; left: 20px; right: 20px; top: calc(var(--sat) + 74px); text-align: center; font-size: 13px; font-weight: 600; z-index: 2; }
.cam-guide span { display: inline-block; background: rgba(21, 20, 18, .5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px 14px; border-radius: 999px; }
.cam-nolive { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 32px calc(var(--tab-h) + var(--sab) + 60px); text-align: center; z-index: 1; }
.cam-nolive p { margin-bottom: 8px; }
.cam-nolive p { color: rgba(255, 255, 255, .72); font-size: 15px; max-width: 320px; }
.big-icon { width: 44px; height: 44px; stroke-width: 1.4; color: rgba(255, 255, 255, .5); }
.cam-block { position: absolute; left: 20px; right: 20px; top: 50%; transform: translateY(-60%); z-index: 3; background: rgba(21, 20, 18, .62); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r-xl); padding: 22px; text-align: center; border: 1px solid rgba(255, 255, 255, .1); }
.cam-block b { display: block; font: 400 26px var(--serif); margin-bottom: 6px; }
.cam-block p { color: rgba(255, 255, 255, .75); font-size: 14px; margin-bottom: 16px; }
.cam-shots { position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 124px); display: flex; gap: 6px; overflow-x: auto; padding: 0 16px; z-index: 2; scrollbar-width: none; }
.cam-shots img { width: 48px; height: 64px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; border: 2px solid #fff; animation: pop .25s var(--ease); }
.set-chip { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--sab) + 122px); z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 12px; border-radius: 999px; background: rgba(21, 20, 18, .5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; font-size: 13px; font-weight: 700; }
.set-chip svg { width: 16px; height: 16px; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; padding: 24px 34px calc(var(--sab) + 22px);
  background: linear-gradient(transparent, rgba(0, 0, 0, .65)); z-index: 2; }
.cam.home .cam-bottom { padding-bottom: calc(var(--tab-h) + var(--sab) + 18px); }
.cam-bottom > * { flex: 0 0 auto; }
#cam-shutter { width: 78px; height: 78px; border-radius: 50%; background: #fff; border: 4px solid rgba(255, 255, 255, .35); background-clip: content-box; padding: 3px; transition: transform .1s; }
#cam-shutter:active { transform: scale(.9); }
#cam-done { min-width: 96px; }
#cam-done:disabled { opacity: .4; }

/* ---------- fit ---------- */
.hero { position: relative; border-radius: var(--r-xl); overflow: hidden; background: var(--bg-2); width: 100%; height: min(46vh, 480px); margin-top: 4px; }
.hero img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.hero .hero-bg { position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(28px) saturate(1.15); opacity: .55; }
.hero-retake { position: absolute; right: 12px; bottom: 12px; }
#fit-cats { padding-top: 14px; }
.strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.strip::-webkit-scrollbar { display: none; }
.strip .thumb { position: relative; flex: 0 0 auto; width: 66px; height: 88px; border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); }
.strip .thumb img { width: 100%; height: 100%; object-fit: cover; }
.strip .thumb .num { position: absolute; left: 6px; bottom: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(21, 20, 18, .7); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.strip .thumb.more { display: grid; place-items: center; font-weight: 700; color: var(--ink-2); background: transparent; border: 1px dashed var(--line-2); }
.cta-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 20px calc(var(--sab) + 16px); background: linear-gradient(to top, var(--bg) 62%, rgba(244, 241, 236, 0)); z-index: 3; }
.cta-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; padding: 0 4px; }
.cta-note::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: 0 0 auto; }
.cta-note.err::before { background: var(--err); }

/* ---------- grids / tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-2); transition: transform .12s var(--ease); }
.tile:active { transform: scale(.97); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity .15s; }
.tile.sel::after { content: ''; position: absolute; inset: 0; border-radius: var(--r-lg); box-shadow: inset 0 0 0 3px var(--accent); pointer-events: none; }
.grid.pick .tile:not(.sel) img { opacity: .5; }
.tile .tick { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .88); border: 1.5px solid rgba(21, 20, 18, .18); display: grid; place-items: center; color: transparent; }
.tile.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile .tick svg { width: 14px; height: 14px; stroke-width: 3.2; }
.tile .del { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(21, 20, 18, .55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tile .del svg { width: 14px; height: 14px; stroke-width: 2.4; }
.tile .num { position: absolute; left: 8px; bottom: 8px; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: rgba(21, 20, 18, .7); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.tile.skel { display: grid; place-items: center; color: var(--ink-3); }
.tile.skel::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); animation: shimmer 1.6s infinite; }
.tile.skel .spinner { border-color: rgba(21, 20, 18, .15); border-top-color: var(--ink-2); }
.tile.err { display: grid; place-items: center; color: var(--err); background: var(--err-bg); }
.tile.err svg { width: 22px; height: 22px; }

/* ---------- history ---------- */
.day { margin-top: 22px; }
.day h4 { font: 400 24px/1.1 var(--serif); letter-spacing: -.01em; margin-bottom: 12px; }
.tryon { margin-bottom: 20px; }
.tryon-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; width: 100%; text-align: left; }
.tryon-head img { width: 44px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--bg-2); flex: 0 0 auto; }
.tryon-meta { flex: 1; min-width: 0; }
.tryon-meta b { display: block; font-size: 15px; }
.tryon-meta span { font-size: 13px; color: var(--ink-2); }
.tryon .err-text { font-size: 13px; color: var(--err); margin-bottom: 8px; }
.empty-state { text-align: center; padding: 16vh 12px 0; }
.empty-state h3 { font: 400 32px/1.1 var(--serif); letter-spacing: -.02em; margin-bottom: 10px; }
.empty-state p { color: var(--ink-2); max-width: 300px; margin: 0 auto; }
.empty-state .btn { margin-top: 22px; }

/* ---------- profile ---------- */
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 8px; }
#set-hint { margin-bottom: 12px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; margin-top: 12px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 58px; padding: 8px 18px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; text-align: left; color: var(--ink); }
.list > :last-child { border-bottom: 0; }
.btn-row svg { width: 18px; height: 18px; color: var(--ink-3); flex: 0 0 auto; }
.btn-row:active { background: var(--bg); }
.list-form { padding: 6px 18px 18px; border-bottom: 1px solid var(--line); }
.list-form .field { margin-top: 10px; }
.gpu-text { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); }
.gpu-text.on { color: var(--ok); }

/* ---------- tabs ---------- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: calc(var(--tab-h) + var(--sab)); padding: 6px 10px var(--sab);
  background: rgba(244, 241, 236, .88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); transition: background .2s; }
#tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 800; letter-spacing: .01em; border-radius: 14px; transition: color .15s, transform .12s var(--ease); }
#tabs button svg { width: 24px; height: 24px; transition: transform .15s var(--ease); }
#tabs button:active svg { transform: scale(.9); }
#tabs button.on { color: var(--ink); }
#tabs.dark { background: rgba(12, 12, 11, .72); border-top-color: rgba(255, 255, 255, .08); }
#tabs.dark button { color: rgba(255, 255, 255, .45); }
#tabs.dark button.on { color: #fff; }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; background: #0C0C0B; color: #fff; z-index: 40; display: flex; flex-direction: column; animation: fade .2s; }
.viewer-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: calc(var(--sat) + 10px) 14px 16px; background: linear-gradient(rgba(0, 0, 0, .6), transparent); }
.segs { display: flex; gap: 4px; height: 3px; }
.segs .seg { flex: 1; border-radius: 2px; background: rgba(255, 255, 255, .28); position: relative; overflow: hidden; }
.segs .seg.done { background: rgba(255, 255, 255, .6); }
.segs .seg.cur { background: #fff; }
.segs .seg.wait::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent); animation: shimmer 1.4s infinite; }
.viewer-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.viewer-garment { width: 40px; height: 52px; border-radius: 10px; object-fit: cover; background: #222; flex: 0 0 auto; }
.viewer-title { flex: 1; min-width: 0; }
.viewer-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title span { font-size: 12px; color: rgba(255, 255, 255, .7); }
.track { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; padding: calc(var(--sat) + 92px) 0 calc(var(--sab) + 100px); }
.slide img { max-width: 100%; max-height: 100%; object-fit: contain; animation: fade .3s; }
.slide .skel { width: min(72%, 60vh * .75); aspect-ratio: 3 / 4; border-radius: 22px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 600; position: relative; overflow: hidden; text-align: center; padding: 20px; }
.slide .skel::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%); animation: shimmer 1.8s infinite; }
.slide .skel.err { color: #FF8A7A; }
.slide .skel.err svg { width: 28px; height: 28px; }
.spinner { width: 28px; height: 28px; border: 2.5px solid rgba(255, 255, 255, .22); border-top-color: #fff; border-radius: 50%; animation: spin .9s linear infinite; }
.viewer-actions { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; justify-content: space-around; padding: 18px 20px calc(var(--sab) + 16px); background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
.vbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; font-size: 12px; font-weight: 700; min-width: 72px; transition: transform .12s var(--ease), opacity .15s; }
.vbtn svg { width: 24px; height: 24px; }
.vbtn:active { transform: scale(.92); }
.vbtn:disabled { opacity: .3; }

/* ---------- sheet + toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(21, 20, 18, .45); animation: fade .2s; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg); border-radius: 26px 26px 0 0; padding: 8px 20px calc(var(--sab) + 16px); max-height: 88dvh; display: flex; flex-direction: column;
  animation: sheet-up .3s var(--ease); box-shadow: 0 -10px 40px rgba(0, 0, 0, .15); }
.sheet.closing .sheet-panel { animation: sheet-down .22s var(--ease) forwards; }
.sheet.closing .sheet-backdrop { animation: fade-out .22s forwards; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 14px; flex: 0 0 auto; }
.sheet-content { overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
.sheet h3 { font: 400 26px/1.1 var(--serif); letter-spacing: -.02em; }
.sheet .sub { margin: 4px 0 14px; }
.sheet .chips.scroll { margin: 0 -20px 14px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
.sheet-list { display: flex; flex-direction: column; gap: 6px; }
.sheet-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 15px; text-align: left; }
.sheet-list button svg { width: 20px; height: 20px; color: var(--ink-3); }
.sheet-list button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sheet-list button.on svg { color: var(--ink); }
.sheet-list button .grow { flex: 1; }
.sheet-list button small { color: var(--ink-2); font-weight: 600; }
.sheet-list .thumbs { display: flex; gap: 3px; }
.sheet-list .thumbs img { width: 22px; height: 30px; border-radius: 5px; object-fit: cover; background: var(--bg-2); }
.sheet .grid { margin-bottom: 4px; }
.sheet .field { margin-top: 12px; }
.sheet p.text { font-size: 15px; color: var(--ink-2); margin-top: 8px; }
.btn-danger { background: var(--err); color: #fff; }
#toast { position: fixed; top: calc(var(--sat) + 14px); left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--on-accent); padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; z-index: 70; max-width: 90vw; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); animation: toast-in .25s var(--ease); }

/* ---------- motion ---------- */
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes push-in { from { transform: translateX(100%); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- larger screens: keep the phone layout centred ---------- */
@media (min-width: 640px) {
  .page-body, .topbar, .cta-bar, .login-form, .login-hero { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }
  .cta-bar { left: 50%; transform: translateX(-50%); }
  #tabs { justify-content: center; } #tabs button { max-width: 150px; }
  .cam-bottom { max-width: 520px; margin: 0 auto; }
}
