/* Long Rebirth item details must scroll INSIDE the dialog: the page is locked
   while a modal is open, and centered unconstrained dialogs clip on phones. */
#char-bag-modal-overlay > .l2-gm-modal,
#l2-item-stats-modal-overlay > .l2-gm-modal {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Rebirth I mage shields: readable stats on equipment modal and bag list. */
.l2-rebirth-shield-item-stats { display:grid; gap:5px; margin:7px 0; width:100%; }
.l2-rebirth-shield-item-stat { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; column-gap:12px; padding:4px 6px; border-bottom:1px solid rgba(184,143,83,.15); font-size:12px; }
.l2-rebirth-shield-item-stat strong { font-weight:700; font-variant-numeric:tabular-nums; }
.l2-rebirth-shield-item-stat--physical {color:#dfbd89}
.l2-rebirth-shield-item-stat--magical {color:#8cbcff}
.l2-rebirth-shield-item-stat--forge {color:#f5c96d}
.l2-rebirth-shield-item-stat--chance {color:#8add94}
.l2-rebirth-shield-item-stat--power {color:#d9aff9}
.l2-rebirth-shield-item-stat--muted {color:#a89b86; font-size:10px}
.l2-rebirth-shield-compact {display:flex;flex-wrap:wrap;gap:3px 10px;margin-top:4px;font-size:10px;line-height:1.45}
.l2-rebirth-shield-compact--physical {color:#dfbd89}
.l2-rebirth-shield-compact--magical {color:#8cbcff}
.l2-rebirth-shield-compact--forge {color:#f5c96d}
.l2-rebirth-shield-compact--chance {color:#8add94}
.l2-rebirth-shield-compact--power {color:#d9aff9}

/* One immutable per-instance quality badge, alongside existing enchant/LS badges. */
.l2-item-icon-badge-host .l2-item-rebirth-quality-badge {
  position:absolute;right:0;bottom:0;z-index:3;
  color:#f1d6a5;background:rgba(32,25,18,.93);border:1px solid #8c7350;
  border-radius:2px;padding:0 2px;font-size:9px;font-weight:700;
  line-height:13px;white-space:nowrap;pointer-events:none;
  font-variant-numeric:tabular-nums;text-shadow:0 1px 1px #000;
}

/* Empty future stone sockets; compact enough for both mobile item modals. */
.l2-rebirth-empty-sockets { display:flex;gap:5px;align-items:center;flex-wrap:wrap;padding:5px 0 8px; }
.l2-rebirth-empty-sockets__cell {
  display:inline-flex;align-items:center;justify-content:center;
  width:29px;height:29px;color:#9a8365;
  font-size:18px;line-height:1;border:1px solid rgba(190,151,93,.52);
  border-radius:3px;background:linear-gradient(145deg,#292622,#171614);
  box-shadow:inset 0 0 7px rgba(0,0,0,.45);
}
.l2-item-icon-badge-host .l2-item-rebirth-sockets-badge {
  position:absolute;left:0;bottom:0;z-index:3;
  color:#d9c8ee;background:rgba(33,27,45,.94);border:1px solid #76638e;
  border-radius:2px;padding:0 2px;font-size:9px;font-weight:700;
  line-height:13px;white-space:nowrap;pointer-events:none;
  font-variant-numeric:tabular-nums;text-shadow:0 1px 1px #000;
}


/* Filled socket uses the actual stone artwork, including gems on equipped items. */
.l2-rebirth-empty-sockets__cell--filled {border-color:#a38458;background:#27201a;}
.l2-rebirth-empty-sockets__cell--filled img{
  display:block;width:27px;height:27px;max-width:100%;max-height:100%;object-fit:contain;border-radius:2px;
}

/* Clickable embedded gemstones and compact inspection window; L2WAP bronze/dark. */
button.l2-rebirth-empty-sockets__cell--filled{
  padding:0;appearance:none;-webkit-appearance:none;cursor:pointer;
  font:inherit;vertical-align:middle;
}
button.l2-rebirth-empty-sockets__cell--filled:focus-visible{
  outline:2px solid #d8b77a;outline-offset:2px;
}
.l2-rebirth-gem-detail-overlay{
  position:fixed;inset:0;z-index:2147483000;display:flex;
  align-items:center;justify-content:center;padding:16px;
  box-sizing:border-box;background:rgba(0,0,0,.77);
}
.l2-rebirth-gem-detail{
  display:flex;align-items:center;flex-direction:column;gap:10px;
  box-sizing:border-box;width:min(100%,310px);padding:16px 13px;
  background:linear-gradient(150deg,#342b23,#1c1917 65%,#252019);
  color:#e5d7bf;border:1px solid #96784c;border-radius:8px;
  box-shadow:0 14px 40px rgba(0,0,0,.82),inset 0 1px rgba(239,210,154,.12);
  text-align:center;
}
.l2-rebirth-gem-detail h3{margin:0;font-size:14px;font-weight:700;color:#e8c68b}
.l2-rebirth-gem-detail img{display:block;object-fit:contain;border:1px solid #705638;border-radius:5px}
.l2-rebirth-gem-detail strong{font-size:13px;line-height:1.35;color:#f0ddbd}
.l2-rebirth-gem-detail__effect{
  width:100%;box-sizing:border-box;margin:0;padding:9px 6px;
  border:1px solid rgba(166,123,72,.42);border-radius:5px;
  background:#211c18;color:#ddbc86;font-size:12px;line-height:1.4;
}
.l2-rebirth-gem-detail__close{
  min-width:110px;min-height:34px;padding:6px 12px;
  border:1px solid #97774b;border-radius:5px;
  background:linear-gradient(#5a472f,#32271e);
  color:#f0d9aa;font:inherit;font-size:12px;font-weight:700;cursor:pointer;
}
.l2-rebirth-gem-detail__close:focus-visible{outline:2px solid #e2c18c;outline-offset:2px}
