* { box-sizing: border-box; }
body { margin: 0; font-family: "Cairo", "Segoe UI", Tahoma, sans-serif; background: #f6f4ef; color: #1c1c1c; padding-bottom: 84px; }
.top { background: #072a62; color: #fff; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 48px; height: 48px; }
.top h1 { font-size: 20px; margin: 0; }
.top p { font-size: 12px; margin: 2px 0 0; opacity: .85; }
#me button, #me span { font-size: 13px; }
#me button { background: #fff; color: #072a62; border: 0; border-radius: 8px; padding: 8px 12px; font-weight: 700; }
#me .pill { background: #e8b23a; color: #072a62; border-radius: 20px; padding: 6px 10px; font-weight: 700; }
#me .pill.pending { background: #d7d7d7; }

.searchbar { display: flex; gap: 8px; padding: 12px; position: sticky; top: 0; background: #f6f4ef; z-index: 5; }
.searchbar input { flex: 1; font-size: 17px; padding: 12px 14px; border: 2px solid #072a62; border-radius: 12px; }
.searchbar button { font-size: 16px; padding: 0 18px; border: 0; border-radius: 12px; background: #072a62; color: #fff; font-weight: 700; }
.suggest { padding: 0 12px 8px; font-size: 14px; }
.suggest b { color: #b3541e; }
.suggest a { margin-inline-start: 8px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 12px 8px; scrollbar-width: none; }
.chips button { white-space: nowrap; border: 1px solid #072a62; background: #fff; color: #072a62; border-radius: 20px; padding: 6px 12px; font-size: 13px; }
.chips button.on { background: #072a62; color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; padding: 6px 12px; }
.card { background: #fff; border-radius: 12px; padding: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 6px; }
.card h2 { font-size: 14px; margin: 0; line-height: 1.45; min-height: 40px; }
.card .meta { font-size: 12px; color: #666; }
.card .avail { font-size: 12px; font-weight: 700; }
.avail.in { color: #1e7d32; } .avail.out { color: #5a5a5a; } .avail.ask { color: #8a6d00; }
.card .price { font-size: 17px; font-weight: 800; color: #072a62; }
.card .noprice { font-size: 12px; color: #6b5400; background: #fdf3d7; border-radius: 8px; padding: 5px 8px; }
.card button { margin-top: auto; border: 0; border-radius: 9px; padding: 9px; font-size: 14px; font-weight: 700; background: #e8b23a; color: #072a62; }
.card button.inlist { background: #d7e6d7; color: #1e7d32; }

.morewrap { text-align: center; padding: 10px; }
.morewrap button { padding: 10px 26px; border-radius: 10px; border: 1px solid #072a62; background: #fff; color: #072a62; font-weight: 700; }
.infobar { margin: 10px 12px; background: #fdf3d7; border-radius: 10px; padding: 8px 12px; font-size: 13px; }

.cta { position: fixed; bottom: 0; right: 0; left: 0; background: #fff; border-top: 1px solid #ddd; padding: 10px 12px; display: flex; gap: 10px; z-index: 10; }
.cta .primary { flex: 1; }
button.primary, .primary.link { background: #072a62; color: #fff; border: 0; border-radius: 12px; padding: 13px; font-size: 16px; font-weight: 800; text-align: center; text-decoration: none; display: block; }
.ghost { background: #fff; color: #072a62; border: 1.5px solid #072a62; border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 700; text-decoration: none; text-align: center; }

dialog { border: 0; border-radius: 16px; padding: 18px; width: min(94vw, 420px); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin: 0 0 10px; font-size: 18px; color: #072a62; }
dialog label { display: block; font-size: 14px; font-weight: 700; margin: 10px 0 4px; }
dialog input { display: block; width: 100%; font-size: 16px; padding: 11px; border: 1.5px solid #999; border-radius: 10px; margin-top: 4px; }
dialog menu { display: flex; gap: 10px; padding: 0; margin: 14px 0 0; }
dialog menu .primary { flex: 1; }
.hint { font-size: 12.5px; color: #666; }
.err { color: #b3261e; font-size: 13.5px; font-weight: 700; }
.qitems { max-height: 34vh; overflow-y: auto; border: 1px solid #eee; border-radius: 10px; padding: 8px; margin-bottom: 6px; }
.qitems .qi { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13.5px; padding: 4px 0; border-bottom: 1px dashed #eee; }
.qitems .qi button { border: 0; background: #f2d7d5; color: #b3261e; border-radius: 6px; padding: 3px 8px; }
.qitems .qi input { width: 56px; padding: 4px; display: inline-block; margin: 0; }
.done { text-align: center; display: grid; gap: 10px; }

.notice { background: #fdecea; border-right: 5px solid #b3261e; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; font-weight: 800; color: #8f1d17; line-height: 1.6; }
#me .mini { background: #e8b23a; color: #072a62; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; margin-inline-start: 6px; }
.quote-card { border: 1px solid #ddd; border-radius: 10px; padding: 10px; margin: 8px 0; }
.quote-card .qhead { font-size: 14px; margin-bottom: 6px; }
.quote-card .qhead small { color: #666; }
.quote-card .changed { color: #b3541e; }
.approve-row { display: grid; gap: 8px; margin-top: 8px; }
#myquotes-list { max-height: 55vh; overflow-y: auto; }
.origin { color: #4a5a6a; font-weight: 700; }
.card button.altbtn { background: #fff; border: 1.5px solid #b3261e; color: #b3261e; margin-top: 0; }
#altmodal { border: 0; border-radius: 14px; padding: 18px; max-width: 480px; width: 92%; }
#altmodal h2 { margin: 0 0 10px; font-size: 18px; color: #072a62; }
#altmodal .notice { margin-bottom: 12px; }
.altrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid #eee; }
.altrow b { font-size: 14px; }
.altrow small { color: #666; font-size: 12px; }
.altrow .price { font-size: 15px; font-weight: 800; color: #072a62; }
.altrow .noprice, .inalt .noprice { font-size: 12px; color: #6b5400; background: #fdf3d7; border-radius: 8px; padding: 4px 8px; display: inline-block; }   /* v12n16O10c: an alternative with no price for this customer carries the same activation line the cards use */
.altrow button { border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 700; background: #e8b23a; color: #072a62; white-space: nowrap; }
.altrow button.inlist { background: #d7e6d7; color: #1e7d32; }
.topsell { font-size:12px; color: #8a6d00; }
#altmodal menu { display: flex; justify-content: flex-end; padding: 10px 0 0; margin: 0; }
.stk { font-size:12px; font-weight: 800; }
.stk.in { color: #1e7d32; }
.stk.partial { color: #b3541e; }
.stk.out { color: #5a5a5a; }
.inalts{margin:6px 0}.inalt-h{font-size:12px;color:#1e7d32;font-weight:700}.inalt{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:13px;padding:4px 0}
.stk.ask { color: #8a6d00; }
.stkrow { display: block; margin-top: 4px; }
.altbtn.sm { border: 1.5px solid #b3261e; background: #fff; color: #b3261e; border-radius: 8px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.stocknote { background: #eef4fb; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-weight: 700; color: #072a62; }

/* v4: logged-in header must wrap cleanly on narrow phones */
#me { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 62%; }
#me .pill { display: inline-block; max-width: 100%; line-height: 1.5; }
#me .mini { margin-inline-start: 0; }
/* v12a orders */
.tl { list-style: none; margin: 6px 0; padding: 0 10px 0 0; border-right: 3px solid #cfd8e6; font-size: 12.5px; }
.tl li { padding: 2px 8px; } .tl li b { color: #072a62; }
#myquotes-list .approve-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
#myquotes-list .approve-row button { flex: 1 1 45%; min-height: 44px; }
.invt { width: 100%; border-collapse: collapse; font-size: 13px; } .invt th, .invt td { border: 1px solid #ccd; padding: 4px; }
#cancel-dialog, #inv-dialog { max-width: 94vw; }
/* v12n16O10n: the sheet typography lives in ui.css, which the shop and the admin panel both load, so the printed invoice
   looks the same from either screen. assets/sheet.js builds the A4 page boxes; this block only puts them on paper. */
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; }
  body > *:not(#inv-dialog) { display: none !important; }
  #inv-dialog { position: static; border: 0; border-radius: 0; width: 210mm; max-width: none; max-height: none; margin: 0; padding: 0; overflow: visible; background: #fff; }
  #inv-dialog::backdrop { display: none !important; }
  .noprint { display: none !important; }
  #inv-body.paged { background: #fff; zoom: 1 !important; }
  #inv-body.paged > .pg-sheet { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  #inv-body.paged > .pg-sheet:last-child { break-after: auto; page-break-after: auto; }
  #inv-body .invt thead { display: table-header-group; }
  #inv-body .invt tr { page-break-inside: avoid; }
}
/* v12 extras */
.xtools{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.xtools button{flex:1 1 140px;min-height:44px;font-size:14px}
.xmore{margin:14px 0;padding:8px 12px;background:#fff;border:1px solid #ddd;border-radius:10px}
.xmore summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:700}
.xmore-b{display:flex;flex-direction:column;gap:8px;padding-bottom:8px}
.xmore-b button{min-height:44px}
.micbtn{min-width:44px;min-height:44px;font-size:18px}
.micbtn.on{background:#b3261e;color:#fff}
.favbtn,.askbtn{min-height:44px}
.card .cardrow{display:flex;gap:6px;margin-top:6px}.card .cardrow button{flex:1}
.fav-act{display:flex;gap:6px}
.qo-row{border:1px solid #ddd;border-radius:10px;padding:8px;margin:8px 0}.qo-row.bad{border-color:#b3261e}
.qo-opt{display:flex;gap:8px;align-items:flex-start;padding:6px 0;min-height:44px}
.qo-w{color:#b3261e;font-size:12px}.qo-q input{width:64px;min-height:44px}
.lowbw *{animation:none!important;transition:none!important}
.lowbw .skel{display:none}
.searchbar input{min-width:0}.searchbar .micbtn{padding:0 10px}
.searchbar{box-sizing:border-box;width:100%}
.xtools{padding:0 12px}
.searchbar button{padding:0 12px}
.searchbar #qbtn{padding:0 14px}
.qo-opt>span{flex:1}
.qo-opt input{width:22px!important;flex:none;min-height:22px;margin-top:4px}
.cocard{margin:16px 12px 90px;padding:12px;background:#fff;border:1px solid #ddd;border-radius:12px;font-size:14px;line-height:1.7}
.cocard ul{margin:6px 0;padding-inline-start:20px}.cocard .co{display:flex;flex-direction:column;gap:2px;margin-top:8px}
.cocard a{display:inline-flex;align-items:center;min-height:44px}
.pimg{width:100%;height:120px;object-fit:contain;background:#f6f4ef;border-radius:8px;margin-bottom:6px}
/* v12n16O12: the item picture. The box is the same height with or without a photo, so the cards do not jump; the
   placeholder is drawn inside the same box and is never a broken square. */
.pimg.pimgph{object-fit:contain;padding:16px 22px;opacity:.9}
.pimg-dlg{display:block;width:100%;max-height:230px;object-fit:contain;background:#f6f4ef;border-radius:8px;margin:0 0 8px}
.pimg-dlg.pimgph{max-height:170px;padding:18px 40px;opacity:.9}
.bell{position:relative;min-width:44px;min-height:44px}.bn{position:absolute;top:-4px;inset-inline-start:-4px;background:#b3261e;color:#fff;border-radius:10px;font-size:12px;padding:1px 5px}
.nt{border-bottom:1px solid #eee;padding:8px 0}.nt.unread{background:#fff7e0;border-radius:8px;padding:8px}

/* ===== v12h: real-phone review fixes (390px first) ===== */
.searchbar{display:flex;gap:8px;align-items:stretch;padding:10px 12px}
.sbox{position:relative;flex:1;min-width:0;display:block}
.sbox input{width:100%;min-height:48px;padding:10px 14px;padding-inline-end:56px;font-size:16px}
.sbox .micbtn{position:absolute;inset-inline-end:4px;top:4px;bottom:4px;min-width:44px;width:44px;min-height:0;padding:0;border-radius:10px;background:#eef2f8;color:#072a62;font-size:20px;border:0}
.sbox .micbtn.on{background:#b3261e;color:#fff;animation:micp 1.1s ease-in-out infinite}
@keyframes micp{50%{box-shadow:0 0 0 6px rgba(179,38,30,.25)}}
.searchbar #qbtn{min-height:48px;padding:0 16px}
.miclive{margin:0 12px 6px;padding:8px 12px;border-radius:10px;background:#fdecea;color:#8f1d17;font-weight:800;font-size:14px;display:flex;align-items:center;gap:8px}
.miclive[hidden]{display:none}
.miclive .dot{width:12px;height:12px;border-radius:50%;background:#b3261e;display:inline-block;animation:micp 1.1s infinite}
.miclive button{margin-inline-start:auto;min-height:36px;border:0;border-radius:8px;background:#b3261e;color:#fff;padding:0 12px;font-weight:700}
.suggest{padding:0 12px 6px;font-size:14px;line-height:1.7}
.suggest .sr-head{font-weight:700;color:#072a62}
.suggest .sr-head a,.suggest .sr-none a,.suggest .sr-sug a{margin-inline-start:6px;display:inline-block;min-height:32px;line-height:32px}
.suggest .sr-none{background:#fdf3d7;border-radius:8px;padding:6px 10px;margin-top:4px}
.xtools{display:grid!important;grid-template-columns:1fr 1fr 1.25fr;gap:6px;margin:4px 0 8px}
.xtools button{min-height:52px!important;padding:4px 6px;font-size:13px;line-height:1.25;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;flex:none}
.xtools button small{font-size:12px;font-weight:400;color:#5b5b5b}
/* v12n16O10i: four quick buttons, four columns, so the fourth does not sit alone in a half-empty row on tablets and desktops */
@media(min-width:600px){.xtools{grid-template-columns:repeat(4,1fr)!important}}
/* cards: one column on phones, compact rows */
.grid{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:10px;padding:6px 12px}
@media(max-width:560px){.grid{grid-template-columns:1fr}}
.card{gap:5px;padding:12px}
.card h2{font-size:15px;min-height:0}.card h2.itemlink{cursor:pointer}
.card .row2{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.card .avail{font-size:13px}
.card .noprice{font-size:12.5px;padding:4px 8px;display:inline-block;align-self:flex-start}
.buyrow{display:flex;gap:8px;align-items:stretch;margin-top:4px}
.step{display:flex;align-items:stretch;border:1.5px solid #072a62;border-radius:10px;overflow:hidden;background:#fff;flex:none}
.step button{width:44px;min-height:44px!important;border:0!important;margin:0!important;border-radius:0!important;background:#eef2f8!important;color:#072a62!important;font-size:22px!important;font-weight:800;padding:0!important;line-height:1}
.step input{width:50px!important;min-height:44px;border:0!important;border-inline:1px solid #cfd8e6!important;border-radius:0!important;text-align:center;font-size:17px!important;font-weight:800;padding:0!important;margin:0!important;display:block;color:#072a62}
.buyrow .addbtn{flex:1;min-height:44px;border:0;border-radius:10px;background:#e8b23a;color:#072a62;font-weight:800;font-size:14px;margin:0!important;padding:4px 8px}
.buyrow .addbtn.inlist{background:#d7e6d7;color:#1e7d32}
.card .subrow,.itemdlg .subrow{display:flex;gap:6px;flex-wrap:wrap;margin-top:4px}
.card .subrow>*,.itemdlg .subrow>*{flex:1 1 auto;min-height:44px;font-size:13px;padding:6px 8px;border-radius:10px;margin:0!important;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}
.card .subrow .favbtn{flex:0 0 46px;font-size:18px}
.card button.ghost{background:#fff!important;border:1.5px solid #072a62!important;color:#072a62!important}
.card .subrow .altbtn{border-color:#b3261e!important;color:#b3261e!important}
/* pager */
.pager-top{margin:0 12px 4px}
.pg-compact{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#fff;border:1px solid #ddd;border-radius:12px;padding:4px 6px;font-size:13px}
.pg-compact button{min-width:44px;min-height:40px;border:0;border-radius:8px;background:#072a62;color:#fff;font-size:22px;font-weight:800;padding:0}
.pg-compact button:disabled,.pgb:disabled{opacity:.35}
.pager{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;margin:14px 12px 8px;padding:12px 8px;background:#fff;border:1px solid #ddd;border-radius:14px}
.pager[hidden],.pager-top[hidden]{display:none}
.pgb{min-width:40px;min-height:44px;padding:6px 10px;border:1px solid #cfd8e6;border-radius:10px;background:#fff;color:#072a62;font-weight:800;font-size:15px}
.pgb.cur{background:#072a62;color:#fff;border-color:#072a62}
.pg-gap{color:#777;padding:0 2px}
.pg-info{width:100%;text-align:center;color:#555;font-size:13px;margin-top:2px}
.pg-jump{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;margin-top:4px}
.pg-jump label{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;margin:0}
.pg-jump input{width:70px;min-height:44px;text-align:center;padding:0;margin:0;font-size:16px}
/* quote dialog */
#quote-dialog{max-height:calc(100dvh - 16px);overflow-y:auto;width:min(96vw,440px);padding:14px}
.qitems{max-height:none;overflow:visible;border:0;padding:0;margin:0 0 4px}
.qitems .qi{display:block;padding:10px 0;border-bottom:1px solid #e6e2d8;font-size:14px}
.qi .qname{font-weight:700;line-height:1.5;margin-bottom:6px}
.qi .qrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.qi .qrow .stkrow{flex:1 1 100px;margin:0}
.qitems .qi button.qdel,.qi .qdel{border:0;background:#f8e1df;color:#b3261e;border-radius:10px;min-height:44px;padding:0 12px;font-weight:700;margin-inline-start:auto}
.qitems .qi .step button{background:#eef2f8;color:#072a62;border-radius:0;padding:0}
.qitems .qi input{display:block;width:50px;padding:0}
.qtotals{background:#eef4fb;border-radius:10px;padding:8px 12px;font-size:14px;margin:4px 0 8px;color:#072a62}
.qtotals:empty{display:none}
#quote-dialog menu{position:sticky;bottom:-14px;background:#fff;padding:10px 0 4px;margin-top:10px;border-top:1px solid #eee}
/* my orders */
.qi.oq{padding:8px 0;border-bottom:1px dashed #ddd}
.qtybadge{background:#eef4fb;border-radius:8px;padding:4px 10px;font-size:13px;color:#072a62}
.qsum{background:#f6f4ef;border-radius:8px;padding:6px 10px;margin:6px 0;font-size:13.5px}
.qprice{margin-inline-start:auto;text-align:end}
/* item + alternatives dialogs */
#item-dlg{width:min(440px,94vw);border:0;border-radius:16px;padding:14px;max-height:calc(100dvh - 20px)}
.itemtbl{width:100%;border-collapse:collapse;margin:6px 0 10px}.itemtbl th{text-align:start;padding:5px 0;padding-inline-end:12px;width:34%;color:#555;font-weight:700}.itemtbl td{padding:5px 0;text-align:start}
.itemdlg h2{margin:0 0 6px;font-size:17px;line-height:1.5}
#altmodal{max-height:calc(100dvh - 20px);overflow-y:auto}
.altreq{background:#f6f4ef;border-radius:10px;padding:8px 12px;margin-bottom:8px;font-size:14px}
.altnone{background:#f6f4ef;border-radius:10px;padding:12px;line-height:1.8}
.altwa{margin-top:10px}
.altrow .why{color:#1e7d32;font-weight:700}
/* notifications */
.bellbody{max-height:62dvh;overflow-y:auto;margin:0 -4px;padding:0 4px}
.ntday{font-size:12.5px;font-weight:800;color:#5b5b5b;margin:10px 0 4px}
.ntg{background:#fff;border:1px solid #e2ded5;border-radius:12px;padding:10px 12px;margin-bottom:8px}
.ntg.unread{background:#fff7e0;border-color:#e8b23a;border-right:5px solid #e8b23a}
.nth{display:flex;align-items:center;justify-content:space-between;gap:8px}
.nth b{font-size:15px}.udot{display:inline-block;width:10px;height:10px;border-radius:50%;background:#b3261e;margin-inline-end:6px}
.nbadge{background:#b3261e;color:#fff;border-radius:10px;font-size:12px;padding:2px 8px;white-space:nowrap}
.ntnow{display:flex;flex-direction:column;gap:2px;margin-top:4px}
.ntstat{font-weight:800;color:#072a62;font-size:14.5px}
.ntnow small,.nthist small{color:#777;font-size:12px}
.nthist{margin-top:6px}.nthist summary{cursor:pointer;color:#072a62;font-size:13px;min-height:36px;display:flex;align-items:center}
.nthist ul{list-style:none;margin:0;padding:0}.nthist li{display:flex;justify-content:space-between;gap:8px;padding:6px 0;border-top:1px dashed #e2ded5;font-size:13px}.nthist li.unread{font-weight:800}
.nt-empty{padding:18px 6px;text-align:center;color:#555}
#bell-dlg menu{flex-wrap:wrap}
#mic-dlg ol{padding-inline-start:20px;line-height:1.9}
/* header: logged-in controls wrap cleanly */
#me{max-width:66%}
#me .pill{font-size:12.5px}
/* v12h filters */
.filters{display:flex;flex-wrap:wrap;gap:8px;padding:6px 12px 2px;align-items:flex-end}
.filters .fsel{flex:1 1 30%;min-width:105px;display:flex;flex-direction:column;font-size:12px;color:#5a6577}
.filters select{min-height:44px;font-size:15px;border:1px solid #cfd6e2;border-radius:10px;background:#fff;padding:0 8px;width:100%}
.filters .fclear{min-height:44px;flex:0 0 auto}
/* v12h: short viewport (keyboard open) */
@media (max-height:560px){ dialog{max-height:calc(100dvh - 12px);overflow-y:auto;-webkit-overflow-scrolling:touch} .authlogo{display:none} dialog h2{margin-bottom:4px} dialog label{margin:6px 0 2px} }
@media (max-height:560px){ #auth-form menu{position:sticky;bottom:0;background:#fff;padding:8px 0 2px;margin:6px 0 0;z-index:2} dialog input{padding:8px} #auth-form .hint{margin:4px 0} }
/* v12h-i header tagline */
.top .tag{font-size:12px;line-height:1.45;margin:2px 0 0;opacity:.9}
.top .brand>div{min-width:0}
.top .tag{text-wrap:balance}
.top.loggedin{flex-wrap:wrap}.top.loggedin .brand{flex:1 1 100%}.top.loggedin #me{flex:1 1 100%;max-width:100%}
.qprice{font-size:13.5px;color:#072a62;font-weight:700;margin:2px 0}.qprice:empty{display:none}

.itembtn{all:unset;box-sizing:border-box;cursor:pointer;display:block;min-height:44px;width:100%;font:inherit;font-weight:700;color:#072a62;line-height:1.4;padding:6px 0}
:focus-visible{outline:3px solid #072a62!important;outline-offset:2px;box-shadow:0 0 0 5px #e8b23a!important}
.top :focus-visible,#me :focus-visible{outline-color:#fff!important;box-shadow:0 0 0 5px #e8b23a!important}
#me button,#me .mini,#me a.mini{min-height:44px;display:inline-flex;align-items:center}
#lang-btn{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0}
.qstep button,.stepper button,.qi .stp button{min-width:44px;min-height:44px}
#quote-form select[name=delivery]{width:100%;min-height:44px;font-size:15px;border:1px solid #cfd6e2;border-radius:10px;background:#fff;padding:0 8px}

.top.loggedin #me{flex-wrap:nowrap;gap:4px}
.top.loggedin #me .pill{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px;min-height:44px;display:inline-flex;align-items:center;font-size:12.5px;max-width:none}
.top.loggedin #me .mini{flex:0 0 auto;padding:0 8px;font-size:12.5px;margin:0}
.top.loggedin .brand{margin-bottom:0}
.top.loggedin{padding-bottom:8px}

/* v12n14: model and year per order line. Optional, so they sit quietly under the part name and never block a send. */
.qi .qcar{display:flex;gap:6px;flex-wrap:wrap;margin:2px 0 6px}
.qi .qcar input{flex:1 1 96px;width:auto;min-width:0;min-height:40px;padding:6px 8px;font-size:13.5px;border:1px solid #ddd;border-radius:8px;display:inline-block;box-sizing:border-box}
.qi .qcarline{font-size:12.5px;color:#555;margin:2px 0 4px}
.qi .qyearerr{display:block;color:#b3261e;font-size:12.5px;margin:-2px 0 6px}
.qi .qyearerr[hidden]{display:none}

/* v12n16: December offer (display only) */
#offer-banner { margin: 10px 10px 8px; padding: 10px 12px 9px; border-radius: 16px; color: #fff; text-align: center;
  background: radial-gradient(120% 90% at 100% 0%, #123f8a 0%, var(--navy) 55%, var(--navy-2) 100%); box-shadow: 0 4px 14px rgba(7,42,98,.28); }
#offer-banner .ob-tag { display: inline-block; margin-top: 4px; background: var(--gold); color: var(--navy-2); font-weight: 800; font-size: 15px; padding: 1px 14px; border-radius: 999px; }
#offer-banner .ob-h { margin: 6px 0 8px; font-size: 20px; line-height: 1.4; font-weight: 800; color: #fff; }
#offer-banner .ob-tiers { display: flex; gap: 8px; justify-content: center; align-items: stretch; }
#offer-banner .ob-tier { flex: 1 1 0; background: rgba(255,255,255,.1); border: 1.5px solid rgba(232,178,58,.6); border-radius: 12px; padding: 4px 6px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#offer-banner .ob-tier b { font-size: 36px; line-height: 1.1; color: var(--gold); font-weight: 900; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
#offer-banner .ob-tier span { font-size: 15px; font-weight: 700; line-height: 1.35; color: #fff; }
#offer-banner .ob-tier.ob-hi { background: var(--gold); border-color: var(--gold); }
#offer-banner .ob-tier.ob-hi b, #offer-banner .ob-tier.ob-hi span { color: var(--navy-2); }
#offer-banner .ob-cta { margin-top: 9px; width: 100%; min-height: 46px; border: 0; border-radius: 12px; background: var(--red); color: #fff; font-size: 18px; font-weight: 800; font-family: inherit; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
#offer-banner .ob-fine { margin: 6px 0 0; font-size: 13px; color: rgba(255,255,255,.85); }
#offer-strip { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #fdf3d7; border: 1.5px solid var(--gold); color: var(--navy-2); font-size: 16px; font-weight: 800; line-height: 1.5; }
#offer-banner .ob-left { margin-top: 9px; }
#offer-banner .ob-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; }
#offer-banner .ob-bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
#offer-banner .ob-left span { display: block; margin-top: 4px; font-size: 16px; font-weight: 800; color: #fff; }
#offer-banner .ob-left.ob-low span { color: var(--gold); }
#offer-banner .ob-proof { margin: 4px 0 0; font-size: 14px; color: rgba(255,255,255,.92); }
/* compact pass: keep the whole block under ~300px at 390 so the catalogue stays on the first screen */
#offer-banner .ob-h { font-size: 18px; margin: 5px 0 7px; }
#offer-banner .ob-tier { flex-direction: row; gap: 8px; padding: 4px 8px; }
#offer-banner .ob-tier b { font-size: 34px; }
#offer-banner .ob-tier span { font-size: 14px; text-align: right; }
#offer-banner .ob-left { margin-top: 7px; }
#offer-banner .ob-left span { font-size: 15px; margin-top: 3px; }
#offer-banner .ob-cta { margin-top: 7px; min-height: 44px; font-size: 18px; }
#offer-banner .ob-fine { margin-top: 5px; font-size: 12.5px; }
#offer-banner.ob-n3 .ob-tier, #offer-banner.ob-n4 .ob-tier { flex-direction: column; gap: 0; padding: 4px 4px 6px; text-align: center; }
#offer-banner.ob-n3 .ob-tier b, #offer-banner.ob-n4 .ob-tier b { font-size: 30px; }
#offer-banner.ob-n3 .ob-tier span, #offer-banner.ob-n4 .ob-tier span { font-size: 13px; text-align: center; }
#offer-banner.ob-n4 .ob-tiers { flex-wrap: wrap; } #offer-banner.ob-n4 .ob-tier { flex: 1 1 40%; }

/* v12n16 compact + readable: fine print and counter at 14-15px, no emoji anywhere in the offer */
#offer-banner { margin: 6px 10px 6px; padding: 8px 12px 8px; }
#offer-banner .ob-tag { margin-top: 0; font-size: 14px; }
#offer-banner .ob-h { font-size: 17px; line-height: 1.3; margin: 4px 0 6px; }
#offer-banner .ob-tier span { font-size: 14px; }
#offer-banner .ob-left { margin-top: 6px; }
#offer-banner .ob-left span { font-size: 16px; margin-top: 3px; }
#offer-banner .ob-proof { font-size: 15px; margin: 2px 0 0; }
#offer-banner .ob-cta { margin-top: 6px; }
#offer-banner .ob-fine { font-size: 14px; margin-top: 4px; line-height: 1.35; }

#offer-banner .ob-ceil { margin: 4px 0 6px; font-size: 20px; line-height: 1.35; font-weight: 800; color: var(--gold); }
#offer-banner .ob-small { margin: 4px 0 0; font-size: 14px; line-height: 1.35; color: rgba(255,255,255,.92); }
#offer-banner.ob-notiers .ob-left span { font-size: 17px; }

#offer-nudge { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: #eef3fb; border: 1.5px solid #9fb6d8; color: #072a62; font-size: 15px; font-weight: 700; line-height: 1.5; }

#me button { white-space: nowrap; }
#offer-banner .ob-proof, #offer-banner .ob-fine, #offer-banner .ob-small { color: #fff; font-size: 15px; }
#offer-banner .ob-fine { opacity: .95; }

/* v12n16k: first-time path is a visible button; error lines never run together */
#auth-toggle.authnew { display: block; text-align: center; border: 2px solid #0b2a5e; border-radius: 12px; padding: 12px; min-height: 44px; font-weight: 800; text-decoration: none; background: #eef3ff; color: #0b2a5e; }
/* Mahmoud, 2026-12-06: every tappable target is at least 24x24 at 320px. The «اضغط هنا» fallback under the login form was 52x23. */
#auth-forgot-wa { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 4px; }
/* ACC-05: the «عندك حساب؟ سجل دخولك» link is a tap target too — 24px high on every screen, not only the register one. */
#auth-toggle { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 4px; }
.err .err-line { display: block; margin: 2px 0; }
.qlt { margin: 2px 0 6px; }
.err .err-line::before { content: '• '; }

/* v12n16O2: the banner stacks by construction - flex-wrap, min-width:0, no fixed widths, no absolute text.
   At 320px every child takes its own line: badge, headline, then the single tier line OR the tiles, then the CTA full width. */
#offer-banner { display: flex; flex-wrap: wrap; align-items: flex-start; max-width: 100%; }
#offer-banner > * { min-width: 0; max-width: 100%; flex: 0 1 100%; }
#offer-banner .ob-tag { align-self: flex-start; flex: 0 0 auto; }
#offer-banner .ob-h, #offer-banner .ob-ceil, #offer-banner .ob-small,
#offer-banner .ob-fine, #offer-banner .ob-proof, #offer-banner .ob-left span { overflow-wrap: anywhere; word-break: break-word; }
#offer-banner .ob-tiers { flex-wrap: wrap; width: 100%; }
#offer-banner .ob-tier { flex: 1 1 72px; min-width: 0; }
#offer-banner .ob-tier b { overflow-wrap: anywhere; }
#offer-banner .ob-cta { width: 100%; flex: 0 0 100%; }

/* v12n16O4: when an out-of-stock item has no in-stock same-part alternative, the inline block renders nothing at all */
.inalts:empty { display: none; }

/* v12n16O5: short viewport (landscape phone) - the header collapses to one compact row and the fixed bar to one 44px row,
   so a product card is visible above the fold. Height query, not a new width breakpoint. */
@media (max-height: 480px) {
  body { padding-bottom: 56px; }
  .top { padding: 3px 8px; gap: 6px; align-items: center; }
  .top .tag { display: none; }
  .top h1 { font-size: 15px; margin: 0; line-height: 1.1; }
  .logo { width: 26px; height: 26px; }
  .brand { gap: 6px; }
  #me { max-width: 58%; gap: 4px; }
  #me button, #me .mini, #me a.mini { min-height: 32px; padding: 2px 8px; font-size: 12px; }
  #me .pill { padding: 3px 8px; font-size: 12px; }
  .searchbar { padding: 4px 8px; gap: 6px; position: static; }
  .sbox input { min-height: 36px; padding: 4px 10px; padding-inline-end: 52px; font-size: 14px; }
  .sbox .micbtn { top: 2px; bottom: 2px; min-width: 44px; width: 44px; font-size: 16px; }
  .searchbar #qbtn { min-height: 36px; padding: 0 12px; font-size: 14px; }
  .chips, .filters { margin: 2px 0; padding-top: 2px; padding-bottom: 2px; }
  .cta { padding: 1px 8px; gap: 8px; }
  .cta button, .cta a, .cta .primary { min-height: 36px; padding: 2px 10px; font-size: 13px; }
}
/* v12n16O5: the customer-name chip truncates with an ellipsis instead of being cut mid-glyph at 320px */
#me { min-width: 0; }
#me .pill { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* v12n16O6: the header's #me group must never push the page wider than the viewport. Its children may shrink and wrap,
   so the login button / customer chip / mini buttons stay fully visible at 320 instead of overflowing the header by 15px. */
#me > * { min-width: 0; max-width: 100%; }
#me button, #me .mini, #me a.mini { white-space: normal; }

/* v12n16O6: the chip is an inline span, so text-overflow never applied. It becomes an inline-block inside a flex child
   that may shrink, and the name sits in its own block span, so the ellipsis renders. */
#me .pill { display: inline-block; vertical-align: middle; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#me .pill > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* v12n16O6: short viewport (landscape phone) - the quick-tools grid was the main offender: it wrapped to two rows of 52px.
   It becomes one horizontally scrolling row (every tool still one tap), the sub-labels are dropped in short viewports only,
   and the filter row scrolls instead of stacking. */
@media (max-height: 480px), (max-width: 340px) {
  .xtools { display: flex !important; flex-wrap: nowrap; overflow-x: auto; grid-template-columns: none; gap: 6px; margin: 2px 0 4px; padding: 0 8px; -webkit-overflow-scrolling: touch; }
  .xtools button { flex: 0 0 auto; min-height: 40px !important; padding: 4px 10px; font-size: 13px; flex-direction: row; gap: 4px; white-space: nowrap; }
  .xtools button small { display: none; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 2px 0; padding: 0 8px; }
  .infobar { margin: 2px 0; padding: 4px 8px; }
}

/* v12n16O6: short viewport (landscape phone) - the whole chrome must leave the first card near the top.
   Header one row, search one row with a filter button, quick tools one scrolling row, and the category chips +
   filter row live behind that one button (nothing is removed; it is one tap away). */
@media (max-height: 480px), (max-width: 430px) {
  .top { padding: 0 6px; }
  .top h1 { font-size: 12px; }
  .logo { width: 20px; height: 20px; }
  .searchbar { padding: 0 6px; gap: 6px; }
  .sbox input { min-height: 30px; padding: 1px 8px; padding-inline-end: 52px; font-size: 14px; }
  .sbox .micbtn { top: 0; bottom: 0; min-width: 44px; width: 44px; font-size: 15px; }
  .searchbar #qbtn { min-height: 30px; min-width: 44px; padding: 0 8px; font-size: 14px; }
  #fbtn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; border: 0; border-radius: 10px; background: #e8b23a; color: #072a62; font-weight: 800; font-size: 13px; }
  .xtools { margin: 0; }
  .xtools button { min-height: 28px !important; padding: 2px 8px; }
  /* v12n16O7: 360x640 portrait was 13px short of showing the whole first card. 14px of pure spacing comes back:
     the header's 8px bottom padding and the grid's 6px top padding. No text shrinks, no target shrinks. */
  .top.loggedin { padding-bottom: 0; }
  .grid { padding-top: 0; }
  .top h1 { line-height: 1.25; }   /* the title's loose line box was 23px for 12px text */
  #pager-top { display: none; }
}

/* v12n16O7: the bell is the one customer control under 32px wide. #me > * sets min-width:0 (the 320 overflow fix),
   which beat .bell's 44px; the floor is restored here for the customer bell only. */
#bell { min-width: 32px; }
/* v12n16O7: quick tools in short/narrow viewports meet the 32px floor */
@media (max-height: 480px), (max-width: 430px) { .xtools button { min-height: 32px !important; } }

/* ===== v12n16O8 ===== */
/* The owner wants every category visible and direct on a phone: in portrait the chips row is back by default as one
   compact scrolling row (32px chips, row <= 36px). Only the three attribute dropdowns (brand/model/origin) and the
   clear button stay behind the فلتر button, because those are a refinement, not a primary choice. */
@media (max-width: 430px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin: 0; padding: 0 8px 2px; -webkit-overflow-scrolling: touch; }
  .chips button { flex: 0 0 auto; min-height: 32px; padding: 0 12px; }
  body:not(.fopen) #filters { display: none; }
  body.fopen #filters { display: flex; }
}
/* Landscape keeps O7's behaviour: height is the constraint there, so the chips and the dropdowns both live behind the button. */
@media (max-height: 480px) {
  body:not(.fopen) #chips, body:not(.fopen) #filters { display: none; }
  body.fopen #chips, body.fopen #filters { display: flex; }
}
/* The filter button has to read as "this opens something": a CSS chevron, no emoji, that flips when it is open. */
#fbtn::after { content: ''; display: inline-block; width: 0; height: 0; border-inline-start: 4px solid transparent; border-inline-end: 4px solid transparent; border-top: 5px solid currentColor; margin-inline-start: 5px; transition: transform .15s ease; }
body.fopen #fbtn::after { transform: rotate(180deg); }
/* v12n16O8: the order-form caption "(السعر النهائي بتأكده المبيعات)" computed to 11.67px (a plain <small> at 14px); 12px floor. */
small { font-size: 12px; }
/* v12n16O8: the verified ✓ inside the customer chip must survive at 320. The name becomes its own shrinkable block so it
   ellipsizes and the ✓ keeps its space. */
#me .pill .nm { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#me .pill .ok { display: inline-block; flex: 0 0 auto; overflow: visible; }
/* 320-class phones: buy the chip its width back from the three mini buttons instead of clipping the name. */
@media (max-width: 340px) {
  .top.loggedin #me { gap: 2px; }
  .top.loggedin #me button, .top.loggedin #me .mini, .top.loggedin #me a.mini { padding: 0 6px; }
  .top.loggedin #me .pill { padding: 0 6px; }
}

/* ===== v12n16O9: 320px - every quick tool and every filter control reachable, no horizontal scrolling ===== */
@media (max-width: 340px) {
  /* four tiles cannot fit in 320px without a swipe, and a hidden tool does not exist for a low-tech customer:
     the install tile is the one that goes below 340 (طلب سريع, قطعي and مش عارف الرقم are the three that matter). */
  #inst-top { display: none !important; }
  .xtools { flex-wrap: nowrap !important; overflow-x: visible !important; }
  .xtools button { flex: 1 1 0 !important; min-width: 0 !important; padding: 2px 6px; white-space: normal; font-size: 12.5px; }
  /* the open filter row stacks instead of running off the edge */
  .filters { flex-wrap: wrap !important; overflow-x: visible !important; }
  .filters .fsel { flex: 1 1 44%; min-width: 0; }
  .filters .fclear { flex: 0 0 auto; }
}
/* no visible horizontal scrollbar anywhere the quick tools or chips can scroll */
.xtools, .chips { scrollbar-width: none; }
.xtools::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; height: 0; }

/* ===== v12n16O10: production review - the brand mark reads as a brand mark again, and the control zone between the
   December offer and the first card is one clean rhythm instead of stacked pieces. Portrait phones only; landscape
   keeps its compact header because height is the constraint there. ===== */
@media (max-width: 430px) {
  /* brand: 20px circle -> 44px mark, name 12px -> 15px. The brand block's height is set by its text, so the taller
     mark costs no vertical space. */
  .top .brand { gap: 10px; align-items: center; }
  .logo { width: 56px; height: 56px; flex: 0 0 auto; }   /* tested 44/52/56: header stays 110px at 320/360/390/414, so the largest that adds nothing wins */
  .top h1 { font-size: 15px; line-height: 1.25; }
  /* the three mini buttons wrapped their labels ("كلمة السر" broke in two) while the chip hogged the row; the buttons
     now hold one line and the chip absorbs the squeeze with its ellipsis */
  /* only the signed-in minis need nowrap; the logged-out login pill must still be allowed to wrap, or it pushes
     the header past the viewport at 320 */
  .top.loggedin #me button, .top.loggedin #me .mini, .top.loggedin #me a.mini { white-space: nowrap; }
  /* the admin link was a heavy filled tile competing with the brand; a quiet outlined button keeps the header balanced */
  #me a.mini { background: transparent !important; color: #fff !important; border: 1px solid rgba(255,255,255,.55) !important; border-radius: 10px !important; padding: 0 10px !important; font-weight: 700; }
  /* quick actions: four equal tiles on ONE row instead of three plus a stray install pill on a second row */
  .xtools { display: flex !important; flex-wrap: nowrap; grid-template-columns: none; gap: 6px; margin: 2px 0 6px; padding: 0 8px; }
  .xtools button { flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 4px 4px; min-height: 44px; font-size: 12.5px; line-height: 1.2; white-space: normal; text-align: center; }
  .xtools button small { font-size: 12px; line-height: 1.15; }
  /* chips: the cut chip fades out at the scrolling edge, which reads as "more to the side", and both ends breathe */
  .chips { padding: 0 10px 4px; -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 26px), transparent 100%); mask-image: linear-gradient(to left, #000 calc(100% - 26px), transparent 100%); }
}
@media (max-width: 340px) {
  /* 320: four tiles cannot sit on one row, so the install tile stays off (as agreed in O9) and the three share the row */
  #inst-top { display: none !important; }
  .xtools button small { display: none; }
  .xtools button { min-height: 36px; padding: 2px 4px; }
  .chips { padding-bottom: 2px; }
}

/* v12n16O10: the guest offer card is 307px tall at 320x568 and 252px at 568x320, which eats the whole fold, so the customer
   sees a promotion and no parts. These two blocks only change how much room the same card takes: every line of copy, the
   terms, the three tier numbers and the CTA stay on screen. Nothing is hidden and no wording changes. */
@media (max-height: 700px) {
  #offer-banner { margin: 6px 8px 4px; padding: 6px 10px 6px; border-radius: 12px; }
  #offer-banner .ob-tag { font-size: 12px; padding: 0 10px; margin: 0; }
  #offer-banner .ob-h { font-size: 14px; line-height: 1.25; margin: 3px 0 4px; }
  #offer-banner .ob-tiers { gap: 5px; }
  #offer-banner.ob-n3 .ob-tier, #offer-banner.ob-n4 .ob-tier { flex-direction: row; gap: 4px; padding: 2px 4px; border-radius: 8px; border-width: 1px; align-items: baseline; }
  #offer-banner.ob-n3 .ob-tier b, #offer-banner.ob-n4 .ob-tier b { font-size: 14px; white-space: nowrap; flex: 0 0 auto; }
  #offer-banner.ob-n3 .ob-tier span, #offer-banner.ob-n4 .ob-tier span { font-size: 12px; line-height: 1.15; }
  #offer-banner .ob-left { margin-top: 3px; }
  #offer-banner .ob-left span { font-size: 12px; margin-top: 2px; }
  #offer-banner .ob-cta { min-height: 34px; font-size: 14px; margin-top: 4px; border-radius: 9px; }
  #offer-banner .ob-fine { font-size: 12px; margin-top: 3px; line-height: 1.25; }
}
/* landscape phones (568x320): the card has to become a strip, or the parts row never reaches the fold */
@media (max-height: 420px) {
  #offer-banner { margin: 4px 8px; padding: 4px 10px; border-radius: 10px; gap: 6px; align-items: center; }
  #offer-banner > * { flex: 0 0 auto; }
  #offer-banner .ob-tag { font-size: 12px; padding: 0 8px; }
  #offer-banner .ob-h { font-size: 12.5px; margin: 0; }
  #offer-banner .ob-tiers { width: auto; gap: 4px; }
  #offer-banner.ob-n3 .ob-tier, #offer-banner.ob-n4 .ob-tier { padding: 1px 6px; gap: 3px; }
  #offer-banner.ob-n3 .ob-tier b, #offer-banner.ob-n4 .ob-tier b { font-size: 12px; white-space: nowrap; flex: 0 0 auto; }
  #offer-banner.ob-n3 .ob-tier span, #offer-banner.ob-n4 .ob-tier span { font-size: 12px; }
  #offer-banner .ob-left { margin: 0; }
  #offer-banner .ob-bar { display: none; }   /* decorative; the counter sentence next to it stays */
  #offer-banner .ob-left span { font-size: 12px; margin: 0; }
  #offer-banner .ob-cta { margin: 0; min-height: 28px; font-size: 12px; width: auto; padding: 0 12px; border-radius: 8px; }
  #offer-banner .ob-fine { font-size: 12px; margin: 0; }
}

/* v12n16O10h: readable on a phone without zoom, and the brand palette (white, navy, red) with copper kept as an accent.
   Sizes were 12-14px on the card, the chips and the hint lines; the card button was gold on every item, which is the
   copper mass the owner saw. */
body { font-size: 16.5px; }
.card h2 { font-size: 16.5px; min-height: 0; }
.card .meta { font-size: 13.5px; }
.card .avail { font-size: 13px; }
.card .price { font-size: 18px; }
.card button { font-size: 16px; background: #072a62; color: #fff; }
.card .noprice { font-size: 15px; background: #eef2f8; color: #072a62; border: 1px solid #dbe3ee; padding: 4px 9px; }
.top p { font-size: 13px; }
#me button, #me span { font-size: 14px; }
.hint { font-size: 13.5px; }
small { font-size: 13px; }
.chips button { font-size: 14px; padding: 8px 14px; }
.qitems .qi { font-size: 15px; }
.notice { font-size: 14.5px; }
.infobar { font-size: 14px; background: #eef2f8; color: #072a62; }
.stk { font-size: 13px; }
.altrow small { font-size: 13px; }
.altrow b { font-size: 15px; }
.altrow .price { font-size: 16px; }
.altrow .noprice, .inalt .noprice { font-size: 13px; background: #eef2f8; color: #072a62; border: 1px solid #dbe3ee; }
.ghost { font-size: 15px; }
dialog label { font-size: 15px; }
dialog input, dialog select, dialog textarea { font-size: 16px; }
.quote-card .qhead { font-size: 15px; }
.pricenote { font-size: 14px; line-height: 1.7; color: #072a62; background: #eef2f8; border: 1px solid #dbe3ee;
  border-radius: 10px; padding: 9px 12px; margin: 4px 0 10px; display: flex; gap: 6px; align-items: flex-start; }
.pricenote[hidden] { display: none; }
/* v12n16O10h: the primary action keeps a solid fill but in the logo's red; navy for the secondary, so gold is left to small accents */
.buyrow .addbtn { background: #dc0a17; color: #fff; font-size: 15px; }
.buyrow .addbtn.inlist { background: #fff; color: #072a62; border: 2px solid #072a62; }
.altrow button { background: #072a62; color: #fff; font-size: 15px; }
.altrow button.inlist { background: #fff; color: #072a62; border: 2px solid #072a62; }
#me .mini { font-size: 14px; }

/* v12n16O10h — «طلباتي»: the dialog scrolls itself so the filter bar can stay stuck at the top while the list moves. */
#myquotes-dialog { max-height: 88vh; overflow: auto; }
.mqbar { position: sticky; top: -18px; z-index: 6; display: flex; gap: 8px; background: #fff;
  padding: 10px 0 10px; border-bottom: 1px solid #e6e6e6; margin: 0 0 6px; }
.mqbar button { flex: 1; min-height: 44px; border: 1.5px solid #cfd8e6; background: #fff; color: #072a62;
  border-radius: 10px; font-size: 15px; font-weight: 800; font-family: inherit; }
.mqbar button span { font-size: 12.5px; font-weight: 700; opacity: .8; }
.mqbar button.on { background: #072a62; color: #fff; border-color: #072a62; }
.mqgrp { font-size: 14px; font-weight: 800; color: #5b5b5b; margin: 12px 0 2px; }
.quote-card .qhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quote-card .qhead small { margin-inline-start: auto; }
.quote-card .qstat { font-size: 13px; font-weight: 800; border-radius: 999px; padding: 3px 10px;
  background: #0b5cad; color: #fff; }
.quote-card .qstat.s-you { background: #dc0a17; }
.quote-card .qstat.s-ready { background: #1e7d32; }
.quote-card .qstat.s-done { background: #2e7d32; opacity: .9; }
.quote-card .qstat.s-off { background: #7a7a7a; }
.quote-card .qmeta { font-size: 13px; color: #555; margin: 4px 0 0; }
.quote-card .qglance { font-size: 13.5px; color: #333; margin: 4px 0 2px; }
.qnext { font-size: 14px; font-weight: 700; border-radius: 10px; padding: 9px 11px; margin: 7px 0 4px;
  background: #eef2f8; color: #072a62; }
.qnext.need { background: #ffe9ea; color: #a8071a; border: 1px solid #f3b6ba; }
.qnext.ready { background: #e8f5e9; color: #14532d; }
.qnext.done { background: #eef2f8; color: #0b5cad; }
.qnext.off { background: #f2f2f2; color: #666; }
.qtl summary { font-size: 13.5px; color: #072a62; cursor: pointer; margin: 6px 0 2px; }
#myquotes-list .ghost.need-act { border-color: #dc0a17; color: #a8071a; font-weight: 800; }

/* v12n16O10h: on a narrow phone the four shortcut tiles keep a real width and the row scrolls, instead of one tile
   being squeezed to zero width by flex:1 1 0 with nowrap text. */
@media (max-width: 400px) {
  .xtools { overflow-x: auto !important; }
  .xtools button { flex: 0 0 auto !important; min-width: 74px !important; }
}

/* O10j (start): the 44px floor for the controls that sit in rows. The audit counted 203 controls under 44px at 320;
   the biggest groups were the category chips (34px), the shortcut tiles (40px) and the pager buttons. */
@media (max-width: 520px) {
  .chips button { min-height: 44px; }
  .xtools button { min-height: 44px !important; }
  .pgb, .pager button, .pg-compact button, .pg-jump button { min-height: 44px; min-width: 44px; }
  .pg-jump input { min-height: 44px; }
}

/* QA on O10i: the activity select in sign-up was half the width of the fields above it, and the bell in the customer
   header measured 32px. Both are brought in line with the rest of the form. */
#act-row { width: 100%; }
#act-row select, dialog select[name=activity] { width: 100%; box-sizing: border-box; }
#bell, #bellb, .bellbtn, #bell-btn { min-width: 44px; min-height: 44px; }
/* a long customer name is cut with an ellipsis instead of pushing the header out of shape */
#me .pill { max-width: 62vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
#me .pill .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { #me .pill { max-width: 58vw; } }
#me .pill .st { flex: 0 0 auto; }
#me .pill .nm { flex: 0 1 auto; min-width: 0; }

/* v12n16O10t (GAP-08): language button, 44px touch target, readable on the dark header */
.langbtn{min-width:44px;min-height:44px;padding:0 10px;border:1px solid rgba(255,255,255,.55);border-radius:10px;background:transparent;color:#fff;font:700 14px/1 inherit;cursor:pointer}
.top .brand .langbtn{margin-inline-start:auto;flex:none}
.qo-sum{border:1px solid #b3261e;border-radius:10px;padding:8px;margin:8px 0;background:#fff4f3;color:#5c1410}
.top .brand{flex:1 1 auto}

/* ===== v12n16O11: هوية الصنف، صورة القطعة، ترتيب طلباتي، اللوجو ===== */
.logo { width: 58px; height: 58px; }
@media (max-height:560px){ .logo { width: 30px; height: 30px; } }
@media (max-width:360px){ .logo { width: 24px; height: 24px; } }
.authlogo { width: 96px; height: 96px; }
/* شارات الصفات: يمين/شمال، أمامي/خلفي، علوي/واطي، طويل/قصير، السنة، طقم */
.attrs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.at { display: inline-block; font-size: 12.5px; font-weight: 800; line-height: 1.6; padding: 0 8px; border-radius: 999px;
      background: #eef2fb; color: #072a62; border: 1px solid #c9d3e4; }
.at-side { background: #e7f6ef; border-color: #9fd6bb; color: #14603f; }
.at-pos { background: #eef2fb; border-color: #b9c9e6; color: #12386f; }
.at-vert { background: #f3eefb; border-color: #cfc0e8; color: #4a2a7a; }
.at-len { background: #fdf3e6; border-color: #f0cf9f; color: #7a4a12; }
.at-year { background: #fff; border-color: #b9c9e6; color: #072a62; font-variant-numeric: tabular-nums; }
.at-kit { background: #fdeceb; border-color: #f3b7b2; color: #8d1a12; }
.at-warn { background: #fff4d6; border-color: #e8b23a; color: #6b4a00; display: inline-block; margin: 2px 0; }
.attrs.sm .at { font-size: 11.5px; padding: 0 6px; }
/* تنبيه الأصناف المتشابهة في نتايج البحث */
.sr-warn { background: #fff4d6; border: 1px solid #e8b23a; color: #5a3d00; border-radius: 10px; padding: 8px 10px; font-size: 13.5px; line-height: 1.6; margin: 6px 0; }
/* سطر هوية الصنف في السلة والطلبات */
.qid { font-size: 12.5px; color: #4a5568; margin: 1px 0 2px; }
/* صورة القطعة القديمة */
.qphoto { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.photobtn { font-size: 13px; min-height: 38px; }
.photobtn small { font-weight: 400; opacity: .8; }
.phthumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid #c9d3e4; }
.phstate { font-size: 12.5px; font-weight: 700; color: #14603f; }
.phstate.bad { color: #b3261e; }
.phdel { min-height: 34px; padding: 0 10px; }
/* البدائل المستبعدة */
.altrej { margin-top: 10px; font-size: 12.5px; color: #5a3d00; background: #fff4d6; border: 1px solid #e8b23a; border-radius: 10px; padding: 8px 10px; }
.altrej ul { margin: 4px 0 0; padding-inline-start: 18px; }
.altrej li { margin: 2px 0; line-height: 1.5; }
/* سطر عدد الأصناف + رابط الدليل */
.cocount { text-align: center; font-size: 13.5px; font-weight: 700; color: #072a62; background: #eef2fb; border: 1px solid #d5deee; border-radius: 999px; padding: 5px 12px; margin: 8px 0 6px; }
.helpline { margin: 6px 0 0; text-align: center; }
.helpline a { color: #072a62; font-weight: 700; font-size: 13.5px; }
/* طلباتي: العنوان ثابت وانت بتنزل (الفلتر ثابت كمان) */
#myquotes-dialog > div > h2 { position: sticky; top: -18px; z-index: 8; background: #fff; margin: 0 0 8px; padding: 6px 0 8px; }
#myquotes-dialog .mqbar { top: -10px; }   /* v12n16O11: the filter bar lives inside the scrolling list, so a positive top would push it down over the first card at rest */

/* v12n16O11 (visual pass): the alternatives row wraps instead of squeezing the name into a narrow column */
.altrow { flex-wrap: wrap; align-items: flex-start; }
.altrow > div { flex: 1 1 210px; min-width: 0; }
.altrow button { flex: 0 0 auto; margin-top: 6px; }
@media (max-width: 430px) { .altrow button { flex: 1 1 100%; } }
/* the sticky bars in طلباتي read as a header over the list, so they carry a shadow */
#myquotes-dialog > div > h2 { box-shadow: 0 6px 8px -6px rgba(7,42,98,.28); }
#myquotes-dialog .mqbar { box-shadow: 0 6px 8px -6px rgba(7,42,98,.28); }
.stepsw { margin: 2mm 0 1mm; }
.stepsw .steps { margin-top: 1mm; }

/* v12n16O12: «مطلوب منك» block on the home screen */
.todoblk { margin: 10px 12px 4px; }
.todoblk .tdb { border: 2px solid #dc0a17; background: linear-gradient(180deg,#fff6f6,#fff); border-radius: 14px; padding: 12px 12px 10px; box-shadow: 0 8px 18px -12px rgba(220,10,23,.55); }
.todoblk .tdbh { display: flex; align-items: center; gap: 8px; color: #a8071a; font-size: 16px; }
.todoblk .tdbn { background: #dc0a17; color: #fff; border-radius: 999px; font-size: 12.5px; font-weight: 800; padding: 2px 8px; }
.todoblk .tdbt { margin: 6px 0 10px; font-size: 14.5px; line-height: 1.65; color: #222; }
.todoblk .tdba { display: flex; gap: 8px; flex-wrap: wrap; }
.todoblk .tdba button { flex: 1 1 44%; min-height: 46px; font-weight: 800; }
.todoblk .tdba button.primary { flex: 1 1 100%; }
/* the approval review */
#apv-dlg { width: min(430px, 94vw); border: 0; border-radius: 16px; padding: 0; }
#apv-dlg > div { padding: 16px; }
#apv-dlg h2 { margin: 0 0 10px; font-size: 19px; color: #072a62; }
.apvhead { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.apvhead .qstat { background: #eef2f8; color: #072a62; border-radius: 8px; padding: 3px 8px; font-size: 12.5px; font-weight: 700; }
.apvl { border-bottom: 1px solid #eee; padding: 8px 0; }
.apvl .apvn { font-weight: 700; font-size: 14.5px; line-height: 1.5; }
.apvl .apvm { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.apvl .apvm small { color: #555; font-size: 12.5px; }
.apvtot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 2px solid #072a62; font-size: 16px; color: #072a62; }
.apvtot b { font-size: 19px; }
.apvnote { font-size: 12.5px; color: #666; line-height: 1.6; margin: 10px 0 0; }
#apv-dlg menu { display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 14px 0 0; }
#apv-dlg menu button { min-height: 46px; font-weight: 800; }
/* clickable notification cards */
.ntg[role="button"] { cursor: pointer; position: relative; }
.ntg[role="button"]:active { background: #f2f5fa; }
.ntg .ntgo { margin-inline-start: auto; color: #072a62; font-size: 20px; line-height: 1; font-weight: 800; }
.ntg .ntlnk { margin-top: 6px; font-size: 13px; font-weight: 800; color: #0b57d0; text-decoration: underline; }
.ntg.flash, .quote-card.flash { animation: ntflash 1.2s ease 2; }
@keyframes ntflash { 0%,100% { background: #fff; } 50% { background: #fff6d6; } }

/* v12n16O12: the customer header keeps the bell and the way out; everything else lives in one menu (no taller header) */
.top .memore { font-size: 17px; line-height: 1; padding: 6px 11px; min-width: 34px; min-height: 0; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
.top #me-menu.memenu { position: absolute; inset-inline-end: 12px; top: calc(100% - 4px); z-index: 60; background: #fff; border: 1px solid #dfe5ee;
  border-radius: 12px; box-shadow: 0 14px 30px -12px rgba(7,42,98,.45); padding: 6px; min-width: 196px; display: flex; flex-direction: column; gap: 2px; }
.top #me-menu.memenu[hidden] { display: none; }
.top #me-menu .mit { text-align: start; border: 0; background: #fff; color: #072a62; font: inherit; font-size: 15px; font-weight: 700;
  padding: 11px 12px; border-radius: 9px; min-height: 44px; }
.top #me-menu .mit:active { background: #eef2f8; }
.top.menuopen #me-more { background: #072a62; color: #fff; border-color: #072a62; }
.top.loggedin .brand #lang-btn { display: none; }

/* v12n16O12: the whole customer row is one line of 34px, so the header is shorter than it was with five buttons */
.top #me .mini, .top #me .memore { box-sizing: border-box; height: 34px; min-height: 0; display: inline-flex; align-items: center; justify-content: center; }
.top #me .pill { box-sizing: border-box; height: 34px; display: inline-flex; align-items: center; }
.top.loggedin #me #bell { height: 32px !important; min-height: 0 !important; box-sizing: border-box; display: inline-flex; align-items: center; }
.top.loggedin #me button { min-height: 32px !important; }
.top.loggedin #me .pill { flex: 0 0 auto; width: auto; max-width: 54%; overflow: hidden; white-space: nowrap; }
.top.loggedin #me .pill .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* v12n16O12: the dropdown needs the header as its positioning box, otherwise it lands under the whole page */
.top { position: relative; z-index: 40; }
/* v12n16O12: the bell menu holds three buttons; let them wrap instead of squeezing the label into three lines */
#bell-dlg menu { flex-wrap: wrap; }
#bell-dlg menu #bell-markall { flex: 1 1 100%; }

/* =============================================================================
   ElAdham — customer design system  (app.css)  ·  design-2  ·  December 2026
   -----------------------------------------------------------------------------
   MERGE ORDER (do not reorder):
     1. the final6 base above — kept verbatim so no rule and no selector of the
        current build is lost (behaviour, print sheet, viewport fixes).
     2. sections 1-17 below — the design system.
     3. section 18 — final6 rules the system did not cover, in their own @media.
     4. section 19 — the components added after final3 (header menu, "مطلوب منك الآن",
        approval dialog, notification list, search bar), designed to the system.
   ============================================================================= */

/* =============================================================================
   ElAdham — customer design system  (app.css)
   Version: design-1  ·  December 2026
   -----------------------------------------------------------------------------
   The file is the single source of truth for everything the CUSTOMER sees.
   It is loaded after ui.css, so the tokens below win on customer pages; the
   admin panel loads ui.css alone and is untouched.
   Order: 1 tokens · 2 base · 3 shell · 4 buttons · 5 forms · 6 chips/filters ·
          7 catalogue + card · 8 pagers · 9 info blocks · 10 dialogs ·
          11 my orders · 12 alternatives · 13 notifications · 14 offer ·
          15 invoice/print · 16 responsive · 17 utilities
   Rule of thumb: no raw hex below section 1. Every colour, size and gap comes
   from a token. Font weights stop at 700 because Cairo ships 400/600/700 only.
   ============================================================================= */

/* ===== 1. TOKENS ========================================================== */
:root {
  /* Brand navy — structure, primary actions, headings */
  --navy-950:#041630; --navy-900:#05204a; --navy-800:#062a5f; --navy-700:#072a62;
  --navy-600:#0e3c82; --navy-500:#1b4c99; --navy-300:#7c9bc9; --navy-100:#e8eef8; --navy-050:#f2f6fc;
  /* Brand gold — accent, highlights, the offer band. Never white text on gold. */
  --gold-700:#8a6414; --gold-600:#b8892b; --gold-500:#e8b23a; --gold-400:#f2c862; --gold-100:#fbf1d8;
  /* Neutrals — text, surfaces, lines */
  --ink-900:#121722; --ink-700:#2c3542; --ink-600:#414c5c; --ink-500:#55606f;
  --line:#dde3ec; --line-strong:#c3ccda; --field-line:#6b7a8f;
  --bg:#f4f6fa; --surface:#ffffff; --surface-2:#eef2f8; --surface-3:#f7f9fc;
  --on-navy:#ffffff; --on-navy-ink:#e6ecf7; --tag-ink:#dbe4f3;
  /* Status */
  --ok-700:#14603f; --ok-bg:#e7f6ef; --ok-line:#9fd6bb;
  --warn-700:#7a4f00; --warn-bg:#fdf3d7; --warn-line:#e8cf9a;
  --bad-700:#a31a14; --bad-bg:#fdecea; --bad-line:#f3b7b2;
  --red-600:#dc0a17;                     /* logo red: destructive confirm only */

  /* Legacy names still read by ui.css (toast, errbox, pendbar, osum) and inline styles */
  --navy:#072a62; --navy-2:#05204a; --gold:#e8b23a; --red:#dc0a17;
  --bg:#f4f6fa; --card:#ffffff; --ink:#121722; --muted:#55606f;
  --ok:#14603f; --warn:#7a4f00; --warn-bg:#fdf3d7; --bad:#a31a14; --line:#dde3ec;

  /* Type — one scale, rem, root 16px. Nothing functional below .875rem. */
  --font:"Cairo","Segoe UI",Tahoma,sans-serif;
  --fs-hero:1.75rem;      /* 28px  big number / offer ceiling   */
  --fs-h1:1.5rem;         /* 24px  page title                    */
  --fs-h2:1.375rem;       /* 22px  dialog title                  */
  --fs-h3:1.0625rem;      /* 17px  card / section title          */
  --fs-body:1rem;         /* 16px  body copy, inputs, buttons    */
  --fs-sm:0.9375rem;      /* 15px  secondary copy, labels        */
  --fs-xs:0.875rem;       /* 14px  meta, chips, captions (floor) */
  --lh-tight:1.3; --lh-body:1.65;

  /* Spacing — one scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:24px; --sp-6:32px; --sp-7:48px;
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px;   /* names ui.css uses */
  --t-sm:0.9375rem; --t-md:1rem; --t-lg:1.125rem; --t-xl:1.375rem;   /* names ui.css uses */

  /* Radius + elevation */
  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:22px; --r-pill:999px; --r:16px;
  --sh-1:0 1px 2px rgba(9,23,48,.06), 0 1px 3px rgba(9,23,48,.05);
  --sh-2:0 6px 18px rgba(9,23,48,.10);
  --sh-3:0 18px 48px rgba(9,23,48,.24);
  --sh:var(--sh-1);

  /* Layout + controls */
  --wrap:1180px; --pad:14px;
  --tap:44px;            /* minimum touch target (WCAG 2.5.5) */
  --ctl:48px;            /* default control height             */
}

/* ===== 2. BASE ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
/* safety belt 2026-12-06: no wide child may shift the whole page sideways.
   clip (not hidden) on body keeps position:sticky working. */
body { overflow-x: clip; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-body); line-height: var(--lh-body);
  color: var(--ink-900); background: var(--bg);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));   /* room for the fixed order bar */
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: var(--lh-tight); }
p { margin: 0 0 var(--sp-2); }
b, strong { font-weight: 700; }
small { font-size: var(--fs-xs); }
img { max-width: 100%; }
a { color: var(--navy-700); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--navy-700); outline-offset: 2px; box-shadow: none; border-radius: var(--r-sm); }
.top :focus-visible, .cta :focus-visible, #me :focus-visible { outline-color: var(--gold-500); box-shadow: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ===== 3. SHELL: header, main, fixed order bar ============================ */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-2) max(var(--pad), calc((100vw - var(--wrap)) / 2));
  background: linear-gradient(180deg, var(--navy-700) 0%, var(--navy-800) 100%);
  color: var(--surface); border-bottom: 3px solid var(--gold-500);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; flex: 1 1 auto; }
.brand > div { min-width: 0; flex: 1 1 auto; text-align: start; }
.logo { width: 52px; height: 52px; flex: 0 0 auto; object-fit: contain; border-radius: 50%;
        background: var(--surface); padding: 2px; box-shadow: 0 0 0 2px rgba(232,178,58,.85); }
.top h1 { font-size: var(--fs-h1); color: var(--surface); letter-spacing: .2px; }
.top .tag { margin: var(--sp-1) 0 0; font-size: var(--fs-xs); line-height: 1.4; color: var(--tag-ink); text-wrap: balance; }
.langbtn {
  min-width: var(--tap); min-height: var(--tap); padding: 0 var(--sp-3); flex: 0 0 auto;
  border: 1.5px solid rgba(255,255,255,.6); border-radius: var(--r-pill);
  background: transparent; color: var(--surface); font: 700 var(--fs-xs)/1 var(--font); cursor: pointer;
}
.langbtn:hover { background: rgba(255,255,255,.14); }

#me { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: flex-end; min-width: 0; flex: 0 0 auto; }
#me button, #me .mini, #me a.mini {
  min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 0 var(--sp-3); border-radius: var(--r-md);
  font: 700 var(--fs-xs)/1.25 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
#me button { background: var(--surface); color: var(--navy-700); border: 0; }
#me .mini { background: rgba(255,255,255,.12); color: var(--surface); border: 1.5px solid rgba(255,255,255,.45); }
#me .mini:hover { background: rgba(255,255,255,.22); }
#me .pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0;
  background: var(--gold-500); color: var(--navy-950); border-radius: var(--r-pill);
  padding: 8px var(--sp-3); font-size: var(--fs-xs); font-weight: 700; line-height: 1.3;
}
#me .pill.pending { background: var(--gold-100); color: var(--warn-700); border: 1.5px solid var(--warn-line); }
#me .pill .nm { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#me .pill .ok { flex: 0 0 auto; }
#me .pill .st { flex: 0 0 auto; }
.top.loggedin { flex-wrap: wrap; }
.top.loggedin .brand { flex: 1 1 100%; }
.top.loggedin #me { flex: 1 1 100%; justify-content: flex-start; }
#me a.mini { background: transparent; color: var(--surface); border: 1.5px solid rgba(255,255,255,.45); }

/* the bell keeps its number badge and gets a word, so it is never an icon alone */
.bell { position: relative; }
.bell::after { content: "إشعارات"; }
.bn { position: absolute; top: -4px; inset-inline-start: -4px; min-width: 20px; padding: 0 5px;
      background: var(--red-600); color: var(--surface); border-radius: var(--r-pill); font-size: var(--fs-xs);
      font-weight: 700; line-height: 20px; text-align: center; }

main { max-width: var(--wrap); margin: 0 auto; }

/* the fixed order bar */
.cta {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: flex; gap: var(--sp-3);
  padding: var(--sp-3) max(var(--pad), calc((100vw - var(--wrap)) / 2)) calc(var(--sp-3) + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.98); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(9,23,48,.08);
}
.cta .primary { flex: 1 1 auto; min-height: 52px; padding: 0 var(--sp-2); font-size: 1rem; white-space: nowrap; }
.cta .ghost { flex: 0 0 auto; min-height: 52px; padding: 0 var(--sp-2); font-size: var(--fs-xs); white-space: nowrap; }

/* ===== 4. BUTTONS ========================================================= */
/* one shape for every action: 48px tall, 14px radius, Cairo 700 1rem, icon + word */
button.primary, .primary.link, .ghost, .addbtn, .pgb, .mqbar button, .xtools button, .chips button {
  font-family: var(--font); cursor: pointer; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
button.primary, .primary.link {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--ctl); padding: 0 var(--sp-5);
  background: var(--navy-700); color: var(--surface); border: 1.5px solid var(--navy-700); border-radius: var(--r-md);
  font-size: var(--fs-body); font-weight: 700; text-align: center; text-decoration: none;
}
button.primary:hover, .primary.link:hover { background: var(--navy-600); border-color: var(--navy-600); }
button.primary:active, .primary.link:active { background: var(--navy-800); border-color: var(--navy-800); transform: translateY(1px); }
.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--ctl); padding: 0 var(--sp-4);
  background: var(--surface); color: var(--navy-700); border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 700; text-decoration: none;
}
.ghost:hover { background: var(--navy-050); border-color: var(--navy-300); }
.ghost:active { background: var(--navy-100); }
/* destructive: red is reserved for "this removes something" */
button.danger, .btn-danger { background: var(--bad-700); border-color: var(--bad-700); color: var(--surface); }
button.danger:hover, .btn-danger:hover { background: var(--red-600); border-color: var(--red-600); }
/* disabled doubles as "submitting": app.js disables a submit while its request is in flight */
button:disabled, .ghost:disabled, .pgb:disabled {
  opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important;
}
button[aria-busy="true"] { position: relative; color: transparent !important; }
button[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.45); border-top-color: var(--surface); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 5. FORMS =========================================================== */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  min-height: var(--ctl); font-family: var(--font); font-size: var(--fs-body);
}
input::placeholder, textarea::placeholder { color: var(--ink-500); opacity: 1; }
[aria-invalid="true"] { border-color: var(--bad-700) !important; background: var(--bad-bg) !important; }
.ferr { display: block; color: var(--bad-700); font-size: var(--fs-xs); font-weight: 700; margin-top: var(--sp-1); }

/* ===== 6. SEARCH AREA, CHIPS, FILTERS ===================================== */
.searchbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--pad);
  background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line);
}
.sbox { position: relative; flex: 1; min-width: 0; display: block; }
@media (max-width: 560px) {
  .searchbar { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
  .sbox { grid-column: 1 / -1; }
  .searchbar #qbtn, .searchbar #fbtn { width: 100%; }
}
.sbox input {
  width: 100%; min-height: 52px; margin: 0;
  padding: 0 var(--sp-4); padding-inline-end: 88px;   /* leaves room for the voice button */
  font-size: var(--fs-body); font-weight: 600; color: var(--ink-900);
  background: var(--surface); border: 1.5px solid var(--field-line); border-radius: var(--r-lg);
}
.sbox input:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(7,42,98,.14); }
.sbox .micbtn {
  position: absolute; inset-inline-end: 5px; top: 5px; bottom: 5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: auto; min-width: 76px; padding: 0 var(--sp-2);
  background: var(--surface-2); color: var(--navy-700); border: 0; border-radius: var(--r-md);
  font-size: var(--fs-xs); font-weight: 700;
}
.sbox .micbtn::after { content: "صوت"; }              /* the mic never stands alone */
.sbox .micbtn.on { background: var(--bad-700); color: var(--surface); animation: micp 1.1s ease-in-out infinite; }
@keyframes micp { 50% { box-shadow: 0 0 0 5px rgba(163,26,20,.22); } }
.searchbar #qbtn, .searchbar #fbtn, .searchbar button {
  min-height: 52px; padding: 0 var(--sp-4); border-radius: var(--r-lg);
  font-size: var(--fs-body); font-weight: 700; white-space: nowrap;
}
.searchbar #qbtn { background: var(--navy-700); color: var(--surface); border: 1.5px solid var(--navy-700); }
.searchbar #qbtn:hover { background: var(--navy-600); }
.searchbar #fbtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--navy-700); border: 1.5px solid var(--line-strong);
}
.searchbar #fbtn:hover { background: var(--navy-050); }
#fbtn::after {
  content: ""; width: 0; height: 0; border-inline: 4px solid transparent; border-top: 5px solid currentColor;
  transition: transform .15s ease;
}
body.fopen #fbtn::after { transform: rotate(180deg); }

.miclive {
  display: flex; align-items: center; gap: var(--sp-2); margin: 0 var(--pad) var(--sp-2);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md);
  background: var(--bad-bg); color: var(--bad-700); font-size: var(--fs-sm); font-weight: 700;
}
.miclive .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad-700); animation: micp 1.1s infinite; }
.miclive button { margin-inline-start: auto; min-height: 40px; border: 0; border-radius: var(--r-sm);
                  background: var(--bad-700); color: var(--surface); padding: 0 var(--sp-3); font-weight: 700; }

/* quick tools: two clear tiles per row on a phone, four on a tablet and up */
.xtools { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin: var(--sp-3) var(--pad) var(--sp-2); }
.xtools button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; padding: var(--sp-2) 6px;
  background: var(--surface); color: var(--navy-700); border: 1.5px solid var(--line-strong); border-radius: var(--r-lg);
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.25; text-align: center;
}
.xtools button:hover { border-color: var(--navy-300); background: var(--navy-050); }
.xtools button small { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--ink-600); line-height: 1.3; }

.xmore { margin: var(--sp-3) var(--pad); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 var(--sp-4); }
.xmore summary { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--ctl); cursor: pointer;
                 font-size: var(--fs-sm); font-weight: 700; color: var(--navy-700); }
.xmore-b { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 0 var(--sp-4); }
.xmore-b button { min-height: var(--tap); }
#upd-msg { color: var(--ink-600); }

.chips { display: flex; gap: var(--sp-2); overflow-x: auto; padding: var(--sp-2) var(--pad) var(--sp-1); scrollbar-width: none; }
.chips::-webkit-scrollbar, .xtools::-webkit-scrollbar { display: none; height: 0; }
.chips button {
  flex: 0 0 auto; min-height: var(--tap); padding: 0 var(--sp-4); white-space: nowrap;
  background: var(--surface); color: var(--navy-700); border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  font-size: var(--fs-sm); font-weight: 600;
}
.chips button:hover { border-color: var(--navy-300); background: var(--navy-050); }
.chips button.on { background: var(--navy-700); border-color: var(--navy-700); color: var(--surface); }

.filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: flex-end; padding: var(--sp-2) var(--pad) var(--sp-1); }
.filters .fsel { flex: 1 1 30%; min-width: 108px; display: flex; flex-direction: column; gap: var(--sp-1);
                 font-size: var(--fs-xs); font-weight: 600; color: var(--ink-600); }
.filters select {
  width: 100%; min-height: var(--tap); padding: 0 var(--sp-2);
  background: var(--surface); color: var(--ink-900); border: 1.5px solid var(--field-line); border-radius: var(--r-md);
  font-size: var(--fs-sm);
}
.filters .fclear { flex: 0 0 auto; min-height: var(--tap); }

/* search answer bar */
.suggest { padding: 0 var(--pad) var(--sp-2); font-size: var(--fs-sm); line-height: 1.7; color: var(--ink-700); }
.suggest b { color: var(--navy-700); }
.suggest a { display: inline-flex; align-items: center; min-height: 32px; margin-inline-start: 6px; font-weight: 700; }
.suggest .sr-head { color: var(--ink-700); }
.suggest .sr-head a, .suggest .sr-none a, .suggest .sr-sug a { display: inline-flex; min-height: 32px; line-height: 32px; }
.suggest .sr-none { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-700);
                    border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin-top: var(--sp-1); }
.sr-warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-700);
           border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); line-height: 1.6; margin: var(--sp-2) 0; }

/* ===== 7. CATALOGUE + PRODUCT CARD ======================================= */
.cocount { margin: var(--sp-2) var(--pad) var(--sp-3); text-align: center;
           font-size: var(--fs-sm); font-weight: 600; color: var(--ink-600); }
.pricenote {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  margin: 0 var(--pad) var(--sp-3); padding: var(--sp-3);
  background: var(--navy-050); border: 1px solid var(--navy-100); border-inline-start: 4px solid var(--gold-500);
  border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 600; color: var(--navy-700); line-height: 1.6;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); padding: 0 var(--pad) var(--sp-2); }
.card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-4); box-shadow: var(--sh-1);
}
.card h2 { font-size: var(--fs-h3); line-height: 1.45; margin: 0; text-align: start; }
.itembtn {
  all: unset; box-sizing: border-box; display: block; width: 100%; min-height: var(--tap);
  padding: 2px 0; font: inherit; font-weight: 700; color: var(--navy-700); line-height: 1.45;
  text-align: start; cursor: pointer;
}
.itembtn:hover { color: var(--navy-500); text-decoration: underline; text-underline-offset: 3px; }
.card .meta { font-size: var(--fs-xs); color: var(--ink-600); line-height: 1.5; }
.card .meta.origin { color: var(--ink-600); font-weight: 600; }
.card .row2 { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.card .avail { font-size: var(--fs-xs); font-weight: 700; padding: 3px var(--sp-3); border-radius: var(--r-pill); }
.avail.in { color: var(--ok-700); background: var(--ok-bg); }
.avail.ask { color: var(--warn-700); background: var(--warn-bg); }
.avail.out { display: block; padding: 6px var(--sp-3); color: var(--warn-700); background: var(--warn-bg);
             border-radius: var(--r-md); line-height: 1.45; font-weight: 600; }
.card .price { font-size: 1.3125rem; font-weight: 700; color: var(--navy-700); font-variant-numeric: tabular-nums; }
.card .noprice {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 5px var(--sp-3); border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--navy-700); border: 1px solid var(--navy-100);
  font-size: var(--fs-xs); font-weight: 700;
}
.card .noprice::after, .altrow .noprice::after { content: "السعر بعد التفعيل"; }
.card .pimg { width: 100%; height: 132px; object-fit: contain; background: var(--surface-2); border-radius: var(--r-md); margin-bottom: 2px; }

/* attribute chips (يمين/شمال، سنة، طقم…) */
.attrs { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: 2px 0; }
.at {
  display: inline-block; padding: 1px var(--sp-2); border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.7;
  background: var(--navy-050); color: var(--navy-700); border: 1px solid var(--navy-100);
}
.at-side { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-700); }
.at-pos { background: var(--navy-050); border-color: var(--navy-100); color: var(--navy-700); }
.at-vert { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink-700); }
.at-len { background: var(--gold-100); border-color: var(--warn-line); color: var(--gold-700); }
.at-year { background: var(--surface); border-color: var(--line-strong); color: var(--navy-700); font-variant-numeric: tabular-nums; }
.at-kit { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-700); }
.at-warn { background: var(--warn-bg); border-color: var(--gold-500); color: var(--warn-700); margin: 2px 0; }
.attrs.sm .at { font-size: var(--fs-xs); padding: 0 6px; }

/* quantity stepper — 48px tall, 44px targets */
.step { display: flex; align-items: stretch; flex: 0 0 auto; background: var(--surface);
        border: 1.5px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; }
.step button, .qstep button, .stepper button, .qi .stp button {
  width: var(--tap); min-width: var(--tap); min-height: var(--ctl); margin: 0; padding: 0;
  background: var(--surface-2); color: var(--navy-700); border: 0; border-radius: 0;
  font-size: 1.25rem; font-weight: 700; line-height: 1;
}
.step button:hover { background: var(--navy-100); }
.step input {
  width: 52px; min-height: var(--ctl); margin: 0; padding: 0; display: block;
  border: 0; border-inline: 1px solid var(--line-strong); border-radius: 0;
  background: var(--surface); color: var(--navy-700); text-align: center;
  font-size: var(--fs-h3); font-weight: 700;
}
.buyrow { display: flex; align-items: stretch; gap: var(--sp-2); margin-top: 2px; }
.buyrow .addbtn {
  flex: 1; min-height: var(--ctl); margin: 0; padding: 4px var(--sp-3);
  background: var(--navy-700); color: var(--surface); border: 1.5px solid var(--navy-700); border-radius: var(--r-md);
  font-size: var(--fs-body); font-weight: 700; line-height: 1.2;
}
.buyrow .addbtn:hover { background: var(--navy-600); border-color: var(--navy-600); }
.buyrow .addbtn.inlist { background: var(--ok-bg); color: var(--ok-700); border-color: var(--ok-line); }

/* secondary row: two columns on a phone so every label stays on one line */
.subrow { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-top: 2px; }
.subrow > *:last-child:nth-child(odd) { grid-column: 1 / -1; }
.subrow > * {
  min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0; padding: 0 var(--sp-2); border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
}
.card button.ghost, .itemdlg button.ghost { background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--navy-700); }
.card button.ghost:hover, .itemdlg button.ghost:hover { background: var(--navy-050); border-color: var(--navy-300); }
.card .subrow .favbtn { font-size: var(--fs-sm); }
.favbtn::after { content: "احفظ"; }
.favbtn[aria-pressed="true"]::after { content: "محفوظ"; }
.favbtn[aria-pressed="true"] { color: var(--gold-700); border-color: var(--gold-500); background: var(--gold-100); }
.card .subrow .altbtn, .altbtn { border-color: var(--line-strong); color: var(--navy-700); background: var(--surface); }
.altbtn.sm { min-height: 40px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.card .cardrow { display: flex; gap: var(--sp-2); }
.card .cardrow button { flex: 1; }

/* inline alternatives under an out-of-stock card */
.inalts { margin: var(--sp-1) 0; }
.inalts:empty { display: none; }
.inalt-h { font-size: var(--fs-xs); font-weight: 700; color: var(--ok-700); }
.inalt { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; font-size: var(--fs-xs); padding: 2px 0; }
.inalt .noprice, .altrow .noprice { font-size: var(--fs-xs); color: var(--navy-700); background: var(--surface-2);
  border: 1px solid var(--navy-100); border-radius: var(--r-pill); padding: 3px var(--sp-2); }
.stk { font-size: var(--fs-xs); font-weight: 700; }
.stk.in { color: var(--ok-700); } .stk.partial { color: var(--warn-700); }
.stk.out { color: var(--ink-600); } .stk.ask { color: var(--warn-700); }
.stkrow { display: block; margin-top: 2px; }
.topsell { font-size: var(--fs-xs); color: var(--gold-700); font-weight: 700; }
.origin { color: var(--ink-600); font-weight: 600; }

/* ===== 8. PAGERS ========================================================= */
.pager-top { margin: 0 var(--pad) var(--sp-1); }
.pg-compact { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); }
.pg-compact button { min-width: var(--tap); min-height: var(--tap); padding: 0 var(--sp-2); border: 0; border-radius: var(--r-sm);
  background: var(--navy-700); color: var(--surface); font-size: var(--fs-sm); font-weight: 700; }
.pg-compact button:disabled, .pgb:disabled { opacity: .35; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  margin: var(--sp-4) var(--pad) var(--sp-2); padding: var(--sp-3) var(--sp-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pgb { min-width: var(--tap); min-height: var(--tap); padding: 0 var(--sp-3);
  background: var(--surface); color: var(--navy-700); border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 700; }
.pgb:hover { background: var(--navy-050); border-color: var(--navy-300); }
.pgb.cur { background: var(--navy-700); border-color: var(--navy-700); color: var(--surface); }
.pg-gap { color: var(--ink-500); padding: 0 2px; }
.pg-info { width: 100%; text-align: center; color: var(--ink-600); font-size: var(--fs-sm); margin-top: 2px; }
.pg-jump { width: 100%; display: flex; align-items: center; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-1); }
.pg-jump label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-700); }
.pg-jump input { width: 72px; min-height: var(--tap); margin: 0; padding: 0; text-align: center;
  border: 1.5px solid var(--field-line); border-radius: var(--r-md); font-size: var(--fs-body); }

/* ===== 9. INFO BLOCKS ==================================================== */
.infobar { margin: var(--sp-3) var(--pad); padding: var(--sp-3); background: var(--navy-050);
  border: 1px solid var(--navy-100); border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--navy-700); }
.infobar p { margin: 0; }
.helpline { margin-top: var(--sp-2) !important; }
.helpline a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; color: var(--navy-700); }
.cocard { margin: var(--sp-4) var(--pad) 90px; padding: var(--sp-4); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); font-size: var(--fs-sm); line-height: 1.8; }
.cocard strong { display: block; font-size: var(--fs-h3); color: var(--navy-700); margin-bottom: var(--sp-2); }
.cocard ul { margin: var(--sp-2) 0; padding-inline-start: 20px; color: var(--ink-700); }
.cocard .co { display: flex; flex-direction: column; gap: 2px; margin-top: var(--sp-3); color: var(--ink-700); }
.cocard a { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; }

.notice { background: var(--bad-bg); border-inline-start: 4px solid var(--bad-700); color: var(--bad-700);
  border-radius: var(--r-md); padding: var(--sp-3); font-size: var(--fs-sm); font-weight: 700; line-height: 1.65; }
.hint { font-size: var(--fs-sm); color: var(--ink-600); line-height: 1.6; }
.err { color: var(--bad-700); font-size: var(--fs-sm); font-weight: 700; }
.err .err-line { display: block; margin: 2px 0; }
.err .err-line::before { content: "• "; }
.stocknote { background: var(--navy-050); border: 1px solid var(--navy-100); border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); font-weight: 700; color: var(--navy-700); }
.empty, .errbox { text-align: center; color: var(--ink-600); padding: var(--sp-5) var(--sp-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin: var(--sp-3) var(--pad); }
.errbox { color: var(--bad-700); border-color: var(--bad-line); }
.errbox button { margin-top: var(--sp-3); background: var(--navy-700); color: var(--surface); border: 0;
  border-radius: var(--r-md); min-height: var(--ctl); padding: 0 var(--sp-5); font-weight: 700; }
.skel { min-height: 140px; border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: sk 1.3s ease infinite; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.pendbar, #pendbar { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-700);
  border-radius: var(--r-md); padding: var(--sp-3); margin: var(--sp-3) var(--pad); font-size: var(--fs-sm); font-weight: 700; }
#offer-nudge { margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md);
  background: var(--navy-050); border: 1.5px solid var(--navy-100); color: var(--navy-700);
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.5; }
#offer-nudge.ntop { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-700); }
.osum { display: flex; flex-direction: column; gap: 2px; margin: var(--sp-2) 0; font-size: var(--fs-sm); color: var(--ink-700); }
.osum span { display: flex; justify-content: space-between; gap: var(--sp-3); }
.osum .net { border-top: 1px solid var(--line); padding-top: var(--sp-1); font-weight: 700; color: var(--navy-700); }

/* ===== 10. DIALOGS ======================================================= */
dialog {
  width: min(96vw, 460px); max-height: calc(100dvh - 24px); margin: auto;
  padding: var(--sp-4); border: 0; border-radius: var(--r-xl);
  background: var(--surface); color: var(--ink-900); box-shadow: var(--sh-3); overflow: auto;
}
dialog::backdrop { background: rgba(4,22,48,.55); }
dialog h2 { font-size: var(--fs-h2); color: var(--navy-700); margin: 0 0 var(--sp-3); }
dialog label { display: block; margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-sm); font-weight: 700; color: var(--ink-700); }
dialog label > input:not([type=checkbox]), dialog label > select, dialog label > textarea, #qo-text {
  display: block; width: 100%; min-height: var(--ctl); margin-top: var(--sp-1); padding: 10px var(--sp-3);
  background: var(--surface); color: var(--ink-900); border: 1.5px solid var(--field-line); border-radius: var(--r-md);
  font-size: var(--fs-body);
}
dialog label > input:focus, dialog label > select:focus, dialog label > textarea:focus, #qo-text:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(7,42,98,.14); }
dialog menu { display: flex; gap: var(--sp-2); margin: var(--sp-4) 0 0; padding: 0; }
dialog menu .primary { flex: 1; }
dialog menu > button, dialog menu > a { min-height: var(--ctl); }
#act-row select, dialog select[name=activity] { width: 100%; }
.authlogo { display: block; width: 84px; height: 84px; margin: 0 auto var(--sp-2); border-radius: 50%; }
.done { display: grid; gap: var(--sp-3); text-align: center; }
.done h2 { margin-bottom: 0; }
.done .primary.link { width: 100%; }

/* quote dialog (السلة → الطلب) */
#quote-dialog { width: min(96vw, 480px); }
#quote-title { margin-bottom: var(--sp-2); }
.qitems { margin: 0 0 var(--sp-1); }
.qitems .qi { display: block; padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.qitems .qi:last-child { border-bottom: 0; }
.qi .qname { margin-bottom: var(--sp-2); font-size: var(--fs-body); font-weight: 700; line-height: 1.5; color: var(--ink-900); }
.qi .qid { font-size: var(--fs-xs); color: var(--ink-600); margin: 0 0 var(--sp-1); }
.qi .qrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); row-gap: var(--sp-2); }
.qi .qrow .stkrow { flex: 1 1 120px; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qi .qrow .stkrow .altbtn { flex: 1 0 100%; min-height: 38px; }
.qitems .qi button.qdel, .qi .qdel {
  margin-inline-start: auto; min-height: var(--tap); padding: 0 var(--sp-3);
  background: var(--bad-bg); color: var(--bad-700); border: 1.5px solid var(--bad-line); border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 700;
}
.qitems .qi input { display: block; width: 52px; padding: 0; }
.qitems .qi .step button { background: var(--surface-2); color: var(--navy-700); border-radius: 0; padding: 0; }
.qi .qcar { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-1) 0 var(--sp-2); }
.qi .qcar input { flex: 1 1 100px; width: auto; min-width: 0; min-height: 40px; margin: 0; padding: 6px var(--sp-2);
  font-size: var(--fs-xs); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.qi .qcarline { margin: 2px 0 var(--sp-1); font-size: var(--fs-xs); color: var(--ink-600); }
.qi .qyearerr { display: block; margin: -2px 0 var(--sp-2); color: var(--bad-700); font-size: var(--fs-xs); font-weight: 700; }
.qprice { margin: 2px 0; font-size: var(--fs-sm); font-weight: 700; color: var(--navy-700); }
.qprice:empty { display: none; }
.qlt { margin: 2px 0 var(--sp-2); }
.qtotals { margin: var(--sp-2) 0; padding: var(--sp-3); background: var(--navy-050); border: 1px solid var(--navy-100);
  border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--navy-700); }
.qtotals:empty { display: none; }
#quote-dialog menu { position: sticky; bottom: calc(-1 * var(--sp-4)); z-index: 2; margin-top: var(--sp-3);
  padding: var(--sp-3) 0 var(--sp-1); background: var(--surface); border-top: 1px solid var(--line); }
#quote-form select[name=delivery] { width: 100%; min-height: var(--ctl); padding: 0 var(--sp-2);
  border: 1.5px solid var(--field-line); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-sm); }
#consent-row { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-sm); line-height: 1.6; }
#consent-row input { width: auto; flex: 0 0 auto; min-height: 24px; width: 24px; margin-top: 4px; }
#consent-row a { color: var(--navy-700); font-weight: 700; }
#auth-toggle.authnew { display: flex; align-items: center; justify-content: center; min-height: var(--ctl);
  padding: var(--sp-3); border: 2px solid var(--navy-700); border-radius: var(--r-md);
  background: var(--navy-050); color: var(--navy-700); font-weight: 700; text-decoration: none; }
#auth-form .hint { margin: var(--sp-2) 0; }
#prof { border: 0; padding: 0; margin: 0 0 var(--sp-1); }
#prof legend { font-weight: 700; color: var(--navy-700); padding: 0; margin-bottom: var(--sp-1); }
#prof label { display: block; margin: var(--sp-2) 0; }
#prof label[hidden] { display: none; }
dialog hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-4) 0; }

/* item detail dialog */
#item-dlg { width: min(96vw, 480px); }
.itemdlg h2 { font-size: var(--fs-h3); line-height: 1.5; margin: 0 0 var(--sp-2); color: var(--navy-700); }
.itemtbl { width: 100%; border-collapse: collapse; margin: var(--sp-1) 0 var(--sp-3); font-size: var(--fs-sm); }
.itemtbl th { width: 34%; padding: 7px 0; padding-inline-end: var(--sp-3); text-align: start; color: var(--ink-600); font-weight: 600; }
.itemtbl td { padding: 7px 0; text-align: start; color: var(--ink-900); font-weight: 600; }
.itemdlg .subrow { margin-top: var(--sp-2); }

/* ===== 11. «طلباتي» ====================================================== */
#myquotes-dialog { max-height: 90dvh; }
#myquotes-dialog > div > h2 { position: sticky; top: calc(-1 * var(--sp-4)); z-index: 8; margin: 0 0 var(--sp-2);
  padding: var(--sp-2) 0; background: var(--surface); box-shadow: 0 6px 8px -6px rgba(7,42,98,.28); }
#myquotes-list { max-height: 62dvh; overflow-y: auto; }
.mqbar { position: sticky; top: calc(-1 * var(--sp-2)); z-index: 6; display: flex; gap: var(--sp-2);
  margin: 0 0 var(--sp-2); padding: var(--sp-2) 0; background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 8px -6px rgba(7,42,98,.28); }
.mqbar button { flex: 1; min-height: var(--tap); padding: 0 var(--sp-1); background: var(--surface); color: var(--navy-700);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 700; }
.mqbar button span { font-size: var(--fs-xs); font-weight: 600; opacity: .9; }
.mqbar button.on { background: var(--navy-700); border-color: var(--navy-700); color: var(--surface); }
.mqgrp { margin: var(--sp-3) 0 2px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-600); }
.quote-card { margin: var(--sp-2) 0; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.quote-card .qhead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.quote-card .qhead small { margin-inline-start: auto; color: var(--ink-600); }
.quote-card .qstat { padding: 3px var(--sp-3); border-radius: var(--r-pill); background: var(--navy-600); color: var(--surface);
  font-size: var(--fs-xs); font-weight: 700; }
.quote-card .qstat.s-you { background: var(--bad-700); }
.quote-card .qstat.s-ready { background: var(--ok-700); }
.quote-card .qstat.s-done { background: var(--navy-700); }
.quote-card .qstat.s-off { background: var(--ink-500); }
.quote-card .qmeta { margin: var(--sp-1) 0 0; font-size: var(--fs-xs); color: var(--ink-600); }
.quote-card .qglance { margin: var(--sp-1) 0 2px; font-size: var(--fs-sm); color: var(--ink-700); }
.quote-card .changed { color: var(--warn-700); font-weight: 700; }
.qnext { margin: var(--sp-2) 0 var(--sp-1); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md);
  background: var(--navy-050); color: var(--navy-700); font-size: var(--fs-sm); font-weight: 700; line-height: 1.5; }
.qnext.need { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-700); }
.qnext.ready { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-700); }
.qnext.done { background: var(--navy-050); color: var(--navy-700); }
.qnext.off { background: var(--surface-2); color: var(--ink-600); }
.approve-row, #myquotes-list .approve-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
#myquotes-list .approve-row button { flex: 1 1 45%; min-height: var(--tap); }
.qtl summary { margin: var(--sp-2) 0 2px; font-size: var(--fs-sm); font-weight: 700; color: var(--navy-700); cursor: pointer; }
.tl { list-style: none; margin: var(--sp-2) 0; padding: 0 var(--sp-3) 0 0; border-inline-start: 3px solid var(--navy-100);
  border-inline-end: 0; font-size: var(--fs-xs); color: var(--ink-700); }
.tl li { padding: 3px var(--sp-2); }
.tl li b { color: var(--navy-700); }
#myquotes-list .ghost.need-act { border-color: var(--bad-700); color: var(--bad-700); }
.qtybadge { padding: var(--sp-1) var(--sp-3); border-radius: var(--r-sm); background: var(--navy-050); color: var(--navy-700); font-size: var(--fs-xs); }
.qsum { margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.qi.oq { padding: var(--sp-2) 0; border-bottom: 1px dashed var(--line); }
.qphoto { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); }
.photobtn { min-height: 40px; font-size: var(--fs-xs); }
.photobtn small { font-weight: 400; color: var(--ink-600); }
.phthumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line-strong); }
.phstate { font-size: var(--fs-xs); font-weight: 700; color: var(--ok-700); }
.phstate.bad { color: var(--bad-700); }
.phdel { min-height: 36px; padding: 0 var(--sp-2); }

/* ===== 12. ALTERNATIVES ================================================== */
#altmodal { width: min(96vw, 520px); }
#altmodal h2 { margin-bottom: var(--sp-2); }
.altreq { margin-bottom: var(--sp-2); padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); }
.altreq small { color: var(--ink-600); }
.altrow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-2);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.altrow > div { flex: 1 1 220px; min-width: 0; }
.altrow b { font-size: var(--fs-body); line-height: 1.5; }
.altrow small { color: var(--ink-600); font-size: var(--fs-xs); line-height: 1.5; }
.altrow .why { color: var(--ok-700); font-weight: 700; }
.altrow .price { font-size: var(--fs-h3); font-weight: 700; color: var(--navy-700); }
.altrow button { flex: 0 0 auto; margin-top: var(--sp-1); min-height: var(--tap); padding: 0 var(--sp-4);
  background: var(--navy-700); color: var(--surface); border: 1.5px solid var(--navy-700); border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
.altrow button.inlist { background: var(--ok-bg); color: var(--ok-700); border-color: var(--ok-line); }
.altnone { padding: var(--sp-4); border-radius: var(--r-md); background: var(--surface-2); line-height: 1.8; color: var(--ink-700); }
.altrej { margin-top: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md);
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-700); font-size: var(--fs-xs); }
.altrej ul { margin: var(--sp-1) 0 0; padding-inline-start: 18px; }
.altrej li { margin: 2px 0; line-height: 1.55; }
.altwa { margin-top: var(--sp-3); width: 100%; }
#altmodal menu { justify-content: flex-end; }

/* ===== 13. NOTIFICATIONS ================================================= */
.bellbody { max-height: 62dvh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.ntday { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-600); }
.ntg { margin-bottom: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.ntg.unread { background: var(--gold-100); border-color: var(--gold-500); border-inline-start: 5px solid var(--gold-500); }
.nth { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.nth b { font-size: var(--fs-body); }
.udot { display: inline-block; width: 10px; height: 10px; margin-inline-end: 6px; border-radius: 50%; background: var(--red-600); }
.nbadge { padding: 2px var(--sp-2); border-radius: var(--r-pill); background: var(--bad-700); color: var(--surface);
  font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.ntnow { display: flex; flex-direction: column; gap: 2px; margin-top: var(--sp-1); }
.ntstat { font-size: var(--fs-sm); font-weight: 700; color: var(--navy-700); }
.ntnow small, .nthist small { color: var(--ink-600); font-size: var(--fs-xs); }
.nthist { margin-top: var(--sp-1); }
.nthist summary { display: flex; align-items: center; min-height: 40px; font-size: var(--fs-xs); font-weight: 700; color: var(--navy-700); cursor: pointer; }
.nthist ul { list-style: none; margin: 0; padding: 0; }
.nthist li { display: flex; justify-content: space-between; gap: var(--sp-2); padding: 6px 0;
  border-top: 1px dashed var(--line); font-size: var(--fs-xs); color: var(--ink-700); }
.nthist li.unread { font-weight: 700; }
.nt-empty { padding: var(--sp-5) 6px; text-align: center; color: var(--ink-600); }
#bell-dlg menu { flex-wrap: wrap; }
#mic-dlg ol { padding-inline-start: 20px; line-height: 1.9; }

/* quick order + favourites + photo dialogs (built by extras.js) */
.qo-row { margin: var(--sp-2) 0; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); }
.qo-row.bad { border-color: var(--bad-700); background: var(--bad-bg); }
.qo-opt { display: flex; align-items: flex-start; gap: var(--sp-2); min-height: var(--tap); padding: 6px 0; }
.qo-opt > span { flex: 1; }
.qo-opt input { width: 24px !important; min-height: 24px !important; flex: none; margin-top: 4px; }
.qo-w { color: var(--bad-700); font-size: var(--fs-xs); }
.qo-q input { width: 68px; min-height: var(--tap); }
.qo-sum { margin: var(--sp-2) 0; padding: var(--sp-3); border: 1px solid var(--bad-line); border-radius: var(--r-md);
  background: var(--bad-bg); color: var(--bad-700); }
.fav-act { display: flex; gap: var(--sp-2); }
#fav-body .altrow button { min-height: var(--tap); }
#fav-body button.ghost::after { content: "شيل"; }
#fav-body button.ghost { font-size: 0; }
#fav-body button.ghost::after { font-size: var(--fs-xs); }

/* ===== 14. OFFER BAND ==================================================== */
#offer-banner {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0;
  margin: var(--sp-3) var(--pad); padding: var(--sp-4);
  border-radius: var(--r-lg); color: var(--surface); text-align: center;
  background: radial-gradient(120% 90% at 100% 0%, var(--navy-600) 0%, var(--navy-700) 55%, var(--navy-900) 100%);
  box-shadow: var(--sh-2);
}
#offer-banner > * { min-width: 0; max-width: 100%; flex: 0 1 100%; }
#offer-banner .ob-tag { align-self: center; flex: 0 0 auto; margin: 0 auto var(--sp-1);
  padding: 2px var(--sp-4); border-radius: var(--r-pill); background: var(--gold-500); color: var(--navy-950);
  font-size: var(--fs-sm); font-weight: 700; }
#offer-banner .ob-h { margin: var(--sp-1) 0 var(--sp-2); font-size: 1.25rem; font-weight: 700; line-height: 1.35; color: var(--surface); }
#offer-banner .ob-ceil { margin: var(--sp-1) 0 var(--sp-2); font-size: var(--fs-h2); font-weight: 700; color: var(--gold-400); }
#offer-banner .ob-small, #offer-banner .ob-proof, #offer-banner .ob-fine { margin: var(--sp-1) 0 0; color: var(--on-navy-ink); font-size: var(--fs-sm); line-height: 1.45; }
#offer-banner .ob-tiers { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin: var(--sp-1) 0; }
#offer-banner .ob-tier { flex: 1 1 84px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--sp-2); border: 1.5px solid rgba(232,178,58,.6); border-radius: var(--r-md); background: rgba(255,255,255,.08); }
#offer-banner .ob-tier b { font-size: 1.75rem; font-weight: 700; line-height: 1.15; color: var(--gold-400); direction: ltr; unicode-bidi: isolate; }
#offer-banner .ob-tier span { font-size: var(--fs-xs); font-weight: 600; line-height: 1.35; color: var(--surface); }
#offer-banner .ob-tier.ob-hi { background: var(--gold-500); border-color: var(--gold-500); }
#offer-banner .ob-tier.ob-hi b, #offer-banner .ob-tier.ob-hi span { color: var(--navy-950); }
#offer-banner .ob-cta { width: 100%; margin-top: var(--sp-2); min-height: var(--ctl);
  background: var(--gold-500); color: var(--navy-950); border: 0; border-radius: var(--r-md);
  font-family: var(--font); font-size: var(--fs-h3); font-weight: 700; }
#offer-banner .ob-cta:hover { background: var(--gold-400); }
#offer-banner .ob-left { margin-top: var(--sp-2); width: 100%; }
#offer-banner .ob-bar { height: 8px; border-radius: var(--r-pill); background: rgba(255,255,255,.22); overflow: hidden; }
#offer-banner .ob-bar i { display: block; height: 100%; background: var(--gold-500); border-radius: var(--r-pill); }
#offer-banner .ob-left span { display: block; margin-top: var(--sp-1); font-size: var(--fs-sm); font-weight: 700; color: var(--surface); }
#offer-banner .ob-left.ob-low span { color: var(--gold-400); }
#offer-strip { margin: var(--sp-2) 0; padding: var(--sp-3); border-radius: var(--r-md);
  background: var(--gold-100); border: 1.5px solid var(--gold-500); color: var(--navy-900);
  font-size: var(--fs-body); font-weight: 700; line-height: 1.5; }

/* ===== 15. INVOICE / PRINT =============================================== */
#inv-dialog { width: min(96vw, 900px); max-width: 96vw; padding: 0; border-radius: var(--r-md); }
#inv-body { background: var(--surface); }
#inv-extra { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 0; padding: 0 var(--sp-4) var(--sp-4); }
#inv-extra:empty { display: none; }
.invt { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); }
.invt th, .invt td { border: 1px solid var(--line-strong); padding: var(--sp-1); }
.noprint { }
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; }
  body > *:not(#inv-dialog) { display: none !important; }
  #inv-dialog { position: static; width: 210mm !important; max-width: none; max-height: none !important; margin: 0 !important; padding: 0 !important; overflow: visible !important;
    border: 0; border-radius: 0; overflow: visible; background: var(--surface); }
  #inv-dialog::backdrop { display: none !important; }
  .noprint { display: none !important; }
  #inv-body.paged { background: #fff; zoom: 1 !important; }
  #inv-body.paged > .pg-sheet { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  #inv-body.paged > .pg-sheet:last-child { break-after: auto; page-break-after: auto; }
  #inv-body .invt thead { display: table-header-group; }
  #inv-body .invt tr { page-break-inside: avoid; }
  /* Mahmoud, 2026-12-06: the «الإجمالي» column printed as «00.00» from a phone-width session — the last cell was
     clipped on its left edge. In print every money cell keeps its digits: no shrinking, no clipping, LTR digits. */
  #inv-body .invt { table-layout: auto; width: 100%; }
  #inv-body .invt td, #inv-body .invt th { overflow: visible; }
  #inv-body .invt th:nth-last-child(-n+2), #inv-body .invt td:nth-last-child(-n+2) {
    white-space: nowrap; direction: ltr; unicode-bidi: isolate; text-align: left; min-width: 22mm; }
  #inv-body .invt th:last-child, #inv-body .invt td:last-child { min-width: 26mm; }
}

/* ===== 16. RESPONSIVE ==================================================== */
/* phones: the category chips stay visible; the three dropdowns live behind «فلتر» (one tap, nothing removed) */
@media (max-width: 430px) {
  .chips { padding-inline: var(--pad); -webkit-mask-image: linear-gradient(to left, var(--ink-900) calc(100% - 24px), transparent 100%);
           mask-image: linear-gradient(to left, var(--ink-900) calc(100% - 24px), transparent 100%); }
  body:not(.fopen) #filters { display: none; }
  body.fopen #filters { display: flex; }
  .top { padding-inline: var(--pad); }
  .logo { width: 48px; height: 48px; }
  .top { padding-block: var(--sp-2); }
  .top h1 { font-size: 1.0625rem; line-height: 1.35; }
  .top .tag { display: none; }
  #offer-banner .ob-tiers { display: grid; grid-template-columns: 1fr 1fr; }
  #me { flex: 1 1 100%; justify-content: stretch; }
  #me > button { flex: 1 1 auto; }
  #pager-top { display: none; }
}
@media (min-width: 431px) {
  .xtools { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .subrow { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
  dialog { padding: var(--sp-5); }
  #myquotes-dialog > div > h2 { top: calc(-1 * var(--sp-5)); }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
  .card { padding: var(--sp-4); }
  .top h1 { font-size: 1.625rem; }
  .top .tag { font-size: var(--fs-sm); }
  .logo { width: 58px; height: 58px; }
}
/* landscape phone: height is the constraint, so the chrome shrinks but nothing disappears */
@media (max-height: 480px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .top { padding-block: 4px; }
  .top .tag { display: none; }
  .top h1 { font-size: 1rem; }
  .logo { width: 32px; height: 32px; }
  .langbtn, #me button, #me .mini, #me a.mini { min-height: 36px; }
  .searchbar { padding-block: 6px; position: static; }
  .sbox input, .searchbar #qbtn, .searchbar #fbtn { min-height: 44px; }
  .xtools button { min-height: 44px; }
  .cta { padding-block: 6px; }
  .cta .primary, .cta .ghost { min-height: 44px; font-size: var(--fs-sm); }
}
/* 320-class phones: nothing may overflow the viewport */
@media (max-width: 340px) {
  :root { --pad: 10px; }
  .top { gap: var(--sp-2); }
  .logo { width: 40px; height: 40px; }
  .top h1 { font-size: 1rem; }
  .top .tag { font-size: 0.75rem; }
  .searchbar { gap: 6px; }
  .searchbar #qbtn, .searchbar #fbtn { padding: 0 var(--sp-2); font-size: var(--fs-sm); }
  .sbox input { padding-inline-end: 76px; }
  .sbox .micbtn { min-width: 66px; font-size: 0.75rem; }
  .xtools { gap: 6px; }
  .xtools button { min-height: 56px; padding: 6px 2px; font-size: 0.8125rem; }
  .xtools button small { font-size: 0.75rem; }
  .card { padding: var(--sp-3); }
  .subrow { gap: 6px; }
  .subrow > * { font-size: 0.8125rem; padding: 0 4px; }
  .buyrow { gap: 6px; }
  .step input { width: 44px; }
  #me .pill { max-width: 100%; }
}
/* wide screens: keep long copy readable inside a card */
@media (min-width: 900px) {
  .card h2, .card .meta, .card .price, .card .avail { max-width: 100%; }
  .cocard { margin-bottom: 100px; }
}

/* ===== 17. UTILITIES ===================================================== */
.lowbw * { animation: none !important; transition: none !important; }
.lowbw .skel { display: none; }
#offline { display: none; position: sticky; top: 0; z-index: 60; background: var(--bad-700); color: var(--surface);
  text-align: center; padding: 6px; font-size: var(--fs-xs); }
.toast { position: fixed; inset-inline: 0; bottom: 96px; z-index: 60; width: max-content;
  max-width: min(92vw, 440px); margin-inline: auto; padding: var(--sp-3) var(--sp-4);
  background: var(--navy-900); color: var(--surface); border-radius: var(--r-md); font-size: var(--fs-sm);
  box-shadow: var(--sh-2); text-align: center; pointer-events: none; }
.toast.ok { background: var(--ok-700); }
.toast.bad, .toast.err { background: var(--bad-700); }
#toasts { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
/* a scroll container is not a control: the ring belongs on the buttons inside it */
dialog:focus, dialog:focus-visible,
#myquotes-list:focus, #myquotes-list:focus-visible,
.bellbody:focus, .bellbody:focus-visible,
.qitems:focus, .qitems:focus-visible { outline: none; }


/* ===== 18. FINAL6 CARRY-OVER ==============================================
   Rules that exist in app-final6.css and are not covered by sections 2-17, kept in
   their original @media context and re-expressed with the tokens above. ============ */
.top p { font-size: var(--fs-xs); margin: 2px 0 0; opacity: .85; }
#me span { font-size: var(--fs-xs); }
.searchbar input { flex: 1; font-size: var(--fs-h3); padding: 12px 14px; border: 2px solid var(--navy-700); border-radius: 12px; }
.card button { margin-top: auto; border: 0; border-radius: 9px; padding: 9px; font-size: var(--fs-xs); font-weight: 700; background: var(--gold-500); color: var(--navy-700); }
.card button.inlist { background: var(--ok-bg); color: var(--ok-700); }
.morewrap { text-align: center; padding: 10px; }
.morewrap button { padding: 10px 26px; border-radius: 10px; border: 1px solid var(--navy-700); background: var(--surface); color: var(--navy-700); font-weight: 700; }
dialog input { display: block; width: 100%; font-size: var(--fs-body); padding: 11px; border: 1.5px solid var(--field-line); border-radius: 10px; margin-top: 4px; }
.qitems .qi button { border: 0; background: var(--bad-bg); color: var(--bad-700); border-radius: 6px; padding: 3px 8px; }
.card button.altbtn { background: var(--surface); border: 1.5px solid var(--bad-700); color: var(--bad-700); margin-top: 0; }
#altmodal .notice { margin-bottom: 12px; }
#cancel-dialog { max-width: 94vw; }
.micbtn { min-width:44px;min-height:44px;font-size:var(--fs-h3) }
.micbtn.on { background:var(--bad-700);color:var(--surface) }
.favbtn, .askbtn { min-height:44px }
.searchbar input { min-width:0 }
.searchbar .micbtn { padding:0 10px }
.qo-opt>span { flex:1 }
.pimg { width:100%;height:120px;object-fit:contain;background:var(--bg);border-radius:8px;margin-bottom:6px }
.nt { border-bottom:1px solid var(--line);padding:8px 0 }
.nt.unread { background:var(--gold-100);border-radius:8px;padding:8px }
.miclive[hidden] { display:none }
.card h2.itemlink { cursor:pointer }
.card .subrow { display:flex;gap:6px;flex-wrap:wrap;margin-top:4px }
.card .subrow>*, .itemdlg .subrow>* { flex:1 1 auto;min-height:44px;font-size:var(--fs-xs);padding:6px 8px;border-radius:10px;margin:0!important;display:inline-flex;align-items:center;justify-content:center;var(--surface)-space:nowrap }
.pager[hidden], .pager-top[hidden] { display:none }
.top .brand>div { min-width:0 }
#lang-btn { min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0 }
.top.loggedin #me .pill { flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;var(--surface)-space:nowrap;padding:0 8px;min-height:44px;display:inline-flex;align-items:center;font-size:var(--fs-xs);max-width:none }
.top.loggedin #me .mini { flex:0 0 auto;padding:0 8px;font-size:var(--fs-xs);margin:0 }
.qi .qyearerr[hidden] { display:none }
#offer-banner.ob-n3 .ob-tier, #offer-banner.ob-n4 .ob-tier { flex-direction: column; gap: 0; padding: 4px 4px 6px; text-align: center; }
#offer-banner.ob-n3 .ob-tier b, #offer-banner.ob-n4 .ob-tier b { font-size: var(--fs-hero); }
#offer-banner.ob-n3 .ob-tier span, #offer-banner.ob-n4 .ob-tier span { font-size: var(--fs-xs); text-align: center; }
#offer-banner.ob-n4 .ob-tiers { flex-wrap: wrap; }
#offer-banner.ob-n4 .ob-tier { flex: 1 1 40%; }
#offer-banner.ob-notiers .ob-left span { font-size: var(--fs-h3); }
#me > * { min-width: 0; max-width: 100%; }
#me .pill > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; var(--surface)-space: nowrap; }
#bell { min-width: 32px; }
.card button { font-size: var(--fs-body); background: var(--navy-700); color: var(--surface); }
.top p { font-size: var(--fs-xs); }
#me span { font-size: var(--fs-xs); }
dialog input, dialog select, dialog textarea { font-size: var(--fs-body); }
.pricenote[hidden] { display: none; }
#act-row { width: 100%; }
#bell, #bellb, .bellbtn, #bell-btn { min-width: 44px; min-height: 44px; }
.top .brand .langbtn { margin-inline-start:auto;flex:none }
.top .brand { flex:1 1 auto }
.qid { font-size: var(--fs-xs); color: var(--ink-600); margin: 1px 0 2px; }
#myquotes-dialog .mqbar { top: -10px; }
#myquotes-dialog .mqbar { box-shadow: 0 6px 8px -6px rgba(7,42,98,.28); }
.stepsw { margin: 2mm 0 1mm; }
.stepsw .steps { margin-top: 1mm; }
.todoblk { margin: 10px 12px 4px; }
.todoblk .tdb { border: 2px solid var(--red-600); background: linear-gradient(180deg,var(--bad-bg),var(--surface)); border-radius: 14px; padding: 12px 12px 10px; box-shadow: 0 8px 18px -12px rgba(220,10,23,.55); }
.todoblk .tdbh { display: flex; align-items: center; gap: 8px; color: var(--bad-700); font-size: var(--fs-body); }
.todoblk .tdbn { background: var(--red-600); color: var(--surface); border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; }
.todoblk .tdbt { margin: 6px 0 10px; font-size: var(--fs-sm); line-height: 1.65; color: var(--ink-900); }
.todoblk .tdba { display: flex; gap: 8px; flex-wrap: wrap; }
.todoblk .tdba button { flex: 1 1 44%; min-height: 46px; font-weight: 700; }
.todoblk .tdba button.primary { flex: 1 1 100%; }
#apv-dlg { width: min(430px, 94vw); border: 0; border-radius: 16px; padding: 0; }
#apv-dlg > div { padding: 16px; }
#apv-dlg h2 { margin: 0 0 10px; font-size: var(--fs-h3); color: var(--navy-700); }
.apvhead { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.apvhead .qstat { background: var(--surface-2); color: var(--navy-700); border-radius: 8px; padding: 3px 8px; font-size: var(--fs-xs); font-weight: 700; }
.apvl { border-bottom: 1px solid var(--line); padding: 8px 0; }
.apvl .apvn { font-weight: 700; font-size: var(--fs-sm); line-height: 1.5; }
.apvl .apvm { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.apvl .apvm small { color: var(--ink-600); font-size: var(--fs-xs); }
.apvtot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--navy-700); font-size: var(--fs-body); color: var(--navy-700); }
.apvtot b { font-size: var(--fs-h3); }
.apvnote { font-size: var(--fs-xs); color: var(--ink-600); line-height: 1.6; margin: 10px 0 0; }
#apv-dlg menu { display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 14px 0 0; }
#apv-dlg menu button { min-height: 46px; font-weight: 700; }
.ntg[role="button"] { cursor: pointer; position: relative; }
.ntg[role="button"]:active { background: var(--surface-2); }
.ntg .ntgo { margin-inline-start: auto; color: var(--navy-700); font-size: var(--fs-h3); line-height: 1; font-weight: 700; }
.ntg .ntlnk { margin-top: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--navy-500); text-decoration: underline; }
.ntg.flash, .quote-card.flash { animation: ntflash 1.2s ease 2; }
.top .memore { font-size: var(--fs-h3); line-height: 1; padding: 6px 11px; min-width: 34px; min-height: 0; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.top #me-menu.memenu { position: absolute; inset-inline-end: 12px; top: calc(100% - 4px); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 30px -12px rgba(7,42,98,.45); padding: 6px; min-width: 196px; display: flex; flex-direction: column; gap: 2px; }
.top #me-menu.memenu[hidden] { display: none; }
.top #me-menu .mit { text-align: start; border: 0; background: var(--surface); color: var(--navy-700); font: inherit; font-size: var(--fs-sm); font-weight: 700; padding: 11px 12px; border-radius: 9px; min-height: 44px; }
.top #me-menu .mit:active { background: var(--surface-2); }
.top.menuopen #me-more { background: var(--navy-700); color: var(--surface); border-color: var(--navy-700); }
.top.loggedin .brand #lang-btn { display: none; }
.top #me .mini, .top #me .memore { box-sizing: border-box; height: 34px; min-height: 0; display: inline-flex; align-items: center; justify-content: center; }
.top #me .pill { box-sizing: border-box; height: 34px; display: inline-flex; align-items: center; }
.top.loggedin #me #bell { height: 32px !important; min-height: 0 !important; box-sizing: border-box; display: inline-flex; align-items: center; }
.top.loggedin #me button { min-height: 32px !important; }
.top.loggedin #me .pill { flex: 0 0 auto; width: auto; max-width: 54%; overflow: hidden; var(--surface)-space: nowrap; }
.top.loggedin #me .pill .nm { overflow: hidden; text-overflow: ellipsis; var(--surface)-space: nowrap; }
#bell-dlg menu #bell-markall { flex: 1 1 100%; }
@media (max-height:560px) {
#auth-form menu { position:sticky;bottom:0;background:var(--surface);padding:8px 0 2px;margin:6px 0 0;z-index:2 }
dialog input { padding:8px }
}
@media (max-height: 480px) {
.cta button, .cta a { min-height: 36px; padding: 2px 10px; font-size: var(--fs-xs); }
body:not(.fopen) #chips { display: none; }
body.fopen #chips { display: flex; }
}
@media (max-height: 480px), (max-width: 430px) {
#fbtn { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; border: 0; border-radius: 10px; background: var(--gold-500); color: var(--navy-700); font-weight: 700; font-size: var(--fs-xs); }
}
@media (max-width: 340px) {
.top.loggedin #me button, .top.loggedin #me .mini, .top.loggedin #me a.mini { padding: 0 6px; }
.top.loggedin #me .pill { padding: 0 6px; }
#inst-top { display: none !important; }
#inst-top { display: none !important; }
}
@media (max-width: 430px) {
.top .brand { gap: 10px; align-items: center; }
.top.loggedin #me button, .top.loggedin #me .mini, .top.loggedin #me a.mini { var(--surface)-space: nowrap; }
}
@media (max-height: 700px) {
#offer-banner.ob-n3 .ob-tier, #offer-banner.ob-n4 .ob-tier { flex-direction: row; gap: 4px; padding: 2px 4px; border-radius: 8px; border-width: 1px; align-items: baseline; }
#offer-banner.ob-n3 .ob-tier b, #offer-banner.ob-n4 .ob-tier b { font-size: var(--fs-xs); var(--surface)-space: nowrap; flex: 0 0 auto; }
#offer-banner.ob-n3 .ob-tier span, #offer-banner.ob-n4 .ob-tier span { font-size: var(--fs-xs); line-height: 1.15; }
}
@media (max-height: 420px) {
#offer-banner.ob-n3 .ob-tier, #offer-banner.ob-n4 .ob-tier { padding: 1px 6px; gap: 3px; }
#offer-banner.ob-n3 .ob-tier b, #offer-banner.ob-n4 .ob-tier b { font-size: var(--fs-xs); var(--surface)-space: nowrap; flex: 0 0 auto; }
#offer-banner.ob-n3 .ob-tier span, #offer-banner.ob-n4 .ob-tier span { font-size: var(--fs-xs); }
}
@media (max-width: 520px) {
.pager button, .pg-jump button { min-height: 44px; min-width: 44px; }
}

/* ===== 19. POST-FINAL3 COMPONENTS, DESIGNED ===============================
   The header menu, the "مطلوب منك الآن" block, the approval dialog and the
   notification list arrived after the version this system was drawn on. Their
   markup and selectors are final6's; everything visual below is the system.
   ========================================================================= */

/* --- 19.1 header: customer row + dropdown menu --------------------------- */
.top { position: relative; z-index: 40; }               /* the menu's positioning box */
.top.loggedin #me #bell,
.top #me .mini, .top #me .memore, .top #me .pill,
.top.loggedin #me button {
  box-sizing: border-box;
  height: var(--tap) !important; min-height: var(--tap) !important;
  display: inline-flex; align-items: center; justify-content: center;
}
.top #me .memore { padding: 0 var(--sp-2); min-width: var(--tap); font-size: 1.125rem; font-weight: 700; letter-spacing: 0; }
.top #me .pill { padding: 0 var(--sp-3); border-radius: var(--r-pill); gap: var(--sp-1); font-size: var(--fs-xs); font-weight: 700; }
.top.loggedin #me .pill { max-width: 46%; }
.top.menuopen #me-more { background: var(--surface); color: var(--navy-700); border-color: var(--surface); }
.top #me-menu.memenu {
  position: absolute; inset-inline-end: var(--pad); top: calc(100% - 2px); z-index: 60;
  min-width: 220px; padding: var(--sp-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); display: flex; flex-direction: column; gap: 2px;
}
.top #me-menu.memenu[hidden] { display: none; }
.top #me-menu .mit {
  min-height: var(--tap); padding: 0 var(--sp-3);
  text-align: start; background: var(--surface); color: var(--navy-700);
  font-family: var(--font); font-size: var(--fs-sm); font-weight: 700;
  border: 0; border-radius: var(--r-sm); cursor: pointer;
}
.top #me-menu .mit:hover { background: var(--navy-050); }
.top #me-menu .mit:active { background: var(--navy-100); }
.top #me-menu .mit + .mit { border-top: 1px solid var(--line); border-radius: 0; }
.top #me-menu .mit:first-child { border-start-start-radius: var(--r-sm); }


/* the menu belongs to the customer controls, not to the page edge: anchor it to #me */
.top #me { position: relative; }
.top #me-menu.memenu { inset-inline-end: auto; inset-inline-start: 0; max-width: calc(100% - 8px); }

/* --- 19.2 "مطلوب منك الآن": the one thing waiting on the customer -------- */
.todoblk { margin: var(--sp-3) var(--pad) var(--sp-1); }
.todoblk .tdb {
  padding: var(--sp-4);
  background: var(--bad-bg);
  border: 1.5px solid var(--bad-line); border-inline-start: 5px solid var(--bad-700);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
}
.todoblk .tdbh { display: flex; align-items: center; gap: var(--sp-2); color: var(--bad-700); font-size: var(--fs-body); font-weight: 700; }
.todoblk .tdbn {
  background: var(--bad-700); color: var(--surface);
  border-radius: var(--r-pill); padding: 2px var(--sp-2);
  font-size: var(--fs-xs); font-weight: 700;
}
.todoblk .tdbt { margin: var(--sp-2) 0 var(--sp-4); font-size: var(--fs-sm); line-height: 1.7; color: var(--ink-900); }
.todoblk .tdba { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.todoblk .tdba button { flex: 1 1 44%; min-height: var(--ctl); font-weight: 700; border-radius: var(--r-md); }
.todoblk .tdba button.primary { flex: 1 1 100%; }
.todoblk .tdba button.ghost { background: var(--surface); }
.todoblk .tdba button.ghost:nth-of-type(2) { border-color: var(--ok-line); color: var(--ok-700); background: var(--ok-bg); }
.todoblk .tdba button.ghost:nth-of-type(3) { border-color: var(--bad-line); color: var(--bad-700); background: var(--surface); }

/* --- 19.3 approval dialog: one price list, one total, one decision ------- */
#apv-dlg { width: min(440px, 94vw); border: 0; border-radius: var(--r-xl); padding: 0; box-shadow: var(--sh-3); background: var(--surface); }
#apv-dlg > div { padding: var(--sp-5); }
#apv-dlg h2 { margin: 0 0 var(--sp-3); font-size: var(--fs-h2); color: var(--navy-700); }
.apvhead { display: flex; align-items: center; gap: var(--sp-2); justify-content: space-between; margin-bottom: var(--sp-2); }
.apvhead .qstat { background: var(--surface-2); color: var(--navy-700); border-radius: var(--r-sm); padding: 3px var(--sp-2); font-size: var(--fs-xs); font-weight: 700; }
.apvl { padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.apvl:last-of-type { border-bottom: 0; }
.apvl .apvn { font-size: var(--fs-sm); font-weight: 700; line-height: 1.55; color: var(--ink-900); }
.apvl .apvm { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }
.apvl .apvm small { font-size: var(--fs-xs); color: var(--ink-600); }
.apvtot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: var(--sp-3); padding-top: var(--sp-3);
  border-top: 2px solid var(--navy-700);
  font-size: var(--fs-body); font-weight: 700; color: var(--navy-700);
}
.apvtot b { font-size: var(--fs-h2); }
.apvnote { margin: var(--sp-3) 0 0; font-size: var(--fs-xs); line-height: 1.7; color: var(--ink-600); }
#apv-dlg menu { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0; margin: var(--sp-4) 0 0; }
#apv-dlg menu button { min-height: var(--ctl); font-weight: 700; border-radius: var(--r-md); }

/* --- 19.4 notifications: a list you can read, not a wall of text -------- */
#bell, #bellb, .bellbtn, #bell-btn { min-width: var(--tap) !important; min-height: var(--tap) !important; }
.bell { position: relative; }
.bell .bn, .bn {
  position: absolute; top: -4px; inset-inline-start: -4px;
  background: var(--bad-700); color: var(--surface);
  border-radius: var(--r-pill); padding: 1px var(--sp-1);
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.4;
}
#bell-dlg { width: min(460px, 94vw); border: 0; border-radius: var(--r-xl); padding: 0; background: var(--surface); box-shadow: var(--sh-3); }
#bell-dlg > div { padding: var(--sp-5); }
#bell-dlg h2 { margin: 0 0 var(--sp-3); font-size: var(--fs-h2); color: var(--navy-700); }
.bellbody { max-height: 60dvh; overflow-y: auto; margin: 0; padding: 0; }
.ntg {
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.6; color: var(--ink-900);
}
.ntg.unread { background: var(--gold-100); border-color: var(--gold-500); border-inline-end: 4px solid var(--gold-500); }
.ntg[role="button"] { cursor: pointer; }
.ntg[role="button"]:active { background: var(--surface-2); }
.ntg .ntgo { margin-inline-start: auto; color: var(--navy-700); font-size: 1.25rem; font-weight: 700; line-height: 1; }
.ntg .ntlnk {
  display: inline-block; margin-top: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 700; color: var(--navy-700);
  text-decoration: underline; text-underline-offset: 3px;
}
.ntg .ntlnk:hover { color: var(--navy-500); }
.ntg.flash, .quote-card.flash { animation: ntflash 1.2s ease 2; }
.nt { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.nt.unread { background: var(--gold-100); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); }
.nt-empty { padding: var(--sp-5) var(--sp-2); text-align: center; color: var(--ink-600); font-size: var(--fs-sm); }
#bell-dlg menu { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0; margin: var(--sp-4) 0 0; }
#bell-dlg menu button { flex: 1 1 46%; min-height: var(--ctl); font-weight: 700; border-radius: var(--r-md); }
#bell-dlg menu #bell-markall { flex: 1 1 100%; }

/* --- 19.5 search + filter bar under the header -------------------------- */
.searchbar { gap: var(--sp-2); padding: var(--sp-3) var(--pad); background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.searchbar input { min-height: 52px; padding: 0 var(--sp-4); font-size: var(--fs-body); font-weight: 600; border: 1.5px solid var(--field-line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink-900); }
.searchbar input:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(7,42,98,.14); }
.searchbar button { min-height: 52px; border-radius: var(--r-lg); font-size: var(--fs-body); font-weight: 700; }
.searchbar #fbtn { display: inline-flex; align-items: center; gap: var(--sp-1); background: var(--surface); color: var(--navy-700); border: 1.5px solid var(--line-strong); }
.searchbar .micbtn { min-width: 76px; min-height: 44px; border-radius: var(--r-md); background: var(--surface-2); color: var(--navy-700); border: 0; font-size: var(--fs-xs); font-weight: 700; }
.searchbar .micbtn.on { background: var(--bad-700); color: var(--surface); }

/* --- 19.6 focus inside dialogs: the system's ring, not the old gold one --- */
dialog :focus-visible, dialog button:focus-visible, dialog a:focus-visible, dialog summary:focus-visible,
#bell-dlg .ntg:focus-visible, #apv-dlg button:focus-visible,
.card button.itembtn:focus-visible, .top #me-menu .mit:focus-visible {
  outline: 3px solid var(--navy-700) !important; outline-offset: 2px !important; box-shadow: none !important;
}

/* --- 19.7 a card title is a title, not a button ---------------------------
   final6 puts the item name inside <button class="itembtn"> so the whole name
   is tappable. The old ".card button" fill painted that button navy and the
   card opened with a heavy block instead of a title. The name keeps its 44px
   tap area, and loses the fill. =========================================== */
.card button.itembtn {
  background: transparent; color: var(--navy-700); border: 0; border-radius: 0;
  padding: 0; margin: 0; font-size: var(--fs-h3); font-weight: 700; text-align: start;
  min-height: var(--tap); line-height: 1.45; box-shadow: none;
}
.card button.itembtn:hover { background: transparent; color: var(--navy-500); text-decoration: underline; text-underline-offset: 3px; }
.card button.itembtn:active { background: transparent; color: var(--navy-700); }
.card h2.itemlink { margin: 0; }


/* v12n16O12 — عرض السعر للعميل: قراءة أوضح للبنود وإبراز الإجمالي والألوان.
   تحسين بصري فقط: مفيش أي تغيير في منطق الحساب ولا في الأرقام (كل الأرقام زي ما هي من نفس الدوال). */
#quote-dialog{ width:min(96vw,480px); padding:16px; border-radius:18px; }
#quote-dialog #quote-title{ font-size:19px; color:#072a62; margin:0 0 10px; }
#quote-dialog .qitems{ margin:0 0 10px; }
#quote-dialog .qitems .qi{ background:#fff; border:1px solid #e2e8f2; border-radius:14px; padding:12px 14px 10px; margin:0 0 10px; box-shadow:0 1px 2px rgba(7,42,98,.06); }
#quote-dialog .qitems .qi:last-child{ margin-bottom:0; }
#quote-dialog .qi .qname{ font-size:15px; font-weight:800; color:#072a62; line-height:1.6; margin:0 0 3px; }
#quote-dialog .qi .qid{ font-size:12.5px; color:#54637d; margin:0 0 6px; }
#quote-dialog .qi .qprice{ background:#f3f7fd; border-inline-start:3px solid #e8b23a; border-radius:8px; padding:7px 10px; margin:6px 0 10px; font-size:14.5px; font-weight:800; color:#072a62; font-variant-numeric:tabular-nums; }
#quote-dialog .qi .qdel{ background:#fff; border:1px solid #e7d6d4; color:#9c3b31; border-radius:10px; min-height:44px; padding:0 12px; font-weight:700; box-shadow:none; }
#quote-dialog .qi .photobtn{ background:#f2f6fc; border:1px solid #dde6f2; color:#0d3a74; border-radius:10px; min-height:40px; padding:0 12px; font-weight:700; }
#quote-dialog .qtotals{ background:linear-gradient(180deg,#f7fafd,#edf3fb); border:1px solid #d9e3f1; border-inline-start:4px solid #e8b23a; border-radius:14px; padding:11px 14px 12px; font-size:12.5px; color:#4a5b76; font-weight:700; line-height:1.7; }
#quote-dialog .qtotals b{ display:block; font-size:26px; font-weight:800; color:#072a62; line-height:1.25; font-variant-numeric:tabular-nums; margin-top:2px; }
#quote-dialog .qtotals small{ display:block; font-size:12px; font-weight:600; color:#5a6b85; }
#quote-dialog .osum{ display:grid; gap:4px; margin:0 0 10px; padding:10px 14px; background:#fff; border:1px solid #e2e8f2; border-radius:12px; font-size:13px; color:#4a5b76; font-weight:600; }
#quote-dialog .osum span{ display:flex; justify-content:space-between; gap:10px; font-variant-numeric:tabular-nums; }
#quote-dialog .osum b{ color:#072a62; font-weight:800; }
#quote-dialog .osum .net{ border-top:1px solid #e8edf5; padding-top:6px; margin-top:2px; font-size:14px; color:#072a62; font-weight:800; }
#quote-dialog #offer-nudge{ background:#fdf6e6; border:1px solid #f0dcae; border-radius:12px; padding:10px 12px; color:#6b4e00; font-weight:700; font-size:13px; line-height:1.7; }
@media (max-width:640px){ #quote-dialog{ padding:14px 12px; } #quote-dialog .qtotals b{ font-size:28px; } }
/* سطر الكمية والحذف في سطر واحد (كان الحذف بينزل لوحده على الموبايل) */
#quote-dialog .qi .qrow{ flex-wrap:nowrap; gap:8px; }
#quote-dialog .qi .qrow .stkrow{ flex:1 1 0; min-width:0; }
#quote-dialog .qi .qrow .stkrow .stk{ font-size:11.5px; line-height:1.35; display:block; }
#quote-dialog .qi .qdel{ flex:0 0 auto; padding:0 10px; }

/* v12n16O12 — عرض السعر للعميل: قراءة أوضح للبنود وإبراز الإجمالي والألوان.
   تحسين بصري فقط: مفيش أي تغيير في منطق الحساب ولا في الأرقام (كل الأرقام زي ما هي من نفس الدوال). */
#quote-dialog{ width:min(96vw,480px); padding:16px; border-radius:18px; }
#quote-dialog #quote-title{ font-size:19px; color:#072a62; margin:0 0 10px; }
#quote-dialog .qitems{ margin:0 0 10px; }
#quote-dialog .qitems .qi{ background:#fff; border:1px solid #e2e8f2; border-radius:14px; padding:12px 14px 10px; margin:0 0 10px; box-shadow:0 1px 2px rgba(7,42,98,.06); }
#quote-dialog .qitems .qi:last-child{ margin-bottom:0; }
#quote-dialog .qi .qname{ font-size:15px; font-weight:800; color:#072a62; line-height:1.6; margin:0 0 3px; }
#quote-dialog .qi .qid{ font-size:12.5px; color:#54637d; margin:0 0 6px; }
#quote-dialog .qi .qprice{ background:#f3f7fd; border-inline-start:3px solid #e8b23a; border-radius:8px; padding:7px 10px; margin:6px 0 10px; font-size:14.5px; font-weight:800; color:#072a62; font-variant-numeric:tabular-nums; }
#quote-dialog .qi .qdel{ background:#fff; border:1px solid #e7d6d4; color:#9c3b31; border-radius:10px; min-height:44px; padding:0 12px; font-weight:700; box-shadow:none; }
#quote-dialog .qi .photobtn{ background:#f2f6fc; border:1px solid #dde6f2; color:#0d3a74; border-radius:10px; min-height:40px; padding:0 12px; font-weight:700; }
#quote-dialog .qtotals{ background:linear-gradient(180deg,#f7fafd,#edf3fb); border:1px solid #d9e3f1; border-inline-start:4px solid #e8b23a; border-radius:14px; padding:11px 14px 12px; font-size:12.5px; color:#4a5b76; font-weight:700; line-height:1.7; }
#quote-dialog .qtotals b{ display:block; font-size:26px; font-weight:800; color:#072a62; line-height:1.25; font-variant-numeric:tabular-nums; margin-top:2px; }
#quote-dialog .qtotals small{ display:block; font-size:12px; font-weight:600; color:#5a6b85; }
#quote-dialog .osum{ display:grid; gap:4px; margin:0 0 10px; padding:10px 14px; background:#fff; border:1px solid #e2e8f2; border-radius:12px; font-size:13px; color:#4a5b76; font-weight:600; }
#quote-dialog .osum span{ display:flex; justify-content:space-between; gap:10px; font-variant-numeric:tabular-nums; }
#quote-dialog .osum b{ color:#072a62; font-weight:800; }
#quote-dialog .osum .net{ border-top:1px solid #e8edf5; padding-top:6px; margin-top:2px; font-size:14px; color:#072a62; font-weight:800; }
#quote-dialog #offer-nudge{ background:#fdf6e6; border:1px solid #f0dcae; border-radius:12px; padding:10px 12px; color:#6b4e00; font-weight:700; font-size:13px; line-height:1.7; }
@media (max-width:640px){ #quote-dialog{ padding:14px 12px; } #quote-dialog .qtotals b{ font-size:28px; } }
/* سطر الكمية: الأزرار في سطر واحد (الكمية يمين والحذف شمال) وحالة التوفر وزر «بدائل» في سطر تحته بعرض كامل */
#quote-dialog .qi .qrow{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
#quote-dialog .qi .qrow .stkrow{ order:3; flex:1 1 100%; display:flex; align-items:center; gap:8px; min-width:0; }
#quote-dialog .qi .qrow .stkrow:empty{ display:none; }
#quote-dialog .qi .qrow .stkrow .stk{ flex:1 1 auto; min-width:0; font-size:12px; }
#quote-dialog .qi .qdel{ order:2; margin-inline-start:auto; }
#quote-dialog .qi .qrow .stkrow .altbtn, #quote-dialog .qi .qrow .stkrow .altbtn.sm{ flex:0 0 auto; min-height:38px; padding:0 12px; font-size:12.5px; border-radius:10px; background:#f2f6fc; border:1px solid #dde6f2; color:#0d3a74; font-weight:700; }
/* شرائح العرض: ترتيب تصاعدي من اليمين (1% → 1.5% → 2%) وفي صف واحد على ٣٩٠ */
#offer-banner .ob-tiers{ direction:rtl; flex-wrap:nowrap; justify-content:stretch; }
#offer-banner .ob-tier{ min-width:0; }
/* شاشة التسجيل: مربع الموافقة جنب نصه في سطر واحد، ومؤشر سكرول واضح في النافذة */
#auth-dialog #consent-row{ display:flex; align-items:flex-start; gap:10px; font-weight:600; line-height:1.55; }
#auth-dialog #consent-row input[type=checkbox]{ flex:0 0 auto; width:22px; height:22px; min-width:22px; margin:2px 0 0; padding:0; }
#auth-dialog #consent-row span{ flex:1 1 auto; min-width:0; }
#auth-dialog{ max-height:calc(100dvh - 12px); padding-bottom:16px; scrollbar-width:thin; }
#auth-dialog::-webkit-scrollbar{ width:8px; }
#auth-dialog::-webkit-scrollbar-thumb{ background:#c3ccdb; border-radius:8px; }
#auth-dialog::-webkit-scrollbar-track{ background:#eef1f6; border-radius:8px; }
/* شاشة التسجيل: تصغير المسافات واللوجو عشان آخر سطر («بنفعّل حسابك…») يبان كامل على ٣٩٠ من غير سكرول */
@media (max-width:640px){
  #auth-dialog{ padding:10px 12px 12px; }
  #auth-dialog .authlogo{ width:68px; height:68px; margin:0 auto 4px; }
  #auth-dialog h2{ font-size:17px; margin:0 0 6px; }
  #auth-dialog label{ margin:0 0 6px; }
  #auth-dialog label input, #auth-dialog label select{ margin-top:3px; min-height:42px; }
  #auth-dialog .hint, #auth-dialog p{ margin:4px 0; font-size:12.5px; }
  #auth-dialog #consent-row{ margin-bottom:6px; }
}

/* «طلب سريع»: تنبيه «أقرب نتيجة» كان أحمر فيتقري كخطأ — بقى كحلي هادي */
.qo-w{ color:#4a5b76; font-weight:600; }

/* «فلتر» على الموبايل: اللوحة كانت بتفتح تحت الشاشة فالمستخدم بيدوس ومش شايف حاجة — بقت لوحة فوق الشاشة */
@media (max-width:640px){
  body.fopen #filters{ position:fixed; inset-inline:8px; bottom:8px; z-index:60; max-height:56vh; overflow:auto; background:#fff; border:1px solid #dde5f0; border-radius:14px; box-shadow:0 8px 24px rgba(7,42,98,.18); padding:10px; }
}
/* زر الحذف في سطر الكمية: عرضه على قد محتواه وميتقلّصش */
#quote-dialog .qi .qdel{ flex:0 0 auto; padding:0 10px; }
