/* สมุดอาชีพ (class-album.js · แท็บ album ในสมุดนักผจญภัย codex.js) — ภาษาภาพเดียวกับสมุด: กระดาษครีม การ์ดขอบทอง
   ล็อก = ไอคอนเงาเทา + 🔒 · ปลดแล้ว = สี + วงทอง · สายครบ 2 ขั้น = การ์ดทอง
   ตามพื้นที่จริง (container cxw ของสมุด · ui-codex.css): กว้าง 3 คอลัมน์ → แคบ 2 → แคบมาก 1 · ตัวอักษรขั้นต่ำ 13px (ยกเว้นป้ายเล็ก) · ปุ่ม 44px บนจอสัมผัส
   ⚠️ ไม่มี animation infinite — การ์ดในตารางวาดซ้ำทุกครั้งที่เปิดสมุด (กฎหน่วยความจำ 4b) */
.ab { display: grid; gap: 10px; padding: 2px 2px 8px; }

/* แถบสรุป */
.ab-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; align-items: center; padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(#fff6dc, #f6e3b0); border: 1.5px solid var(--gold, #e8b64a); box-shadow: 0 2px 6px #8a5a1a1f; }
.ab-count { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 4px; padding-right: 14px; border-right: 1px dashed #d9b56a; }
.ab-count b { font: 800 30px/1 var(--font-head, inherit); color: var(--teal, #2f6f73); }
.ab-count span { font: 700 16px var(--font-head, inherit); color: #8a5a10; }
.ab-count small { grid-column: 1 / -1; font-size: 13px; color: #8a5a10; }
.ab-sum { display: grid; gap: 4px; min-width: 0; }
.ab-sum small { font-size: 13px; color: #8a5a10; }
.ab-sum b { font: 700 14.5px/1.35 var(--font-head, inherit); color: #4a3008; overflow-wrap: anywhere; }
.ab-cu { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 11px; background: #e6f3ee; border: 1px solid #9fcfbf; }
.ab-cu > i { font-style: normal; font-size: 20px; font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; }
.ab-cu > span { display: grid; min-width: 0; } .ab-cu b { font: 800 14.5px var(--font-head, inherit); color: #245d60; } .ab-cu small { font-size: 13px; color: #3d6a5c; }

/* ตาราง 6 สาย + ช่องครบทุกสาย */
.ab-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ab-line { display: grid; align-content: start; gap: 6px; padding: 9px 10px 10px; border-radius: 13px; border: 1.5px solid #e6d6b0;
  background: linear-gradient(#fffdf8, #fbf1dc); color: var(--ink, #3e2c16); min-width: 0; }
.ab-line.half { border-color: #d9b56a; }
.ab-line.full { border-color: var(--gold, #e8b64a); background: linear-gradient(#fff8e2, #fbe9b8); box-shadow: 0 0 0 2px #e8b64a55, 0 3px 8px #8a5a1a22; }
.ab-line.mine { box-shadow: inset 4px 0 0 var(--leaf, #3f8f4e); }
.ab-line.full.mine { box-shadow: inset 4px 0 0 var(--leaf, #3f8f4e), 0 0 0 2px #e8b64a55, 0 3px 8px #8a5a1a22; }
.ab-line > header { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.ab-line > header b { font: 700 14.5px/1.2 var(--font-head, inherit); color: #6b4510; overflow-wrap: anywhere; }
.ab-line > header b i { font-style: normal; color: #c8901a; }
.ab-n, .ab-me { flex: none; padding: 0 8px; border-radius: 999px; font: 700 12.5px/1.6 var(--font-head, inherit); background: #efe4c8; color: #6b5530; }
.ab-line.full .ab-n { background: linear-gradient(#f2c14e, #d99a26); color: #4a3008; }
.ab-me { background: #dcefd6; color: #2f6f3c; }

.ab-tiers { display: grid; gap: 5px; }
.ab-tier { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 7px; border-radius: 10px; background: #f6efdc; }
.ab-tier.on { background: #fffdf4; }
.ab-ic { position: relative; width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: #e7dcc2; }
.ab-ic img { width: 100%; height: 100%; object-fit: contain; border-radius: 11px; filter: grayscale(1) brightness(.78) contrast(.9); opacity: .55; }
.ab-tier.on .ab-ic { background: #fff3cf; box-shadow: 0 0 0 2px var(--gold, #e8b64a), 0 0 8px #e8b64a80; }
.ab-tier.on .ab-ic img { filter: none; opacity: 1; }
.ab-lock { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #fffaf0; border: 1px solid #c9a86a;
  font-style: normal; font-size: 12px; line-height: 1; font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; }
.ab-tx { display: grid; min-width: 0; }
.ab-tx small { font-size: 12.5px; color: var(--mute, #7a6548); overflow-wrap: anywhere; }
.ab-tx b { font: 700 14px/1.25 var(--font-head, inherit); color: #2f5a3c; }
.ab-tier:not(.on) .ab-tx b { color: #7a6548; }
.ab-tx em { font-style: normal; font-size: 12.5px; line-height: 1.3; color: #9a6410; overflow-wrap: anywhere; }
.ab-tx em.ok { color: #2f8f4e; font-weight: 700; }
.ab-new { width: 100%; min-height: 38px; white-space: normal; line-height: 1.2; }
.ab-how { margin: 0; font-size: 12.5px; color: #a8957a; } .ab-how:empty { display: none; }
.ab-fin { align-content: start; }
.ab-fin .mem-rw { padding: 6px 8px; }
.ab-fin .mem-rw b { font-size: 14px; }
.ab-fin .cx-go.on { background: var(--teal, #2f6f73); border-color: var(--teal, #2f6f73); }

/* ปุ่มในหน้าต่างของสกินไม้ถูกตั้งสูง 28px ทั้งเกม */
html body #windows .win[data-win="codex"] .ab button.cx-go { height: auto; }

/* ตามพื้นที่จริงของสมุด (container cxw — ui-codex.css) */
@container cxw (max-width: 1000px) { .ab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container cxw (max-width: 860px) {
  /* มือถือแนวนอน: แถบสรุปบางลง · การ์ด 3 คอลัมน์ถ้ากว้างพอ (เมนูหมวดเหลือไอคอน 62px) */
  .ab-head { padding: 7px 10px; gap: 4px 10px; }
  .ab-count b { font-size: 24px; }
  .ab-grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 6px; }
  .ab-line { padding: 7px 8px 8px; gap: 5px; }
  .ab-tier { grid-template-columns: 40px minmax(0, 1fr); padding: 4px 6px; }
  .ab-ic, .ab-ic img { width: 40px; height: 40px; }
  .ab-new { min-height: 44px; }
}
@container cxw (max-width: 520px) { .ab-head { grid-template-columns: minmax(0, 1fr); } .ab-count { border-right: 0; padding-right: 0; } }

/* ฉากฉลองตอนปลด (celebrate epic · class-album.js albumCelebrate) */
.ab-cel-art { width: min(140px, 22vh); height: min(140px, 22vh); object-fit: contain; border-radius: 22px; box-shadow: 0 0 0 4px #e8b64a, 0 10px 24px #0006; }
.ab-cel .mem-rw > i { display: grid; place-items: center; }
.ab-cel-ic { width: 30px; height: 30px; object-fit: contain; border-radius: 7px; }
@media (max-height: 520px) { .ab-cel-art { width: 96px; height: 96px; border-radius: 16px; } }

/* แท็บนี้ไม่มีอะไรให้ค้นหา — ซ่อนช่องค้นหา (จอแคบซ่อนทั้งแถวบน คืนที่ให้การ์ด) */
.cx[data-cx="album"] .cx-search { display: none; }
@container cxw (max-width: 860px) { .cx[data-cx="album"] .cx-main > .cx-top { display: none; } }

/* หน้าสถานะ: ป้ายตามทัน */
.ab-status .ab-cu-chip { background: #e6f3ee; color: #245d60; }
