/* ใบ 181 (14 ต.ค.) — เก็บรายละเอียด popup/หน้าต่าง/บทพูด NPC ให้ 10/10 ทั้งมือถือแนวนอน 915×412 · 844×390 และคอม 1366×768 ไทย+อังกฤษ
   ไล่ด้วย design-briefs/181-popup-audit/audit.mjs (ตัวเช็ก DOM: ล้นกรอบ · ตัดคำ · ฟอนต์ < 12px · อีโมจิ · ปุ่มทับ · ภาพยืด)
   ไฟล์นี้โหลดท้าย index.html — แต่ละกฎบอกว่าแก้อะไร ที่ไหน · ห้ามตั้ง z-index/ตำแหน่ง HUD ที่นี่ (ui-root.js เป็นเจ้าของ) */

/* ── เควส › วันนี้ (ui.js renderQuests): ปุ่ม "เช็คอิน & ภารกิจรายสัปดาห์" อยู่นอกการ์ด เคยเป็นปุ่มเบราว์เซอร์สี่เหลี่ยมเทา ── */
html body .win .qd-go[data-qgo="checkin"] {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 32px; padding: 4px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid #8fb6b3; color: #285d61; background: #e8f3f1; font: 600 13px/1.2 var(--font-head, inherit);
}
html body .win .qd-go[data-qgo="checkin"]:hover { filter: brightness(1.04); }
html body .win .qd-go.qd-chest[data-qgo="checkin"] { border-color: #b8761f; color: #3e2a10; background: linear-gradient(#f6c75a, #e8a43a); font-weight: 700; margin-bottom: 6px; }   /* หีบรอรับ (24 ต.ค.) */
html body .win .qd-rh .ui-ic { vertical-align: -0.2em; }

/* ── กล่องคุย NPC (npc-talk.js · ui.js renderNpc): แถบท้ายมีแค่ปุ่มปิดที่ซ่อนไว้ → เหลือแถบเปล่ามีเส้นขอบใต้ "ลาก่อน" ── */
html body #windows .win .foot.npc-service-footer:has(> .npc-close-redundant:only-child) { display: none; }
/* คำกำกับ "เนื้อเรื่อง / เรื่องข้างทาง" เหนือชื่อเควสต์ 11px → 12px */
html body #windows .win[data-win="npc"] .npc-talk-opts .nq-kick { font-size: 12px; }

/* ── การ์ดไอเทม (item-card.js): ปุ่มล่าง 3 ปุ่ม "แชร์ในแชท" ตกเป็น "แชร์ใน / แชท" สองบรรทัด → บรรทัดเดียว ไอคอนอยู่หน้า
   ปุ่มยาวกว่าที่ (ภาษาอังกฤษ/4 ปุ่ม) = ขึ้นแถวใหม่ทั้งปุ่ม ไม่ตัดคำกลางปุ่ม ── */
.icard .ic-acts { flex-wrap: wrap; }
.icard .ic-acts button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding-inline: 10px; white-space: nowrap; flex: 1 1 auto; min-width: fit-content; }
html.touch-ui .icard .ic-acts button { font-size: 14px; padding-inline: 8px; }
.icard .ic-acts button .ui-ic { flex: none; }

/* ── ป้ายข่าวเมือง Lyra (herald-window.js): หัวข้อ/การ์ดโครงการที่เคยเป็นอีโมจิ 🌿🍮🏗️ → ภาพข่าวชุดเดิม (news/ic_*.webp) ── */
.hw-sh-ic > img:not(.ui-ic) { width: 24px; height: 24px; object-fit: contain; display: block; }
.hw-ph > img { width: 40px; height: 40px; object-fit: contain; display: block; margin: auto; }
.hw-notice .ui-ic { vertical-align: -0.2em; }
/* มือถือแนวนอน (สูง ≤ 500): ข่าวเด่นหัวข้อยาว (อังกฤษ) ตก 6 บรรทัดกินทั้งจอเพราะภาพประกอบกินคอลัมน์ขวา → ภาพเล็กลง หัวข้อ 16px */
@media (max-height: 500px) and (min-width: 681px) {
  .hw-feat { grid-template-columns: minmax(0, 1fr) 84px; }
  .hw-feat-tx b { font-size: 16px; line-height: 1.25; }
  .hw-feat-art { height: 72px; }
  .hw-feat-art:not(.pic) img { width: 64px; height: 64px; }
  .hw-feat-art.pic img { max-height: 72px; }
}

/* ── การ์ดผลตกปลา (fish-catch-card.js): ของในหีบสมบัติ (Gold + ชื่อของยาว) เป็นบรรทัดเดียว nowrap ทะลุการ์ดไปหลังปุ่ม "เก็บไว้"
   → ขึ้นบรรทัดใหม่ในการ์ด · จอสัมผัสตัวรอง 10.5–11.5 → 12px ── */
/* ⚠ บั๊กจริง: การ์ดหีบสมบัติได้คลาส .jp (แจ็กพอต) ชนกับ .jp ของจิ๊กซอว์ความทรงจำ (ui-memory.css: width/height 100%)
   → การ์ดสูงเต็มจอ ป้ายไม้ "แจ็กพอต!" หลุดขอบบน ทุกจอ — คืนความสูงตามเนื้อหา */
#fish-card.jp { height: auto; }
#fish-card .fc-flags { flex-wrap: wrap; min-width: 0; }
#fish-card.jp .fc-size { flex: 1 1 auto; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
html.touch-ui #fish-card .fc-size, html.touch-ui #fish-card .fc-minor, html.touch-ui #fish-card .fc-book, html.touch-ui #fish-card .fc-fx { font-size: 12px; }
html.touch-ui #fish-card .fc-flair, #fish-card .fc-flair { font-size: 12px; }
html.touch-ui #fish-card .fc-btns small, #fish-card .fc-btns small { font-size: 12px; }
/* ปุ่ม "เก็บไว้ · Ingredient" บนจอสัมผัส (กว้าง 112px) — fish-garden-popups 16 ต.ค.: เดิมให้ขึ้นบรรทัด → ตัดกลางคำ "+18 XP ตก/ปลา"
   ตอนนี้ซ่อนภาพประจำปุ่มบนจอสัมผัสแทน (ui-life.css) คำรองจึงพอบรรทัดเดียว */
html.touch-ui #fish-card .fc-btns small { white-space: nowrap; line-height: 1.15; font-size: 11.5px; }
#fish-card .fc-btns small .ui-ic { width: 1.1em; height: 1.1em; }
#fish-card .fc-fx .ui-ic { vertical-align: -0.25em; }

/* ── ห้องแชทมีรหัส (ui.js joinChatRoom · .rwin.dlg): ปุ่ม ยกเลิก/เข้าห้อง 11px → ขนาดปุ่มมาตรฐาน ── */
html body #croom-pass .rwin.dlg .rbtn { font-size: 14px; min-height: 36px; padding-inline: 16px; }

/* ── ร้าน (shop-window.js) จอสัมผัสแนวนอน: ร้านที่มีแท็บหมวด 4 แท็บ (Bram: อาวุธ/ชุดเกราะ/หมวก/เครื่องประดับ) ดันช่องค้นหา+เรียง
   จนเหลือ "ค้นหาไ…" และ "เรีย" จมหลังคอลัมน์รายละเอียด (ui-touch.css วางแท็บ+เครื่องมือแถวเดียว) → แท็บแถวบน เครื่องมือแถวถัดไป ── */
@media (min-width: 761px) {
  html.touch-ui body #windows .win[data-win="shop"] .shop-cat:has(> .shop-tabs > :nth-child(4)) { grid-template-rows: auto auto auto minmax(0, 1fr) auto !important; row-gap: 4px; }
  html.touch-ui body #windows .win[data-win="shop"] .shop-cat:has(> .shop-tabs > :nth-child(4)) > .shop-tabs { grid-column: 1 / -1 !important; }
  html.touch-ui body #windows .win[data-win="shop"] .shop-cat:has(> .shop-tabs > :nth-child(4)) > .shop-tools { grid-column: 1 / -1 !important; grid-row: 2 !important; }
  html.touch-ui body #windows .win[data-win="shop"] .shop-cat:has(> .shop-tabs > :nth-child(4)) > .shop-filter-strip { grid-row: 3; }
  html.touch-ui body #windows .win[data-win="shop"] .shop-cat:has(> .shop-tabs > :nth-child(4)) > .shop-list { grid-row: 4 !important; }
}

/* ── ช่าง Ferra/Tobin บนจอเตี้ย (ui-touch.css HEAD SLOT): หัวข้อ "· ตีบวกอุปกรณ์/โต๊ะช่างคราฟ" ย้ายขึ้นแถวหัว แต่แถบแท็บ
   ตีบวก/แลกเศษ/ขาย/ย่อย (พื้นโปร่ง) วางทับด้านขวา → ตัวหนังสือโผล่ตามช่องระหว่างแท็บ ("ขาย ใ ย่อย ี")
   → แถบแท็บมีพื้นสีเดียวกับหัวหน้าต่าง บังหัวข้อที่อยู่ข้างใต้ (ไม่ซ่อน .cw-head/.rw-head — check-hud-layout ตรวจว่าช่องหัวต้องอยู่) ── */
@media (max-height: 500px) {
  html.touch-ui body #windows .win[data-win] .body .npc-modes { background: linear-gradient(#fef7e8, #f3e6cb) !important; padding-left: 8px !important; box-shadow: -10px 0 8px -4px #fbf1dd; }
  html.touch-ui body #windows .win[data-win]:has(.npc-modes) :is(.body, .hslot) :is(.cw-title, .rw-title) > b { color: transparent !important; }   /* ยังอยู่ในแถบ (ด่านนับช่องหัว) แต่ไม่โผล่ตามช่องแท็บ */
}

/* ── แท็บขายของร้าน/ช่าง (trade-panel.js): ป้าย "สวมอยู่/ขายไม่ได้" 10.5px ทับเลขจำนวน "99" ที่มุมขวาล่าง (โผล่เป็น "ขายไม่ได้9")
   → ช่องที่ขายไม่ได้ไม่ต้องโชว์จำนวน · ป้าย 12px ── */
#windows .sp-slot.no .sp-q { display: none; }
html.touch-ui #windows .sp-slot .sp-why, #windows .sp-slot .sp-why { font-size: 12px; letter-spacing: -.01em; }
#windows .sp-slot .sp-tag.junk { font-size: 11px; }

/* ── แผนที่ภูมิภาค (worldmap.js) มือถือแนวนอน: ภาพแผนที่สูง ~280px หมุดสนามเรียงชิด → ไอคอนเต็นท์/หัวกะโหลกทับป้ายชื่อหมุดข้าง ๆ
   ("ซัน☠", "แอ่⛺อซิส") — ใช้กติกาเดียวกับจอแคบ ≤ 560 (ui-map.css): ป้ายเฉพาะจุดที่ยืน/ที่เลือก/เร็ว ๆ นี้ ชื่ออื่นดูที่การ์ดขวาเมื่อแตะ ── */
@media (max-height: 500px) {
  html body .wm-pin span { display: none; }   /* ui-map.css โหลดทีหลัง (ตอนเปิดแผนที่) — ต้องเจาะจงกว่า */
  html body .wm-pin:is(.me, .on, .soon) span { display: block; }
  html body .wm-pin:is(.me, .on) { z-index: 2; }
}
html body .wm-pin span { font-size: 12px; }

/* ── ช่างตีบวก (refine-window.js) คอม: คอลัมน์รายการแคบ ชื่อ "Cotton Shi…" "Training D…" ถูกตัด เพราะป้าย "สวมอยู่" กินที่
   → ชื่อขึ้น 2 บรรทัดได้ · คอม: ป้ายสวมอยู่ลงไปอยู่ใต้ชื่อ (ไม่แย่งความกว้าง) ── */
.rw-item-tx b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
html:not(.touch-ui) .rw-item { grid-template-columns: 26px minmax(0, 1fr); }
html:not(.touch-ui) .rw-item > .rw-worn { grid-column: 2; justify-self: start; font-size: 12px; }

/* ── กระดานบอส (ui.js renderMvp): "ที่เกิด · เกิดใหม่ทุก ~30 นาที" ถูกตัด … กลางประโยค (อังกฤษยาวกว่า) → 2 บรรทัดได้ ── */
.mv-map, .mv-kill { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }

/* ── สถานะตัวละคร (ui.js renderStatus) จอสัมผัส: ปุ่ม + (กฎปุ่มสัมผัส ≥ 44px) กว้างกว่าคอลัมน์ 36px → ยื่นทะลุขอบการ์ดค่าสถานะ ── */
html.touch-ui body #windows .win[data-win="status"] :is(.st-main, .st-grid > .st-col:first-child) .st-row { grid-template-columns: minmax(25px, 1fr) auto 44px !important; }
html.touch-ui body #windows .win[data-win="status"] button.up { width: 44px; min-width: 0; max-width: 100%; height: 44px; justify-self: end; box-sizing: border-box; }
.wm-tag { font-size: 12px; }

/* ── สมุดผจญภัย (codex.js): ชื่อยาว 2 บรรทัด ("Thornspine Shield") ดัน "Lv" ต่ำกว่าการ์ดข้าง ๆ → ชื่อจองที่ 2 บรรทัด Lv ตรงแถวกัน ── */
.cx-grid > .cx-card { grid-template-rows: auto minmax(2.4em, auto) auto; align-content: start; }
.cx-grid > .cx-card > b { align-self: center; text-align: center; }

/* ── คลัง Lina บนจอสัมผัส (storage-window.js · แท็บ กระเป๋า/คลัง/พักฟื้น ย้ายขึ้นแถวหัว): ปุ่มรับ font: inherit จากหัว
   → ตัวอักษรบาง ~24px คนละฟอนต์กับแท็บ NPC อื่น และ "พักฟื้น"/"Rest" ล้นขอบปุ่ม → ฟอนต์หัวหนา 14px แบบแท็บ npc-modes ── */
html.touch-ui body #windows .win[data-win] :is(.body, .hslot) .stw-row :is(.stw-seg button, .stw-heal-btn) { font: 700 14px/1.1 var(--font-head, inherit); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
html.touch-ui body #windows .win[data-win] :is(.body, .hslot) .stw-row .stw-seg button small { font: 600 12px/1 var(--font-body, inherit); margin-left: 2px; }
html.touch-ui body #windows .win[data-win] :is(.body, .hslot) .stw-row :is(.stw-seg button, .stw-heal-btn) .stw-ic { width: 26px; height: 26px; margin: 0; }

/* ── ตู้ระฆังโชค (lucky-bell.js): หัวชื่อตู้ line-height 1.1 → สระล่าง "ตู้" ชนวรรณยุกต์ "ค่ำ" บรรทัดล่าง · ตัวรอง 11.5 → 12px ── */
.lb-title b { line-height: 1.25; }
.lb-title small { line-height: 1.35; padding-top: 1px; }
@media (max-height: 520px) { .lb-title b { line-height: 1.2; } .lb-title small { font-size: 12px; } }

/* ── ตัวอักษรรองที่ต่ำกว่า 12px ในหน้าต่าง (ตัวตรวจ audit.mjs 'tiny') → 12px ── */
#windows .win[data-win="checkin"] .ck-ms, #windows .win[data-win="checkin"] .ck-mbadge, #windows .win[data-win="checkin"] .ck-note { font-size: 12px; }
html body .win .qd-tab i { font-size: 12px; }
.fm-lead, .fm-val { font-size: 12px; }
.cy-site .cy-tst { font-size: 12px; }
.lr-tabs .lr-lab { font-size: 12px; }
html body #windows .win[data-win="status"] .st-i { font-size: 12px; }
.win[data-win="craft"] .cw-tab-cq { font-size: 12px; }
#windows .win[data-win="checkin"] .ck-say, #windows .win[data-win="checkin"] .ck-tab small, #windows .win[data-win="checkin"] .ck-bar span { font-size: 12px; }
html body #windows .win[data-win="status"] .st-lv em, html body #windows .win[data-win="skills"] .key-head em { font-size: 12px; }
.win[data-win="fame"] .foot .btn { font-size: 12px; }
.mem-done .mem-rw small { font-size: 12px; }
.tm-tabs em { font-size: 12px; }
.ck-row .ck-cat { font-size: 12px; }
.fm-grp li em { font-size: 12px; }
.cy-steps i { font-size: 12px; }
.lr-ctxt em, .lr-ctxt small { font-size: 12px; }
@media (max-height: 520px) { .lb-pull small { font-size: 12px; } }

/* ── กองไฟ (cook-window.js): ชื่อวัตถุดิบในชิปถูกตัด "Garden Carrot (any Ra…" ทั้งที่การ์ดยังกว้าง → ขึ้นบรรทัดใหม่ในชิปแทน · ตัวอักษรรอง 11.5 → 12px ── */
.ck-mat { max-width: 100%; }
.ck-mat small { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
.ckc-tt small, .ckc-can, .ckc-use, .ckc-lack { font-size: 12px; }

/* ── เช็คอิน 7 วัน (checkin-window.js): ชื่อของรางวัล 10.5px ตัดเหลือ "Coral Tinker…" → 12px ได้ 3 บรรทัด ── */
#windows .win[data-win="checkin"] .ck-lb { font-size: 12px; line-height: 1.15; -webkit-line-clamp: 3; overflow-wrap: anywhere; }
