/* =====================================================================
   v3 — modern UI: glass header, cards, grid/list, toasts, lightbox, mobile nav
   (loaded after styles.css, so these rules refine the base look)
   ===================================================================== */
:root{
  --glass:rgba(255,255,255,.68);
  --glass-border:rgba(255,255,255,.8);
  --low:#16A34A;
  --low-ink:#FFFFFF;
  --low-soft:#DDF6E5;
  --card-shadow:0 1px 2px rgba(27,42,32,.05), 0 8px 24px rgba(27,42,32,.07);
  --card-shadow-hover:0 2px 4px rgba(27,42,32,.06), 0 16px 36px rgba(27,42,32,.14);
  --bg-a:rgba(160,214,180,.55);
  --bg-b:rgba(170,200,240,.45);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --glass:rgba(22,32,24,.62); --glass-border:rgba(255,255,255,.09);
    --low:#4ADE80; --low-ink:#04220F; --low-soft:rgba(74,222,128,.13);
    --card-shadow:0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.35);
    --card-shadow-hover:0 2px 4px rgba(0,0,0,.4), 0 16px 36px rgba(0,0,0,.5);
    --bg-a:rgba(46,110,70,.35); --bg-b:rgba(50,80,140,.28);
  }
}
:root[data-theme="dark"]{
  --glass:rgba(22,32,24,.62); --glass-border:rgba(255,255,255,.09);
  --low:#4ADE80; --low-ink:#04220F; --low-soft:rgba(74,222,128,.13);
  --card-shadow:0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.35);
  --card-shadow-hover:0 2px 4px rgba(0,0,0,.4), 0 16px 36px rgba(0,0,0,.5);
  --bg-a:rgba(46,110,70,.35); --bg-b:rgba(50,80,140,.28);
}

body{
  background:
    radial-gradient(900px 520px at 8% -8%, var(--bg-a), transparent 62%),
    radial-gradient(800px 500px at 100% 0%, var(--bg-b), transparent 58%),
    var(--paper);
  background-attachment:fixed;
}
body.no-scroll{ overflow:hidden; }
kbd{
  font:600 11px 'IBM Plex Mono', monospace; color:var(--ink-soft);
  border:1px solid var(--rule); border-bottom-width:2px; border-radius:6px; background:var(--surface); padding:1px 6px;
}

/* ---------- sticky glass header ---------- */
.wrap{ padding-top:12px; }
header.top{
  position:sticky; top:10px; z-index:70;
  align-items:center;
  margin:0 0 18px; padding:11px 18px;
  border:1px solid var(--glass-border); border-bottom:1px solid var(--glass-border);
  border-radius:18px;
  background:var(--glass);
  -webkit-backdrop-filter:saturate(170%) blur(18px); backdrop-filter:saturate(170%) blur(18px);
  box-shadow:0 2px 12px rgba(27,42,32,.07);
  transition:box-shadow .2s ease, background .2s ease;
}
header.top.scrolled{ box-shadow:0 10px 34px rgba(27,42,32,.18); }
header.top .brand{ align-items:center; gap:10px; }
header.top h1{ font-size:24px; }
.logo-mark{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:11px;
  background:linear-gradient(135deg, #22C55E, #15803D); color:#fff;
  font:700 19px 'Zilla Slab', serif; box-shadow:0 4px 12px rgba(22,163,74,.35);
}
header.top .stamp{ border:0; background:color-mix(in srgb, var(--ink) 6%, transparent); border-radius:999px; padding:5px 11px; }

.hint{ border-radius:14px; border:1px solid var(--rule); background:color-mix(in srgb, var(--surface) 70%, transparent); line-height:1.55; }
.hint-keys{ display:block; margin-top:6px; font-size:12px; color:var(--ink-faint); }

/* ---------- tabs (segmented) ---------- */
.tabs{ display:inline-flex; gap:4px; padding:4px; margin-bottom:14px; border-radius:14px; background:color-mix(in srgb, var(--ink) 7%, transparent); }
.tab{ border:0; background:transparent; border-radius:10px; padding:8px 16px; color:var(--ink-soft); transition:background .15s, color .15s, box-shadow .15s; }
.tab:hover{ color:var(--ink); }
.tab.on{ background:var(--surface); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.12); border:0; }

/* ---------- search ---------- */
.search-row{ align-items:stretch; margin-bottom:14px; }
#search{
  padding:15px 88px 15px 46px; border-radius:16px; border:1.5px solid transparent;
  background:var(--surface); box-shadow:var(--card-shadow);
  transition:border-color .15s, box-shadow .15s;
}
#search:focus{ outline:none; border-color:var(--low); box-shadow:0 0 0 4px color-mix(in srgb, var(--low) 22%, transparent), var(--card-shadow); }
.search-box .search-ico{ left:16px; }
.clear-btn{
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  width:28px; height:28px; border-radius:50%; border:0; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  background:color-mix(in srgb, var(--ink) 12%, transparent); color:var(--ink-soft);
  transition:background .12s, color .12s, transform .12s;
}
.clear-btn:hover{ background:var(--accent); color:var(--accent-ink); transform:translateY(-50%) scale(1.08); }
.clear-btn[hidden], .kbd-hint[hidden]{ display:none; }
.kbd-hint{ position:absolute; right:14px; top:50%; transform:translateY(-50%); pointer-events:none; opacity:.85; }
.img-btn{ border-radius:16px; border:0; background:linear-gradient(135deg, #F97316, #DC2626); color:#fff; box-shadow:0 6px 16px rgba(220,38,38,.28); transition:transform .12s, box-shadow .12s; }
.img-btn:hover:not(:disabled){ background:linear-gradient(135deg, #FB923C, #EF4444); color:#fff; transform:translateY(-1px); box-shadow:0 10px 22px rgba(220,38,38,.34); }

/* ---------- filters ---------- */
.filters{ gap:8px 10px; margin-bottom:16px; }
.chip{
  --c:var(--ink-soft);
  color:var(--ink-soft); border:1.5px solid var(--rule); background:var(--surface);
  font-weight:500; transition:background .15s, color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.chip .dot{ background:var(--c); }
.chip:hover{ border-color:var(--c); transform:translateY(-1px); }
.chip.on{ background:color-mix(in srgb, var(--c) 13%, var(--surface)); color:var(--c); border-color:var(--c); font-weight:600; box-shadow:0 2px 8px color-mix(in srgb, var(--c) 22%, transparent); }
.chip:not(.on){ opacity:.55; }
.chip:not(.on) .dot{ background:var(--ink-faint); }
.chip-group.collapsed{ max-height:80px; overflow:hidden; }
.chip-more{ border:0; background:transparent; color:var(--link); font:600 12.5px 'IBM Plex Sans', sans-serif; cursor:pointer; padding:6px 4px; }
.chip-more[hidden]{ display:none; }
.chip-more:hover{ text-decoration:underline; }
select#sort, select#category{ border-radius:12px; border:1.5px solid var(--rule); padding:8px 12px; }
.view-toggle{ display:inline-flex; padding:3px; gap:2px; border-radius:12px; background:color-mix(in srgb, var(--ink) 7%, transparent); }
.view-toggle button{
  width:34px; height:32px; border:0; border-radius:9px; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  background:transparent; color:var(--ink-soft); transition:background .15s, color .15s;
}
.view-toggle button:hover{ color:var(--ink); }
.view-toggle button.on{ background:var(--surface); color:var(--low); box-shadow:0 1px 3px rgba(0,0,0,.14); }

/* ---------- lowest-price banner (green) ---------- */
#best{ border:1.5px solid var(--low); border-radius:16px; background:linear-gradient(90deg, var(--low-soft), var(--surface) 55%); box-shadow:var(--card-shadow); }
#best .badge{ background:var(--low); color:var(--low-ink); border-radius:999px; padding:5px 12px; }
#best .price{ color:var(--low); font-size:22px; }

/* ---------- product cards ---------- */
.results{ background:transparent; border:0; box-shadow:none; overflow:visible; gap:12px; }
.results .empty{ background:var(--surface); border:1px dashed var(--rule); border-radius:16px; }
.row{
  position:relative; overflow:hidden;
  padding:14px 16px 14px 22px; gap:14px;
  border:1px solid var(--rule); border-bottom:1px solid var(--rule); border-radius:18px;
  background:var(--surface); box-shadow:var(--card-shadow);
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.row:nth-child(even){ background:var(--surface); }
.row:last-child{ border-bottom:1px solid var(--rule); }
.row:hover{ transform:translateY(-2px); box-shadow:var(--card-shadow-hover); }
.row .stripe{ position:absolute; left:0; top:0; bottom:0; width:6px; flex:none; align-self:auto; background:var(--c, var(--rule)); }
.row.cheapest{
  border-color:var(--low);
  box-shadow:0 0 0 1px var(--low), 0 10px 28px color-mix(in srgb, var(--low) 20%, transparent);
  background:linear-gradient(90deg, var(--low-soft), var(--surface) 42%);
}
.row.cheapest .stripe{ background:var(--low); }
.row .main .name{ font-size:15px; font-weight:500; line-height:1.35; }
.row .thumb{ width:68px; height:68px; border-radius:14px; border:1px solid var(--rule); object-fit:cover; transition:transform .15s; }
.row img.thumb:hover{ transform:scale(1.04); }
.row .price-col{ font-size:19px; font-weight:700; letter-spacing:-.2px; display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.row.cheapest .price-col{ color:var(--low); }
.low-tag{
  display:inline-block; font:700 9.5px 'IBM Plex Sans', sans-serif; letter-spacing:.07em; text-transform:uppercase;
  background:var(--low); color:var(--low-ink); padding:2px 8px; border-radius:999px;
}

/* vibrant supplier badges */
.sup-tag{
  --c:var(--ink-soft);
  background:var(--c); color:#fff; padding:3px 11px 3px 8px; border-radius:999px;
  font-size:10.5px; letter-spacing:.05em;
  box-shadow:0 3px 8px color-mix(in srgb, var(--c) 35%, transparent);
}
.sup-tag .dot{ background:#fff; opacity:.9; }
.tg-tag{ background:color-mix(in srgb, #2A8AC4 12%, transparent); padding:2px 8px; border-radius:999px; }
.cat-tag, .code-tag{ background:color-mix(in srgb, var(--ink) 6%, transparent); padding:2px 8px; border-radius:999px; }

/* order buttons */
.wa-order{ gap:6px; }
.wa-order .wa-qty{ width:48px; border-radius:10px; padding:8px 4px; }
.wa-order .wa-btn{ border-radius:10px; padding:8px 14px; font-size:12.5px; background:linear-gradient(135deg, #34D399, #16A34A); border-color:transparent; box-shadow:0 4px 12px rgba(22,163,74,.3); transition:transform .12s, box-shadow .12s; }
.wa-order .wa-btn:hover{ background:linear-gradient(135deg, #2FC58C, #12863D); border-color:transparent; transform:translateY(-1px); box-shadow:0 8px 18px rgba(22,163,74,.38); }
.wa-copy{
  width:34px; height:34px; border-radius:10px; cursor:pointer; flex:0 0 auto;
  display:inline-flex; align-items:center; justify-content:center;
  border:1.3px solid var(--rule); background:var(--surface); color:var(--ink-soft);
  transition:background .15s, color .15s, border-color .15s;
}
.wa-copy:hover{ border-color:var(--low); color:var(--low); }
.wa-copy.done{ background:var(--low); border-color:var(--low); color:var(--low-ink); }
.row .action a{ border-radius:10px; }
.row .contact-link{ font-size:11px; }

/* ---------- GRID view ---------- */
.results.grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(224px, 1fr)); gap:16px; align-items:stretch; }
.results.grid .empty{ grid-column:1 / -1; }
.results.grid .row{ flex-direction:column; flex-wrap:nowrap; align-items:stretch; gap:0; padding:0 0 14px; border-radius:20px; }
.results.grid .row .stripe{ position:static; width:auto; height:6px; flex:0 0 6px; order:-3; }
.results.grid .row .price-group{ display:contents; }
.results.grid .row .thumb{
  order:-2; width:100%; height:auto; aspect-ratio:1 / 1; border-radius:0; border:0; border-bottom:1px solid var(--rule);
  object-fit:cover; background:var(--surface-2);
}
.results.grid .row img.thumb:hover{ transform:none; }
/* PDF-catalog photos are only ~100px: show them small and crisp instead of blown up */
.results.grid .row .thumb.lowres{ width:128px; height:128px; aspect-ratio:auto; align-self:center; margin:16px auto 8px; border:1px solid var(--rule); border-radius:16px; }
.results.grid .row .thumb-ph{ display:flex; height:auto; min-height:120px; }
.results.grid .row .main{ order:0; flex:1 1 auto; padding:12px 14px 0; min-width:0; }
.results.grid .row .main .name{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:2.7em; }
.results.grid .row .price-col{ order:1; flex-direction:row-reverse; justify-content:flex-end; align-items:center; gap:10px; text-align:left; padding:10px 14px 0; font-size:22px; }
.results.grid .row .action{ order:2; padding:12px 14px 0; margin:0; }
.results.grid .row .action .wa-order .wa-btn{ flex:1; justify-content:center; }
.results.grid .row .action .wa-order .wa-qty{ width:52px; }
.results.grid .row .contact-link{ text-align:left; }
.results.grid .row .action a.tg-link{ display:flex; justify-content:center; }
.results.grid .row.is-tg .thumb{ width:100%; height:auto; }
.results.grid .row .post-text{ -webkit-line-clamp:2; }

/* ---------- panels ---------- */
.img-sup .is-name{ color:inherit; }
.img-panel{ border-radius:18px; border:1px solid var(--rule); box-shadow:var(--card-shadow); }
details.suppliers{ border-radius:16px; box-shadow:var(--card-shadow); }

/* ---------- toasts ---------- */
.toasts{
  position:fixed; z-index:800; left:50%; transform:translateX(-50%);
  bottom:calc(22px + env(safe-area-inset-bottom));
  width:min(440px, calc(100vw - 28px));
  display:flex; flex-direction:column; gap:10px; pointer-events:none;
}
.toast-item{
  position:relative; overflow:hidden; pointer-events:auto; cursor:pointer;
  display:flex; align-items:flex-start; gap:12px;
  padding:13px 14px 15px; border-radius:16px;
  background:var(--ink); color:var(--paper);
  box-shadow:0 14px 40px rgba(0,0,0,.32);
  animation:rc-toast-in .28s cubic-bezier(.2,.9,.3,1.2) both;
}
.toast-item.out{ animation:rc-toast-out .2s ease forwards; }
.toast-item .ti{
  flex:0 0 auto; width:26px; height:26px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  background:#3B82F6; color:#fff;
}
.toast-item.success .ti{ background:#22C55E; }
.toast-item.error .ti{ background:#EF4444; }
.toast-item .tt{ flex:1; min-width:0; font-size:13.5px; line-height:1.4; display:flex; flex-direction:column; gap:2px; word-break:break-word; }
.toast-item .tt b{ font-size:14px; }
.toast-item .tt span{ opacity:.88; }
.toast-item .tx{ flex:0 0 auto; border:0; background:transparent; color:inherit; opacity:.55; cursor:pointer; font-size:13px; padding:2px 4px; }
.toast-item .tx:hover{ opacity:1; }
.toast-item .tbar{ position:absolute; left:0; bottom:0; height:3px; width:100%; background:#3B82F6; transform-origin:left; animation:rc-toast-bar linear forwards; }
.toast-item.success .tbar{ background:#22C55E; }
.toast-item.error .tbar{ background:#EF4444; }
@keyframes rc-toast-in{ from{ opacity:0; transform:translateY(18px) scale(.96); } to{ opacity:1; transform:none; } }
@keyframes rc-toast-out{ to{ opacity:0; transform:translateY(10px) scale(.96); } }
@keyframes rc-toast-bar{ from{ transform:scaleX(1); } to{ transform:scaleX(0); } }

/* ---------- full-screen image viewer ---------- */
.lightbox{
  position:fixed; inset:0; z-index:700;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px;
  padding:56px 64px 24px; background:rgba(6,12,8,.9);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  animation:rc-fade .18s ease both;
}
.lightbox[hidden]{ display:none; }
.lb-img{
  max-width:100%; max-height:calc(100vh - 190px); width:auto; height:auto; object-fit:contain;
  border-radius:16px; background:#fff; box-shadow:0 20px 60px rgba(0,0,0,.55);
  animation:rc-pop .22s cubic-bezier(.2,.9,.3,1.1) both;
}
.lb-img.small{ width:min(82vw, 340px); height:auto; }   /* ~100px catalog photos: show them a comfortable size */
.lb-cap{ color:#fff; text-align:center; max-width:min(720px, 100%); }
.lb-name{ font-size:16px; font-weight:600; line-height:1.35; margin-bottom:8px; }
.lb-meta{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:center; }
.lb-price{ font:700 20px 'IBM Plex Sans', sans-serif; color:#4ADE80; }
.lb-count{ font:12px 'IBM Plex Mono', monospace; opacity:.6; }
.lb-btn{
  position:absolute; width:46px; height:46px; border-radius:50%; border:0; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.14); color:#fff; transition:background .15s, transform .15s;
}
.lb-btn:hover{ background:rgba(255,255,255,.28); transform:scale(1.06); }
.lb-close{ top:16px; right:16px; }
.lb-prev{ left:14px; top:50%; margin-top:-23px; }
.lb-next{ right:14px; top:50%; margin-top:-23px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next{ display:none; }
@keyframes rc-fade{ from{ opacity:0; } to{ opacity:1; } }
@keyframes rc-pop{ from{ opacity:0; transform:scale(.94); } to{ opacity:1; transform:none; } }

/* ---------- mobile bottom navigation ---------- */
.bottom-nav{ display:none; }

@media (min-width:721px){
  .lightbox{ padding-left:96px; padding-right:96px; }
}
@media (max-width:720px){
  .wrap{ padding:8px 12px calc(96px + env(safe-area-inset-bottom)); }
  header.top{ top:6px; padding:9px 12px; border-radius:16px; gap:8px; flex-direction:row; align-items:center; }
  header.top .tagline{ display:none; }
  header.top h1{ font-size:20px; }
  .logo-mark{ width:30px; height:30px; font-size:17px; border-radius:10px; }
  header.top .stamp{ display:none; }
  header.top h1{ white-space:nowrap; }
  header.top .top-right{ gap:10px; margin-left:auto; flex-wrap:nowrap; }
  .top-link{ font-size:12px; }
  .hint{ font-size:12.5px; padding:9px 12px; }
  .tabs{ display:none; }                       /* the bottom bar replaces the top tabs */
  .search-row{ gap:8px; }
  .img-btn{ padding:0 14px; font-size:18px; }
  .filters{ gap:8px; }
  .filters .spacer{ display:none; }
  .chip-group, .chip-group.collapsed{ flex-wrap:nowrap; overflow-x:auto; max-height:none; width:100%; padding:2px 2px 6px; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  .chip-group::-webkit-scrollbar{ display:none; }
  .chip{ flex:0 0 auto; white-space:nowrap; }
  .chip-more{ display:none !important; }
  .view-toggle{ margin-left:auto; }
  .row{ padding:12px 12px 12px 18px; border-radius:16px; }
  .row .action{ flex:1 1 100%; margin:4px 0 0; padding-left:0; }
  .results.grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
  .results.grid .row{ padding-bottom:12px; border-radius:16px; }
  .results.grid .row .main{ padding:10px 10px 0; }
  .results.grid .row .main .name{ font-size:13px; }
  .results.grid .row .price-col{ padding:8px 10px 0; font-size:18px; }
  .results.grid .row .action{ padding:10px 10px 0; }
  .results.grid .row .wa-order{ flex-wrap:wrap; }
  .results.grid .row .wa-order .wa-qty{ width:42px; }
  .results.grid .row .wa-order .wa-btn{ padding:8px 10px; }
  .lightbox{ padding:60px 12px 18px; }
  .lb-prev{ left:6px; } .lb-next{ right:6px; }
  .lb-btn{ width:40px; height:40px; background:rgba(255,255,255,.2); }
  .toasts{ bottom:calc(84px + env(safe-area-inset-bottom)); }
  .kbd-hint, .hint-keys{ display:none; }
  #search{ padding-right:52px; }

  .bottom-nav{
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:80;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom));
    background:var(--glass); border-top:1px solid var(--glass-border);
    -webkit-backdrop-filter:saturate(170%) blur(18px); backdrop-filter:saturate(170%) blur(18px);
    box-shadow:0 -8px 28px rgba(27,42,32,.12);
  }
  .bottom-nav button{
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    padding:7px 4px; border:0; border-radius:14px; background:transparent; cursor:pointer;
    color:var(--ink-faint); font:600 10.5px 'IBM Plex Sans', sans-serif; transition:color .15s, background .15s;
    -webkit-tap-highlight-color:transparent;
  }
  .bottom-nav button.on{ color:var(--low); background:color-mix(in srgb, var(--low) 13%, transparent); }
  .bottom-nav button:active{ transform:scale(.95); }
  .nav-ico{ position:relative; display:inline-flex; }
  .nav-badge{
    position:absolute; top:-6px; left:14px; min-width:17px; height:17px; padding:0 4px; border-radius:999px;
    background:#EF4444; color:#fff; font:700 9.5px/17px 'IBM Plex Sans', sans-serif; text-align:center; font-style:normal;
  }
  .nav-badge[hidden]{ display:none; }
}
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* =====================================================================
   v4 — Requirement board (out-of-stock watch list + persistent alerts)
   ===================================================================== */
.req-tab-count{ background:var(--accent); color:var(--accent-ink); border-radius:999px; padding:1px 7px; font-size:11px; }
.req-tab-count[hidden]{ display:none; }

.requirement-panel{ margin-bottom:18px; }
.req-help{
  background:color-mix(in srgb, var(--surface) 70%, transparent); border:1px solid var(--rule); border-radius:14px;
  padding:12px 16px; font-size:13px; line-height:1.55; color:var(--ink-soft); margin-bottom:14px;
}
.req-help b{ color:var(--ink); }

.req-form{
  display:flex; gap:16px; padding:16px; margin-bottom:20px;
  background:var(--surface); border:1px solid var(--rule); border-radius:18px; box-shadow:var(--card-shadow);
}
.req-photo-drop{
  position:relative; flex:0 0 160px; height:160px; border-radius:14px; cursor:pointer;
  border:2px dashed var(--rule); background:var(--surface-2);
  display:flex; align-items:center; justify-content:center; text-align:center; padding:10px;
  transition:border-color .15s, background .15s;
}
.req-photo-drop:hover, .req-photo-drop:focus-visible{ border-color:var(--low); background:color-mix(in srgb, var(--low) 6%, var(--surface-2)); outline:none; }
.req-photo-drop span{ font-size:12px; color:var(--ink-faint); line-height:1.5; }
.req-photo-drop span b{ color:var(--ink-soft); }
.req-photo-drop img{ width:100%; height:100%; object-fit:cover; border-radius:12px; }
.req-photo-clear{
  position:absolute; top:6px; right:6px; width:26px; height:26px; border-radius:50%; border:0; cursor:pointer;
  background:rgba(0,0,0,.55); color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px;
}
.req-photo-clear[hidden]{ display:none; }
.req-form-right{ flex:1; display:flex; flex-direction:column; gap:8px; min-width:0; }
.req-label{ font-size:12px; color:var(--ink-faint); font-weight:600; }
#reqName{
  padding:11px 13px; border-radius:12px; border:1.5px solid var(--rule); background:var(--surface);
  color:var(--ink); font:14px 'IBM Plex Sans', sans-serif;
}
#reqName:focus{ outline:none; border-color:var(--low); box-shadow:0 0 0 3px color-mix(in srgb, var(--low) 20%, transparent); }
.req-form-right .btn-primary{ align-self:flex-start; border-radius:12px; }

.req-list-h{ font-size:15px; margin:0 0 12px; display:flex; align-items:center; gap:8px; }
.req-list{ display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:12px; }
.req-list .empty{ grid-column:1/-1; background:var(--surface); border:1px dashed var(--rule); border-radius:14px; padding:24px; text-align:center; color:var(--ink-faint); }
.req-card{
  position:relative; display:flex; gap:12px; align-items:center; padding:10px;
  background:var(--surface); border:1px solid var(--rule); border-radius:14px; box-shadow:var(--card-shadow);
}
.req-thumb{ width:52px; height:52px; border-radius:10px; object-fit:cover; flex:0 0 auto; border:1px solid var(--rule); }
.req-thumb-ph{ display:flex; align-items:center; justify-content:center; font-size:20px; background:var(--surface-2); }
.req-card-body{ flex:1; min-width:0; }
.req-card-name{ font-size:13.5px; font-weight:500; line-height:1.3; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.req-card-meta{ margin-top:4px; }
.req-match-badge{ font:600 11px 'IBM Plex Sans', sans-serif; background:var(--low-soft); color:var(--low); padding:2px 8px; border-radius:999px; }
.req-waiting{ font-size:11px; color:var(--ink-faint); }
.req-remove{
  flex:0 0 auto; width:26px; height:26px; border-radius:50%; border:1px solid var(--rule); background:var(--surface);
  color:var(--ink-faint); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:12px;
}
.req-remove:hover{ border-color:var(--accent); color:var(--accent); }

/* ---- persistent alerts (right side, until dismissed) ---- */
.req-alerts{
  position:fixed; z-index:750; top:96px; right:20px; width:min(340px, calc(100vw - 32px));
  display:flex; flex-direction:column; gap:12px; pointer-events:none;
}
.ra-card{
  pointer-events:auto; position:relative; overflow:hidden; display:flex; gap:12px; align-items:flex-start;
  padding:14px 14px 14px 16px; border-radius:16px;
  background:var(--surface); border:1.5px solid var(--accent);
  box-shadow:0 12px 34px color-mix(in srgb, var(--accent) 30%, transparent), var(--card-shadow);
  animation:ra-in .3s cubic-bezier(.2,.9,.3,1.2) both, ra-pulse 1.6s ease-in-out infinite;
}
.ra-thumb{ width:52px; height:52px; border-radius:10px; object-fit:cover; flex:0 0 auto; border:1px solid var(--rule); }
.ra-thumb-ph{ display:flex; align-items:center; justify-content:center; font-size:20px; background:var(--surface-2); }
.ra-body{ flex:1; min-width:0; }
.ra-h{ font-size:13px; line-height:1.35; }
.ra-h b{ color:var(--accent); }
.ra-sup{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); margin-top:2px; }
.ra-post{ font-size:12px; color:var(--ink-soft); margin-top:2px; }
.ra-open{ display:inline-block; margin-top:6px; font-size:11.5px; color:var(--link); }
.ra-stop{
  flex:0 0 auto; font:700 12px 'IBM Plex Sans', sans-serif; padding:7px 12px; border-radius:9px; cursor:pointer;
  border:0; background:var(--accent); color:var(--accent-ink);
}
.ra-stop:hover{ filter:brightness(1.08); }
@keyframes ra-in{ from{ opacity:0; transform:translateX(24px) scale(.96); } to{ opacity:1; transform:none; } }
@keyframes ra-pulse{ 0%,100%{ box-shadow:0 12px 34px color-mix(in srgb, var(--accent) 30%, transparent), var(--card-shadow); } 50%{ box-shadow:0 12px 34px color-mix(in srgb, var(--accent) 55%, transparent), var(--card-shadow); } }

@media (max-width:720px){
  .req-form{ flex-direction:column; }
  .req-photo-drop{ flex:0 0 auto; width:100%; }
  .req-alerts{ top:auto; bottom:calc(88px + env(safe-area-inset-bottom)); right:10px; left:10px; width:auto; }
}
@media (prefers-reduced-motion: reduce){
  .ra-card{ animation:ra-in .01ms both; }
}
