/* Blaire de Bloom · เว็บลูกค้า v2 (Phase 5) · ชุดหน้าตาเดียวกับแคนวาส Phase 3 */
:root{
  --bloom-50:#FAF6FC;--bloom-100:#F3ECF8;--bloom-200:#E6D7F0;--bloom-600:#6E3F8E;--bloom-700:#5B3477;
  --cream:#FBF7F4;--paper:#FFFFFF;--ink:#2A2233;--ink2:#625A6E;--ink3:#7A7090;--line:#EAE3F3;
  --petal:#B5482F;--petal-bg:#FBE8E3;--honey:#8A5A00;--honey-bg:#FFF1D6;--leaf:#276B43;--leaf-bg:#E6F3EA;--msgr:#0866FF;
  --ticket:#FFF8EC;--ticket-line:#EADFCB;--bank-bg:#E9F5EC;
  --r:12px;--r-sheet:16px;
  --sh-rest:0 1px 3px rgba(42,34,51,.08);--sh-lift:0 8px 24px rgba(42,34,51,.14);
  --safe-b:env(safe-area-inset-bottom,0px);--safe-t:env(safe-area-inset-top,0px);
  --bnav-h:64px;--gut:16px;--maxw:1200px;
  /* z-layers (X3) */
  /* ชื่อสีชุดเดียวกับเว็บจริง (ใช้ใน live-*.css ที่ลอกมา) */
  --bg:#FBF7F4;--plum:#6E3F8E;--plum2:#5B3477;--lilac:#F3ECF8;--lilac2:#E6D7F0;--coral:#B5482F;--coralbg:#FBE9E4;--amber:#8A5A00;--amberbg:#FFF1D6;--green:#276B43;--greenbg:#E6F3EA;--r-pill:999px;--ease:cubic-bezier(.2,.8,.2,1);--t-press:80ms;--t-hover:160ms;--t-sheet:240ms;
  --z-sticky:20;--z-nav:30;--z-dock:35;--z-page:40;--z-sheet:60;--z-toast:70;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font:400 15px/1.5 'Sarabun',system-ui,-apple-system,'Segoe UI',sans-serif;color:var(--ink);background:var(--cream);overscroll-behavior-y:none}
h1,h2,h3,.mitr,.price{font-family:'Mitr','Sarabun',sans-serif;font-weight:500;margin:0}
button,a,[role=button],.card{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer}
a{color:var(--bloom-600)}
img{display:block;max-width:100%}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
[hidden]{display:none!important}
.ico{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.ico.sm{width:16px;height:16px}
:focus-visible{outline:3px solid #C9A9E0;outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* ── app shell ── */
#app{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
.wrap{width:100%;max-width:var(--maxw);margin:0 auto;padding:0 var(--gut)}
main{flex:1;padding-bottom:calc(var(--bnav-h) + var(--safe-b) + 16px)}

/* header (ค้นหา + EN) · เลื่อนหายตอนเลื่อนลง เหลือแถวปุ่ม 3 ปุ่มติดบน */
.hdr{background:var(--paper);border-bottom:1px solid var(--line);padding-top:var(--safe-t)}
.hdr .wrap{display:flex;align-items:center;gap:10px;height:64px}
.logo{width:40px;height:40px;border-radius:10px;background:var(--bloom-100);display:flex;align-items:center;justify-content:center;flex:none;overflow:hidden;text-decoration:none}
.logo img{width:100%;height:100%;object-fit:cover}
.search{flex:1;min-width:0;height:44px;border-radius:999px;background:var(--bloom-100);display:flex;align-items:center;gap:8px;padding:0 14px;color:var(--ink2);border:2px solid transparent}
.search input{flex:1;min-width:0;border:0;background:transparent;font:400 16px Sarabun,sans-serif;color:var(--ink);outline:0;height:40px}
.search input::placeholder{color:var(--ink2)}
.search:focus-within{background:var(--paper);border-color:var(--bloom-600)}
.search .x{width:32px;height:32px;border:0;background:transparent;border-radius:999px;display:flex;align-items:center;justify-content:center;color:var(--ink2)}
.lang{width:44px;height:44px;border-radius:12px;border:1.5px solid var(--line);background:var(--paper);font-weight:600;font-size:13px;flex:none}
.dnav{display:none}

.tabs{display:flex;gap:6px;padding:5px;margin:10px 0 0;background:var(--bloom-100);border-radius:999px}
.tabs button{flex:1;height:40px;border:0;border-radius:999px;background:transparent;font:500 15px Mitr,sans-serif;color:var(--ink2);display:flex;align-items:center;justify-content:center;gap:6px}
.tabs button[aria-selected=true]{background:var(--paper);color:var(--bloom-700);box-shadow:var(--sh-rest)}
.tabs .dot{width:8px;height:8px;border-radius:999px;background:#E0457B}

.toolwrap{position:sticky;top:0;z-index:var(--z-sticky);background:var(--cream);padding:8px 0}
.toolwrap.stuck{box-shadow:0 4px 10px -8px rgba(42,34,51,.35)}
.tool{display:flex;gap:8px}
.ctl{flex:1;min-width:0;height:38px;border-radius:999px;border:1.5px solid var(--bloom-200);background:var(--paper);display:flex;align-items:center;justify-content:center;gap:4px;font-size:14px;font-weight:600;padding:0 10px;white-space:nowrap}
.ctl span{overflow:hidden;text-overflow:ellipsis}
.ctl.on{border-color:var(--bloom-600);color:var(--bloom-700);background:var(--bloom-50)}
.ctl[aria-expanded=true]{border-color:var(--bloom-600)}

/* popover ใต้ปุ่ม (Proximity) */
.pop{position:absolute;z-index:var(--z-sheet);background:var(--paper);border-radius:14px;box-shadow:var(--sh-lift);padding:6px;min-width:220px;max-width:min(360px,calc(100vw - 32px))}
.pop .opt{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;border:0;background:transparent;border-radius:10px;padding:0 10px;font-size:15px;text-align:left}
.pop .opt:hover{background:var(--bloom-50)}
.pop .opt .o{width:20px;height:20px;border-radius:999px;border:2px solid #CFC6D9;flex:none}
.pop .opt[aria-checked=true] .o{border:6px solid var(--bloom-600)}
.pop .opt small{margin-left:auto;color:var(--ink2);font-size:13px}
.pop .grp{padding:8px 8px 4px;font-weight:600;font-size:14px}
.pop .chips{padding:0 6px 6px}
.pop .row{display:flex;gap:8px;padding:6px}
.scrim{position:fixed;inset:0;z-index:calc(var(--z-sheet) - 1);background:rgba(42,34,51,.25)}

/* chips / pills / sections */
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{height:40px;padding:0 14px;border-radius:999px;border:1.5px solid var(--bloom-200);background:var(--paper);display:inline-flex;align-items:center;gap:6px;font-size:14.5px;font-weight:600;white-space:nowrap;color:var(--ink)}
.chip[aria-pressed=true]{background:var(--bloom-600);border-color:var(--bloom-600);color:#fff}
.chip small{font-weight:400;color:var(--ink2)}.chip[aria-pressed=true] small{color:#EADCF3}
.hscroll{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 calc(-1 * var(--gut));padding:0 var(--gut)}
.hscroll::-webkit-scrollbar{display:none}
.pill{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:3px 10px;font-size:12.5px;font-weight:600;white-space:nowrap}
.leaf{background:var(--leaf-bg);color:var(--leaf)}.honey{background:var(--honey-bg);color:var(--honey)}.petal{background:var(--petal-bg);color:var(--petal)}.grey{background:#EEEBF1;color:var(--ink2)}.purple{background:var(--bloom-100);color:var(--bloom-700)}
.sec-t{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:18px 0 10px}
.sec-t h2{font-size:17px}
.sec-t a,.sec-t button{font-size:14px;color:var(--bloom-600);font-weight:600;text-decoration:none;border:0;background:none;padding:0}
.small{font-size:12.5px;color:var(--ink2)}
.muted{color:var(--ink2);font-size:13.5px}
.stack{display:flex;flex-direction:column;gap:12px}

/* applied filter chip row */
.applied{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 10px}
.applied .ap{height:34px;border-radius:999px;background:var(--bloom-600);color:#fff;border:0;display:inline-flex;align-items:center;gap:6px;padding:0 8px 0 12px;font-size:13.5px;font-weight:600}
.applied .cnt{font:500 15px Mitr,sans-serif}
.applied .clr{margin-left:auto;font-size:13.5px;border:0;background:none;color:var(--bloom-600);font-weight:600;text-decoration:underline}

/* ── book cards ── */
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.card{background:var(--paper);border-radius:var(--r);overflow:hidden;box-shadow:var(--sh-rest);position:relative;display:flex;flex-direction:column;text-decoration:none;color:inherit;cursor:pointer}
.card:active{transform:scale(.99)}
.cv{aspect-ratio:1/1;position:relative;background:#EDE6F2;overflow:hidden}
.cv img{width:100%;height:100%;object-fit:cover}
.cv.col{display:grid;grid-template-columns:3fr 2fr;grid-template-rows:repeat(3,1fr);gap:2px}
.cv.col img:first-child{grid-row:span 3}
.cv .pc{position:absolute;left:6px;bottom:6px;display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 9px 0 7px;border-radius:999px;background:rgba(42,34,51,.72);color:#fff;font:600 12px Sarabun,sans-serif}
.cv .pc .ico{width:14px;height:14px;stroke:#fff}
.card .b{padding:8px 10px 10px;display:flex;flex-direction:column;flex:1}
.card .n{font-weight:600;font-size:14.5px;line-height:1.3;height:2.6em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.card .meta{font-size:12.5px;color:var(--ink2);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card .price{font-size:17px;margin-top:auto;padding-top:2px;display:flex;align-items:baseline;gap:6px}
.card .price s{font:400 12.5px Sarabun,sans-serif;color:var(--ink3)}
.heart{position:absolute;right:6px;top:6px;width:36px;height:36px;border-radius:999px;border:0;background:rgba(255,255,255,.92);display:flex;align-items:center;justify-content:center;color:var(--ink2);z-index:1}
.heart[aria-pressed=true]{color:#D23F6E}.heart[aria-pressed=true] .ico{fill:#D23F6E;stroke:#D23F6E}
.badge{position:absolute;left:6px;top:6px;border-radius:999px;padding:3px 9px;font-size:12px;font-weight:600;z-index:1}
.card.sold .cv img{filter:grayscale(.6);opacity:.75}
.feat{display:flex;gap:12px;background:var(--paper);border-radius:16px;padding:12px;box-shadow:var(--sh-rest);grid-column:1/-1;cursor:pointer}
.feat img{width:84px;aspect-ratio:3/4;object-fit:cover;border-radius:8px;flex:none}
.inl{grid-column:1/-1;background:var(--bloom-100);border-radius:14px;padding:14px;display:flex;gap:10px;align-items:center}
.skel{background:linear-gradient(90deg,#EFE9F3 25%,#F7F3FA 50%,#EFE9F3 75%);background-size:200% 100%;animation:sk 1.2s linear infinite;border-radius:var(--r)}
@keyframes sk{to{background-position:-200% 0}}
.skel.card{height:280px;box-shadow:none}
.more{display:flex;justify-content:center;margin:16px 0}

/* welcome / themes / sets */
.wel{background:var(--paper);border-radius:16px;padding:14px;box-shadow:var(--sh-rest);display:flex;flex-direction:column;gap:6px;margin-top:4px}
.wel h1{font-size:19px;line-height:1.25}
.lot{border-radius:16px;padding:14px;color:#fff;background:linear-gradient(135deg,#4B3366,#7B5C9F);display:flex;flex-direction:column;gap:6px;margin-top:4px}
.lot b{font:500 19px/1.25 Mitr,sans-serif}
.cd{display:flex;gap:6px}.cd span{min-width:52px;border-radius:10px;background:rgba(255,255,255,.14);text-align:center;padding:6px 4px;font:500 20px Mitr,sans-serif}
.cd small{display:block;font:400 11px Sarabun,sans-serif;opacity:.85}
.day{font:500 14px Mitr,sans-serif;color:var(--bloom-700);margin:14px 0 8px}
.setcard{background:var(--paper);border-radius:16px;overflow:hidden;box-shadow:var(--sh-rest);cursor:pointer}
.setcard .img{display:flex;height:150px;gap:2px;background:#EDE6F2}
.setcard .img img{flex:1;min-width:0;object-fit:cover}
.setcard .b{padding:10px 14px 12px;display:flex;flex-direction:column;gap:2px}

/* ── buttons ── */
.btn{min-height:52px;border-radius:14px;border:0;display:flex;align-items:center;justify-content:center;gap:8px;font:600 16px Sarabun,sans-serif;width:100%;text-decoration:none;padding:0 16px;text-align:center}
.btn-p{background:var(--bloom-600);color:#fff}.btn-p:active{background:var(--bloom-700);transform:scale(.98)}
.btn-s{background:var(--paper);color:var(--bloom-700);border:1.5px solid var(--bloom-200)}
.btn-m{background:var(--msgr);color:#fff}
.btn-g{background:transparent;color:var(--bloom-600);min-height:44px;font-size:15px}
.btn-ok{background:var(--leaf-bg);color:var(--leaf)}
.btn[disabled]{background:#D9D3DF;color:#8E8699;border:0}
.btn.sm{min-height:40px;width:auto;font-size:14.5px;border-radius:12px}
.ib{width:44px;height:44px;border-radius:999px;border:0;background:transparent;display:flex;align-items:center;justify-content:center;color:var(--ink);flex:none;position:relative;text-decoration:none}
.ib em{position:absolute;top:4px;right:2px;background:var(--petal);color:#fff;font:600 11px Sarabun,sans-serif;font-style:normal;border-radius:999px;min-width:18px;height:18px;display:flex;align-items:center;justify-content:center;padding:0 4px}
.link{color:var(--bloom-600);font-weight:600;text-decoration:underline;background:none;border:0;padding:0}

/* panels / notes */
.sp{background:var(--paper);border-radius:var(--r);padding:14px;box-shadow:var(--sh-rest)}
.note{border-radius:10px;padding:10px 12px;font-size:13.5px;line-height:1.5}
.note.info{background:var(--bloom-50);border:1px solid var(--bloom-200)}
.note.honey{background:var(--honey-bg);color:#5C3D00}.note.leaf{background:var(--leaf-bg);color:var(--leaf)}.note.petal{background:var(--petal-bg);color:var(--petal)}
.sum{display:flex;justify-content:space-between;gap:10px;font-size:15px;padding:3px 0}
.sum.tot{font:500 19px Mitr,sans-serif;border-top:1px solid var(--line);padding-top:10px;margin-top:4px}
.star{font-size:12px;color:var(--ink2);line-height:1.45}
.rowi{display:flex;align-items:center;gap:12px;min-height:52px;padding:6px 2px;border:0;border-bottom:1px solid var(--line);background:none;width:100%;text-align:left;text-decoration:none;color:inherit}
.rowi:last-child{border-bottom:0}
.rowi .ic{width:36px;height:36px;border-radius:10px;background:var(--bloom-100);color:var(--bloom-700);display:flex;align-items:center;justify-content:center;flex:none}
.rowi .tx{flex:1;min-width:0}.rowi .tx b{display:block;font-size:15px}.rowi .tx small{font-size:12.5px;color:var(--ink2)}
.rowi .ch{color:var(--ink3)}

/* ── bottom nav (มือถือ) ── */
.bnav{position:fixed;left:0;right:0;bottom:0;z-index:var(--z-nav);height:calc(var(--bnav-h) + var(--safe-b));padding-bottom:var(--safe-b);display:flex;background:var(--paper);border-top:1px solid var(--line)}
.bnav a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:12px;color:var(--ink2);position:relative;text-decoration:none}
.bnav a i{width:56px;height:30px;border-radius:999px;display:flex;align-items:center;justify-content:center}
.bnav a[aria-current=page]{color:var(--bloom-700);font-weight:600}.bnav a[aria-current=page] i{background:var(--bloom-100)}
.bnav em{position:absolute;top:6px;left:calc(50% + 6px);background:var(--petal);color:#fff;font:600 11px Sarabun,sans-serif;font-style:normal;border-radius:999px;min-width:18px;height:18px;display:flex;align-items:center;justify-content:center;padding:0 4px}
.dock{position:fixed;right:16px;bottom:calc(var(--bnav-h) + var(--safe-b) + 14px);z-index:var(--z-dock);display:flex;flex-direction:column;gap:10px}
.dock button{width:48px;height:48px;border-radius:999px;border:1px solid var(--line);background:var(--paper);box-shadow:var(--sh-lift);display:flex;align-items:center;justify-content:center;color:var(--bloom-700)}

/* ── full pages (หน้าเล่ม ตะกร้า เมนู …) ── */
.page{position:fixed;inset:0;z-index:var(--z-page);background:var(--cream);display:flex;flex-direction:column;overflow:hidden}
.page .top{display:flex;align-items:center;gap:6px;padding:calc(8px + var(--safe-t)) 8px 8px;background:var(--paper);border-bottom:1px solid var(--line);min-height:60px;flex:none}
.page .top .t{flex:1;min-width:0;font:500 16px Mitr,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.page .top .t.l{font:400 15px Sarabun,sans-serif}
.page .body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.page .foot{flex:none;padding:10px var(--gut) calc(12px + var(--safe-b));background:var(--paper);border-top:1px solid var(--line);display:flex;flex-direction:column;gap:6px}
.page .foot .row{display:flex;gap:8px}
.page .foot .row .btn-s.sq{width:56px;flex:none;padding:0}
.hint{font-size:12.5px;color:var(--ink2);text-align:center}

/* book page */
.gal{position:relative;background:#EDE6F2;flex:none}
.gal .track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;height:min(78vw,420px)}
.gal .track::-webkit-scrollbar{display:none}
.gal .track button{flex:0 0 100%;scroll-snap-align:center;border:0;padding:0;background:transparent;display:flex;align-items:center;justify-content:center}
.gal .track img{max-width:100%;max-height:100%;object-fit:contain}
.gal .lbl{position:absolute;bottom:12px;border-radius:999px;padding:4px 10px;font-size:12.5px;font-weight:600;background:rgba(42,34,51,.75);color:#fff;pointer-events:none}
.gal .nav{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:999px;border:0;background:rgba(255,255,255,.9);display:none;align-items:center;justify-content:center}
.thumbs{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:10px var(--gut) 0}
.thumbs::-webkit-scrollbar{display:none}
.thumbs button{flex:none;width:68px;border:0;background:none;padding:0;font-size:11.5px;color:var(--ink2);text-align:center}
.thumbs img{width:68px;height:68px;object-fit:cover;border-radius:8px;margin-bottom:3px;background:#D9CFE3}
.thumbs button[aria-current=true]{color:var(--bloom-700);font-weight:600}.thumbs button[aria-current=true] img{outline:2px solid var(--bloom-600)}
.bp{padding:12px var(--gut) 24px;display:flex;flex-direction:column;gap:12px}
.bp h1{font-size:20px;line-height:1.3}
.byl{display:flex;flex-direction:column;gap:2px;margin-top:4px;font-size:14px;color:var(--ink2)}
.byl a{color:var(--bloom-600);font-weight:600;text-decoration:none}
.byl .na{color:var(--ink3)}
.prow{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:4px}
.prow .price{font-size:24px}
.prow s{color:var(--ink3);font-size:14px}
.blk{background:var(--paper);border-radius:14px;box-shadow:var(--sh-rest);padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.blk-h{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:4px}
.blk-h h2{font-size:16px}
.blk-h a,.blk-h button{font-size:13.5px;color:var(--bloom-600);font-weight:600;text-decoration:none;white-space:nowrap;border:0;background:none;padding:0}
.cond2{display:flex;gap:10px;align-items:flex-start;font-size:14.5px;padding:3px 0}
.cond2 i{width:7px;height:7px;border-radius:999px;background:var(--petal);flex:none;margin-top:8px}
.blk .foot2{font-size:12.5px;color:var(--ink2);line-height:1.45;margin-top:6px;padding-top:8px;border-top:1px solid var(--line)}
.dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:14px;margin:0}
.dl>div{padding:8px 0;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:1px;min-width:0}
.dl>div:nth-child(-n+2){border-top:0}
.dl dt{font-size:12px;color:var(--ink2)}
.dl dd{margin:0;font-size:14.5px;font-weight:600;overflow-wrap:anywhere}
.dl dd small{font-weight:400;color:var(--ink2);font-size:12.5px}
.dl dd.na{font-weight:400;color:var(--ink3)}
.dl .sub{font-size:12px;color:var(--bloom-600);font-weight:600;border:0;background:none;padding:0;text-align:left}
.stbox{border-radius:12px;padding:12px 14px;font-size:14px;line-height:1.5}

/* lightbox */
.lb{position:fixed;inset:0;z-index:calc(var(--z-sheet) + 2);background:#141016;color:#fff;display:flex;flex-direction:column}
.lb .lb-h{display:flex;justify-content:space-between;align-items:center;padding:calc(10px + var(--safe-t)) 14px 10px}
.lb .lb-b{flex:1;display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none}
.lb .lb-b>div{flex:0 0 100%;scroll-snap-align:center;display:flex;align-items:center;justify-content:center;overflow:auto;touch-action:pan-x pan-y pinch-zoom}
.lb img{max-width:100%;max-height:100%;object-fit:contain}

/* sheet (เมนู ตัวกรอง ยืนยัน) */
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:var(--z-sheet);background:var(--paper);border-radius:var(--r-sheet) var(--r-sheet) 0 0;box-shadow:var(--sh-lift);padding:8px var(--gut) calc(16px + var(--safe-b));display:flex;flex-direction:column;gap:12px;max-height:88vh;max-height:88dvh;overflow-y:auto}
.grab{width:40px;height:4px;border-radius:4px;background:#DCD3E3;margin:4px auto 0}

/* toast */
.toast{position:fixed;left:16px;right:16px;bottom:calc(var(--bnav-h) + var(--safe-b) + 12px);z-index:var(--z-toast);background:#2A2233;color:#fff;border-radius:12px;padding:12px 14px;font-size:14px;display:flex;justify-content:space-between;align-items:center;gap:10px;max-width:520px;margin:0 auto;transform:translateY(20px);opacity:0;transition:.2s;pointer-events:none}
.toast.on{transform:none;opacity:1;pointer-events:auto}
.toast button{color:#E6D7F0;font-weight:600;border:0;background:none;padding:6px}

/* empty / error states */
.empty{text-align:center;padding:32px 12px;display:flex;flex-direction:column;align-items:center;gap:8px}
.empty .fl{width:64px;height:64px}
.empty h2{font-size:18px}

/* ── tablet / desktop ── */
@media (min-width:600px){
  .grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
}
@media (min-width:900px){
  .grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (min-width:1024px){
  :root{--gut:28px}
  main{padding-bottom:40px}
  .bnav{display:none}
  .dock{bottom:24px}
  .toast{bottom:24px}
  .hdr .wrap{height:72px;gap:16px}
  .search{max-width:520px}
  .dnav{display:flex;gap:6px;margin-left:auto}
  .dnav a{height:40px;padding:0 14px;border-radius:999px;display:flex;align-items:center;gap:6px;font-size:15px;color:var(--ink2);text-decoration:none;position:relative}
  .dnav a[aria-current=page]{background:var(--bloom-100);color:var(--bloom-700);font-weight:600}
  .dnav em{background:var(--petal);color:#fff;font:600 11px Sarabun,sans-serif;font-style:normal;border-radius:999px;min-width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px}
  .tabs{max-width:520px}
  .tool{max-width:520px}
  /* หน้าเล่มจอคอม: รูปซ้าย ข้อมูลขวา */
  .page.bpage .body{display:grid;grid-template-columns:minmax(0,560px) minmax(0,1fr);gap:36px;max-width:var(--maxw);margin:0 auto;padding:16px var(--gut) 40px;width:100%;align-content:start}
  .page.bpage .gal{border-radius:12px;overflow:hidden}
  .page.bpage .gal .track{height:520px}
  .page.bpage .gal .nav{display:flex}
  .page.bpage .thumbs{padding:10px 0 0}
  .page.bpage .bp{padding:0}
  .page.bpage .bp h1{font-size:28px}
  .page.bpage .foot{display:none}
  .page.bpage .bp .acts{display:flex!important}
  .sheet{left:50%;right:auto;width:520px;transform:translateX(-50%);bottom:auto;top:50%;transform:translate(-50%,-50%);border-radius:var(--r-sheet);max-height:80vh;max-height:80dvh}
  .page.narrow .body>.inner{max-width:640px;margin:0 auto}
}
.bp .acts{display:none;gap:10px}
.bp .acts .btn{width:auto;flex:1}

/* ── ชั้นหนังสือเล็ก (ต่อจากที่ดูไว้) · รายการแนะนำค้นหา ── */
.shelf .mini{flex:none;width:118px;border:0;background:none;padding:0;text-align:left;display:flex;flex-direction:column;gap:4px}
.shelf .mini img{width:118px;aspect-ratio:3/4;object-fit:cover;border-radius:8px;background:#EDE6F2}
.shelf .mini .n{font-size:13px;font-weight:600;line-height:1.25;height:2.5em;overflow:hidden}
.shelf .mini .p{font-size:14px}
.sgimg{width:40px;height:52px;object-fit:cover;border-radius:6px;flex:none;background:#EDE6F2}
.sugg{position:absolute;left:0;right:0;z-index:var(--z-sheet);background:var(--paper);border-bottom:1px solid var(--line);box-shadow:var(--sh-lift);max-height:70vh;max-height:70dvh;overflow-y:auto;padding:4px 0 12px}
/* ── แถบกรองซ้าย (จอคอม) ── */
.cat-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:28px;margin-top:14px;align-items:start}
.side{position:sticky;top:calc(var(--hdr-h) + 12px);background:var(--paper);border-radius:14px;box-shadow:var(--sh-rest);padding:8px 10px 12px;max-height:calc(100vh - var(--hdr-h) - 24px);max-height:calc(100dvh - var(--hdr-h) - 24px);overflow-y:auto}
.side h3{font:500 15px Mitr,sans-serif;margin:12px 6px 4px}
.srow{display:flex;align-items:center;gap:10px;width:100%;min-height:38px;border:0;background:none;border-radius:8px;padding:0 6px;font-size:14.5px;text-align:left}
.srow:hover{background:var(--bloom-50)}
.srow i{width:18px;height:18px;border-radius:5px;border:2px solid #CFC6D9;flex:none}
.srow[role=radio] i{border-radius:999px}
.srow[aria-checked=true]{color:var(--bloom-700);font-weight:600}
.srow[aria-checked=true] i{background:var(--bloom-600);border-color:var(--bloom-600);box-shadow:inset 0 0 0 3px #fff}
.srow small{margin-left:auto;color:var(--ink3);font-weight:400}
.cat-main .applied{margin-top:0}
@media (min-width:1024px){ .cat-main .grid{grid-template-columns:repeat(3,minmax(0,1fr))} }
@media (min-width:1280px){ .cat-main .grid{grid-template-columns:repeat(4,minmax(0,1fr))} }
input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none;display:none}
.card .badge{max-width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.pg-foot .toast,body:has(.page .foot) .toast{bottom:calc(120px + var(--safe-b))}
@media (min-width:1024px){ body.pg-book .toast,body:has(.page.bpage) .toast{bottom:24px} }
.bp .acts>div .btn{width:100%}

/* ═══ รอบแก้ 29 ต.ค. เย็น: คืนของดีเว็บเดิม ═══ */
/* การ์ด: ติ๊กถูกเมื่ออยู่ในตะกร้า · บรรทัดตำหนิ */
.cv .incart{position:absolute;right:6px;bottom:6px;width:28px;height:28px;border-radius:999px;background:var(--bloom-600);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 4px rgba(0,0,0,.25)}
.cv .incart .ico{stroke:#fff;width:16px;height:16px}
.card .meta.df{color:var(--petal);font-weight:600}
/* ตัวเลือก 0 เล่ม: จาง กดไม่ได้ */
.pop .opt[disabled],.chip[disabled],.srow[disabled]{opacity:.4;cursor:default;pointer-events:none}
.pop .grp small{font:400 12px Sarabun,sans-serif}
/* แถบบอกอายุจากคำค้น / คำใกล้เคียง */
.agenote{background:var(--bloom-50);border:1px solid var(--bloom-200);border-radius:10px;padding:8px 12px;font-size:14px;margin:6px 0 8px}
.cntline{font:500 14px Mitr,sans-serif;color:var(--ink2);margin:6px 0 8px}
/* จอคอม: แถวบนผลลัพธ์ */
.dbar{display:flex;align-items:center;gap:16px;margin:0 0 10px;min-height:44px}
.dbar .sw{display:flex;align-items:center;gap:8px;font-size:14.5px;cursor:pointer}
.dbar .sw input{width:20px;height:20px;accent-color:#6E3F8E}
.dbar .dsort{margin-left:auto;display:flex;align-items:center;gap:8px;font-size:14px;color:var(--ink2)}
.dbar select{height:40px;border-radius:10px;border:1.5px solid var(--bloom-200);padding:0 10px;font:15px Sarabun,sans-serif;background:var(--paper);color:var(--ink)}
/* แถบซ้าย: หัวข้อพับ/กาง */
.sgrp{border-top:1px solid var(--line)}.sgrp:first-of-type{border-top:0}
.sgrp summary{list-style:none;display:flex;align-items:center;gap:8px;min-height:44px;padding:0 6px;cursor:pointer;font:500 15px Mitr,sans-serif}
.sgrp summary::-webkit-details-marker{display:none}
.sgrp summary em{font:600 12px Sarabun,sans-serif;font-style:normal;background:var(--bloom-100);color:var(--bloom-700);border-radius:999px;padding:2px 8px;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sgrp summary .ico{margin-left:auto;transition:transform .16s}
.sgrp[open] summary .ico{transform:rotate(180deg)}
.sgrp>.srow:last-child{margin-bottom:8px}
.sclr{display:block;margin:4px 6px 2px auto;border:0;background:none;color:var(--bloom-600);font-weight:600;font-size:13.5px;text-decoration:underline;min-height:32px}
/* อีเวนต์ · โปร */
.evb{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;background:var(--bloom-100);border-radius:14px;padding:12px 14px;margin:8px 0;text-decoration:none;color:var(--ink)}
.evb b{font:500 16px Mitr,sans-serif}.evb span{font-size:13.5px;color:var(--ink2);flex:1 1 200px}.evb em{font-style:normal;font-weight:600;color:var(--bloom-700)}
.prs{margin:6px calc(-1 * var(--gut)) 6px}
.prchip{flex:none;display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:999px;background:var(--honey-bg);color:#5C3D00;font-size:13px;font-weight:600}
/* หน้าเล่ม: เครดิตเห็นชัด (แถวเดียว รวมทุกชื่อ) */
.credits{display:flex;flex-direction:column;gap:6px;margin-top:8px;padding:10px 12px;background:var(--bloom-50);border-radius:12px}
.crow{display:flex;gap:10px;font-size:15px;line-height:1.45}
.crow .ck{flex:none;width:112px;color:var(--ink2);font-size:14px}
.crow .cv2{flex:1;min-width:0}
.crow a{color:var(--bloom-700);font-weight:600;text-decoration:underline;text-underline-offset:3px}
/* ปุ่มกลับ: มีคำว่า "กลับ" · จอคอมชิดเนื้อหา ไม่ไกลสุดขอบ */
.page .top{padding-left:0;padding-right:0}
.page .top .ti{display:flex;align-items:center;gap:6px;width:100%;max-width:var(--maxw);margin:0 auto;padding:0 8px}
.ib.backb{width:auto;padding:0 12px 0 6px;gap:2px;font:600 15px Sarabun,sans-serif;color:var(--ink);border-radius:999px}
.ib.backb:hover{background:var(--bloom-50)}
/* เล่มคล้ายกัน: เต็มความกว้างใต้รายละเอียด แบบแคตตาล็อก */
.rel{padding:4px var(--gut) 24px}
@media (min-width:1024px){
  .page.bpage .rel{grid-column:1/-1;padding:8px 0 24px;border-top:1px solid var(--line)}
  .page.bpage .relgrid{grid-template-columns:repeat(5,minmax(0,1fr))}
  .page.bpage .rel .sec-t h2{font-size:20px}
}
/* ดูรูปเต็มจอ */
.lb .lb-h{padding:calc(8px + var(--safe-t)) 0 8px}
.lb .lb-h .ti{display:flex;align-items:center;gap:10px;width:100%;max-width:var(--maxw);margin:0 auto;padding:0 8px;min-height:44px}
.lb .backb{color:#fff;background:rgba(255,255,255,.14)}
.lb .backb:hover{background:rgba(255,255,255,.24)}
.lb .backb .ico{stroke:#fff}
.lb .lbn{font-size:14px;color:#E6DCEE}
.lb .lb-m{flex:1;position:relative;min-height:0;display:flex}
.lb .lb-b{flex:1}
.lb-nav{position:absolute;top:50%;transform:translateY(-50%);width:52px;height:52px;border-radius:999px;border:0;background:rgba(255,255,255,.16);display:none;align-items:center;justify-content:center;cursor:pointer}
.lb-nav .ico{stroke:#fff}.lb-nav:hover{background:rgba(255,255,255,.28)}.lb-nav[disabled]{opacity:.25;cursor:default}
.lb-nav.l{left:max(12px,calc(50% - 400px))}.lb-nav.r{right:max(12px,calc(50% - 400px))}
.lb-t{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:8px 12px calc(10px + var(--safe-b));justify-content:safe center}
.lb-t button{flex:none;width:56px;height:56px;border:0;padding:0;border-radius:8px;overflow:hidden;background:#2A2233;opacity:.55;cursor:pointer}
.lb-t button img{width:100%;height:100%;object-fit:cover}
.lb-t button[aria-current=true]{opacity:1;outline:2px solid #fff}
@media (hover:hover) and (min-width:700px){ .lb-nav{display:flex} .lb-t button{width:72px;height:72px} }
/* ตะกร้า */
.crow2 .cl{display:flex;align-items:center;gap:12px;flex:1;min-width:0;text-decoration:none;color:inherit}
.crow2 .cp{flex:none;font-size:15px}
.fsrow{display:flex;gap:10px;margin-top:8px}
.fsb{flex:1;min-width:0;border:0;background:none;padding:0;display:flex;flex-direction:column;gap:4px;align-items:center;cursor:pointer}
.fsb img{width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:8px;background:#EDE6F2}
.fsb.more{justify-content:center;border:1.5px dashed var(--bloom-200);border-radius:8px;color:var(--bloom-700);font-weight:600;font-size:13.5px}
.fsall{margin-top:10px}
.toast .tbar{display:block;height:5px;border-radius:999px;background:rgba(255,255,255,.2);margin-top:6px}
.toast .tbar i{display:block;height:5px;border-radius:999px;background:#C9A9E0}
/* เมนู / หมวด */
.mg{font-weight:600;margin:4px 0}
.mg2{font-size:16px;margin:4px 0 2px}
.sg-h{padding:10px 0 4px;font-weight:600}
.sg-all{color:var(--bloom-700)}
/* ตะกร้า: ค่าหนังสือเด่นที่สุด (finalize 3.3 · รอบ 25) รวมประมาณรองลงมา */
.sp .sum:first-child{font:500 17px Mitr,sans-serif}
.sp .sum:first-child b{font:500 22px Mitr,sans-serif}
.sum.tot{font:500 16px Mitr,sans-serif}
.evb{flex-direction:column;align-items:flex-start}
.evb span{flex:none}

/* ═══ 29 ต.ค. 17:00 · หน้าเล่มตามแบบเจ้าของ · แถวแท็บคอม ═══ */
.tabrow{display:flex;align-items:center;gap:20px}
.tabrow .tabs{flex:none;width:520px;margin:0}
.tabrow .dbar{flex:1;margin:0}
/* ลูกศร: ปุ่มเปิดตัวเลือก = ชี้ลง · หัวข้อแถบซ้าย ปิด = ชี้ลง เปิด = ชี้ขึ้น */
.ctl .ico{transform:rotate(90deg)}
.sgrp summary .ico{transform:rotate(90deg)}
.sgrp[open] summary .ico{transform:rotate(-90deg)}
/* หน้าเล่ม */
.bp h1{font-size:22px}
.bp .prow .price{font-size:30px;color:var(--bloom-700)}
.condbox{background:var(--bloom-100);border-radius:16px;padding:14px 16px;display:flex;flex-direction:column;gap:6px}
.condbox .ch2{display:flex;align-items:center;gap:10px}
.condbox .ch2 .ico{width:24px;height:24px;stroke:var(--bloom-700)}
.condbox h2{font-size:17px}
.condbox .used{font-size:16px;margin-left:34px}
.condbox ul{margin:0 0 0 52px;padding:0;font-size:15px;line-height:1.6}
.condlink{display:flex;align-items:center;gap:10px;border:0;background:none;padding:6px 0 0 4px;font:15px Sarabun,sans-serif;color:var(--ink);text-align:left;cursor:pointer}
.condlink .ico{stroke:var(--bloom-700)}
.condlink:hover{color:var(--bloom-700);text-decoration:underline}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tile{background:var(--bloom-50);border:1px solid var(--bloom-200);border-radius:14px;padding:10px 12px;min-height:86px;display:flex;flex-direction:column;justify-content:space-between;gap:8px}
.tile .tk{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--ink2)}
.tile .tk .ico{stroke:var(--bloom-700);flex:none}
.tile b{font:500 17px Mitr,sans-serif;text-align:center}
.tile b small{font:400 12.5px Sarabun,sans-serif;color:var(--ink2)}
.tile b.na{font:400 13.5px Sarabun,sans-serif;color:var(--ink3)}
.tile .sub{font-size:13px;padding:0 2px}
.details{padding:4px var(--gut) 8px;display:grid;grid-template-columns:1fr;gap:0 28px}
.drow{display:flex;align-items:center;gap:12px;min-height:52px;border-bottom:1px solid var(--line);font-size:15px}
.drow .dk{flex:none;width:150px;display:flex;align-items:center;gap:10px;color:var(--ink2)}
.drow .dk .ico{stroke:var(--ink2)}
.drow .dv{flex:1;min-width:0}
.drow .dv a{color:var(--bloom-700);font-weight:600;text-decoration:none}
.drow .dv a:hover{text-decoration:underline}
.drow .na{color:var(--ink3)}
.szbtn{display:inline-flex;align-items:center;gap:8px;border:0;background:var(--bloom-100);color:var(--bloom-700);border-radius:10px;padding:8px 12px;font:600 14px Sarabun,sans-serif;cursor:pointer}
.szbtn .ico{stroke:var(--bloom-700)}
@media (min-width:1024px){
  .tiles{grid-template-columns:repeat(4,minmax(0,1fr))}
  .page.bpage .details{grid-column:1/-1;grid-template-columns:1fr 1fr;padding:8px 0 16px}
  .page.bpage .relgrid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .page.bpage .bp{gap:14px}
  .page.bpage .bp h1{font-size:30px}
}
@media (min-width:1024px) and (max-width:1279px){ .page.bpage .relgrid{grid-template-columns:repeat(3,minmax(0,1fr))} }

/* ═══ 29 ต.ค. 17:10 · หน้าเล่มคอม: รูปใหญ่ซ้าย · ข้อมูลทั้งหมดอยู่ข้างรูป สูงเท่ากัน ═══ */
.ib2{width:34px;height:34px;border-radius:10px;background:var(--paper);display:inline-flex;align-items:center;justify-content:center;flex:none;box-shadow:0 0 0 1px var(--bloom-200) inset}
.ib2 .ico{width:20px;height:20px;stroke:var(--bloom-700);stroke-width:1.7}
.condbox{gap:8px}
.condbox .ch2 .ib2{background:var(--paper)}
.condbox ul{margin:0 0 0 46px}
.condlink{padding:2px 0 0 0}
.tile{align-items:flex-start;justify-content:flex-start;gap:6px;min-height:0;padding:10px 12px 12px}
.tile .ib2{width:30px;height:30px;border-radius:9px}
.tile .ib2 .ico{width:18px;height:18px}
.tile .tk{font-size:12.5px;color:var(--ink2);display:block}
.tile b{text-align:left;font-size:16px;line-height:1.3}
.tile b.na{font-size:13px}
.details{padding:0;display:grid;grid-template-columns:1fr;gap:0}
.drow{min-height:46px;gap:10px}
.drow .dk{width:150px;gap:8px;font-size:14.5px}
.drow .dk .ico{width:18px;height:18px;stroke:var(--bloom-700);stroke-width:1.7}
.page .bp .details{background:var(--paper);border-radius:14px;box-shadow:var(--sh-rest);padding:2px 14px}
.page .bp .details .drow:last-child{border-bottom:0}
@media (min-width:1024px){
  .page.bpage .body{grid-template-columns:minmax(0,1.12fr) minmax(0,1fr);gap:32px}
  .page.bpage .gal .track{height:min(600px,calc(100vh - 210px));height:min(600px,calc(100dvh - 210px))}
  .page.bpage .bp{gap:12px;align-self:start}
  .page.bpage .bp h1{font-size:28px;line-height:1.25}
  .page.bpage .bp .prow .price{font-size:28px}
  .page.bpage .tiles{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  .page.bpage .tile{padding:9px 10px 10px}
  .page.bpage .bp .details{grid-template-columns:1fr 1fr;column-gap:22px;padding:2px 14px;grid-column:auto}
  .page.bpage .bp .details .drow{min-height:42px;font-size:14px}
  .page.bpage .bp .details .drow .dk{width:auto;flex:none;min-width:96px;font-size:13.5px}
  .page.bpage .bp .details .dcol .drow:last-child{border-bottom:0}
}
.szbtn{white-space:nowrap;padding:7px 11px}
.drow .dv{line-height:1.4}

/* ═══ 29 ต.ค. 17:20 · หน้าเล่ม: ไม่มีไอคอนในส่วนข้อมูล · ข้อมูลยาวลงมาเท่ารูป+แถบรูปย่อ · 4 ช่องเด่น ═══ */
.condbox{gap:6px;padding:14px 18px}
.condbox h2{font:500 16px Mitr,sans-serif}
.condbox ul{margin:0;padding-left:20px;font-size:15px;line-height:1.7}
.condbox li::marker{color:var(--bloom-600)}
.condlink{display:inline;padding:0;border:0;background:none;font:15px Sarabun,sans-serif;color:var(--ink);text-decoration:underline;text-decoration-color:var(--bloom-200);text-underline-offset:3px;cursor:pointer;text-align:left}
.condlink:hover{color:var(--bloom-700);text-decoration-color:currentColor}
/* 4 ช่องสรุป: เด่นที่สุดในส่วนข้อมูล (Von Restorff) · ป้ายเล็กบน ค่าตัวใหญ่ */
.tile{background:var(--paper);border:1.5px solid var(--bloom-200);border-radius:14px;padding:12px 14px;gap:4px;justify-content:center;box-shadow:var(--sh-rest)}
.tile .tk{font-size:13px;color:var(--ink2)}
.tile b{font:500 20px Mitr,sans-serif;color:var(--bloom-700)}
.tile b small{display:block;font:400 12.5px Sarabun,sans-serif;color:var(--ink2);margin-top:2px}
.tile b.na{font:400 14px Sarabun,sans-serif;color:var(--ink3)}
/* ตารางรายละเอียด: ป้ายซ้าย ค่าเด่น · ไม่มีไอคอน */
.drow .dk{width:120px;color:var(--ink2);font-size:14px}
.drow .dv{font-size:15px;font-weight:600;color:var(--ink)}
.drow .dv a{font-weight:600}
.szbtn{background:none;padding:0;border-radius:0;color:var(--bloom-700);font:600 15px Sarabun,sans-serif}
.szbtn:hover{text-decoration:underline}
@media (min-width:1024px){
  .page.bpage .body{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px}
  .page.bpage .body>.bgal{display:flex;flex-direction:column}
  .page.bpage .bp{align-self:stretch;display:flex;flex-direction:column;gap:12px}
  .page.bpage .tiles .tile{min-height:96px}
  /* ตารางรายละเอียดยืดลงมาให้จบพอดีกับแถบรูปย่อ ไม่เหลือที่โล่งข้างรูปย่อ */
  .page.bpage .bp .details{flex:1;display:grid;grid-template-columns:1fr 1fr;column-gap:24px;padding:4px 16px}
  .page.bpage .bp .details .dcol{display:flex;flex-direction:column}
  .page.bpage .bp .details .drow{flex:1;min-height:44px}
  .page.bpage .bp .details .drow .dk{min-width:92px;width:92px;font-size:13.5px}
  .page.bpage .bp .details .drow .dv{font-size:14.5px}
}
.tile{justify-content:flex-start}

/* ═══ 29 ต.ค. 17:25 · ตารางรายละเอียดขนาดคงที่ · 4 ช่องสำคัญยืดเติมพื้นที่ที่เหลือ และเด่นขึ้น ═══ */
.tile{background:linear-gradient(180deg,var(--bloom-50),var(--paper));border:1.5px solid var(--bloom-200);box-shadow:0 2px 8px rgba(91,52,119,.08)}
.tile .tk{font-size:13.5px;font-weight:600;color:var(--bloom-700);letter-spacing:.1px}
.tile b{font:500 22px Mitr,sans-serif;color:var(--ink)}
.tile b.na{font:400 14px Sarabun,sans-serif;color:var(--ink3)}
@media (min-width:1024px){
  .page.bpage .bp .details{flex:none}
  .page.bpage .bp .details .drow{flex:none;min-height:46px}
  .page.bpage .tiles{flex:1;align-items:stretch}
  .page.bpage .tiles .tile{min-height:110px;justify-content:center;gap:8px;padding:14px}
  .page.bpage .tile b{font-size:26px}
  .page.bpage .tile b small{font-size:13px}
}
@media (min-width:1024px){
  .page.bpage .tiles .tile{justify-content:flex-start}
  .page.bpage .tile b{margin:auto 0}
  .page.bpage .tile b.na{font:400 14px Sarabun,sans-serif;color:var(--ink3)}
}

/* ═══ 29 ต.ค. 17:40 · ช่องค้นหาติดบนนิ่งทุกหน้า · แท็บ/ปุ่มซ่อนเมื่อเลื่อนลง · ใช้จอคอมเต็มที่ ═══ */
#hdr{position:sticky;top:0;z-index:calc(var(--z-page) + 6)}
:root{--hdr-h:65px}
/* หน้าเล่ม/ตะกร้า/เมนู อยู่ใต้ช่องค้นหาเสมอ (ช่องค้นหาไม่ขยับ ค้นจากหน้าไหนก็ได้) · มือถือ: แถบล่างยังอยู่ */
.page{top:var(--hdr-h);bottom:calc(var(--bnav-h) + var(--safe-b))}
.bnav{z-index:calc(var(--z-page) + 5)}
.page .top{padding-top:8px;min-height:52px}
.sugg{z-index:calc(var(--z-page) + 7)}
/* แถบแท็บ + ปุ่มกรอง/เรียง */
.catbar{position:sticky;top:var(--hdr-h);z-index:var(--z-sticky);background:var(--cream);padding-bottom:8px;transition:transform .22s cubic-bezier(.2,.8,.2,1);box-shadow:0 6px 10px -10px rgba(42,34,51,.35)}
.catbar.hide{transform:translateY(calc(-100% - 2px));pointer-events:none}
.catbar .tool{margin-top:8px}
/* แท็บกับปุ่มกรอง กว้างเท่ากันเสมอ (มือถือ/ไอแพด) */
.catbar .tabs,.catbar .tool{width:100%;max-width:none}
@media (min-width:600px) and (max-width:1023px){ .catbar .tabs,.catbar .tool{max-width:640px;margin-left:auto;margin-right:auto} }
/* ปุ่มเรียงตาม + popover แบบเว็บปัจจุบัน */
.pop.pop-sort{padding:10px 8px;min-width:280px}
.sortpop .sp-h{font-size:13px;color:var(--ink2);font-weight:600;padding:2px 12px 6px}
.sortpop .sp-h2{border-top:1px solid var(--line);margin-top:8px;padding-top:12px}
.sopt{display:flex;align-items:center;gap:10px;width:100%;min-height:46px;border:0;background:none;border-radius:12px;padding:0 12px;font:500 16px Mitr,sans-serif;color:var(--ink);text-align:left;cursor:pointer}
.sopt:hover{background:var(--bloom-50)}
.sopt .ck{width:20px;display:inline-flex;justify-content:center}
.sopt .ck .ico{stroke:var(--bloom-700);stroke-width:2.4;width:18px;height:18px}
.sopt.on{color:var(--bloom-700)}
.sswitch{display:flex;align-items:center;gap:12px;width:100%;border:0;background:none;border-radius:12px;padding:8px 12px;text-align:left;cursor:pointer}
.sswitch:hover{background:var(--bloom-50)}
.sswitch .tx{flex:1}.sswitch .tx b{display:block;font:500 16px Mitr,sans-serif;color:var(--ink)}.sswitch .tx small{font-size:13px;color:var(--ink2)}
.sw2{width:52px;height:30px;border-radius:999px;background:#E6D9F0;position:relative;flex:none;transition:background .16s}
.sw2 i{position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:999px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:left .16s}
.sswitch[aria-checked=true] .sw2{background:var(--bloom-600)}.sswitch[aria-checked=true] .sw2 i{left:25px}
.ctl.sortb .ico{transform:none}
/* ปุ่มตะกร้าบนหัวเว็บ */
.dnav a.dcart.has{border:1.5px solid var(--bloom-600);color:var(--bloom-700);font-weight:600}
.dnav a.dcart .ico{stroke:currentColor}
/* ตะกร้า: รวมเด่นที่สุด · ค่าหนังสือรองลงมาแต่มองเห็นทันที */
.sp .sum:first-child{font:500 16px Mitr,sans-serif;color:var(--ink)}
.sp .sum:first-child b{font:500 18px Mitr,sans-serif}
.sum.tot{font:500 18px Mitr,sans-serif;color:var(--ink)}
.sum.tot span:last-child{font:500 26px Mitr,sans-serif;color:var(--bloom-700)}
/* เซ็ต */
.setprice{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.setprice .now{font-size:24px}
@media (min-width:1024px){
  :root{--maxw:1480px;--gut:32px}
  .page{bottom:0}
  /* คอม: แท็บยาวเต็มแนว (ไม่มีช่องว่างโล่ง) · เรียงตามอยู่บรรทัดบนผลลัพธ์ */
  .catbar .tabs{max-width:none}
  .catbar{padding-bottom:10px}
  .dbar{justify-content:space-between}
  .dbar .ctl.sortb{flex:none;width:auto;padding:0 16px;height:40px}
  .cat-layout{grid-template-columns:250px minmax(0,1fr)}
}
@media (min-width:1400px){ .cat-main .grid{grid-template-columns:repeat(5,minmax(0,1fr))} }
@media (min-width:1700px){ .cat-main .grid{grid-template-columns:repeat(6,minmax(0,1fr))} }
/* รูปเต็มจอก็อยู่ใต้ช่องค้นหา · ปุ่มปิดตรงกับปุ่มกลับพอดี */
.lb{top:var(--hdr-h)}
.lb .lb-h{padding:8px 0}
.page .top .ti,.lb .lb-h .ti{padding:0 calc(var(--gut) - 10px)}

/* ═══ 29 ต.ค. 18:10 · หน้าตาแบบเว็บปัจจุบัน (เจ้าของ 18:02): แถบซ้าย · แท็บ · ปุ่มเรียง · ฟอนต์ · แคปซูลเมนูตามหน้าที่อยู่ ═══ */
/* เมนูบนหัวเว็บ (คอม): ไอคอน + คำ · หน้าที่อยู่ = แคปซูลม่วงอ่อน · ตะกร้ามีของ = กรอบม่วง */
@media (min-width:1024px){
  .hdr .wrap{gap:20px}
  .search{max-width:none;flex:1}
  .dnav{gap:4px;margin-left:0;flex:none}
  .dnav a{height:44px;padding:0 14px;border-radius:12px;gap:8px;font:500 14px Sarabun,sans-serif;color:var(--ink2);border:0}
  .dnav a .ico{width:22px;height:22px;stroke-width:1.9}
  .dnav a:hover{background:var(--bloom-100)}
  .dnav a[aria-current=page]{background:var(--bloom-100);color:var(--bloom-600);font-weight:600}
  .dnav a.dcart.has{border:0;box-shadow:inset 0 0 0 1.5px var(--bloom-600);color:var(--bloom-600);font-weight:600;background:var(--paper)}
  .dnav a.dcart.has[aria-current=page]{background:var(--bloom-100)}
}
/* มือถือ: แถบล่างตามหน้าที่อยู่ (สีจาก .bnav a[aria-current=page] เดิม) */

/* แถบซ้าย (คอม) แบบเว็บปัจจุบัน */
.side{padding:6px 6px 8px;border-radius:14px}
.side .sclr{display:block;margin:6px 8px 4px auto;border:0;background:none;color:var(--bloom-600);font:600 13.5px Sarabun,sans-serif;text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:4px 0}
.sgrp summary{font:500 15px Mitr,Sarabun,sans-serif;color:var(--ink);min-height:44px;padding:0 10px;border-radius:10px}
.sgrp summary:hover{background:var(--bloom-50)}
.sgrp summary em{font:600 12px Sarabun,sans-serif;background:var(--bloom-100);color:var(--bloom-600);border-radius:8px;padding:2px 8px;margin-left:auto}
.sgrp summary em + .ico{margin-left:6px}
.sgrp summary .ico,.sgrp[open] summary .ico{transform:none;width:18px;height:18px;color:var(--ink3);stroke:var(--ink3)}
.sgrp[open] summary .ico{transform:rotate(180deg)}
.sgrp .slist{padding:0 0 8px}
.srow{min-height:38px;border-radius:10px;padding:0 10px;gap:8px;font:500 14px Sarabun,sans-serif;color:var(--ink2);justify-content:space-between}
.srow:hover{background:var(--bloom-100)}
.srow i{display:none}
.srow span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.srow small{font:500 12.5px Sarabun,sans-serif;color:var(--ink3);margin-left:8px}
.srow.on,.srow[aria-pressed=true]{background:var(--bloom-600);color:#fff;font-weight:600}
.srow.on small{color:#fff}
.srow.on:hover{background:var(--bloom-700)}
.srow[disabled]{opacity:.4}

/* คอม: แถวหัวผลลัพธ์ [ทั้งหมด ใหม่ เซ็ตสุดคุ้ม ……… N เล่ม · เรียงตาม แนะนำ ⌄] ติดบน ซ่อนเมื่อเลื่อนลง */
.catbar.dk{top:var(--hdr-h);background:var(--cream);box-shadow:none;padding:0;margin:0 0 14px;z-index:var(--z-sticky)}
.dh-main{display:flex;align-items:center;gap:16px;min-height:62px;border-bottom:1px solid var(--line)}
.catbar.dk .tabs{display:flex;gap:40px;background:none;padding:0;margin:0;border-radius:0;width:auto;max-width:none;flex:none}
.catbar.dk .tabs button{flex:none;height:62px;padding:0;border-radius:0;background:none;box-shadow:none;font:500 18px Mitr,Sarabun,sans-serif;color:var(--ink2);position:relative}
.catbar.dk .tabs button:hover{color:var(--bloom-600)}
.catbar.dk .tabs button[aria-selected=true]{color:var(--bloom-600);background:none;box-shadow:none}
.catbar.dk .tabs button[aria-selected=true]::after{content:"";position:absolute;left:0;right:0;bottom:10px;height:3px;border-radius:3px;background:var(--bloom-600)}
.dh-t{font:500 18px Mitr,Sarabun,sans-serif;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dcount{margin-left:auto;font:400 15px Sarabun,sans-serif;color:var(--ink2);white-space:nowrap}
.dsort{height:44px;border-radius:12px;border:1px solid var(--line);background:var(--paper);padding:0 14px;display:flex;align-items:center;gap:8px;font:400 15px Sarabun,sans-serif;color:var(--ink);cursor:pointer;white-space:nowrap;flex:none}
.dsort:hover,.dsort[aria-expanded=true]{border-color:var(--bloom-200)}
.dsort .k{color:var(--ink2)}
.dsort b{font-weight:600}
.dsort .av{font:600 12px Sarabun,sans-serif;background:var(--bloom-100);color:var(--bloom-600);border-radius:8px;padding:2px 8px}
.dsort .ico{width:18px;height:18px;color:var(--ink2);stroke:var(--ink2)}
.dsort.set{border-color:var(--bloom-600)}
.cat-main .dbar{display:none}
@media (min-width:1024px){ .cat-layout{margin-top:12px;grid-template-columns:240px minmax(0,1fr)} .side{top:calc(var(--hdr-h) + 12px)} .dh-main .dcount + .dsort{margin-left:0} }

/* มือถือ/ไอแพด: แท็บ + ปุ่ม อายุ ⌄ · ประเภท ⌄ · ตัวกรอง (แบบเว็บปัจจุบัน) */
.tabs button{font:500 15px Mitr,Sarabun,sans-serif}
.tabs button[aria-selected=true]{color:var(--bloom-600)}
.ctl{height:44px;border-radius:12px;border:1px solid var(--line);background:var(--paper);font:500 14px Sarabun,sans-serif;color:var(--ink);gap:6px}
.ctl .ico{transform:none!important;width:16px;height:16px;stroke:var(--ink2)}
.ctl.on{border:1.5px solid var(--bloom-600);color:var(--bloom-600);background:var(--bloom-50);font-weight:600}
.ctl.on .ico{stroke:var(--bloom-600)}
.ctl em{font:600 11px Sarabun,sans-serif;font-style:normal;background:var(--bloom-600);color:#fff;border-radius:999px;min-width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px}
.catbar .tool{margin-top:10px}

/* แผ่นล่าง อายุ/ประเภท/ตัวกรอง */
.fsheet{gap:6px;padding-top:6px}
.fsheet .shd{display:flex;align-items:center;justify-content:space-between;padding:4px 0 2px}
.fsheet .shd h2{font:500 18px Mitr,Sarabun,sans-serif;margin:0}
.fsheet .shd .ib{width:44px;height:44px;margin-right:-10px}
.slist2{display:flex;flex-direction:column}
.sli{display:flex;align-items:center;gap:10px;min-height:56px;border:0;border-bottom:1px solid var(--line);background:none;padding:0 4px;font:500 16px Sarabun,sans-serif;color:var(--ink);text-align:left;cursor:pointer}
.sli:last-child{border-bottom:0}
.sli span{flex:1}
.sli small{font:500 13px Sarabun,sans-serif;color:var(--ink3)}
.sli i{width:20px;display:inline-flex;justify-content:center}
.sli i .ico{stroke:var(--bloom-600);stroke-width:2.4;width:18px;height:18px}
.sli.on{color:var(--bloom-600);font-weight:600}
.sli[disabled]{opacity:.4;cursor:default}
.fsec{padding:6px 0}
.fsec .fh{font:500 15px Mitr,Sarabun,sans-serif;color:var(--ink);margin:2px 0 10px}
.fchips{display:flex;flex-wrap:wrap;gap:8px}
.fchip{height:40px;padding:0 16px;border-radius:999px;border:1px solid var(--line);background:var(--paper);font:500 15px Sarabun,sans-serif;color:var(--ink);cursor:pointer}
.fchip.on{background:var(--bloom-600);border-color:var(--bloom-600);color:#fff}
.fchip[disabled]{opacity:.4;cursor:default}
.fcard{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;min-height:56px;margin:0 0 8px;padding:8px 14px;border-radius:12px;border:1px solid var(--line);background:var(--paper);text-align:left;cursor:pointer}
.fcard b{font:600 15px Sarabun,sans-serif;color:var(--ink)}.fcard b small{font-weight:500;font-size:12.5px;color:var(--ink3);margin-left:4px}
.fcard span{font-size:13px;color:var(--ink2)}
.fcard.on{border:1.5px solid var(--bloom-600);background:var(--bloom-50)}.fcard.on b{color:var(--bloom-600)}
.fcard[disabled]{opacity:.4;cursor:default}
.fsheet .sswitch{padding:8px 0}
.ffoot{position:sticky;bottom:calc(-16px - var(--safe-b));display:flex;gap:10px;background:var(--paper);padding:10px 0 calc(6px + var(--safe-b));margin-top:4px;border-top:1px solid var(--line)}
.ffoot .btn-s{flex:1}.ffoot .btn-p{flex:2}
@media (min-width:600px){ .fsheet{max-width:560px;margin:0 auto;border-radius:16px 16px 0 0} }

/* ที่ชอบ · ตะกร้า · เมนู: หัวข้อในหน้า ไม่มีแถบกลับ (กดจากหัวเว็บ/แถบล่างได้) */
.phead{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding:16px 0 6px}
.phead h1{font:500 22px Mitr,Sarabun,sans-serif;margin:0}
.page.favpg .grid{margin-top:8px}
/* ตะกร้าว่าง: เล่มแนะนำแบบแคตตาล็อก */
.cempty{padding-bottom:28px}
.cetop{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:var(--bloom-100);border-radius:14px;padding:14px 16px;margin:4px 0 6px}
.cetop b{font:500 17px Mitr,Sarabun,sans-serif}
.cetop .small{flex:1;min-width:160px}
.cetop .btn{flex:none}
.crec{margin-top:8px}
.crec .sec-t{display:flex;align-items:baseline;justify-content:space-between;margin:18px 0 10px}
.crec .sec-t h2{font:500 18px Mitr,Sarabun,sans-serif}
.crec .sec-t a{font:600 14px Sarabun,sans-serif;color:var(--bloom-600);text-decoration:none}
@media (min-width:1024px){ .page.cartpg:not(.narrow) .grid,.page.favpg .grid{grid-template-columns:repeat(5,minmax(0,1fr))} }
@media (min-width:1700px){ .page.cartpg:not(.narrow) .grid,.page.favpg .grid{grid-template-columns:repeat(6,minmax(0,1fr))} }

/* 18:30 · แก้ตามภาพหน้าจอ: popover เรียง = ตัวอักษรแบบเว็บปัจจุบัน · ชื่อการ์ดไม่เว้นบรรทัดว่าง · จำนวนเล่มตัวปกติ · ตะกร้าว่างบนมือถือ */
.sopt{font:400 16px Sarabun,sans-serif;color:var(--ink);min-height:44px}
.sopt.on{font-weight:600;color:var(--bloom-600)}
.sortpop .sp-h{font:400 13px Sarabun,sans-serif;color:var(--ink2)}
.sswitch .tx b{font:500 15px Sarabun,sans-serif}
.card .n{height:auto;max-height:2.6em}
.cntline{font:400 13px Sarabun,sans-serif;color:var(--ink2)}
@media (max-width:599px){ .cetop{flex-direction:column;align-items:stretch;gap:4px} .cetop .btn{margin-top:8px} }

/* เบราว์เซอร์ในแอป (Facebook / Messenger / LINE / IG) และเบราว์เซอร์รุ่นเก่า: หน้าตาเหมือนเดิม ไม่พัง */
@supports not (aspect-ratio:1/1){
  .cv{height:0;padding-top:100%}
  .cv>img{position:absolute;top:0;left:0;width:100%;height:100%}
  .feat img{height:112px}
  .shelf .mini img{height:157px}
}
html{-webkit-tap-highlight-color:transparent}
.bnav{padding-bottom:var(--safe-b)}
.tile .sub{border:0;background:none;color:var(--ink3);font:500 15px Sarabun,sans-serif;padding:0 2px;margin-left:2px;vertical-align:middle;cursor:pointer;min-width:28px;min-height:28px}
