/* Parts Lister — mobile-first dark UI. Tokens follow the redesign handoff. */
:root{
  --bg:#0E1116; --bar:#12161C; --surface:#171B22; --surface-2:#1E232B; --thumb:#232934;
  --border:#262C36; --divider:#222832;
  --text:#E8EAED; --text-2:#C9D0D8; --muted:#9AA3AE; --faint:#6B7480;
  --accent:#F5B83D; --accent-hover:#FFD27A; --on-accent:#1A1300;
  --draft-bg:#2A2F38;   --draft-fg:#C9D0D8;
  --ready-bg:#13263D;   --ready-fg:#8CC4FF;
  --listed-bg:#12301F;  --listed-fg:#6EE7A0;
  --sold-bg:#33270E;    --sold-fg:#F5C866;
  --problem-bg:#3A1A1D; --problem-fg:#FF9E9E; --problem-border:#5C2A2E; --required:#FFB4A8; --required-border:#8A4A44;
  --r-sm:10px; --r:12px; --r-md:14px; --r-lg:16px; --r-xl:20px;
  --font:Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --safe-b:env(safe-area-inset-bottom, 0px);
  --safe-t:env(safe-area-inset-top, 0px);
  color-scheme:dark;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%}
body{min-height:100dvh}
a{color:var(--accent)} a:hover{color:var(--accent-hover)}
button{font:inherit;color:inherit;cursor:pointer}
button:disabled{opacity:.55;cursor:default}
input,select,textarea{font:inherit}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.mono{font-family:var(--mono)}
.muted{color:var(--muted)}
.small{font-size:13px}
svg{flex-shrink:0}
[hidden]{display:none !important}

.app{max-width:480px;margin:0 auto;min-height:100dvh;position:relative;padding-top:var(--safe-t)}
.screen{display:flex;flex-direction:column;min-height:100dvh}

/* Header */
.header{padding:20px 20px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.eyebrow{font-size:13px;color:var(--muted);font-weight:500}
.h1{margin:0;font-size:28px;font-weight:700;letter-spacing:-.02em}
.h-title{font-size:17px;font-weight:700;margin:0}
.icon-btn{width:44px;height:44px;border-radius:var(--r);border:1px solid var(--border);background:var(--surface);color:var(--text);display:inline-flex;align-items:center;justify-content:center;text-decoration:none;flex-shrink:0}

/* Search */
.search{margin:0 20px 12px;display:flex;align-items:center;gap:10px;height:52px;padding:0 6px 0 14px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--border)}
.search input{flex:1;min-width:0;background:transparent;border:0;outline:none;color:var(--text);font-size:16px}
.search input::placeholder{color:var(--faint)}
.scan-btn{width:40px;height:40px;border-radius:var(--r-sm);border:0;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center}

/* Chips */
.chips{display:flex;gap:8px;padding:0 20px 14px;overflow-x:auto;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex-shrink:0;height:40px;padding:0 14px;border-radius:999px;font-weight:600;font-size:14px;border:1px solid var(--border);background:var(--surface);color:var(--text)}
.chip .n{opacity:.75;font-weight:500;margin-left:2px}
.chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}

/* Banners */
.alert{margin:0 20px 14px;padding:12px 14px;border-radius:var(--r-md);background:#2A1517;border:1px solid var(--problem-border);display:flex;align-items:center;gap:12px;text-decoration:none;color:#FFD6D6}
.alert span{flex:1;font-size:14px;line-height:1.35}
.alert b{font-size:14px;color:var(--problem-fg)}
.info{margin:0 20px 14px;padding:12px 14px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--border);display:flex;align-items:center;gap:12px;font-size:14px;line-height:1.35;color:var(--text-2)}
.info .btn-sm{margin-left:auto;padding:0 12px;height:36px}

/* List */
.list{display:flex;flex-direction:column;gap:10px;padding:0 20px calc(120px + var(--safe-b))}
.card{display:flex;gap:12px;align-items:center;padding:10px;border-radius:var(--r-lg);background:var(--surface);border:1px solid var(--divider);text-decoration:none;color:var(--text)}
.card:hover{color:var(--text)}
.thumb{width:68px;height:68px;border-radius:var(--r);background:var(--thumb);display:flex;align-items:center;justify-content:center;color:#5E6875;flex-shrink:0;overflow:hidden}
.thumb img{width:100%;height:100%;object-fit:cover}
.card-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.card-title{font-size:15px;font-weight:600;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.meta{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--muted);min-width:0;overflow:hidden;white-space:nowrap}
.sku{font-family:var(--mono);background:var(--thumb);color:var(--text-2);padding:2px 6px;border-radius:6px}
.row-between{display:flex;justify-content:space-between;align-items:center;gap:10px}
.price{font-size:15px;font-weight:700}
.pill{font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;white-space:nowrap}
.pill.draft{background:var(--draft-bg);color:var(--draft-fg)}
.pill.ready{background:var(--ready-bg);color:var(--ready-fg)}
.pill.listed{background:var(--listed-bg);color:var(--listed-fg)}
.pill.sold{background:var(--sold-bg);color:var(--sold-fg)}
.pill.problem{background:var(--problem-bg);color:var(--problem-fg)}
.empty{padding:40px 20px;text-align:center;color:var(--muted);font-size:15px;line-height:1.5}

/* Tab bar */
.tabbar{position:fixed;left:50%;transform:translateX(-50%);bottom:0;width:100%;max-width:480px;height:calc(92px + var(--safe-b));padding:0 28px calc(18px + var(--safe-b));background:var(--bar);border-top:1px solid var(--divider);display:flex;align-items:center;justify-content:space-between;z-index:10}
.tab{width:84px;display:flex;flex-direction:column;align-items:center;gap:4px;color:var(--muted);text-decoration:none;font-size:12px;font-weight:500}
.tab:hover{color:var(--text)}
.tab[aria-current="page"]{color:var(--accent);font-weight:600}
.fab{width:68px;height:68px;margin-top:-30px;border-radius:22px;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(245,184,61,.28);text-decoration:none}
.fab:hover{color:var(--on-accent)}

/* Segmented */
.segmented{margin:0 20px 14px;padding:4px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--border);display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
.segmented button{height:44px;border-radius:var(--r-sm);border:0;background:transparent;color:var(--text-2);font-weight:600;font-size:14px}
.segmented button[aria-selected="true"]{background:var(--accent);color:var(--on-accent)}

/* Camera */
.viewfinder{margin:0 20px;height:min(400px,46dvh);border-radius:22px;background:radial-gradient(circle at 50% 45%,#1A2029 0%,#05070A 70%);border:1px solid var(--divider);position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden}
.viewfinder video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.frame{position:relative;width:260px;height:260px;max-width:80%;max-height:80%;border-radius:16px;transition:all .2s;pointer-events:none}
.frame.barcode{width:280px;height:140px}
.frame i{position:absolute;width:28px;height:28px;border:0 solid var(--accent)}
.frame i:nth-child(1){left:-2px;top:-2px;border-left-width:4px;border-top-width:4px;border-top-left-radius:14px}
.frame i:nth-child(2){right:-2px;top:-2px;border-right-width:4px;border-top-width:4px;border-top-right-radius:14px}
.frame i:nth-child(3){left:-2px;bottom:-2px;border-left-width:4px;border-bottom-width:4px;border-bottom-left-radius:14px}
.frame i:nth-child(4){right:-2px;bottom:-2px;border-right-width:4px;border-bottom-width:4px;border-bottom-right-radius:14px}
.laser{display:none;position:absolute;left:12px;right:12px;top:50%;height:2px;background:#FF6B6B;box-shadow:0 0 10px #FF6B6B;animation:scan 1.6s ease-in-out infinite alternate}
.frame.barcode .laser{display:block}
@keyframes scan{from{top:25%}to{top:75%}}
@media (prefers-reduced-motion:reduce){.laser{animation:none}}
.vf-hint{position:absolute;bottom:16px;left:12px;right:12px;text-align:center;font-size:14px;color:var(--text-2);text-shadow:0 1px 3px #000}
.vf-msg{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;text-align:center;color:var(--text-2);font-size:14px;line-height:1.5}
.flash{position:absolute;top:14px;right:14px;width:44px;height:44px;border-radius:999px;border:0;background:rgba(23,27,34,.85);color:var(--text);display:flex;align-items:center;justify-content:center}
.flash[aria-pressed="true"]{background:var(--accent);color:var(--on-accent)}
.snap{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none;transition:opacity .25s}
.snap.on{opacity:.6;transition:none}
.shutter-row{padding:18px 20px 0;display:flex;align-items:center;justify-content:space-between}
.shutter{width:78px;height:78px;border-radius:999px;border:4px solid var(--text);background:transparent;padding:4px}
.shutter span{display:block;width:100%;height:100%;border-radius:999px;background:var(--accent);transition:transform .08s}
.shutter:active span{transform:scale(.9)}

/* Capture tray */
.tray{margin-top:auto;padding:16px 20px calc(24px + var(--safe-b));display:flex;flex-direction:column;gap:14px;border-top:1px solid #1C212A;background:var(--bar)}
.label{font-size:13px;font-weight:600;color:var(--muted)}
.shots{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding-top:2px}
.shots::-webkit-scrollbar{display:none}
.shot{width:60px;height:60px;border-radius:var(--r);background:var(--thumb);border:1px solid var(--border);position:relative;display:flex;align-items:center;justify-content:center;color:#5E6875;flex-shrink:0;overflow:hidden;padding:0}
.shot img{width:100%;height:100%;object-fit:cover}
.shot.main{border:2px solid var(--accent)}
.shot em{position:absolute;left:4px;bottom:4px;font-style:normal;font-size:10px;font-weight:700;color:var(--on-accent);background:var(--accent);border-radius:4px;padding:0 4px}
.shot-add{width:60px;height:60px;border-radius:var(--r);border:1.5px dashed #3A424F;background:transparent;color:var(--muted);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.tray-row{display:grid;grid-template-columns:1fr 96px;gap:8px}
.tray-btns{display:grid;grid-template-columns:1fr 1.6fr;gap:10px}

/* Buttons */
.btn{height:56px;padding:0 16px;border-radius:var(--r-lg);font-size:16px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;border:1px solid var(--border);background:var(--surface);color:var(--text);text-align:center}
.btn:hover{color:var(--text)}
.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:700;font-size:17px}
.btn-primary:hover{color:var(--on-accent)}
.btn-sm{height:44px;border-radius:var(--r);font-size:14px;background:var(--surface-2)}
.btn-danger{color:var(--problem-fg)}
.btn-danger:hover{color:var(--problem-fg)}
.btn-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}

/* Forms */
.form{padding:18px 20px calc(140px + var(--safe-b));display:flex;flex-direction:column;gap:16px}
.field{display:flex;flex-direction:column;gap:7px;min-width:0}
.field-head{display:flex;justify-content:space-between;gap:8px}
.input,select.input,textarea.input{height:52px;width:100%;min-width:0;padding:0 14px;border-radius:var(--r);background:var(--surface);border:1px solid var(--border);color:var(--text);font-size:16px;outline:none;appearance:none;-webkit-appearance:none}
select.input{background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 20px) 50%,calc(100% - 14px) 50%;background-size:6px 6px;background-repeat:no-repeat;padding-right:34px}
textarea.input{height:auto;min-height:110px;padding:12px 14px;line-height:1.45;resize:vertical}
.input:focus,.input-wrap:focus-within{border-color:var(--accent)}
.input::placeholder,.input-wrap input::placeholder,textarea::placeholder{color:var(--faint)}
.input.lg{height:56px;font-size:17px;border-radius:var(--r-md)}
.required .label{color:var(--required)}
.required .input,.required .input-wrap,.required .catbox{border-color:var(--required-border)}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.input-wrap{height:52px;padding:0 14px;border-radius:var(--r);background:var(--surface);border:1px solid var(--border);display:flex;align-items:center;gap:4px}
.input-wrap input{flex:1;min-width:0;background:transparent;border:0;color:var(--text);font-size:17px;font-weight:600;outline:none}
.radios{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.radios button{min-height:48px;padding:4px 6px;border-radius:var(--r);border:1px solid var(--border);background:var(--surface);color:var(--text-2);font-weight:600;font-size:13px;line-height:1.2}
.radios button[aria-checked="true"]{border-color:var(--accent);background:var(--sold-bg);color:var(--sold-fg)}
.stepper{height:52px;border-radius:var(--r);background:var(--surface);border:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 4px}
.stepper button{width:44px;height:44px;border-radius:var(--r-sm);border:0;background:var(--thumb);font-size:20px}
.stepper output{font-size:17px;font-weight:700}
details.more{border-radius:var(--r);background:var(--surface);border:1px solid var(--border);padding:0 14px}
details.more > summary{min-height:52px;display:flex;align-items:center;justify-content:space-between;font-size:15px;font-weight:600;cursor:pointer;list-style:none}
details.more > summary::-webkit-details-marker{display:none}
details.more > summary::after{content:'+';font-size:20px;color:var(--muted)}
details.more[open] > summary::after{content:'−'}
details.more .inner{display:flex;flex-direction:column;gap:14px;padding-bottom:14px}
details.more .input{background:var(--bg)}
.hint{font-size:13px;color:var(--muted);line-height:1.45;margin:0}
.section-title{font-size:13px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:6px 0 -4px}

/* Item */
.hero{margin:0 20px;height:300px;border-radius:var(--r-xl);background:var(--surface);border:1px solid var(--divider);position:relative;overflow:hidden;color:#4A5360}
.hero .slides{display:flex;height:100%;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none}
.hero .slides::-webkit-scrollbar{display:none}
.hero .slides img{flex:0 0 100%;width:100%;height:100%;object-fit:contain;scroll-snap-align:center;background:#0A0D11}
.hero .placeholder{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;color:var(--muted);font-size:14px}
.hero .badge{position:absolute;top:12px;left:12px;font-size:12px;font-weight:600;padding:4px 9px;border-radius:8px;background:rgba(14,17,22,.85);color:var(--text)}
.hero .add-photos{position:absolute;top:8px;right:8px;height:40px;padding:0 12px;border-radius:var(--r-sm);border:0;background:rgba(14,17,22,.85);color:var(--text);font-size:13px;font-weight:600;display:flex;align-items:center;gap:6px}
.hero .photo-acts{position:absolute;bottom:10px;right:10px;display:flex;gap:6px}
.hero .photo-acts button{height:36px;padding:0 10px;border-radius:var(--r-sm);border:0;background:rgba(14,17,22,.85);color:var(--text);font-size:12px;font-weight:600;display:flex;align-items:center;gap:4px}
.dots{position:absolute;bottom:14px;left:0;right:0;display:flex;justify-content:center;gap:6px;pointer-events:none}
.dots span{width:6px;height:6px;border-radius:3px;background:#4A5360;transition:width .15s}
.dots span.on{width:20px;background:var(--accent)}
.meter{margin:14px 20px 0;padding:14px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--border);display:flex;flex-direction:column;gap:10px}
.meter .track{height:6px;border-radius:3px;background:var(--border);overflow:hidden}
.meter .fill{height:100%;background:var(--accent);border-radius:3px;transition:width .2s}
.meter.done .fill{background:var(--listed-fg)}
.box{margin:14px 20px 0;padding:14px;border-radius:var(--r-md);background:var(--surface);border:1px solid var(--border);display:flex;flex-direction:column;gap:12px}
.box.bad{background:#2A1517;border-color:var(--problem-border);color:#FFD6D6;font-size:14px;line-height:1.45}
.box.good{background:var(--listed-bg);border-color:#1F4A31;color:var(--listed-fg);font-size:14px}
.box.good a{color:var(--listed-fg);font-weight:700}
.ai{font-size:14px;line-height:1.45;color:var(--text-2)}
.ai b{color:var(--text)}
.ai ul{margin:6px 0 0;padding-left:18px}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.stat{padding:8px;border-radius:var(--r);border:1px solid var(--border);background:var(--surface-2);text-align:left;color:var(--text)}
.stat span{display:block;font-size:11px;color:var(--muted);font-weight:500}
.stat b{font-size:16px}
.comps{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.comp{display:flex;gap:10px;align-items:center;font-size:13px}
.comp img{width:44px;height:44px;object-fit:cover;border-radius:8px;background:var(--thumb);flex:0 0 44px}
.comp .t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--text-2);text-decoration:none}
.catbox{border-radius:var(--r);background:var(--surface);border:1px solid var(--border);padding:12px 14px;font-size:14px;line-height:1.4}
.sugg{display:flex;flex-direction:column;gap:6px}
.sugg button{text-align:left;font-size:14px;line-height:1.35;padding:10px 12px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);color:var(--text)}
.sugg button small{color:var(--muted)}
.action-bar{position:fixed;left:50%;transform:translateX(-50%);bottom:0;width:100%;max-width:480px;padding:14px 20px calc(26px + var(--safe-b));background:var(--bar);border-top:1px solid var(--divider);display:grid;grid-template-columns:1fr 1.6fr;gap:10px;z-index:10}
.btn-primary[aria-disabled="true"]{opacity:.55}

.toast{position:fixed;left:50%;bottom:calc(110px + var(--safe-b));transform:translateX(-50%) translateY(20px);opacity:0;pointer-events:none;background:var(--text);color:var(--bg);font-weight:600;font-size:14px;line-height:1.35;padding:12px 16px;border-radius:12px;transition:all .2s;z-index:50;width:max-content;max-width:calc(100% - 40px)}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.bad{background:var(--problem-fg);color:#2A0B0D}

/* Settings */
.settings{padding:0 20px calc(120px + var(--safe-b));display:flex;flex-direction:column;gap:22px}
.panel{padding:16px;border-radius:18px;background:var(--surface);border:1px solid var(--border);display:flex;flex-direction:column;gap:14px;font-size:14px;line-height:1.45}
.ok-icon,.warn-icon{width:44px;height:44px;border-radius:var(--r);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ok-icon{background:var(--listed-bg);color:var(--listed-fg)}
.warn-icon{background:var(--sold-bg);color:var(--sold-fg)}
.h2{margin:0 4px;font-size:13px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.rows{border-radius:18px;background:var(--surface);border:1px solid var(--border);overflow:hidden}
.rowbtn{position:relative;width:100%;min-height:56px;padding:0 16px;border:0;border-bottom:1px solid var(--divider);background:transparent;color:var(--text);display:flex;align-items:center;gap:12px;font-size:15px;font-weight:500;text-align:left;text-decoration:none}
.rowbtn:hover{color:var(--text)}
.rowbtn:last-child{border-bottom:0}
.rowbtn .grow{flex:1;min-width:0}
.rowbtn .val{color:var(--muted);font-size:14px;max-width:55%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.rowbtn select{position:absolute;inset:0;width:100%;height:100%;opacity:0;font-size:16px;cursor:pointer}
.rowbtn input.inline{width:110px;height:40px;text-align:right;background:var(--bg);border:1px solid var(--border);border-radius:var(--r-sm);color:var(--text);font-size:16px;padding:0 10px}
.switch{position:relative;width:50px;height:30px;flex-shrink:0}
.switch input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer;z-index:1}
.switch span{position:absolute;inset:0;border-radius:999px;background:var(--thumb);transition:background .15s}
.switch span::after{content:'';position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:var(--text);transition:transform .15s}
.switch input:checked + span{background:var(--accent)}
.switch input:checked + span::after{transform:translateX(20px);background:var(--on-accent)}

/* Scanner overlay (scan to search) */
.overlay{position:fixed;inset:0;z-index:40;background:#000;display:flex;flex-direction:column}
.overlay video{flex:1;width:100%;min-height:0;object-fit:cover}
.overlay .frame{position:absolute;left:50%;top:42%;transform:translate(-50%,-50%)}
.overlay .bar{padding:16px 20px calc(16px + var(--safe-b));display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--bar);font-size:14px;color:var(--text-2)}

.spin{display:inline-block;width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .8s linear infinite;vertical-align:-3px}
@keyframes spin{to{transform:rotate(360deg)}}

/* Labels (print) */
.labels{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;padding:0 20px calc(40px + var(--safe-b))}
.lbl{border:1px dashed var(--border);border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:4px;break-inside:avoid}
.lbl .s{font:700 22px/1 var(--mono)}
.lbl .b{font-size:12px;color:var(--muted)}
.lbl .t{font-size:12px;line-height:1.3;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
@media print{
  :root{--bg:#fff;--text:#000;--muted:#333;--border:#999}
  body{background:#fff;color:#000}
  .no-print{display:none !important}
  .app{max-width:none}
  .labels{grid-template-columns:repeat(3,1fr);padding:0}
}

/* Add screen fits one phone screen: the viewfinder takes whatever space is left,
   so "Save & next" is always visible without scrolling. */
.screen.add{height:calc(100dvh - var(--safe-t));min-height:0;overflow:hidden}
.screen.add .header{padding:12px 20px 10px}
.screen.add .segmented{margin-bottom:10px}
.screen.add #camera-ui{flex:1;min-height:0;display:flex;flex-direction:column}
.screen.add .viewfinder{flex:1;height:auto;min-height:160px}
.screen.add .shutter-row{padding:10px 20px 10px}
.screen.add .shutter{width:70px;height:70px}
.screen.add #type-ui{flex:1;min-height:0;overflow-y:auto}
.screen.add .tray{margin-top:0;padding:12px 20px calc(14px + var(--safe-b));gap:10px}
.screen.add .tray .input{height:46px}
.screen.add .tray .btn{height:52px}
.btn-primary.btn-sm{background:var(--accent);color:var(--on-accent)}
/* Short phones (iPhone SE/mini): shutter sits on top of the viewfinder, smaller thumbnails */
@media (max-height:760px){
  .screen.add #camera-ui{position:relative}
  .screen.add .viewfinder{min-height:120px}
  .screen.add .vf-hint{bottom:auto;top:12px;left:12px;right:64px;text-align:left}
  .screen.add .shutter-row{position:absolute;left:20px;right:20px;bottom:10px;padding:0 12px}
  .screen.add .shutter-row .icon-btn{background:rgba(23,27,34,.85)}
  .screen.add #shot-count{background:rgba(14,17,22,.7);border-radius:8px;padding:4px 0}
  .screen.add .shutter{width:64px;height:64px}
  .screen.add .shot,.screen.add .shot-add{width:52px;height:52px}
  .screen.add .segmented button{height:40px}
  .screen.add .header{padding:8px 20px 8px}
}

/* In-app confirm sheet */
.sheet-back{position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.55);display:flex;align-items:flex-end;justify-content:center}
.sheet{width:100%;max-width:480px;background:var(--surface);border-top:1px solid var(--border);border-radius:20px 20px 0 0;padding:20px 20px calc(20px + var(--safe-b));display:flex;flex-direction:column;gap:14px;animation:up .18s ease-out}
@keyframes up{from{transform:translateY(30px);opacity:0}}
.sheet-title{font-size:17px;font-weight:700}
.sheet-body{font-size:14px;line-height:1.45;color:var(--text-2)}
.btn-danger-fill{background:#B3261E;border-color:#B3261E;color:#fff;font-weight:700}
.btn-danger-fill:hover{color:#fff}
.price-ai{margin-top:8px;padding:10px 12px;border-radius:var(--r);background:var(--surface-2);border:1px solid var(--border)}
