/* ============================================================
   Phase 10 — nested context menu, marks, gear modals,
   attachment manager, SYNCHRONIZE header pill.
   ============================================================ */

/* ---------------- SYNCHRONIZE ---------------- */
.sync-pill {
  gap: 8px;
  border-color: rgba(56, 189, 248, .35);
  background: rgba(56, 189, 248, .08);
  color: #bae6fd;
  flex: none;
  /* في نص الشريط: الهيدر grid بثلاث أعمدة (يسار/الزرار/يمين) فالزرار مابيلغيش
     فوق زرار SCRAPPY مهما اتحجم الفل أو اتغيّر عدد الحسابات. */
}
.sync-pill:hover { border-color: rgba(56, 189, 248, .7); color: #e0f2fe; }
.sync-pill[disabled] { opacity: .55; cursor: progress; }
.sync-ico { display: inline-block; font-size: 14px; line-height: 1; }
.sync-pill.spinning .sync-ico { animation: p10-spin .8s linear infinite; }
@keyframes p10-spin { to { transform: rotate(360deg); } }

/* ---------------- CONTEXT MENU (nested) ---------------- */
.ctx { min-width: 214px; padding: 7px; gap: 1px; }
.ctx .ctx-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 9px 5px; font-size: 9px; letter-spacing: 2px;
}
.ctx .ctx-title > span:first-child { color: rgba(255, 255, 255, .62); }
.ctx .ctx-count { color: #c084fc; font-weight: 900; letter-spacing: 1.6px; white-space: nowrap; }
.ctx .ctx-row,
.ctx .ctx-label {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; min-height: 30px;
}
.ctx .ctx-label .arrow {
  font-size: 14px; line-height: 1; color: rgba(255, 255, 255, .35);
  transition: color .12s ease, transform .12s ease;
}
.ctx-item { position: relative; }
.ctx-label:hover .arrow,
.ctx-item.hover > .ctx-label .arrow,
.ctx-item.open > .ctx-label .arrow { color: #c084fc; }
.ctx-label:hover,
.ctx-item.hover > .ctx-label,
.ctx-item.open > .ctx-label { background: rgba(255, 255, 255, .07); color: #fff; }

.ctx-sub {
  display: none; position: absolute; top: -7px; left: calc(100% + 7px); z-index: 2;
  min-width: 198px; padding: 7px;
  background: rgba(14, 15, 20, .99); border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 12px; box-shadow: 0 22px 54px rgba(0, 0, 0, .9);
  flex-direction: column; gap: 1px;
}
/* invisible hover bridge: keeps the pointer inside the submenu while crossing the 7px gap */
.ctx-sub::before {
  content: ""; position: absolute; top: -8px; bottom: -8px; left: -15px; width: 15px;
  background: transparent;
}
/* display is driven by JS .hover (with switch delay) + click .open; pure :hover
   would reopen a neighbour whose wider box sits under the pointer in the gap */
.ctx-item.hover > .ctx-sub,
.ctx-item.open > .ctx-sub { display: flex; }
.ctx.left .ctx-sub { left: auto; right: calc(100% + 7px); }
.ctx.left .ctx-sub::before { left: auto; right: -15px; }
.ctx-sub-title {
  padding: 6px 9px 3px; font-size: 8px; font-weight: 900;
  letter-spacing: 2.2px; color: rgba(255, 255, 255, .3);
}
.ctx .ctx-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 6px; background: rgba(168, 85, 247, .22);
  color: #e9d5ff; font-size: 9px; font-weight: 900; letter-spacing: 0;
}
.ctx .danger { color: #fca5a5; }
.ctx .danger:hover:not(:disabled) { background: rgba(239, 68, 68, .14); color: #fecaca; }
.ctx .sell-total {
  font-size: 10px; font-weight: 900; letter-spacing: .4px;
  color: #86efac; text-shadow: 0 0 12px rgba(34, 197, 94, .35);
}
.ctx .sell-total.zero { color: rgba(255, 255, 255, .28); text-shadow: none; }

/* ---------------- MODAL PILL VARIANTS / WIDE ---------------- */
.modal-card.modal-wide { width: min(1120px, 100%); }
.pill.purple { color: #fff; border-color: rgba(168, 85, 247, .75); background: rgba(139, 92, 246, .32); }
.pill.purple:hover { background: rgba(139, 92, 246, .45); }
.pill.danger { color: #fff; border-color: rgba(239, 68, 68, .7); background: rgba(239, 68, 68, .25); }
.pill.danger:hover { background: rgba(239, 68, 68, .38); }
.pill.green { color: #052e16; border-color: rgba(34, 197, 94, .8); background: #4ade80; font-weight: 900; }
.pill.green:hover { background: #6ee7a8; }
.pill[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- GEAR MODALS ---------------- */
.gear-modal { display: grid; gap: 12px; }
.gear-hero { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gear-icon {
  width: 58px; height: 58px; flex: 0 0 auto; border-radius: 12px;
  background: #0b0c12; border: 2px solid rgba(255, 255, 255, .12);
  display: grid; place-items: center; overflow: hidden;
}
.gear-icon img { max-width: 84%; max-height: 84%; object-fit: contain; }
.gear-icon.r-Common { border-color: #788091; }
.gear-icon.r-Uncommon { border-color: #4cc94f; box-shadow: 0 0 14px rgba(76, 201, 79, .25); }
.gear-icon.r-Rare { border-color: #0fa2e0; box-shadow: 0 0 14px rgba(15, 162, 224, .25); }
.gear-icon.r-Epic { border-color: #a44de0; box-shadow: 0 0 14px rgba(164, 77, 224, .25); }
.gear-icon.r-Legendary { border-color: #f5b800; box-shadow: 0 0 14px rgba(245, 184, 0, .25); }
.gear-icon.r-Amplified { border-color: #ff4d2e; box-shadow: 0 0 14px rgba(255, 77, 46, .28); }
.gear-id { min-width: 0; }
.gear-id h4 { margin: 0; font-size: 15px; font-weight: 900; letter-spacing: .2px; }
.gear-id span { display: block; margin-top: 3px; font-size: 9px; font-weight: 800; letter-spacing: 1.6px; color: var(--muted); text-transform: uppercase; }

.gear-row {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 11px 13px; border-radius: 12px;
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06);
}
.gear-current { display: flex; align-items: baseline; gap: 9px; }
.gear-current span,
.gear-targets > span { font-size: 9px; font-weight: 900; letter-spacing: 2px; color: rgba(255, 255, 255, .35); }
.gear-current b { font-size: 18px; font-weight: 900; color: #c084fc; }
.gear-targets { display: flex; align-items: center; gap: 7px; }
.gear-tbtn {
  width: 38px; height: 31px; border-radius: 9px; cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 900; letter-spacing: .5px;
  color: var(--muted); background: #0b0b12; border: 1px solid var(--line);
  transition: all .12s ease;
}
.gear-tbtn:hover:not(:disabled) { color: #fff; border-color: rgba(168, 85, 247, .55); }
.gear-tbtn.on {
  color: #fff; border-color: rgba(168, 85, 247, .9);
  background: rgba(139, 92, 246, .35); box-shadow: 0 0 16px rgba(168, 85, 247, .3);
}
.gear-tbtn[disabled] { opacity: .3; cursor: not-allowed; }

.gear-items { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.gear-items::-webkit-scrollbar { width: 6px; }
.gear-items::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }
.gear-line {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 11px; border-radius: 9px;
  background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .05);
  font-size: 10px; letter-spacing: .4px;
}
.gear-line span { color: rgba(255, 255, 255, .72); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gear-line b { color: #e9d5ff; font-weight: 900; white-space: nowrap; }

.gear-item {
  display: grid; gap: 9px; padding: 10px 12px;
  border-radius: 12px; background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(255, 255, 255, .06);
}
.gear-item-x { position: relative; padding-right: 44px; }
.gear-x {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .65); font-size: 12px; line-height: 1;
}
.gear-x:hover { background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .55); color: #fecaca; }
.gear-value {
  position: absolute; top: 10px; right: 12px;
  font-size: 12px; font-weight: 900; color: #86efac;
}
.gear-item-x .gear-value + .gear-x { display: none; }

.gear-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px; padding: 12px 14px; border-radius: 12px;
  background: rgba(139, 92, 246, .1); border: 1px solid rgba(168, 85, 247, .35);
}
.gear-total span { font-size: 9px; font-weight: 900; letter-spacing: 2px; color: rgba(255, 255, 255, .5); }
.gear-total b { font-size: 18px; font-weight: 900; color: #86efac; text-shadow: 0 0 16px rgba(34, 197, 94, .4); }

.gear-h {
  margin: 6px 0 0; font-size: 9px; font-weight: 900;
  letter-spacing: 2.2px; color: rgba(255, 255, 255, .4);
}
.gear-mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 7px; }
.gear-mat {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px;
  border-radius: 9px; background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
}
.gear-mat-ico {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 6px;
  background: rgba(255, 255, 255, .04); display: grid; place-items: center; overflow: hidden;
}
.gear-mat-ico img { width: 90%; height: 90%; object-fit: contain; }
.gear-mat-name { flex: 1; min-width: 0; font-size: 10.5px; font-weight: 700; color: rgba(255, 255, 255, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear-mat b { font-size: 11px; font-weight: 900; letter-spacing: .2px; white-space: nowrap; }
.gear-mat b.ok { color: #4ade80; }
.gear-mat b.bad { color: #f87171; }
.gear-mat b.gain { color: #86efac; }
.gear-note { margin: 2px 0 0; font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.gear-note.warn { color: #fcd9a1; }
.gear-note.bad { color: #fca5a5; }

/* ---------------- REPAIR PANEL (game style) ---------------- */
.rep-label {
  font-size: 10.5px; font-weight: 900; letter-spacing: 1.4px; color: rgba(255, 255, 255, .55);
  text-transform: uppercase; margin: 0 0 8px;
}
.rep-label + .rep-list { margin-top: 0; }
.rep-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 8px; margin: 0 0 14px;
}
.rep-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 12px;
  border: 1px solid var(--arc-b); background: var(--arc-card);
}
.rep-item-tile {
  position: relative; width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 9px; overflow: hidden; background: rgba(255, 255, 255, .05);
  display: grid; place-items: center; font-size: 16px; font-weight: 900; color: rgba(255, 255, 255, .4);
}
.rep-item-tile img { width: 88%; height: 88%; object-fit: contain; }
.rep-item-qty {
  position: absolute; right: 3px; bottom: 2px;
  font-size: 10px; font-weight: 900; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}
.rep-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rep-item-top { display: flex; align-items: center; gap: 8px; }
.rep-item-name {
  flex: 1; min-width: 0;
  font-size: 12.5px; font-weight: 800; letter-spacing: .2px; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rep-drop {
  flex: 0 0 auto; width: 20px; height: 20px; border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px; background: rgba(0, 0, 0, .25); color: rgba(255, 255, 255, .6);
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
}
.rep-drop:hover { color: #fff; border-color: rgba(248, 113, 113, .8); background: rgba(248, 113, 113, .18); }
.rep-hp { display: flex; align-items: baseline; gap: 6px; }
.rep-hp b { font-size: 15px; font-weight: 900; letter-spacing: .2px; color: #fbbf24; font-variant-numeric: tabular-nums; }
.rep-hp b.rep-new { color: #4ade80; }
.rep-arrow { font-size: 11px; color: rgba(255, 255, 255, .4); }
.rep-of { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .45); font-variant-numeric: tabular-nums; }
.rep-gain {
  font-size: 11px; font-weight: 900; color: #04240f; background: #4ade80;
  padding: 2px 7px; border-radius: 999px; margin-left: auto; font-variant-numeric: tabular-nums;
}
.rep-item.compact { padding: 7px 9px; gap: 8px; align-items: center; }
.rep-item.compact .rep-item-tile { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 7px; }
.rep-item.compact .rep-item-main { gap: 5px; }
.rep-item.compact .rep-item-top { gap: 7px; }
.rep-item.compact .rep-hp { flex: 0 0 auto; gap: 3px; }
.rep-item.compact .rep-hp b { font-size: 12.5px; }
.rep-item.compact .rep-of, .rep-item.compact .rep-arrow { font-size: 10px; }
.rep-item.compact .rep-gain { margin-left: 4px; font-size: 10px; padding: 1px 6px; }
.rep-bar { position: relative; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, .07); }
.rep-bar i { position: absolute; left: 0; top: 0; bottom: 0; display: block; background: linear-gradient(90deg, #b45309, #f59e0b); }
.rep-est { font-size: 10px; font-weight: 900; color: #fbbf24; cursor: help; }
.rep-mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 116px)); gap: 9px; margin: 0 0 4px; }
.rep-mat { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rep-mat-tile {
  position: relative; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--arc-b); background: var(--arc-card);
  display: flex; align-items: center; justify-content: center; color: var(--arc-r, #94a3b8);
}
.rep-mat-tile img { width: 74%; height: 74%; object-fit: contain; }
.rep-mat-num {
  position: absolute; inset: auto 0 0 0; padding: 3px 0; text-align: center;
  font-size: 11px; font-weight: 900; font-variant-numeric: tabular-nums;
  color: #04240f; background: rgba(74, 222, 128, .85);
}
.rep-mat.miss .rep-mat-num { color: #fff; background: rgba(220, 38, 38, .88); }
.rep-mat-name {
  font-size: 10.5px; line-height: 1.2; color: #cbd5e1; text-align: center;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.rep-go {
  flex: 1 1 220px; border: 0; border-radius: 999px; padding: 13px 18px;
  font-size: 12px; font-weight: 900; letter-spacing: 1.8px; cursor: pointer;
  color: #04240f; background: linear-gradient(180deg, #6ee7a8, #22c55e);
}
.rep-go:hover { background: linear-gradient(180deg, #86efac, #34d399); }
.rep-go[disabled] { opacity: .35; pointer-events: none; }

/* ---------------- ATTACHMENT MANAGER ---------------- */
.mgr-wrap { display: grid; gap: 12px; }
.mgr-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mgr-detachall {
  color: #2a0606 !important; background: #fb7185 !important;
  border: 1px solid rgba(244, 63, 94, .85) !important; font-weight: 900 !important;
  letter-spacing: 1.4px !important; box-shadow: 0 0 18px rgba(244, 63, 94, .25);
}
.mgr-detachall:hover { background: #fda4af !important; }
.mgr-detachall[disabled] { opacity: .4; box-shadow: none; }
.mgr-autofill {
  color: #052e16 !important; background: #4ade80 !important;
  border: 1px solid rgba(34, 197, 94, .85) !important; font-weight: 900 !important;
  box-shadow: 0 0 18px rgba(34, 197, 94, .25);
}
.mgr-autofill:hover { background: #6ee7a8 !important; }
.mgr-autofill[disabled] { opacity: .4; box-shadow: none; }

.mgr-counts {
  display: flex; flex-wrap: wrap; gap: 18px;
  padding: 9px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06);
  font-size: 8.5px; font-weight: 900; letter-spacing: 1.8px; color: rgba(255, 255, 255, .38);
}
.mgr-counts b { color: #fff; font-size: 12px; margin-right: 4px; letter-spacing: .5px; }

.mgr-h {
  margin: 6px 0 0; font-size: 9px; font-weight: 900;
  letter-spacing: 2.4px; color: rgba(255, 255, 255, .42);
}

.mgr-group {
  border-radius: 12px; overflow: hidden;
  background: rgba(255, 255, 255, .02); border: 1px solid rgba(255, 255, 255, .07);
}
.mgr-group-head {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  background: rgba(255, 255, 255, .035); border-bottom: 1px solid rgba(255, 255, 255, .06);
  font-size: 10px; font-weight: 900; letter-spacing: 1.6px; text-transform: uppercase;
}
.mgr-idx {
  display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 auto;
  border-radius: 6px; background: rgba(168, 85, 247, .25);
  color: #e9d5ff; font-size: 9px; font-weight: 900; letter-spacing: 0;
}
.mgr-meta { margin-left: auto; font-size: 8.5px; letter-spacing: 1.4px; color: var(--muted); text-transform: none; }
.mgr-slot-rows { display: grid; gap: 5px; padding: 10px 12px; }
.mgr-slot-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 7px; border-radius: 8px;
  background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .05);
}
.mgr-slot-row.empty { border-style: dashed; background: transparent; }
.mgr-wpn { flex: 1; min-width: 0; font-size: 10px; letter-spacing: .5px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-slot {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; padding: 0; cursor: pointer;
  background: #0a0a11; border: 1px solid rgba(255, 255, 255, .1);
  display: grid; place-items: center; overflow: hidden;
}
.mgr-slot.filled { border-color: var(--arc-r, rgba(168, 85, 247, .35)); }
.mgr-slot.filled:hover:not(:disabled) { border-color: rgba(239, 68, 68, .7); box-shadow: 0 0 12px rgba(239, 68, 68, .25); }
.mgr-slot.empty { border-style: dashed; cursor: default; }
.mgr-slot img { width: 84%; height: 84%; object-fit: contain; }
.mgr-slot .dot { width: 8px; height: 8px; border-radius: 50%; background: #c084fc; box-shadow: 0 0 10px rgba(192, 132, 252, .8); }
.mgr-slot .plus { font-size: 15px; color: rgba(255, 255, 255, .22); }
.mgr-slot[disabled] { opacity: .55; cursor: not-allowed; }

.mgr-avail-head {
  padding: 9px 12px 5px; font-size: 8.5px; font-weight: 900;
  letter-spacing: 2px; color: rgba(255, 255, 255, .35);
}
.mgr-avail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 7px;
  max-height: 240px; overflow-y: auto; padding: 6px 12px 12px;
}
.mgr-avail-grid::-webkit-scrollbar { width: 6px; }
.mgr-avail-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }
.mgr-avail-card {
  display: grid; gap: 6px; justify-items: center; padding: 8px;
  border-radius: 10px; background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
}
.mgr-avail-ico {
  width: 48px; height: 48px; border-radius: 9px; background: #0a0a11;
  border: 1px solid rgba(255, 255, 255, .08); display: grid; place-items: center; overflow: hidden;
}
.mgr-avail-ico img { width: 86%; height: 86%; object-fit: contain; }
.mgr-avail-name {
  width: 100%; text-align: center; font-size: 8.5px; font-weight: 700;
  color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mgr-avail-card .mgr-avail-name { color: var(--arc-r, rgba(255, 255, 255, .72)); }
.mgr-avail-card .mgr-avail-ico { border-color: var(--arc-r, rgba(255, 255, 255, .08)); }
.mgr-avail-card { border-color: var(--arc-glow, rgba(255, 255, 255, .07)); }

/* أيقونات المرفقات بتلبس لون درجتها — نفس متغيرات --arc-* بتاعة بلاطات المخزن */
.mgr-slot.filled, .mgr-wslot:not(.empty), .mgr-avail-ico {
  background-color: #0a0a11; background-image: var(--arc-card, none);
  box-shadow: inset 0 0 14px var(--arc-glow, transparent);
}
.mgr-slot.filled img, .mgr-wslot:not(.empty) img, .mgr-avail-ico img {
  filter: drop-shadow(0 1px 4px var(--arc-glow, transparent));
}

.mgr-equip {
  width: 100%; padding: 5px 4px; border-radius: 7px; cursor: pointer;
  font: inherit; font-size: 8px; font-weight: 900; letter-spacing: 1.2px;
  color: #052e16; background: #4ade80; border: 1px solid rgba(34, 197, 94, .8);
}
.mgr-equip:hover:not(:disabled) { background: #6ee7a8; }
.mgr-equip[disabled] { opacity: .3; cursor: not-allowed; }
.mgr-equip.mgr-swap { color: #2a1500; background: #fbbf24; border-color: rgba(245, 158, 11, .85); }
.mgr-equip.mgr-swap:hover:not(:disabled) { background: #fcd34d; }
.mgr-equip.mgr-on { color: #d8ccf7; background: transparent; border-color: rgba(168, 85, 247, .55); opacity: .9; }

.mgr-weapons { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 9px; }
.mgr-weapon {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px;
  border-radius: 12px; background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(255, 255, 255, .07);
}
.mgr-check { padding-top: 2px; }
.mgr-check input { width: 15px; height: 15px; accent-color: #a855f7; cursor: pointer; }
.mgr-wicon {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 9px; overflow: hidden;
  background: #0a0a11; border: 1px solid rgba(255, 255, 255, .08); display: grid; place-items: center;
}
.mgr-wicon img { width: 88%; height: 88%; object-fit: contain; }
.mgr-wmain { flex: 1; min-width: 0; display: grid; gap: 5px; }
.mgr-wname { font-size: 10.5px; font-weight: 900; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-whp { font-size: 8.5px; font-weight: 800; letter-spacing: .8px; color: var(--muted); }
.mgr-whp span { opacity: .5; margin: 0 3px; }
.mgr-whp.hurt { color: #fcd34d; }
.mgr-wslots { display: flex; flex-wrap: wrap; gap: 5px; }
.mgr-wstencils { display: flex; flex-wrap: wrap; gap: 5px; }
.mgr-wstencil {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 3px; border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .02);
  font-size: 9.5px; font-weight: 800; color: #cfd6cd;
}
.mgr-wstencil img { width: 16px; height: 16px; object-fit: contain; opacity: .9; }
.mgr-wstencil em { font-style: normal; font-size: 8px; letter-spacing: .6px; color: #7f8a80; }
.mgr-wslot {
  width: 28px; height: 28px; border-radius: 7px; overflow: hidden;
  background: #0a0a11; border: 1px solid rgba(255, 255, 255, .09);
  display: grid; place-items: center;
}
.mgr-wslot.empty { border-style: dashed; }
.mgr-wslot:not(.empty) { border-color: var(--arc-r, rgba(255, 255, 255, .09)); }
.mgr-wslot img { width: 84%; height: 84%; object-fit: contain; }
.mgr-wslot .plus { font-size: 11px; color: rgba(255, 255, 255, .2); }
.mgr-wacts { display: grid; gap: 4px; }
.mgr-wacts .ghost { padding: 4px 8px !important; font-size: 8px !important; letter-spacing: 1px !important; }

/* manager note at bottom */
.mgr-wrap > .gear-note { padding: 10px 12px; border-radius: 10px; background: rgba(245, 158, 11, .07); border: 1px solid rgba(245, 158, 11, .25); }

/* modal close X */
.modal-card { position: relative; }
.modal-card #m-title { padding-right: 36px; }
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 28px; height: 28px;
  display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255, 255, 255, .03); color: rgba(255, 255, 255, .5);
  font-size: 12px; line-height: 1; cursor: pointer; transition: .15s;
}
.modal-x:hover { color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .07); }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1220px) {
  .mgr-weapons { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .modal-card.modal-wide { width: 100%; }
  .gear-mats { grid-template-columns: 1fr; }
  .ctx-sub { position: static; display: none; margin: 2px 0 4px 8px; box-shadow: none; border-radius: 9px; }
  .ctx-sub::before { content: none; }
  .ctx-item.open > .ctx-sub { display: flex; }
  .ctx-item:hover > .ctx-sub:not(.force),
  .ctx-item.hover > .ctx-sub { display: none; }
}

/* ---------------- SPLIT STACK ---------------- */
.modal-card.modal-split { width: min(460px, 100%); }
.split-modal { display: grid; gap: 14px; }
.split-controls {
  display: grid; gap: 9px; padding: 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .025); border: 1px solid var(--line);
}
.split-controls > label { font-size: 9px; font-weight: 900; letter-spacing: 1.6px; color: var(--muted); }
.split-row { display: grid; grid-template-columns: 38px 1fr 38px; gap: 8px; align-items: center; }
.split-step {
  height: 38px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04); color: #fff; font-size: 16px; cursor: pointer;
}
.split-step:hover { background: rgba(255, 255, 255, .09); }
#split-amount {
  height: 38px; text-align: center; font-family: inherit; font-size: 18px; font-weight: 900;
  border-radius: 9px; border: 1px solid rgba(168, 85, 247, .5);
  background: rgba(10, 10, 17, .75); color: #fff;
}
#split-amount::-webkit-outer-spin-button,
#split-amount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#split-amount { -moz-appearance: textfield; appearance: textfield; }
#split-range { width: 100%; accent-color: #a855f7; cursor: pointer; }
.split-hint { display: flex; justify-content: space-between; font-size: 9px; font-weight: 800; letter-spacing: 1px; color: var(--muted); }
.split-hint b { color: #fff; }
.split-actions { display: flex; gap: 8px; }
.split-actions .pill { flex: 1; justify-content: center; padding: 10px 12px; font-size: 10px; letter-spacing: 1.2px; }

/* ---------------- SELECTION — INDEPENDENT FRAME + CHECK BADGE ---------------- */
.tile.sel, .tile.selected { transform: scale(.93); }
.tile.sel::before, .tile.selected::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-color: rgba(0, 0, 0, .35); border-radius: inherit;
}
.tile.sel::after, .tile.selected::after {
  content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  border: 2px solid #00f0ff; border-radius: 14px;
  box-shadow: inset 0 0 12px rgba(0, 240, 255, .28);
}
.tile .sel-check {
  position: absolute; top: 6px; right: 6px; z-index: 7;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #0e2f38 0%, #04090c 72%);
  border: 2px solid #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, .7), 0 0 18px rgba(0, 240, 255, .35);
  color: #b8fbff; font-size: 13px; font-weight: 900; line-height: 1;
  text-shadow: 0 0 6px rgba(0, 240, 255, .95);
  pointer-events: none;
}
.tile.sel .warn,
.tile.selected .warn { right: 36px; }

/* ---------------- BLUEPRINT LEARNED — ✔ الزاوية العلوية اليمين ----------------
   بتاع الحساب المفتوح بس (عقد "Unlock Craft X" من شجرة البوابة)، فبلاطات
   FIND ME/الحسابات التانية بترفع من غيرھا. */
.tile .bpl-check {
  position: absolute; top: 6px; right: 8px; z-index: 5;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 10, 14, .78); border: 1.5px solid rgba(255, 255, 255, .82);
  color: #fff; font-size: 11px; font-weight: 900; line-height: 1;
  pointer-events: none; backdrop-filter: blur(4px);
}
.tile.bpl .warn { right: 30px; }
.tile.bpl.sel .bpl-check, .tile.bpl.selected .bpl-check { right: 34px; }
.tile.bpl.sel .warn, .tile.bpl.selected .warn { right: 58px; }

/* ---------------- HIDDEN SCROLLBARS (scroll still works) ---------------- */
.inv-body, .tr-offers, .gear-items, .mgr-avail-grid, .log, .drawer-body, .sys-body, .modal-card {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.inv-body::-webkit-scrollbar,
.tr-offers::-webkit-scrollbar,
.gear-items::-webkit-scrollbar,
.mgr-avail-grid::-webkit-scrollbar,
.log::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar,
.sys-body::-webkit-scrollbar,
.modal-card::-webkit-scrollbar { display: none; width: 0; height: 0; }
