.unit-nameplates{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:3}
.unit-nameplates[hidden],.unit-nameplate[hidden]{display:none}
/* Keep the marker inside the already measured plate bounds. */
.unit-nameplate[data-reserved=true]{border-color:#8fddd2;border-style:double;background:#254957;box-shadow:inset 0 -2px #8fddd2,0 1px 3px #0008}
.unit-nameplate{position:absolute;width:44px;height:18px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:3px;transform:translate(-50%,-100%);background:#122338ed;border:1px solid var(--plate-role);border-radius:5px;color:#e7effa;font:600 11px/1 system-ui,sans-serif;box-shadow:0 1px 3px #0008;white-space:nowrap;contain:layout style}
.plate-role{letter-spacing:-.6px}.plate-rank{color:var(--plate-role);font-size:11px}.unit-nameplate.compact{width:20px;border-radius:7px}.unit-nameplate.compact .plate-role{display:none}.unit-nameplate.partner{border-color:#fff;box-shadow:0 0 0 1px #fff8}.unit-nameplate[data-attacking=true]{background:#263d53;border-color:#fff4c8;box-shadow:0 0 5px var(--plate-role)}

/* Read the real role and rank by the feet; geometry protects faces and foes. */
.unit-nameplates[data-mode=battle] .unit-nameplate{width:44px;height:20px;border-radius:5px;gap:3px;background:#142338ed;box-shadow:0 1px 2px #0007;font-size:10px}
.unit-nameplates[data-mode=battle] .unit-nameplate:not(.compact) .plate-role{display:inline}
.unit-nameplates[data-mode=battle] .unit-nameplate.compact{width:18px;height:18px;gap:0}
.unit-nameplates[data-mode=battle] .plate-rank{font-size:11px}
.unit-nameplates[data-mode=battle] .unit-nameplate[data-attacking=true]{background:#30485c;border-color:#fff4c8}
.unit-nameplates[data-mode=battle] .unit-nameplate[data-reserved=true]{border-color:#8fddd2;border-style:double;background:#254957}
