/* แท็บกิลด์ในหน้าต่างสังคม (client/guild-tab.js · ใบ guild-1025) — ใช้ชิ้นเดิมของหน้าสังคม (sx-card · sx-btn · sx-find · sx-h) + ส่วนเฉพาะกิลด์
   สี: teal ประจำเกม #2f6f73 · ทอง UI #e8b64a · ครีม #fffdf7 · ไม่มี z-index นอกตาราง (กล่องยืนยันอยู่ในหน้าต่างเอง) */
.gd-wrap { display: flex; flex-direction: column; gap: 10px; }   /* ขอบเขตของ guildClick — ระยะห่างเท่า .sx-body */
.gd-emb { width: 46px; height: 46px; display: block; flex: none; object-fit: contain; }
.gd-emb.xs { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; margin-right: 3px; }
.gd-emb.sm { width: 28px; height: 28px; }
.gd-emb.lg { width: 56px; height: 56px; }
.gd-emb.xl { width: 72px; height: 72px; }
.gd-tag { font: 700 var(--fs-sm, 14px) var(--font); color: #2f6f73; }
.gd-note { color: #6b5a3a !important; font-style: italic; overflow-wrap: anywhere; }
.gd-warn { margin: 0; padding: 8px 12px; border-radius: 10px; background: #fff3d6; border: 1px solid #e8c77a; color: #6b4e14; font: 600 var(--fs-sm, 14px)/1.35 var(--font); display: flex; gap: 6px; align-items: center; }

/* ยังไม่มีกิลด์ */
.gd-inv { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(#f4fbf8, #e9f5f1); border: 2px solid #2f6f73; box-shadow: 0 2px 0 #cfe3dd; }
.gd-inv .sx-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.gd-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(100deg, #fffaf0, #fbf0d8); border: 1px solid #e6d3a6; box-shadow: 0 2px 0 #ead9b2; }
.gd-hero b { font: 800 var(--fs-btn, 17px)/1.25 var(--font-head); color: #2f6f73; }
.gd-hero small { font: 500 var(--fs-sm, 13px)/1.35 var(--font); color: #7a6a4a; }
.gd-hero-art { position: relative; width: 92px; height: 60px; flex: none; }
.gd-hero-art .gd-emb { position: absolute; width: 44px; height: 44px; }
.gd-hero-art .a { left: 24px; top: 0; z-index: 1; width: 50px; height: 50px; }
.gd-hero-art .b { left: 0; top: 14px; transform: rotate(-12deg); }
.gd-hero-art .c { left: 50px; top: 14px; transform: rotate(12deg); }
.gd-mine { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 8px; border-radius: 12px; background: #fffdf7; border: 1px solid #e6dabb; }
.gd-chip b { font: 700 var(--fs-sm, 14px) var(--font); color: #4a3512; }
.gd-chip small { font: 500 var(--fs-xs, 12px) var(--font); color: #8a7a5a; }
.gd-chip .sx-btn { min-height: 34px; padding: 0 10px; font-size: var(--fs-sm, 13px); }
.gd-card .gd-emb { width: 46px; height: 46px; }
.gd-card.full { opacity: .72; }
.gd-card .sx-main small { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.gd-sent { display: inline-flex; align-items: center; gap: 4px; font: 700 var(--fs-sm, 13px) var(--font); color: #2f6f73; }
.gd-apply { grid-column: 1 / -1; }

/* ก่อตั้ง */
.gd-back { display: flex; align-items: center; gap: 10px; }
.gd-back .sx-h { margin: 0; }
.gd-form { display: grid; gap: 10px; padding: 12px 14px; border-radius: 16px; background: #fffdf7; border: 1px solid #e6dabb; }
.gd-req { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gd-req li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; font: 600 var(--fs-sm, 14px)/1.3 var(--font); }
.gd-req li.ok { background: #eef7f2; color: #1f5558; }
.gd-req li.no { background: #fdf1ea; color: #8a3f1f; }
.gd-req li i { font-style: normal; display: inline-flex; }
.gd-req li .sx-btn { margin-left: auto; min-height: 40px; }
.gd-lbl { font: 800 var(--fs-body, 15px) var(--font-head); color: #2f6f73; }
.gd-lbl small { font: 500 var(--fs-xs, 12px) var(--font); color: #8a7a5a; margin-left: 6px; }
.gd-count { align-self: center; font: 700 var(--fs-sm, 13px) var(--font); color: #8a7a5a; min-width: 44px; text-align: right; }
.gd-count.bad { color: #b4401f; }
.gd-embs { display: grid; grid-template-columns: repeat(12, minmax(0, 76px)); gap: 8px; }
#windows .gd-pick { display: flex; align-items: center; justify-content: center; }
.gd-pick { min-height: 58px; padding: 4px; border-radius: 12px; border: 2px solid #eadfc3; background: #fbf6ea; cursor: pointer; }
.gd-pick .gd-emb { width: 48px; height: 48px; }
.gd-pick:hover { background: #fff8e6; }
.gd-pick.on { border-color: #2f6f73; background: #e9f5f1; box-shadow: 0 0 0 3px #2f6f7333; }
.gd-pick:focus-visible { outline: 3px solid #e8b64a; outline-offset: 2px; }
.gd-prev { display: grid; justify-items: center; gap: 2px; padding: 10px; border-radius: 12px; background: linear-gradient(#a7d27e, #86c55e); }
.gd-prev-plate { font: 700 var(--fs-sm, 13px) var(--font); color: #e6fbf6; text-shadow: 0 1px 2px #0b3a3c, 0 0 3px #0b3a3c; }
.gd-prev b { font: 800 var(--fs-body, 15px) var(--font); color: #fff; text-shadow: 0 1px 2px #2a2a2a, 0 0 3px #2a2a2a; }
.gd-make { justify-self: stretch; min-height: 50px; font-size: var(--fs-body, 16px); }
.gd-make:disabled { opacity: .55; cursor: not-allowed; }
.gd-fine { margin: 0; font: 500 var(--fs-xs, 12px)/1.4 var(--font); color: #8a7a5a; }

/* มีกิลด์ */
.gd-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(100deg, #f4fbf8, #fbf3e1); border: 1px solid #cfe3dd; box-shadow: 0 2px 0 #dbe9e3; }
.gd-name { font: 800 var(--fs-title, 22px)/1.2 var(--font-head); color: #1f5558; overflow-wrap: anywhere; }
.gd-head small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font: 500 var(--fs-sm, 13px) var(--font); color: #6b5a3a; }
.gd-role { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font: 700 var(--fs-xs, 12px) var(--font); white-space: nowrap; }
.gd-role.leader { background: #fff1c9; color: #7a5410; border: 1px solid #e8b64a; }
.gd-role.officer { background: #e3f1ef; color: #1f5558; border: 1px solid #9cc9c3; }
.gd-role.member { background: #f3eee2; color: #6b5a3a; border: 1px solid #e0d4b6; }
.gd-notice { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: #fffaf0; border: 1px dashed #e0c98d; font: 600 var(--fs-sm, 14px)/1.35 var(--font); color: #4a3512; }
.gd-notice span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.gd-notice i { color: #8a7a5a; }
.gd-notice .sx-btn { min-height: 38px; }
.gd-rows { display: grid; gap: 6px; }
.gd-row { display: grid; grid-template-columns: 40px minmax(0, 1.3fr) auto minmax(0, 1.4fr) auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 12px; background: #fffdf7; border: 1px solid #ece2c8; }
.gd-row.me { border-color: #9cc9c3; background: #f6fbf9; }
.gd-row.off { background: #faf7ef; }
.gd-row.off .sx-main b { color: #7a6a4a; }
.gd-row .sx-main small { font: 500 var(--fs-xs, 12px) var(--font); color: #8a7a5a; }
.gd-row .sx-acts { display: flex; gap: 6px; justify-content: flex-end; }
.gd-row .sx-btn { min-width: 44px; min-height: 44px; padding: 0 10px; }
.gd-st small { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font: 600 var(--fs-xs, 12px) var(--font); }
.gd-you { font: 700 var(--fs-xs, 11px) var(--font); font-style: normal; color: #fff; background: #2f6f73; border-radius: 999px; padding: 1px 6px; vertical-align: 2px; }
.gd-face { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #efe6cf; display: grid; place-items: center; }
.gd-face img { width: 40px; height: 40px; object-fit: cover; }
.gd-face.off img { filter: grayscale(.6); opacity: .8; }
.gd-rq .gd-face { width: 46px; height: 46px; }
.gd-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; }
.gd-foot small { font: 500 var(--fs-xs, 12px) var(--font); color: #8a7a5a; }
.sx-btn.warn { background: #fff4ef; border-color: #e3a58a; color: #9a3b18; }
.gd-menu b { display: block; padding: 6px 12px 4px; font: 800 var(--fs-sm, 14px) var(--font); color: #2f6f73; }
.gd-menu button.sure { background: #fdeee6; }
.gd-menu button em { font-style: normal; font-size: var(--fs-xs, 12px); color: #9a3b18; }

/* กล่องยืนยัน (อยู่ในหน้าต่างสังคม — ทับเนื้อหาแท็บ ไม่ออกนอกหน้าต่าง) */
.gd-modal { position: fixed; inset: 0; display: grid; place-items: center; background: #2a1f0f66; border-radius: inherit; z-index: 3; }
.gd-modal-box { display: grid; gap: 10px; width: min(420px, calc(100% - 32px)); padding: 16px 18px; border-radius: 16px; background: #fffdf7; border: 2px solid #e8b64a; box-shadow: 0 6px 24px #0004; }
.gd-modal-box b { font: 800 var(--fs-name, 18px) var(--font-head); color: #4a3512; }
.gd-modal-box small { font: 500 var(--fs-sm, 14px)/1.4 var(--font); color: #6b5a3a; }
.gd-modal-box input { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid #d8c69a; background: #fff; font: 600 var(--fs-body, 15px) var(--font); }
.gd-modal-box .sx-acts { display: flex; gap: 8px; justify-content: flex-end; }

/* แท็บหน้าสังคมบนจอสัมผัส (26 ต.ค. ตัดแท็บกิลด์แล้ว เหลือ 5) — ตัวหนังสือ/ช่องว่างเล็กลงให้ชื่อแท็บไม่ถูกตัด · เลขคำขอไม่ทับชื่อ */
html.touch-ui #windows .sx2 .sx-tabs button{ font-size: var(--fs-sm, 13px); gap: 4px; padding: 0 4px; }
html.touch-ui #windows .sx2 .sx-tabs button i .sx-img{ width: 24px; height: 24px; }

/* แคบ (มือถือแนวนอน · หน้าต่างแคบ) */
@media (max-width: 900px), (max-height: 500px) {
  .gd-row { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
  .gd-row .gd-st { grid-column: 2 / 4; grid-row: 2; }
  .gd-row .sx-acts { grid-row: 1 / 3; grid-column: 4; }
  .gd-face, .gd-face img { width: 36px; height: 36px; }
  .gd-embs { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; max-width: none; }
  .gd-pick { min-height: 50px; } .gd-pick .gd-emb { width: 40px; height: 40px; }
  .gd-hero { grid-template-columns: minmax(0, 1fr) auto; } .gd-hero-art { display: none; }
  .gd-head { grid-template-columns: auto minmax(0, 1fr); } .gd-head .sx-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
  .gd-emb.xl { width: 56px; height: 56px; }
  .gd-name { font-size: var(--fs-name, 19px); }
}
