/* Shared BondDisc appearance, in-match bond strip and detail card. */

/* Shared bond glyphs and detail/info chips; original rule order retained. */
.bglyph { display: inline-grid; place-items: center; width: .24rem; height: .24rem; flex: none; }
.bglyph img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0) invert(.86) sepia(.4) hue-rotate(110deg) saturate(2.5); }
.bglyph__txt { font-weight: 900; font-size: calc(.15 * var(--t)); color: var(--mint-400); }
/* BondGlyph mask: the icon's alpha filled with the text colour (the 规程 shop card's bond rows, §37.228). In 0.4.0 this sat
   in game-panels.css and a later merge dropped it, so those icons drew nothing (the owner, 2026-11-30: 「商店里的干员的所属盟约
   图标没有显示」; §37.390) */
.bglyph--mask { background-color: currentColor; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.dbonds { display: flex; flex-wrap: wrap; gap: .08rem; }
.dbond { display: inline-flex; align-items: center; gap: .05rem; padding: .03rem .1rem .03rem .05rem; font-size: calc(.15 * var(--t)); background: rgba(78, 216, 175, .08); border: 1px solid var(--mint-800); color: var(--mint-400); }
/* the unit's bonds in the header's right column, right under name / class (user playtest #2 item 9): icon, name,
   count / next threshold, tier pips — visible as soon as the card opens */
.dbonds--top { gap: .05rem; margin-top: .06rem; }
.dhead__info .dbonds--top .dbond { font-size: calc(.14 * var(--t)); padding: .02rem .07rem .02rem .03rem; }
.dhead__info .dbond__icon { width: .24rem; height: .24rem; }
.dbonds--top .dbond { gap: .06rem; padding: .03rem .08rem .03rem .04rem; font: inherit; font-size: calc(.15 * var(--t)); color: var(--text-md);
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line-2); cursor: var(--sp-cursor-default, default); }
.dbonds--top button.dbond { cursor: var(--sp-cursor-pointer, pointer); }
.dbonds--top button.dbond:hover { border-color: var(--mint-500); color: #fff; }
.dbonds--top .dbond.is-active { color: var(--mint-400); background: rgba(78, 216, 175, .1); border-color: var(--mint-700); }
.dbonds--top .dbond.is-core .dbond__name { font-weight: 700; }
.dbond__icon { width: .26rem; height: .26rem; }
.dbond:not(.is-active) .dbond__icon img { filter: brightness(0) invert(.6); }
.dbond__count { font-size: calc(.15 * var(--t)); color: #fff; }
.dbond__count small { font-size: calc(.11 * var(--t)); color: var(--text-dim); }
.dbond__count.is-max { color: var(--gold-2); }
.dbond__tiers { display: inline-flex; gap: 2px; margin-left: .02rem; }
.dbond__tiers i { width: .05rem; height: .12rem; background: rgba(255, 255, 255, .16); transform: skewX(-18deg); }
.dbond__tiers i.on { background: var(--mint-400); box-shadow: 0 0 .04rem rgba(78, 216, 175, .8); }
/* a bond the mode never activates (标准: 10 of 23 — gameLogic modeOffBonds) */
.dbonds--top .dbond.is-off { border-style: dashed; border-color: rgba(255, 255, 255, .16); background: transparent; color: var(--text-dim); }
.dbond.is-off .dbond__name { text-decoration: line-through; text-decoration-color: rgba(255, 84, 84, .6); }
.dbond.is-off .dbond__icon img { filter: grayscale(1) brightness(.5); }
.dbond__off { font-size: calc(.12 * var(--t)); color: var(--text-dim); white-space: nowrap; }
.dbonds--top .dbond.is-granted { border-style: dashed; }
.dbond__iso { font-size: calc(.11 * var(--t)); font-weight: 700; color: var(--gold-2); }
.ibonds { display: flex; flex-wrap: wrap; gap: .06rem; }
.ibond { display: inline-flex; align-items: center; gap: .05rem; padding: .03rem .08rem .03rem .04rem; font-size: calc(.14 * var(--t)); border: 1px solid var(--line-2); color: var(--text-md); }
.ibond.is-off { color: var(--text-dim); background: rgba(255, 255, 255, .02); text-decoration: line-through; text-decoration-color: rgba(255, 84, 84, .6); }
.ibond.is-off .bglyph img { filter: grayscale(1) brightness(.5); }
.ibond__ban { display: inline-flex; align-items: center; gap: .02rem; font-size: calc(.12 * var(--t)); padding: 0 .05rem; background: var(--red); color: #fff; text-decoration: none; }
.ibond__ban .icon { width: .12rem; height: .12rem; }

/* #746: optional selected-unit bond timers; labels wrap at narrow widths and large text sizes. */
.dbond-times__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .08rem .2rem; margin: .1rem 0; font-size: calc(.24 * var(--t)); }
.dbond-times__row > span { min-width: 0; overflow-wrap: anywhere; }

/* ---- bond disc ------------------------------------------------------------------------------------ */
.bond {
  --disc: .56rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .05rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}
.bond__disc { position: relative; width: var(--disc); height: var(--disc); display: grid; place-items: center; }
.bond__core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.bond__icon { width: 66%; height: 66%; object-fit: contain; filter: brightness(0) invert(.82); pointer-events: none; }
.bond__glyph { font-weight: 900; font-size: calc(var(--disc) * .42); line-height: 1; color: #cfd6d3; }
.bond__count {
  position: absolute;
  left: 50%;
  bottom: calc(var(--disc) * -.1);
  transform: translateX(-50%);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: calc(var(--disc) * .32);
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 3px #000, 0 1px 2px #000, 0 0 6px #000;
  font-variant-numeric: tabular-nums;
}
.bond__name { font-size: calc(var(--disc) * .27); color: var(--text-md); text-shadow: 0 1px 2px #000; white-space: nowrap; }
.bond.is-active .bond__name { color: var(--text-hi); }
.bond.is-disabled .bond__disc::before,
.bond.is-disabled .bond__core { filter: grayscale(1) brightness(.55); }
.bond.is-disabled .bond__name { color: var(--text-dim); }
.bond__ban {
  position: absolute;
  top: calc(var(--disc) * -.12);
  right: calc(var(--disc) * -.12);
  width: calc(var(--disc) * .36);
  height: calc(var(--disc) * .36);
  display: grid;
  place-items: center;
  background: #d32a1b;
  color: #fff;
  border: 1px solid #ff7a6b;
  box-shadow: 0 0 4px rgba(0, 0, 0, .6);
}
.bond__ban .icon { width: 80%; height: 80%; }
/* Keep the 阵容不完整 corner out of the disc's grid, including its CSS-only fallback. */
.bond__tag {
  position: absolute; top: calc(var(--disc) * -.27); right: calc(var(--disc) * -.27);
  width: calc(var(--disc) * .54); height: calc(var(--disc) * .54); pointer-events: none;
  background: var(--tag) center / 100% 100% no-repeat;
}
.bond__tag.is-plain {
  display: grid; place-items: start end; color: #e3e7e6;
  background: linear-gradient(225deg, rgba(18, 22, 21, .94) 50%, transparent 50%);
}
.bond__tag.is-plain .icon { width: 46%; height: 46%; margin: 6% 6% 0 0; }
.bond.is-frozen { opacity: .5; }
.bond.is-clickable { cursor: var(--sp-cursor-pointer, pointer); }
.bond--sm { --disc: .42rem; }
.bond--lg { --disc: .76rem; }

/* Extracted from game.css; original rule order retained. */
/* Only the bond discs (and the +N chip) take the pointer: the strip's box spans the width under the top bar, where the
   top board row's units stand (row 12 at 16:9 / 21:9 / 720p / phones, the boss field's row 5 in a boss prep) — it used
   to swallow the taps and drags on them (review of user playtest #2 item 8: every own unit reachable). */
.gm__bonds > *, .gm__bonds .bstrip { pointer-events: none; }
.gm__bonds .bslot, .gm__bonds .bstrip__more { pointer-events: auto; }
.gm__bond-list { min-width: 0; flex: 1; }
/* The hidden list leaves no hit area over the board; only this compact tab can reopen it (GitHub #142). */
/* A bare arrow (the owner's request after 0.2.0: the boxed 「收起」 tab looked heavy): transparent, half-visible until
   hovered or focused; the 44 × 44 touch target stays (an invisible hit area), the name is the aria-label. */
.gm__bonds .bonds-toggle { pointer-events: auto; flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0; color: var(--text-hi); background: transparent; border: 0; cursor: var(--sp-cursor-pointer, pointer);
  opacity: .55; transition: opacity var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); line-height: 1; }
.bonds-toggle .icon { width: max(.22rem, 18px); height: max(.22rem, 18px); filter: drop-shadow(0 0 2px rgba(0, 0, 0, .85)); }
.bonds-toggle[aria-expanded="false"] { opacity: .8; }
.bonds-toggle:hover, .bonds-toggle:focus-visible { opacity: 1; color: var(--mint-500); }
.bonds-toggle:focus-visible { outline: 2px solid var(--mint-500); outline-offset: -4px; }
.bstrip { display: flex; align-items: flex-start; gap: .1rem; flex-wrap: nowrap; }
.bstrip.is-frozen .bslot { opacity: .5; filter: saturate(.4); }
.bstrip--empty { display: inline-flex; align-items: center; gap: .12rem; padding: .08rem .16rem; font-size: .15rem; color: var(--text-dim); background: rgba(8, 11, 10, .6); border: 1px dashed var(--line-2); }
/* a watched teammate's bonds (DESIGN §20.15): an amber "👁 name" pill in front of the discs, amber rings. Horizontal at
   every width with a pixel floor (a vertical .12rem name was ~6-8 px per glyph on desktop / tablet, ~5 px on phones
   where 1rem is clamped at 40 px); centred on the discs, clear of the team panel below */
.bstrip__owner { align-self: center; flex: none; display: inline-flex; flex-direction: row; align-items: center; gap: max(.04rem, calc(3px * var(--sp-ui, 1)));
  padding: max(.03rem, calc(2px * var(--sp-ui, 1))) max(.06rem, calc(4px * var(--sp-ui, 1))); border: 1px solid rgba(246, 163, 41, .5); background: rgba(40, 26, 6, .7); }
.bstrip__owner .micro { color: var(--amber); font-size: max(.15rem, 10px); letter-spacing: .04em; max-width: max(1.3rem, calc(72px * var(--sp-ui, 1)));
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bstrip__eye { color: var(--amber); font-size: max(.17rem, 11px); flex: none; }
.bstrip--empty .bstrip__owner .micro { max-width: max(1.6rem, calc(80px * var(--sp-ui, 1))); }
.bstrip--empty.is-other { border-color: rgba(246, 163, 41, .5); }
@media (max-width: 767px) {
  .bstrip__owner .micro { font-size: max(.12rem, 9px); }
  .bstrip__eye { font-size: max(.15rem, 10px); }}
.bstrip.is-other .bond__core { box-shadow: 0 0 0 1px rgba(246, 163, 41, .45); }
.bstrip__more { align-self: center; font-size: .16rem; color: var(--text-lo); padding: .04rem .08rem; border: 1px solid var(--line-2); background: rgba(8, 11, 10, .7); }
.bslot { position: relative; display: flex; flex-direction: column; align-items: center; width: .74rem; padding-top: .18rem; }
.bslot .bond { --disc: .52rem; }
.bslot .bond__name { font-size: .14rem; font-weight: 500; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.bslot.is-open .bond__core { box-shadow: 0 0 0 2px var(--mint-400), 0 0 .2rem rgba(23, 249, 183, .6); }
/* a bond the mode never activates, with members (the server's `off` entry): the briefing's grey ✕ disc, the chips'
   struck name, 本局禁用 under it instead of the count */
.bslot.is-off .bond__name { color: var(--text-dim); text-decoration: line-through; text-decoration-color: rgba(255, 84, 84, .6); }
.bslot.is-off .bslot__off {
  position: static; margin-top: .02rem; font-size: .11rem; font-weight: 500; color: var(--text-dim); white-space: nowrap;
  background: rgba(8, 11, 10, .85); border: 1px dashed rgba(255, 255, 255, .25);
}

/* Keep every bond reachable without shrinking its disc or extending over the right HUD. */
.bstrip-scroll { display: flex; align-items: center; min-width: 0; gap: .04rem; }
/* Let the padding protect rings/counts from clipping without lowering the discs and names into the board. */
.gm__bonds .bstrip-scroll .bstrip { min-width: 0; overflow-x: auto; overflow-y: hidden; padding: .08rem 0; margin: -.08rem 0;
  pointer-events: auto; touch-action: pan-x; scrollbar-width: thin; }
.bstrip-scroll .bslot { flex: none; }
.gm__bonds .bstrip-scroll__arrow { flex: none; width: 44px; height: 44px; padding: 0;
  background: rgba(8, 11, 10, .7); color: var(--mint); border: 1px solid var(--line-2); cursor: var(--sp-cursor-pointer, pointer); pointer-events: auto; }
.bstrip-scroll__arrow:disabled { opacity: .3; cursor: var(--sp-cursor-default, default); }
.gm.is-pen .gm__bonds .bstrip-scroll *, .gm.has-sp .gm__bonds .bstrip-scroll * { pointer-events: none; }

.gm__bond-list > .tt-anchor { display: block; max-width: 100%; }

/* Stage mark above each bond disc (the official phase level Ⅰ–Ⅲ, centred on the ring's top rim); stack counts stay on the disc. */
.bslot__stage {
  position: absolute; top: calc(.18rem + .26rem - var(--bond-frame-size) * (0.5 - var(--bond-rim-top))); left: 50%; transform: translate(-50%, -50%);
  display: flex; justify-content: center; height: .24rem; color: #fff; font-size: .18rem;
  pointer-events: none;
}
/* The official bond_level_1–3 (24 × 24 px, the .24rem box): white bars 3 × 12 px, 2 px apart, centred, in a soft dark
   halo that also darkens the gaps between bars (ui/bondStrip.js BondStage). */
.bslot__stage-bars { display: flex; align-items: center; justify-content: center; gap: .02rem; width: .24rem; height: .24rem; }
.bslot__stage-bars i {
  display: block; flex: none; width: .03rem; height: .12rem; background: #fff;
  box-shadow: 0 0 0 .01rem rgba(0, 0, 0, .5), 0 0 .025rem .005rem rgba(0, 0, 0, .55);
}

/* Extracted from game-panels.css; original rule order retained. */
/* ---- bond popup ---- */
.bpop {
  position: absolute; left: 2.3rem; top: 2.1rem; width: 5.4rem; max-height: calc(100% - 2.4rem); z-index: 8; overflow: hidden;
  display: flex; flex-direction: column; gap: .08rem; padding: .14rem .22rem;
  background: rgba(11, 15, 13, .97); border: 1px solid var(--line-2); box-shadow: 0 .14rem .4rem rgba(0, 0, 0, .65);
  animation: pop-in var(--t-med) var(--ease-out);
}
/* placement (gameLogic bondPopupPlace / BPOP — keep in sync): beside the left-docked detail card, left of the
   right-docked one, against the right edge, or over the card it was opened from — never over the selected unit's
   underframe when a place is free */
.bpop--beside { left: 7.32rem; z-index: 10; }
.bpop--besideR { left: auto; right: 5.92rem; z-index: 10; }
.bpop--right { left: auto; right: .9rem; z-index: 10; }
/* The top-strip card fits seven square portraits, their gaps and the card padding. */
.bpop--center, .bpop-nav {
  --bond-member-size: .9rem;
  width: calc(7 * var(--bond-member-size) + 6 * .08rem + .44rem + 2px);
}
.bpop--center {
  left: 50%; right: auto; translate: -50% 0;
  max-width: calc(100% - .32rem);
}
.bpop--center .bpop__members { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bpop--center .bpop__member { min-width: 0; }
.bpop--center .square-op-thumb { width: var(--bond-member-size); }
.bpop.is-over { z-index: 10; background: rgb(11, 15, 13); }
/* Identity and stage stay left, stacks right; the compact header does not scroll. */
.bpop__head {
  position: relative; isolation: isolate; flex: none; min-height: .6rem; padding: 0 .08rem 0 0;
  display: flex; gap: .12rem; align-items: center;
}
.bpop__disc { border-radius: 50%; display: grid; place-items: center; flex: none; }
.bpop__head .bpop__disc { width: .74rem; height: .74rem; }
.bpop__disc .bond { --disc: .46rem; }
.bpop__titles { display: flex; flex-direction: column; flex: 1; gap: .02rem; min-width: 0; }
.bpop__name { font-size: calc(.22 * var(--t)); font-weight: 900; letter-spacing: 0; }
.bpop__owner { display: inline-flex; align-items: center; gap: .06rem; font-size: calc(.14 * var(--t)); color: var(--amber); }
.bpop__owner b { color: #fff; font-weight: 700; max-width: 2.4rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bpop.is-other .bpop__disc { box-shadow: 0 0 0 1px rgba(246, 163, 41, .55); }
.bpop__facts { display: flex; flex-wrap: wrap; align-items: center; gap: .06rem .1rem; font-size: calc(.15 * var(--t)); color: var(--text-lo); }
.bpop__facts b { color: #fff; font-size: calc(.18 * var(--t)); }
.bpop__facts small { font-size: calc(.12 * var(--t)); }
.bpop__off { margin: .08rem 0 0; font-size: calc(.14 * var(--t)); color: var(--text-lo); border-left: 2px solid rgba(255, 255, 255, .2); padding-left: .08rem; }
.bpop__sec { min-width: 0; max-width: 100%; display: flex; flex-direction: column; gap: .06rem; }
.bpop__desc { min-width: 0; overflow-wrap: anywhere; font-size: calc(.16 * var(--t)); line-height: 1.7; color: var(--text-md); }
.bpop__members { min-width: 0; max-width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .08rem; }
.bpop__member { position: relative; display: flex; flex-direction: column; align-items: center; gap: .03rem; padding: .04rem 0; background: none; border: 1px solid transparent; }
.bpop__member:hover { border-color: var(--line-2); background: rgba(255, 255, 255, .03); }
.bpop__mname { font-size: calc(.12 * var(--t)); color: var(--text-lo); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bpop__member.is-on .bpop__mname { color: var(--mint-400); }
.bpop__member.is-owned .bpop__mname { color: var(--text-hi); }
/* a member through 变形同构体 (the item pairing, not the operator's own bond): a gold 同构 tag on the portrait */
.bpop__iso { position: absolute; top: .02rem; right: .08rem; padding: 0 .04rem; font-size: calc(.11 * var(--t)); line-height: 1.45; font-weight: 700; color: #141414; background: var(--gold-2); }
/* a count that holds 调和's +1 (the server's bond entry `harmony`, DESIGN §21.26): 在场 n（含调和 +1） and the 调和 row that
   heads the member list, naming the 调和 operators on the board (px floors: readable on phones) */
.bpop__facts small.bpop__hnote { font-size: max(calc(.12 * var(--t)), 8px); color: var(--gold-2); }
.bpop__harmony { display: flex; align-items: center; gap: .08rem; width: 100%; margin: 0; padding: .05rem .1rem; text-align: left;
  font: inherit; font-size: max(calc(.14 * var(--t)), 9px); line-height: 1.45; color: var(--text-md); background: rgba(242, 189, 62, .08); border: 1px dashed rgba(242, 189, 62, .5); }
button.bpop__harmony { cursor: var(--sp-cursor-pointer, pointer); }
button.bpop__harmony:hover { border-style: solid; color: #fff; }
.bpop__harmony b { flex: none; color: var(--gold-2); font-weight: 700; white-space: nowrap; }
.bpop__harmony span { min-width: 0; }
.bpop__harmony .bglyph { width: max(.24rem, 14px); height: max(.24rem, 14px); }
.bpop__harmony .bglyph img { filter: brightness(0) invert(.78) sepia(1) saturate(3) hue-rotate(5deg); }

/* Keep navigation outside the scrolling card and clear of the viewport edges. */
.bpop-nav {
  position: absolute; top: 2.1rem; left: 50%; translate: -50% 0; z-index: 10;
  max-width: calc(100% - max(1.6rem, calc(100px * var(--sp-ui, 1))));
  max-height: calc(100% - 2.4rem); display: grid; grid-template-columns: minmax(0, 1fr); pointer-events: none;
}
.bpop-nav > .bpop {
  position: relative; inset: auto; translate: none; width: 100%; max-width: 100%;
  max-height: 100%; min-height: 0; min-width: 0; pointer-events: auto;
}
.bpop-nav__arrow {
  position: absolute; top: 50%; translate: 0 -50%; width: max(.6rem, 32px, calc(44px * var(--sp-ui, 1))); height: max(.9rem, 32px, calc(44px * var(--sp-ui, 1)));
  display: grid; place-items: center; padding: 0; border: 0; background: transparent;
  color: var(--text-hi); cursor: var(--sp-cursor-pointer, pointer); pointer-events: auto; filter: drop-shadow(0 2px 3px #000);
}
.bpop-nav__arrow--prev { right: calc(100% + .06rem); }
.bpop-nav__arrow--next { left: calc(100% + .06rem); }
.bpop-nav__image { width: 100%; height: 100%; object-fit: contain; opacity: .85; }
.bpop-nav__arrow--prev .bpop-nav__image { transform: scaleX(-1); }
.bpop-nav__arrow:hover .bpop-nav__image { opacity: 1; }
.bpop-nav__arrow:focus-visible { outline: 2px solid var(--mint-400); outline-offset: 2px; }

.bpop__population { display: inline-flex; align-items: center; gap: .04rem; white-space: nowrap; }
.bpop__population > .icon { width: .22rem; height: .22rem; color: var(--mint-400); }
/* the count reads as one string, 「n/第一档」 with no gap in it. Active, as the official cards draw it in both families:
   the members in the accent (the icon's and the check's colour), 「/第一档」 light grey, one size and one bold weight (盟约
   维多利亚 7/3, BV1yyC9BPEXV 1600 s; 规程 不屈 3/2, PR #923's round-11 screenshot; §37.342): the 「/第一档」 takes the
   members' size and weight (`.bpop__facts b`, and its floor in the match-info dialog below). The inactive red plate keeps
   its bold white members and small 「/n」 (no official inactive card found). */
.bpop__tally { white-space: nowrap; }
.bpop__population:not(.is-inactive) .bpop__count { color: var(--mint-400); }
.bpop__population:not(.is-inactive) .bpop__cap { color: var(--text-md); font-size: calc(.18 * var(--t)); font-weight: 700; }
.bpop__check { display: inline-grid; place-items: center; border: 2px solid var(--mint-400); border-radius: .02rem; color: var(--mint-400); }
.bpop__check .icon { width: .14rem; height: .14rem; }
.bpop__stage { padding: .01rem .1rem; font-size: calc(.13 * var(--t)); background: rgba(255, 255, 255, .08); color: var(--text-lo); white-space: nowrap; }
.bpop__stage.is-active { background: var(--mint-400); color: var(--text-on-mint); font-weight: 700; }
.bpop__layers {
  position: relative; flex: none; align-self: stretch; display: flex; flex-direction: column; align-items: flex-end;
  justify-content: flex-start; gap: .03rem; min-width: 1.2rem; padding: .03rem .03rem 0; margin-right: 0;
}
.bpop__stack-deco {
  position: absolute; width: 50%; height: auto; right: 0; top: 0;
  object-fit: contain; opacity: .35; pointer-events: none;
  filter: brightness(.7) sepia(1) saturate(4) hue-rotate(105deg);
}
.bpop__layers > span { position: relative; padding: .03rem .08rem; font-size: calc(.16 * var(--t)); background: var(--bpop-layer-bg, none) center / 100% 100% no-repeat rgba(65, 70, 68, .75); color: var(--text-lo); }
.bpop__layers b { color: var(--text-hi); }

.bpop__population.is-inactive {
  padding: .02rem .05rem; background: var(--bpop-inactive-bg, none) center / 100% 100% no-repeat rgba(117, 36, 36, .75);
  color: var(--text-hi);
}
.bpop__population.is-inactive > .icon { color: #eec6c6; }
.bpop__stage.bpop__inactive { padding: 0; background: none; color: #ff7878; font-weight: 700; }

.bpop__layers > .bpop__temporary { padding: 0 .08rem; background: none; color: var(--gold-2); font-weight: 700; }
.bslot .bond__count { color: var(--text-hi); }
.bslot.has-temp-layers .bond__count { color: var(--gold-2); }

/* Keep the title and decoration fixed; only the description and roster scroll. */
.bpop__body {
  flex: 1 1 auto; min-height: 0; min-width: 0;
  display: flex; flex-direction: column; gap: .08rem;
  padding: .04rem; margin: -.04rem;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
}
.bpop__body > * { flex-shrink: 0; }

/* Original bond board sprites supply both the disc and its ring. Once active, the full lit ring around the lit centre at
   every tier: the unbroken 1_1 in 规程, N_N split by the first threshold in a 盟约 period and on the bond popup's header
   disc in both families (§37.342). Before activation, the segmented member progress (components.js bondFrame). */
.bond.is-sprite .bond__disc::before {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: var(--bond-frame-size); height: var(--bond-frame-size);
  background: var(--bond-frame) center / contain no-repeat; pointer-events: none;
}
.bond.is-sprite .bond__core { position: relative; background: none; box-shadow: none; }
.bond.is-sprite .bond__icon { filter: brightness(0) invert(.65); }
.bond.is-sprite.is-active:not(.is-disabled) .bond__icon { filter: brightness(0) opacity(.85); }
.bond.is-sprite .bond__glyph { color: var(--text-lo); }
.bond.is-sprite.is-active:not(.is-disabled) .bond__glyph { color: #06221a; }

/* Enlarge only the central plate of the same sprite; clip away the ring in this second layer. The mint underneath keeps an
   active centre lit while the sprite loads. */
.bond.is-sprite .bond__core::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: var(--bond-frame) center / calc(var(--bond-frame-size) * 1.08) calc(var(--bond-frame-size) * 1.08) no-repeat;
  clip-path: circle(46% at 50% 50%);
}
.bond.is-sprite.is-active:not(.is-disabled) .bond__core::before { background-color: var(--mint-400); }
.bond.is-sprite .bond__core > .bond__icon, .bond.is-sprite .bond__core > .bond__glyph { position: relative; }

/* Fielded members glow; elite portraits retain their existing gold border. */
.bpop__member.is-on .square-op-thumb__art { border-color: var(--mint-400); box-shadow: 0 0 .1rem rgba(23, 249, 183, .45); }
.bpop__member.is-on .square-op-thumb.is-golden .square-op-thumb__art { border-color: var(--gold); }

/* Only fielded elite members keep gold; all non-fielded members use the original grey frame. */
.bpop__member:not(.is-on) .square-op-thumb .square-op-thumb__art {
  border-color: #808080; border-image: var(--bpop-inactive-border, none) 3 / 1px; box-shadow: none;
}

/* Missing or failed frame images retain a readable disc without requesting guessed URLs. */
.bond.is-frame-missing .bond__core { background: #29332f; border: 2px solid #718079; }
.bond.is-frame-missing.is-active .bond__core { border-color: var(--mint-400); }
.bond.is-frame-missing.is-active:not(.is-disabled) .bond__core { background: var(--mint-400); }

/* Match information opens the same card above its drawer / dialog, without replacing the parent (#915). */
.match-bond-modal { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.match-bond-dialog { --match-bond-close: max(.36rem, 32px); display: flex; min-height: 0; width: min(max(5.4rem, calc(320px * var(--sp-ui, 1)), 32px), 100%); max-height: 100%; outline: none; }
.match-bond-dialog .bpop { position: relative; inset: auto; width: 100%; max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.match-bond-dialog .bpop__close { width: var(--match-bond-close); height: var(--match-bond-close); }
.match-bond-dialog .bpop__head { padding-right: var(--match-bond-close); }
.match-bond-dialog .bpop__name { font-size: max(calc(.28 * var(--t)), 20px); }
.match-bond-dialog .bpop__facts { flex-wrap: wrap; }
.match-bond-dialog .bpop__facts b, .match-bond-dialog .bpop__population:not(.is-inactive) .bpop__cap { font-size: max(calc(.18 * var(--t)), 14px); }
.match-bond-dialog .bpop__sec h4 { font-size: max(calc(.16 * var(--t)), 13px); }
.match-bond-dialog .bpop__desc { font-size: max(calc(.16 * var(--t)), 12px); }
.match-bond-dialog .bpop__facts, .match-bond-dialog .bpop__off { font-size: max(calc(.15 * var(--t)), 12px); }
.match-bond-dialog .bpop__member { min-width: 0; }
.match-bond-dialog .bpop__mname { font-size: max(calc(.12 * var(--t)), 10px); }
.match-bond-dialog .bpop__close { position: absolute; right: .08rem; top: .08rem; z-index: 1; display: grid; place-items: center; background: none; border: 1px solid var(--line-2); color: var(--text-lo); }
.match-bond-dialog .bpop__close .icon { width: .18rem; height: .18rem; }

/* With no members, retain every segment but light none of them. */
.bond.is-empty-progress .bond__disc::before,
.bond.is-empty-progress .bond__core::before { filter: grayscale(1) brightness(.6); }
