/* JOYBOX app — components + screens, on tokens.css.
   Adapted from the official design handoff; the prototype's device-frame
   scoping (.dev-ipad/.dev-phone) is rescoped to real viewport breakpoints. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* never let a display rule defeat the hidden attribute */
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before { /* ambient calm wash */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(50% 38% at 8% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(42% 34% at 100% 4%, rgba(122,160,214,0.07), transparent 72%);
  opacity: .8;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; width: 20px; height: 20px; flex: none; vertical-align: middle; }
/* keep icons inside pill buttons proportional unless a screen overrides */
.btn .ic { width: 18px; height: 18px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- glass (floating control layer only) ---------- */
.glass { position: relative; background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-stroke); box-shadow: var(--glass-shadow); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--glass-specular); pointer-events: none; }
.glass > * { position: relative; z-index: 1; }

/* ---------- shell ---------- */
.app-grid { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 96px 1fr; }
.app-grid.no-rail { grid-template-columns: 1fr; }  /* public storefront: no back-office rail */
.store-backlink { position: fixed; right: 22px; bottom: 22px; z-index: 45; border-radius: 999px; padding: 10px 16px;
  font-size: 13px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--glass-stroke); }
.store-backlink .ic { width: 17px; height: 17px; }
.sidebar { margin: 16px 0 16px 16px; border-radius: var(--r-xl); display: flex; flex-direction: column;
  align-items: center; padding: 14px 0; gap: 0; position: sticky; top: 16px; height: calc(100vh - 32px); }
/* the nav items slide up/down inside the rail; logo + sign-out stay pinned */
.navscroll { position: relative; flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  scroll-snap-type: y proximity;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
.navscroll::-webkit-scrollbar { width: 0; }
.navscroll.no-fade { -webkit-mask-image: none; mask-image: none; }
.sidebar .logo { margin-bottom: 12px; flex: none; }
.navlogo { display: block; margin-bottom: 12px; flex: none; }
.navlogo img { width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; display: block; box-shadow: var(--e1); }
.navbtn { width: 64px; padding: 9px 0; border: none; background: transparent; border-radius: var(--r-md);
  color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-size: 10px; font-weight: 600; transition: all .22s var(--ease-liquid); }
.navbtn svg { width: 23px; height: 23px; }
.navbtn { scroll-snap-align: center; flex: none; }
.navbtn:hover { color: var(--ink); background: var(--glass-edge); }
.navbtn.on { color: var(--accent); background: var(--accent-soft); }
.navbtn.soon { opacity: .55; }
.navdiv { width: 38px; height: 1px; background: var(--hairline); margin: 7px 0; flex: none; }
.sidebar .grow { flex: 1; }
.sidebar .logout { color: var(--ink-faint); flex: none; margin-top: 4px; }
.sidebar .logout:hover { color: var(--accent); }

/* content stage */
.stage { position: relative; min-height: 100vh; }
.screen-pad { padding: 30px 36px 56px; max-width: 1220px; }
.screen-head { margin-bottom: 22px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.screen-title { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.screen-sub { font-size: 15px; color: var(--ink-soft); margin: 6px 0 0; }
.section-label { font-size: 13px; font-weight: 600; color: var(--ink-faint); letter-spacing: .04em; text-transform: uppercase; margin: 30px 0 13px; }

/* ---------- stat tiles ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--r-md); box-shadow: var(--e1); padding: 18px 20px; }
.stat .lab { font-size: 13px; color: var(--ink-soft); font-weight: 500; margin: 0 0 8px; }
.stat .val { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat .val .cur { font-size: 20px; color: var(--ink-faint); font-weight: 600; }
.stat .delta { font-size: 12px; font-weight: 600; margin-top: 6px; }
.stat .delta.up { color: var(--success-ink); }
.stat .delta.flat { color: var(--ink-faint); }

/* ---------- item card (the soul) ---------- */
.grid-cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); }
.item-card { background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  box-shadow: var(--e2); overflow: hidden; transition: transform .26s var(--ease-liquid), box-shadow .26s var(--ease-liquid);
  text-align: left; width: 100%; padding: 0; display: block; }
.item-card:hover { transform: translateY(-3px); box-shadow: var(--e3); }
.item-card.sold { opacity: .9; }
.item-photo { aspect-ratio: 5/4; position: relative; padding: 12px; }
.ph { background: repeating-linear-gradient(135deg, rgba(43,37,48,0.025) 0 10px, transparent 10px 20px), radial-gradient(120% 120% at 30% 18%, var(--pa, #FCE7EC), var(--pb, #DCEAF4)); }
.ph-rose { --pa:#FBDCE4; --pb:#F2C7D3; } .ph-sky { --pa:#D6E7F6; --pb:#C2DAF0; }
.ph-lilac { --pa:#E7DCF4; --pb:#D6C9EC; } .ph-mint { --pa:#D7EEDF; --pb:#C4E4CF; }
.ph-butter { --pa:#F6EBC9; --pb:#EFDFB4; } .ph-coral { --pa:#FBDDD9; --pb:#F6C6C0; }
.ph-cam { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-58%); width: 42px; height: 30px; border-radius: 8px; box-shadow: inset 0 0 0 2px rgba(43,37,48,0.22); }
.ph-cam::after { content: ""; position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%); width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(43,37,48,0.22); }
.ph-label { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: rgba(43,37,48,0.38); }
.tag { position: absolute; top: 11px; left: 11px; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--glass-bg-strong); color: var(--ink-soft); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--glass-stroke); }
.stockpill { position: absolute; top: 11px; right: 11px; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.stockpill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stockpill.in { background: var(--success-soft); color: var(--success-ink); }
.stockpill.low { background: var(--warning-soft); color: var(--warning-ink); }
.stockpill.out { background: var(--surface-sunken); color: var(--ink-faint); }
.item-body { padding: 12px 14px 14px; }
.item-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.item-sub { font-size: 13px; color: var(--ink-faint); margin: 2px 0 11px; }
.figs { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.price { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.price .cur { font-size: 15px; color: var(--ink-faint); font-weight: 600; margin-right: 1px; }
.cost { font-size: 13px; color: var(--ink-soft); }
.margin { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--success-ink); background: var(--success-soft); padding: 3px 8px; border-radius: 999px; }
.item-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--hairline); }
.binchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--cat-sky-ink); background: var(--cat-sky); padding: 4px 9px; border-radius: 999px; }
.binchip .pin { width: 6px; height: 6px; border-radius: 50% 50% 50% 0; transform: rotate(45deg); background: currentColor; }
.sku { margin-left: auto; font-size: 11px; color: var(--ink-faint); }
.soldstamp { margin-left: auto; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--success-ink); }

/* ---------- list rows / panels ---------- */
.panel { background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--e1); padding: 8px; }
.row { display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: var(--r-md); }
.row + .row { border-top: 1px solid var(--hairline); }
.row .av { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: var(--on-accent); background: var(--accent); flex: none; }
.row .av.soft { background: var(--cat-lilac); color: var(--cat-lilac-ink); }
.row .rtitle { font-size: 15px; font-weight: 600; }
.row .rsub { font-size: 12.5px; color: var(--ink-faint); margin-top: 1px; }
.row .rright { margin-left: auto; text-align: right; }

/* ---------- buttons ---------- */
.btn { border: none; border-radius: 999px; font-weight: 600; font-size: 14px; padding: 10px 18px; transition: transform .18s var(--ease-liquid), background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 14px var(--accent-soft); }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost { background: var(--surface-sunken); color: var(--ink); }
.btn-outline { background: var(--surface-raised); color: var(--accent-press); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-sm { font-size: 13px; padding: 7px 13px; }

/* ---------- chips / search ---------- */
.chiprow { display: flex; gap: 9px; flex-wrap: wrap; }
.chip { border: 1px solid var(--hairline); background: var(--surface-raised); color: var(--ink-soft); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; transition: all .18s; }
.chip.on { background: var(--accent-soft); color: var(--accent-press); border-color: transparent; }
.search { display: flex; align-items: center; gap: 10px; border-radius: var(--r-full); padding: 11px 18px; color: var(--ink-soft); font-size: 15px; }
.search svg { width: 19px; height: 19px; }
.search input { border: none; background: transparent; outline: none; flex: 1; font: inherit; color: var(--ink); }

/* ---------- empty state ---------- */
.empty { margin-top: 28px; padding: 44px 32px; text-align: center; border: 1px dashed var(--hairline); border-radius: var(--r-lg); color: var(--ink-soft); background: var(--surface-raised); }
.empty h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 6px; }
.empty p { margin: 0 auto; max-width: 46ch; font-size: 14px; }

/* ---------- suggestion fab ---------- */
.suggest-fab { position: fixed; right: 22px; bottom: 22px; z-index: 45; border-radius: 999px; padding: 11px 17px;
  font-size: 13px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--glass-stroke); }

/* ---------- phone tab bar ---------- */
.tabbar { display: none; }
/* While a drawer/sheet owns the screen, hide the floating bottom nav so it can't
   poke up through the drawer's own action bar (the iPhone stock-edit overlap). */
body.drawer-open .tabbar,
body:has(.drawer-scrim:not([hidden])) .tabbar { display: none !important; }
@media (max-width: 859px) {
  .app-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .screen-pad { padding: 16px 18px calc(92px + env(safe-area-inset-bottom)); }
  .screen-title { font-size: 26px; }
  .stat-row { grid-template-columns: 1fr; gap: 12px; }
  .grid-cards { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Bottom nav = one swipeable strip. Slide left/right to reach every section;
     the floating pill clears the home indicator via the safe-area inset. */
  .tabbar { display: block; position: fixed; left: 10px; right: 10px;
    bottom: max(12px, env(safe-area-inset-bottom)); height: 66px;
    border-radius: var(--r-xl); padding: 0; overflow: hidden; z-index: 40; }
  .tabstrip { position: relative; display: flex; height: 100%; align-items: stretch; gap: 2px; padding: 0 8px;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
    overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); }
  .tabstrip::-webkit-scrollbar { display: none; }
  .tabstrip.no-fade { -webkit-mask-image: none; mask-image: none; }
  .tabbtn { flex: 0 0 auto; width: 62px; scroll-snap-align: center; border: none; background: transparent;
    color: var(--ink-faint); display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 9.5px; font-weight: 600; padding: 6px 2px; border-radius: var(--r-md); }
  .tabbtn svg { width: 22px; height: 22px; }
  .tabbtn span { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbtn.on { color: var(--accent); }
  .suggest-fab { bottom: calc(86px + env(safe-area-inset-bottom)); right: 16px; }
}

/* ---------- listing studio ---------- */
.studio-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); margin-bottom: 20px; }
.studio-bar .btn { display: inline-flex; align-items: center; gap: 7px; }
.studio-bar .btn svg { width: 18px; height: 18px; }
.vision-note { margin-left: auto; font-size: 12.5px; color: var(--ink-faint); }
.draft-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.draft { display: flex; gap: 14px; background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--e2); padding: 12px; }
.draft.saved { opacity: .72; }
.draft .thumb { width: 104px; height: 130px; flex: none; border-radius: var(--r-md); background: var(--surface-sunken) center/cover no-repeat; }
.draft .dbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.draft .dstatus { font-size: 12px; font-weight: 600; color: var(--ink-faint); }
.draft .dstatus.busy { color: var(--info-ink); }
.draft .dstatus.ok { color: var(--success-ink); }
.draft .dstatus.warn { color: var(--warning-ink); }
.draft .finp { width: 100%; background: var(--surface-inset); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 8px 10px; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.draft .finp:focus { border-color: var(--accent); }
.draft .f-name { font-weight: 600; }
.draft .frow { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.draft .dactions { display: flex; gap: 7px; margin-top: 2px; }
.draft .dactions .b-save { flex: 1; }
.draft .dactions .b-remove { flex: none; width: 34px; padding: 7px 0; }
.qwrap { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.qsel { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--surface-raised); border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); padding: 8px 12px; outline: none; }
.qsel:focus { border-color: var(--accent); }

/* ---------- live camera ---------- */
.cam { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; padding-top: max(18px, env(safe-area-inset-top)); }
.cam-pill { font-size: 13px; font-weight: 600; color: #fff; background: rgba(0,0,0,0.42); padding: 6px 13px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cam-text { border: none; background: rgba(255,255,255,0.92); color: #1a1620; font: inherit; font-weight: 700; padding: 9px 18px; border-radius: 999px; }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-around; padding: 26px 20px; padding-bottom: max(26px, env(safe-area-inset-bottom)); }
.cam-side { width: 52px; height: 52px; border-radius: 50%; border: none; background: rgba(255,255,255,0.16); color: #fff; display: grid; place-items: center; }
.cam-side svg { width: 24px; height: 24px; }
.cam-shutter { width: 78px; height: 78px; border-radius: 50%; background: #fff; border: 5px solid rgba(255,255,255,0.45); box-shadow: 0 6px 24px rgba(0,0,0,0.5); }
.cam-shutter:active { transform: scale(0.93); }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.on { opacity: .85; transition: opacity .16s; }

/* ---------- listing studio (clean) ---------- */
.vstat { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--ink-faint); border: 1px solid var(--hairline-strong); padding: 2px 9px; border-radius: var(--r-pill); vertical-align: middle; }
.vstat.on { color: var(--success-ink); background: var(--success-soft); border-color: transparent; }
.cap-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border-radius: var(--r-lg); margin-bottom: 22px; }
.cap-group { display: flex; align-items: center; gap: 8px; }
.cap-bar .btn { display: inline-flex; align-items: center; gap: 7px; }
.cap-bar .btn svg { width: 18px; height: 18px; }
.cap-spacer { flex: 1 1 auto; }
.qchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); background: var(--surface-sunken); border-radius: var(--r-pill); padding: 3px 4px 3px 13px; }
.qchip select { border: none; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); padding: 5px 8px; border-radius: var(--r-pill); outline: none; }
.cap-batch { display: inline-flex; align-items: center; gap: 8px; }
.cap-count { font-size: 12px; font-weight: 700; color: var(--accent-press); background: var(--accent-soft); min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; }
.cap-empty { margin-top: 8px; padding: 48px 32px; text-align: center; border: 1px dashed var(--hairline-strong); border-radius: var(--r-xl); background: var(--surface-raised); color: var(--ink-soft); }
.cap-empty-mark { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cap-empty-mark svg { width: 28px; height: 28px; }
.cap-empty h3 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 6px; letter-spacing: -.01em; }
.cap-empty p { margin: 0 auto; max-width: 42ch; font-size: 14px; }
@media (max-width: 859px) {
  .cap-group { flex: 1 1 100%; }
  .cap-group .btn { flex: 1; justify-content: center; }
  .cap-spacer { display: none; }
  .cap-batch { flex: 1 1 100%; justify-content: flex-end; margin-top: 2px; }
  .draft-grid { grid-template-columns: 1fr; gap: 12px; }
  .draft { flex-direction: column; }
  .draft .thumb { width: 100%; height: 190px; }
  .cap-empty { padding: 36px 20px; }
}

/* ---------- login ---------- */
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: 40px 32px; box-shadow: var(--e3); text-align: center; }
.login-card .logo { margin: 0 auto 18px; }
.login-card .wordmark { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; margin: 0; }
.login-card .wordmark em { color: var(--accent); font-style: normal; }
.login-card .sub { color: var(--ink-soft); font-size: 14px; margin: 6px 0 26px; }
.field { margin-bottom: 14px; text-align: left; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-faint); letter-spacing: .03em; text-transform: uppercase; display: block; margin-bottom: 6px; }
.field input { width: 100%; background: var(--surface-inset); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 12px 13px; font-size: 16px; font-weight: 500; color: var(--ink); outline: none; }
.field input:focus { border-color: var(--accent); }
.login-card .btn-primary { width: 100%; margin-top: 8px; padding: 13px; font-size: 16px; }
.err { background: var(--accent-soft); color: var(--accent-press); padding: 11px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px; }

/* ---------- shared cross-module primitives ---------- */
/* sidebar can hold the full module list on short screens */
.sidebar { overflow: hidden; }  /* the inner .navscroll slides; logo + sign-out stay put */

/* two-column split (iPad/desktop); stacks on phone */
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 859px) { .split { grid-template-columns: 1fr; gap: 14px; } }

/* live badge — used by LIVE + Storefront */
.live-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; padding: 6px 13px; border-radius: 999px; }
.live-badge .d { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
@media (prefers-reduced-motion: no-preference) { .live-badge .d { animation: jb-pulse 1.6s ease-in-out infinite; } }
@keyframes jb-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* toast — global notice (Listing, Bundle, LIVE, etc.) */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); z-index: 60;
  background: #1d1924; color: #fff; font-size: 14px; font-weight: 600; padding: 12px 20px; border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: all .35s var(--ease-liquid);
  display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); }
[data-theme="dark"] .toast { background: #0d0b12; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 859px) { .toast { bottom: 96px; } }

/* modal scaffold — used by Suggestion box + others */
.modal-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(20,16,26,.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.modal-card { width: 100%; max-width: 460px; background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--r-xl); box-shadow: var(--e3); padding: 24px; }
.modal-card h3 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.modal-card .msub { margin: 0 0 16px; font-size: 14px; color: var(--ink-soft); }
.field-area { width: 100%; background: var(--surface-inset); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 12px 13px; font: inherit; font-size: 15px; color: var(--ink); outline: none; resize: vertical; min-height: 96px; }
.field-area:focus { border-color: var(--accent); }

/* find-by-bin map (Inventory) */
.binmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 16px; }
.binbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--hairline); background: var(--surface-raised); border-radius: var(--r-md); box-shadow: var(--e1); transition: all .18s var(--ease-liquid); }
.binbtn:hover { border-color: var(--cat-sky); }
.binbtn.on { background: var(--accent-soft); border-color: transparent; box-shadow: 0 0 0 2px var(--accent) inset; }
.binbtn .bl { font-size: 14px; font-weight: 700; color: var(--ink); }
.binbtn .bn { font-size: 11px; color: var(--ink-faint); }

/* Today: "Needs you" flow-monitor feed */
.needs-label { display: flex; align-items: center; gap: 8px; color: var(--accent-press); }
.needs-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: needspulse 2.4s ease-in-out infinite; }
@keyframes needspulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.needs-feed { overflow: hidden; }
.needs-row { position: relative; }
.needs-row::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--hairline); }
.needs-row.lvl-urgent::before { background: var(--warning-ink, #c47d12); }
.needs-row.lvl-attention::before { background: var(--accent); }
.needs-row.lvl-soft::before { background: var(--cat-lilac, #b9a8e0); }
.needs-mark { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-press); }
.needs-row.lvl-urgent .needs-mark { background: var(--warning-soft); color: var(--warning-ink); }
.needs-mark .ic { width: 18px; height: 18px; }

/* deep-link arrival highlight (a card/order you were sent straight to) */
@keyframes flashpulse { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 4px transparent; } }
.flash { animation: flashpulse 1.4s var(--ease-liquid); outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-md); }

/* filtered-inventory banner (arrived from a Needs-you finding) */
.filter-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-md);
  padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; color: var(--accent-press); }

/* Onboarding card (Today) — dismissible, auto-completing checklist */
.onb-card { position: relative; padding: 18px 20px; margin-bottom: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface-raised)), var(--surface-raised));
  transition: opacity .28s, height .28s; overflow: hidden; }
.onb-x { position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border: none; background: none;
  font-size: 22px; line-height: 1; color: var(--ink-faint); cursor: pointer; border-radius: 50%; }
.onb-x:hover { background: var(--surface-sunken); color: var(--ink); }
.onb-head { display: flex; align-items: flex-start; gap: 12px; padding-right: 28px; }
.onb-spark { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.onb-spark .ic { width: 20px; height: 20px; }
.onb-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 0; }
.onb-sub { font-size: 13px; color: var(--ink-soft); margin: 2px 0 0; }
.onb-prog { height: 6px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; margin: 14px 0 4px; }
.onb-prog-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-press)); border-radius: 999px; transition: width .4s var(--ease-liquid, ease); }
.onb-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.onb-step { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: var(--r-md); }
.onb-step.done { opacity: .62; }
.onb-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--hairline-strong); display: grid; place-items: center; }
.onb-step.done .onb-check { background: var(--success); border-color: var(--success); color: #fff; }
.onb-check .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.onb-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.onb-step-label { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.onb-step.done .onb-step-label { text-decoration: line-through; text-decoration-color: var(--ink-faint); }
.onb-step-hint { font-size: 12px; color: var(--ink-faint); }
.onb-go { flex: none; }

/* JBProgress — global top bar (every network call) + inline bars (uploads / AI waits) */
#jbTopProg { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .2s; }
#jbTopProg.on { opacity: 1; }
#jbTopProg .jbtp-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-press));
  box-shadow: 0 0 10px var(--accent); border-radius: 0 3px 3px 0; transition: width .22s var(--ease-liquid, ease); }
.jb-ibar { height: 6px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; margin: 9px 0; }
.jb-ibar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-press)); border-radius: 999px; transition: width .2s ease; }
.jb-ibar.indet .jb-ibar-fill { width: 38%; animation: jbIndet 1.1s ease-in-out infinite; }
@keyframes jbIndet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ---- branded gift-box loader (the shop mark forming) — for uploads / GPU / AI waits ---- */
.jb-loader { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.jb-loader.compact { flex-direction: row; gap: 10px; }
.jb-gift-wrap { position: relative; width: 88px; height: 88px; flex: none; }
.jb-loader.compact .jb-gift-wrap { width: 30px; height: 30px; }
.jb-gift { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.jb-gift-ghost rect, .jb-gift-ghost circle { fill: var(--surface-sunken); stroke: var(--hairline); stroke-width: 2; }
.jb-gift-fill { clip-path: inset(100% 0 0 0); transition: clip-path .35s var(--ease-liquid, ease); will-change: clip-path; }
.jb-gift-fill rect, .jb-gift-fill circle { fill: var(--accent); }
.jb-gift-fill.indet { animation: jbFillPulse 1.5s ease-in-out infinite; }
@keyframes jbFillPulse { 0%, 100% { clip-path: inset(80% 0 0 0); } 50% { clip-path: inset(16% 0 0 0); } }
.jb-gift-glow { position: absolute; inset: -6px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at 50% 58%, var(--accent-soft), transparent 68%); }
.jb-loader.done .jb-gift-glow { opacity: 1; }
.jb-loader.done .jb-gift-wrap { animation: jbPop .42s var(--ease-liquid, ease); }
@keyframes jbPop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.jb-loader-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-align: center; }
.jb-loader.compact .jb-loader-label { font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { .jb-gift-fill.indet { animation: none; clip-path: inset(45% 0 0 0); } }

/* in-app modal (uiConfirm/uiAlert/uiPrompt) — styled overlay, never a browser dialog */
.ui-modal-scrim { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(20,16,26,.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ui-modal { width: 100%; max-width: 380px; background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg, 20px); box-shadow: 0 24px 64px rgba(43,37,48,.28); padding: 22px 22px 18px; }
.ui-modal-msg { font-size: 15px; line-height: 1.5; color: var(--ink); white-space: pre-line; margin: 0 0 16px; }
.ui-modal-field { margin: 0 0 16px; }
.ui-modal-input { width: 100%; background: var(--surface-inset); border: 1px solid var(--hairline); border-radius: var(--r-sm, 10px); padding: 10px 12px; font: inherit; font-size: 15px; color: var(--ink); outline: none; }
.ui-modal-input:focus { border-color: var(--accent); }
.ui-modal-acts { display: flex; gap: 10px; justify-content: flex-end; }
.btn.btn-danger { background: var(--accent-press, #c0392b); color: #fff; }
.btn.btn-danger:hover { filter: brightness(.95); }
body.ui-modal-open { overflow: hidden; }

/* editable price field (tap to edit) */
.editprice { cursor: text; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; border-bottom: 1px dashed transparent; transition: background .12s; }
.editprice:hover { background: var(--accent-soft); border-bottom-color: var(--accent); }
.editprice.editing { background: var(--surface-inset); }
.editprice-input { width: 74px; font: inherit; font-weight: 700; text-align: right; border: 1px solid var(--accent); border-radius: 6px; padding: 2px 6px; outline: none; background: var(--surface-raised); color: var(--ink); }

/* image lightbox (tap product image -> full-size) */
.lightbox { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(12,10,16,.9); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: zoom-out; }
.lightbox-img { max-width: 94vw; max-height: 94vh; object-fit: contain; border-radius: 14px; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.lightbox-close { position: fixed; top: 18px; right: 20px; width: 46px; height: 46px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.16); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: rgba(255,255,255,.28); }
body.lightbox-open { overflow: hidden; }
.zoomable { cursor: zoom-in; }

/* Temporary Parts welcome moment. Expires server-side at 6:00 PM PHT on 2026-07-05. */
.parts-moment {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 22px;
  background: radial-gradient(circle at 50% 20%, rgba(255,255,255,.88), rgba(255,237,245,.74) 34%, rgba(28,18,36,.46));
  -webkit-backdrop-filter: blur(7px) saturate(1.12); backdrop-filter: blur(7px) saturate(1.12);
  pointer-events: none; animation: partsBackdrop 5.2s ease forwards;
}
.parts-card {
  position: relative; width: min(760px, 92vw); overflow: hidden; text-align: center; padding: clamp(28px, 5vw, 58px);
  border-radius: 28px; color: #2d1735; border: 2px solid rgba(255,255,255,.82);
  background: linear-gradient(135deg, #fff7fb 0%, #ffe0ef 32%, #fff3bd 66%, #dff7ff 100%);
  box-shadow: 0 34px 100px rgba(79,34,78,.38), inset 0 0 0 1px rgba(255,255,255,.72);
  transform-origin: center; animation: partsPop 5.2s cubic-bezier(.16,1,.3,1) forwards;
}
.parts-store .parts-card { background: linear-gradient(135deg, #fff8fb 0%, #ffd5e8 34%, #fff2a8 68%, #e7fbff 100%); }
.parts-os .parts-card { background: linear-gradient(135deg, #f5f7ff 0%, #dde6ff 26%, #ffe5f1 62%, #fff4bd 100%); }
.parts-kicker { margin: 0 0 10px; font-size: 12px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: #9b2f6d; }
.parts-card h1 { margin: 0; font-size: clamp(42px, 8vw, 92px); line-height: .9; letter-spacing: 0; color: #35163d; text-wrap: balance; }
.parts-card p { max-width: 620px; margin: 20px auto 0; font-size: clamp(19px, 3vw, 31px); line-height: 1.2; font-weight: 750; color: #5b315e; text-wrap: balance; }
.parts-card strong { display: block; margin-top: 18px; font-size: clamp(24px, 4vw, 42px); line-height: 1.08; color: #cf2e74; text-wrap: balance; }
.parts-ribbon { position: fixed; left: -10vw; right: -10vw; height: 44px; display: grid; place-items: center; font-size: 14px; font-weight: 950; letter-spacing: .28em; color: #fff; background: linear-gradient(90deg, #ff4f93, #ffb13d, #51c6df, #ff4f93); box-shadow: 0 10px 34px rgba(0,0,0,.18); opacity: .96; }
.parts-ribbon-a { top: 13vh; transform: rotate(-5deg); animation: partsRibbonA 5.2s ease forwards; }
.parts-ribbon-b { bottom: 14vh; transform: rotate(4deg); animation: partsRibbonB 5.2s ease forwards; }
.parts-spark { position: absolute; width: 190px; aspect-ratio: 1; border-radius: 50%; pointer-events: none; opacity: .8; filter: blur(.2px); background: repeating-conic-gradient(from 10deg, rgba(255,255,255,.95) 0 8deg, transparent 8deg 18deg); mask: radial-gradient(circle, transparent 0 32%, #000 33% 42%, transparent 43%); }
.parts-spark-one { top: -54px; left: -42px; animation: partsSpin 5s linear infinite; }
.parts-spark-two { right: -58px; bottom: -60px; animation: partsSpin 4.4s linear infinite reverse; }
.parts-moment-out { opacity: 0; transform: scale(1.03); transition: opacity .9s ease, transform .9s ease; }
@keyframes partsPop { 0% { opacity: 0; transform: scale(.66) rotate(-2deg); } 14% { opacity: 1; transform: scale(1.06) rotate(1deg); } 24%, 78% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: scale(.94) translateY(-10px); } }
@keyframes partsBackdrop { 0% { opacity: 0; } 10%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes partsRibbonA { 0% { transform: translateX(-20%) rotate(-5deg); } 16%, 84% { transform: translateX(0) rotate(-5deg); } 100% { transform: translateX(20%) rotate(-5deg); opacity: 0; } }
@keyframes partsRibbonB { 0% { transform: translateX(20%) rotate(4deg); } 16%, 84% { transform: translateX(0) rotate(4deg); } 100% { transform: translateX(-20%) rotate(4deg); opacity: 0; } }
@keyframes partsSpin { to { transform: rotate(360deg); } }
@media (max-width: 560px) { .parts-card { border-radius: 22px; } .parts-ribbon { height: 36px; font-size: 11px; letter-spacing: .18em; } .parts-ribbon-a { top: 9vh; } .parts-ribbon-b { bottom: 10vh; } }
@media (prefers-reduced-motion: reduce) { .parts-moment, .parts-card, .parts-ribbon, .parts-spark { animation: none; } .parts-moment { opacity: 1; } }
/* Mobile polish for the temporary Parts greeting and JoyBox phone shell. */
@supports (height: 100svh) {
  .app-grid, .stage { min-height: 100svh; }
}
.parts-moment {
  min-height: 100vh;
  min-height: 100svh;
  align-items: center;
  justify-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  animation-duration: 10.4s;
}
.parts-card {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100svh - 108px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation-duration: 10.4s;
}
.parts-ribbon-a, .parts-ribbon-b { animation-duration: 10.4s; }
@keyframes partsPop { 0% { opacity: 0; transform: scale(.68) rotate(-2deg); } 9% { opacity: 1; transform: scale(1.055) rotate(1deg); } 15%, 88% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: scale(.95) translateY(-10px); } }
@keyframes partsBackdrop { 0% { opacity: 0; } 8%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes partsRibbonA { 0% { transform: translateX(-20%) rotate(-5deg); } 12%, 90% { transform: translateX(0) rotate(-5deg); } 100% { transform: translateX(20%) rotate(-5deg); opacity: 0; } }
@keyframes partsRibbonB { 0% { transform: translateX(20%) rotate(4deg); } 12%, 90% { transform: translateX(0) rotate(4deg); } 100% { transform: translateX(-20%) rotate(4deg); opacity: 0; } }
@media (max-width: 560px) {
  .screen-pad { padding: 12px 12px calc(88px + env(safe-area-inset-bottom)); }
  .screen-title { font-size: 24px; line-height: 1.08; }
  .screen-sub { font-size: 13.5px; }
  .grid-cards { grid-template-columns: 1fr; }
  .row { padding: 11px 10px; gap: 10px; }
  .stat { padding: 14px; }
  .parts-moment { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .parts-card {
    width: calc(100vw - 24px);
    max-height: min(74svh, 540px);
    border-radius: 20px;
    padding: clamp(18px, 4.2svh, 30px) 16px;
  }
  .parts-kicker { margin-bottom: 8px; font-size: 10px; letter-spacing: .12em; }
  .parts-card h1 { font-size: clamp(32px, 11vw, 46px); line-height: .95; }
  .parts-card p { margin-top: 12px; font-size: clamp(16px, 5vw, 20px); line-height: 1.22; }
  .parts-card strong { margin-top: 12px; font-size: clamp(19px, 6vw, 25px); line-height: 1.12; }
  .parts-ribbon { height: 32px; font-size: 10px; letter-spacing: .16em; }
  .parts-ribbon-a { top: max(8px, env(safe-area-inset-top)); transform: rotate(-3deg); }
  .parts-ribbon-b { bottom: max(8px, env(safe-area-inset-bottom)); transform: rotate(3deg); }
  .parts-spark { width: 120px; opacity: .55; }
  .parts-spark-one { top: -34px; left: -30px; }
  .parts-spark-two { right: -34px; bottom: -36px; }
}
@media (max-width: 420px) {
  .screen-pad { padding-left: 10px; padding-right: 10px; }
  .tabbar { left: 8px; right: 8px; height: 62px; }
  .tabbtn { width: 58px; }
}
/* Hard phone fit pass: keep JoyBox and the Parts greeting inside the viewport. */
@media (max-width: 640px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  body { min-width: 0; }
  .app-grid, .stage, .screen-pad, .panel, .empty { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .stage { overflow-x: hidden; }
  .screen-pad { padding: 10px 10px calc(84px + env(safe-area-inset-bottom)); }
  .screen-head { margin-bottom: 14px; }
  .section-label { margin: 20px 0 10px; }
  .grid-cards, .stat-row { grid-template-columns: minmax(0, 1fr) !important; }
  .item-card, .row, .stat { min-width: 0; }
  .row { flex-wrap: wrap; }
  .row .rright { margin-left: 0; width: 100%; text-align: left; }
  .figs { align-items: center; }
  .price { font-size: 20px; }
  .btn { max-width: 100%; white-space: normal; }
  .tabbar { left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); height: 60px; border-radius: 18px; }
  .tabstrip { padding: 0 6px; }
  .tabbtn { width: 56px; min-width: 56px; font-size: 9px; }
  .tabbtn .ic { width: 20px; height: 20px; }
  .suggest-fab, .store-backlink { right: 10px; bottom: calc(74px + env(safe-area-inset-bottom)); max-width: calc(100vw - 20px); }

  .parts-moment {
    inset: 0 !important;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .parts-card {
    width: min(336px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 28px);
    overflow: hidden;
    border-radius: 18px;
    padding: 18px 14px 16px;
    box-sizing: border-box;
  }
  .parts-ribbon { display: none; }
  .parts-kicker { font-size: 9px; line-height: 1.2; letter-spacing: .1em; margin-bottom: 7px; }
  .parts-card h1 { font-size: clamp(28px, 8.8vw, 38px); line-height: .98; }
  .parts-card p { margin-top: 10px; font-size: clamp(14px, 4.2vw, 17px); line-height: 1.22; font-weight: 750; }
  .parts-card strong { margin-top: 10px; font-size: clamp(16px, 5vw, 21px); line-height: 1.14; }
  .parts-spark { width: 88px; opacity: .45; }
  .parts-spark-one { top: -24px; left: -22px; }
  .parts-spark-two { right: -22px; bottom: -24px; }
}
@media (max-width: 380px) {
  .parts-card { width: calc(100vw - 16px); max-width: calc(100vw - 16px); padding: 15px 12px 14px; }
  .parts-card h1 { font-size: 27px; }
  .parts-card p { font-size: 14px; }
  .parts-card strong { font-size: 16px; }
}
.guardian-indicator{position:fixed;right:18px;top:max(12px,env(safe-area-inset-top));z-index:45;
  display:flex;align-items:center;gap:7px;padding:7px 10px;border-radius:999px;
  background:color-mix(in srgb,var(--surface-raised) 92%,transparent);
  border:1px solid var(--hairline);box-shadow:var(--shadow-sm);color:var(--ink-soft);
  font-size:12px;font-weight:650;text-decoration:none}
.guardian-indicator span{width:8px;height:8px;border-radius:50%;background:var(--success)}
.guardian-indicator.guardian-needs_review span{background:var(--warning-ink,#c47d12)}
.guardian-indicator.guardian-action_required{color:var(--danger-ink,#a33)}
.guardian-indicator.guardian-action_required span{background:var(--danger-ink,#c0392b)}
@media(max-width:760px){
  .guardian-indicator{top:max(8px,env(safe-area-inset-top));right:10px;font-size:11px;
    padding:6px 8px;max-width:44vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
