/* nexbatt storefront — "Calm Lab" (DESIGN.md). Home + catalog, plus the shared primitives product-page.css and
   commerce.css build on (reset, .button, .section, dialogs, toast, header, footer, mobile nav).
   Load after tokens.css. Every colour, radius, shadow and font comes from tokens.css. */

/* ---------- Aliases kept for product-page.css / commerce.css ---------- */
/* Metric-matched local fallbacks so the web-font swap (display=swap) does not reflow the page (CLS). */
@font-face{font-family:"Anuphan Fallback";src:local("Leelawadee UI"),local("Leelawadee");size-adjust:106.8%}
@font-face{font-family:"DM Sans Fallback";src:local("Arial"),local("Helvetica Neue"),local("Helvetica");size-adjust:94.2%}
@font-face{font-family:"Plex Mono Fallback";src:local("Consolas");size-adjust:109%}
:root{--thai:"Anuphan","Anuphan Fallback","DM Sans",system-ui,sans-serif;--sans:"DM Sans","DM Sans Fallback","Anuphan","Anuphan Fallback",system-ui,sans-serif;--mono:"IBM Plex Mono","Plex Mono Fallback",ui-monospace,SFMono-Regular,Menlo,monospace}
:root{--line:var(--rule);--font-ui:var(--thai);--header-h:64px;--devbar-h:0px;--ribbon-h:32px}

/* ---------- Base ---------- */
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;scroll-padding-top:calc(var(--header-h) + var(--devbar-h) + 12px);scrollbar-color:var(--rule-2) var(--paper);accent-color:var(--ink);caret-color:var(--olive)}
body{margin:0;min-width:320px;background:var(--paper);color:var(--ink);font:400 16px/1.7 var(--thai);font-optical-sizing:auto;-webkit-font-smoothing:antialiased;overflow-x:clip}
::selection{background:var(--ink);color:var(--lime)}
/* Placeholders: explicit muted ink at full opacity (>=4.5:1 on card and paper) */
::placeholder{color:var(--muted);opacity:1}
/* Fixed bottom bars (mobile nav, compare tray; cart/PDP bars via --vl-bottom-bar from app.js) never cover the focused element.
   html:root outranks the plain html rule in commerce.css so both sources are respected. */
html:root{scroll-padding-bottom:calc(max(var(--mnav-h,0px) + var(--tray-h,0px),var(--vl-bottom-bar,0px)) + 12px)}
h1,h2,h3,h4{margin:0;line-height:1.3;text-wrap:balance;font-family:var(--thai);font-weight:600}
p{margin:0;text-wrap:pretty}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none;text-underline-offset:.22em;text-decoration-thickness:1px}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0}
button,a,input,select{-webkit-tap-highlight-color:transparent}
button,a{touch-action:manipulation}
button:disabled{cursor:not-allowed}
code{font-family:var(--mono);font-size:.88em}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px;border-radius:var(--r-xs)}
input:focus-visible,select:focus-visible{outline-offset:1px}
svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.ic{width:1.15em;height:1.15em;flex:none}
.icon-sprite{position:absolute;width:0;height:0;overflow:hidden}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.skip-link{position:absolute;left:12px;top:-80px;z-index:200;background:var(--ink);color:var(--paper);padding:10px 16px;border-radius:var(--r-sm);font-weight:600}
.skip-link:focus{top:12px}

/* ---------- Buttons ---------- */
.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;border-radius:var(--r-sm);border:1px solid transparent;font:600 16px/1.2 var(--thai);text-decoration:none;transition:transform .2s var(--ease)}
.button:active{transform:translateY(1px)}
.button .ic{width:20px;height:20px}
.button.dark,.button.primary,.primary{background:var(--forest);color:var(--on-forest)}
.button.dark:hover,.button.primary:hover{background:var(--ink-2)}
.button:disabled{background:var(--sunk);color:var(--muted);border-color:var(--rule-2)}
.button.secondary{background:var(--card);border-color:var(--rule-2);color:var(--ink)}
.button.secondary:hover{border-color:var(--ink)}
.text-button,.quiet-link{display:inline-flex;align-items:center;gap:6px;min-height:44px;font:600 15px/1.4 var(--thai);color:var(--olive);text-decoration:underline;text-decoration-color:var(--rule-2);text-underline-offset:.3em;white-space:nowrap}
.text-button:hover,.quiet-link:hover{text-decoration-color:currentColor}
.linkbtn{display:inline-flex;align-items:center;gap:6px;min-height:44px;font:600 15px/1.4 var(--thai);color:var(--olive);text-decoration:underline;text-underline-offset:.3em;text-decoration-color:var(--rule-2)}
.linkbtn:hover{text-decoration-color:currentColor}
.linkbtn .ic{width:18px;height:18px}
.close,.sheet-x{position:absolute;top:14px;right:14px;z-index:2;display:grid;place-items:center;width:44px;height:44px;border-radius:var(--r-sm);border:1px solid var(--rule);background:var(--card);color:var(--ink)}
.close:hover,.sheet-x:hover{border-color:var(--ink)}
.close .ic,.sheet-x .ic{width:20px;height:20px}
.sheet-x{position:static}

/* ---------- Header ---------- */
body>header{position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:clamp(12px,3vw,32px);min-height:64px;padding-inline:max(var(--gut),calc((100% - var(--max)) / 2 + var(--gut)));background:var(--paper);border-bottom:1px solid var(--rule)}
.logo{display:inline-flex;align-items:baseline;min-height:44px;align-items:center;font:700 22px/1 var(--sans);letter-spacing:-.02em;color:var(--ink);white-space:nowrap}
.logo>span{color:var(--olive);font-weight:400;margin-inline:3px}
body>header nav{display:flex;gap:4px}
body>header nav a{white-space:nowrap;display:inline-flex;align-items:center;min-height:44px;padding:0 12px;border-radius:var(--r-sm);font:500 15px/1.4 var(--thai);color:var(--ink-2)}
body>header nav a:hover{background:var(--sunk)}
.nav-end{margin-left:auto;display:flex;align-items:center;gap:8px}
/* Single test-mode ribbon (Round 5). Its space is reserved from first paint (html.has-ribbon is set inline before render). */
.mode-ribbon{display:none}
.has-ribbon .mode-ribbon{display:flex;align-items:center;justify-content:center;height:var(--ribbon-h);padding-inline:var(--gut);background:var(--paper);border-bottom:1px solid transparent}
.mode-ribbon p{display:flex;align-items:center;gap:8px;min-width:0;font:600 13px/1 var(--thai);color:var(--ink-2);white-space:nowrap}
.mode-ribbon p:empty{visibility:hidden}
.mode-ribbon p::before{content:"";flex:none;width:7px;height:7px;border-radius:50%;background:currentColor}
html[data-ribbon=test] .mode-ribbon{background:var(--warn-bg);border-bottom-color:color-mix(in oklab,var(--warn) 22%,transparent)}
html[data-ribbon=test] .mode-ribbon p{color:var(--warn)}
html[data-ribbon=demo] .mode-ribbon{background:var(--sunk);border-bottom-color:var(--rule)}
/* LINE contact (rendered only when store.line is configured) */
.line-link{display:inline-flex;align-items:center;gap:8px;min-height:44px;font:600 15px/1.3 var(--thai);color:var(--ink)}
.line-link>span:not(.visually-hidden){text-decoration:underline;text-decoration-color:var(--rule-2);text-underline-offset:.3em}
.line-link:hover>span{text-decoration-color:currentColor}
.line-link .ic{width:20px;height:20px;color:var(--olive)}
.line-link small{font:500 13px/1 var(--mono);color:var(--muted)}
.head-line{padding:0 10px;border-radius:var(--r-sm);font-size:14px;font-weight:500;color:var(--ink-2);white-space:nowrap}
.head-line>span:not(.visually-hidden){text-decoration:none}
.head-line:hover{background:var(--sunk)}
.head-line small{display:none}
@media (max-width:1023px){.head-line{display:none}}
.foot-line{margin-top:14px}
.empty-line{padding:0 16px;border:1px solid var(--rule-2);border-radius:var(--r-sm);background:var(--card)}
.empty-line>span:not(.visually-hidden){text-decoration:none}
.empty-line:hover{border-color:var(--ink)}
body>footer .line-link{color:var(--on-forest)}
body>footer .line-link>span:not(.visually-hidden){text-decoration-color:color-mix(in oklab,var(--on-forest) 35%,transparent)}
body>footer .line-link .ic{color:var(--on-forest)}
body>footer .line-link small{color:var(--on-forest-2)}
.dym-hidden{display:none!important}
.saved-nav,.cart-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:44px;min-height:44px;padding:0 10px;border-radius:var(--r-sm);border:1px solid var(--rule);background:var(--card);color:var(--ink)}
.saved-nav:hover,.cart-button:hover{border-color:var(--ink)}
.saved-nav .ic,.cart-button .ic{width:20px;height:20px}
.saved-nav>span,.cart-button>span{font:600 13px/1 var(--sans);font-variant-numeric:tabular-nums}
.cart-button>span{min-width:22px;padding:4px 6px;border-radius:99px;background:var(--ink);color:var(--paper);text-align:center}
.saved-nav>span{color:var(--muted)}
.saved-nav.has-saved .ic{fill:currentColor;color:var(--olive)}

/* ---------- Sections ---------- */
.home>.section{max-width:var(--max);margin-inline:auto;padding:clamp(48px,7vw,88px) var(--gut) 0}
.section-heading{display:flex;justify-content:space-between;align-items:end;gap:12px 20px;flex-wrap:wrap;margin-bottom:24px}
.section-heading h2{font-size:clamp(24px,3vw,32px);line-height:1.3}
.section-heading p{margin-top:6px;max-width:58ch;color:var(--muted);font-size:16px}
.source-date{font:400 14px/1.5 var(--thai);color:var(--muted)}
.more-link{display:inline-flex;align-items:center;gap:6px;min-height:44px;font:600 15px/1.4 var(--thai);color:var(--olive);text-decoration:underline;text-decoration-color:var(--rule-2);text-underline-offset:.3em}
.more-link:hover{text-decoration-color:currentColor}
.more-link .ic{width:18px;height:18px}

/* ---------- Plate (product photo) ---------- */
.plate{position:relative;isolation:isolate;display:grid;place-items:center;aspect-ratio:1;padding:12%;border-radius:var(--r);background:radial-gradient(52% 9% at 50% 88%,color-mix(in oklab,var(--ink) 20%,transparent),transparent 72%),var(--plate)}
.plate img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}
.fallback-text{font:600 13px/1.2 var(--sans);letter-spacing:.04em;color:var(--muted)}

/* ---------- Hero: search-first with the label decoder ---------- */
.hero{padding-block:clamp(28px,6vw,80px) clamp(8px,2vw,24px)}
.hero-inner{max-width:var(--max);margin-inline:auto;padding-inline:var(--gut);display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:clamp(28px,5vw,72px);align-items:center}
.hero h1{font-size:clamp(40px,6vw,72px);line-height:1.22;font-weight:600}
.hero h1 em{display:block;font-style:normal;color:var(--olive)}
.hero-lede{margin-top:16px;max-width:26.5em;font-size:clamp(16px,1.4vw,18.5px);line-height:1.7;color:var(--muted)}
.hero-lede b{color:var(--ink);font:600 1em/1 var(--sans);font-variant-numeric:tabular-nums}
#heroCount{display:inline-block;width:2.75em;text-align:center}
.nowrap{white-space:nowrap}
@media (min-width:761px){.m-br{display:none}}
#heroCount.is-pending{height:1em;vertical-align:-.1em;border-radius:var(--r-xs);background:var(--sunk)}
.hero-search{position:relative;margin-top:28px;scroll-margin-top:calc(var(--header-h) + 12px)}
.hero-search-row{display:flex;align-items:center;gap:6px;padding:6px 6px 6px 18px;background:var(--card);border:1.5px solid var(--ink);border-radius:var(--r);box-shadow:var(--shadow)}
/* Focus: a real 2px --focus ring (about 9:1 on paper) instead of the 1.4:1 halo. */
.hero-search-row:focus-within{outline:2px solid var(--focus);outline-offset:3px}
#catalogSearch:focus,#deviceInput:focus,#brandInput:focus{outline:2px solid var(--focus);outline-offset:2px}
.hero-search-row>.ic{width:22px;height:22px;color:var(--olive)}
.hero-search-row input{flex:1;min-width:0;padding:12px 4px;border:0;background:none;outline:none;font:400 18px/1.4 var(--sans)}
.hero-search-row input::placeholder{color:var(--muted);opacity:1}
.hero-search-row input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
.hero-submit{min-width:84px}
.hero-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 20px;margin-top:14px}
/* Round 6: the code-guide entry is its own quiet line right under the search (first step for people without a code);
   stacking it also keeps the hero height independent of font swap (no wrap shift). */
.hero-meta{flex-direction:column;flex-wrap:nowrap;align-items:flex-start}
.hero-guide{margin-top:-4px}
.hero-examples{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.hero-examples>span{font:400 15px/1.4 var(--thai);color:var(--muted);margin-right:2px}
.hero-examples button{display:inline-flex;align-items:center;min-height:36px;padding:0 12px;border-radius:var(--r-sm);border:1px solid var(--rule-2);background:var(--card);font:500 14px/1 var(--mono);color:var(--ink)}
.hero-examples button:hover{border-color:var(--ink)}

/* Suggestions dropdown */
.suggestions{position:absolute;left:0;right:0;top:calc(100% + 8px);z-index:30;padding:10px;background:var(--card);border:1px solid var(--rule);border-radius:var(--r);box-shadow:var(--shadow-lg);max-height:min(70vh,560px);overflow:auto;overscroll-behavior:contain}
.suggestion-heading{padding:2px 6px 8px;font:500 13.5px/1.5 var(--thai);color:var(--muted)}
.suggestions [data-suggest]{display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;padding:6px;border-radius:var(--r-sm);text-align:left}
.suggestions [data-suggest]:hover,.suggestions .suggestion-active{background:var(--sunk)}
.suggestions .plate{padding:6px;border-radius:var(--r-sm)}
.suggestion-copy{display:grid;min-width:0}
.suggestion-copy b{font:500 15px/1.45 var(--thai);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.suggestion-copy small{display:flex;align-items:center;gap:6px;min-width:0;font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.suggestion-price{display:grid;justify-items:end;font:700 15px/1.3 var(--sans);font-variant-numeric:tabular-nums}
.suggestion-price small{font:500 12px/1.4 var(--thai);color:var(--muted)}
.suggestion-foot{padding-top:6px;margin-top:6px;border-top:1px solid var(--rule)}
.suggestion-all{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:44px;border-radius:var(--r-sm);font:600 15px/1.3 var(--thai);color:var(--olive)}
.suggestion-all:hover{background:var(--sunk)}
.suggestion-all .ic{width:18px;height:18px}
.suggestion-fix{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:4px 6px 10px;margin-bottom:6px;border-bottom:1px solid var(--rule);font:400 14.5px/1.5 var(--thai);color:var(--muted)}
.fix-chip{display:inline-flex;align-items:center;min-height:36px;padding:0 14px;border-radius:99px;border:1px solid var(--ink);background:var(--card);color:var(--ink);font:600 15px/1.2 var(--sans)}
.fix-chip:hover,.suggestions .fix-chip.suggestion-active{background:var(--sunk)}

.fit-badge.is-other{background:var(--sunk);color:var(--muted)}
.suggestion-soon{display:grid;gap:8px;justify-items:start;padding:8px 8px 6px}
.suggestion-soon .soon-title{font:600 16px/1.5 var(--thai);color:var(--ink)}
.suggestion-soon p{font:400 14.5px/1.6 var(--thai);color:var(--muted)}

/* Label decoder (desktop / tablet) */
.decoder{position:relative;margin:0;padding:18px;background:var(--card);border:1px solid var(--rule);border-radius:calc(var(--r) + 6px);box-shadow:var(--shadow)}
.decoder::before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:.45;background-image:linear-gradient(var(--rule) 1px,transparent 1px),linear-gradient(90deg,var(--rule) 1px,transparent 1px);background-size:22px 22px;-webkit-mask:linear-gradient(180deg,var(--ink) 0,transparent 62%);mask:linear-gradient(180deg,var(--ink) 0,transparent 62%)}
.decoder-head{position:relative;display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;font:500 14px/1.4 var(--thai);color:var(--muted)}
.state-pill{display:inline-flex;align-items:center;padding:5px 10px;border-radius:99px;background:var(--sunk);color:var(--ink);font:600 13px/1.2 var(--thai);white-space:nowrap}
[data-level=verified] .state-pill{background:var(--forest);color:var(--on-forest)}
[data-level=exact] .state-pill{background:var(--card);color:var(--ok);box-shadow:inset 0 0 0 1.5px var(--ok)}
[data-level=exact][data-fit=device] .state-pill{background:var(--lime);color:var(--ink);box-shadow:none}
[data-level=family] .state-pill{background:var(--warn-bg);color:var(--warn);box-shadow:inset 0 0 0 1.5px var(--warn)}
[data-level=partial] .state-pill{background:var(--warn-bg);color:var(--warn)}
[data-level=empty] .state-pill{background:var(--bad-bg);color:var(--bad)}
.label-case{position:relative;margin-right:14px;padding:18px;border-radius:18px;background:var(--forest)}
.label-nub{position:absolute;right:-14px;top:50%;width:14px;height:46px;margin-top:-23px;border-radius:0 6px 6px 0;background:var(--ink-2)}
.label-paper{display:grid;gap:2px;min-width:0;padding:12px 14px 12px;border-radius:8px;background:var(--card)}
.lb-faint{font:400 12px/1.5 var(--sans);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lb-line{min-width:0;margin-inline:-8px;padding:1px 7px;border:1.5px solid transparent;border-radius:var(--r-xs)}
.lb-line span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lb-code span{font:600 clamp(18px,1.9vw,22px)/1.4 var(--mono);color:var(--ink)}
.lb-spec{font:500 14.5px/1.6 var(--sans);color:var(--ink-2);font-variant-numeric:tabular-nums}
.lb-model span{font:400 13.5px/1.55 var(--sans);color:var(--ink-2)}
.lb-foot{display:flex;justify-content:space-between;align-items:end;margin-top:8px}
.lb-bars{display:block;width:96px;height:26px;background:repeating-linear-gradient(90deg,var(--ink) 0 2px,transparent 2px 4px,var(--ink) 4px 5px,transparent 5px 8px,var(--ink) 8px 11px,transparent 11px 13px,var(--ink) 13px 14px,transparent 14px 17px)}
.lb-marks{display:flex;gap:6px}
.lb-marks i{width:20px;height:20px;border:1px solid var(--rule-2);border-radius:4px}
/* Lime stays on badges/buttons only: the matched label line is outlined in ink, the state pill carries the lime. */
[data-level=exact] .is-hit,[data-level=verified] .is-hit{background:var(--sunk);border-color:var(--ink)}
[data-level=idle] .is-hit{background:var(--sunk);border-color:var(--rule-2)}
[data-level=partial] .is-hit{background:var(--warn-bg);border-color:var(--warn);border-style:dashed}
[data-level=family] .is-hit{background:var(--warn-bg);border-color:var(--warn)}
/* Idle = a labelled example: no "ผลค้นหา –" filler cell. */
.decoder[data-level=idle] .readout{grid-template-columns:repeat(3,minmax(0,1fr))}
.decoder[data-level=idle] .rd-count{display:none}
[data-level=empty] .lb-code span,[data-level=empty] .mini-line code{color:var(--bad)}
.readout{position:relative;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:14px 0 0;border-top:1px solid var(--rule)}
.readout div{min-width:0;padding:10px 8px 2px;border-left:1px solid var(--rule)}
.readout div:first-child{padding-left:0;border-left:0}
.readout dt{font:500 12.5px/1.3 var(--thai);color:var(--muted)}
.readout dd{margin:2px 0 0;font:500 17px/1.3 var(--mono);color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.decoder-note{position:relative;min-height:3.1em;margin-top:12px;font:400 13.5px/1.55 var(--thai);color:var(--muted);text-wrap:balance}
.is-swapping .label-paper>*,.is-swapping .mini-line,.is-swapping .mini-spec,.is-swapping .readout dd{animation:swap .32s var(--ease) both}
@keyframes swap{from{opacity:.2;transform:translateY(4px)}}

/* Compact decoder (phones) */
.decoder-mini{display:none}

/* ---------- Device-family bento ---------- */
.categories .section-heading{margin-bottom:24px}
#groupCount{font-variant-numeric:tabular-nums}
#groupCount:empty{display:none}
.more-link{white-space:nowrap}
.category-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(150px,auto);gap:12px}
.tile{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 88px;grid-template-rows:auto auto 1fr;column-gap:12px;height:100%;padding:18px;text-align:left;border:1px solid var(--rule);border-radius:var(--r);background:var(--card);color:var(--ink);transition:transform .25s var(--ease)}
.tile:hover{border-color:var(--ink);transform:translateY(-2px)}
.tile-icon{grid-column:1;display:grid;place-items:center;width:34px;height:34px;border-radius:var(--r-sm);background:var(--sunk);color:var(--olive)}
.tile-icon .ic{width:20px;height:20px}
.tile-name{grid-column:1;margin-top:12px;font:600 17px/1.35 var(--thai)}
.tile-note{grid-column:1;font:400 14px/1.55 var(--thai);color:var(--muted)}
.tile-count{grid-column:1;align-self:end;margin-top:10px;font:400 14px/1.3 var(--thai);color:var(--muted)}
.tile-count b{font:500 15px/1 var(--mono);color:var(--ink);font-variant-numeric:tabular-nums}
.tile-plate{grid-column:2;grid-row:1/4;align-self:center;padding:10%;border-radius:var(--r-sm)}
.tile--feature{grid-column:span 2;grid-row:span 2;grid-template-columns:minmax(0,1fr) minmax(0,1fr);background:var(--forest);border-color:var(--forest);color:var(--on-forest)}
.tile--feature .tile-name{font-size:clamp(22px,2.2vw,28px)}
.tile--feature .tile-note,.tile--feature .tile-count{color:var(--on-forest-2)}
.tile--feature .tile-count b{color:var(--on-forest)}
.tile--feature .tile-icon{background:color-mix(in oklab,var(--on-forest) 12%,transparent);color:var(--on-forest)}
.tile--feature .tile-plate{max-width:260px;justify-self:end;width:100%}
.tile--feature:hover{border-color:var(--lime)}
.brand-strip{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin-top:20px;padding-top:16px;border-top:1px solid var(--rule)}
.brand-strip h3{font:500 15px/1.4 var(--thai);color:var(--muted)}
.brand-strip-list{display:flex;flex-wrap:wrap;gap:8px}
.brand-strip-list button,.brand-strip-list a{display:inline-flex;align-items:center;min-height:40px;padding:0 14px;border-radius:99px;border:1px solid var(--rule-2);background:var(--card);font:600 14px/1 var(--sans)}
.brand-strip-list button:hover,.brand-strip-list a:hover{border-color:var(--ink)}

/* ---------- Catalog ---------- */
.home>#catalog{max-width:none;padding:clamp(48px,7vw,88px) 0 0}
.catalog-inner{max-width:var(--max);margin-inline:auto;padding:clamp(28px,4vw,44px) var(--gut) 0}
.device-bar{position:sticky;top:var(--header-h);z-index:30;background:var(--paper);border-block:1px solid var(--rule)}
.device-bar:not(.has-device){display:none}
.device-inner{max-width:var(--max);margin-inline:auto;padding:8px var(--gut);display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;min-height:60px}
.dev-ico{display:grid;place-items:center;width:36px;height:36px;border-radius:var(--r-sm);background:var(--forest);color:var(--lime)}
.dev-ico .ic{width:20px;height:20px}
.dev-text{min-width:0;font:500 15.5px/1.45 var(--thai);color:var(--muted)}
.dev-text b{font:600 16px/1.4 var(--sans);color:var(--ink)}
.dev-count{font-variant-numeric:tabular-nums}
.dev-actions{margin-left:auto;display:flex;gap:6px}
.dev-btn{display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border-radius:var(--r-sm);border:1px solid var(--rule-2);background:var(--card);font:500 15px/1 var(--thai);color:var(--ink)}
.dev-btn:hover{border-color:var(--ink)}
.dev-form{display:flex;flex-wrap:wrap;gap:8px;width:100%;padding-bottom:4px}
.dev-form input{flex:1 1 220px;min-width:0;min-height:44px;padding:0 14px;border:1px solid var(--ink);border-radius:var(--r-sm);background:var(--card);font:500 16px/1 var(--sans)}
.dev-form .button{min-height:44px}
.dev-error{flex-basis:100%;font:500 14px/1.5 var(--thai);color:var(--bad)}
.catalog-bar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px 16px;padding-bottom:14px;margin-bottom:14px;border-bottom:1px solid var(--rule)}
.catalog-bar .results{order:-1}
.results{font:400 15px/1.5 var(--thai);color:var(--muted)}
.results b{font:600 16px/1 var(--sans);color:var(--ink);font-variant-numeric:tabular-nums}
.catalog-toolbar{display:flex;align-items:center;gap:8px}
.filter-toggle,.saved-toggle{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border-radius:var(--r-sm);border:1px solid var(--rule-2);background:var(--card);font:500 15px/1 var(--thai);color:var(--ink)}
.filter-toggle:hover,.saved-toggle:hover{border-color:var(--ink)}
.filter-toggle .ic,.saved-toggle .ic{width:18px;height:18px}
.filter-toggle{display:none}
.saved-toggle.selected{background:var(--forest);border-color:var(--forest);color:var(--on-forest)}
.saved-toggle.selected .ic{fill:currentColor}
.saved-tab-count,.count-pill{font:600 13px/1 var(--sans);font-variant-numeric:tabular-nums}
.count-pill{min-width:22px;padding:4px 6px;border-radius:99px;background:var(--ink);color:var(--paper);text-align:center}
.sort-field{display:inline-flex;align-items:center;gap:8px;font:400 14px/1.4 var(--thai);color:var(--muted)}
.sort-field select,#filters select,#filters input{min-height:44px;padding:0 12px;border:1px solid var(--rule-2);border-radius:var(--r-sm);background:var(--card);font:400 15px/1.4 var(--thai);color:var(--ink)}
.filter-chips{display:flex;flex-wrap:wrap;gap:8px}
.filter-chips:not(:empty){margin-bottom:14px}
.filter-chips button{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 10px 0 14px;border-radius:99px;border:1px solid var(--rule-2);background:var(--card);font:500 14px/1 var(--thai)}
.filter-chips button:hover{border-color:var(--ink)}
.filter-chips .ic{width:16px;height:16px;color:var(--muted)}
.filter-chips .chip-clear-all{border-style:dashed;padding-right:14px;color:var(--olive)}
.fit-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 16px;margin-bottom:14px;padding:10px 16px;border-radius:var(--r);background:var(--sunk);border:1px solid var(--rule)}
.fit-bar p{display:flex;align-items:flex-start;gap:10px;font:400 15px/1.6 var(--thai)}
.fit-bar p .ic{margin-top:4px;color:var(--olive)}
.fit-bar.is-note{background:var(--warn-bg);border-color:color-mix(in oklab,var(--warn) 35%,transparent)}
.fit-bar.is-note p .ic{color:var(--warn)}
.fit-bar.is-family{display:grid;justify-content:stretch;gap:10px;background:var(--warn-bg);border-color:color-mix(in oklab,var(--warn) 35%,transparent)}
.fit-bar.is-family p .ic{color:var(--warn)}
.qual-row{display:flex;flex-wrap:wrap;gap:8px;padding-left:30px}
.qual-chip{display:inline-flex;align-items:center;min-height:40px;padding:0 16px;border-radius:99px;border:1.5px solid var(--warn);background:var(--card);color:var(--ink);font:600 15px/1.2 var(--sans)}
.qual-chip:hover,.suggestions .qual-chip.suggestion-active{background:var(--sunk);border-color:var(--ink)}
.suggestion-quals .qual-chip{min-height:36px;padding:0 12px;font-size:14px}
.legend{display:flex;flex-wrap:wrap;gap:8px 20px;margin:0 0 16px;padding:0;list-style:none;font:400 14px/1.5 var(--thai);color:var(--muted)}
.legend li{display:flex;align-items:center;gap:8px}
.shop-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:24px;align-items:start}
.products-area{min-width:0}

/* Filters (sidebar on desktop, bottom sheet on phones) */
#filters{position:sticky;top:calc(var(--header-h) + var(--devbar-h) + 16px);max-height:calc(100dvh - var(--header-h) - var(--devbar-h) - 32px);overflow:auto;overscroll-behavior:contain;border:1px solid var(--rule);border-radius:var(--r);background:var(--card);scrollbar-width:thin}
.sheet-head{display:flex;align-items:center;gap:8px;padding:14px 16px 6px}
.filter-heading{font:600 17px/1.4 var(--thai);margin-right:auto}
.filter-reset{min-height:36px;font:600 14px/1 var(--thai);color:var(--olive);text-decoration:underline;text-underline-offset:.3em}
.sheet-close{display:none}
.sheet-body{display:grid;gap:6px;padding:0 16px 16px}
.sheet-body>*{min-width:0}
#filters input,#filters select{width:100%}
.filter-field,.facet legend{margin-top:10px;font:600 14px/1.5 var(--thai);color:var(--ink-2)}
.brand-combo,.type-field{display:grid;gap:6px}
.combo-wrap{position:relative}
.combo-wrap input{width:100%;padding-right:40px!important}
.combo-clear{position:absolute;right:4px;top:4px;display:grid;place-items:center;width:36px;height:36px;border-radius:var(--r-xs);color:var(--muted)}
.combo-clear .ic{width:16px;height:16px}
.combo-list{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:5;margin:0;padding:6px;list-style:none;max-height:260px;overflow:auto;background:var(--card);border:1px solid var(--rule);border-radius:var(--r-sm);box-shadow:var(--shadow-lg)}
.combo-list [role=option]{display:flex;justify-content:space-between;gap:8px;min-height:40px;align-items:center;padding:0 10px;border-radius:var(--r-xs);cursor:pointer;font:400 15px/1.3 var(--sans)}
.combo-list [role=option] span{font:400 13px/1 var(--mono);color:var(--muted)}
.combo-list [role=option]:hover,.combo-list .is-active,.combo-list [aria-selected=true]{background:var(--sunk)}
.combo-group,.combo-empty{padding:6px 10px;font:500 13px/1.4 var(--thai);color:var(--muted)}
.facet{margin:0;padding:0;border:0;min-width:0}
.facet-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.facet-chip{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 10px;border-radius:var(--r-sm);border:1px solid var(--rule-2);background:var(--card);font:500 14px/1 var(--mono);font-variant-numeric:tabular-nums}
.facet-chip span{font-size:12px;color:var(--muted)}
.facet-chip:hover{border-color:var(--ink)}
.facet-chip[aria-pressed=true]{background:var(--forest);border-color:var(--forest);color:var(--on-forest)}
.facet-chip[aria-pressed=true] span{color:var(--on-forest-2)}
.facet-empty{font:400 14px/1.5 var(--thai);color:var(--muted)}
.filter-tip{display:flex;align-items:flex-start;gap:10px;width:100%;margin-top:14px;padding:12px;border-radius:var(--r-sm);background:var(--sunk);text-align:left;font:600 14.5px/1.5 var(--thai);color:var(--ink)}
.filter-tip .ic{width:20px;height:20px;margin-top:2px;color:var(--olive)}
.filter-tip small{display:block;font-weight:400;font-size:13px;color:var(--muted)}
.filter-tip:hover{background:var(--plate)}
.sheet-foot{display:none}
.sheet-backdrop{position:fixed;inset:0;z-index:65;background:color-mix(in oklab,var(--forest) 45%,transparent);opacity:1;transition:opacity .25s var(--ease)}
@starting-style{.sheet-backdrop{opacity:0}}

/* ---------- Product grid + cards ---------- */
.product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.product-card{position:relative;display:grid;grid-template-areas:"plate" "body";grid-template-rows:auto 1fr;padding:10px;background:var(--card);border:1px solid var(--rule);border-radius:calc(var(--r) + 4px);transition:transform .25s var(--ease)}
.product-card:hover{border-color:var(--rule-2);box-shadow:var(--shadow)}
.product-card[data-level=verified]{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.product-card:has(.product-title:focus-visible){outline:3px solid var(--focus);outline-offset:2px}
.card-plate{grid-area:plate}
.product-card>.fit-badge{grid-area:plate;align-self:start;justify-self:start;z-index:2;margin:10px;max-width:calc(100% - 68px)}
/* The favourite button sits in the card's own stacking layer (not inside the isolated plate), above the stretched title link. */
.favorite-button{position:relative;z-index:2;grid-area:plate;align-self:start;justify-self:end;margin:8px;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:color-mix(in oklab,var(--card) 85%,transparent);color:var(--muted)}
.favorite-button:hover{color:var(--ink)}
.favorite-button .ic{width:20px;height:20px}
.favorite-button.is-saved{color:var(--olive)}
.favorite-button.is-saved .ic{fill:currentColor}
.card-body{grid-area:body;display:flex;flex-direction:column;gap:9px;min-width:0;padding:12px 6px 4px}
.match-lead{font:400 13.5px/1.5 var(--thai);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.match-lead b{font:600 13.5px/1.5 var(--sans);color:var(--ink)}
/* The link itself is the clamped block, so its hit area is at least one full line (>=24px), not the glyph box. */
.product-name{font:600 16.5px/1.45 var(--thai)}
.product-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:24px;color:var(--ink)}
.product-title::after{content:"";position:absolute;inset:0;z-index:1;border-radius:inherit}
.product-title:focus-visible{outline:none}
.product-card:hover .product-title{text-decoration:underline;text-decoration-color:var(--rule-2)}
.part-code{display:flex;flex-wrap:wrap;gap:6px}
.part-code code,.empty-guide code,.guide-band code{padding:3px 7px;border-radius:var(--r-xs);background:var(--sunk);color:var(--ink-2);font:500 12.5px/1.4 var(--mono)}
.specs{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,auto);margin:0;border-block:1px solid var(--rule)}
.specs div{min-width:0;padding:7px 0 6px 10px;border-left:1px solid var(--rule)}
.specs div:first-child{padding-left:0;border-left:0}
.specs dt{font:500 12px/1.2 var(--mono);color:var(--muted)}
.specs dd{margin:2px 0 0;font:500 14px/1.35 var(--mono);color:var(--ink);font-variant-numeric:tabular-nums;overflow-wrap:normal}
.specs .nw{white-space:nowrap}
.spec-none{padding:7px 0;border-block:1px solid var(--rule);font:400 13.5px/1.4 var(--thai);color:var(--muted)}
.card-foot{display:flex;justify-content:space-between;align-items:end;gap:10px;margin-top:auto;padding-top:2px}
.product-card .price{display:grid;min-width:0;margin:0}
.product-card .price small{font:500 12.5px/1.4 var(--thai);color:var(--muted)}
.product-card .price.is-estimate small{color:var(--olive)}
.product-card .price span{font:700 21px/1.2 var(--sans);letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.product-card .price .price-from{margin-right:5px;font:500 14px/1.2 var(--thai);font-style:normal;letter-spacing:0;color:var(--ink-2)}
.add-button{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 14px;border-radius:var(--r-sm);border:1px solid var(--forest);background:var(--forest);color:var(--on-forest);font:600 15px/1.2 var(--thai);white-space:nowrap;transition:transform .2s var(--ease)}
.add-button:hover{background:var(--ink-2)}
.add-button:active{transform:translateY(1px)}
.add-button .ic{width:18px;height:18px}
.add-button.is-fit{background:var(--lime);border-color:var(--lime);color:var(--ink)}
.add-button.is-choose{background:var(--card);border-color:var(--rule-2);color:var(--ink)}
.add-button.is-choose:hover{border-color:var(--ink)}
.compare-product{position:relative;z-index:2;align-self:flex-start;display:inline-flex;align-items:center;gap:8px;min-height:36px;padding-right:6px;font:500 14px/1 var(--thai);color:var(--muted)}
.compare-product:hover{color:var(--ink)}
.compare-checkbox{display:grid;place-items:center;width:18px;height:18px;border:1.5px solid var(--rule-2);border-radius:5px;background:var(--card)}
.compare-checkbox .ic{width:13px;height:13px;opacity:0}
.compare-product.is-selected{color:var(--ink)}
.compare-product.is-selected .compare-checkbox{background:var(--forest);border-color:var(--forest);color:var(--on-forest)}
.compare-product.is-selected .compare-checkbox .ic{opacity:1}
.product-grid.is-refreshing>.product-card{animation:card-in .32s var(--ease) both}
@keyframes card-in{from{opacity:0;transform:translateY(8px)}}
.image-unavailable img{display:none}
/* Loading skeleton (app.js markup) */
.skeleton-card{display:flex;flex-direction:column;gap:10px;pointer-events:none}
.skeleton-card span{display:block;border-radius:var(--r-xs);background:var(--sunk);animation:pulse 1.4s ease-in-out infinite}
.skeleton-card .sk-image{aspect-ratio:1;border-radius:var(--r);background:var(--plate)}
.skeleton-card .sk-line{height:14px;margin-inline:6px}
.skeleton-card .sk-short{width:55%}
.skeleton-card .sk-price{width:35%;height:22px;margin-bottom:8px}
@keyframes pulse{50%{opacity:.55}}

/* Fit badges (DESIGN.md) */
.fit-badge{display:inline-flex;align-items:center;gap:6px;width:fit-content;margin:0;padding:5px 10px 5px 8px;border-radius:8px;font:600 13px/1.35 var(--thai)}
.fit-badge .ic{width:16px;height:16px}
.fit-badge.is-verified{background:var(--forest);color:var(--on-forest)}
.fit-badge.is-verified .ic{color:var(--lime)}
/* Lime only for verified (icon) or exact against the saved device; a typed-query exact is a green outline. */
.fit-badge.is-exact{background:var(--card);color:var(--ok);outline:1.5px solid var(--ok);outline-offset:-1.5px}
.fit-badge.is-exact.is-device{background:var(--lime);color:var(--ink);outline:0}
.fit-badge.is-family{background:var(--warn-bg);color:var(--warn);outline:1.5px solid var(--warn);outline-offset:-1.5px}
.fit-badge.is-partial{background:var(--warn-bg);color:var(--warn);outline:1.5px dashed var(--warn);outline-offset:-1.5px}
.fit-badge.is-mini{padding:1px 6px 1px 4px;border-radius:var(--r-xs);font-size:12px;gap:3px}
.fit-badge.is-mini .ic{width:13px;height:13px}
.fit-badge.is-new{animation:badge-in .18s var(--ease) both}
@keyframes badge-in{from{opacity:0;transform:scale(.88)}}

/* Empty + error + pagination */
.empty-state,.load-error{display:grid;gap:12px;justify-items:start;padding:clamp(20px,4vw,36px);border:1px solid var(--rule);border-radius:var(--r);background:var(--card)}
.empty-state h3,.load-error h3{font-size:clamp(20px,2.4vw,24px)}
.empty-state p,.load-error p{color:var(--muted)}
.load-error>.ic{width:28px;height:28px;color:var(--warn)}
.empty-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:4px}
.empty-label{flex-basis:100%;font:500 14px/1.5 var(--thai);color:var(--muted)}
.empty-suggest{min-height:40px;padding:0 14px;border-radius:99px;border:1px solid var(--ink);background:var(--card);font:600 15px/1 var(--sans)}
.empty-suggest:hover{background:var(--sunk)}
.empty-categories{display:flex;flex-wrap:wrap;gap:8px}
.empty-category{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 14px 0 12px;border-radius:99px;border:1px solid var(--rule-2);background:var(--card);font:500 14.5px/1.2 var(--thai)}
.empty-category .ic{color:var(--olive)}
.empty-category:hover{border-color:var(--ink)}
.empty-actions{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center}
.empty-guide{width:100%;margin-top:6px;padding:16px;border-radius:var(--r);background:var(--sunk)}
.empty-state.is-soon{max-width:760px}
.empty-state .soon-title{font-size:clamp(20px,2.4vw,24px)}
.catalog-empty .catalog-bar,.catalog-empty #filters,.catalog-empty #filterChips,.catalog-empty #fitLegendBox,.catalog-empty #catalog .section-heading p,.catalog-empty .source-date,
.catalog-empty .brand-strip,.catalog-empty #recentSection{display:none!important}
.catalog-empty .shop-layout{grid-template-columns:minmax(0,1fr)}
/* Same tile geometry as the live bento (no layout shift when the empty state arrives); the count slot says "เร็ว ๆ นี้" */

.catalog-empty .tile-plate{visibility:hidden}
.empty-guide h4{font-size:17px}
.empty-guide ol{margin:8px 0 4px;padding-left:22px;display:grid;gap:4px;font-size:15px}
.pagination{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:28px}
.pagination button{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;border:1px solid var(--rule-2);background:var(--card)}
.pagination button:hover:not(:disabled){border-color:var(--ink)}
.pagination button:disabled{opacity:.4}
.pagination .ic{width:20px;height:20px}
#pageLabel{font:500 15px/1 var(--thai);color:var(--muted);font-variant-numeric:tabular-nums}

/* ---------- Recently viewed ---------- */
.recent-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.recent-card{display:grid;grid-template-columns:72px minmax(0,1fr);gap:12px;align-items:center;padding:8px;text-align:left;border:1px solid var(--rule);border-radius:var(--r);background:var(--card)}
.recent-card:hover{border-color:var(--rule-2);box-shadow:var(--shadow)}
.recent-card .plate{padding:8px;border-radius:var(--r-sm)}
.recent-copy{display:grid;min-width:0}
.recent-copy small{font-size:12.5px;color:var(--muted)}
.recent-copy b{font:600 14.5px/1.4 var(--thai);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.recent-copy>span{font:700 14px/1.4 var(--sans);font-variant-numeric:tabular-nums}
.recent-copy em{font:500 12px/1 var(--thai);font-style:normal;color:var(--muted)}

/* ---------- Guide band + trust row ---------- */
.home>.guide-band{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px 32px;max-width:calc(var(--max) - 2 * var(--gut));margin:clamp(48px,7vw,88px) var(--gut) 0;padding:clamp(20px,3vw,32px);border:1px solid var(--rule);border-radius:var(--r);background:var(--sunk)}
.guide-copy h2{font-size:clamp(22px,2.4vw,28px)}
.guide-copy p{margin-top:6px;max-width:62ch;color:var(--muted)}
.guide-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px}
.trust{max-width:var(--max);margin-inline:auto;padding:clamp(48px,7vw,88px) var(--gut) 0}
.trust-grid{display:grid;grid-template-columns:1.3fr repeat(4,minmax(0,1fr));border-block:1px solid var(--rule)}
.trust-lead{padding:28px 24px 28px 0}
.trust-lead h2{font-size:22px;line-height:1.35}
.trust-lead p{margin-top:8px;font-size:15px;line-height:1.65;color:var(--muted)}
.trust-item{display:grid;align-content:start;gap:6px;padding:28px 20px;border-left:1px solid var(--rule)}
.trust-item>.ic{width:26px;height:26px;color:var(--olive)}
.trust-item h3{margin-top:6px;font-size:16px;line-height:1.4}
.trust-item p{font-size:14.5px;line-height:1.6;color:var(--muted)}
.soon,.live,.test{justify-self:start;display:inline-flex;align-items:center;min-height:26px;padding:0 9px;border-radius:99px;font:600 12.5px/1 var(--thai)}
.soon{background:var(--sunk);border:1px solid var(--rule);color:var(--muted)}
.test{background:var(--warn-bg);color:var(--warn)}
.live{background:var(--ok-bg);color:var(--ok)}
button.live{min-height:36px;padding:0 12px;text-decoration:underline;text-underline-offset:.25em}

/* ---------- Footer ---------- */
body>footer.site-foot{background:var(--forest);color:var(--on-forest)}
body>footer{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:32px;margin-top:clamp(56px,8vw,104px);padding:56px max(var(--gut),calc((100% - var(--max)) / 2 + var(--gut))) 72px;background:var(--forest);color:var(--on-forest)}
body>footer .logo{color:var(--on-forest)}
body>footer .logo>span{color:var(--on-forest-2)}
.foot-tag{margin-top:10px;font-size:17px;color:var(--on-forest)}
.foot-meta{margin-top:4px;font-size:15px;color:var(--on-forest-2)}
.mode-strip{display:inline-flex;margin-top:16px;padding:6px 12px;border:1px dashed color-mix(in oklab,var(--on-forest-2) 60%,transparent);border-radius:99px;font:500 13.5px/1.4 var(--thai);color:var(--on-forest)}
.foot-help h2,body>footer .footer-links::before{display:block;margin-bottom:8px;font:600 15px/1.4 var(--thai);color:var(--on-forest)}
.foot-help ul{margin:0;padding:0;list-style:none}
.foot-help a,body>footer .footer-links a{display:inline-flex;align-items:center;min-height:36px;font:400 15px/1.5 var(--thai);color:var(--on-forest);text-decoration:underline;text-decoration-color:color-mix(in oklab,var(--on-forest) 35%,transparent);text-underline-offset:.3em}
.foot-help a:hover,body>footer .footer-links a:hover{text-decoration-color:currentColor}
body>footer .footer-links{display:flex;flex-direction:column;align-items:flex-start;gap:0;padding:0;border:0;order:0}
body>footer .footer-links::before{content:"ข้อมูลร้าน"}
body>footer .footer-links a[href*="view=order"]{font-weight:600;color:var(--lime)}

/* ---------- Dialogs + sheets ---------- */
dialog{width:min(92vw,860px);max-width:860px;max-height:90dvh;padding:clamp(20px,3vw,32px);border:0;border-radius:calc(var(--r) + 6px);background:var(--card);color:var(--ink);box-shadow:var(--shadow-lg)}
dialog::backdrop{background:color-mix(in oklab,var(--forest) 45%,transparent)}
.sheet{width:min(560px,100%);max-width:100%;max-height:92dvh;margin:auto auto 0;padding:0;border-radius:24px 24px 0 0;opacity:1;transform:translateY(0);transition:transform .28s var(--ease),opacity .24s var(--ease),overlay .28s allow-discrete,display .28s allow-discrete}
.sheet:not([open]){opacity:0;transform:translateY(40px)}
@media (min-width:761px){.sheet{margin:auto;border-radius:24px}}
@starting-style{.sheet[open]{opacity:0;transform:translateY(40px)}}
.sheet::backdrop{opacity:1;transition:opacity .28s var(--ease),overlay .28s allow-discrete,display .28s allow-discrete}
.sheet:not([open])::backdrop{opacity:0}
@starting-style{.sheet[open]::backdrop{opacity:0}}
.sheet-inner{max-height:92dvh;overflow:auto;overscroll-behavior:contain;padding:10px 22px 24px}
.sheet-grip{width:44px;height:5px;margin:2px auto 12px;border-radius:9px;background:var(--rule-2)}
.code-sheet-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.code-sheet-head h2{font-size:21px;line-height:1.35}
.sheet-lede{margin-top:4px;font-size:15px;color:var(--muted)}
.sheet-fig{margin:16px 0 0;padding:14px;border-radius:var(--r);background:var(--plate)}
.sheet-fig figcaption{margin-top:6px;font-size:12.5px;color:var(--muted);text-align:center}
.label-svg{width:100%;height:auto;stroke:none}
.label-svg .lb-case{fill:var(--forest)}
.label-svg .lb-case-2{fill:var(--ink-2)}
.label-svg .lb-paper{fill:var(--card)}
.label-svg text{font-family:var(--sans);fill:var(--ink)}
.label-svg .lb-faint{font-size:11px;fill:var(--muted)}
.label-svg .lb-mono{font-family:var(--mono)}
.label-svg .lb-big{font-size:17px;font-weight:600}
.label-svg .lb-mid{font-size:12.5px;font-weight:500}
.label-svg .lb-small{font-size:11px}
.label-svg .lb-bars{stroke:var(--ink);stroke-width:1.6;stroke-linecap:butt}
.label-svg .lb-faint-g{fill:none;stroke:var(--rule-2);stroke-width:1}
.label-svg .lb-hit{fill:color-mix(in oklab,var(--lime) 55%,transparent);stroke:var(--ink);stroke-width:1.5}
.label-svg .lb-num circle{fill:var(--ink)}
.label-svg .lb-num text{fill:var(--lime);font:700 12px var(--sans);text-anchor:middle}
.sheet-legend{display:grid;gap:10px;margin:16px 0 0;padding:0;list-style:none;counter-reset:n}
.sheet-legend li{display:grid;grid-template-columns:28px 1fr;column-gap:10px;counter-increment:n;font-size:15px;line-height:1.6}
.sheet-legend li::before{content:counter(n);grid-row:span 2;display:grid;place-items:center;width:24px;height:24px;margin-top:2px;border-radius:50%;background:var(--ink);color:var(--lime);font:700 12px/1 var(--sans)}
.sheet-legend span{color:var(--muted)}
.sheet-sub{margin-top:20px;font-size:16px}
.sheet-steps{display:grid;gap:6px;margin:8px 0 0;padding-left:22px;font-size:15px}
.sheet-where{display:grid;gap:8px;margin:8px 0 0;padding:0;list-style:none}
.sheet-where li{display:flex;align-items:flex-start;gap:10px;font-size:15px;line-height:1.6}
.sheet-where .ic{margin-top:4px;color:var(--olive)}
.sheet-done{width:100%;margin-top:20px}
.compare-sheet{width:min(960px,100%)}
.compare-note{margin-top:4px;font-size:15px;color:var(--muted)}
.compare-scroll{margin-top:16px;overflow-x:auto}
.compare-table{width:100%;min-width:560px;border-collapse:collapse;font-size:15px}
.compare-table th,.compare-table td{padding:10px 12px 10px 0;border-top:1px solid var(--rule);text-align:left;vertical-align:top}
.compare-table thead th{border-top:0;font-weight:600}
.compare-table thead th>*{display:block}
.compare-table thead .plate{width:88px;padding:8px;margin-bottom:8px;border-radius:var(--r-sm)}
.compare-table thead small{font:500 12.5px/1.4 var(--thai);color:var(--muted)}
.compare-table thead b{font:600 15px/1.45 var(--thai)}
.compare-table thead strong{font:700 18px/1.3 var(--sans);font-variant-numeric:tabular-nums}
.compare-table th[scope=row]{width:140px;color:var(--muted);font-weight:500}
.compare-table td{font-variant-numeric:tabular-nums}
.compare-remove{min-height:36px;font:500 14px/1 var(--thai);color:var(--olive);text-decoration:underline;text-underline-offset:.3em}
.compare-table .button{min-height:44px;padding:0 14px;font-size:15px}
.compare-tray{position:fixed;left:50%;bottom:16px;z-index:50;display:flex;align-items:center;gap:12px;width:min(720px,calc(100% - 24px));padding:10px 10px 10px 16px;transform:translateX(-50%);background:var(--card);border:1px solid var(--rule);border-radius:var(--r);box-shadow:var(--shadow-lg)}
.compare-tray-copy{display:flex;align-items:center;gap:10px;min-width:0;margin-right:auto}
.compare-mark{display:grid;place-items:center;width:36px;height:36px;border-radius:var(--r-sm);background:var(--sunk);color:var(--olive)}
.compare-mark .ic{width:20px;height:20px}
.compare-tray-copy b{display:block;font:600 15px/1.4 var(--thai)}
.compare-tray-copy small{display:block;font-size:13px;color:var(--muted)}
#compareThumbs{display:flex;gap:6px}
#compareThumbs button{position:relative;width:44px;height:44px;padding:4px;border-radius:var(--r-sm);background:var(--plate)}
#compareThumbs img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}
#compareThumbs span{position:absolute;top:-6px;right:-6px;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--ink);color:var(--paper)}
#compareThumbs span .ic{width:12px;height:12px}
.compare-tray .button{min-height:44px;padding:0 16px}
.tray-close{display:grid;place-items:center;width:44px;height:44px;border-radius:var(--r-sm);color:var(--muted)}
.tray-close:hover{color:var(--ink)}
.tray-close .ic{width:20px;height:20px}
body.has-compare>footer{padding-bottom:140px}
/* Legacy dialogs (#detail is replaced by the product page; #cart by the cart page) */
#detail,#cart{max-width:640px}
.cart-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.cart-head .close{position:static}
.cart-row{display:grid;grid-template-columns:64px minmax(0,1fr) auto;gap:12px;padding:12px 0;border-top:1px solid var(--rule)}
.cart-row img{width:64px;height:64px;object-fit:contain;background:var(--plate);border-radius:var(--r-sm);mix-blend-mode:multiply}
.cart-row h3{font-size:15px}
.cart-row small{display:block;color:var(--muted);font-size:13px}
.quantity-control{display:inline-flex;align-items:center;gap:4px;margin-top:6px}
.quantity-control button{width:36px;height:36px;border-radius:var(--r-xs);border:1px solid var(--rule-2)}
.cart-total{display:flex;justify-content:space-between;padding:14px 0;border-top:1px solid var(--rule);font-weight:600}
.demo-note{margin:4px 0 14px;font-size:14px;color:var(--muted)}

/* ---------- Toast ---------- */
.toast{position:fixed;left:50%;bottom:24px;z-index:100;max-width:calc(100% - 32px);width:max-content;padding:12px 18px;border-radius:var(--r-sm);background:var(--ink);color:var(--on-forest);font:500 15px/1.5 var(--thai);text-align:center;box-shadow:var(--shadow-lg);opacity:0;pointer-events:none;transform:translate(-50%,16px);transition:transform .3s var(--ease),opacity .2s var(--ease)}
.toast.show{opacity:1;transform:translate(-50%,0)}
.has-compare .toast{bottom:104px}
/* Round 6: one placement on every page (overrides older page-specific rules). Toasts never cover headings or sticky bars:
   phones = bottom-centre just above the lowest fixed bottom bar; desktop = top-right just below the sticky top bars.
   enhance.js measures the bars into --toast-bottom / --toast-top before each toast; app.js auto-dismisses after 2.5 s. */
#toast.toast{top:auto!important;bottom:var(--toast-bottom,calc(16px + env(safe-area-inset-bottom)))!important;left:50%!important;right:auto!important;transform:translate(-50%,12px)!important}
#toast.toast.show{transform:translate(-50%,0)!important}
@media (min-width:761px){
 #toast.toast{top:var(--toast-top,calc(var(--header-h,64px) + 16px))!important;bottom:auto!important;left:auto!important;right:max(16px,calc((100vw - var(--max)) / 2))!important;max-width:min(400px,calc(100vw - 32px));text-align:left;transform:translateY(-8px)!important}
 #toast.toast.show{transform:none!important}
}
/* Focus ring on the forest footer: lime ring (>= 3:1 against --forest). */
body>footer :focus-visible{outline-color:var(--lime)}

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

/* ---------- Motion ---------- */
::view-transition-group(*){animation-duration:.42s;animation-timing-function:var(--ease)}
::view-transition-old(root),::view-transition-new(root){animation-duration:.22s}
@supports (animation-timeline:view()){
 @media (prefers-reduced-motion:no-preference){
  .categories,.recent-section,.guide-band,.trust{animation:reveal linear forwards;animation-timeline:view();animation-range:entry 0% entry 30%}
 }
}
@keyframes reveal{from{opacity:.5;transform:translateY(20px)}}

/* ---------- Responsive ---------- */
@media (max-width:1100px){
 .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .trust-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .trust-lead{grid-column:1/-1;padding-right:0;border-bottom:1px solid var(--rule)}
 .trust-item:nth-child(2n){padding-left:0;border-left:0}
 .trust-item:nth-child(n+4){border-top:1px solid var(--rule)}
 .recent-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
 .hero-inner{grid-template-columns:minmax(0,1fr)}
 .decoder{max-width:560px}
 .category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .tile--feature{grid-row:span 1}
 body>footer{grid-template-columns:1fr 1fr}
 .foot-brand{grid-column:1/-1}
}
@media (min-width:761px) and (max-width:900px){.hero-copy{max-width:640px}body>header nav a{padding:0 8px;font-size:14.5px}}
@media (min-width:761px){.mobile-nav{display:none!important}}
@media (max-width:760px){
 :root{--header-h:57px}
 body>header{min-height:57px;gap:10px}
 body>header nav{display:none}
 .logo{font-size:20px}
 .nav-end{gap:6px}
 .hero-examples button,.filter-chips button,.facet-chip,.fix-chip,.qual-chip,.suggestion-quals .qual-chip,.compare-product,.filter-reset,.brand-strip-list button,.brand-strip-list a,.empty-suggest,.empty-category,.dev-btn,button.live{min-height:44px}
 .foot-help a,body>footer .footer-links a,body>footer .line-link{min-height:44px}
 .hero{padding-top:20px}
 .hero h1{font-size:clamp(34px,10vw,44px);line-height:1.25}
 .hero-lede{margin-top:10px}
 .hero-search{margin-top:20px}
 .hero-search-row{padding-left:14px}
 .hero-search-row input{font-size:17px;padding-block:10px}
 .hero-submit{min-width:0;padding:0 16px}
 .decoder{display:none}
 .decoder-mini{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:4px 10px;margin-top:10px;padding:10px 12px;border:1px solid var(--rule);border-radius:var(--r-sm);background:var(--card)}
 .decoder-mini .state-pill{justify-self:start;padding:4px 8px;font-size:12px}
 .mini-line{min-width:0;margin-left:-6px;padding:0 5px;border:1.5px solid transparent;border-radius:var(--r-xs);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .mini-line code{font:600 15px/1.5 var(--mono);color:var(--ink)}
 .mini-spec{grid-column:1/-1;font:500 13.5px/1.5 var(--sans);color:var(--ink-2);font-variant-numeric:tabular-nums}
 .mini-model{grid-column:1/-1;margin-right:-6px;font:400 13.5px/1.5 var(--sans);color:var(--muted)}
 .hero-meta{gap:2px 14px}
 .hero-examples>span{flex-basis:100%;margin:0}
 .hero-examples{gap:6px 8px}
 .category-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:auto;gap:10px}
 .tile{grid-template-columns:minmax(0,1fr) 52px;padding:12px}
 .tile-plate{grid-row:1/2;align-self:start;padding:8%}
 .tile-icon{width:30px;height:30px}
 .tile-name{grid-column:1/-1;margin-top:8px;font-size:15px}
 .tile-note{display:none}
 .tile-count{grid-column:1/-1;margin-top:4px}
 .tile--feature{grid-column:1/-1;grid-template-columns:minmax(0,1fr) 120px;padding:14px 16px}
 .tile--feature .tile-plate{grid-row:1/4;align-self:center}
 .tile--feature .tile-name,.tile--feature .tile-note,.tile--feature .tile-count{grid-column:1}
 .tile--feature .tile-note{display:block;font-size:13.5px}
 .home>#catalog{padding-top:clamp(40px,10vw,56px)}
 .catalog-inner{padding-top:24px}
 .device-inner{min-height:52px;gap:4px 10px;padding-block:6px}
 .dev-ico{display:none}
 .device-inner{flex-wrap:nowrap}
 .dev-text{flex:1;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .dev-count{display:none}
 .dev-actions{flex:none}
 .device-inner:has(.dev-form:not([hidden])){flex-wrap:wrap}
 .dev-btn{min-height:44px;padding:0 11px}
 .catalog-bar{position:sticky;top:calc(var(--header-h) + var(--devbar-h));z-index:20;margin-inline:calc(var(--gut) * -1);padding:8px var(--gut);background:var(--paper);gap:6px 10px}
 .filter-toggle{display:inline-flex}
 .catalog-toolbar{width:100%;gap:6px}
 .sort-field{margin-left:auto;flex:0 1 auto;min-width:0}
 .sort-label{display:none}
 .sort-field select{max-width:150px;width:100%;min-width:0}
 .saved-label{display:none}
 .saved-nav,#savedTab{display:none}
 .results{font-size:14px}
 .shop-layout{grid-template-columns:1fr}
 #filters{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:70;display:flex;flex-direction:column;max-height:88dvh;border:0;border-radius:22px 22px 0 0;box-shadow:var(--shadow-lg);transform:translateY(105%);visibility:hidden;transition:transform .28s var(--ease),visibility 0s linear .28s}
 #filters.open{transform:none;visibility:visible;transition:transform .28s var(--ease)}
 .sheet-head{padding:12px 16px;border-bottom:1px solid var(--rule)}
 .sheet-close{display:grid;place-items:center;width:44px;height:44px;border-radius:var(--r-sm);border:1px solid var(--rule)}
 .sheet-close .ic{width:20px;height:20px}
 .sheet-body{flex:1;overflow:auto;padding-top:6px}
 .sheet-foot{display:block;padding:12px 16px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--rule);background:var(--card)}
 .sheet-foot .button{width:100%}
 body.sheet-open{overflow:hidden}
 .sheet-open .toast{bottom:calc(96px + env(safe-area-inset-bottom))}
 .recent-grid{grid-template-columns:1fr}
 .home>.guide-band{grid-template-columns:1fr}
 .mobile-nav{position:fixed;left:0;right:0;bottom:0;z-index:45;display:flex;justify-content:space-around;padding:4px 8px calc(4px + env(safe-area-inset-bottom));background:var(--paper);border-top:1px solid var(--rule)}
 .mobile-nav a,.mobile-nav button{display:flex;flex:1 1 0;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:52px;color:var(--muted);font:500 12px/1.3 var(--thai)}
 .mobile-nav .ic{width:22px;height:22px}
 .mobile-nav b{font:600 12px/1 var(--sans);font-variant-numeric:tabular-nums}
 .mobile-nav a:hover,.mobile-nav button:hover{color:var(--ink)}
 body>footer{grid-template-columns:1fr;gap:24px;padding-bottom:calc(96px + env(safe-area-inset-bottom))}
 .toast{bottom:calc(76px + env(safe-area-inset-bottom))}
 .compare-tray{bottom:calc(68px + env(safe-area-inset-bottom));flex-wrap:wrap;gap:8px}
 .compare-tray-copy{flex-basis:100%}
 .compare-tray .button{flex:1}
 .has-compare .toast{bottom:calc(200px + env(safe-area-inset-bottom))}
 body.has-compare>footer{padding-bottom:calc(230px + env(safe-area-inset-bottom))}
 .sheet{max-height:92dvh}
}
@media (min-width:600px) and (max-width:760px){.product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:599px){
 .product-grid{grid-template-columns:1fr;gap:10px}
 .product-card{grid-template-columns:112px minmax(0,1fr);grid-template-areas:"plate badge" "plate body";grid-template-rows:auto 1fr;column-gap:4px;padding:8px}
 .card-plate{align-self:start;padding:10%}
 .product-card>.fit-badge{grid-area:badge;margin:4px 0 0 10px;max-width:none}
 .favorite-button{margin:0;width:44px;height:44px}

 .card-body{padding:4px 4px 2px 10px;gap:7px}
 .product-name{font-size:15.5px}
 .product-card .price span{font-size:19px}
 .add-button{padding:0 12px}
 .trust-item{padding:20px 0 20px 14px}
 .trust-item:nth-child(2n){padding-left:0;padding-right:10px}
 .trust-item p{font-size:14px}
 .readout{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:1600px){body>header{padding-inline:calc((100% - var(--max)) / 2 + var(--gut))}}
@media (min-width:1240px){.home>.guide-band{margin-inline:auto}}
@media (max-width:360px){
 .hero-examples button{padding:0 9px;font-size:13px}
 .add-button span{font-size:14px}
}
@media (prefers-reduced-motion:reduce){
 html{scroll-behavior:auto}
 *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
 ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}
}

/* nexbatt logo image (dist/brand, 2026-11-18): header on cream, footer white on forest */
.logo-img{display:block;width:auto;height:26px}
body>footer .logo-img{height:30px}
@media(max-width:420px){.logo-img{height:23px}}

/* Server-rendered summary (docs/SEO.md): <div id="ssr" class="ssr"> at the top of <main> on /p/, /c/, /b/ pages.
   The readable page without JavaScript; html.js (inline script in <head>) hides it and the app removes it after render. */
html.js #ssr{display:none}
.ssr{box-sizing:border-box;max-width:76ch;margin:0 auto;padding:32px 16px 40px;font:400 16px/1.7 var(--thai);color:var(--ink);overflow-wrap:anywhere}
.ssr h1{margin:0 0 12px;font:600 clamp(24px,4.2vw,34px)/1.3 var(--thai);letter-spacing:-.01em}
.ssr h2{margin:28px 0 8px;font:600 19px/1.4 var(--thai)}
.ssr p{margin:0 0 12px}
.ssr nav,.ssr small,.ssr .muted{color:var(--muted);font-size:14px}
.ssr nav{margin-bottom:12px}
.ssr a{color:var(--forest);text-decoration:underline;text-underline-offset:.22em}
.ssr a:hover{color:var(--olive)}
.ssr ul,.ssr ol{margin:0 0 16px;padding-left:1.25em}
.ssr li{margin:4px 0}
.ssr img{display:block;max-width:min(100%,320px);height:auto;margin:0 0 16px;border:1px solid var(--rule);border-radius:var(--r);background:var(--card)}
.ssr dl{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:4px 16px;margin:0 0 16px}
.ssr dt{color:var(--muted)}
.ssr dd{margin:0}
.ssr code{font-family:var(--mono);font-size:.92em}
.ssr table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse}
.ssr-crumbs ol{display:flex;flex-wrap:wrap;gap:2px 8px;margin:0;padding:0;list-style:none}
.ssr-crumbs li{margin:0}
.ssr-crumbs li+li::before{content:"/";margin-right:8px;color:var(--rule-2)}
.ssr ul ul{margin:4px 0 8px}
.ssr-products{display:grid;gap:2px}
.ssr-price{font:600 20px/1.4 var(--sans)}

/* ---------- Storefront round 7 (2026-11-18): results first, listing pages, skeletons, compare ---------- */
/* Catalog heading: title, intro (home only), one small count line with the badge legend as a disclosure. */
.section-heading h1{font-size:clamp(26px,3.4vw,36px);line-height:1.28;font-weight:600;text-wrap:balance}
.catalog-heading{align-items:flex-end;margin-bottom:16px}
.catalog-head-copy{min-width:0}
.catalog-meta{display:flex;flex-wrap:wrap;align-items:center;gap:2px 14px;margin-top:8px}
.catalog-meta .results{margin:0}
.results .results-range{color:var(--muted)}
.legend-box{position:relative}
.legend-box>summary{display:inline-flex;align-items:center;gap:6px;min-height:44px;margin-block:-10px;padding:0 4px;list-style:none;cursor:pointer;font:500 14px/1.4 var(--thai);color:var(--olive);text-decoration:underline;text-decoration-color:var(--rule-2);text-underline-offset:.3em}
.legend-box>summary::-webkit-details-marker{display:none}
.legend-box>summary::after{content:"";width:7px;height:7px;margin:-3px 2px 0;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg)}
.legend-box[open]>summary::after{margin-top:3px;transform:rotate(-135deg)}
.legend-box>summary:hover{text-decoration-color:currentColor}
.legend-box .legend{position:absolute;top:calc(100% + 8px);left:0;z-index:25;display:grid;gap:10px;width:min(360px,calc(100vw - 2 * var(--gut)));margin:0;padding:14px 16px;background:var(--card);border:1px solid var(--rule);border-radius:var(--r);box-shadow:var(--shadow-lg)}
.legend-box .legend li{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px}
/* Search, filters, saved and listing pages: the intro and the date give way to the results. */
#catalog.is-narrowed .catalog-intro,#catalog.is-narrowed .source-date{display:none}
#catalog.is-narrowed .catalog-meta{margin-top:4px}

/* Sticky toolbar under the header (and the "my device" bar) at every width. */
.catalog-bar{position:sticky;top:calc(var(--header-h) + var(--devbar-h));z-index:20;justify-content:flex-end;margin:0 0 14px;padding:8px 0;background:var(--paper);border-bottom:1px solid var(--rule)}
.catalog-bar::before{content:"";position:absolute;inset:0 -12px;z-index:-1;background:var(--paper)}
@media (min-width:761px){#filters{top:calc(var(--header-h) + var(--devbar-h) + 76px);max-height:calc(100dvh - var(--header-h) - var(--devbar-h) - 92px)}}

/* Listing pages (/c/, /b/): html.route-listing is set before first paint, so the home hero never flashes. */
html.route-listing .hero,html.route-listing #categories{display:none}
html.route-listing .home>#catalog{padding-top:0}
html.route-listing .catalog-inner{padding-top:clamp(16px,3vw,32px)}

/* Loading skeleton: 4 cards (plate block + 3 bars) in --sunk; the pulse stops under reduced motion. */
.skeleton-card{display:grid;grid-template-rows:auto 1fr;gap:12px;padding:10px;border:1px solid var(--rule);border-radius:calc(var(--r) + 4px);background:var(--card);pointer-events:none}
.skeleton-card span{display:block}
.skeleton-card .sk-plate{aspect-ratio:1;border-radius:var(--r);background:var(--sunk)}
.skeleton-card .sk-bars{display:grid;align-content:start;gap:10px;padding:4px 6px}
.skeleton-card .sk-bar{height:14px;border-radius:var(--r-xs);background:var(--sunk)}
.skeleton-card .sk-short{width:60%}
.skeleton-card .sk-price{width:38%;height:22px;margin-top:6px}
.skeleton-card .sk-plate,.skeleton-card .sk-bar{animation:pulse 1.4s ease-in-out infinite}
.product-grid[aria-busy=false] .skeleton-card{display:none}
@media (prefers-reduced-motion:reduce){.skeleton-card .sk-plate,.skeleton-card .sk-bar{animation:none!important}}

/* Card -> product View Transition: the card photo morphs with the product photo's timing (product-page.css). */
.card-plate img{view-transition-class:product-plate}

/* Header "ถามผู้ช่วย" (assistant.css): never wraps; icon only where the desktop nav is tight. Name stays readable. */
#assistantOpen{white-space:nowrap}
@media (min-width:720px) and (max-width:900px){
 #assistantOpen{padding:0 11px}
 #assistantOpen>span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}

/* Search box focus: the same 3px ring as every other control. */
.hero-search-row:focus-within{outline:3px solid var(--focus);outline-offset:3px}
.hero-search-row input:focus-visible{outline:none}

/* Zero results: ask the assistant first. */
.empty-ask{min-height:48px;max-width:100%;margin-top:4px}
.empty-ask>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.empty-ask .ic{flex:none;width:20px;height:20px}

/* Compare: copy by count; table values in mono like the spec table; a fit row for the saved device. */
.compare-tray-copy b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.compare-tray-copy>div{min-width:0}
.oc-short{display:none}
.compare-table td.is-mono{font:500 14.5px/1.5 var(--mono);color:var(--ink)}
.compare-table thead .compare-title{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.compare-fit th b{font-weight:600;color:var(--ink)}
.compare-fit .fit-badge{font-size:12.5px}
.compare-nofit{font-size:14px;color:var(--muted)}
.compare-remove{min-height:44px}

@media (max-width:760px){
 /* Results first: tighter heading, the toolbar is one 60px row. */
 .home>#catalog{padding-top:32px}
 #catalog.is-narrowed .catalog-heading{margin-bottom:10px}
 .section-heading h1{font-size:clamp(24px,7vw,30px)}
 .catalog-heading h2{font-size:clamp(22px,6.4vw,26px)}
 .catalog-bar{margin-inline:calc(var(--gut) * -1);padding:8px var(--gut);margin-bottom:12px}
 .catalog-bar::before{content:none}
 .filter-chips:not(:empty){margin-bottom:10px}
 .fit-bar{margin-bottom:12px;padding:10px 12px}
 .fit-bar.is-family{gap:8px}
 .fit-bar p{font-size:14.5px;line-height:1.55}
 .qual-row{padding-left:0}

 .catalog-meta{justify-content:space-between}
 /* Phone skeleton = phone card: plate on the left. */
 .skeleton-card{grid-template-columns:112px minmax(0,1fr);grid-template-rows:auto;gap:14px;padding:8px}
 .skeleton-card .sk-bars{padding:8px 0}
 /* Compare tray: a single 56px row above the bottom nav. */
 .compare-tray{bottom:calc(64px + env(safe-area-inset-bottom));flex-wrap:nowrap;gap:8px;min-height:56px;padding:6px 6px 6px 8px;container-type:inline-size}
 .compare-tray-copy{flex:1 1 auto;flex-basis:auto;order:2;gap:0}
 .compare-mark,.compare-tray-copy small{display:none}
 .compare-tray-copy b{font-size:14px;line-height:1.35;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
 #compareThumbs{order:1;gap:4px}
 #compareThumbs button{width:40px;height:40px}
 .compare-tray .button{order:3;flex:none;min-height:44px;padding:0 14px}
 .oc-long{display:none}.oc-short{display:inline}
 .tray-close{order:4;width:40px;height:44px}
 .has-compare .toast{bottom:calc(132px + env(safe-area-inset-bottom))}
 body.has-compare>footer{padding-bottom:calc(160px + env(safe-area-inset-bottom))}
 /* Compare table: sticky label column on the card surface. */
 .compare-table{min-width:520px;font-size:14.5px}
 .compare-table th[scope=row]{position:sticky;left:0;z-index:1;width:104px;min-width:104px;padding-right:10px;background:var(--card)}
 .compare-table thead th:first-child{position:sticky;left:0;z-index:1;background:var(--card)}
 .compare-table td{padding-left:8px}
 .quantity-control button{width:44px;height:44px}
}
@media (max-width:360px){
 .specs dd{font-size:13px}
 .specs div{padding-left:7px}
}
@container (max-width:300px){.compare-tray-copy{display:none}}
/* The legend panel anchors to the count line, so it never runs off the left edge on phones. */
.catalog-meta{position:relative}
.legend-box{position:static}
.legend-box .legend{left:0;right:auto}
.skeleton-card .sk-bars{border-radius:0;background:none;animation:none}
/* Listing pages are narrowed from first paint too (no intro/date flash before the catalog arrives). */
html.route-listing #catalog .catalog-intro,html.route-listing #catalog .source-date{display:none}
@media (max-width:760px){.compare-tray{padding-block:5px}}
#assistantOpen{min-width:44px;justify-content:center}

/* Header with guides + B2B links (round 8): the logo never shrinks below its brand minimum; mid widths tighten the menu and drop the search link (the hero search and bottom nav cover it). */
body>header .logo{flex-shrink:0}
@media (min-width:761px) and (max-width:1199px){body>header nav{gap:0}body>header nav a{padding:0 7px;font-size:14px}body>header nav a[href="/#catalog"]{display:none}}

/* Mobile reach for guides + B2B (round 8): a quiet link row under the hero help (phones only; the header menu covers wider screens). */
.hero-more{display:none}
@media (max-width:760px){.hero-more{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin:-4px 0 6px;font:500 14.5px/1.4 var(--thai);color:var(--muted)}.hero-more a{display:inline-flex;align-items:center;min-height:44px;color:var(--olive);text-decoration:underline;text-decoration-color:var(--rule-2);text-underline-offset:.3em}.mobile-nav a,.mobile-nav button{min-width:0}.mobile-nav span{white-space:nowrap}}
