/* jx-dialog.css — khung JX1 cho moi hop thoai modal() (xem js/jx-dialog.js). Lop #modal.jxd = hop thoai thuong,
   bang chi tiet mon do (.item-preview-modal / .item-tooltip-preview, ui-jx1.css) khong co lop nay nen giu nguyen. */

/* ---------- bien mau trong hop thoai: doi tong xanh ngoc cu sang nau vang JX ---------- */
#modal.jxd { --font: var(--jx-font); --panel: rgba(16, 13, 9, .94); --panel2: rgba(0, 0, 0, .34); --line: #3f3522; --line2: #6e5c34;
  --gold: rgb(255, 217, 78); --gold2: #8a7240; --text: var(--jx-text); --dim: #a89c80;
  --jxd-btn: linear-gradient(#4a3c22, #241c10); --jxd-btn-on: linear-gradient(#6a5126, #2e220f); --jxd-cell: rgba(0, 0, 0, .34); }

/* ---------- lop phu + khung ---------- */
#modal.jxd { display: flex; align-items: center; justify-content: center; padding: 10px 10px calc(var(--jx-nav-h, 54px) + 6px); background: rgba(0, 0, 0, .68); }
#modal.jxd .mbox { position: relative; isolation: isolate; display: flex; flex-direction: column;
  width: fit-content; min-width: min(100%, 400px); max-width: min(100%, 760px); max-height: 100%; overflow: visible;
  padding: 63px 18px 27px; border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--jx-text); font: 13px/1.45 var(--jx-font); text-shadow: 1px 1px 0 #000; }
/* nen trong + khung 9 manh (63/44/21/44 px) — giong .jxw trong jx-shell.css */
#modal.jxd .mbox::before { content: ""; position: absolute; inset: 10px 8px 8px; z-index: -1; background: var(--jx-bg); box-shadow: 0 10px 34px #000c; }
#modal.jxd .mbox::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-style: solid; border-width: 63px 44px 21px;
  border-image: url('ui/jx1/khung9.png') 63 44 21 44 round; }
/* than hop thoai cuon ben trong, dai tieu de dung yen */
#modal.jxd #mBody { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 2px 4px 4px;
  scrollbar-width: thin; scrollbar-color: #6e5c34 transparent; }
#modal.jxd #mBody::-webkit-scrollbar { width: 8px; height: 8px; }
#modal.jxd #mBody::-webkit-scrollbar-thumb { background: #6e5c34; border: 1px solid #2a2214; }
#modal.jxd #mBody::-webkit-scrollbar-track { background: rgba(0, 0, 0, .3); }

/* dai tieu de: chu toi tren nen giay cua khung, nhu .jxw-title */
.jxd-band { display: none; }
#modal.jxd .jxd-band { position: absolute; left: 58px; right: 58px; top: 29px; height: 26px; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 8px;
  overflow: hidden; white-space: nowrap; pointer-events: none; }
/* Tahoma dam, khong viet hoa (giong .jxw-title): Times hoa + vien mo lam dau tieng Viet nhoe (dai ca 06/10/2026) */
#modal.jxd .jxd-t { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 700 15px/1.2 var(--jx-font); letter-spacing: .5px;
  color: #24180a; text-shadow: 0 1px 0 #fff6d6, 0 0 2px #fff3c4; }
#modal.jxd .jxd-sub { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; border-left: 1px solid #6b5a33;
  font: 700 11px/1.2 var(--jx-font); color: #3a2606; text-shadow: 0 1px 0 #fff6d6, 0 0 2px #fff3c4; }
#modal.jxd #mBody h3.jxd-h { display: none; }
/* h3 bi nhac len nam trong mot khoi tieu de rieng (vd .support-heading) -> chi an h3, giu phan con lai */

/* nut dong JX (o hinh vuong tren dai tieu de; vung bam rong hon hinh ve) */
#modal.jxd .mx { position: absolute; right: 14px; top: 30px; left: auto; z-index: 5; display: grid; place-items: center; width: 26px; height: 24px; padding: 0;
  border: 1px solid #8a7240; border-radius: 0; background: var(--jxd-btn); color: #f3dfa2; font: 13px/1 var(--jx-font); text-shadow: 1px 1px 0 #000;
  box-shadow: inset 0 1px 0 #ffffff14; cursor: pointer; }
#modal.jxd .mx::after { content: ""; position: absolute; inset: -9px -10px -9px -10px; }
#modal.jxd .mx:hover { filter: brightness(1.3); }
#modal.jxd[data-locked="1"] .mx { display: none; }

/* ---------- chu ---------- */
#modal.jxd #mBody, #modal.jxd #mBody :is(button, input, select, textarea, h3, h4, b, strong, small, table) { font-family: var(--jx-font); }
#modal.jxd #mBody h3 { margin: 10px 0 6px; padding: 0 0 3px; border-bottom: 1px solid #4a3f27; color: var(--jx-gold); font: 700 13px/1.35 var(--jx-font); }
#modal.jxd #mBody h3 small { font: 11px var(--jx-font); color: var(--jx-dim); }
#modal.jxd #mBody h4 { color: var(--jx-gold); font-weight: 700; }
#modal.jxd #mBody b, #modal.jxd #mBody strong { font-weight: 700; }
#modal.jxd #mBody > :first-child, #modal.jxd #mBody > h3.jxd-h + * { margin-top: 0; }
#modal.jxd #mBody .desc { margin: 4px 0 8px; color: #cdbf98; font-size: 12px; line-height: 1.5; }
#modal.jxd #mBody .dim, #modal.jxd #mBody small.dim { color: var(--jx-dim); }
#modal.jxd #mBody .cp, #modal.jxd #mBody .good { color: var(--jx-green); }
#modal.jxd #mBody .cn, #modal.jxd #mBody .bad, #modal.jxd #mBody .reqbad { color: #ff7a5c; }
#modal.jxd #mBody .boss { color: #ff9a4a; }
#modal.jxd #mBody p { margin: 4px 0; }

/* goc vuong cho moi thu trong hop thoai (kieu JX, khong bo goc / vien tron) */
#modal.jxd #mBody *, #modal.jxd #mBody *::before, #modal.jxd #mBody *::after { border-radius: 0; }

/* ---------- nut ---------- */
#modal.jxd #mBody .btn { min-height: 28px; padding: 3px 12px; border: 1px solid #8a7240; border-radius: 0; background: var(--jxd-btn); color: #f3dfa2;
  font: 12px/1.25 var(--jx-font); text-shadow: 1px 1px 0 #000; box-shadow: inset 0 1px 0 #ffffff14, inset 0 -1px 0 #000; transform: none; filter: none; }
#modal.jxd #mBody .btn:hover:not(:disabled) { border-color: #c9a24e; color: #fff2c9; filter: brightness(1.2); box-shadow: inset 0 1px 0 #ffffff22, inset 0 -1px 0 #000; transform: none; }
#modal.jxd #mBody .btn:active:not(:disabled) { transform: none; filter: brightness(.9); box-shadow: inset 0 1px 3px #000; }
#modal.jxd #mBody .btn.sm { min-height: 24px; padding: 2px 9px; font-size: 11px; }
#modal.jxd #mBody .btn.on { border-color: #e0bc5a; background: var(--jxd-btn-on); color: var(--jx-gold); box-shadow: inset 0 0 6px #ffd24a55; }
#modal.jxd #mBody .btn.red { border-color: #a0503a; background: linear-gradient(#5e2a1c, #2c120a); color: #ffc6ae; }
#modal.jxd #mBody .btn.red:hover:not(:disabled) { border-color: #e08a6a; }
#modal.jxd #mBody .btn.soft-red { border-color: #7a4a3a; background: linear-gradient(#3c261c, #22150e); color: #e8b8a4; }
#modal.jxd #mBody .btn[disabled], #modal.jxd #mBody .btn:disabled { opacity: .5; filter: grayscale(.4); box-shadow: none; }
#modal.jxd #mBody .btnrow { gap: 6px; margin-top: 8px; }

/* ---------- hang the (gift / shop / codex / stash ... dung .dtabs; cac doan chon khac) ---------- */
#modal.jxd #mBody :is(.dtabs, .setting-segment, .account-segment, .difficulty-segment, .ground-loot-tabs) {
  display: flex; flex-wrap: wrap; gap: 2px; width: auto; margin: 0 0 8px; padding: 0 0 4px; border: 0; border-bottom: 1px solid #6e5c34; background: none; box-shadow: none; }
#modal.jxd #mBody :is(.dtabs, .setting-segment, .account-segment, .difficulty-segment, .ground-loot-tabs) > button {
  flex: 0 0 auto; min-height: 26px; padding: 3px 10px; border: 1px solid #5a4a2a; border-radius: 0; background: linear-gradient(#3a2f1c, #1c160c);
  color: #cdb983; font: 12px/1.2 var(--jx-font); text-shadow: 1px 1px 0 #000; white-space: nowrap; box-shadow: inset 0 1px 0 #ffffff12; }
#modal.jxd #mBody :is(.dtabs, .setting-segment, .account-segment, .difficulty-segment, .ground-loot-tabs) > button:hover { filter: brightness(1.2); }
#modal.jxd #mBody :is(.dtabs, .setting-segment, .account-segment, .difficulty-segment, .ground-loot-tabs) > button.on {
  border-color: #c9a24e; background: linear-gradient(#5a4520, #2a1f0e); color: var(--jx-gold); box-shadow: inset 0 0 6px #ffd24a55; }
#modal.jxd #mBody .item-segment { border-radius: 0; border-color: #6e5c34; background: rgba(0, 0, 0, .4); }
#modal.jxd #mBody .item-segment button { border-radius: 0; }
#modal.jxd #mBody .item-segment button.on { border-color: #c9a24e; background: linear-gradient(#5a4520, #2a1f0e); color: var(--jx-gold); }

/* ---------- khoi / hang / o ---------- */
#modal.jxd #mBody :is(.card, .qrow, .slotrow, .shoprow, .day, .cmp2, .shop-potion-bulk, .todo, .loot-panel, .loot-advanced-body, .loot-summary, .ground-loot-row,
  .tm-intro, .tm-progress, .tm-how, .tm-training, .tm-card, .pet-preview, .petskill, .petgroup-grid button, .donkho-options, .potion-info) {
  border: 1px solid #4a3f27; border-radius: 0; background: var(--jxd-cell); box-shadow: inset 0 0 0 1px #00000080; }
#modal.jxd #mBody .card { padding: 7px 9px; margin-bottom: 6px; }
#modal.jxd #mBody :is(.qrow, .slotrow) { padding: 5px 8px; }
#modal.jxd #mBody .qrow.lock, #modal.jxd #mBody .card.lock { opacity: .55; }
#modal.jxd #mBody .shoprow:hover, #modal.jxd #mBody .petgroup-grid button:hover { border-color: #8a7240; background: rgba(60, 46, 20, .45); }
#modal.jxd #mBody :is(.shoprow.own, .day.cur, .petgroup-grid button.on, .tm-card.owned, .ground-loot-row.is-target) { border-color: #c9a24e; box-shadow: inset 0 0 6px #ffd24a33; }
#modal.jxd #mBody .day b, #modal.jxd #mBody .shoprow em { color: var(--jx-gold); }
#modal.jxd #mBody .slotrow.del { border-color: #a0503a; background: rgba(60, 16, 8, .45); }
/* hang slot khong co anh (vd nap file luu: slot da co nhan vat) -> khong de nut chiem cot chu */
#modal.jxd #mBody .slotrow:not(:has(> img)) { grid-template-columns: 1fr auto auto; }
#modal.jxd #mBody .tm-card:hover { transform: none; border-color: #c9a24e; }
#modal.jxd #mBody :is(.tm-card.tier-3, .tm-card.tier-4) { background: linear-gradient(145deg, rgba(70, 52, 20, .45), rgba(0, 0, 0, .34) 78%); }
#modal.jxd #mBody .tm-intro { background: linear-gradient(135deg, rgba(70, 52, 20, .4), rgba(0, 0, 0, .3)); }
#modal.jxd #mBody :is(.tm-effects, .tm-portrait, .tm-seal) { background: rgba(0, 0, 0, .45); border-color: #6e5c34; }
#modal.jxd #mBody .tm-tier-heading { border-bottom-color: #6e5c34; }
#modal.jxd #mBody .stats > span:nth-of-type(even) { color: var(--jx-gold); }

/* chon mon phai / nhan vat */
#modal.jxd #mBody .facpick button { border: 1px solid #4a3f27; border-radius: 0;
  background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%), rgba(0, 0, 0, .4);
  box-shadow: inset 0 -2px 0 var(--c), inset 0 0 0 1px #000; }
#modal.jxd #mBody .facpick button:hover { border-color: #c9a24e; filter: brightness(1.12); }
#modal.jxd #mBody .facpick b { color: var(--jx-gold); font-weight: 700; }
#modal.jxd #mBody .slotrow b { font-weight: 700; }

/* ---------- o nhap / chon ---------- */
#modal.jxd #mBody input:not([type="checkbox"]):not([type="range"]):not([type="file"]):not([type="radio"]), #modal.jxd #mBody select, #modal.jxd #mBody textarea,
#modal.jxd #mBody .ui-select-trigger {
  min-height: 28px; padding: 3px 8px; border: 1px solid #6e5c34; border-radius: 0; background-color: #0d0b07; color: var(--jx-text);
  font: 12px/1.35 var(--jx-font); box-shadow: inset 0 1px 3px #000; }
#modal.jxd #mBody input:not([type="checkbox"]):not([type="range"]):not([type="file"]):not([type="radio"]), #modal.jxd #mBody textarea,
#modal.jxd #mBody .ui-select-trigger { background-image: none; }
#modal.jxd #mBody select { padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffd94e' stroke-width='3' stroke-linecap='square'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px 12px; }
#modal.jxd #mBody :is(input, select, textarea):focus, #modal.jxd #mBody .ui-select-trigger:hover { border-color: #c9a24e; box-shadow: inset 0 1px 3px #000, 0 0 0 1px #c9a24e44; }
#modal.jxd #mBody select option { background: #15110a; color: var(--jx-text); }
#modal.jxd #mBody .ui-select-menu { border: 1px solid #8a7240; border-radius: 0; background: rgba(16, 13, 9, .98); box-shadow: 0 6px 18px #000c; }
#modal.jxd #mBody .ui-select-option { border-radius: 0; font: 12px var(--jx-font); }
#modal.jxd #mBody .ui-select-option.is-selected, #modal.jxd #mBody .ui-select-option:hover { background: #3a2c12; color: var(--jx-gold); }
#modal.jxd #mBody input[type="checkbox"], #modal.jxd #mBody input[type="radio"] { accent-color: #c9a24e; }
#modal.jxd #mBody input[type="range"]::-webkit-slider-runnable-track { border-color: #6e5c34; border-radius: 0; background: #0d0b07; }
#modal.jxd #mBody input[type="range"]::-webkit-slider-thumb { border-radius: 0; border: 1px solid #f3dfa2; background: linear-gradient(#c9a24e, #6a5126); box-shadow: 0 1px 2px #000; }

/* cong tac kieu iOS -> o vuong JX */
#modal.jxd #mBody .ios-switch { border-radius: 0; border-color: #6e5c34; background: #0d0b07; }
#modal.jxd #mBody .ios-switch::after, #modal.jxd #mBody .ios-switch i { border-radius: 0; background: #8a7a58; }
#modal.jxd #mBody .ios-switch-row input:checked + .ios-switch { border-color: #c9a24e; background: #5a4520; box-shadow: inset 0 0 4px #ffd24a66; }
#modal.jxd #mBody .ios-switch-row input:checked + .ios-switch::after { background: var(--jx-gold); }
#modal.jxd #mBody .loot-check { border-color: #4a3f27; background: var(--jxd-cell); color: var(--jx-text); }

/* ---------- thanh tien do ---------- */
#modal.jxd #mBody :is(.tm-xp, .bar, .prog, .progress) { border: 1px solid #6e5c34; border-radius: 0; background: #070604; box-shadow: inset 0 1px 2px #000; }
#modal.jxd #mBody :is(.tm-xp, .prog, .progress) > i { border-radius: 0; background: linear-gradient(#ffe48a, #c9962e 60%, #7a5a1a); box-shadow: none; }
#modal.jxd #mBody progress { appearance: none; -webkit-appearance: none; height: 10px; border: 1px solid #6e5c34; background: #070604; }
#modal.jxd #mBody progress::-webkit-progress-bar { background: #070604; }
#modal.jxd #mBody progress::-webkit-progress-value { background: linear-gradient(#ffe48a, #c9962e 60%, #7a5a1a); }

/* ---------- nhan / huy hieu ---------- */
#modal.jxd #mBody :is(.tag, .chip2, .pet-role-tag, .loot-bag-state, .auto-loot-state, .todochip, .badge) {
  border: 1px solid #5a4a2a; border-radius: 0; background: rgba(0, 0, 0, .45); color: #d8c48c; }
#modal.jxd #mBody .tag.attack { border-color: #7a3a24; background: rgba(70, 24, 10, .5); color: #ffb38a; }

/* ---------- bang ---------- */
#modal.jxd #mBody table { border-collapse: collapse; }
#modal.jxd #mBody :is(th, td) { border-color: #3f3522; }
#modal.jxd #mBody th { color: var(--jx-gold); font-weight: 700; background: rgba(60, 46, 20, .35); }

/* luoi o do trong hop thoai (kho chung, ren...): o vuong co dinh kieu tui JX thay vi 8 cot gian het chieu ngang */
#modal.jxd #mBody .invgrid { grid-template-columns: repeat(auto-fill, minmax(42px, 46px)); gap: 2px; justify-content: start; padding: 3px;
  border: 1px solid #4a3f27; background: rgba(0, 0, 0, .3); }
#modal.jxd #mBody .it { border-radius: 0; border-color: rgba(120, 96, 44, .6);
  background: radial-gradient(ellipse 82% 42% at 50% 112%, var(--item-glow) 0%, var(--item-glow-soft) 48%, transparent 100%), linear-gradient(#1a150d, #0c0a06); }
#modal.jxd #mBody .it.r1 { border-color: #58b86b; } #modal.jxd #mBody .it.r2 { border-color: #ffd24a; } #modal.jxd #mBody .it.r3 { border-color: #c77bff; }
#modal.jxd #mBody .stash-empty-slot { border: 1px solid rgba(100, 80, 30, .35); background: rgba(0, 0, 0, .35); }
#modal.jxd #mBody .potion-inv-cell { border-color: #6e8a6a; }
#modal.jxd #mBody :is(#stInv, #stBox) { border-radius: 0; }
#modal.jxd #mBody :is(#stInv, #stBox).stash-drop-active { box-shadow: inset 0 0 0 1px #c9a24e, inset 0 0 14px #ffd24a33; }

/* ---------- may tinh: giua man hinh, rong theo noi dung ---------- */
@media (min-width: 641px) and (orientation: landscape) {
  #modal.jxd .mbox { min-width: min(100%, 520px); }
}

/* ---------- dien thoai: gan kin man hinh phia tren thanh nut ---------- */
@media (max-width: 640px), (orientation: portrait) {
  #modal.jxd { padding: 4px 4px calc(var(--jx-nav-h, 54px) + 4px); align-items: center; }
  #modal.jxd .mbox { width: 100%; min-width: 0; max-width: 100%; padding: 60px 13px 26px; }
  #modal.jxd .jxd-band { left: 50px; right: 50px; }
  #modal.jxd .jxd-t { font-size: 17px; letter-spacing: 0; }   /* .mbox bi zoom 0,8 tren dien thoai -> ~13,5px that */
  #modal.jxd .jxd-sub { font-size: 12px; }
  #modal.jxd #mBody .facpick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  #modal.jxd #mBody .facpick button { padding: 5px 3px 4px; }
  #modal.jxd #mBody .facpick img { height: 96px; }
  #modal.jxd #mBody .facpick b { font-size: 11px; line-height: 1.2; }
}
/* cam ung: nut / the de bam hon (app dien thoai thu 0,8 -> 40px hien ~32px) */
@media (pointer: coarse) {
  #modal.jxd #mBody .btn { min-height: 40px; padding: 4px 12px; }
  #modal.jxd #mBody .btn.sm { min-height: 40px; min-width: 40px; }
  #modal.jxd #mBody .loot-check { min-height: 38px; align-items: center; }
  #modal.jxd #mBody .loot-check input { width: 16px; height: 16px; }
  #modal.jxd #mBody :is(.dtabs, .setting-segment, .account-segment, .difficulty-segment, .ground-loot-tabs) > button { min-height: 38px; padding: 4px 11px; }
  #modal.jxd #mBody input:not([type="checkbox"]):not([type="range"]):not([type="file"]):not([type="radio"]), #modal.jxd #mBody select,
  #modal.jxd #mBody .ui-select-trigger { min-height: 38px; }
  #modal.jxd .mx { width: 30px; height: 26px; top: 29px; right: 12px; }
}

/* hang chi co 1 nut (Nhan, Dong y...): dat giua, nut rong hon (dai ca 06/10/2026, hop Chao mung tro lai) */
#modal.jxd #mBody .btnrow:has(> .btn:only-child) { justify-content: center; }
#modal.jxd #mBody .btnrow > .btn:only-child { min-width: min(220px, 70%); justify-content: center; text-align: center; }
/* Ky Tran Cac (js/jx-bank.js): luoi o vat pham kieu cua hang JX1 — o den vien vang dong, icon giua, ten + gia (icon tien dong) */
#modal .ktc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
#modal .ktc-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px 5px; background: #0a0907; border: 1px solid #4a3f28;
  box-shadow: inset 0 0 0 1px #000; color: #e8dcc0; font: 12px/1.2 Tahoma, Arial, sans-serif; cursor: pointer; }
#modal .ktc-cell:hover { border-color: #8a7240; }
#modal .ktc-cell.on { border-color: #ffd24a; box-shadow: inset 0 0 0 1px #000, inset 0 0 10px #8a6a1a; }
#modal .ktc-cell b { font-weight: 400; text-align: center; min-height: 2.4em; display: flex; align-items: center; }
#modal .ktc-ic { width: 40px; height: 40px; display: grid; place-items: center; background: #15130f; border: 1px solid #2c271d; }
#modal .ktc-ic img { max-width: 34px; max-height: 34px; image-rendering: pixelated; transform: scale(1.4); }
#modal .ktc-ic.big { width: 54px; height: 54px; flex: none; }
#modal .ktc-ic.big img { transform: scale(1.9); }
#modal .ktc-price { display: flex; align-items: center; gap: 3px; color: #ffd94e; }
#modal .ktc-coin { width: 15px; height: 12px; vertical-align: -2px; }
#modal .ktc-info { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 4px; padding: 8px; background: #080706; border: 1px solid #3a352b; }
#modal .ktc-info p { margin: 4px 0; color: #cfc4a8; font-size: 12px; line-height: 1.45; }
#modal .ktc-name { color: #ffd94e; }
#modal .ktc-gold { color: #ffd94e; }
#modal .ktc-bal { display: flex; gap: 8px; margin-top: 6px; }
#modal .ktc-bal > span { flex: 1; display: flex; align-items: center; gap: 5px; padding: 4px 8px; background: #080706; border: 1px solid #3a352b; color: #c9a24e; }
#modal .ktc-bal b { flex: 1; text-align: right; color: #ffd94e; font-weight: 400; }
/* rong co dinh tren may tinh (dai ca 06/10/2026: doi mon thi cua so khong duoc co gian theo do dai mo ta) */
@media (min-width: 641px) and (orientation: landscape) {
  #modal.jxd .mbox:has(.ktc-grid) { width: min(100%, 640px); }
  #modal .ktc-grid { grid-template-columns: repeat(5, 1fr); }
}
/* Lo Ep Do (js/jx-forge.js): hang o dat kieu cua so ghep / khaam cua Tho ren JX1 */
#modal .ep-body { display: flex; flex-direction: column; gap: 8px; }
#modal .ep-slots { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; background: #080706; border: 1px solid #3a352b; flex-wrap: wrap; }
#modal .ep-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; }
#modal .ep-slot small { color: #b8ad95; font-size: 11px; }
#modal .ep-box { width: 46px; height: 46px; display: grid; place-items: center; background: #15130f; border: 1px solid #4a3f28; box-shadow: inset 0 0 0 1px #000; }
#modal .ep-slot.has .ep-box { border-color: #c77bff; box-shadow: inset 0 0 0 1px #000, inset 0 0 8px #7a3ab0; }
#modal .ep-box img { max-width: 40px; max-height: 40px; image-rendering: pixelated; }
#modal .ep-plus, #modal .ep-arrow { color: #c9a24e; font-size: 18px; padding: 0 2px; margin-bottom: 16px; }
#modal .ep-mat { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; background: #15130f; border: 1px solid #3a352b; vertical-align: middle; }
#modal .ep-mat img { max-width: 22px; max-height: 22px; image-rendering: pixelated; }
#modal .ep-mat i { position: absolute; right: 1px; bottom: -2px; font: 700 10px/1 Tahoma, sans-serif; font-style: normal; color: #ffd94e; text-shadow: 1px 1px 0 #000; }
#modal .ep-hts { display: flex; flex-wrap: wrap; gap: 4px; }
#modal .ep-ht { display: flex; align-items: center; gap: 3px; padding: 2px 6px 2px 2px; background: #0a0907; border: 1px solid #3a352b; color: #cfc4a8; cursor: pointer; }
#modal .ep-ht.on { border-color: #ffd24a; }
#modal .ep-res { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; background: #080706; border: 1px solid #3a352b; }
#modal .ep-res b { color: #ffd94e; font-weight: 400; } #modal .ep-res small { color: #a89c80; }
#modal .ep-aux { font-size: 12px; color: #cfc4a8; }
#modal .ep-lines, #modal .ep-opts { display: flex; flex-direction: column; gap: 3px; }
#modal .ep-line, #modal .ep-opt { display: flex; align-items: center; gap: 8px; padding: 4px 6px; background: #0a0907; border: 1px solid #3a352b; color: #cfc4a8; text-align: left; cursor: pointer; font: 12px/1.3 Tahoma, Arial, sans-serif; }
#modal .ep-line.on, #modal .ep-opt.on { border-color: #c77bff; background: #170f20; }
#modal .ep-line:disabled { opacity: .45; cursor: default; }
#modal .ep-line b, #modal .ep-opt b { color: #9fd0ff; font-weight: 400; flex: 1; }
#modal .ep-opt span:last-child { display: flex; flex-direction: column; } #modal .ep-opt small, #modal .ep-line small { color: #a89c80; }
#modal .ep-klines { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
#modal .ep-kline { display: flex; gap: 6px; padding: 3px 6px; background: #120c18; border: 1px solid #4a2f63; font-size: 12px; }
#modal .ep-kline span { color: #a89c80; flex: none; } #modal .ep-kline b { color: #c77bff; font-weight: 400; }
#modal .ep-kline.empty { background: #0a0907; border-color: #2c271d; } #modal .ep-kline.empty b { color: #6b6250; }
#modal .ep-grid { max-height: 190px; overflow: auto; }
#modal .ep-grid .ep-on { outline: 2px solid #ffd24a; outline-offset: -2px; }
#modal .ep-sec { display: flex; flex-direction: column; gap: 5px; padding: 6px; border: 1px solid #2c271d; }
#modal .ep-h { color: #e2c77c; font-size: 13px; }
#modal .ep-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #cfc4a8; } #modal .ep-row > span:nth-child(2) { flex: 1; }
#modal .ep-matlist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: #cfc4a8; }
@media (max-width: 559px) { #modal .ep-klines { grid-template-columns: 1fr; } }
