/* Bins: black tub / yellow lid, echoing the 27-gallon heavy-duty tote. */
:root {
  --bg:#0d0e0f;        /* garage-dark backdrop */
  --tub:#17191b;       /* matte-black tote body (surfaces) */
  --tub-2:#101214;     /* recessed inputs */
  --lid:#F5C21B;       /* the yellow lid: the one action color */
  --lid-hi:#FFD542;    /* lid, lit */
  --ink:#F3F1EA;       /* molded-label off-white */
  --muted:#949A9F;     /* hardware gray */
  --line:#2A2E31;      /* seams / edges */
  --danger:#E5484D;
  --display:'Oswald','Arial Narrow',system-ui,sans-serif;
}
/* Self-hosted Oswald (latin) so the installed/offline app never depends on the Google Fonts CDN */
@font-face { font-family:'Oswald'; font-style:normal; font-weight:500; font-display:swap; src:url('/app/fonts/oswald-500.woff2') format('woff2'); }
@font-face { font-family:'Oswald'; font-style:normal; font-weight:600; font-display:swap; src:url('/app/fonts/oswald-600.woff2') format('woff2'); }
@font-face { font-family:'Oswald'; font-style:normal; font-weight:700; font-display:swap; src:url('/app/fonts/oswald-700.woff2') format('woff2'); }
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
/* Fixed-size app: no pinch / double-tap zoom (paired with user-scalable=no in the viewport meta). */
body { margin:0; font:16px/1.5 system-ui,-apple-system,sans-serif; background:var(--bg); color:var(--ink); touch-action:manipulation;
  overscroll-behavior-y:contain; }   /* our own pull-to-refresh owns the overscroll gesture */

/* Pull-to-refresh indicator (app-wide; driven from app.js) */
.ptr { position:fixed; top:calc(2px + env(safe-area-inset-top)); left:50%; z-index:200;
  width:38px; height:38px; display:grid; place-items:center; border-radius:50%;
  background:var(--tub); border:1px solid var(--line); color:var(--muted);
  transform:translate(-50%,0); opacity:0; pointer-events:none; transition:opacity .18s ease; }
.ptr.show { opacity:1; }
.ptr.armed { color:var(--lid); border-color:var(--lid); }
.ptr.snapping { transition:opacity .2s ease, transform .25s ease; }
.ptr svg { width:19px; height:19px; }
.ptr.busy svg { animation:ptrspin .8s linear infinite; }
@keyframes ptrspin { to { transform:rotate(360deg); } }
#app { max-width:960px; margin:0 auto; padding:16px; padding-top:calc(16px + env(safe-area-inset-top)); }
body.has-nav #app { padding-bottom:calc(80px + env(safe-area-inset-bottom)); }
h1,h2,h3 { font-family:var(--display); font-weight:600; line-height:1.15; letter-spacing:.01em; margin:0; }

.card { background:var(--tub); border:1px solid var(--line); border-radius:12px; padding:20px; margin-bottom:14px; }

/* Controls */
input, textarea, select { font:inherit; padding:10px 12px; border-radius:8px; border:1px solid var(--line);
  background:var(--tub-2); color:var(--ink); height:44px; }
textarea { height:auto; min-height:120px; width:100%; }
input:focus, textarea:focus, select:focus { outline:2px solid var(--lid); outline-offset:1px; border-color:var(--lid); }
button { font-family:var(--display); font-weight:600; text-transform:uppercase; letter-spacing:.05em;
  padding:0 16px; height:44px; border-radius:8px; border:none; background:var(--lid); color:#0d0e0f; cursor:pointer; }
button:hover { background:var(--lid-hi); }
button:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.ghost { background:transparent; border:1px solid var(--line); color:var(--ink); font-weight:500; letter-spacing:.03em; }
.ghost:hover { background:var(--tub); border-color:var(--muted); }
.apple-btn { background:#000; color:#fff; border:1px solid #2a2a2a; height:44px; border-radius:8px; font-weight:600; cursor:pointer; width:100%; }
.apple-btn:hover { background:#111; }
.error { color:var(--danger); font-size:14px; }
[onclick], .tile, .clickable { cursor:pointer; }

/* Login: stamped wordmark with a yellow lid underline */
.login { max-width:360px; margin:11vh auto; display:flex; flex-direction:column; gap:12px; text-align:center; }
.login .logo { width:240px; max-width:82%; height:auto; margin:2px auto; display:block; mix-blend-mode:screen; }
.login h1 { font-size:46px; text-transform:uppercase; letter-spacing:.08em; margin-bottom:2px; }
.login h1::after { content:""; display:block; width:66px; height:6px; border-radius:2px; background:var(--lid); margin:12px auto 0; }
.login p { color:var(--muted); margin:0 0 6px; }
.login #gbtn { display:flex; justify-content:center; }

/* Zone bar: horizontally-scrolling chips + an edit gear */
.zonebar { display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.chips { display:flex; gap:8px; flex:1; overflow-x:auto; padding-bottom:2px; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.chips::-webkit-scrollbar { display:none; }
.chip { flex:none; height:44px; padding:0 16px; border-radius:8px; background:var(--tub); border:1px solid var(--line);
  color:var(--ink); cursor:pointer; font-family:var(--display); font-weight:500; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; }
.chip:hover { background:var(--tub); }
.chip.on { background:var(--lid); color:#0d0e0f; border-color:var(--lid); font-weight:600; }
.chip--add { color:var(--muted); }
.iconbtn { flex:none; width:44px; height:44px; padding:0; display:grid; place-items:center; background:var(--tub);
  border:1px solid var(--line); border-radius:10px; color:var(--ink); cursor:pointer; }
.iconbtn svg { width:20px; height:20px; }
.iconbtn:hover { background:var(--tub); border-color:var(--muted); }
#gridwrap { overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:4px; }

/* THE SIGNATURE: a tote. Black tub body, yellow lid cap with two black latches. */
.grid { display:grid; gap:12px; }
.tile { position:relative; min-height:108px; border:1px solid var(--line); border-radius:6px 6px 10px 10px;
  padding:28px 12px 12px; background:var(--tub); display:flex; flex-direction:column; gap:4px;
  cursor:pointer; overflow:hidden; box-shadow:0 1px 0 #000 inset; }
.tile::before { content:""; position:absolute; top:0; left:0; right:0; height:18px;
  background:var(--lid); border-bottom:2px solid #0d0e0f; }
.tile::after { content:""; position:absolute; top:4px; left:50%; transform:translateX(-50%);
  width:52px; height:9px; border-radius:2px;
  background:linear-gradient(90deg,#0d0e0f 0 9px, transparent 9px 43px, #0d0e0f 43px 52px); }  /* two latches */
.tile strong { font-family:var(--display); font-weight:600; font-size:15px; text-transform:uppercase; letter-spacing:.02em; }
.tile .muted { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.05em; }
.tile--light strong { color:#141516; }
.tile--light .muted { color:#3d4247; }
.tile.hit { border-color:var(--lid); box-shadow:0 0 0 3px rgba(245,194,27,.35); }
.tile.hit::before { background:var(--lid-hi); }
/* Empty slot: a dashed ghost tote */
.tile.add { align-items:center; justify-content:center; padding:12px; background:transparent;
  border:1.5px dashed var(--line); color:var(--muted); font-family:var(--display); text-transform:uppercase; letter-spacing:.06em; box-shadow:none; }
.tile.add::before, .tile.add::after { display:none; }
.tile.add:hover { border-color:var(--lid); color:var(--ink); }
/* Loose zone: totes wrap in a responsive grid, same tile sizing as a rack but no fixed slots. */
.loose { display:grid; grid-template-columns:repeat(auto-fill, minmax(116px, 1fr)); gap:12px; }

/* Container type: a wrapping row of chips in the tote editor (reuses .chip). */
.typechips { display:flex; flex-wrap:wrap; gap:8px; }

/* "All" overview: cross-zone roster grouped by zone, with counts. */
.overview__sum { font-family:var(--display); text-transform:uppercase; letter-spacing:.04em;
  color:var(--muted); font-size:13px; margin:2px 2px 16px; }
.overview__sum strong { color:var(--ink); }
.overview__empty { color:var(--muted); padding:24px 2px; }
.overview__zone { margin-bottom:22px; }
.overview__zonehead { display:flex; align-items:baseline; justify-content:space-between; gap:10px;
  margin:0 2px 10px; padding-bottom:6px; border-bottom:1px solid var(--line); }
.overview__zonehead span:first-child { font-family:var(--display); font-weight:600; text-transform:uppercase;
  letter-spacing:.03em; font-size:15px; }
.overview__tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(116px, 1fr)); gap:12px; }
/* A small type badge on an overview tile (only shown when the container is not a plain tote). */
.tile__type { position:absolute; top:22px; right:8px; font-size:9px; line-height:1; padding:3px 5px;
  border-radius:4px; background:var(--tub-2); color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.tile--light .tile__type { background:rgba(0,0,0,.14); color:#2c3033; }

/* Segmented Rack/Loose chooser (new-zone modal + zone editor). */
.segmented { display:flex; gap:8px; }
.segmented .seg { flex:1; height:auto; display:flex; flex-direction:column; gap:2px; align-items:flex-start; text-align:left;
  padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--tub-2); color:var(--ink);
  cursor:pointer; font:inherit; text-transform:none; letter-spacing:0; }
.segmented .seg span { line-height:1.25; }
.segmented--sm .seg { height:44px; }
.segmented .seg strong { font-weight:600; }
.segmented .seg span { color:var(--muted); font-size:12px; }
.segmented .seg.on { border-color:var(--lid); box-shadow:0 0 0 2px rgba(245,194,27,.4); }
.segmented--sm { flex:0 0 auto; }
.segmented--sm .seg { flex:0 0 auto; flex-direction:row; padding:8px 18px;
  font-family:var(--display); text-transform:uppercase; letter-spacing:.04em; }
.zrow--type { align-items:center; }
.ztype-hint { font-size:12px; }
.muted { color:var(--muted); font-size:13px; }

/* Search results */
.results { list-style:none; padding:0; margin:0 0 14px; }
.results li { padding:11px 13px; border:1px solid var(--line); border-left:4px solid var(--lid); border-radius:6px;
  margin-bottom:6px; cursor:pointer; background:var(--tub); }
.results li:hover { border-color:var(--muted); border-left-color:var(--lid); }

/* Bin detail */
.cover img { width:100%; max-height:280px; object-fit:cover; border-radius:8px; }
.cover .noimg { height:160px; display:flex; align-items:center; justify-content:center; color:var(--muted);
  border:1.5px dashed var(--line); border-radius:8px; text-transform:uppercase; letter-spacing:.05em; font-family:var(--display); }
.upload { display:flex; align-items:center; justify-content:center; margin-top:12px; min-height:46px; padding:0 16px;
  border:1px solid var(--line); border-radius:10px; background:var(--tub); color:var(--ink); cursor:pointer;
  font-family:var(--display); font-weight:600; text-transform:uppercase; letter-spacing:.04em; font-size:14px; }
.upload:hover { border-color:var(--lid); color:var(--lid); }
/* Scan a Photo (AI item detection) */
.scan { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0 0 10px; }
.scan__btn { display:inline-flex; align-items:center; gap:8px; flex:none; height:44px; padding:0 14px;
  border:1px solid var(--line); border-radius:10px; background:var(--tub); color:var(--ink); cursor:pointer;
  font-family:var(--display); font-weight:600; text-transform:uppercase; letter-spacing:.04em; font-size:14px; }
.scan__btn svg { width:20px; height:20px; }
.scan__btn:hover { border-color:var(--lid); color:var(--lid); }
.scan__btn.busy { opacity:.55; pointer-events:none; }
.scan__hint { flex:1; min-width:140px; font-size:12px; }
.items { list-style:none; padding:0; margin:0 0 12px; }
.items li { display:flex; align-items:center; gap:10px; padding:6px 0; border-bottom:1px solid var(--line); }
.items .qty { width:58px; height:44px; text-align:center; }
.items .del { flex:none; height:40px; padding:0 12px; background:none; border:1px solid transparent; border-radius:8px;
  color:#e8837a; font-family:var(--display); font-weight:600; text-transform:uppercase; letter-spacing:.04em; font-size:12px; cursor:pointer; }
.items .del:hover { border-color:#7f1d1d; background:rgba(185,28,28,.14); }
.items .name { flex:1; }

/* Zone edit */
.zrow { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.zrow .zname { flex:1; min-width:160px; }
/* Reorder handle: up/down arrows that move a zone in the list (and so on the map's zone bar). */
.zmove { display:flex; gap:6px; flex:none; }
.iconbtn:disabled { opacity:.3; cursor:default; }
.iconbtn:disabled:hover { background:var(--tub); border-color:var(--line); }
.zrow label { color:var(--muted); font-size:13px; display:flex; gap:8px; align-items:center; }
/* -/+ stepper: number field flanked by two tappable buttons (replaces the tiny native spinner) */
.stepper { display:inline-flex; align-items:center; height:44px; border:1px solid var(--line);
  border-radius:8px; background:var(--tub-2); overflow:hidden; }
.stepper .step { width:40px; height:44px; padding:0; display:grid; place-items:center; flex:none;
  background:transparent; color:var(--ink); border:none; border-radius:0; text-transform:none; letter-spacing:0; }
.stepper .step svg { width:20px; height:20px; }
.stepper .step:hover { background:rgba(255,255,255,.06); color:var(--lid); }
.stepper .step:active { background:rgba(245,194,27,.15); }
.stepper .step:first-child { border-right:1px solid var(--line); }
.stepper .step:last-child { border-left:1px solid var(--line); }
.stepper .zr, .stepper .zc { width:44px; height:44px; text-align:center; border:none; border-radius:0; background:transparent; padding:0; }
/* hide the browser's native number spinner (we provide our own) */
.stepper input[type=number] { -moz-appearance:textfield; appearance:textfield; }
.stepper input[type=number]::-webkit-outer-spin-button,
.stepper input[type=number]::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }

/* Household */
.members, .invites { list-style:none; padding:0; margin:0; }
.members li, .invites li { display:flex; gap:8px; align-items:center; padding:8px 0; border-bottom:1px solid var(--line); }
.invites input { flex:1; }
.card.danger { border-color:#5a2224; }
.danger-btn { background:var(--danger); color:#fff; }
.danger-btn:hover { background:#f0575b; }

/* Destructive action at the foot of the container editor: available but not alarming (outline,
   fills red on hover/focus). Full-width so it reads as a section action, not a primary button. */
.binview__danger { margin-top:2px; margin-bottom:40px; }
.btn-danger { width:100%; background:transparent; border:1px solid #5a2224; color:var(--danger); }
.btn-danger:hover, .btn-danger:focus-visible { background:var(--danger); color:#fff; border-color:var(--danger); }
/* Confirm-dialog message + its destructive OK button. */
.modal__msg { color:var(--muted); font-size:14px; line-height:1.5; margin:0 0 4px; text-transform:none; letter-spacing:0; }
.modal__ok--danger { background:var(--danger); color:#fff; }
.modal__ok--danger:hover { background:#f0575b; }

/* Bottom tab bar (app-style) */
.bottomnav { position:fixed; left:0; right:0; bottom:0; z-index:50; display:flex;
  background:rgba(14,15,16,.9); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px);
  border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); }
.bottomnav button { flex:1; height:58px; padding:0; background:none; border:none; border-radius:0; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  color:var(--muted); font-family:var(--display); font-weight:500; text-transform:uppercase; letter-spacing:.06em; }
.bottomnav button span { font-size:10px; }
.bottomnav button svg { width:23px; height:23px; }
.bottomnav button.on { color:var(--lid); }
.bottomnav button:hover { background:none; color:var(--ink); }
.bottomnav button.on:hover { color:var(--lid); }

/* Search view */
.searchbar { position:relative; margin-bottom:14px; }
.searchbar__icon { position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--muted); display:grid; place-items:center; pointer-events:none; }
.searchbar__icon svg { width:19px; height:19px; }
.searchbar input { width:100%; height:48px; padding-left:42px; }
.results-wrap .hint { color:var(--muted); text-align:center; padding:26px 12px; margin:0; }
.results li strong { display:block; font-size:15px; }
.results li .where { color:var(--muted); font-size:13px; }
.results li .snippet { display:block; color:var(--muted); font-size:12px; margin-top:3px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

@media (prefers-reduced-motion: no-preference) {
  .tile { transition:box-shadow .15s ease, border-color .15s ease; }
}

/* Zone editor: explicit Save with confirmation + red destructive Delete */
.zrow--actions { margin-top:14px; }
.save.saved { background:#2f7d32; color:#fff; }
.detail-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px;
  min-height:300px; color:var(--muted); text-align:center; padding:24px; }
.detail-empty svg { width:52px; height:52px; opacity:.45; }
.detail-empty p { max-width:24ch; margin:0; }
.tile.selected { border-color:var(--lid); box-shadow:0 0 0 2px rgba(245,194,27,.4); }

/* ===== iPad / tablet split view (per fleet 768 standard) ===== */
@media (min-width: 768px) {
  body.is-tablet #app { max-width:none; padding:0; }
  .ipad { display:grid; grid-template-columns:236px minmax(0,1fr); min-height:100vh; }

  .sidebar { position:sticky; top:0; align-self:start; height:100vh;
    display:flex; flex-direction:column; gap:6px; border-right:1px solid var(--line);
    padding:calc(20px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
  .sidebar__logo { width:150px; max-width:86%; height:auto; margin:2px auto 20px; display:block; mix-blend-mode:screen; }
  .sidebar__nav { display:flex; flex-direction:column; gap:4px; }
  .sidebar__nav button { display:flex; align-items:center; justify-content:flex-start; gap:12px;
    height:48px; padding:0 14px; border-radius:10px; background:none; border:none; cursor:pointer;
    color:var(--muted); font-family:var(--display); font-weight:500; text-transform:uppercase; letter-spacing:.04em; }
  .sidebar__nav button svg { width:22px; height:22px; flex:none; }
  .sidebar__nav button:hover { background:var(--tub); color:var(--ink); }
  .sidebar__nav button.on { background:var(--tub); color:var(--lid); }
  .sidebar__foot { margin-top:auto; padding:14px 14px 0; border-top:1px solid var(--line);
    color:var(--muted); font-family:var(--display); text-transform:uppercase; letter-spacing:.05em; font-size:13px; }

  .content { min-width:0; padding:22px clamp(20px,3vw,40px) calc(22px + env(safe-area-inset-bottom)); }

  /* master-detail: browse the grid/results on the left, a tote's contents on the right */
  .masterdetail { display:grid; grid-template-columns:minmax(0,1fr) minmax(304px,384px); gap:22px; align-items:start; }
  .master { min-width:0; }
  .detail { position:sticky; top:22px; align-self:start; max-height:calc(100vh - 44px); overflow:auto;
    border-left:1px solid var(--line); padding-left:22px; }
  .detail .binview .card:first-child { margin-top:0; }

  /* embedded bin header (no Back button; the pane is persistent) */
  .binhead { margin-bottom:12px; }
  .binhead input { width:100%; height:auto; padding:6px 2px; border:none; border-bottom:1px solid var(--line);
    border-radius:0; background:transparent; font-family:var(--display); font-weight:600; font-size:19px;
    text-transform:uppercase; letter-spacing:.02em; }
  .binhead input:focus { outline:none; border-bottom-color:var(--lid); }

  /* login stays a centered card on tablet */
  body:not(.is-tablet) .login, .login { margin-top:12vh; }
}

/* ===== Audit fixes: toast, modal, tip, focus, scroll hint, search clear ===== */

/* Toast: save feedback (#12) + forgiving delete with Undo (#1) */
.toast { position:fixed; left:50%; bottom:calc(74px + env(safe-area-inset-bottom)); transform:translate(-50%,8px);
  z-index:200; display:flex; align-items:center; gap:14px; max-width:calc(100% - 32px);
  background:#20242a; border:1px solid var(--line); border-radius:12px; padding:12px 16px; color:var(--ink);
  box-shadow:0 12px 32px -10px rgba(0,0,0,.65); opacity:0; transition:opacity .18s ease, transform .18s ease; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.toast__msg { font-size:14px; }
.toast__action { flex:none; min-height:36px; padding:0 14px; background:var(--lid); color:#0d0e0f; border:none; border-radius:8px;
  font-family:var(--display); font-weight:700; text-transform:uppercase; letter-spacing:.05em; font-size:12px; cursor:pointer; }
body:not(.has-nav) .toast { bottom:calc(26px + env(safe-area-inset-bottom)); }

/* In-app text prompt (#4) */
.modal-overlay { position:fixed; inset:0; z-index:300; background:rgba(0,0,0,.55);
  -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); display:flex; align-items:center; justify-content:center; padding:20px; }
.modal { width:100%; max-width:380px; display:flex; flex-direction:column; gap:14px; }
.modal h3 { margin:0; }
.modal__input { width:100%; height:48px; }
.modal__actions { display:flex; justify-content:flex-end; gap:10px; }
.modal__ok { min-height:46px; padding:0 20px; }
.modal__cancel { min-height:46px; padding:0 18px; }

/* First-run Search nudge (#3) */
.tip { display:flex; align-items:stretch; margin-bottom:12px; border:1px solid var(--line);
  border-left:3px solid var(--lid); border-radius:10px; overflow:hidden; background:var(--tub); }
.tip__go { flex:1; text-align:left; background:none; border:none; color:var(--ink); padding:12px 14px; cursor:pointer;
  font:inherit; text-transform:none; letter-spacing:0; }
.tip__x { flex:none; width:46px; background:none; border:none; border-left:1px solid var(--line); color:var(--muted); font-size:20px; cursor:pointer; }
.tip__x:hover { color:var(--ink); }

/* Wide-zone horizontal-scroll hint (#6) */
#gridwrap.scrollable { -webkit-mask-image:linear-gradient(90deg,#000 88%,transparent); mask-image:linear-gradient(90deg,#000 88%,transparent); }

/* Keyboard focus for tappable tiles / result rows (#2) */
.tile:focus-visible, .results li:focus-visible, .tip__go:focus-visible { outline:2px solid var(--lid); outline-offset:2px; }

/* On-brand search clear, replaces the default blue webkit X (#10) */
.searchbar input[type=search]:not(:placeholder-shown)::-webkit-search-cancel-button {
  -webkit-appearance:none; appearance:none; height:18px; width:18px; margin-left:6px; cursor:pointer; opacity:.7;
  background:var(--muted);
  -webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 6l12 12M18 6L6 18' stroke='black' stroke-width='2.6' stroke-linecap='round'/></svg>") center/contain no-repeat;
          mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 6l12 12M18 6L6 18' stroke='black' stroke-width='2.6' stroke-linecap='round'/></svg>") center/contain no-repeat; }

/* Tab-root header without a Back button (#7) */
.viewhead { margin-bottom:12px; }
.viewhead h2 { margin:0; }

/* Continue-with Google / Apple buttons (match the shared fleet design) */
.oauth { position:relative; width:100%; }
.oauth-btn { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:52px;
  border-radius:12px; cursor:pointer;
  font:600 16px/1 -apple-system,system-ui,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  text-transform:none; letter-spacing:0; }
.oauth-btn svg { width:20px; height:20px; flex:none; }
.oauth-btn--google { background:#fff; color:#1f1f1f; border:1px solid #dadce0; }
.oauth-btn--google:hover { background:#f6f7f8; }
.oauth-btn--apple { background:#000; color:#fff; border:1px solid #000; }
.oauth-btn--apple:hover { background:#141414; }
/* Real GIS button lives off-screen; the visible button forwards taps to it. */
.oauth-gis { position:absolute; left:-9999px; top:0; width:1px; height:1px; overflow:hidden; }

/* Drill-in header (Back + editable title). Was unstyled, so the title sat in a big
   input box and the row misaligned. Lay it out and style the title like a heading. */
.topbar { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.topbar > .ghost { flex:none; }
.topbar h2 { flex:1; min-width:0; }
.topbar input { flex:1; min-width:0; height:auto; padding:6px 2px; background:transparent;
  border:none; border-bottom:1px solid var(--line); border-radius:0;
  font-family:var(--display); font-weight:600; font-size:20px; text-transform:uppercase; letter-spacing:.02em; }
.topbar input:focus { outline:none; border-bottom-color:var(--lid); }

/* Section headings were cramped against the first row (e.g. Contents -> first item). */
.card > h3:first-child { margin-bottom:14px; }

/* ===== Drag to rearrange totes + the Floor (park a tote to free a slot) ===== */
.tile { touch-action: manipulation; }
.tile.dragging { opacity:.25; }
.tile-ghost { position:fixed; z-index:400; margin:0; pointer-events:none; opacity:.97;
  transform:scale(1.04); box-shadow:0 20px 44px -12px rgba(0,0,0,.75); }
.tile.drop-target, .floor.drop-target { outline:2px dashed var(--lid); outline-offset:2px; }
#gridwrap.dnd-lock { touch-action:none; }

.floor { margin-top:16px; border:1.5px dashed var(--line); border-radius:12px; padding:12px 14px; background:rgba(255,255,255,.015); }
.floor.drop-target { border-color:var(--lid); background:rgba(245,194,27,.06); }
.floor__label { font-family:var(--display); font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-size:12px; margin-bottom:10px; }
.floor__hint { color:var(--muted); font-size:13px; }
.floor__items { display:flex; flex-wrap:wrap; gap:10px; }
.floorchip { display:flex; align-items:center; gap:8px; padding:9px 13px; border:1px solid var(--line); border-radius:10px;
  background:var(--tub); cursor:grab; touch-action:manipulation; }
.floorchip:hover { border-color:var(--muted); }
.floorchip.selected { border-color:var(--lid); box-shadow:0 0 0 2px rgba(245,194,27,.35); }
.floorchip strong { font-family:var(--display); font-weight:600; font-size:13px; text-transform:uppercase; letter-spacing:.02em; }
.floorchip .muted { font-size:11px; }
.floorchip__zone { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.05em;
  padding:2px 6px; border:1px solid var(--line); border-radius:999px; }

/* A tote glyph: bin body with a lid strip across the top. Colors come from --tub / --lid inline. */
.toteswatch { position:relative; display:inline-block; width:22px; height:16px; flex:none;
  background:var(--tub); border:1px solid rgba(0,0,0,.35); border-radius:2px 2px 3px 3px; box-shadow:0 0 0 1px var(--line); }
.toteswatch::before { content:""; position:absolute; top:0; left:0; right:0; height:5px;
  background:var(--lid); border-bottom:1px solid rgba(0,0,0,.4); border-radius:2px 2px 0 0; }
.toteswatch--lg { width:64px; height:46px; border-radius:3px 3px 6px 6px; }
.toteswatch--lg::before { height:13px; }

/* Lid + Bin color picker */
.colorctl__preview { display:flex; justify-content:center; padding:6px 0 16px; }
.swatchrow { display:flex; align-items:center; gap:12px; padding:8px 0; }
.swatchrow + .swatchrow { border-top:1px solid var(--line); }
.swatchrow__label { flex:none; width:38px; color:var(--muted); font-family:var(--display); font-weight:600;
  text-transform:uppercase; letter-spacing:.05em; font-size:12px; }
.swatchrow__swatches { display:flex; flex-wrap:wrap; gap:8px; }
.swatch { width:30px; height:30px; padding:0; border-radius:50%; border:1px solid rgba(0,0,0,.35);
  box-shadow:0 0 0 1px var(--line); cursor:pointer; }
.swatch:hover { box-shadow:0 0 0 2px var(--muted); }
.swatch.on { box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--lid); }

/* In a WKWebView (the iOS shell) a long-press raises the native callout/selection, which cancels
   the pointer stream and kills the long-press drag. Suppress it on the draggable pieces. */
.tile, .floorchip { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
/* Once a drag actually begins we own the gesture, so stop the WebView from panning underneath it. */
.dnd-lock, .dnd-lock .tile, .tile.dragging, .floorchip.dragging { touch-action:none; }

/* Bin detail: zone picker row */
.binmeta { margin-bottom:14px; }
.binmeta__field { display:flex; align-items:center; gap:10px; }
.binmeta__field > span { color:var(--muted); font-family:var(--display); font-weight:600; text-transform:uppercase;
  letter-spacing:.05em; font-size:12px; flex:none; }
.binmeta__field select { flex:1; min-width:0; }

