/* BaanElec's own look (sites/appliance.json "css"), loaded after the shared app.css.
   Warm "home" palette: deep teal + sunny yellow on a cream background, rounder cards, soft shadows.
   New home + tool components are prefixed be-. */
:root {
  --bg: #f7f3ea; --surface: #ffffff; --ink: #16262b; --muted: #5b6a6e; --line: #e4ddcf;
  --accent: #0f7b74; --accent-ink: #ffffff; --dim: #0f7b74; --chip: #efe9dc; --media: #f2efe8;
  --sun: #f5b324; --sun-soft: #fff1cc; --teal-soft: #dff2ef; --coral: #ef7a5f; --good: #1d7a4a; --price: #b35a00;
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 6px 18px rgba(40, 30, 10, .06);
  --r: 16px;
  --f-display: "Anuphan", "IBM Plex Sans Thai", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #10181a; --surface: #172225; --ink: #e8efee; --muted: #9db0b2; --line: #2a3a3d; --accent: #5fd0c4; --accent-ink: #062523;
  --dim: #5fd0c4; --chip: #203033; --media: #eef0ed; --sun: #f7c14d; --sun-soft: #3a3218; --teal-soft: #173533; --good: #62d39b;
  --price: #f2a54a; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25) } }
:root[data-theme="dark"] {
  --bg: #10181a; --surface: #172225; --ink: #e8efee; --muted: #9db0b2; --line: #2a3a3d; --accent: #5fd0c4; --accent-ink: #062523;
  --dim: #5fd0c4; --chip: #203033; --media: #eef0ed; --sun: #f7c14d; --sun-soft: #3a3218; --teal-soft: #173533; --good: #62d39b;
  --price: #f2a54a; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25) }

/* ---- shared components, softened ---- */
h1, h2, h3, .logo { font-family: var(--f-display) }
h1 { font-weight: 700 }
.bar { position: sticky; top: 0; z-index: 8; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding: 10px max(16px, env(safe-area-inset-left, 0px)); margin-bottom: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line) }
.logo { font-size: 1.25rem; font-weight: 700; letter-spacing: 0 }
.logo-mark { width: 34px; height: 32px; margin-right: 6px }
.logo:has(.logo-mark) { gap: 0 }
.bar .chip { border-color: transparent; background: transparent; font-size: 14px; padding: 8px 12px }
.bar .chip:hover { background: var(--chip) }
.bar .chip[aria-current="page"] { background: var(--accent); color: var(--accent-ink) }
.chip { border-radius: 999px }
.card, .buybox, .alts, .tile, .gcard, .catcard, .mgroup, .ncard, .tablewrap, .calc, .btutool, .idtable, .src li { border-radius: var(--r); border-color: var(--line); box-shadow: var(--shadow) }
.card:hover, .ncard:hover { box-shadow: 0 2px 4px rgba(40, 30, 10, .06), 0 12px 28px rgba(40, 30, 10, .1) }
.btn { border-radius: 999px }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
input[type=search], input[type=number], select { border-radius: 10px }
.filters { background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); top: 58px }
.elno { border-radius: 8px }
.sitefoot { border-top: 1px solid var(--line); background: var(--surface) }
.ngrid .ncard .nthumb { background: var(--teal-soft) }
.ngrid .ncard img { transition: transform .3s }
.ngrid .ncard:hover img { transform: scale(1.03) }
@media (prefers-reduced-motion: reduce) { .ngrid .ncard img { transition: none } }

.be-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.be-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--teal-soft); color: var(--accent); flex: none }
.be-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }

/* ---- home ---- */
.be-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center;
  background: radial-gradient(120% 140% at 100% 0%, var(--sun-soft) 0, transparent 55%), linear-gradient(160deg, var(--teal-soft), var(--surface) 70%);
  border: 1px solid var(--line); border-radius: 28px; padding: clamp(20px, 4vw, 48px); box-shadow: var(--shadow); overflow: hidden }
.be-eyebrow { margin: 0 0 8px; font: 600 13px/1 var(--f-body); color: var(--accent); letter-spacing: .04em }
.be-hero h1 { font-size: clamp(1.75rem, 4.2vw, 2.9rem); line-height: 1.15 }
.be-lead { color: var(--muted); font-size: 1.05rem; max-width: 52ch; margin: 12px 0 20px }
.be-search { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: var(--shadow); max-width: 620px }
.be-search select { border: 0; background: var(--chip); border-radius: 999px; padding-inline: 12px; font-weight: 500 }
.be-search input[type=search] { border: 0; flex: 1 1 auto; min-width: 0; background: transparent; font-size: 16px }
.be-search input:focus-visible { outline: none }
.be-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px }
.be-go { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 10px 20px; font-weight: 600 }
.be-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px }
.be-pill { font-size: 13px; text-decoration: none; color: var(--ink); background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px }
.be-pill:hover { border-color: var(--accent); color: var(--accent) }
.be-heroart { position: relative; display: grid; justify-items: center; align-content: end; min-height: 260px }
.be-mascot { width: min(240px, 60vw); height: auto; filter: drop-shadow(0 10px 18px rgba(15, 80, 75, .18)); animation: be-bob 4s ease-in-out infinite }
@keyframes be-bob { 50% { transform: translateY(-6px) } }
@media (prefers-reduced-motion: reduce) { .be-mascot { animation: none } }
.be-bubble { position: relative; margin: 0 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; max-width: 300px; font-size: 14px; box-shadow: var(--shadow) }
.be-bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg) }
.be-bubble b { color: var(--accent) }
.be-facts { list-style: none; padding: 0; margin: 16px 0 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px }
.be-facts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; color: var(--muted); font-size: 13.5px }
.be-facts b { display: block; font: 700 1.5rem/1.2 var(--f-display); color: var(--ink) }
.be-sec { margin-top: 36px }
.be-sechead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px }
.be-sechead h2 { font: 700 1.45rem/1.2 var(--f-display); margin: 0 }
.be-sechead p { margin: 0; color: var(--muted); font-size: 14px; flex-basis: 100% }
.be-more { font-size: 14px; font-weight: 500; text-decoration: none }
.be-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px }
.be-cat { display: grid; gap: 6px; align-content: start; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s }
.be-cat:hover { transform: translateY(-2px); border-color: var(--accent) }
@media (prefers-reduced-motion: reduce) { .be-cat { transition: none } .be-cat:hover { transform: none } }
.be-cat .be-ico { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 4px }
.be-cat-fridge .be-ico, .be-cat-tv .be-ico { background: var(--sun-soft); color: #9a6a00 }
.be-catname { font: 700 1.25rem/1.2 var(--f-display) }
.be-catn { font: 700 1.6rem/1.1 var(--f-display); color: var(--accent) }
.be-catn small { font: 500 13px var(--f-body); color: var(--muted) }
.be-catp { color: var(--muted); font-size: 13.5px }
.be-catb { font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px }
.be-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px }
.be-tool { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow) }
.be-tool .be-ico { grid-row: span 2 }
.be-tool:hover { border-color: var(--accent) }
.be-tooltitle { font: 700 1.02rem/1.3 var(--f-display) }
.be-tooltitle em { font: 600 11px/1 var(--f-body); font-style: normal; background: var(--sun); color: #3a2a00; border-radius: 999px; padding: 3px 7px; vertical-align: 2px; margin-left: 4px }
.be-tooltext { color: var(--muted); font-size: 13.5px }
.be-ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px }
.be-rank { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); display: grid; align-content: start; gap: 8px }
.be-rank h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.02rem }
.be-rank h3 .be-ico { width: 34px; height: 34px; border-radius: 10px } .be-rank h3 .be-ico svg { width: 18px; height: 18px }
.be-rank ol { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 2px }
.be-rank li { counter-increment: r; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 0 8px; padding: 8px 0; border-top: 1px solid var(--line) }
.be-rank li::before { content: counter(r); grid-row: span 2; font: 700 .95rem/1.6 var(--f-display); color: var(--accent); text-align: center; background: var(--teal-soft); border-radius: 8px; height: 26px }
.be-rank li a { color: var(--ink); text-decoration: none; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.be-rank li a:hover { color: var(--accent) }
.be-val { font: 600 13px var(--f-data); color: var(--good); white-space: nowrap }
.be-sub { grid-column: 2 / -1; font-size: 12.5px; color: var(--muted) }
.be-tip { display: flex; gap: 14px; align-items: center; margin-top: 36px; background: var(--sun-soft); border: 1px solid color-mix(in srgb, var(--sun) 40%, var(--line)); border-radius: 20px; padding: 14px 18px }
.be-tip p { margin: 0; font-size: 14.5px }
.be-tipmascot { width: 64px; height: auto; flex: none }
.be-about { margin-top: 28px; color: var(--muted); font-size: 14px; max-width: 80ch }
.be-about h2 { font-size: 1.05rem; color: var(--ink); margin: 0 0 4px }

/* ---- tool pages ---- */
.be-pagehead { display: flex; gap: 16px; align-items: center; margin: 8px 0 18px }
.be-headmascot { width: 84px; height: auto; flex: none }
.be-pb, .be-fit { padding: clamp(14px, 3vw, 24px) }
.be-pbin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px }
.be-pbin fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 14px; margin: 0; display: grid; gap: 10px; align-content: start; min-width: 0 }
.be-pbin legend { font: 700 .95rem var(--f-display); padding: 0 6px }
.be-pbin label { display: grid; gap: 4px; font-size: 13.5px; color: var(--muted) }
.be-pbin input[type=number], .be-pbin select { width: 100%; font-size: 16px }
.be-pbout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0 }
.be-pbout div { background: var(--chip); border-radius: 14px; padding: 12px 16px; display: grid; gap: 2px }
.be-pbout span { font-size: 13px; color: var(--muted) }
.be-pbout b { font: 700 1.35rem/1.2 var(--f-display) }
.be-pbout small { color: var(--muted); font-size: 12.5px }
.be-pbout .hl { background: var(--accent); color: var(--accent-ink) } .be-pbout .hl span, .be-pbout .hl small { color: inherit; opacity: .85 }
.be-pbtab { width: 100%; border-collapse: collapse; font-size: 14px }
.be-pbtab th, .be-pbtab td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top }
.be-pbtab thead th { font-size: 12.5px; color: var(--muted); font-weight: 500; background: var(--chip); position: sticky; top: 0 }
.be-pbtab td a { text-decoration: none; color: var(--ink) } .be-pbtab td a:hover { color: var(--accent) }
.be-pbtab small { display: block; color: var(--muted); font-size: 12px }
.be-pbtab .good { color: var(--good); font-weight: 600 } .be-pbtab .bad { color: var(--muted) }
.be-pbtab .pbcell { font-weight: 700; color: var(--accent) }
.be-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px }
.be-tab { cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 500; background: var(--surface) }
.be-tab input { position: absolute; opacity: 0; pointer-events: none }
.be-tab:has(input:checked) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
.be-tab:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px }
.be-fitsum { margin: 16px 0 10px; font-size: 15px } .be-fitsum b { font: 700 1.3rem var(--f-display); color: var(--accent) }
.be-fitgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px }
.be-fitcard { display: grid; gap: 3px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface) }
.be-fitcard:hover { border-color: var(--accent) }
.be-fitcard .b { font-size: 12px; color: var(--accent); font-weight: 600 }
.be-fitcard .n { font-weight: 500; font-size: 14px; line-height: 1.35 }
.be-fitcard .dim { font-size: 12.5px } .be-fitcard .meta, .be-fitcard .room { font-size: 12.5px; color: var(--muted) }
.be-fitcard .p { font-weight: 600; color: var(--price) }

@media (max-width: 960px) {
  .be-cats, .be-tools { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .be-pbin { grid-template-columns: 1fr }
}
@media (max-width: 720px) {
  .be-hero { grid-template-columns: 1fr; border-radius: 22px }
  .be-heroart { order: -1; min-height: 0; grid-template-columns: auto 1fr; align-items: center; justify-items: start; gap: 10px }
  .be-heroart .be-mascot { width: 96px; order: -1 }
  .be-bubble { margin: 0; font-size: 13px } .be-bubble::after { left: -7px; bottom: auto; top: 50%; transform: translateY(-50%) rotate(135deg) }
  .be-facts { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .be-search { flex-wrap: wrap; border-radius: 18px } .be-search select { flex: 1 1 100%; padding-block: 9px }
  .be-pbout { grid-template-columns: 1fr }
  .be-pagehead .be-headmascot { width: 60px }
  .be-tools { grid-template-columns: 1fr }
  .bar .cats { order: 3; flex-basis: 100%; display: flex; overflow-x: auto; scrollbar-width: none } .bar .cats::-webkit-scrollbar { display: none }
  .filters { top: 98px }
}
@media (max-width: 560px) {
  .be-cat { padding: 14px; border-radius: 18px } .be-cat .be-ico { width: 42px; height: 42px }
  .be-catp, .be-catb { display: none } .be-catname { font-size: 1.1rem } .be-catn { font-size: 1.35rem }
  .be-go { flex: 1 1 100% }
  .be-home .ngrid { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px }
  .be-home .ngrid > * { scroll-snap-align: start }
}
.be-pbtab { min-width: 0; table-layout: fixed }
.be-pbtab th:first-child { width: 34% }
.be-pbtab td { overflow-wrap: anywhere }
@media (max-width: 720px) { .be-pbtab { table-layout: auto; min-width: 640px } }
.be-pbtab td { min-width: 0 } .be-pbtab th { position: static; white-space: normal }
.be-pbin [hidden] { display: none }
.be-pbout div { grid-template-columns: minmax(0, 1fr); align-content: start }
