/* พร้าวหอม – shared styles for the recipe pages (index.html, recipe.html) and the site header/footer. */
:root {
  --pr-green: #2f6b3a;
  --pr-green-dark: #24552d;
  --pr-green-soft: #e7efe2;
  --pr-cream: #f3f1e7;
  --pr-bg: #fafaf5;
  --pr-surface: #ffffff;
  --pr-ink: #1f2a20;
  --pr-muted: #6b7468;
  --pr-line: #e4e7dc;
  --pr-red: #c8402f;
  --pr-red-soft: #fbe9e6;
  --pr-amber-soft: #fff4dc;
  --pr-amber-ink: #8a5a00;
  --pr-radius: 14px;
  --pr-shadow: 0 1px 2px rgba(25, 45, 25, .05), 0 6px 18px rgba(25, 45, 25, .06);
  --pr-head: 'Kanit', 'Sarabun', system-ui, sans-serif;
  --pr-body: 'Sarabun', 'IBM Plex Sans Thai', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pr-green: #6cc07a;
    --pr-green-dark: #8fd49a;
    --pr-green-soft: #1f3324;
    --pr-cream: #1a201b;
    --pr-bg: #121612;
    --pr-surface: #1a201b;
    --pr-ink: #e8efe8;
    --pr-muted: #9aa79d;
    --pr-line: #2a332c;
    --pr-red: #ff7a68;
    --pr-red-soft: #3a1f1b;
    --pr-amber-soft: #3a2f14;
    --pr-amber-ink: #f3c86b;
    --pr-shadow: none;
  }
}

/* ---- Site header & footer (also used by prices.html) ---- */
.site-header { background: var(--pr-surface); border-bottom: 1px solid var(--pr-line); position: sticky; top: 0; z-index: 20; }
.site-header-inner { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 32px; padding: 10px 24px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--pr-green); flex-shrink: 0; }
.logo img { width: 44px; height: 44px; }
.logo-text { display: flex; flex-direction: column; line-height: 1; font-family: var(--pr-head); }
.logo-text b { font-size: 25px; font-weight: 600; }
.logo-text small { font-size: 10.5px; letter-spacing: 4.5px; margin-top: 3px; font-weight: 500; padding-left: 2px; }
.site-nav { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.site-nav a {
  font-family: var(--pr-head); font-size: 16px; color: var(--pr-ink); text-decoration: none;
  padding: 10px 14px; border-bottom: 3px solid transparent; white-space: nowrap;
}
.site-nav a:hover { color: var(--pr-green); }
.site-nav a.active { color: var(--pr-green); border-bottom-color: var(--pr-green); font-weight: 500; }

.site-footer { border-top: 1px solid var(--pr-line); background: var(--pr-surface); margin-top: 48px; }
.site-footer-inner { max-width: 1320px; margin: 0 auto; padding: 20px 24px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.site-footer .logo img { width: 36px; height: 36px; }
.site-footer .logo-text b { font-size: 20px; }
.site-footer p { margin: 0; font-size: 13px; color: var(--pr-muted); line-height: 1.6; flex: 1; min-width: 260px; }
.site-footer a { color: var(--pr-green); }

/* ---- Page basics ---- */
.pr-page { margin: 0; background: var(--pr-bg); color: var(--pr-ink); font-family: var(--pr-body); font-size: 15.5px; line-height: 1.55; }
.pr-page * { box-sizing: border-box; }
.pr-page [hidden] { display: none !important; }
.pr-page button { font: inherit; cursor: pointer; }
.pr-page h1, .pr-page h2, .pr-page h3 { font-family: var(--pr-head); font-weight: 600; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(100deg, var(--pr-cream) 45%, transparent 85%), var(--pr-cream); }
.hero-photo {
  position: absolute; inset: 0 0 0 45%; background-size: cover; background-position: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%);
  opacity: .9;
}
.hero-inner { position: relative; padding: 34px 24px 26px; max-width: 1320px; margin: 0 auto; }
.hero h1 { margin: 0; font-size: 44px; line-height: 1.15; color: var(--pr-ink); }
.hero p { margin: 8px 0 0; max-width: 620px; font-size: 18px; color: var(--pr-muted); }
.hero-script {
  position: absolute; right: 36px; top: 26px; transform: rotate(-10deg);
  font-family: 'Mali', cursive; font-size: 24px; line-height: 1.25; color: #fff; text-align: right;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .4);
}
.big-search {
  margin-top: 22px; display: flex; align-items: center; gap: 10px; background: var(--pr-surface);
  border: 1px solid var(--pr-line); border-radius: 14px; padding: 6px 6px 6px 18px; box-shadow: var(--pr-shadow);
}
.big-search svg { width: 22px; height: 22px; stroke: var(--pr-muted); fill: none; stroke-width: 2; flex-shrink: 0; }
.big-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--pr-ink); padding: 10px 0; }
.btn-primary {
  border: 0; border-radius: 10px; background: var(--pr-green); color: #fff; font-family: var(--pr-head);
  font-size: 17px; font-weight: 500; padding: 10px 26px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: var(--pr-green-dark); }
.btn-outline {
  border: 1px solid var(--pr-line); background: var(--pr-surface); color: var(--pr-ink); border-radius: 10px;
  padding: 9px 16px; font-family: var(--pr-head); text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn-outline:hover { border-color: var(--pr-green); color: var(--pr-green); }

.chips { display: flex; gap: 10px; margin-top: 18px; overflow-x: auto; padding-bottom: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0;
  border: 1px solid var(--pr-line); background: var(--pr-surface); color: var(--pr-ink);
  border-radius: 999px; padding: 8px 18px; font-family: var(--pr-head); font-size: 15px;
}
.chip:hover { border-color: var(--pr-green); }
.chip.active { background: var(--pr-green); border-color: var(--pr-green); color: #fff; }
.chip .ico { font-size: 17px; line-height: 1; }

/* ---- Recipe listing ---- */
.listing { display: grid; grid-template-columns: 270px 1fr; gap: 28px; margin-top: 26px; }
.filters { background: var(--pr-surface); border: 1px solid var(--pr-line); border-radius: var(--pr-radius); padding: 6px 18px 18px; align-self: start; position: sticky; top: 84px; }
.filter-group { border-bottom: 1px solid var(--pr-line); padding: 12px 0; }
.filter-group:last-of-type { border-bottom: 0; }
.filter-group summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: var(--pr-head); font-weight: 600; font-size: 16px; }
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::after { content: '⌃'; font-size: 14px; color: var(--pr-muted); transform: translateY(3px); }
.filter-group:not([open]) summary::after { transform: rotate(180deg) translateY(3px); }
.filter-opt { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 15px; color: var(--pr-ink); cursor: pointer; }
.filter-opt input { width: 17px; height: 17px; accent-color: var(--pr-green); margin: 0; }
.filter-opt .n { margin-left: auto; color: var(--pr-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.filter-opt.empty { opacity: .45; }
.clear-btn { width: 100%; margin-top: 14px; justify-content: center; border-color: var(--pr-green); color: var(--pr-green); }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.results-head h2 { margin: 0; font-size: 22px; }
.sort { display: flex; align-items: center; gap: 10px; color: var(--pr-muted); font-size: 14.5px; }
.sort select {
  font: inherit; color: var(--pr-ink); background: var(--pr-surface); border: 1px solid var(--pr-line);
  border-radius: 10px; padding: 8px 32px 8px 14px; min-width: 170px;
}
.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.recipe-card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--pr-surface); border: 1px solid var(--pr-line); border-radius: var(--pr-radius); overflow: hidden;
  box-shadow: var(--pr-shadow); transition: transform .14s ease, border-color .14s ease;
}
.recipe-card:hover { transform: translateY(-3px); border-color: var(--pr-green); }
.recipe-photo { aspect-ratio: 16 / 10; background: var(--pr-green-soft) center / cover no-repeat; }
.recipe-photo.placeholder { display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #f6efd9, #e3ecd8); }
.recipe-photo.placeholder span { font-size: 54px; filter: saturate(.9); }
.fav {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); color: #333; display: grid; place-items: center; font-size: 19px; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.fav.on { color: var(--pr-red); }
.recipe-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.recipe-body h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.tag { align-self: flex-start; background: var(--pr-green-soft); color: var(--pr-green); border-radius: 999px; padding: 2px 14px; font-size: 13.5px; font-family: var(--pr-head); }
.recipe-meta { display: flex; gap: 0; margin-top: auto; padding-top: 6px; font-size: 14px; color: var(--pr-muted); flex-wrap: wrap; }
.recipe-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-left: 1px solid var(--pr-line); }
.recipe-meta span:first-child { padding-left: 0; border-left: 0; }
.recipe-meta svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--pr-muted); }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.pager button {
  min-width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--pr-line);
  background: var(--pr-surface); color: var(--pr-ink); font-family: var(--pr-head);
}
.pager button.active { background: var(--pr-green); border-color: var(--pr-green); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }

/* ---- Shopping page ---- */
.order-hero .hero-inner { padding-bottom: 96px; }
.dish-card {
  position: relative; margin-top: -78px; background: var(--pr-surface); border: 1px solid var(--pr-line);
  border-radius: 16px; box-shadow: var(--pr-shadow); padding: 14px; display: flex; gap: 18px; align-items: center;
}
.dish-card .recipe-photo { width: 260px; flex-shrink: 0; border-radius: 12px; aspect-ratio: 16 / 10; }
.dish-info { flex: 1; min-width: 0; }
.dish-info h2 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dish-info p { margin: 4px 0 10px; color: var(--pr-muted); }
.dish-facts { display: flex; gap: 20px; flex-wrap: wrap; font-size: 15px; color: var(--pr-ink); }
.dish-facts span { display: inline-flex; align-items: center; gap: 6px; }
.dish-facts svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.servings { display: inline-flex; align-items: center; gap: 6px; }
.servings select { font: inherit; border: 1px solid var(--pr-line); border-radius: 8px; padding: 2px 8px; background: var(--pr-surface); color: var(--pr-ink); }
.dish-actions { display: flex; flex-direction: column; gap: 8px; align-self: flex-start; margin-top: 30px; }

.order-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; margin-top: 22px; align-items: start; }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs .chip { padding: 8px 20px; }

.panel { background: var(--pr-surface); border: 1px solid var(--pr-line); border-radius: var(--pr-radius); box-shadow: var(--pr-shadow); }
.ing-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ing-table th {
  text-align: left; font-family: var(--pr-head); font-weight: 500; font-size: 14.5px; color: var(--pr-ink);
  background: var(--pr-cream); padding: 10px 10px; border-bottom: 1px solid var(--pr-line);
}
.ing-table th small { display: block; font-weight: 400; font-size: 12px; color: var(--pr-muted); }
.ing-table td { padding: 10px; border-bottom: 1px solid var(--pr-line); vertical-align: middle; }
.ing-table tr:last-child td { border-bottom: 0; }
.ing-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--pr-green); }
.ing-thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--pr-line); }
.ing-thumb.none { display: grid; place-items: center; font-size: 22px; background: var(--pr-cream); }
.ing-name { font-weight: 600; font-family: var(--pr-head); font-weight: 500; font-size: 16px; }
.ing-prod { font-size: 12.5px; color: var(--pr-muted); line-height: 1.35; max-width: 230px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ing-amount { white-space: nowrap; }
.ing-amount small { display: block; color: var(--pr-muted); font-size: 12px; white-space: normal; max-width: 150px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--pr-line); border-radius: 10px; overflow: hidden; background: var(--pr-surface); }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--pr-ink); font-size: 18px; }
.stepper button:hover { background: var(--pr-cream); }
.stepper output { min-width: 32px; text-align: center; font-variant-numeric: tabular-nums; }
.qty-unit { display: block; font-size: 12px; color: var(--pr-muted); margin-top: 3px; white-space: nowrap; }
.store-pick { position: relative; }
.store-pick select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 14.5px; color: var(--pr-ink);
  border: 1px solid var(--pr-line); border-radius: 10px; background: var(--pr-surface); padding: 8px 30px 8px 44px; min-width: 170px;
}
.store-pick img { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 22px; object-fit: contain; border-radius: 4px; pointer-events: none; }
.store-pick img[src*="lotuss"] { background: linear-gradient(90deg, rgb(0,174,167), rgb(20,121,117)); padding: 2px; }
.store-pick::after { content: '⌄'; position: absolute; right: 12px; top: 45%; transform: translateY(-50%); pointer-events: none; color: var(--pr-muted); }
.store-none { font-size: 13px; color: var(--pr-muted); max-width: 170px; }
.ing-price { text-align: right; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.ing-price small { display: block; font-weight: 400; font-size: 12px; color: var(--pr-muted); }
.ing-price s { font-weight: 400; color: var(--pr-muted); font-size: 12.5px; }
.del-btn { border: 0; background: none; color: var(--pr-muted); padding: 6px; border-radius: 8px; font-size: 17px; }
.del-btn:hover { color: var(--pr-red); background: var(--pr-red-soft); }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; gap: 12px; flex-wrap: wrap; }
.btn-danger { border: 1px solid var(--pr-red); color: var(--pr-red); background: var(--pr-surface); border-radius: 10px; padding: 8px 16px; font-family: var(--pr-head); }
.btn-danger:disabled { opacity: .4; cursor: default; }
.removed-note { font-size: 13.5px; color: var(--pr-muted); }
.removed-note button { border: 0; background: none; color: var(--pr-green); text-decoration: underline; padding: 0; }

.summary { padding: 20px; position: sticky; top: 84px; }
.summary h3, .stores-panel h3 { margin: 0 0 14px; font-size: 21px; display: flex; align-items: center; gap: 10px; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15.5px; }
.sum-row small { color: var(--pr-muted); }
.sum-store { display: flex; align-items: center; gap: 8px; font-size: 14.5px; padding: 4px 0; }
.sum-store img { width: 26px; height: 18px; object-fit: contain; }
.sum-store img[src*="lotuss"] { background: linear-gradient(90deg, rgb(0,174,167), rgb(20,121,117)); border-radius: 3px; padding: 2px; }
.sum-store b { margin-left: auto; font-variant-numeric: tabular-nums; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--pr-line); margin-top: 10px; padding-top: 14px; }
.sum-total span { font-family: var(--pr-head); font-size: 22px; font-weight: 600; }
.sum-total b { font-family: var(--pr-head); font-size: 34px; color: var(--pr-green); font-variant-numeric: tabular-nums; }
.summary .btn-primary { width: 100%; margin-top: 14px; padding: 14px; font-size: 19px; }
.sum-note { font-size: 13px; color: var(--pr-muted); text-align: center; margin: 10px 0 0; }
.serving-cost { margin-top: 8px; font-size: 14px; color: var(--pr-muted); text-align: right; }

.stores-panel { padding: 20px; margin-top: 18px; }
.store-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--pr-line); }
.store-row img { width: 52px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px; border: 1px solid var(--pr-line); }
.store-row img[src*="lotuss"] { background: linear-gradient(90deg, rgb(0,174,167), rgb(20,121,117)); }
.store-row div { flex: 1; }
.store-row b { display: block; font-family: var(--pr-head); font-weight: 500; }
.store-row small { color: var(--pr-muted); font-size: 13px; }
.badge { font-size: 12.5px; background: var(--pr-green-soft); color: var(--pr-green); border-radius: 999px; padding: 3px 10px; white-space: nowrap; font-family: var(--pr-head); }

.recipe-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 26px; }
.recipe-detail .panel { padding: 20px 22px; }
.recipe-detail h3 { margin: 0 0 12px; font-size: 21px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 12px; }
.steps li::before {
  content: counter(s); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--pr-green); color: #fff;
  display: grid; place-items: center; font-family: var(--pr-head); font-size: 14px; margin-top: 1px;
}
.tips { margin: 14px 0 0; padding: 12px 14px; background: var(--pr-amber-soft); color: var(--pr-amber-ink); border-radius: 10px; font-size: 14.5px; }
.tips ul { margin: 4px 0 0; padding-left: 18px; }
.cost-bars { display: flex; flex-direction: column; gap: 9px; }
.cost-bar { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; font-size: 14px; }
.cost-bar .track { height: 10px; background: var(--pr-cream); border-radius: 999px; overflow: hidden; }
.cost-bar .fill { height: 100%; background: var(--pr-green); border-radius: 999px; }
.cost-bar b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.analysis-facts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.analysis-facts div { flex: 1; min-width: 120px; background: var(--pr-cream); border-radius: 12px; padding: 10px 12px; }
.analysis-facts small { display: block; color: var(--pr-muted); font-size: 12.5px; }
.analysis-facts b { font-family: var(--pr-head); font-size: 22px; font-weight: 600; }
.credit { font-size: 12px; color: var(--pr-muted); margin-top: 14px; }
.credit a { color: inherit; }

/* Checkout dialog */
.checkout { width: min(560px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 22px; background: var(--pr-surface); color: var(--pr-ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); font-family: var(--pr-body); }
.checkout::backdrop { background: rgba(10, 20, 10, .45); }
.checkout h3 { margin: 0 0 4px; font-family: var(--pr-head); font-size: 22px; }
.checkout > p { margin: 0 0 14px; color: var(--pr-muted); font-size: 14px; }
.co-store { border: 1px solid var(--pr-line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.co-store header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.co-store header img { width: 60px; height: 22px; object-fit: contain; }
.co-store header img[src*="lotuss"] { background: linear-gradient(90deg, rgb(0,174,167), rgb(20,121,117)); border-radius: 4px; padding: 3px; }
.co-store header b { margin-left: auto; font-variant-numeric: tabular-nums; }
.co-store ul { list-style: none; margin: 0; padding: 0; }
.co-store li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--pr-line); font-size: 14px; }
.co-store li a { color: var(--pr-green); text-decoration: none; white-space: nowrap; font-weight: 600; }
.co-close { position: absolute; top: 12px; right: 12px; margin: 0; }
.co-close button { border: 0; background: var(--pr-cream); color: var(--pr-ink); width: 34px; height: 34px; border-radius: 50%; }

.loading-block { padding: 40px; text-align: center; color: var(--pr-muted); }
.notice-bar { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--pr-amber-soft); color: var(--pr-amber-ink); font-size: 14px; }

/* ---- Cost calculator ---- */
.calc-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; margin-top: 26px; align-items: start; }
.calc-main, .calc-side, .calc-section { padding: 20px 22px; }
.calc-side { position: sticky; top: 84px; }
.calc-section { margin-top: 24px; }
.calc-h { margin: 0 0 14px; font-size: 20px; }
.calc-controls { display: grid; grid-template-columns: 1fr 180px; gap: 14px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--pr-muted); font-family: var(--pr-head); }
.pr-page .field input, .pr-page .field select, .kv-input input, .price-edit {
  font: inherit; font-family: var(--pr-body); font-size: 16px; color: var(--pr-ink); background: var(--pr-surface);
  border: 1px solid var(--pr-line); border-radius: 10px; padding: 9px 12px; width: 100%;
}
.pr-page .field input:focus, .pr-page .field select:focus, .kv-input input:focus, .price-edit:focus { outline: 2px solid var(--pr-green-soft); border-color: var(--pr-green); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 16px; }
.cost-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cost-table th { text-align: left; font-family: var(--pr-head); font-weight: 500; font-size: 14px; background: var(--pr-cream); padding: 9px 10px; }
.cost-table td { padding: 8px 10px; border-bottom: 1px solid var(--pr-line); vertical-align: middle; }
.cost-table tfoot td { font-family: var(--pr-head); font-weight: 600; font-size: 16px; border-bottom: 0; padding-top: 12px; }
.cost-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-table .ing-prod { max-width: 260px; }
.price-edit { width: 96px; padding: 6px 8px; font-size: 15px; text-align: right; }
.origin img { width: 54px; height: 20px; object-fit: contain; vertical-align: middle; }
.origin img[src*="lotuss"] { background: linear-gradient(90deg, rgb(0,174,167), rgb(20,121,117)); border-radius: 4px; padding: 2px; }
.origin-est { font-size: 13px; color: var(--pr-muted); }
.calc-hint { font-size: 13px; color: var(--pr-muted); margin: 12px 0 0; }
.link-btn { border: 0; background: none; color: var(--pr-green); padding: 0; text-decoration: underline; font: inherit; }
.link-btn.strong { text-decoration: none; font-family: var(--pr-head); font-weight: 500; text-align: left; }
.link-btn.strong:hover { text-decoration: underline; }

.kv, .kv-input { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; font-size: 15px; }
.kv b { font-variant-numeric: tabular-nums; }
.kv-input span { display: inline-flex; align-items: center; gap: 6px; color: var(--pr-muted); font-size: 14px; }
.kv-input input { width: 92px; padding: 6px 8px; text-align: right; }
.kv.total { border-top: 1px solid var(--pr-line); margin-top: 6px; padding-top: 12px; font-family: var(--pr-head); font-size: 18px; }
.kv.total b { font-size: 22px; }
.target { background: var(--pr-cream); border-radius: 12px; padding: 12px 14px; margin: 14px 0; }
.target label { display: flex; justify-content: space-between; font-size: 14.5px; }
.target input[type="range"] { width: 100%; accent-color: var(--pr-green); margin: 8px 0; }
.suggest { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--pr-head); font-size: 16px; }
.suggest b { font-size: 28px; color: var(--pr-green); }
.target small { display: block; color: var(--pr-muted); font-size: 12.5px; margin-top: 4px; }
.price-in { font-family: var(--pr-head); font-size: 16px; }
.price-in input { width: 110px; font-size: 18px; font-weight: 600; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.result-grid div { background: var(--pr-green-soft); border-radius: 10px; padding: 8px 10px; }
.result-grid small { display: block; font-size: 12.5px; color: var(--pr-muted); }
.result-grid b { font-family: var(--pr-head); font-size: 19px; font-weight: 600; color: var(--pr-green); }
.pr-page .neg { color: var(--pr-red) !important; }

.be-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.be-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.be-card { background: var(--pr-cream); border-radius: 12px; padding: 12px 14px; }
.be-card small { display: block; color: var(--pr-muted); font-size: 13px; }
.be-card b { display: block; font-family: var(--pr-head); font-size: 24px; font-weight: 600; margin: 2px 0; }
.be-card span { font-size: 13px; color: var(--pr-muted); }
.be-card.good b { color: var(--pr-green); }
.be-card.bad b { color: var(--pr-red); }

.compare-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.compare-head small { color: var(--pr-muted); }
.table-scroll { overflow-x: auto; }
.compare-table tr.current td { background: var(--pr-green-soft); }
.share { display: inline-block; width: 70px; height: 8px; background: var(--pr-cream); border-radius: 999px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.share div { height: 100%; background: var(--pr-green); }
.compare-table small { color: var(--pr-muted); }

/* ---- น้องพร้าวหอม floating assistant (assets/dot.js) ---- */
.pdot {
  position: fixed; right: 24px; bottom: 24px; z-index: 70;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  font-family: var(--pr-body, 'Sarabun', system-ui, sans-serif); pointer-events: none;
}
.pdot > * { pointer-events: auto; }
.pdot.pd-left { align-items: flex-start; }
.pdot-mascot {
  width: 84px; height: 84px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none;
  filter: drop-shadow(0 6px 8px rgba(30, 70, 25, .28)); animation: pd-bob 3.2s ease-in-out infinite;
  margin-right: 6px; transition: transform .2s ease;
}
.pdot.pd-left .pdot-mascot { margin-right: 0; margin-left: 6px; }
.pdot-mascot:hover { transform: scale(1.06); }
.pdot-mascot:focus-visible { outline: 3px solid #9ad35d; outline-offset: 4px; border-radius: 50%; }
.pdot.dragging .pdot-mascot { cursor: grabbing; animation: none; transform: scale(1.1); }
.pdot-mascot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pdot-shadow {
  width: 54px; height: 10px; margin: -12px 21px 0 0; border-radius: 50%;
  background: radial-gradient(rgba(0, 0, 0, .28), transparent 70%); animation: pd-shadow 3.2s ease-in-out infinite;
}
.pdot.pd-left .pdot-shadow { margin: -12px 0 0 21px; }
.pd-eyes { transform-origin: 60px 58px; animation: pd-blink 4.6s infinite; }
.pd-leaves { transform-origin: 60px 30px; animation: pd-sway 3.2s ease-in-out infinite; }


.pdot-bar {
  display: flex; align-items: center; gap: 6px; width: min(460px, var(--pd-room, calc(100vw - 32px)), calc(100vw - 16px));
  background: #fff; border-radius: 999px; padding: 6px; box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
  border: 1px solid rgba(0, 0, 0, .06); animation: pd-pop .18s ease-out;
}
.pdot-bar[hidden] { display: none; }
.pdot-new { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; font-size: 24px; line-height: 1; color: #4a5548; cursor: pointer; }
.pdot-new:hover { background: #eef3e8; }
.pdot-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: #1f2a20; padding: 8px 4px; }
.pdot-bar input::placeholder { color: #9aa196; }
.pdot-send {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: #2f6b3a; color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.pdot-send:disabled { opacity: .5; cursor: default; }
.pdot-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.pdot-bubble {
  max-width: min(320px, var(--pd-room, calc(100vw - 32px)), calc(100vw - 16px)); background: #fff; color: #1f2a20; border-radius: 16px;
  padding: 10px 14px; font-size: 14.5px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  border: 1px solid rgba(0, 0, 0, .06); position: relative; margin-right: 6px; cursor: pointer;
  animation: pd-pop .2s ease-out; transition: opacity .4s ease;
}
.pdot-bubble::after {
  content: ''; position: absolute; bottom: -7px; right: 36px; width: 14px; height: 14px; background: #fff;
  transform: rotate(45deg); border-right: 1px solid rgba(0, 0, 0, .06); border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.pdot.pd-left .pdot-bubble { margin: 0 0 0 6px; }
.pdot.pd-left .pdot-bubble::after { right: auto; left: 36px; }
.pdot-bubble[hidden] { display: none; }
.pdot-bubble.fade { opacity: 0; }

/* Moods */
.pdot[data-mood="thinking"] .pdot-mascot { animation: pd-think 1s ease-in-out infinite; }
.pdot[data-mood="thinking"] .pd-eyes { animation: none; transform: translateY(-2px); }
.pdot[data-mood="happy"] .pdot-mascot { animation: pd-hop .6s ease-out 2; }
.pdot[data-mood="sad"] .pdot-mascot { animation: pd-shake .5s ease-in-out 1; }

@keyframes pd-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pd-shadow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.82); opacity: .7; } }
@keyframes pd-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes pd-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes pd-think { 0%, 100% { transform: rotate(-7deg) translateY(-2px); } 50% { transform: rotate(7deg) translateY(-6px); } }
@keyframes pd-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px) scale(1.04); } 70% { transform: translateY(0) scale(.97, 1.03); } }
@keyframes pd-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes pd-pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .pdot-mascot, .pdot-shadow, .pd-eyes, .pd-leaves { animation: none !important; }
}
@media (max-width: 560px) {
  .pdot { right: 14px; bottom: 14px; }
  .pdot-mascot { width: 70px; height: 70px; }
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-layout { grid-template-columns: 1fr; }
  .calc-side { position: static; }
  .be-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 860px) {
  .site-header-inner { gap: 12px; padding: 8px 16px; }
  .logo img { width: 36px; height: 36px; }
  .logo-text b { font-size: 20px; }
  .site-nav a { font-size: 14.5px; padding: 8px 8px; }
  .wrap, .hero-inner { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .hero-photo { inset: 0 0 0 30%; opacity: .45; }
  .hero-script { display: none; }
  .listing { grid-template-columns: 1fr; }
  .filters { position: static; }
  .recipe-detail { grid-template-columns: 1fr; }
  .dish-card { flex-direction: column; align-items: stretch; }
  .dish-card .recipe-photo { width: 100%; }
  .dish-actions { margin-top: 0; flex-direction: row; }
  /* Ingredient table becomes stacked cards */
  .ing-table thead { display: none; }
  .ing-table, .ing-table tbody, .ing-table tr, .ing-table td { display: block; width: 100%; }
  .ing-table tr { display: grid; grid-template-columns: 28px 64px 1fr auto; gap: 6px 10px; padding: 12px; border-bottom: 1px solid var(--pr-line); }
  .ing-table td { padding: 0; border: 0; }
  .ing-table td.c-check { grid-column: 1; grid-row: 1; }
  .ing-table td.c-img { grid-column: 2; grid-row: 1 / span 2; }
  .ing-table td.c-name { grid-column: 3; grid-row: 1; }
  .ing-table td.c-del { grid-column: 4; grid-row: 1; }
  .ing-table td.c-amount { grid-column: 3 / -1; grid-row: 2; }
  .ing-table td.c-qty { grid-column: 2 / 4; grid-row: 3; display: flex; align-items: center; gap: 10px; }
  .ing-table td.c-qty .qty-unit { margin: 0; }
  .ing-table td.c-price { grid-column: 4; grid-row: 3; align-self: center; }
  .ing-table td.c-store { grid-column: 2 / -1; grid-row: 4; }
  .store-pick select { width: 100%; }
}
@media (max-width: 560px) {
  .recipe-grid { grid-template-columns: 1fr; }
  .calc-controls, .be-grid, .be-results { grid-template-columns: 1fr; }
  .origin img { width: 34px; height: 16px; }
  .origin .badge { font-size: 11px; padding: 2px 6px; }
  .cost-table { font-size: 14px; }
  .cost-table th, .cost-table td { padding: 7px 6px; }
  .calc-main .cost-table .ing-prod { display: none; }
  .calc-main .cost-table .ing-name { font-size: 14.5px; }
  .price-edit { width: 68px; padding: 5px 6px; }
  .calc-main, .calc-side, .calc-section { padding: 16px 14px; }
  .site-nav { gap: 0; }
  .logo-text small { display: none; }
}
