/* Babytabi v2 (/next) · สี/ขนาดจาก next-tokens.css (DESIGN.md) · layout 3 แบบ: compact · tall · regular (DESIGN.md §Layout) */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } /* iOS ขยายตัวอักษรเองหลังกาง→พับ (Por 26/10 ลิงก์ล่างตัวโต) */
body { background: var(--c-paper); color: var(--c-ink); font: 500 var(--t-md)/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: var(--c-matcha-ink); }
[lang="ja"] { font-family: var(--f-ja); }
:focus-visible { outline: 3px solid var(--c-sakura-ink); outline-offset: 2px; }

/* ---------- layout: compact (แผนที่บน · แผงคุยล่าง) */
.nx { position: fixed; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; grid-template-columns: minmax(0, 1fr); }
.map { grid-row: 1; grid-column: 1; position: relative; min-height: 0; }
.talk { grid-row: 2; grid-column: 1; max-height: calc(var(--l-panel-max-compact) - 4svh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--c-paper); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -8px 24px var(--c-scrim);
  padding: var(--s-4) max(var(--s-4), env(safe-area-inset-right, 0px)) var(--s-3) max(var(--s-4), env(safe-area-inset-left, 0px));
  display: grid; gap: var(--s-3); align-content: start; position: relative; z-index: 2; margin-top: -20px; }
.legal { grid-row: 3; grid-column: 1; background: var(--c-paper); color: var(--c-ink-2); font-size: var(--t-xs); text-align: center;
  padding: var(--s-1) var(--s-4) max(var(--s-2), env(safe-area-inset-bottom, 0px)); position: relative; z-index: 2; }
.legal a { color: var(--c-ink-2); }
.nx.going .talk, .nx.going .legal, .nx.going .bar { display: none; }
.nx:not([data-view="home"]) .legal { display: none; } /* ลิงก์กฎหมายเฉพาะหน้าแรก ไม่ทับปุ่มหลัก (รีวิวภาพ ปัญหา 1) */

/* tall: กว้าง 600–899 และสูง ≥ 800 (Duo จอในแนวตั้ง) · ขอบบนแผง ≥ 530px · ไม่มีปุ่มใน y 420–530 */
@media (min-width: 600px) and (max-width: 899px) and (min-height: 800px) {
  .nx { grid-template-rows: minmax(550px, 1fr) auto auto; }
  .talk { max-height: calc(100svh - 550px - 32px); }
}
/* ---------- บนแผนที่ */
.glass { background: var(--c-glass); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 18px var(--c-scrim); }
.bar { position: absolute; z-index: 3; top: max(var(--s-3), env(safe-area-inset-top, 0px)); left: max(var(--s-3), env(safe-area-inset-left, 0px));
  right: max(var(--s-3), env(safe-area-inset-right, 0px)); display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 6px; padding: 6px 14px 6px; border-radius: var(--r-pill); text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.brand .kana { font: 700 12px/1 var(--f-brand); color: var(--c-ink-2); letter-spacing: .04em; }
.kid { border: 0; border-radius: var(--r-pill); min-height: var(--l-tap); padding: 0 var(--s-4); font-size: var(--t-sm); cursor: pointer; }
.maplibregl-ctrl-bottom-left { bottom: 22px; left: calc(env(safe-area-inset-left, 0px) + 64px); } /* ข้างขวาดังโงะที่ยืนบนขอบแผง ชิดขอบแผง (Por 26/10: เดิมลอยสูงเกิน) */
@media (min-width: 600px) and (max-width: 899px) and (min-height: 800px) { .maplibregl-ctrl-bottom-left { bottom: auto; top: 360px; left: 0; } } /* ตายตัวเหนือแถบพับ y 420–530 ไม่ว่าแผงจะสูงเท่าไร */
@media (min-width: 900px) { .maplibregl-ctrl-bottom-left { bottom: 4px; left: 0; } }
.me { width: 18px; height: 18px; border-radius: 50%; background: var(--c-me); border: 3px solid #fff; box-shadow: 0 0 0 8px color-mix(in srgb, var(--c-me) 25%, transparent); }
.dest { width: 64px; pointer-events: none; transform-origin: 50% 100%; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.dest img { width: 100%; display: block; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .25)); }
.dest b { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); white-space: nowrap; background: var(--c-card); color: var(--c-sakura-ink);
  font-size: var(--t-sm); padding: 1px 10px; border-radius: var(--r-pill); box-shadow: 0 2px 6px var(--c-scrim); }
.banner { position: absolute; z-index: 4; left: 50%; top: 72px; transform: translateX(-50%); background: var(--c-card); padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); box-shadow: 0 4px 14px var(--c-scrim); font-size: var(--t-sm); }

/* ---------- แคปซูลตอนพาไป */
.capsule[hidden] { display: none; }
.capsule { position: absolute; z-index: 3; top: max(var(--s-3), env(safe-area-inset-top, 0px)); left: max(var(--s-3), env(safe-area-inset-left, 0px));
  right: max(var(--s-3), env(safe-area-inset-right, 0px)); border-radius: var(--r-lg); padding: var(--s-3); display: grid; gap: var(--s-2);
  animation: drop .28s ease-out; }
.cap-top { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--s-3); align-items: center; }
.cap-top img { width: 52px; }
.cap-name { font-size: var(--t-sm); color: var(--c-ink-2); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-dist { font-size: var(--t-xl); font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cap-dist small { font-size: var(--t-sm); font-weight: 500; color: var(--c-ink-2); }
.cap-note { font-size: var(--t-sm); color: var(--c-ink-2); }
.cap-acts { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ---------- แผงคุย */
/* ดังโงะคนพูดยืนบนขอบแผง ครึ่งตัวล้นขึ้นแผนที่ (Por 26/10 แนวทาง ก) · อยู่ช่องเดียวกับ .talk แต่ไม่อยู่ในนั้น จึงไม่โดน overflow ตัด
   กล่อง 86px คงที่ + object-fit ให้ไม้เสียบอยู่กลางกล่องทุกท่า · ฟองคำพูดเว้นซ้าย 48px ให้ตัวล่างของดังโงะ */
.perch { grid-row: 2; grid-column: 1; align-self: start; justify-self: start; position: relative; z-index: 3; pointer-events: none;
  width: 86px; height: 84px; object-fit: contain; object-position: 50% 100%; margin: -62px 0 0 calc(max(var(--s-4), env(safe-area-inset-left, 0px)) - 23px);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .22)); transform-origin: 50% 100%; }
.perch[hidden], .nx.going .perch { display: none; }
.say { margin-left: 48px; animation: rise .22s ease-out; }
.say .spk { display: none; }
.talk.perched > .topnav { margin-left: 48px; } /* ปุ่มบนสุด (ถามใหม่/กลับ) ไม่ให้ดังโงะบนขอบทับ */
.bub { background: var(--c-sakura-soft); border-radius: 6px var(--r-md) var(--r-md) var(--r-md); padding: var(--s-2) var(--s-3); min-width: 0; position: relative; } /* ฟองสีชมพู = ดังโงะพูด · มุมแหลมชี้ไปทางดังโงะ */
.bub p { margin: 0; }
.bub .hint { color: var(--c-ink-2); font-size: var(--t-sm); margin-top: 2px; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.choice { border: 0; background: var(--c-card); box-shadow: inset 0 0 0 1px var(--c-line); border-radius: var(--r-md); min-height: 64px; padding: var(--s-2) var(--s-1);
  display: grid; justify-items: center; align-content: center; gap: 2px; font-size: var(--t-sm); cursor: pointer; }
.choice img { width: 28px; height: 28px; object-fit: contain; }
.choice.c-diaper { background: var(--c-sakura-soft); box-shadow: none; }
.choice.c-visit { background: var(--c-matcha-soft); box-shadow: none; }
.choice.c-eat { background: var(--c-neutral-soft); box-shadow: none; } /* ขาวบนขาวหายตอนเบลอ → เทาอุ่นอ่อน */
.choice[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--c-primary); font-weight: 600; } /* ปุ่มทึบสงวนไว้ให้ "พาไปเลย" ปุ่มเดียว */

.ans { background: var(--c-card); border-radius: var(--r-md); padding: var(--s-3); display: grid; gap: var(--s-1); box-shadow: 0 1px 2px var(--c-scrim), 0 4px 14px var(--c-scrim); animation: rise .22s ease-out; position: relative; }
.ans.presented { margin-top: 24px; }
.presenter { position: absolute; right: 4px; top: -36px; height: 100px; width: auto; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .2)); transform-origin: 50% 100%; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.ans.presented .lead, .ans.presented .name, .ans.presented .ja, .ans.presented .hint { padding-right: 60px; }
.ja { color: var(--c-ink-2); font-size: var(--t-sm); line-height: 1.35; }
.nw { white-space: nowrap; }
.name.sm { font-size: var(--t-md); font-weight: 600; }
.lead .count { margin-left: var(--s-2); }
.src { font-size: var(--t-xs); color: var(--c-ink-2); }
.src.old { color: var(--c-warn-ink); }
.topnav { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.walkpane { display: grid; gap: var(--s-1); justify-items: start; animation: rise .22s ease-out; }
.walker { height: 150px; width: auto; justify-self: center; margin-bottom: var(--s-3); }
@media (max-width: 899px) { .walkpane { display: none; } } /* จอแคบใช้แคปซูลอย่างเดียว */
/* เครดิตแผนที่ตามธีม (ไม่ขาวจ้าในโหมดมืด) */
.maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib.maplibregl-compact { background: var(--c-glass); color: var(--c-ink-2); }
.maplibregl-ctrl-attrib a { color: var(--c-ink-2); }
:root[data-theme="dark"] .maplibregl-ctrl-attrib-button { filter: invert(1); }
/* โลโก้สองสีตามธีมของปุ่ม (SVG ใน <img> ตามธีมระบบเอง คุมไม่ได้) */
.wm-d { display: none !important; }
:root[data-theme="dark"] .wm-l { display: none !important; }
:root[data-theme="dark"] .wm-d { display: block !important; }
.theme { border: 0; background: none; color: var(--c-ink-2); padding: 0 var(--s-2); min-height: var(--l-tap); vertical-align: middle; cursor: pointer; }
.theme svg { width: 18px; height: 18px; vertical-align: -4px; }
.ans.presented .src { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ans .lead { color: var(--c-ink-2); font-size: var(--t-sm); }
.ans .name { font-size: var(--t-lg); font-weight: 600; line-height: 1.3; }
.ans .sub { color: var(--c-ink-2); font-size: var(--t-sm); }
.dist { font-size: var(--t-num); font-weight: 600; line-height: 1.05; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.dist small { font-size: var(--t-md); font-weight: 500; color: var(--c-ink-2); }
.where { color: var(--c-ink-2); font-size: var(--t-sm); margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.fact { background: var(--c-matcha-soft); color: var(--c-matcha-ink); border-radius: var(--r-sm); padding: 1px 10px; font-size: var(--t-sm); }
.fact.free { background: var(--c-matcha-soft); font-weight: 600; }
.fact.warn { background: var(--c-warn-soft); color: var(--c-warn-ink); font-weight: 600; }
.acts { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--l-tap); padding: 0 var(--s-4);
  border-radius: var(--r-pill); border: 1.5px solid var(--c-line); background: var(--c-card); color: var(--c-ink); font-size: var(--t-md); text-decoration: none; cursor: pointer; }
.btn.go { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); font-weight: 600; }
.cap-acts .btn { padding: 0 var(--s-3); font-size: var(--t-sm); } /* ≥ 44px เท่ากันทุกปุ่ม */
.link { border: 0; background: none; color: var(--c-matcha-ink); text-decoration: underline; padding: 0; cursor: pointer; font-size: var(--t-sm); min-height: var(--l-tap); }
.count { color: var(--c-ink-2); font-size: var(--t-sm); margin-left: auto; }

/* การ์ดสถานที่ */
.qa { list-style: none; margin: var(--s-1) 0 0; padding: 0; display: grid; gap: 0; }
.qa li { display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr); gap: 0 var(--s-2); padding: var(--s-2) 0; border-top: 1px solid var(--c-line); }
.qa .q { color: var(--c-ink-2); font-size: var(--t-sm); }
.qa .v { font-weight: 600; }
.qa .src, .qa .alt { grid-column: 2; font-size: var(--t-xs); color: var(--c-ink-2); }
.qa .alt, .qa .old { color: var(--c-warn-ink); }
.qa .v-yes .v, .qa .v-limited .v { color: var(--c-matcha-ink); }
.qa .v-none .v { color: var(--c-ink-2); font-weight: 500; }
.qa .v-step .v, .qa .v-paid .v, .qa .v-room_no .v { color: var(--c-warn-ink); font-weight: 500; }
.prices { margin: 0; padding-left: 1.2em; font-size: var(--t-sm); }
details { font-size: var(--t-sm); }

/* ฟอร์มลูก */
.kidform { display: grid; grid-template-columns: auto minmax(0, 7em); gap: var(--s-2) var(--s-3); align-items: center; }
.kidform input { font: inherit; min-height: var(--l-tap); padding: 0 var(--s-3); border: 1.5px solid var(--c-line); border-radius: var(--r-sm); background: var(--c-card); color: var(--c-ink); }
.kidform .acts { grid-column: 1 / -1; margin-top: 0; }

/* ---------- การเคลื่อนไหว 3 จุด: แผงคุยขึ้น · คำตอบปรากฏ · แคปซูลลง (DESIGN.md) */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- PWA เต็มจอ (black-translucent): แผนที่ขึ้นถึงขอบบน (Por 26/10 · แบบแอป nas-hub/agentic-os)
   วัดบน Duo (26/10): จอ 678 แต่หน้าเว็บได้ 657 · safe-area บน 0 → iOS เลื่อนหน้าขึ้น 21pt (เผื่อแถบสถานะบนที่ Duo ไม่มี) แล้วเหลือแถบล่าง 21pt
   ที่เนื้อหาวาดไม่ได้ (สีพื้นแถบ = สีพื้น html) · 100lvh ไม่ช่วย (ถูกตัดที่ 657) · แอปอื่นของ Por พื้นมืดเลยไม่เห็น */
html { background: var(--c-paper); }

/* ---------- หน้าเอกสารในแอป (ความเป็นส่วนตัว/ข้อตกลง/แหล่งข้อมูล · Por 26/10) · เนื้อหาใช้คลาสจาก next-legal.css */
.doc-tabs { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.doc-tabs button { border: 0; font: inherit; font-size: var(--t-sm); min-height: var(--l-tap); padding: 0 var(--s-3); border-radius: var(--r-pill);
  background: var(--c-neutral-soft); color: var(--c-ink-2); cursor: pointer; }
.doc-tabs button[aria-current="page"] { background: var(--c-sakura-soft); color: var(--c-sakura-ink); font-weight: 600; }
.doc .lg-main { max-width: none; padding: 0; }
/* จอแคบ/พับ: แผงขยายเต็มจอทับแผนที่ · จอกว้างอยู่ในแผงขวาตามเดิม */
@media (max-width: 899px) {
  .nx[data-view="doc"] .talk { grid-row: 1 / span 2; max-height: none; margin-top: 0; border-radius: 0; box-shadow: none; z-index: 5;
    padding-top: max(var(--s-3), env(safe-area-inset-top, 0px)); }
  .nx[data-view="doc"] .bar { display: none; }
}

/* ---------- ต้องอยู่ท้ายไฟล์ให้ชนะกฎพื้นฐานข้างบน */
/* regular: กว้าง ≥ 900 (Duo จอในแนวนอน) · แผนที่ซ้าย | แถบพับ | คุยขวา */
@media (min-width: 900px) {
  .nx { grid-template-columns: minmax(0, 1fr) var(--l-fold-gap) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; background: var(--c-paper); }
  .map { grid-row: 1 / span 2; grid-column: 1; }
  .talk { grid-row: 1; grid-column: 3; max-height: none; margin-top: 0; border-radius: 0; box-shadow: none; padding-top: max(var(--s-6), env(safe-area-inset-top, 0px)); }
  .legal { grid-row: 2; grid-column: 3; }
  .nx.going .talk { display: grid; }
  .nx.going .legal { display: block; }
  .bar, .capsule { right: calc(50% + var(--l-fold-gap) / 2 + var(--s-3)); }
  /* จอกว้าง: ไม่มีขอบแผงให้ยืน → ดังโงะอยู่ในแผงเหนือฟองคำพูด ตัวเดียว (หน้าแรก = ตัวขยับตัวใหญ่) */
  .perch { display: none; }
  .talk.perched > .topnav { margin-left: 0; }
  .say { margin-left: 0; display: grid; justify-items: center; gap: var(--s-3); }
  /* ทุกสถานะใช้กรอบเดียวกัน ยืนบนเส้นเดียวกัน → เปลี่ยนแค่ท่ากับข้อความ ฟอง/ปุ่มไม่กระโดด (Por 27/10) */
  .say .spk, .say .spk.idle { display: block; height: 220px; width: auto; max-width: 55%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .18)); }
  .bub { justify-self: stretch; border-radius: var(--r-md); }
  .bub::before { content: ""; position: absolute; top: -9px; left: 50%; margin-left: -9px; border: 9px solid transparent; border-top: 0; border-bottom-color: var(--c-sakura-soft); }
}

/* ---------- ชุมชน (docs/community-design.md · mockup board) */
.trust { display: flex; align-items: center; gap: var(--s-2); background: var(--c-matcha-soft); border-radius: var(--r-sm); padding: 6px 10px; margin: 2px 0; }
/* วงแต้ม = ลูกดังโงะไม่มีหน้า + มือชูนิ้วโป้ง (ภาพ trust-* · Por 27/10) · มือยื่นเลยกรอบขวา 0.25 เท่า · เลขสีเข้มคงที่ (ลูกสีเดิมทั้งสองธีม) */
.trust b { position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none; font-size: 15.5px; color: #2B2522; }
.trust b img { position: absolute; left: 0; top: 0; width: 125%; height: 100%; max-width: none; }
.trust b i { position: relative; font-style: normal; font-weight: 600; } /* เท่า iOS semibold · b ปกติหนา 700 ล้นลูก */
.trust span { display: grid; line-height: 1.3; }
.trust strong { color: var(--c-matcha-ink); font-size: var(--t-sm); }
.trust small { color: var(--c-ink-2); font-size: var(--t-xs); }
.trust.t-check { background: var(--c-warn-soft); }
.trust.t-check b { color: #6B4508; }
.trust.t-check strong { color: var(--c-warn-ink); }
.trust.t-unsure { background: var(--c-neutral-soft); }
.trust.t-unsure b { color: #6B5F58; }
.trust.t-unsure strong { color: var(--c-ink-2); }
.trust.sm { display: inline-flex; gap: 10px; padding: 0 10px 0 0; margin: 0; border-radius: var(--r-pill); vertical-align: middle; white-space: nowrap; }
.trust.sm b { width: 22px; height: 22px; font-size: 8.5px; } /* เว้นที่ในลูก ไม่คับ (Por 27/10) */
.raterow { display: flex; align-items: center; gap: var(--s-2); justify-content: space-between; border-top: 1px solid var(--c-line); padding-top: var(--s-2); margin-top: var(--s-1); }
.raterow[hidden] { display: none; }
.raterow .q { color: var(--c-ink-2); font-size: var(--t-sm); }
.thumbs { display: inline-flex; gap: var(--s-2); align-items: center; flex: none; }
.thumbs.ro { color: var(--c-ink-2); font-size: var(--t-sm); gap: 4px; }
.th { border: 0; font: inherit; font-size: var(--t-sm); display: inline-flex; align-items: center; gap: 6px; min-height: var(--l-tap); padding: 0 12px; border-radius: var(--r-pill); cursor: pointer; }
.th.up { background: var(--c-matcha-soft); color: var(--c-matcha-ink); }
.th.down { background: var(--c-neutral-soft); color: var(--c-ink-2); }
.th[aria-pressed="true"] { box-shadow: inset 0 0 0 2px currentColor; font-weight: 600; }
.ic { display: inline-flex; }
.ic svg { width: 18px; height: 18px; }
.thumbs.ro .ic svg { width: 15px; height: 15px; }
.qa .rowth { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: var(--s-2); margin-top: 4px; }
.badge { display: inline-block; background: var(--c-warn-soft); color: var(--c-warn-ink); border-radius: var(--r-pill); padding: 0 8px; font-size: var(--t-xs); font-weight: 600; }
.fact.badge { padding: 2px 10px; }
.comm { display: grid; gap: var(--s-2); border-top: 1px solid var(--c-line); padding-top: var(--s-2); margin-top: var(--s-1); }
.props { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.props li { display: grid; gap: 2px; border-top: 1px dashed var(--c-line); padding-top: var(--s-2); }
.row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.row small { color: var(--c-ink-2); font-size: var(--t-xs); }
.bub.reason { margin: 0 0 var(--s-2); }
.link.sm { font-size: var(--t-xs); min-height: var(--l-tap); color: var(--c-ink-2); }
.form { display: grid; gap: var(--s-2); }
.form .lbl { font-weight: 600; font-size: var(--t-sm); margin-top: var(--s-1); }
.form .must { color: var(--c-sakura-ink); font-weight: 500; }
.form .opt { color: var(--c-ink-2); font-weight: 500; }
.form textarea, .form input[type="text"], .form select { font: inherit; font-size: 16px; border: 1.5px solid var(--c-line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--c-card); color: var(--c-ink); min-height: var(--l-tap); resize: vertical; }
.form textarea:focus, .form input:focus, .form select:focus { outline: 3px solid var(--c-sakura-ink); outline-offset: 1px; }
.form .meta { display: flex; justify-content: space-between; gap: var(--s-2); color: var(--c-ink-2); font-size: var(--t-xs); }
.form .name { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { border: 0; font: inherit; font-size: var(--t-sm); min-height: var(--l-tap); padding: 0 14px; border-radius: var(--r-pill); background: var(--c-neutral-soft); color: var(--c-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--c-sakura-soft); color: var(--c-sakura-ink); box-shadow: inset 0 0 0 2px var(--c-sakura-ink); }
.chip input { width: 18px; height: 18px; accent-color: var(--c-primary); margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.selrow { display: grid; gap: 4px; font-size: var(--t-sm); color: var(--c-ink-2); }
.check { display: flex; align-items: center; gap: var(--s-2); min-height: var(--l-tap); font-size: var(--t-sm); }
.check input { width: 20px; height: 20px; accent-color: var(--c-primary); }
.hint.err { color: var(--c-sakura-ink); }
.addplace { justify-self: start; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--c-ink); color: var(--c-paper);
  padding: 10px 18px; border-radius: var(--r-pill); font-size: var(--t-sm); box-shadow: 0 6px 18px var(--c-scrim); animation: rise .2s ease-out; max-width: 90vw; }
.toast[hidden] { display: none; }


/* ---------- รีวิว oil-ui-pro 26/10 (UX walk + visual) */
.hint { font-size: var(--t-xs); color: var(--c-ink-2); margin: 0; }
.btn:disabled, .btn.go:disabled { background: var(--c-line); border-color: var(--c-line); color: var(--c-ink-2); font-weight: 500; cursor: default; }
.talk.quiet, .talk.quiet * { animation: none !important; } /* โหวต/กลับจากฟอร์ม = วาดใหม่เงียบๆ ไม่เล่นท่าเข้า */
.ans .name.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.alert { margin: 2px 0; background: var(--c-warn-soft); color: var(--c-warn-ink); border-radius: var(--r-sm); padding: 6px 10px; font-size: var(--t-sm); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cap-alert { font-size: var(--t-xs); color: var(--c-warn-ink); background: var(--c-warn-soft); border-radius: var(--r-sm); padding: 4px 8px; }
.cap-gate { justify-self: start; font-size: var(--t-xs); font-weight: 600; color: var(--c-warn-ink); background: var(--c-warn-soft); border-radius: var(--r-pill); padding: 2px 10px; }
.cap-way { font-size: var(--t-sm); color: var(--c-ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* การ์ดสถานที่: 1 ข้อมูล = ชื่อ · ค่า · ปุ่มโหวต บรรทัดเดียว · ที่มา/เตือน/ข้อเสนอ อยู่ใต้ค่า */
.qa li { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto; align-items: center; }
.qa .rowth { grid-column: 3; grid-row: 1; margin-top: 0; }
.qa .src, .qa .alt, .qa .warnline, .qa .props, .qa .alert { grid-column: 2 / -1; }
.qa .warnline { font-size: var(--t-xs); color: var(--c-warn-ink); }
.qa .props { margin-top: 4px; }
.props li { grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--c-line); padding: 6px 0 0; gap: 2px var(--s-2); }
.props .pv { font-size: var(--t-sm); }
.props small { color: var(--c-ink-2); font-size: var(--t-xs); }
.qa li.qwhere .v { font-weight: 500; font-size: var(--t-sm); line-height: 1.5; }
.form .changed { border-color: var(--c-primary) !important; box-shadow: inset 0 0 0 1px var(--c-primary); }
.form .chg { font-size: var(--t-xs); color: var(--c-matcha-ink); margin-top: -4px; }
.form textarea { field-sizing: content; min-height: 4.5em; max-height: 9em; }
.form .acts .btn.go { flex: 1; }
/* หมุดดังโงะกลางแผนที่ตอนเพิ่มสถานที่ (ตามหมวดที่เลือก) */
.centerpin { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -100%); pointer-events: none; display: grid; justify-items: center; }
.centerpin img { width: 40px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.centerpin .stem { width: 3px; height: 14px; background: var(--c-sakura-ink); border-radius: 2px; margin-top: -2px; }

/* ---------------------------------------------------------------- การ์ดสถานที่ ข3 "จุดดังโงะ" (DESIGN.md · Por 26/10 · รีวิว r1) */
.ans.place3 { background: none; box-shadow: none; padding: 0; gap: var(--s-2); }
/* หัว: ชื่อเป็นชั้นสอง (ประโยคนำคือพระเอก) · ปุ่มออกวงเดียวขวาบน ไม่กินบรรทัด */
.phead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); align-items: start; }
/* รูปสถานที่ (Wikimedia Commons · Por 27/10): จอแคบ = รูปเล็ก 68 ข้างชื่อ · จอกว้าง = รูปเต็มกว้าง 16:9 เหนือชื่อ เครดิตทับมุมล่าง · แตะ = modal */
.phead.hasthumb { grid-template-columns: minmax(0, 1fr) auto auto; }
.pthumb, .phero { border: 0; padding: 0; background: var(--c-neutral-soft); cursor: zoom-in; overflow: hidden; }
.pthumb { width: 68px; height: 68px; border-radius: 14px; }
.pthumb img, .phero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phero { display: none; position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-md); }
.phero .pcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 6px; font-size: var(--t-xs); line-height: 1.3; color: #fff; text-align: right;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
@media (min-width: 900px) { .phero { display: block; } .pthumb { display: none; } .phead.hasthumb { grid-template-columns: minmax(0, 1fr) auto; } }
.pmodal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .94); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: max(56px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.pmodal figure { margin: 0; width: fit-content; max-width: min(960px, 100%); display: grid; gap: 10px; } /* กว้างเท่ารูป → เครดิตเริ่มที่ขอบรูป */
.pmodal img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; justify-self: center; }
.pmodal figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 14px; }
.pcredit { margin: 0; color: rgba(255, 255, 255, .85); font-size: var(--t-xs); }
.pcredit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pmodal .pwrong { color: #fff; font-size: var(--t-sm); min-height: 44px; }
.pmodal .xbtn { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; }
.pname { display: grid; gap: 2px; }
.place3 .name { font-size: var(--t-md); font-weight: 500; line-height: 1.35; color: var(--c-ink); }
.place3 .ja { font-size: var(--t-xs); color: var(--c-ink-2); }
.place3 .pname .badge { justify-self: start; }
.xbtn { width: var(--l-tap); height: var(--l-tap); margin: -6px -6px 0 0; border: 0; border-radius: 50%; background: var(--c-neutral-soft); color: var(--c-ink-2); display: grid; place-items: center; cursor: pointer; }
.xbtn .ic svg { width: 20px; height: 20px; }
.place3 .name, .place3 .ja, .lead3 { overflow-wrap: anywhere; }
.nw { white-space: nowrap; }
.lead3 { display: grid; gap: 4px; }
.lead3 p { margin: 0; font-size: var(--t-xl); font-weight: 600; line-height: 1.35; color: var(--c-ink); letter-spacing: -.005em; }
.lead3 .ok { color: var(--c-matcha-ink); }
/* คำบอกทาง = เนื้อความ: Mitr Medium สี ink-2 (เบาสุดที่แบรนด์มี) · ญี่ปุ่นใช้ฟอนต์ ja ของแบรนด์ */
.lead3 .way { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0; font: inherit; font-size: 15px; font-weight: 500; line-height: 1.6; color: var(--c-ink-2); cursor: pointer; }
.lead3 .way.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lead3 .way .f3m { margin-left: var(--s-2); }
/* แถวข้อเท็จจริง: จุดดังโงะ (มีเส้นขอบน้ำตาลแบบมาสคอต) · ข้อความ · หลักฐาน · ลูกศรกาง */
.facts3 { list-style: none; margin: var(--s-1) 0 0; padding: 0; }
.facts3 .f3 + .f3 { border-top: 1px solid var(--c-line); }
.f3row, .trust3row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 18px; align-items: center; gap: 10px; width: 100%; min-height: var(--l-tap); padding: 6px 0;
  border: 0; background: none; color: var(--c-ink); font: inherit; font-size: var(--t-md); text-align: left; cursor: pointer; }
.f3row:focus-visible, .trust3row:focus-visible, .lead3 .way:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 6px; }
/* จุดหน้าหัวข้อ = ลูกดังโงะลายเดียวกับหัวตัวละคร ไม่มีหน้า (Por 27/10 · ภาพจาก design/mascot/export.py) · active 4 + inactive 1 */
.dot { width: 18px; height: 18px; object-fit: contain; justify-self: center; }
.f3m { display: inline-flex; align-items: center; gap: 3px; font-size: var(--t-xs); color: var(--c-ink-2); white-space: nowrap; }
.f3m.ok { color: var(--c-matcha-ink); font-weight: 600; }
.f3m:empty { display: block; } /* ช่องว่างยังกินคอลัมน์ ลูกศรตรงแนวทุกแถว */
.f3m.warn { color: var(--c-warn-ink); font-weight: 600; }
.f3m .ic svg { width: 15px; height: 15px; }
.chev { color: var(--c-ink-2); display: grid; place-items: center; transition: transform .2s ease; }
.chev .ic svg { width: 18px; height: 18px; }
.f3.open .chev, .trust3.open .chev { transform: rotate(180deg); }
.f3.open .f3row, .trust3.open .trust3row { color: var(--c-ink); }
.f3 .badge { vertical-align: 1px; }
.f3more { display: grid; gap: var(--s-1); padding: 0 0 var(--s-2) 32px; overflow: hidden; animation: drawer .22s ease-out; }
.f3more:empty { display: none; }
.f3more .warnline, .f3more .alt { font-size: var(--t-xs); color: var(--c-warn-ink); }
.f3vote { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); color: var(--c-ink-2); font-size: var(--t-sm); }
.ext { display: inline-flex; vertical-align: -3px; color: var(--c-ink-2); }
.ext .ic svg { width: 15px; height: 15px; }
/* ความน่าเชื่อทั้งการ์ด: วงแต้มเล็ก + เหตุผล (ไม่ใช่แถวที่ 5) */
.trust3 { margin-top: var(--s-1); }
.trust3row { grid-template-columns: auto minmax(0, 1fr) 18px; }
.trust3row .why { font-size: var(--t-sm); color: var(--c-ink-2); }
.trust3 .hint { margin: 0; font-size: var(--t-xs); color: var(--c-ink-2); }
.f3more .src a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--t-sm); color: var(--c-ink-2); }
.backlink { justify-self: start; display: inline-flex; align-items: center; gap: 2px; min-height: 32px; margin: -6px 0 -4px -4px; color: var(--c-ink-2); text-decoration: none; font-size: var(--t-sm); }
.backlink .ic svg { width: 16px; height: 16px; }
.editlink { font-size: var(--t-sm); color: var(--c-ink-2); min-height: 40px; }
.ask3 .editlink { display: block; margin-top: 6px; }
.editrow { padding-left: 30px; }
.trust3 .f3more { padding-left: 0; }
@keyframes drawer { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 420px; } }
@keyframes chevOpen { from { transform: rotate(0); } to { transform: rotate(180deg); } }
.f3.open .chev, .trust3.open .chev { animation: chevOpen .22s ease-out; }
/* กล่องถามที่ยังไม่รู้: ตัวหนังสือตรงแนวเดียวกับข้อความในแถว */
.ask3 { margin-top: var(--s-2); border-radius: var(--r-md); background: var(--c-card); border: 1.5px solid var(--c-line); padding: 10px 12px 10px 28.5px; }
.ask3 p { margin: 0 0 var(--s-2); font-size: var(--t-sm); color: var(--c-ink-2); }
.ask3 .row { font-size: var(--t-md); }
.ask3 .row + .row { margin-top: 6px; }
.ask3 .row span { flex: 1; }
.ask3 .yn { min-height: 40px; min-width: 56px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--c-neutral-soft); color: var(--c-ink); font: inherit; font-size: var(--t-sm); font-weight: 600; cursor: pointer; transition: transform .12s ease; }
.ask3 .yn:active, .th:active { transform: scale(.94); }
.ask3 .yn:disabled { opacity: .5; cursor: default; }
/* ท้ายการ์ด = แถบล่างสุดของแผงจริง (สิ่งสุดท้ายในการ์ด + ติดขอบล่างตอนเลื่อน · พื้นทึบ) */
.foot3 { position: sticky; bottom: calc(-1 * var(--s-3)); z-index: 2; display: flex; align-items: center; gap: var(--s-3);
  margin: var(--s-3) 0 calc(-1 * var(--s-3)); padding: var(--s-3) 0 calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  background: var(--c-paper); box-shadow: 0 -1px 0 var(--c-line), 0 -10px 14px -10px var(--c-scrim); }
.foot3 .btn.sm { min-height: 40px; padding: 0 var(--s-3); font-size: var(--t-sm); }
.foot3 .m { display: grid; font-size: var(--t-sm); color: var(--c-ink-2); line-height: 1.25; font-variant-numeric: tabular-nums; }
.foot3 .m b { font-size: 26px; color: var(--c-ink); font-weight: 600; }
.foot3 .btn.go { margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .f3more, .f3.open .chev, .trust3.open .chev { animation: none; } .chev { transition: none; } }
/* จอนอก Duo (compact): แผงสูงแค่ ~325px → ประโยคนำเล็กลงนิด · คำบอกทาง 2 บรรทัด ให้เห็นแถวแรกในจอแรก (รีวิว r1 P4) */
@media (max-width: 599px) {
  .lead3 p { font-size: 21px; }
  .place3 .name { font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lead3 .way { font-size: 14px; line-height: 1.55; }
}
