/* MeowNavi design system - tokens from the approved design draft.
   Oatmeal / Sage / Terracotta / Ink. No emoji; icons are inline SVG (.ic). */
:root {
  --oat-50: #F9F8F6;
  --oat-100: #F1EDE3;
  --oat-200: #E5DFD1;
  --sage-400: #8DAE96;
  --sage-500: #5F8268;
  --sage-600: #4A6852;
  --terra-500: #D97A62;
  --ink: #2A2E2B;
  --radius: 24px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--oat-100);
  color: var(--ink);
  font-family: "IBM Plex Sans Thai", sans-serif;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: "Noto Serif Thai", serif; line-height: 1.3; margin: 0 0 .5em; overflow-wrap: break-word; }
a { color: var(--sage-600); text-decoration: none; }
a:hover { text-decoration: underline; }
.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }

/* Header */
.site-head {
  max-width: 72rem; margin: 0 auto; padding: 1.1rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--sage-600); }
.brand:hover { text-decoration: none; }
.brand .ic { width: 1.7rem; height: 1.7rem; color: var(--terra-500); }
.brand-name { font-family: "Noto Serif Thai", serif; font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand-accent { color: var(--terra-500); }
.site-nav { display: flex; gap: 1.4rem; font-size: .9rem; font-weight: 500; }
.site-nav a { color: rgba(42,46,43,.7); }
.site-nav a.on, .site-nav a:hover { color: var(--sage-500); text-decoration: none; }

/* Layout */
main { max-width: 72rem; margin: 0 auto; padding: 0 1rem 4rem; }
.hero { text-align: center; padding: 3rem 0 2rem; display: flex; flex-direction: column; align-items: center; }
.hero .kicker {
  display: inline-block; padding: .35rem 1rem; border-radius: 999px;
  background: rgba(95,130,104,.1); color: var(--sage-600);
  font-weight: 600; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 1.4rem;
}
.hero h1 { font-size: clamp(1.9rem, 5vw, 3.4rem); font-weight: 700; max-width: 46rem; }
.hero p { color: rgba(42,46,43,.6); font-size: 1.05rem; max-width: 34rem; margin: 0 auto 2.2rem; }

/* Search */
.search-wrap { position: relative; width: 100%; max-width: 40rem; }
.search-wrap input {
  width: 100%; background: #fff; border: 1px solid transparent; outline: none;
  padding: 1.1rem 6.4rem 1.1rem 3.4rem; border-radius: 999px; font-size: 1.05rem;
  font-family: inherit; box-shadow: 0 2px 10px rgba(0,0,0,.04); transition: border .15s, box-shadow .15s;
}
.search-wrap input:focus { border-color: var(--sage-400); box-shadow: 0 0 0 4px rgba(95,130,104,.15); }
.search-wrap > .ic { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); width: 1.3rem; height: 1.3rem; opacity: .45; }
.search-results {
  position: absolute; top: calc(100% + .5rem); left: 0; right: 0; background: #fff;
  border-radius: 18px; box-shadow: 0 10px 34px rgba(0,0,0,.1); text-align: left;
  max-height: 19rem; overflow-y: auto; z-index: 30; display: none;
}
.search-results.open { display: block; }
.search-results a { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--oat-100); color: var(--ink); }
.search-results a:hover { background: var(--oat-50); text-decoration: none; }
.search-results .sr-type { color: rgba(42,46,43,.45); font-size: .78rem; white-space: nowrap; }

/* Pills */
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1.8rem; }
.pills a {
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(255,255,255,.65); border: 1px solid rgba(0,0,0,.05);
  padding: .55rem 1.1rem; border-radius: 999px; font-size: .88rem; font-weight: 500; color: var(--ink);
}
.pills a:hover { background: #fff; text-decoration: none; }
.pills .ic { color: var(--sage-500); }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.4rem; margin-top: 2rem; }
.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.03); padding: 1.6rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.span8 { grid-column: span 8; }
.span4 { grid-column: span 4; }
.span12 { grid-column: span 12; }
@media (max-width: 760px) { .span8, .span4 { grid-column: span 12; } }

.card-tool {
  background: linear-gradient(135deg, var(--sage-500), var(--sage-600)); color: #fff;
  display: flex; flex-direction: column; justify-content: center;
}
.card-tool h2 { color: #fff; font-size: 1.7rem; }
.card-tool p { color: rgba(255,255,255,.88); font-size: .95rem; }
.card-tool .kicker { color: rgba(255,255,255,.75); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.card-tool a.btn { background: var(--terra-500); color: #fff; align-self: flex-start; }
.card-tool a.btn:hover { filter: brightness(1.05); }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: 14px; font-weight: 600; font-size: .92rem;
  background: var(--oat-100); color: var(--sage-600);
}
.btn:hover { background: var(--oat-200); text-decoration: none; }

/* Section head */
.sec-head { grid-column: span 12; display: flex; justify-content: space-between; align-items: end; margin-top: 1.6rem; padding: 0 .2rem; }
.sec-head h2 { font-size: 1.45rem; margin: 0; }
.sec-head p { color: rgba(42,46,43,.6); font-size: .85rem; margin: .2rem 0 0; }
.sec-head a { font-size: .88rem; font-weight: 500; white-space: nowrap; }

/* Place cards */
.place-card { display: flex; flex-direction: column; justify-content: space-between; }
.pc-top { display: flex; justify-content: space-between; align-items: start; margin-bottom: .9rem; }
.pc-icon {
  width: 3rem; height: 3rem; border-radius: 999px; background: rgba(95,130,104,.12);
  display: flex; align-items: center; justify-content: center; color: var(--sage-600);
}
.pc-icon .ic { width: 1.4rem; height: 1.4rem; }
.badge { font-size: .64rem; font-weight: 700; padding: .25rem .5rem; border-radius: 8px; }
.badge-24 { background: #fde8e8; color: #b53030; }
.badge-open { background: #e5f2e8; color: #2c6b3f; }
.badge-review { background: #fdf3e0; color: #9a6b1a; }
.place-card h3 { font-size: 1.12rem; margin-bottom: .15rem; font-weight: 700; }
.pc-area { font-size: .85rem; color: rgba(42,46,43,.5); margin: 0 0 .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.chips span { background: var(--oat-100); color: rgba(42,46,43,.7); font-size: .74rem; font-weight: 500; padding: .28rem .6rem; border-radius: 8px; }
.place-card .btn { justify-content: center; width: 100%; font-size: .88rem; padding: .6rem; background: var(--oat-50); }
.place-card .btn:hover { background: var(--oat-100); }

/* Detail page */
.detail { max-width: 46rem; margin: 2rem auto 0; }
.crumbs { font-size: .82rem; color: rgba(42,46,43,.55); margin: 1.2rem 0; }
.crumbs a { color: rgba(42,46,43,.55); }
.detail h1 { font-size: 1.9rem; }
.answer-block {
  background: #fff; border-left: 4px solid var(--sage-500); border-radius: 0 18px 18px 0;
  padding: 1.1rem 1.4rem; margin: 1.2rem 0 1.8rem; font-size: 1.02rem;
}
.fact-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; border-radius: 18px; overflow: hidden; font-size: .95rem; }
.fact-table th, .fact-table td { text-align: left; padding: .8rem 1.1rem; border-bottom: 1px solid var(--oat-100); vertical-align: top; word-break: break-word; }
.fact-table a { word-break: break-all; }
.fact-table th { width: 34%; color: rgba(42,46,43,.55); font-weight: 500; }
.verified { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--sage-600); font-weight: 500; }
.sources { font-size: .82rem; color: rgba(42,46,43,.55); margin-top: 1.6rem; }
.sources a { word-break: break-all; }

/* Toxicity tool */
.tox-result { border-radius: 18px; padding: 1.1rem 1.4rem; margin: 1rem 0; display: none; }
.tox-result.open { display: block; }
.tox-toxic { background: #fde8e8; }
.tox-safe { background: #e5f2e8; }
.tox-table-wrap { overflow-x: auto; margin-top: 1.6rem; }
.tox-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 18px; overflow: hidden; font-size: .9rem; }
.tox-table th, .tox-table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--oat-100); }
.tox-table thead th { background: var(--oat-50); font-weight: 600; font-size: .8rem; }
.tag-toxic { color: #b53030; font-weight: 600; }
.tag-mild { color: #9a6b1a; font-weight: 600; }
.tag-safe { color: #2c6b3f; font-weight: 600; }
.disclaimer { font-size: .8rem; color: rgba(42,46,43,.5); margin-top: 1.4rem; }

/* Footer */
.site-foot { border-top: 1px solid rgba(0,0,0,.05); background: var(--oat-50); margin-top: 3rem; }
.foot-inner {
  max-width: 72rem; margin: 0 auto; padding: 2.2rem 1.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-size: .84rem; color: rgba(42,46,43,.5);
}
.foot-inner nav { display: flex; gap: 1.2rem; }
.foot-inner a { color: rgba(42,46,43,.55); }
