/* หน้าต่างหลักในเกม (core.js) — ใช้ตัวแปรจาก theme.css เท่านั้น */

/* ---------- สถานะ ---------- */
.st-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.st-ava { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 24px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, var(--surface-3), var(--bg)); border: 2px solid var(--gold-2); }
.st-name { font-weight: 700; font-size: 15px; }
.st-pts { display: flex; flex-direction: column; align-items: center; padding: 4px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.st-pts b { font-size: 20px; color: var(--text-2); }
.st-pts.has { border-color: var(--gold); box-shadow: 0 0 12px color-mix(in srgb, var(--gold) 25%, transparent); }
.st-pts.has b { color: var(--gold); }
.st-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; }
.st-stats { display: flex; flex-direction: column; gap: 3px; }
.st-row { display: grid; grid-template-columns: 34px 1fr auto 38px; align-items: center; gap: 6px; padding: 2px 4px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--bg) 40%, transparent); }
.st-k { font-weight: 800; color: var(--info); font-size: 12px; letter-spacing: .04em; }
.st-v { font-weight: 700; }
.st-v em { font-style: normal; color: var(--ok); font-size: 11.5px; margin-left: 3px; }
.st-add { width: 26px; min-height: 26px; }
.st-add:not(:disabled) { border-color: var(--gold-2); color: var(--gold); }
.st-cost { text-align: right; }
.st-hint { margin: 4px 0 0; }
.st-derived { align-content: start; padding: 8px 10px; border-radius: var(--r); background: color-mix(in srgb, var(--bg) 40%, transparent); border: 1px solid var(--line); }
.st-derived dt { font-size: 12px; font-weight: 700; }
.st-derived dd { text-align: right; }
.moon-tag { font-size: 11px; color: var(--moon-glow); }
.st-weight { margin-top: 10px; }
.st-weight .bar { margin: 4px 0 2px; }

/* ---------- อุปกรณ์ ---------- */
.eq-doll { display: grid; grid-template-columns: 1fr 140px 1fr; gap: 8px; align-items: stretch; }
.eq-col { display: flex; flex-direction: column; gap: 6px; }
.eq-cell { display: flex; align-items: center; gap: 6px; min-height: var(--slot); }
.eq-cell.l { justify-content: flex-end; text-align: right; }
.eq-lbl { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.eq-item { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-art { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; border-radius: var(--r); overflow: hidden; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--moon-glow) 18%, transparent), transparent 70%), linear-gradient(var(--surface), var(--bg)); border: 1px solid var(--line); }
.eq-art img { width: 100%; height: 230px; object-fit: contain; object-position: bottom; }
.eq-art [data-artph] { width: 100%; }
.eq-art-name { position: absolute; top: 6px; left: 0; right: 0; text-align: center; font-weight: 700; font-size: 12px; color: var(--moon); text-shadow: 0 1px 2px var(--bg); }
.eq-total { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; }

/* ---------- กระเป๋า ---------- */
.inv-tabs button { padding: 6px 8px; }
.inv-tools { margin-bottom: 8px; }
.inv-tools .input { min-height: 32px; padding: 4px 10px; }
.inv-grid { grid-template-columns: repeat(auto-fill, minmax(var(--slot), 1fr)); justify-items: center; max-height: 280px; overflow-y: auto; padding: 2px; }
.inv-hint { margin: 8px 0 0; }
.inv-act { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-2); animation: drop .12s; }
.inv-act-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-btns { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.inv-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.inv-w .bar { height: 14px; }
.inv-crystal { background: none; border: 0; color: var(--text); cursor: pointer; padding: 2px 4px; border-radius: var(--r-sm); }
.inv-crystal:hover { background: var(--surface-3); }

/* ---------- สกิล ---------- */
.sk-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sk-pts { padding: 3px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; }
.sk-pts.has { border-color: var(--gold); color: var(--gold); }
.sk-list { display: flex; flex-direction: column; gap: 4px; }
.sk-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--bg) 40%, transparent); border: 1px solid var(--line); }
.sk-row.locked .slot { filter: grayscale(1); opacity: .6; }
.sk-row [data-drag] { cursor: grab; }
.sk-name { font-size: 13px; }
.sk-dots { display: flex; gap: 3px; margin: 3px 0 1px; }
.sk-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-2); }
.sk-dots i.on { background: var(--gold); border-color: var(--gold-2); box-shadow: 0 0 4px color-mix(in srgb, var(--gold) 60%, transparent); }
.sk-req { margin-top: 2px; }

/* ---------- เควสต์ ---------- */
.q-wrap { display: grid; grid-template-columns: 190px 1fr; gap: 10px; min-height: 260px; }
.q-list { border-right: 1px solid var(--line); padding-right: 6px; max-height: 380px; overflow-y: auto; }
.q-list .item { padding: 6px; border-radius: var(--r-sm); border-bottom: 0; }
.q-list .item.on { box-shadow: inset 2px 0 0 var(--gold); }
.q-li-name { font-size: 12.5px; margin-bottom: 4px; }
.q-detail { min-width: 0; }
.q-name { font-size: 16px; color: var(--gold); }
.q-desc { color: var(--text-2); line-height: 1.6; margin: 8px 0; }
.q-goal { margin-bottom: 6px; }
.q-goal.done { color: var(--ok); }
.q-goal .bar { margin-top: 3px; }
.q-rew { display: flex; flex-wrap: wrap; gap: 4px; }
.q-acts { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ---------- อาชีพ ---------- */
.jb-note { padding: 8px 10px; border-radius: var(--r); font-size: 12.5px; line-height: 1.5; color: var(--text-2); background: color-mix(in srgb, var(--info) 10%, transparent); border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); }
.jb { display: flex; align-items: center; gap: 10px; padding: 10px; }
.jb-glyph { width: 42px; height: 42px; flex: none; display: grid; place-items: center; font-size: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); }
.jb-locked { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.jb-l { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); border: 1px dashed var(--line-2); opacity: .8; }
.jb-lg { font-size: 20px; filter: grayscale(.8); }

/* ---------- ร้าน NPC ---------- */
.shop-list { max-height: 250px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); }
.shop-row { gap: 8px; }
.shop-name { font-size: 13px; font-weight: 600; }
.shop-price { color: var(--gold); font-size: 12.5px; white-space: nowrap; }
.shop-cart { margin-top: 6px; }
.cart-row { padding: 4px 6px; gap: 6px; }
.cart-g { font-size: 18px; }
.cart-q { min-width: 26px; text-align: center; }
.cart-sub { min-width: 56px; text-align: right; color: var(--gold); }

/* ---------- ตั้งค่า ---------- */
.set-body { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-l { font-size: 13.5px; }
.set-row .seg { flex: none; }
.set-range { display: flex; align-items: center; gap: 8px; width: 170px; flex: none; }
.set-range [data-rv] { width: 34px; text-align: right; }
.set-keys { margin-top: 8px; }
.set-lang { display: flex; justify-content: space-between; align-items: center; width: 100%; color: var(--text); font: inherit; text-align: left; }
.set-acc { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.set-acc code { color: var(--text-2); }
.set-del { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }

/* ---------- แผนที่โลก ---------- */
.wm-map {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; border: 1px solid var(--gold-2);
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--bg) 80%, transparent), inset 0 0 0 3px color-mix(in srgb, var(--gold-2) 35%, transparent);
  background:
    radial-gradient(ellipse at 35% 60%, color-mix(in srgb, var(--jexp) 22%, transparent), transparent 45%),
    radial-gradient(ellipse at 68% 40%, color-mix(in srgb, var(--jexp) 18%, transparent), transparent 40%),
    radial-gradient(ellipse at 82% 72%, color-mix(in srgb, var(--sp) 28%, transparent), transparent 30%),
    radial-gradient(ellipse at 25% 28%, color-mix(in srgb, var(--hp) 12%, transparent), transparent 25%),
    repeating-linear-gradient(0deg, transparent 0 39px, color-mix(in srgb, var(--gold) 7%, transparent) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, color-mix(in srgb, var(--gold) 7%, transparent) 39px 40px),
    linear-gradient(160deg, var(--surface-2), var(--bg));
}
.wm-compass { position: absolute; right: 10px; bottom: 8px; font-size: 26px; opacity: .6; }
.wm-moon { position: absolute; right: 18px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 38% 36%, var(--moon), var(--gold-2)); box-shadow: 0 0 22px var(--moon-glow); opacity: .85; }
.wm-pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0; background: none; border: 0; color: var(--text); cursor: pointer; }
.wm-ico { width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--frame); box-shadow: var(--shadow); transition: transform .12s; }
.wm-pin:hover .wm-ico { transform: scale(1.12); border-color: var(--frame-hi); }
.wm-pin.k-town .wm-ico { border-color: var(--gold-2); }
.wm-pin.k-dungeon .wm-ico { border-color: var(--danger); }
.wm-pin.k-farm .wm-ico { border-color: var(--jexp); }
.wm-pin.k-rest .wm-ico { border-color: var(--info); }
.wm-pin.sel .wm-ico { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent), var(--shadow); }
.wm-lbl { font-size: 11.5px; font-weight: 700; white-space: nowrap; text-shadow: 0 1px 2px var(--bg), 0 0 3px var(--bg); }
.wm-here { position: absolute; top: -20px; padding: 0 6px; border-radius: 8px; font-size: 10px; font-weight: 800; white-space: nowrap; background: var(--moon-glow); color: var(--bg); animation: bob 1.4s ease-in-out infinite; }
.wm-pin.cur .wm-ico { border-color: var(--moon-glow); animation: pinPulse 1.6s infinite; }
.wm-legend { position: absolute; left: 8px; bottom: 6px; display: flex; flex-wrap: wrap; gap: 8px; padding: 3px 8px; border-radius: 10px; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text-2); }
.wm-info { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.wm-info-ico { font-size: 26px; }

/* ---------- โปรไฟล์ ---------- */
.pf-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r); background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); }
.pf-ava { width: 56px; height: 56px; flex: none; display: grid; place-items: center; font-size: 28px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold-2); }
.pf-name { font-size: 16px; font-weight: 700; word-break: break-all; }
.pf-kv { margin: 10px 2px; }
.pf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* ---------- เมนูระบบ ---------- */
.sys-menu { margin-bottom: 8px; }
.sys-menu .btn { justify-content: flex-start; }

/* ---------- จอเล็ก ---------- */
@media (max-width: 760px), (max-height: 480px) {
  .st-grid { grid-template-columns: 1fr; }
  .eq-doll { grid-template-columns: 1fr 96px 1fr; }
  .eq-art img { height: 170px; }
  .eq-item { font-size: 11px; }
  .q-wrap { grid-template-columns: 1fr; }
  .q-list { border-right: 0; padding-right: 0; max-height: 160px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  .inv-grid { max-height: none; }
  .set-row { flex-wrap: wrap; }
  .set-range { width: 100%; }
  .hb-pick { grid-template-columns: repeat(5, auto); }
  .wm-lbl { font-size: 10px; }
  .wm-ico { width: 28px; height: 28px; font-size: 15px; }
}
@media (max-width: 420px) {
  .eq-doll { grid-template-columns: 1fr 1fr; }
  .eq-art { grid-column: 1 / -1; order: -1; }
  .eq-art img { height: 150px; }
}

@keyframes pinPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--moon-glow) 25%, transparent); } }
.jb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; margin-top: 8px; }
.jb-grid .jb { padding: 8px; }
.jb-kit { margin-top: 3px; color: var(--gold); cursor: help; }
/* บอท */
.win-hact { display: flex; margin-right: 4px; }
.bot-go { min-width: 92px; font-weight: 700; }
.bot-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); }
.bot-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3, #8a8fb0); }
.bot-status.on { border-color: var(--gold); }
.bot-status.on i { background: #7be08a; box-shadow: 0 0 8px #7be08a; animation: botPulse 1.4s infinite; }
.bot-status .tiny { flex-basis: 100%; }
@keyframes botPulse { 50% { opacity: .35; } }
.bot-radius { display: grid; gap: 6px; }
.bot-radius input[type=range] { width: 100%; height: 22px; appearance: none; background: none; cursor: pointer; }
.bot-radius input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 99px; border: 1px solid var(--frame);
  background: linear-gradient(90deg, #f3cf74 0 var(--p), #1a1f3b var(--p) 100%); }
.bot-radius input[type=range]::-moz-range-track { height: 10px; border-radius: 99px; border: 1px solid var(--frame); background: #1a1f3b; }
.bot-radius input[type=range]::-moz-range-progress { height: 10px; border-radius: 99px; background: #f3cf74; }
.bot-radius input[type=range]::-webkit-slider-thumb { appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff3cf, #f3cf74 55%, #a8844a); border: 2px solid #1a1f3b; box-shadow: 0 0 0 1px var(--frame), 0 2px 6px rgba(0,0,0,.5); }
.bot-radius input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #f3cf74; border: 2px solid #1a1f3b; }
.bot-marks { display: flex; justify-content: space-between; gap: 4px; }
.bot-marks button { flex: 1; padding: 3px 0; font-size: 11px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.bot-marks button.on { border-color: var(--gold); color: var(--gold); }
.bot-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.bot-mob { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 6px; padding: 5px 7px; text-align: left; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); color: var(--text); cursor: pointer; }
.bot-mob img { grid-row: span 2; width: 34px; height: 34px; }
.bot-mob.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.bot-mob.off { opacity: .45; }
.bot-seg { display: flex; }
.bot-seg button { flex: 1; }
.bot-types { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.bot-types.dim { opacity: .45; }
.bot-type { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; cursor: pointer; }
.bot-type input { accent-color: var(--gold); }
.bot-only { display: flex; flex-wrap: wrap; margin-bottom: 8px; }
.bot-field { display: grid; grid-template-columns: 1fr 1.2fr 64px auto; align-items: center; gap: 8px; margin: 6px 0; font-size: 12.5px; }
.bot-field input[type=range] { width: 100%; accent-color: var(--gold); }
.bot-num { width: 64px; padding: 4px 6px; }
.bot-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.bot-sk { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); cursor: pointer; }
.bot-sk.on { border-color: var(--gold); color: var(--text); box-shadow: inset 0 0 0 1px var(--gold); }
@media (max-width: 480px) { .bot-field { grid-template-columns: 1fr 64px auto; } .bot-field input[type=range] { grid-column: 1 / -1; order: 2; } }
@media (prefers-reduced-motion: reduce) { .bot-status.on i { animation: none; } }
.bot-radius.dim input[type=range] { opacity: .4; }
.bot-whole { flex: 1.6 !important; font-weight: 700; }
.bot-whole.on { background: linear-gradient(#3a4478, #283060) !important; }
.bot-pot { padding: 6px 8px; margin-bottom: 6px; border-radius: var(--r-sm); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.bot-pot.dim .bot-field, .bot-pot.dim .bot-pots { opacity: .45; }
.bot-pot .hp-c { color: #ff9a8a; } .bot-pot .sp-c { color: #8fc4ff; }
.bot-pots { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-potion { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); color: var(--text); cursor: pointer; text-align: left; line-height: 1.25; }
.bot-potion .slot { position: relative; width: 34px; height: 34px; }
.bot-potion.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.bot-potion.empty { opacity: .5; }

/* เปลี่ยนอาชีพ: 10 อาชีพซ้าย + ตาราง 3 สาย × 5 Tier */
.jb2 { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.jb2 .cg-list { max-height: 560px; overflow-y: auto; }
.jb2 .cg-job { grid-template-columns: 30px 1fr auto; padding: 5px 7px; }
.jb2 .cg-job .job-ava { width: 30px; height: 30px; }
.jb2 .cg-job { grid-template-columns: 44px 1fr auto; }
.jb-bust.class-bust { width: 44px; border-radius: 8px; }
.cg-head h3 { display: flex; align-items: center; gap: 8px; }
.jb-bust.lg.class-bust { width: 56px; }
.cg-job.on .class-bust, .cg-job:hover .class-bust { border-color: var(--frame-hi); box-shadow: 0 0 12px rgba(243,207,116,.35); }
.jb2-body { min-width: 0; }
.jb2-grid { display: grid; grid-template-columns: 78px repeat(4, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.jb2-th { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15; color: var(--gold); }
.jb2-rh { display: flex; align-items: center; font-size: 12.5px; color: var(--text); }
.jb2-cell { position: relative; display: flex; flex-direction: column; align-items: center; padding: 3px 3px 22px; border-radius: 9px; border: 1px solid var(--line-2); background: radial-gradient(ellipse at 50% 85%, rgba(159,216,255,.14), transparent 65%), var(--bg-2); cursor: pointer; font: inherit; }
.jb2-cell .class-art { width: 100%; }
.jb2-cell:hover:not(.locked):not(.cur) { border-color: var(--frame-hi); transform: translateY(-1px); }
.jb2-cell.cur { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), 0 0 12px rgba(243,207,116,.3); cursor: default; }
.jb2-cell.locked { cursor: not-allowed; }
.jb2-cell.locked .class-art { filter: grayscale(1) brightness(.45); }
.jb2-tag { position: absolute; left: 3px; right: 3px; bottom: 3px; font-size: 10.5px; text-align: center; padding: 2px 0; border-radius: 6px; background: rgba(10,12,28,.75); color: var(--text-2); }
.jb2-cell.cur .jb2-tag { color: var(--gold); }
@media (max-width: 760px) { .jb2 { grid-template-columns: 1fr; } .jb2 .cg-list { flex-direction: row; overflow-x: auto; max-height: none; } .jb2-grid { grid-template-columns: 56px repeat(4, minmax(0, 1fr)); } }

/* หน้าต่างเปลี่ยนอาชีพ (D-055) — 3 คอลัมน์ในจอเดียว: รายชื่ออาชีพ | ภาพ | รายละเอียด (ไม่ต้องเลื่อน) */
.jw { display: grid; grid-template-columns: 290px minmax(220px, 1fr) 340px; gap: 12px; height: min(600px, calc(100vh - 110px)); min-height: 0; }
.jw-list { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.jw-first { margin: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.jw-cards { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 5px; flex: 1; min-height: 0; }
.jw-card { display: flex; align-items: center; gap: 7px; padding: 4px 6px; min-height: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; }
.jw-card:hover { border-color: var(--frame-hi); }
.jw-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.jw-card .class-bust { width: 42px; flex: none; }
.jw-ct { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.jw-ct b { font-size: 13px; }
.jw-ct .cc-stars { font-size: 9px; letter-spacing: 0; }
.jw-curtag { color: var(--gold); font-weight: 700; }
.jw-hint { margin: 0; }
.jw-stage { position: relative; min-height: 0; display: grid; place-items: center; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(ellipse at 50% 88%, color-mix(in srgb, var(--moon-glow) 22%, transparent), transparent 62%), var(--bg-2); }
.jw-stage { container-type: size; }
.jw-stage .class-art { height: min(94cqh, 114cqw); width: auto; } /* สัดส่วนภาพ 400:480 — ไม่ล้นกรอบทั้งกว้างและสูง */
.jw-tiertag { position: absolute; left: 8px; top: 8px; }
.jw-playing { position: absolute; right: 8px; top: 8px; }
.jw-info { display: flex; flex-direction: column; gap: 5px; min-height: 0; }
.jw-head { display: flex; align-items: center; gap: 8px; }
.jw-head .class-face, .jw-head > :first-child { flex: none; }
.jw-head h3 { margin: 0; font-size: 20px; color: var(--moon); line-height: 1.1; }
.jw-meta { gap: 6px; margin-top: 3px; }
.jw-desc { margin: 0; color: var(--text-2); }
.jw-lbl { font-size: 11.5px; font-weight: 700; color: var(--gold); margin-top: 3px; }
.jw-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.jw-seg.jw-tiers { grid-template-columns: repeat(4, 1fr); }
.jw-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 5px 3px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 12.5px; cursor: pointer; min-width: 0; }
.jw-opt.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); font-weight: 700; }
.jw-opt.locked { opacity: .5; }
.jw-opt span { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.jw-kit { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.jw-kit .row { gap: 4px; align-items: center; }
.jw-kit .slot { width: 38px; height: 38px; }
.jw-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.jw-stat { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.jw-stat > span { width: 26px; font-weight: 700; color: var(--text-2); }
.jw-stat .bar.thin { height: 6px; }
.jw-play { margin-top: auto; width: 100%; }
@media (max-width: 900px) {
  .jw { grid-template-columns: 1fr; height: auto; }
  .jw-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: auto; }
  .jw-card { flex-direction: column; text-align: center; padding: 5px 2px; }
  .jw-card .jw-ct .tiny:not(.jw-curtag) { display: none; }
  .jw-stage { height: 240px; }
}

/* หน้าต่างเปลี่ยนอาชีพแบบเดิม — กระชับ (2026-09-27): รายชื่อเต็มความสูงบนคอม, เลื่อนได้บนมือถือ/หน้าต่างเล็ก */
.jb-note-sm { padding: 5px 9px; font-size: 12px; }
.jb-note-sm summary { cursor: pointer; }
.jb2 { grid-template-columns: 172px minmax(0, 1fr); gap: 10px; margin-top: 6px; }
.jb2 .cg-list { max-height: none; overflow: visible; gap: 4px; }
.jb2 .cg-job { grid-template-columns: 34px 1fr auto; gap: 6px; padding: 3px 6px; min-height: 0; }
.jb2 .cg-job .cg-jn b { font-size: 13px; }
.jb2 .cg-job .tag { font-size: 9.5px; padding: 0 5px; }
.jb-bust.class-bust { width: 34px; border-radius: 7px; }
.jb-bust.lg.class-bust { width: 46px; }
.jb-head { display: flex; align-items: center; gap: 8px; padding: 0; }
.jb-htxt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.jb-hrow { gap: 6px; align-items: center; }
.jb-head h3 { margin: 0; font-size: 17px; }
.jb-info { display: grid; grid-template-columns: auto auto minmax(180px, 1fr); gap: 8px; margin: 6px 0 4px; }
.jb-box { border: 1px solid var(--line); border-radius: 9px; padding: 4px 7px 6px; background: var(--surface-2); min-width: 0; }
.jb-lbl { font-size: 10.5px; font-weight: 700; color: var(--gold); margin-bottom: 3px; }
.jb-wpn { gap: 5px; align-items: center; }
.jb-skills { gap: 3px; }
.jb-info .slot { width: 34px; height: 34px; }
.jb-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 3px 10px; }
.jb-stat { display: flex; align-items: center; gap: 4px; font-size: 10.5px; }
.jb-stat > span { width: 24px; font-weight: 700; color: var(--text-2); }
.jb-stat .bar.thin { height: 5px; }
.jb-hint { margin: 0 0 4px; }
.jb2-grid { gap: 5px; }
.jb2-th { font-size: 12px; }
.jb2-cell { padding: 2px 2px 19px; }
.jb2-cell .class-art { width: auto; height: 118px; max-width: 100%; }
.jb2-tag { font-size: 10px; padding: 1px 0; }
@media (max-width: 760px) {
  .jb2 { grid-template-columns: 1fr; }
  .jb2 .cg-list { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .jb2 .cg-job { flex: none; min-width: 132px; }
  .jb-info { grid-template-columns: 1fr 1fr; }
  .jb-statbox { grid-column: 1 / -1; }
  .jb2-cell .class-art { height: 88px; }
}

/* หน้าต่างสกิล (2026-09-27): แท็บ Tier + การ์ดสกิล 2 คอลัมน์ */
.skw-top { display: flex; align-items: center; gap: 10px; }
.skw-top .tag { font-size: 10.5px; }
.skw-bust.class-bust { width: 40px; border-radius: 8px; }
.skt-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.skt-tab { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; min-width: 0; }
.skt-tab b { font-size: 13px; }
.skt-tab span { font-size: 10px; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skt-count { position: absolute; right: 7px; top: 6px; font-size: 10px; font-style: normal; color: var(--text-2); }
.skt-tab:hover:not(:disabled) { border-color: var(--frame-hi); }
.skt-tab.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); box-shadow: 0 0 0 1px var(--gold); }
.skt-tab.t2.on { border-color: #c9d3e6; box-shadow: 0 0 0 1px #c9d3e6; background: color-mix(in srgb, #c9d3e6 12%, var(--surface)); }
.skt-tab.t4.on { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(120deg, #ff6a9a, #fff6a0, #6affd0, #7aa8ff, #e08aff) border-box; border: 1.5px solid transparent; box-shadow: 0 0 12px rgba(224, 138, 255, .35); }
.skt-tab:disabled { opacity: .45; cursor: not-allowed; }
.skc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.skc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 45%, transparent); }
.skc.max { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.skc.locked .slot { filter: grayscale(1); opacity: .6; }
.skc [data-drag] { cursor: grab; }
.skc-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.skc-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.skc-meta { display: flex; gap: 8px; color: var(--text-2); }
.skc-tag { padding: 0 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.skc-lv { display: flex; align-items: center; gap: 6px; }
.skc-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.skc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2, #c89b3c), var(--gold)); }
.skc-desc { line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skc-act { display: flex; flex-direction: column; gap: 4px; }
.skw-hint { margin: 8px 0 0; }
@media (max-width: 520px) { .skt-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ค่าสถานะในหน้าต่างเปลี่ยนอาชีพ: แบบหน้าต่าง Status ของ Ragnarok — ชื่อค่า + ตัวเลขในช่อง 2 คอลัมน์ ไม่มีกราฟ/หลอด */
.jb-info { grid-template-columns: auto auto auto; justify-content: start; }
.ro-stats { display: grid; grid-template-columns: repeat(2, 76px); gap: 3px 12px; justify-content: start; }
.ro-stat { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.ro-stat span { color: var(--text-2); font-weight: 700; }
.ro-stat b { min-width: 22px; padding: 0 5px; text-align: right; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: inset 0 1px 2px rgba(0,0,0,.45); font-size: 12px; }
.ro-stat.hi b { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line-2)); }
.ro-stat.lo b { color: var(--muted); }
@media (max-width: 760px) { .jb-info { grid-template-columns: 1fr 1fr; } .ro-stats { grid-template-columns: repeat(3, 76px); } }
.ro-wrap { display: flex; align-items: center; gap: 12px; }
.ro-wrap .cc-radar { width: 92px; height: 92px; flex: none; }

/* ======================================================================
   หน้าต่างเปลี่ยนอาชีพ "หอแห่งโชคชะตา" (D-060) — จาก handoff job-change-modal-v1
   กรอบทองหลายชั้น · มุมเถาวัลย์ · มงกุฎอัญมณี · กรอบการ์ดแกะลาย · สีเน้นตามอาชีพ (--pm-accent = "R,G,B")
   ลวดลาย SVG: assets/ui/job-modal/ · พฤติกรรมยืด/ขยาย/ไอคอน มาจาก core/wm.js (.win-resize/.win-maxed/.win-iconified)
   ====================================================================== */
/* ---------- กรอบหน้าต่างมาตรฐาน (D-061): ทุกหน้าต่างใช้กรอบเดียวกับหอแห่งโชคชะตา ---------- */
.win.pm-frame {
  --pm-gold: #f3d58d; --pm-ink: #f7f0df; --pm-accent: 214,176,96;
  container: pmwin / inline-size; isolation: isolate; overflow: hidden;
  max-width: calc(100vw - 8px); max-height: calc(100dvh - 8px);
  border: 2px solid #e5c171; border-radius: 18px;
  background: radial-gradient(circle at 50% -20%, #27375e 0, #101b32 35%, #0a1021 78%);
  box-shadow: 0 0 0 5px #10162d, 0 0 0 8px #b1833d, 0 0 0 10px #342744, 0 32px 95px #000d, inset 0 0 0 2px #e9c57a55, inset 0 0 60px #b8913730;
}
.win.pm-frame.focused { border-color: #ffe7a6; }
.win.pm-frame::before { content: ""; position: absolute; inset: 12px; left: 12px; top: 12px; right: 12px; width: auto; height: auto; background: none; filter: none; transform: none; pointer-events: none; border: 2px solid #e4bd6e78; border-radius: 9px; box-shadow: inset 0 0 0 5px #a5762230, 0 0 0 4px #ab793042; z-index: 5; }
.win.pm-frame::after { content: ""; position: absolute; left: 50%; right: auto; top: -8px; width: 430px; max-width: 36%; height: 108px; max-height: 60px; transform: translateX(-50%); background: url("../../../../assets/ui/job-modal/crown-crest.svg") center top / contain no-repeat; filter: none; pointer-events: none; z-index: 6; }
.pm-corner { position: absolute; width: clamp(56px, 11cqi, 145px); aspect-ratio: 1; z-index: 7; pointer-events: none; background: url("../../../../assets/ui/job-modal/corner-filigree.svg") center / contain no-repeat; filter: drop-shadow(0 0 7px #efd27c88); }
.pm-corner--tl { left: 3px; top: 3px; }
.pm-corner--tr { right: 3px; top: 3px; transform: rotate(90deg); }
.pm-corner--bl { left: 3px; bottom: 3px; transform: rotate(270deg); }
.pm-corner--br { right: 3px; bottom: 3px; transform: rotate(180deg); }

/* หัวหน้าต่าง: ลากย้ายได้ทั้งเมาส์และนิ้ว */
.win.pm-frame > .win-head {
  position: relative; display: flex; align-items: center; gap: 10px; flex: none; min-height: 58px; padding: 6px clamp(18px, 4cqi, 54px) 6px clamp(22px, 4.5cqi, 57px); cursor: move; touch-action: none; user-select: none;
  border: 0; border-bottom: 1px solid #bd9b566b; border-radius: 16px 16px 0 0; border-image: none;
  background: radial-gradient(ellipse at 50% 0, #71603b61, transparent 40%), linear-gradient(90deg, #102143, #233257 52%, #111f40);
  box-shadow: 0 10px 36px #0005;
}
.win.pm-frame > .win-head::after { content: ""; position: absolute; left: clamp(40px, 12cqi, 175px); right: clamp(40px, 12cqi, 175px); bottom: 3px; border-bottom: 2px solid #e2c0717d; box-shadow: 0 4px 12px #eabf5c55; pointer-events: none; }
.win.pm-frame > .win-head .t { flex: 1; min-width: 0; display: flex; align-items: center; gap: clamp(10px, 2cqi, 20px); white-space: normal; overflow: visible; font: inherit; color: inherit; text-shadow: none; letter-spacing: 0; }
.win.pm-frame > .win-head kbd { position: relative; z-index: 9; }
.win.pm-frame > .win-head .win-hact { position: relative; z-index: 9; }
.pm-sigil { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 2px solid #ffebaa; border-radius: 50%; background: radial-gradient(circle, #9c743a66 0, #3c3560 50%, #101932 76%); box-shadow: 0 0 0 3px #744d2b, 0 0 0 5px #d9b66b, 0 0 18px #f6cb5b99, inset 0 0 12px #f6c86a8c; color: #ffedae; font: 22px Georgia, serif; }
.pm-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 0 1px; color: #ffe9b8; font: 600 clamp(16px, 2.2cqi, 24px)/1.2 Georgia, "Trirong", serif; text-shadow: 0 2px 0 #6d4529, 0 0 24px #f6c85e99; }
.win.pm-frame > .win-head .win-ctl { display: flex; gap: 3px; margin-left: 2px; }
.win.pm-frame > .win-head .wb, .win.pm-frame > .win-head .x {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 1px solid #d5bb79a4; border-radius: 50%; color: #ebcf8b; font: 22px/1 Georgia, serif; cursor: pointer;
  background: #151d38f2; box-shadow: 0 0 0 2px #0a1021, 0 0 10px #000a;
}
.win.pm-frame > .win-head .x { margin-left: -7px; } /* หัวหน้าต่างมี gap 10px → ห่างปุ่ม □ 3px */
.win.pm-frame > .win-head .win-ctl:empty + .x { margin-left: 0; }
.win.pm-frame > .win-head .win-ctl, .win.pm-frame > .win-head .x { position: relative; z-index: 9; }
.win.pm-frame > .win-head .wb:hover, .win.pm-frame > .win-head .x:hover, .win.pm-frame > .win-head .wb:focus-visible, .win.pm-frame > .win-head .x:focus-visible { border-color: #ffe5a2; background: #6b583773; box-shadow: 0 0 12px #e6bb6b66; }
.win.pm-frame > .win-body { padding: 14px clamp(16px, 4cqi, 24px) 18px; }
.win.pm-frame > .win-foot { position: relative; z-index: 8; min-height: 36px; padding: 4px clamp(48px, 11cqi, 155px); border-top: 2px solid #f0c974; border-radius: 0 0 16px 16px;
  background: radial-gradient(ellipse at 50% 0, #bc934d35, transparent 55%), linear-gradient(90deg, #13243f, #213153 50%, #13243f); box-shadow: inset 0 4px 0 #ad7c3755; }

/* หน้าต่างเปลี่ยนอาชีพ: หัวแบบมีคำนำ + ชิปอาชีพปัจจุบัน */
.win.pm-job-modal { color: var(--pm-ink); }
.pm-job-heading { display: flex; flex-direction: column; min-width: 0; }
.pm-job-overline, .pm-job-kicker { color: var(--pm-gold); font: 700 10px/1.4 Georgia, serif; letter-spacing: 2.4px; text-transform: uppercase; }
.pm-job-sub { display: none; }
.pm-job-current { margin-left: auto; padding: 8px 14px; border: 1px solid #c8a66563; border-radius: 99px; background: #d6af4c10; color: #aeb3ce; font-size: 11px; white-space: nowrap; }
.pm-job-current b { margin-left: 6px; color: #ffdf93; }

/* เนื้อหา */
.win.pm-job-modal > .win-body { display: flex; padding: 0; overflow: hidden; min-height: 0; flex: 1; }
.pm-job-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); flex: 1; min-height: 0; min-width: 0; }
.pm-job-sidebar { overflow: auto; padding: 20px 12px 20px 16px; border-right: 2px solid #d9ac5b9e; box-shadow: inset -6px 0 15px #0006;
  background: radial-gradient(circle at 50% 20%, #b8903b1c, transparent 35%), repeating-linear-gradient(45deg, transparent 0 30px, #e6c17b08 31px 32px, transparent 33px 62px), linear-gradient(180deg, #152544, #0c1730 58%, #080f21); }
.pm-job-sidebar h2 { margin: 5px 0 4px; color: #ffe8ac; font: 600 19px Georgia, "Trirong", serif; text-shadow: 0 0 13px #ecbd6d77; }
.pm-job-sidebar > p { margin: 0 0 15px; color: #9faac0; font-size: 11px; }
.pm-job-class-list { display: grid; gap: 7px; }
.pm-job-class { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 6px 10px 6px 7px; border: 1px solid #ae8d579c; border-radius: 10px; background: linear-gradient(135deg, #253453, #10192e 55%, #1b2542); box-shadow: inset 0 0 0 2px #d9b87117; color: #e9eaf2; text-align: left; cursor: pointer; transition: transform .18s, border-color .18s; }
.pm-job-class:hover { transform: translateX(2px); border-color: #deb9778c; }
.pm-job-class[aria-current="true"] { border: 2px solid #fbe3a2; background: linear-gradient(90deg, rgba(var(--pm-accent), .27), #20304a 78%); box-shadow: inset 0 0 0 2px #b37d34, 0 0 19px rgba(var(--pm-accent), .38), 0 0 26px #e0b75e55; }
.pm-job-class .class-bust { flex: none; }
.pm-job-cn { min-width: 0; }
.pm-job-cn strong, .pm-job-cn small { display: block; }
.pm-job-cn strong { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.pm-job-spark { color: #cfaa62aa; font: normal 11px Georgia, serif; }
.pm-job-cn small { color: #9fa7c2; font-size: 10px; }
.pm-job-class[aria-current="true"] small { color: #f0d49e; }
.pm-job-curmark { color: #ffdf93; font-style: normal; font-size: 13px; text-shadow: 0 0 8px #f3c75f; }
.pm-job-cn small { line-height: 1.3; white-space: nowrap; }

.pm-job-content { min-width: 0; overflow: auto; padding: 20px 26px 30px;
  background: radial-gradient(ellipse at 50% 10%, rgba(var(--pm-accent), .085), transparent 47%), repeating-radial-gradient(circle at 50% 54%, transparent 0 66px, #e3c17806 67px 68px, transparent 69px 132px); }
.pm-job-note { margin: 0 0 12px; padding: 7px 12px; border: 1px solid #c8a66563; border-radius: 8px; background: #0c152ac9; color: #c8cae0; font-size: 12px; }
.pm-job-note summary { cursor: pointer; color: #f0d49e; }
.pm-job-hero { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 8px 14px; border: 2px solid #f1ce83; border-radius: 13px;
  background: radial-gradient(circle at 16% 45%, rgba(var(--pm-accent), .31), transparent 34%), linear-gradient(105deg, #233252, #131c36);
  box-shadow: inset 0 0 0 3px #94682b, inset 0 0 0 6px #f4d98b50, 0 10px 28px #0008, 0 0 30px rgba(var(--pm-accent), .16); }
.pm-job-hero::before, .pm-job-hero::after { position: absolute; color: #e4c77f; font: 11px Georgia, serif; letter-spacing: 4px; }
.pm-job-hero::before { content: "✦ · ✧"; left: 10px; top: 3px; }
.pm-job-hero::after { content: "✧ · ✦"; right: 10px; bottom: 1px; }
.pm-job-hero-art { position: relative; display: grid; place-items: center; height: 118px; overflow: hidden; }
.pm-job-hero-art .class-art { position: relative; z-index: 2; height: 114px; width: auto; }
.pm-job-halo { position: absolute; width: 92px; height: 92px; border: 3px double #ffe4a0; border-radius: 50%; animation: pmHalo 10s linear infinite;
  box-shadow: 0 0 0 7px #bc8c3580, 0 0 0 10px #f4db8d64, 0 0 38px rgba(var(--pm-accent), .7), inset 0 0 22px rgba(var(--pm-accent), .38); }
.pm-job-halo { box-shadow: 0 0 0 4px #bc8c3580, 0 0 0 6px #f4db8d64, 0 0 24px rgba(var(--pm-accent), .7), inset 0 0 22px rgba(var(--pm-accent), .38); }
.pm-job-halo::after { content: "✧  ✦  ✧  ✦"; position: absolute; inset: -14px; color: #f3d58d; font: 10px Georgia, serif; letter-spacing: 6px; text-align: center; }
.pm-job-hero-info { min-width: 0; }
.pm-job-hero-info h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 1px 0 3px; color: #fff0c7; font: 600 20px/1.25 Georgia, "Trirong", serif; }
.pm-job-hero-info h2 span { color: #b7b9d0; font: 10px Georgia, serif; letter-spacing: 2px; }
.pm-job-hero-info p { max-width: 470px; margin: 0; color: #c0c8dd; font-size: 11px; line-height: 1.5; }
.pm-job-traits { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.pm-job-traits > span { padding: 2px 8px; border: 1px solid rgba(var(--pm-accent), .65); border-radius: 30px; background: rgba(var(--pm-accent), .15); color: #f3e0b4; font-size: 10px; }
.pm-job-progression { display: flex; align-items: center; gap: 5px; color: #7f8aa4; font-size: 9px; white-space: nowrap; }
.pm-job-progression span.ok { color: #c6cde0; }
.pm-job-progression span.on { color: #f2d381; font-weight: 700; }
.pm-job-progression i { flex: 1; max-width: 35px; height: 1px; background: #bc995a; }
.pm-job-stat-panel { align-self: center; display: flex; flex-direction: column; justify-content: center; padding: 6px 9px; border: 2px solid #daba71; border-radius: 10px; background: #0c152ac9; box-shadow: inset 0 0 0 2px #735328, inset 0 0 14px #d5a34920; }
.pm-job-stat-panel .pm-job-kicker { font-size: 8px; letter-spacing: 1.4px; }
.pm-job-stat-panel::before { content: "✧  ✦  ✧"; display: block; margin-bottom: 2px; color: #f7d58e; text-align: center; letter-spacing: 4px; font: 9px Georgia, serif; white-space: pre; }
.pm-job-stats { display: grid; grid-template-columns: max-content; justify-content: start; gap: 3px; margin-top: 4px; }
.pm-job-stat { display: grid; grid-template-columns: 24px 58px 10px; align-items: center; gap: 3px; color: #d4d9e8; font-size: 8px; }
.pm-job-stat i { height: 3px; border-radius: 99px; background: #29304c; overflow: hidden; }
.pm-job-stat i::before { content: ""; display: block; width: var(--value); height: 100%; background: linear-gradient(90deg, #a5733f, #f6d992); box-shadow: 0 0 8px #e5bc76; }
.pm-job-stat b { color: #efd39e; text-align: right; }
.pm-job-stat-panel > small { display: none; }

.pm-job-paths { padding-top: 14px; }
.pm-job-paths-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #d9b46c8a; }
.pm-job-paths-heading h2 { margin: 4px 0 0; font: 600 22px Georgia, "Trirong", serif; color: #ffe8ab; text-shadow: 0 0 14px #f5c77277; }
.pm-job-paths-heading p { margin: 0 0 3px; color: #9faac3; font-size: 11px; }
.pm-job-tier-head, .pm-job-path-row { display: grid; grid-template-columns: 130px repeat(4, minmax(0, 1fr)); gap: 9px; }
.pm-job-tier-head { margin-bottom: 8px; padding: 3px 0 7px; border-bottom: 1px solid #b8894b73; color: #ffe5a4; text-align: center; font: 700 11px Georgia, serif; letter-spacing: 1px; text-shadow: 0 0 10px #f0c36f88; }
.pm-job-tier-head b small { display: block; color: #9faac3; font: 400 9px system-ui, sans-serif; letter-spacing: 0; text-shadow: none; }
.pm-job-path-grid { display: grid; gap: 10px; }
.pm-job-path-row { align-items: stretch; }
.pm-job-path-name { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; padding: 12px; border-left: 3px solid #f4d482; color: #f8ecd0;
  background: linear-gradient(90deg, rgba(var(--pm-accent), .18), #1c28462c 66%, transparent); box-shadow: inset 0 0 0 1px #bd95564f; }
.pm-job-path-name::before { content: "◇"; color: #f5d991; font: 22px Georgia, serif; margin-bottom: 3px; }
.pm-job-path-name b { font-size: 13px; }
.pm-job-path-name small { color: #aeb9cf; font-size: 10px; letter-spacing: 1px; }
.pm-job-card { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; height: clamp(145px, min(20cqi, (100dvh - 520px) / 3), 208px); padding: 6px; border: 2px solid #c79d56; border-radius: 10px; color: #e9e8ec; overflow: hidden; cursor: pointer; font: inherit;
  background: radial-gradient(circle at 50% 55%, rgba(var(--pm-accent), .19), #17223e 66%, #10172d); box-shadow: inset 0 0 0 2px #402d2a, 0 5px 15px #0006; }
.pm-job-card::before { content: ""; position: absolute; inset: 5px; border: 1px solid #edd59a92; border-radius: 6px; pointer-events: none; }
.pm-job-card::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: url("../../../../assets/ui/job-modal/card-tracery.svg") center / 100% 100% no-repeat; filter: drop-shadow(0 0 3px #f7d99144); }
.pm-job-card:not(:disabled):hover { border-color: #efd28b; box-shadow: 0 0 20px rgba(var(--pm-accent), .25); }
.pm-job-card[aria-pressed="true"] { border-color: #ffedb8; box-shadow: 0 0 0 2px #b38a3d, 0 0 28px #edbd66aa, inset 0 0 30px rgba(var(--pm-accent), .2); }
.pm-job-card .class-art { position: relative; z-index: 1; flex: 1; min-height: 0; width: auto; max-width: 100%; margin-top: 10px; }
.pm-job-card-label { position: relative; z-index: 4; display: block; width: 100%; padding: 5px; border: 1px solid #d5b36b68; border-radius: 6px; background: #0a1127d9; color: #efdeba; text-align: center; font-size: 10px; line-height: 1.3; }
.pm-job-card[aria-pressed="true"] .pm-job-card-label { background: linear-gradient(90deg, #a47631, #d1ac58, #8e6629); color: #111727; font-weight: 700; }
.pm-job-card.cur:not([aria-pressed="true"]) .pm-job-card-label { border-color: #f3d58d; color: #ffdf93; }
.pm-job-card-rune { position: absolute; top: 10px; right: 10px; z-index: 4; color: #eac77c; font: 16px Georgia, serif; text-shadow: 0 0 12px #e8b868; }
.pm-job-card:disabled { cursor: not-allowed; border-color: #6f6553; }
.pm-job-card:disabled .class-art { filter: grayscale(.85) brightness(.55); }
.pm-job-card:disabled .pm-job-card-label { color: #a9a6b3; background: #080d1ee6; }

/* ส่วนท้าย */
.win.pm-job-modal > .win-foot { justify-content: space-between; gap: 20px; color: #b1b8ce; font-size: 11px; }
.pm-job-actions { display: flex; gap: 9px; flex: none; }
.pm-job-secondary, .pm-job-primary { padding: 5px 16px; border-radius: 8px; font: 700 12px system-ui, "Sarabun", sans-serif; cursor: pointer; }
.pm-job-secondary { border: 1px solid #b3a37480; background: #131c33; color: #d6d5dd; }
.pm-job-primary { border: 2px solid #fff2bf; background: linear-gradient(115deg, #cfb46d, #f6dfa0 55%, #bb8d43); box-shadow: 0 0 0 2px #6e4d29, 0 0 14px #f7cb73a6, inset 0 1px #fff9dc; color: #172036; }
.pm-job-primary span { margin-right: 6px; }
.pm-job-primary:not(:disabled):hover { filter: brightness(1.1); }
.pm-job-primary:disabled { filter: grayscale(.7) brightness(.7); cursor: not-allowed; box-shadow: 0 0 0 3px #3d3122; }

/* มุมลากปรับขนาด (ระบบหน้าต่าง) */
.win > .win-resize { position: absolute; right: 17px; bottom: 13px; z-index: 11; width: 29px; height: 29px; cursor: nwse-resize; touch-action: none;
  background: repeating-linear-gradient(135deg, transparent 0 5px, #fff0bd 6px 8px, transparent 9px 12px); clip-path: polygon(100% 0, 100% 100%, 0 100%); filter: drop-shadow(0 0 4px #eec875); }
.win > .win-resize:focus-visible { outline: 2px solid #fff3c2; outline-offset: 3px; }
.win.win-maxed { position: fixed; left: 12px !important; top: 12px !important; width: calc(100vw - 24px) !important; height: calc(100dvh - 24px) !important; max-width: none; max-height: none; }
@media (max-width: 760px), (max-height: 480px) { .win.win-maxed { left: 4px !important; top: 4px !important; width: calc(100vw - 8px) !important; height: calc(100dvh - 8px) !important; } }
.win.win-maxed > .win-resize { display: none; }
.win.win-iconified { display: none !important; }

/* ไอคอนหน้าต่างที่ย่อเก็บ — มุมขวากลางจอ (ไม่บังแถบเมนู/ฮอตบาร์/มินิแมพ) */
.win-docks { position: absolute; right: 14px; top: 42%; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.win-dock { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; border: 2px solid #ffdf9a; border-radius: 14px; background: linear-gradient(130deg, #263958, #101b34); color: #fff0c6; box-shadow: 0 0 0 3px #6e4b28, 0 12px 38px #000a, 0 0 22px #f4c56b65; text-align: left; font: 700 13px system-ui, "Sarabun", sans-serif; cursor: pointer; }
.win-dock small { display: block; color: #c5bfd1; font-size: 10px; font-weight: 400; }
.win-dock-gem { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #fff1c7; border-radius: 10px; background: radial-gradient(circle, #7aa9df, #263a70 65%, #111e41); color: #fff4c9; font: 24px Georgia, serif; }
.win-dock:hover, .win-dock:focus-visible { filter: brightness(1.12); }

@keyframes pmHalo { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pm-job-halo { animation: none; } .pm-job-class { transition: none; } }

/* กะทัดรัด: หน้าต่างแคบกว่า 1160px */
@container pmwin (max-width: 1160px) {
  .pm-job-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .pm-job-content { padding: 14px; }
  .pm-job-hero { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; }
  .pm-job-hero-art { height: 104px; }
  .pm-job-hero-art .class-art { height: 100px; }
  .pm-job-halo { width: 80px; height: 80px; }
  .pm-job-tier-head { display: none; }
  .pm-job-path-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .pm-job-path-name { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 10px; min-height: 32px; padding: 4px 10px; }
  .pm-job-path-name::before { display: none; }
  .pm-job-card { height: 170px; }
  .pm-job-current { display: none; }
  .pm-job-overline { display: none; }
}
@container pmwin (max-width: 900px) {
  .pm-job-path-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pm-job-paths-heading p, .pm-job-sub { display: none; }
}

/* หน้าต่างแคบ (มือถือ หรือย่อเหลือ < 620px): เนื้อหาเรียงแนวตั้ง · มือถือใช้ ลาก/ยืด/ขยาย/ปิด ได้เหมือนคอม (D-061) */
@container pmwin (max-width: 620px) {
  .pm-job-overline { display: none; }
  .pm-job-layout { display: block; overflow: auto; }
  .pm-job-sidebar { overflow: visible; padding: 12px; border-right: 0; border-bottom: 1px solid #b6975b70; box-shadow: none; }
  .pm-job-sidebar h2, .pm-job-sidebar > p, .pm-job-sidebar > .pm-job-kicker { display: none; }
  .pm-job-class-list { display: flex; overflow-x: auto; padding-bottom: 6px; }
  .pm-job-class { flex: none; width: 128px; min-height: 48px; padding: 4px 8px 4px 4px; }
  .pm-job-cn strong { font-size: 11px; }
  .pm-job-cn small { font-size: 8px; }
  .pm-job-content { overflow: visible; padding: 12px; }
  .pm-job-hero { grid-template-columns: 72px minmax(0, 1fr); padding: 6px 8px; gap: 8px; }
  .pm-job-hero-art { height: 84px; }
  .pm-job-hero-art .class-art { height: 80px; }
  .pm-job-halo { width: 64px; height: 64px; }
  .pm-job-halo::after { display: none; }
  .pm-job-hero-info h2 { font-size: 17px; }
  .pm-job-hero-info p { font-size: 10px; line-height: 1.4; }
  .pm-job-stat-panel { grid-column: 1 / -1; }
  .pm-job-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 10px; }
  .pm-job-stat { grid-template-columns: 24px minmax(0, 1fr) 10px; }
  .pm-job-progression { display: none; }
  .pm-job-path-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .pm-job-card { height: 170px; }
  .pm-job-status, .pm-job-secondary { display: none; }
  .pm-job-actions { width: 100%; }
  .pm-job-primary { width: 100%; }
}

@media (max-width: 760px), (max-height: 480px) {
  .win.pm-frame::before { inset: 7px; }
  .win.pm-frame > .win-head { min-height: 46px; }
  .pm-sigil { width: 32px; height: 32px; font-size: 16px; }
  .win.pm-frame > .win-head .wb, .win.pm-frame > .win-head .x { width: 30px; height: 30px; font-size: 20px; }
  .win.pm-frame > .win-foot { padding-left: 14px; padding-right: 46px; }
  .win > .win-resize { width: 34px; height: 34px; right: 10px; bottom: 8px; } /* ใหญ่ขึ้นให้นิ้วจับถนัด */
  .win-docks { top: auto; bottom: 150px; right: 10px; }
}

/* จุดเด่น ▲ / จุดด้อย ▼ ประจำอาชีพ + สาย (D-064) — หน้าต่างสถานะ + หอแห่งโชคชะตา */
.edge { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 10px; line-height: 1.5; white-space: nowrap; }
.edge.pro { color: #b9f5c8; background: #2f7a4a33; border: 1px solid #62c98a77; }
.edge.con { color: #ffc2b8; background: #8a3a2f33; border: 1px solid #e0786a77; }
.st-edge { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 2px; }
.pm-job-edge { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 0; }

/* แผนที่โลก 8 ภูมิภาค (D-065) */
.wm-world { aspect-ratio: 1 / 0.86; } /* เมืองหลวงกลาง 4 ทิศ: ระยะเหนือ-ใต้ใกล้เคียงตะวันออก-ตะวันตก */
.wm-region { position: absolute; border-radius: 18px; background: color-mix(in srgb, var(--rt) 16%, transparent); border: 1px dashed color-mix(in srgb, var(--rt) 55%, transparent); pointer-events: none; }
.wm-region > span { position: absolute; left: 6px; top: 4px; font-size: 10.5px; font-weight: 700; color: color-mix(in srgb, var(--rt) 70%, #fff); text-shadow: 0 1px 2px #000; white-space: nowrap; }
.wm-region > span b { font-weight: 600; opacity: .8; }
.wm-region.lb-br > span { left: auto; top: auto; right: 6px; bottom: 4px; }
.wm-links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wm-links line { stroke: color-mix(in srgb, var(--gold) 55%, transparent); stroke-width: 0.35; stroke-dasharray: 1 0.8; }
.wm-links line.cross { stroke: color-mix(in srgb, var(--moon-glow) 55%, transparent); stroke-width: 0.35; stroke-dasharray: none; }
.wm-world .wm-ico { width: 22px; height: 22px; font-size: 12px; border-width: 1.5px; }
.wm-world .wm-lbl { display: none; font-size: 10.5px; }
.wm-world .wm-pin.k-town .wm-lbl, .wm-world .wm-pin.cur .wm-lbl, .wm-world .wm-pin.sel .wm-lbl, .wm-world .wm-pin:hover .wm-lbl { display: block; }
.wm-world .wm-pin:hover, .wm-world .wm-pin.sel { z-index: 3; }
.wm-row { display: flex; gap: 8px; align-items: baseline; margin-top: 4px; font-size: 12px; }
.wm-k { flex: none; min-width: 92px; color: var(--text-2); font-size: 11px; }
.wm-mobs { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.wm-mob b { font-weight: 600; color: var(--gold); }
.wm-walk { white-space: normal; max-width: 180px; text-align: center; }
.el { font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 8px; background: #ffffff18; border: 1px solid #ffffff30; }
.el-fire { color: #ffb08a; } .el-water { color: #9fd8ff; } .el-wind { color: #bfffd8; } .el-earth { color: #e0c08a; } .el-holy { color: #fff6c8; }
.el-shadow { color: #c9a8ff; } .el-ghost { color: #d8d8ff; } .el-undead { color: #b8c8a8; } .el-poison { color: #a8e07a; } .el-neutral { color: #d8d8d8; }

/* วงแหวนเลเวลรอบเมืองหลวง (D-068) · แผนที่ล่าแสดงชื่อ+เลเวลเสมอ */
.wm-ring { position: absolute; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--rt) 60%, transparent); background: radial-gradient(circle, transparent 60%, color-mix(in srgb, var(--rt) 10%, transparent)); pointer-events: none; }
.wm-ring > span { position: absolute; left: 50%; top: -2px; transform: translate(-50%, -100%); font-size: 10px; font-weight: 700; color: color-mix(in srgb, var(--rt) 75%, #fff); text-shadow: 0 1px 2px #000; white-space: nowrap; }
.wm-world .wm-pin.k-field .wm-lbl { display: block; }
.wm-world .wm-lbl b { color: var(--gold); font-weight: 700; }
