/* quest-ui-1026 · แถบติดตามเควส (HUD ซ้าย #goal) แบบใหม่ — ใต้ html.qw2 เท่านั้น (quest-track.js · ?qw=0 = เดิม)
 * ผู้ใช้ 26 ต.ค. "คลิกเควสก็คลิกสลับไปสลับมา": ป้ายชนิด ไอคอน+คำ (เนื้อเรื่อง ทอง · ข้างทาง เขียว · ค่าหัว แดงอิฐ …) ทุกแถว
 * แถบย่อ = 2 บรรทัด [ไอคอน][ป้ายชนิด + เหตุผล / ชื่อเป้าหมาย][ปุ่มมีคำ ▶ ไปทำ] — ไม่มีจุดแตะซ่อน (เดิมขอบขวา 40px = ไปเลย)
 * บรรทัดรอง #goal-cer = [ป้าย][ข้อความ][ไป ›][✕] ที่เห็นจริง · โหลดหลัง ui-goal-glass.css / ui-touch.css (ชนะด้วย .qw2 + ลำดับไฟล์)
 * ตัวหนังสือใช้ --fs-* (ui-scale.css) · ไม่มี animation ค้าง */

/* ── ป้ายชนิด (ใช้ร่วมกับหน้าต่างเควส) ── */
.qt-tag { display: inline-flex; align-items: center; gap: 3px; flex: none; max-width: 100%; padding: 1px 8px 1px 3px; border-radius: 999px; box-sizing: border-box;
  font: 800 var(--fs-xs, 12px)/1.35 var(--font-head, inherit); letter-spacing: .1px; white-space: nowrap; color: #fff; background: #6f7d86; text-shadow: none;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .18); }
.qt-tag img { width: 1.4em; height: 1.4em; margin: -2px 0; object-fit: contain; flex: none; }
.qt-tag i { width: .7em; height: .7em; margin: 0 2px 0 3px; border-radius: 50%; background: #fff; flex: none; }
.qt-tag.qt-main { background: linear-gradient(#f4cd6c, #e2a93a); color: #4a2c0c; }
.qt-tag.qt-side { background: linear-gradient(#7fbf5c, #5a9a3e); }
.qt-tag.qt-bounty { background: linear-gradient(#e27d66, #c4573f); }
.qt-tag.qt-daily { background: linear-gradient(#3f8584, #2f6f73); }
.qt-tag.qt-job { background: linear-gradient(#8f7ad0, #6d58ad); }
.qt-tag.qt-train { background: linear-gradient(#a08a6c, #7d6a50); }
.qt-tag.qt-now { background: linear-gradient(#e0605a, #b8423c); }
.qt-tag.qt-event { background: linear-gradient(#ee9c4e, #d47a2a); }
.qt-tag.qt-tip { background: rgba(255, 255, 255, .22); }

/* ── แถบ (ย่อ + กาง) ── */
html.qw2 body #goal { border-left: 4px solid #8a97a0 !important; }
html.qw2 body #goal[data-qt="main"] { border-left-color: #e8b64a !important; }
html.qw2 body #goal[data-qt="side"] { border-left-color: #6fae4f !important; }
html.qw2 body #goal[data-qt="bounty"] { border-left-color: #d4664f !important; }
html.qw2 body #goal[data-qt="job"] { border-left-color: #8f7ad0 !important; }
html.qw2 body #goal[data-qt="now"] { border-left-color: #e0605a !important; }
html.qw2 body #goal[data-qt="event"] { border-left-color: #ee9c4e !important; }
#goal .qt-line { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; }
#goal .qt-why { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #d6e0e6; font: 600 var(--fs-xs, 12px)/1.3 var(--font, inherit); }
#goal .qt-pinmark { display: inline-flex; align-items: center; flex: none; font-style: normal; }
#goal .qt-pinmark { gap: 2px; color: #ffe7a8; font: 800 var(--fs-xs, 12px)/1 var(--font-head, inherit); }
#goal .qt-pinmark img { width: 1.35em; height: 1.35em; object-fit: contain; }
html.qw2 body #goal #goal-tag { display: flex; }
html:not(.qw2) body #goal #goal-tag, html:not(.qw2) body #goal #goal-go, html:not(.qw2) body #goal #goal-pin { display: none !important; }

/* ย่อ: 2 บรรทัด + ปุ่มมีคำ */
html.qw2 body #goal#goal.min { height: auto !important; min-height: 46px !important; }
html.qw2 body #goal#goal.min > .body {
  display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px; row-gap: 1px;
  height: auto !important; min-height: 44px; padding: 3px 4px 3px 6px !important; box-sizing: border-box;
}
html.qw2 body #goal.min > .body::after, html.qw2 body #goal.min .body::after { content: none !important; display: none !important; }
html.qw2 body #goal.min #goal-icon { grid-column: 1; grid-row: 1 / 3; width: 26px !important; height: 26px !important; }
html.qw2 body #goal.min #goal-tag { grid-column: 2; grid-row: 1; }
html.qw2 body #goal.min #goal-txt { grid-column: 2; grid-row: 2; display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-sm, 13px) !important; line-height: 1.3 !important; }
html.qw2 body #goal.min .qt-tag { font-size: var(--fs-xs, 11px); padding-top: 0; padding-bottom: 0; }
html.qw2 body #goal #goal-go {
  grid-column: 3; grid-row: 1 / 3; align-self: center; min-width: 58px; min-height: 36px; margin: 0; padding: 0 9px; border-radius: 10px; cursor: pointer;
  border: 1px solid #b8841c; background: linear-gradient(#f6d27a, #e8b64a); color: #4b2d17; box-shadow: 0 2px 0 #b8841c;
  font: 800 var(--fs-xs, 12px)/1.1 var(--font-head, inherit); white-space: nowrap; text-shadow: none;
}
html.qw2 body #goal #goal-go:hover { filter: brightness(1.06); }
html.qw2 body #goal.min #goal-go { pointer-events: auto; }   /* ui-astra.css: .body ของแถบย่อ pointer-events:none (แตะทั้งแถบ = กาง) — ปุ่มต้องรับแตะเอง */
html.qw2 body #goal #goal-go.stop { border-color: #8e3a28; background: linear-gradient(#e0806a, #c4573f); color: #fff8ef; box-shadow: 0 2px 0 #8e3a28; }
html.qw2 body #goal #goal-go[hidden], html.qw2 body #goal:not(.min) #goal-go { display: none !important; }
html.qw2.touch-ui body #goal #goal-go { min-height: max(44px, calc(44px / var(--ui, 1))); min-width: max(62px, calc(62px / var(--ui, 1))); }   /* โซนซ้ายบนถูก zoom --ui (จอเตี้ย 0.85) — ขนาดจริงบนจอต้อง ≥ 44 */
html.qw2.touch-ui body #goal#goal.min > .body { min-height: max(48px, calc(48px / var(--ui, 1))); }
/* ui-astra.css: ::before โปร่งคลุมทั้งแถบ (ขยายจุดแตะ) ทำให้แตะปุ่ม ▶ ไปทำ ไปโดนแถบแทน (= กางดู) — แบบใหม่มีปุ่มจริง ไม่ต้องคลุม */
html.qw2 body #goal.min::before { content: none !important; display: none !important; }
html.qw2.touch-ui body #goal#goal.min.aq, html.qw2.touch-ui body #goal#goal.min.aq > .body { height: auto !important; }
/* จอสัมผัส: กว้างเท่าการ์ดตัวละครเดิม (194 · ui-touch.css) — กว้างกว่านี้ไปทับแถบหอระฆัง/โซนบนกลางที่หลบแค่ขอบการ์ด (--hz-tl-r)
 * ที่พอสำหรับชื่อเควส + ปุ่มมีคำ = ซ่อนไอคอนชนิด/หน้า NPC ในแถบย่อ (ป้ายชนิดมีไอคอนอยู่แล้ว · แถบกางยังมีหน้า NPC) */
html.qw2.touch-ui body #goal.min:not(.chip) #goal-icon { display: none !important; }
html.qw2.touch-ui body #goal#goal.min:not(.chip) > .body { grid-template-columns: minmax(0, 1fr) auto; padding-left: 7px !important; }
html.qw2.touch-ui body #goal.min:not(.chip) #goal-tag, html.qw2.touch-ui body #goal.min:not(.chip) #goal-txt { grid-column: 1; }
html.qw2.touch-ui body #goal.min:not(.chip) #goal-go { grid-column: 2; }
html.qw2:not(.touch-ui) body #goal.min { width: 256px !important; max-width: 256px !important; height: auto !important; }

/* กาง: ป้ายชนิดเหนือชื่อ · ปุ่ม [▶ ไปเลย][📌 ติดตาม/เลิก] แถวแรก */
html.qw2 body #goal:not(.min) > .body { grid-template-columns: 34px minmax(0, 1fr) !important; }
html.qw2 body #goal:not(.min) #goal-icon { grid-column: 1 !important; grid-row: 1 / 3 !important; }
html.qw2 body #goal:not(.min) #goal-tag { grid-column: 2; grid-row: 1; }
html.qw2 body #goal:not(.min) #goal-txt { grid-column: 2 !important; grid-row: 2 !important; }
html.qw2 body #goal:not(.min) #goal-sub { grid-column: 1 / -1 !important; grid-row: 3 !important; }
html.qw2 body #goal:not(.min) .gfoot { display: flex !important; flex-wrap: wrap; }
html.qw2 body #goal:not(.min) .gfoot > button { flex: 1 1 0; min-width: 0; }
html.qw2 body #goal:not(.min) #goal-act { flex: 1.5 1 0; }
html.qw2:not(.touch-ui) body #goal:not(.min) #goal-act, html.qw2:not(.touch-ui) body #goal:not(.min) #goal-pin { flex-basis: 40%; }
html.qw2 body #goal #goal-pin[hidden] { display: none !important; }
html.qw2 body #goal:not(.min) #goal-pin { background: rgba(232, 182, 74, .2) !important; border-color: rgba(232, 182, 74, .6) !important; color: #ffe7a8 !important; font-weight: 700; }
html.qw2 body #goal.pinned:not(.min) #goal-pin { background: rgba(255, 255, 255, .08) !important; border-color: rgba(255, 255, 255, .25) !important; color: #fff !important; }
html.qw2.touch-ui body #goal:not(.min) .gfoot button { min-height: 44px !important; }

/* ── บรรทัดรอง: [ป้าย][ข้อความ][ไป ›][✕] ── */
html.qw2 body #goal #goal-cer:not([hidden]) { display: flex !important; align-items: center; gap: 5px; padding: 3px 4px 3px 6px !important; min-height: 32px; white-space: nowrap; }
html.qw2 body #goal #goal-cer::after, html.qw2 body #goal #goal-cer.tap::after, html.qw2 body #goal #goal-cer[data-k="link-nudge"].tap::after { content: none !important; display: none !important; }
html.qw2 body #goal #goal-cer .qt-tag { font-size: var(--fs-xs, 11px); padding-top: 0; padding-bottom: 0; }
html.qw2 body #goal #goal-cer .cr-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html.qw2.touch-ui body #goal #goal-cer .cr-txt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }
html.qw2 body #goal #goal-cer .cr-go { flex: none; padding: 3px 8px; border-radius: 8px; background: rgba(232, 182, 74, .9); color: #4b2d17; font: 800 var(--fs-xs, 12px)/1.2 var(--font-head, inherit); text-shadow: none; }
html.qw2 body #goal #goal-cer .cr-x { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: var(--fs-xs, 12px); cursor: pointer; }
html.qw2 body #goal #goal-cer .cr-x:hover { background: rgba(255, 255, 255, .3); }
html.qw2.touch-ui body #goal #goal-cer:not([hidden]) { min-height: 36px; }
html.qw2.touch-ui body #goal #goal-cer .cr-x { width: 34px; height: 34px; }
html.qw2.touch-ui body #goal.min .qt-pinmark { font-size: 0; }   /* แถบย่อจอสัมผัส: หมุดอย่างเดียว (คำ "ติดตาม" ล้นที่) — แถบกางมีหัว "📌 กำลังติดตาม" */
html.qw2.touch-ui body #goal.min .qt-pinmark img { width: 18px; height: 18px; }

/* ── quest-compact-1028 · จอสัมผัส: แถบย่อบรรทัดเดียว [ไอคอนชนิด][ชื่อเควส][▶] · บรรทัดรอง (กิจกรรม/ไป ›) ซ่อนตอนย่อ (กางแล้วยังเห็น)
 * ผู้เล่นบ่น "tab เควสใหญ่เกิน" — แถบย่อ 2 บรรทัดสูง ~1.6 เท่าของเดิม · ?qcompact=0 = แบบเดิมของ 26 ต.ค. */
html.qw2.qc.touch-ui body #goal#goal.min:not(.chip) > .body { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; min-height: 0; column-gap: 5px; padding: 2px 3px 2px 6px !important; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) #goal-tag { grid-column: 1; grid-row: 1; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) #goal-txt { grid-column: 2; grid-row: 1; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) #goal-go { grid-column: 3; grid-row: 1; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) #goal-sub { display: none !important; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) .qt-tag { padding: 2px; font-size: 0; gap: 0; }   /* ไอคอนอย่างเดียว (สีขอบซ้าย+ไอคอนบอกชนิด · คำอยู่ในแถบกาง) */
html.qw2.qc.touch-ui body #goal.min:not(.chip) .qt-tag img { width: 22px; height: 22px; margin: 0; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) .qt-tag i { margin: 4px; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) .qt-why, html.qw2.qc.touch-ui body #goal.min:not(.chip) .qt-pinmark { display: none; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) #goal-cer { display: none !important; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) #goal-go { font-size: 0; min-width: max(44px, calc(44px / var(--ui, 1))); padding: 0; }
html.qw2.qc.touch-ui body #goal.min:not(.chip) #goal-go::before { content: '▶'; font: 800 var(--fs-md, 16px)/1 var(--font-head, inherit); }
html.qw2.qc.touch-ui body #goal.min:not(.chip) #goal-go.stop::before { content: '■'; }
/* แถบกาง (จอสัมผัส): ป้ายชนิดอยู่บรรทัดเดียวกับชื่อ · บรรทัดรองข้อความ 1 บรรทัด — ไม่ยื่นไปทับแชท/จอย */
html.qw2.qc.touch-ui body #goal:not(.min) > .body { grid-template-columns: 34px auto minmax(0, 1fr) !important; grid-template-rows: auto auto; row-gap: 0; }
html.qw2.qc.touch-ui body #goal:not(.min) #goal-icon { grid-row: 1 / 2 !important; }
html.qw2.qc.touch-ui body #goal:not(.min) #goal-tag { grid-column: 2; grid-row: 1; }
html.qw2.qc.touch-ui body #goal:not(.min) #goal-txt { grid-column: 3 !important; grid-row: 1 !important; }
html.qw2.qc.touch-ui body #goal:not(.min) #goal-sub { grid-column: 1 / -1 !important; grid-row: 2 !important; }
html.qw2.qc.touch-ui.land body #goal:not(.min) #goal-sub { -webkit-line-clamp: 1; line-height: 1.3; }
html.qw2.qc.touch-ui body #goal:not(.min) > header { min-height: 0 !important; padding-top: 2px !important; padding-bottom: 2px !important; }
html.qw2.qc.touch-ui body #goal:not(.min) #goal-cer .cr-txt { -webkit-line-clamp: 1; }
html.qw2.qc.touch-ui body #goal:not(.min) #goal-cer:not([hidden]) { min-height: 32px; }

/* ── left-hud-size-1028 · จอสัมผัส: ขนาดที่เห็น = แถบเควสแบบเดิมตอนแรก (?qw=0 · ปุ่ม ▶ เล็ก ~30x24) แต่พื้นที่แตะยัง >= 44 ด้วย ::after โปร่ง
 * ผู้ใช้ 28 ต.ค. "ซ้ายมือยังใหญ่ไป ยิ่งในมือถือ" · ?lhud=0 = แบบ quest-compact (ปุ่ม 44+ ที่เห็นจริง) */
html.lhud.qw2.touch-ui body #goal#goal.min { min-height: 0 !important; }
html.lhud.qw2.touch-ui body #goal#goal.min > .body { min-height: 0 !important; padding: 2px 3px 2px 6px !important; }
html.lhud.qw2.touch-ui body #goal.min:not(.chip) #goal-go { min-width: 30px; min-height: 24px; height: 26px; border-radius: 8px; position: relative; box-shadow: 0 1px 0 #b8841c; }
html.lhud.qw2.touch-ui body #goal.min:not(.chip) #goal-go::before { font-size: var(--fs-sm, 14px); }
html.lhud.qw2.touch-ui body #goal.min:not(.chip) #goal-go::after { content: ""; position: absolute; inset: -10px -8px; }
/* ปุ่มท้ายแถบกาง: ภาพสูง 30 · พื้นที่แตะ 44 = ขอบโปร่ง 7px (background-clip) + margin ติดลบ (ไม่ใช้ ::after เพราะ overflow:hidden ตัดพื้นที่แตะ) */
html.lhud.qw2.touch-ui body #goal#goal:not(.min) .gfoot > button { box-sizing: border-box !important; height: 44px !important; min-height: 44px !important; max-height: 44px !important; margin: -7px 0 !important; border: 7px solid transparent !important; background-clip: padding-box !important; border-radius: 16px !important; }

/* ── แถวปุ่มท้ายแถบกาง (ผู้ใช้ 28 ต.ค. "3 ปุ่มขนาดไม่ balance"): [ไปเลย][เควส][ขอช่วย] กว้างเท่ากัน สูงเท่ากัน — คอลัมน์เท่ากัน (1fr) ตามจำนวนปุ่มที่เห็น
 * ไปเลยแยกด้วยสี (teal) ไม่ใช่ขนาด · ข้อความ+ไอคอนกึ่งกลาง · ยาวเกินตัดบรรทัดเดียว (…) · ทั้งจอสัมผัสและคอม */
html.qw2 body #goal#goal:not(.min) .gfoot { display: grid !important; grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; gap: 5px !important; }
html.qw2 body #goal#goal:not(.min) .gfoot > button { flex: none !important; width: auto !important; min-width: 0 !important; display: flex; align-items: center; justify-content: center; gap: 3px; text-align: center; padding: 2px 4px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs, 12px) !important; line-height: 1.2; }
html.qw2 body #goal#goal:not(.min) .gfoot > button { grid-column: auto !important; grid-row: auto !important; }
html.qw2:not(.touch-ui) body #goal#goal:not(.min) .gfoot > button { height: 38px !important; min-height: 38px !important; }

/* hud-overlap-1101 (เจ้าของ 1 พ.ย.): ปุ่มแถวล่างการ์ดเป้าหมายบนมือถือ "ไปล่าให้จนคร…" ถูกตัด — ให้ตัดบรรทัดได้ (2 บรรทัดในปุ่มสูง 44) แทน … */
html.qw2.touch-ui body #goal:not(.min) .gfoot > button { white-space: normal !important; text-overflow: clip !important; overflow-wrap: anywhere; line-height: 1.15 !important; padding-inline: 4px !important; min-width: 0; }
html.qw2.touch-ui body #goal:not(.min) #goal-act { flex: 1.6 1 0; }

/* ── lang-layout-1115 · ภาษาอังกฤษยาวกว่าไทย: ไม่ตัดสาระด้วย … บรรทัดเดียว ──
 * (1) ชื่อเป้าหมายสมดุลบรรทัด "(Lv 1)" ไม่โดดเดี่ยว · แถบย่อบนคอมให้ 2 บรรทัด (ชื่อมอน/เควสไม่ถูกตัด)
 * (2) บรรทัดรอง (กิจกรรม/ไป ›) ขึ้นได้ 2 บรรทัด · (3) ปุ่มท้ายแถบกางตัดบรรทัดได้ทุกจอ (เดิมคอมตัด "Hunt until don") */
#goal #goal-txt { text-wrap: balance; }
html.qw2.qc.touch-ui.land body #goal:not(.min) #goal-sub { -webkit-line-clamp: 2; line-height: 1.3; }   /* มือถือแนวนอน: คำอธิบายกาง 2 บรรทัด (เดิม 1 บรรทัดตัด "boss room needs a part…") */
html.qw2 body #goal.min #goal-txt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }
/* lang-layout-1115 รอบ 2: การ์ดย่อบนมือถือกว้างตายตัว 194px (กฎโซนบน: กว้างกว่านี้ทับแถบหอระฆัง/โซนบนกลาง) — ชื่อเควสยาว ("Accept quest \"A Crack Beneath the Town\"") เหลือที่ข้อความแค่ ~100px = ตัด … ที่ 2 บรรทัด
 * เลือก: คงความกว้าง 194 · ให้ข้อความลงได้ 3 บรรทัด (โตแนวตั้งลงไปทางว่างระหว่างการ์ดกับปุ่ม "หาปาร์ตี้" ไม่ชนโซนบน) */
html.qw2.touch-ui body #goal.min #goal-txt { -webkit-line-clamp: 3; }
html.qw2 body #goal #goal-cer .cr-txt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
html.qw2 body #goal#goal:not(.min) .gfoot > button { white-space: normal !important; text-overflow: clip !important; overflow-wrap: anywhere; line-height: 1.15 !important; }
