/* =====================================================================
   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;
  animation:rcCardFadeIn .3s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes rcCardFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.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; }
}

/* =====================================================================
   v5 — Trending board (marketplace trends matched against our suppliers)
   ===================================================================== */
.req-form-right input[type="text"], .req-form-right input[type="number"], .req-form-right select{
  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; width:100%;
}
.req-form-right input[type="text"]:focus, .req-form-right input[type="number"]:focus, .req-form-right select:focus{
  outline:none; border-color:var(--low); box-shadow:0 0 0 3px color-mix(in srgb, var(--low) 20%, transparent);
}
.trend-row{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
.trend-row > div{ display:flex; flex-direction:column; gap:6px; min-width:0; }

.trend-list .req-card{ align-items:flex-start; flex-direction:column; }
.trend-card-top{ display:flex; gap:12px; align-items:center; width:100%; }
.trend-card-meta-line{ font-size:11.5px; color:var(--ink-faint); margin-top:2px; }
.trend-status{ margin-top:8px; width:100%; }
.trend-match-head{
  font-size:12px; font-weight:600; color:var(--low); background:var(--low-soft);
  border-radius:10px 10px 0 0; padding:7px 10px;
}
.trend-match-list{
  display:flex; flex-direction:column; max-height:190px; overflow-y:auto;
  border:1px solid var(--low-soft); border-top:0; border-radius:0 0 10px 10px;
}
.trend-match-row{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  font-size:12px; color:var(--ink-soft); padding:6px 10px; border-top:1px solid var(--rule);
  text-decoration:none;
}
.trend-match-row:first-child{ border-top:0; }
a.trend-match-row:hover{ background:var(--low-soft); color:var(--low); }
.trend-match-row-static{ color:var(--ink-faint); }
.trend-open{ font-size:10.5px; font-weight:600; color:var(--link); flex:0 0 auto; }
a.trend-match-row:hover .trend-open{ color:inherit; }
.trend-margin{ font-weight:700; }
.trend-nomatch{
  font-size:12px; background:color-mix(in srgb, var(--accent) 14%, var(--surface-2)); color:var(--accent);
  border-radius:10px; padding:8px 10px;
}
.trend-wholesale-links{ display:flex; flex-wrap:wrap; gap:6px 12px; margin-top:6px; }
.trend-wholesale-links a{ font-size:11px; font-weight:600; color:var(--link); text-decoration:underline; }
.trend-actions{ display:flex; gap:6px; margin-top:8px; }
.trend-actions button{
  font:600 11px 'IBM Plex Sans', sans-serif; padding:6px 10px; border-radius:8px; cursor:pointer;
  border:1px solid var(--rule); background:var(--surface); color:var(--ink-soft);
}
.trend-actions button:hover{ border-color:var(--accent); color:var(--accent); }
.trend-list .req-card[data-status="listed"]{ opacity:.55; }

@media (max-width:720px){
  .trend-row{ grid-template-columns:1fr; }
}

/* =====================================================================
   v5 — left menu (desktop: fixed column, below 1000px: slide-in drawer) + AI Salah chat
   ===================================================================== */
:root{ --side-w:236px; }
body.side-collapsed{ --side-w:70px; }

.menu-btn{
  display:none; align-items:center; justify-content:center; flex:0 0 auto;
  width:38px; height:38px; margin-right:10px; border-radius:12px; cursor:pointer;
  border:1px solid var(--rule); background:var(--surface); color:var(--ink); font-size:19px; line-height:1;
}
.menu-btn:hover{ border-color:var(--low); }

.side-menu{
  position:fixed; z-index:120; top:0; left:0; bottom:0; width:var(--side-w);
  display:flex; flex-direction:column; padding:14px 10px calc(14px + env(safe-area-inset-bottom));
  background:var(--glass); border-right:1px solid var(--glass-border);
  -webkit-backdrop-filter:saturate(170%) blur(18px); backdrop-filter:saturate(170%) blur(18px);
  box-shadow:4px 0 24px rgba(27,42,32,.08);
  transition:transform .22s ease, width .2s ease;
  overflow-x:hidden; overflow-y:auto;
}
.side-head{ display:flex; align-items:center; gap:10px; padding:2px 6px 14px; }
.side-title{ font:700 19px 'Zilla Slab', serif; color:var(--ink); white-space:nowrap; }
.side-collapse{
  margin-left:auto; width:28px; height:28px; border-radius:9px; border:1px solid var(--rule); cursor:pointer;
  background:var(--surface); color:var(--ink-soft); font-size:16px; line-height:1; transition:transform .2s;
}
.side-nav{ display:flex; flex-direction:column; gap:3px; flex:1; }
.side-sep{ height:1px; margin:8px 6px; background:var(--rule); }
.side-item{
  position:relative; display:flex; align-items:center; gap:12px; width:100%; box-sizing:border-box;
  padding:10px 12px; border:0; border-radius:12px; background:transparent; cursor:pointer;
  color:var(--ink-soft); font:600 14px 'IBM Plex Sans', sans-serif; text-align:left; text-decoration:none;
  transition:background .15s, color .15s; -webkit-tap-highlight-color:transparent;
}
.side-item:hover{ background:color-mix(in srgb, var(--ink) 7%, transparent); color:var(--ink); }
.side-item.on{ background:color-mix(in srgb, var(--low) 15%, transparent); color:var(--low); }
.side-item.on::before{ content:''; position:absolute; left:-10px; top:9px; bottom:9px; width:4px; border-radius:0 4px 4px 0; background:var(--low); }
.si-ico{ flex:0 0 auto; width:22px; text-align:center; font-size:18px; }
.si-txt{ flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.side-badge{
  flex:0 0 auto; min-width:20px; padding:1px 7px; border-radius:999px; text-align:center;
  background:var(--accent); color:var(--accent-ink); font:700 11px/18px 'IBM Plex Sans', sans-serif;
}
.side-badge-soft{ background:color-mix(in srgb, var(--ink) 10%, transparent); color:var(--ink-soft); }
.side-badge[hidden]{ display:none; }
.side-new{
  flex:0 0 auto; padding:1px 6px; border-radius:6px; font:800 9.5px/16px 'IBM Plex Sans', sans-serif; letter-spacing:.05em;
  color:#fff; background:linear-gradient(135deg,#8B5CF6,#EC4899);
}
.side-ai .si-ico{ filter:drop-shadow(0 0 6px rgba(139,92,246,.45)); }
.side-foot{ border-top:1px solid var(--rule); padding-top:10px; margin-top:10px; }
.side-backdrop{ position:fixed; inset:0; z-index:110; background:rgba(10,20,14,.5); animation:rc-fade .2s both; }
.side-backdrop[hidden]{ display:none; }

/* collapsed rail (desktop) */
body.side-collapsed .side-title, body.side-collapsed .si-txt, body.side-collapsed .side-new{ display:none; }
body.side-collapsed .side-head{ flex-direction:column; padding-bottom:10px; gap:8px; }
body.side-collapsed .side-head .logo-mark{ display:none; }
body.side-collapsed .side-collapse{ margin:0; transform:rotate(180deg); }
body.side-collapsed .side-item{ justify-content:center; padding:10px 0; }
body.side-collapsed .side-badge{ position:absolute; top:2px; right:6px; min-width:16px; padding:0 4px; font-size:10px; line-height:16px; }

@media (min-width:1000px){
  body.has-side{ padding-left:var(--side-w); transition:padding-left .2s ease; }
  body.has-side .tabs{ display:none; }        /* the left menu replaces the top tabs */
  body.has-side .lightbox{ padding-left:calc(var(--side-w) + 40px); }
}
@media (max-width:999px){
  .menu-btn{ display:inline-flex; }
  .side-menu{ width:min(280px, 84vw); transform:translateX(-102%); box-shadow:none; background:var(--surface); }
  body.side-open .side-menu{ transform:none; box-shadow:8px 0 40px rgba(0,0,0,.3); }
  .side-collapse{ display:none; }
  /* the drawer is always full width, even if the desktop rail was collapsed */
  body.side-collapsed .side-title, body.side-collapsed .si-txt{ display:inline; }
  body.side-collapsed .side-new{ display:inline; }
  body.side-collapsed .side-head .logo-mark{ display:inline-flex; }
  body.side-collapsed .side-head{ flex-direction:row; }
  body.side-collapsed .side-item{ justify-content:flex-start; padding:10px 12px; }
  body.side-collapsed .side-badge{ position:static; min-width:20px; padding:1px 7px; font-size:11px; line-height:18px; }
}

/* ---------- AI Salah ---------- */
.ai-panel{
  display:flex; flex-direction:column; gap:12px; margin-bottom:16px; padding:16px;
  background:var(--surface); border:1px solid var(--rule); border-radius:20px; box-shadow:var(--card-shadow);
}
.ai-panel[hidden]{ display:none; }
.ai-head{ display:flex; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.ai-head > div{ flex:1 1 260px; }
.ai-title{ margin:0; font:700 22px 'Zilla Slab', serif; }
.ai-sub{ margin-top:2px; font-size:12.5px; color:var(--ink-faint); line-height:1.5; }
.ai-new{ border-radius:10px; }
.ai-notice{
  padding:10px 14px; border-radius:12px; font-size:13px; line-height:1.5;
  background:color-mix(in srgb, #F59E0B 16%, transparent); border:1px solid color-mix(in srgb, #F59E0B 55%, transparent); color:var(--ink);
}
.ai-log{
  display:flex; flex-direction:column; gap:10px; min-height:220px; max-height:min(58vh, 560px); overflow-y:auto;
  padding:4px 2px; scroll-behavior:smooth;
}
.ai-msg{ max-width:86%; padding:10px 14px; border-radius:16px; font-size:14px; line-height:1.6; word-wrap:break-word; overflow-wrap:anywhere; animation:rc-pop .18s both; }
.ai-msg p{ margin:0 0 6px; } .ai-msg p:last-child{ margin-bottom:0; }
.ai-msg ul{ margin:4px 0 6px; padding-left:20px; } .ai-msg li{ margin:2px 0; }
.ai-user{ align-self:flex-end; background:linear-gradient(135deg,#22C55E,#15803D); color:#fff; border-bottom-right-radius:5px; }
.ai-bot{ align-self:flex-start; background:color-mix(in srgb, var(--ink) 6%, transparent); border-bottom-left-radius:5px; }
.ai-err{ background:color-mix(in srgb, var(--accent) 14%, transparent); }
.ai-src{ display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; padding-top:8px; border-top:1px dashed var(--rule); font-size:11px; color:var(--ink-faint); }
.ai-src span{ padding:1px 8px; border-radius:999px; background:var(--surface); border:1px solid var(--rule); }
.ai-typing{ display:inline-flex; gap:3px; margin-right:6px; vertical-align:middle; }
.ai-typing i{ width:6px; height:6px; border-radius:50%; background:var(--ink-faint); animation:ai-dot 1s ease-in-out infinite; }
.ai-typing i:nth-child(2){ animation-delay:.15s; } .ai-typing i:nth-child(3){ animation-delay:.3s; }
@keyframes ai-dot{ 0%,80%,100%{ transform:translateY(0); opacity:.4; } 40%{ transform:translateY(-4px); opacity:1; } }
.ai-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.ai-chip{
  border:1.5px solid var(--rule); background:var(--surface); color:var(--ink-soft); border-radius:999px; padding:7px 13px; cursor:pointer;
  font:600 12.5px 'IBM Plex Sans', sans-serif; transition:border-color .15s, color .15s, background .15s;
}
.ai-chip:hover{ border-color:var(--low); color:var(--low); background:color-mix(in srgb, var(--low) 8%, transparent); }
.ai-form{ display:flex; gap:10px; align-items:flex-end; }
.ai-form textarea{
  flex:1; resize:none; padding:11px 14px; border-radius:14px; border:1.5px solid var(--rule); background:var(--surface); color:var(--ink);
  font:14px/1.5 'IBM Plex Sans', sans-serif;
}
.ai-form textarea:focus{ outline:none; border-color:var(--low); box-shadow:0 0 0 4px color-mix(in srgb, var(--low) 20%, transparent); }
.ai-send{ align-self:stretch; border-radius:14px; padding:0 22px; }
.ai-send:disabled{ opacity:.5; cursor:wait; }
.ai-foot{ font-size:11.5px; color:var(--ink-faint); }
@media (max-width:720px){
  .ai-panel{ padding:12px; border-radius:16px; }
  .ai-msg{ max-width:94%; }
  .ai-log{ max-height:52vh; }
  .ai-form{ flex-direction:column; align-items:stretch; }
  .ai-send{ padding:11px; }
}

/* =====================================================================
   v6 — AI Salah as big, easy-to-read cards (no chat box, no inner scroll box)
   ===================================================================== */
.ai-panel{ background:none; border:0; box-shadow:none; padding:0; gap:16px; }
.ai-head{ padding:0 2px; }
.ai-sub{ font-size:13.5px; }
.ai-log{ display:block; max-height:none; min-height:0; overflow:visible; padding:0; }
.ai-block{ display:flex; flex-direction:column; gap:18px; margin-bottom:18px; }

.ai-card{
  background:var(--surface); border:1px solid var(--rule); border-radius:20px; box-shadow:var(--card-shadow);
  padding:22px 24px; font-size:15.5px; line-height:1.65; color:var(--ink);
}
.ai-card-head{ display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.ai-card-ico{
  width:52px; height:52px; flex:0 0 auto; border-radius:16px; display:flex; align-items:center; justify-content:center;
  font-size:26px; background:var(--surface-2); border:1px solid var(--rule);
}
.ai-card h3{ margin:0; font:700 21px/1.3 'Zilla Slab', serif; }
.ai-card h4{ margin:18px 0 8px; font:700 13px 'IBM Plex Sans', sans-serif; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-faint); }
.ai-todo{
  margin:0 0 14px; padding:12px 16px; border-radius:14px; font-size:15px; line-height:1.55;
  background:var(--low-soft); color:var(--ink); border:1px solid color-mix(in srgb, var(--low) 35%, transparent);
}
.ai-list{ list-style:none; margin:0; padding:0; }
.ai-list li{ padding:10px 0; border-top:1px solid var(--rule); }
.ai-list li:first-child{ border-top:0; }
.ai-stamp{ font-size:12.5px; color:var(--ink-faint); text-align:center; padding:2px 8px; }
.ai-loading{ display:flex; align-items:center; gap:12px; font-size:15px; color:var(--ink-soft); }

/* winner cards */
.ai-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap:18px; margin-top:18px; }
.ai-win{ border-width:2px; }
.ai-v-win{ border-color:color-mix(in srgb, var(--low) 65%, var(--rule)); }
.ai-v-mid{ border-color:color-mix(in srgb, #F59E0B 60%, var(--rule)); }
.ai-v-bad{ border-color:color-mix(in srgb, var(--accent) 55%, var(--rule)); }
.ai-win-head{ display:flex; align-items:center; gap:14px; }
.ai-thumb{ width:110px; height:110px; flex:0 0 auto; border-radius:16px; object-fit:cover; border:1px solid var(--rule); background:var(--surface-2); }
.ai-thumb-ph{ display:flex; align-items:center; justify-content:center; font-size:34px; }
.ai-win-title{ flex:1; min-width:0; }
.ai-win-title h3{ font-size:20px; word-break:break-word; }
.ai-verdict{ margin-top:6px; font-size:13.5px; font-weight:700; }
.ai-verdict{ color:var(--ink-soft); }
.ai-v-win .ai-verdict{ color:var(--low); }
.ai-v-mid .ai-verdict{ color:#B45309; }
.ai-v-bad .ai-verdict{ color:var(--accent); }
.ai-score{ flex:0 0 auto; text-align:center; padding:8px 14px; border-radius:16px; background:var(--surface-2); border:1px solid var(--rule); }
.ai-score b{ font:700 32px/1 'Zilla Slab', serif; }
.ai-score span{ font-size:13px; color:var(--ink-faint); }
.ai-money{ display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; margin-top:16px; }
.ai-money > div{ padding:12px 10px; border-radius:14px; background:var(--surface-2); border:1px solid var(--rule); text-align:center; }
.ai-money span{ display:block; font-size:12px; color:var(--ink-faint); line-height:1.3; }
.ai-money b{ display:block; margin-top:4px; font:700 24px/1.1 'Zilla Slab', serif; }
.ai-money-net{ background:var(--low-soft) !important; border-color:color-mix(in srgb, var(--low) 40%, transparent) !important; }
.ai-money-net b{ color:var(--low); }
.ai-note{ margin-top:8px; font-size:12.5px; color:var(--ink-faint); line-height:1.5; }
.ai-sups{ display:flex; flex-direction:column; gap:8px; }
.ai-sup{
  display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 14px; border-radius:12px;
  background:var(--surface-2); border:1px solid var(--rule); color:var(--ink); text-decoration:none; font-size:15px;
}
a.ai-sup:hover{ border-color:var(--low); }
.ai-sup span{ font-size:12px; font-weight:600; color:var(--link); flex:0 0 auto; }
.ai-bars{ display:grid; grid-template-columns:1fr 1fr; gap:10px 18px; }
.ai-bar-top{ display:flex; justify-content:space-between; font-size:13px; color:var(--ink-soft); }
.ai-bar-track{ height:8px; margin-top:4px; border-radius:99px; background:var(--surface-2); border:1px solid var(--rule); overflow:hidden; }
.ai-bar-track i{ display:block; height:100%; border-radius:99px; background:linear-gradient(90deg, #22C55E, #15803D); }

@media (max-width:720px){
  .ai-card{ padding:16px 16px; font-size:15px; border-radius:16px; }
  .ai-card h3{ font-size:18px; }
  .ai-card-ico{ width:44px; height:44px; font-size:22px; }
  .ai-grid{ grid-template-columns:1fr; }
  .ai-win-head{ flex-wrap:wrap; }
  .ai-thumb{ width:64px; height:64px; }
  .ai-money b{ font-size:20px; }
  .ai-bars{ grid-template-columns:1fr; }
}

/* =====================================================================
   v9 — Payout Calculator (purchase price -> Snapdeal net payout + profit %)
   ===================================================================== */
.po-grid{ display:grid; grid-template-columns:1fr; gap:16px; }
@media (min-width:840px){ .po-grid{ grid-template-columns:360px 1fr; align-items:start; } }
.po-col{ display:flex; flex-direction:column; gap:16px; }

.po-card{ padding:16px; background:var(--surface); border:1px solid var(--rule); border-radius:18px; box-shadow:var(--card-shadow); }
.po-h{ font:700 16px 'Zilla Slab', serif; margin:0 0 14px; }

.po-field{ margin-bottom:14px; }
.po-field:last-child{ margin-bottom:0; }
.po-field label{ display:block; font-size:12px; color:var(--ink-faint); font-weight:600; margin-bottom:5px; }
.po-inp-wrap{ position:relative; display:flex; align-items:center; }
.po-inp-wrap .po-prefix{ position:absolute; left:11px; color:var(--ink-faint); font-size:14px; pointer-events:none; }
.po-inp-wrap .po-suffix{ position:absolute; right:11px; color:var(--ink-faint); font-size:12.5px; pointer-events:none; }
.po-card input[type="number"]{
  width:100%; padding:9px 11px; border-radius:12px; border:1.5px solid var(--rule); background:var(--surface);
  color:var(--ink); font:14px 'IBM Plex Sans', sans-serif;
}
.po-card input[type="number"].po-with-prefix{ padding-left:26px; }
.po-card input[type="number"].po-with-suffix{ padding-right:34px; }
.po-card input[type="number"]:focus{ outline:none; border-color:var(--low); box-shadow:0 0 0 3px color-mix(in srgb, var(--low) 20%, transparent); }
.po-row2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.po-card details{ border-top:1px solid var(--rule); margin-top:14px; padding-top:14px; }
.po-card summary{ cursor:pointer; font-size:13px; font-weight:600; color:var(--ink); list-style:none; display:flex; align-items:center; gap:6px; }
.po-card summary::-webkit-details-marker{ display:none; }
.po-chev{ transition:transform .15s ease; font-size:10px; color:var(--ink-faint); }
.po-card details[open] .po-chev{ transform:rotate(90deg); }
.po-card details .po-field{ margin-top:14px; }

.po-check-row{ display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.po-check-row input{ width:16px; height:16px; accent-color:var(--low); }
.po-check-row label{ margin:0; color:var(--ink); font-size:13.5px; }

.po-reset-link{ background:none; border:none; color:var(--link); font-size:12px; cursor:pointer; padding:0; margin-top:12px; font-family:'IBM Plex Sans', sans-serif; text-decoration:underline; }

.po-suggest-box{ background:var(--surface-2); border:1px dashed var(--rule); border-radius:14px; padding:14px; margin-top:14px; }
.po-suggest-lbl{ font-size:12.5px; color:var(--ink-faint); }
.po-suggest-result{ display:flex; align-items:baseline; gap:10px; margin-top:10px; flex-wrap:wrap; }
.po-suggest-price{ font:700 24px/1 'Zilla Slab', serif; color:var(--low); }
.po-warn{ color:var(--accent); font-size:12.5px; margin-top:8px; }

.po-ledger{ width:100%; border-collapse:collapse; font:14px 'IBM Plex Mono', monospace; }
.po-ledger td{ padding:7px 0; }
.po-ledger td:first-child{ color:var(--ink-faint); font-family:'IBM Plex Sans', sans-serif; }
.po-ledger td:last-child{ text-align:right; white-space:nowrap; }
.po-ledger tr.po-sub td:last-child{ color:var(--accent); }
.po-ledger tr.po-subtotal td{ border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); font-weight:600; padding:9px 0; }
.po-ledger tr.po-subtotal + tr td{ padding-top:12px; }
.po-ledger tr.po-final td{ font-weight:700; font-size:16px; padding-top:12px; }
.po-ledger tr.po-final td:last-child{ color:var(--low); }

.po-stats{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:16px; }
@media (min-width:520px){ .po-stats{ grid-template-columns:repeat(4,1fr); } }
.po-stat{ padding:12px 10px; border-radius:14px; background:var(--surface-2); border:1px solid var(--rule); text-align:center; }
.po-stat-lbl{ font-size:11.5px; color:var(--ink-faint); line-height:1.3; }
.po-stat-val{ margin-top:4px; font:700 19px/1.1 'Zilla Slab', serif; font-variant-numeric:tabular-nums; }
.po-stat-cost .po-stat-val{ color:var(--accent); }
.po-stat-profit{ background:var(--low-soft); border-color:color-mix(in srgb, var(--low) 40%, transparent); }
.po-stat-profit .po-stat-val{ color:var(--low); }

.po-batch-band{ display:flex; flex-wrap:wrap; gap:16px; justify-content:space-between; }
.po-b-item{ flex:1 1 140px; }
.po-b-lbl{ font-size:12px; color:var(--ink-faint); margin-bottom:2px; }
.po-b-val{ font:700 20px/1.15 'Zilla Slab', serif; color:var(--low); font-variant-numeric:tabular-nums; }

@media (max-width:720px){
  .po-h{ font-size:15px; }
  .po-stat-val{ font-size:17px; }
}

/* ================= Task Manager ================= */
.task-dash{ display:grid; grid-template-columns:repeat(auto-fill, minmax(130px, 1fr)); gap:10px; margin-bottom:16px; }
.task-stat{ background:var(--surface); border:1px solid var(--rule); border-radius:12px; padding:12px 14px; }
.task-stat .n{ font:700 22px/1.1 'Zilla Slab', serif; }
.task-stat .l{ font-size:11px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.03em; margin-top:2px; }
.task-stat.warn .n{ color:var(--accent); }

.task-toolbar{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.task-filters{ display:flex; gap:6px; flex-wrap:wrap; }
.task-filter{ font:600 12.5px 'IBM Plex Sans', sans-serif; padding:6px 12px; border-radius:999px; border:1.3px solid var(--rule); background:var(--surface); color:var(--ink-soft); cursor:pointer; }
.task-filter.on{ background:var(--ink); color:var(--paper); border-color:var(--ink); }

.task-list{ display:flex; flex-direction:column; gap:8px; }
.task-card{ background:var(--surface); border:1px solid var(--rule); border-radius:12px; padding:12px 14px; cursor:pointer; display:flex; flex-direction:column; gap:6px; }
.task-card:hover{ border-color:var(--ink-faint); }
.task-card.overdue{ border-left:3px solid var(--accent); }
.task-card-top{ display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.task-card-title{ font-weight:600; font-size:14px; }
.task-card-meta{ display:flex; gap:6px; flex-wrap:wrap; font-size:11.5px; color:var(--ink-faint); align-items:center; }
.task-badge{ font:600 10.5px 'IBM Plex Mono', monospace; padding:2px 7px; border-radius:999px; white-space:nowrap; }
.task-badge-pri-HIGH{ background:color-mix(in srgb, var(--accent) 20%, transparent); color:var(--accent); }
.task-badge-pri-MEDIUM{ background:color-mix(in srgb, var(--ink) 12%, transparent); color:var(--ink-soft); }
.task-badge-pri-LOW{ background:color-mix(in srgb, var(--low) 18%, transparent); color:var(--low); }
.task-badge-status{ background:color-mix(in srgb, var(--ink) 8%, transparent); color:var(--ink-soft); }
.task-badge-overdue{ background:var(--accent); color:var(--accent-ink); }

.task-modal-overlay{ position:fixed; inset:0; z-index:300; background:color-mix(in srgb, var(--ink) 55%, transparent); display:flex; align-items:flex-start; justify-content:center; padding:24px 14px; overflow:auto; }
.task-modal-card{ width:100%; max-width:560px; background:var(--surface); border-radius:14px; box-shadow:var(--shadow); padding:20px; display:flex; flex-direction:column; gap:12px; }
.task-modal-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.task-modal-close{ border:none; background:none; font-size:20px; cursor:pointer; color:var(--ink-faint); line-height:1; }
.task-row{ display:flex; gap:10px; flex-wrap:wrap; }
.task-row > div{ flex:1 1 140px; min-width:0; }
.task-field label{ font-size:12px; color:var(--ink-faint); font-weight:600; display:block; margin-bottom:3px; }
.task-field input, .task-field select, .task-field textarea{ width:100%; font:500 13.5px 'IBM Plex Sans', sans-serif; padding:8px 10px; border-radius:8px; border:1.3px solid var(--rule); background:var(--paper); color:var(--ink); box-sizing:border-box; }
.task-field textarea{ resize:vertical; min-height:60px; }
.task-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.task-actions button{ font:600 12.5px 'IBM Plex Sans', sans-serif; padding:7px 14px; border-radius:8px; border:1.3px solid var(--rule); background:var(--surface); color:var(--ink-soft); cursor:pointer; }
.task-actions button.primary{ background:var(--ink); color:var(--paper); border-color:var(--ink); }
.task-actions button.danger{ border-color:var(--accent); color:var(--accent); }
.task-section-h{ font-size:12.5px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--ink-faint); margin:4px 0 2px; }
.task-checklist-item{ display:flex; align-items:center; gap:8px; font-size:13px; padding:4px 0; }
.task-checklist-item.done{ color:var(--ink-faint); text-decoration:line-through; }
.task-comment{ font-size:13px; padding:6px 0; border-bottom:1px dashed var(--rule); }
.task-comment b{ color:var(--ink); }
.task-comment .t{ font-size:10.5px; color:var(--ink-faint); margin-left:6px; }
.task-activity-row{ font-size:11.5px; color:var(--ink-faint); padding:2px 0; }
.task-attach-grid{ display:flex; gap:8px; flex-wrap:wrap; }
.task-attach-grid img{ width:64px; height:64px; object-fit:cover; border-radius:8px; border:1px solid var(--rule); }
.task-user-row{ display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--rule); font-size:13px; }
.task-user-row .role-pill{ font:600 10.5px 'IBM Plex Mono', monospace; padding:2px 8px; border-radius:999px; background:color-mix(in srgb, var(--ink) 10%, transparent); }
.task-user-row.inactive{ opacity:.5; }

@media (max-width:640px){
  .task-toolbar{ flex-direction:column; align-items:stretch; }
  .task-modal-card{ max-width:none; }
}

/* ================= Task Manager v2: Google Tasks-style quick add + rows ================= */
.gtask-quickadd{ display:flex; align-items:center; gap:8px; background:var(--surface); border:1.3px solid var(--rule); border-radius:10px; padding:8px 12px; margin-bottom:6px; }
.gtask-quickadd-plus{ font:700 16px/1 'IBM Plex Sans', sans-serif; color:var(--ink-faint); flex-shrink:0; }
.gtask-quickadd-input{ flex:1; min-width:0; border:none; background:none; font:500 13.5px 'IBM Plex Sans', sans-serif; color:var(--ink); padding:4px 0; }
.gtask-quickadd-input:focus{ outline:none; }
.gtask-quickadd-assign{ flex-shrink:0; max-width:160px; font:500 12px 'IBM Plex Sans', sans-serif; padding:5px 8px; border-radius:7px; border:1.3px solid var(--rule); background:var(--paper); color:var(--ink-soft); }
.gtask-more-link{ border:none; background:none; color:var(--link); font:500 11.5px 'IBM Plex Sans', sans-serif; cursor:pointer; padding:0; text-decoration:underline; text-underline-offset:2px; }

.task-list{ display:flex; flex-direction:column; gap:1px; background:var(--rule); border:1px solid var(--rule); border-radius:10px; overflow:hidden; }
.gtask-row{ display:flex; align-items:center; gap:10px; background:var(--surface); padding:9px 12px; }
.gtask-row.overdue{ background:color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.gtask-circle{ flex-shrink:0; width:20px; height:20px; border-radius:50%; border:1.6px solid var(--ink-faint); background:none; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:12px; color:#fff; padding:0; }
.gtask-circle:disabled{ cursor:default; opacity:.35; }
.gtask-circle.done{ background:var(--low); border-color:var(--low); }
.gtask-title-wrap{ flex:1; min-width:0; cursor:pointer; }
.gtask-row-title{ font:500 13.5px 'IBM Plex Sans', sans-serif; color:var(--ink); }
.gtask-row-title.done{ color:var(--ink-faint); text-decoration:line-through; }
.gtask-pills{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; flex-shrink:0; }
.gtask-pill{ font:500 10.5px 'IBM Plex Mono', monospace; padding:2px 7px; border-radius:999px; background:color-mix(in srgb, var(--ink) 8%, transparent); color:var(--ink-soft); white-space:nowrap; }
.gtask-pill-high{ background:none; padding:0 2px; }
.gtask-pill-overdue{ background:var(--accent); color:var(--accent-ink); }
.gtask-pill-status{ background:color-mix(in srgb, var(--link) 14%, transparent); color:var(--link); }

@media (max-width:640px){
  .gtask-quickadd{ flex-wrap:wrap; }
  .gtask-quickadd-assign{ max-width:none; flex:1 1 100%; order:3; }
  .gtask-row{ flex-wrap:wrap; }
  .gtask-pills{ order:3; width:100%; justify-content:flex-start; margin-left:30px; }
}
