/* Elliephant Nails try-on page (/ar/). Builds on css/site.css (a copy of the site styles) + css/ar-photo.css. */
.ar-page{background:var(--paper)}
.ar-top{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px var(--pad);padding-top:max(10px,env(safe-area-inset-top));background:rgba(244,239,231,.9);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid rgba(15,14,14,.1)}
.ar-brand{display:flex;align-items:center;gap:8px;min-height:48px;text-decoration:none;color:var(--ink);font:600 15px/1 var(--sans);letter-spacing:.02em}
.ar-tag{font:600 11px/1 var(--sans);letter-spacing:.2em;text-transform:uppercase;color:var(--pink)}
.ar-page .builder{padding-top:18px}
.ar-foot{padding:26px var(--pad) max(26px,env(safe-area-inset-bottom));text-align:center;font-size:13px;color:var(--muted)}

/* Ellie's original layer */
.bd-origtile{box-shadow:inset 0 0 0 1.5px rgba(224,51,107,.35)}
.bd-origtile em{background:var(--pink);color:#fff}
.bd-origchip{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 12px;padding:10px 12px;border-radius:14px;background:#fff0f5;font:500 14px/1.35 var(--sans);color:var(--pink-deep)}

/* Done: live camera extra */
.bd-live-btn{display:grid;grid-template-columns:44px 1fr;column-gap:12px;align-items:center;width:100%;min-height:72px;margin:14px 0 6px;padding:12px 14px;border:0;border-radius:18px;background:#fff;box-shadow:inset 0 0 0 1px rgba(15,14,14,.1),0 8px 20px -16px rgba(15,14,14,.5);text-align:left;color:var(--ink)}
.bd-live-btn svg{grid-row:1/3;width:40px;height:40px;padding:7px;border-radius:50%;background:#fde4ee;color:var(--pink-deep)}
.bd-live-btn b{font:600 16px/1.25 var(--sans)}
.bd-live-btn span{font:400 14px/1.35 var(--sans);color:var(--muted)}

/* live camera overlay */
.live{position:fixed;inset:0;z-index:200;display:flex;flex-direction:column;background:#0f0e0e}
.live[hidden]{display:none}
body.live-open{overflow:hidden}
.live-stage{position:relative;flex:1;min-height:0;overflow:hidden}
#liveView{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
#liveView.mirror{transform:scaleX(-1)}
.cam-src{position:absolute;width:2px;height:2px;opacity:0;pointer-events:none;left:0;top:0}
.live-status{position:absolute;left:50%;top:max(14px,env(safe-area-inset-top));transform:translateX(-50%);max-width:calc(100% - 28px);padding:9px 15px;border-radius:999px;background:rgba(15,14,14,.72);color:#fff;font:500 14px/1.35 var(--sans);text-align:center;white-space:pre-line;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.live-status:empty{display:none}
.live-err{position:absolute;left:14px;right:14px;bottom:20px;padding:16px;border-radius:16px;background:rgba(251,250,247,.97)}
.live-err p{margin:0 0 6px}
.live-err-t{font:600 15px/1.3 var(--sans)}
.live-err-m{font:12.5px/1.4 ui-monospace,monospace;color:var(--muted);word-break:break-word}
.live-hud{position:absolute;left:10px;bottom:10px;padding:6px 8px;border-radius:8px;background:rgba(0,0,0,.55);color:#9fe;font:11px/1.35 ui-monospace,monospace;white-space:pre}
.live-bar{display:flex;align-items:center;justify-content:space-around;padding:14px 18px max(18px,env(safe-area-inset-bottom));background:#0f0e0e}
.live-round{display:grid;place-items:center;width:52px;height:52px;border-radius:50%;border:0;background:rgba(255,255,255,.16);color:#fff;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.live-shutter{width:72px;height:72px;border-radius:50%;border:4px solid #fff;background:transparent;padding:4px}
.live-shutter span{display:block;width:100%;height:100%;border-radius:50%;background:#fff}

/* photo preview: bigger, cropped to the hand */
.bd-photo-mode .bd-photo{height:min(31svh,300px)!important}
.bd-one.bd-photo-mode .bd-photo{height:min(26svh,250px)!important}
.bd-photo canvas{border-radius:18px}

/* layout fixes: the preview sticks right under the page header (no overlap), and the photo never spills over the controls */
.ar-page{--ar-top:calc(58px + env(safe-area-inset-top))}
.ar-top{box-sizing:border-box;height:var(--ar-top);padding-top:calc(5px + env(safe-area-inset-top));padding-bottom:5px}
.ar-page .builder:not([data-step="intro"]) .bd-stage{top:var(--ar-top)!important}
.ar-page .builder[data-step="intro"] .bd-stage{top:auto!important}
.bd-photo-mode .bd-photo{display:flex!important;align-items:center;justify-content:center;overflow:hidden}
.bd-photo canvas{width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important}
.ar-top{background:var(--paper)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}

/* ================= hand-focus app layout (mobile, once building starts) =================
   slim header, the user's hand as the hero (about 50 to 60% of the screen, zoomed to the nails),
   compact swipe rows of options below it, Back/Next pinned at the bottom above the safe area. */
@media (max-width:899px){
  body.ar-app{overflow:hidden;height:100%}
  body.ar-app .ar-foot{display:none}
  body.ar-app{--ar-top:calc(46px + env(safe-area-inset-top))}
  body.ar-app .ar-top{height:var(--ar-top);padding-top:env(safe-area-inset-top);padding-bottom:0}
  body.ar-app .ar-brand{min-height:44px;font-size:14px}
  body.ar-app .ar-brand img{width:28px;height:24px}
  body.ar-app main{position:fixed;left:0;right:0;top:var(--ar-top);bottom:0;display:flex;flex-direction:column;overflow:hidden}
  body.ar-app .builder{flex:1;display:flex;flex-direction:column;min-height:0;padding:0!important;margin:0}
  body.ar-app .bd-head{display:none}
  body.ar-app .bd-app{flex:1;display:flex;flex-direction:column;min-height:0;padding:0}
  body.ar-app .bd-stage{position:relative!important;top:auto!important;flex:1 1 auto;min-height:0;display:flex;flex-direction:column;padding:0 10px 4px;border-radius:0;box-shadow:none}
  body.ar-app .bd-top{flex:0 0 auto;min-height:34px}
  body.ar-app .bd-top .bd-mini{min-height:34px;font-size:13px}
  body.ar-app .bd-steptitle{font-size:13px}
  body.ar-app .bd-svg,body.ar-app .bd-photo{flex:1 1 auto;min-height:0;height:auto!important}
  body.ar-app .bd-svg{display:flex;align-items:center;justify-content:center}
  body.ar-app .bd-svg svg{height:100%!important;max-height:100%!important;width:100%}
  body.ar-app.ar-noscroll .bd-photo-mode .bd-svg{display:none}
  body.ar-app .bd-photo canvas{border-radius:14px}
  /* links under the preview, never over the hand */
  body.ar-app .bd-skin,.bd-photo-mode .bd-skin{position:static!important;flex:0 0 auto;display:flex;justify-content:center;align-items:center;gap:2px 14px;flex-wrap:wrap;margin:2px 0 0}
  body.ar-app .bd-skin .bd-pill-btn{min-height:32px;padding:0 4px;background:none;box-shadow:none;font:500 13px/1 var(--sans);color:var(--pink-deep);text-decoration:underline;text-underline-offset:3px}
  body.ar-app .bd-skin-btn{min-height:32px;padding:0 10px;font-size:13px}
  body.ar-app .bd-skin-pop{bottom:40px;top:auto}
  body.ar-app .bd-mode{flex:0 0 auto;margin-top:2px;gap:2px 10px}
  body.ar-app .bd-switch{min-height:34px;font-size:13px}
  body.ar-app .bd-hint{display:none}
  body.ar-app .bd-chips{gap:4px}
  body.ar-app .bd-chip{min-height:34px;padding:0 10px;font-size:13px}
  body.ar-app .bd-progress{flex:0 0 auto;height:3px;margin-top:4px}
  body.ar-app .bd-steps{display:none}
  /* options: a compact area under the hand */
  body.ar-app .bd-flow{flex:0 0 auto;display:flex;flex-direction:column;max-height:min(44%,330px);min-height:0;background:var(--white)}
  body.ar-app .bd-panel{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 12px 6px;animation:none}
  body.ar-app .bd-h{margin:8px 0 6px;font-size:14px}
  body.ar-app .bd-p,body.ar-app .bd-note,body.ar-app .bd-privacy{font-size:13px;margin:0 0 6px}
  body.ar-app .builder:not([data-step="hand"]):not([data-step="done"]) .bd-p{display:none}
  body.ar-app .bd-tiles,body.ar-app .bd-tiles4,body.ar-app .bd-swatches{display:flex!important;flex-wrap:nowrap;gap:8px;overflow-x:auto;scroll-snap-type:x proximity;padding:2px 2px 6px;margin:0 -12px;padding-left:12px;padding-right:12px;scrollbar-width:none}
  body.ar-app .bd-tiles::-webkit-scrollbar,body.ar-app .bd-swatches::-webkit-scrollbar{display:none}
  body.ar-app .bd-tile{flex:0 0 78px;min-height:84px;padding:6px 2px;gap:4px;scroll-snap-align:start;font-size:12px}
  body.ar-app .bd-tile svg{height:44px}
  body.ar-app .bd-tile span{font-size:12px;line-height:1.15}
  body.ar-app .bd-sw{flex:0 0 auto;min-width:56px;font-size:12px}
  body.ar-app .bd-sw.big i{width:42px;height:42px}
  body.ar-app .bd-presets#bdPresets .bd-preset{flex-basis:30%}
  body.ar-app .bd-preset span{font-size:12px}
  body.ar-app .bd-or{margin:6px 0}
  body.ar-app .bd-hand-opt{min-height:64px;padding:10px 12px}
  body.ar-app .bd-quote{padding:10px 12px;font-size:14px}
  body.ar-app .bd-live-btn{min-height:56px;margin:8px 0 4px}
  body.ar-app .bd-nav{position:static;flex:0 0 auto;padding:8px 12px max(8px,env(safe-area-inset-bottom));gap:8px;box-shadow:0 -8px 16px -14px rgba(15,14,14,.35)}
  body.ar-app .bd-nav .pill{min-height:48px;font-size:15px}
  body.ar-app .bd-origchip{margin:0 0 6px;padding:6px 10px;font-size:13px}
}
body.ar-app .bd-photo-mode .bd-svg{display:none!important}
@media (max-width:899px){body.ar-app.ar-page .builder .bd-stage{top:auto!important}}
@media (max-width:899px){
  body.ar-app .bd-flow{max-height:min(37%,300px)}
  body.ar-app .bd-top{min-height:30px}
  body.ar-app .bd-top .bd-mini{min-height:30px}
  body.ar-app .bd-skin .bd-pill-btn{min-height:28px}
  body.ar-app .bd-switch{min-height:30px}
  body.ar-app .bd-chip{min-height:30px}
  body.ar-app .bd-nav{padding-top:6px}
  body.ar-app .bd-nav .pill{min-height:46px}
}
@media (max-width:899px){
  html,body.ar-app{overflow-x:hidden}
  body.ar-app main,body.ar-app .bd-flow,body.ar-app .bd-panel{overflow-x:hidden}
  body.ar-app .bd-presets#bdPresets .bd-preset{flex:0 0 120px}
  body.ar-app .bd-preset img{height:96px;width:100%;object-fit:cover}
  body.ar-app .bd-preset span{padding:6px 8px;font-size:12px;line-height:1.2}
  body.ar-app .bd-pwrap{margin:0 -12px}
  body.ar-app .bd-presets#bdPresets{padding:0 12px 4px}
  body.ar-app .bd-origchip{flex-wrap:wrap}
  body.ar-app .bd-origchip .bd-pill-btn{min-height:30px;padding:0 10px}
}
/* the canvas must never widen its flex parents (its intrinsic size is the photo size) */
.bd-photo{min-width:0;width:100%}
.bd-stage,.bd-app,.bd-flow{min-width:0}
@media (max-width:899px){body.ar-app main,body.ar-app .builder,body.ar-app .bd-app,body.ar-app .bd-stage{overflow:clip}}
@media (max-width:899px){body.ar-app .bd-app,body.ar-app .builder{width:100%;max-width:none;margin:0}}
/* no dead bands: the stage takes the hand's natural height (width-filling, capped), the options take the rest */
@media (max-width:899px){
  body.ar-app .bd-stage{flex:0 0 auto}
  body.ar-app .bd-svg{flex:0 0 auto;display:block}
  body.ar-app .bd-svg svg{width:100%!important;height:auto!important;max-height:38svh!important}
  body.ar-app .bd-photo,body.ar-app .bd-photo-mode .bd-photo{flex:0 0 auto;height:auto!important;display:flex!important;justify-content:center}
  body.ar-app .bd-photo canvas{width:100%!important;height:auto!important;max-height:56svh!important;object-fit:contain}
  body.ar-app .bd-flow{flex:1 1 auto;max-height:none}
}
.bd-photo canvas{cursor:pointer}

/* current layers on the nail: tap to remove */
.bd-layers{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px}
.bd-layer{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 12px;border:0;border-radius:999px;background:#fde4ee;color:var(--pink-deep);font:600 13px/1 var(--sans)}
.bd-layer i{font-style:normal;font-size:12px;opacity:.8}
