body.worldmap-root-active {
    --panel-paper: #10241e;
    --panel-raised: #18332a;
    --panel-line: #426354;
    --panel-muted: #adbfaf;
    --panel-ivory: #f1e8cd;
    --panel-jade: #91d4b9;
    --panel-gold: #cfb377;
}

.wm-root-panel {
    padding: 24px;
    background: #030b08c9;
}

.wm-root-panel-inner {
    width: min(1100px, 100%);
    max-height: min(920px, calc(100dvh - 48px));
    background: linear-gradient(140deg, #183027, #0d1d18 65%);
    border: 1px solid #a08b5e;
    border-radius: 12px;
    box-shadow: 0 24px 80px #000a, inset 0 1px #e5d19924;
    overflow: hidden;
    color: var(--panel-ivory);
    font-size: 14px;
    line-height: 1.5;
}

.wm-root-panel-inner > header {
    flex-shrink: 0;
    padding: 16px 22px;
    border-bottom: 1px solid #cfb37745;
    background: linear-gradient(100deg, #243c2f, #14271f);
}

.wm-panel-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wm-panel-heading h2 { color: #f0deb3; font: 600 23px/1.2 Georgia, serif; overflow-wrap: anywhere; }
.wm-panel-emblem { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; background: #cfb37712; border: 1px solid #cfb37750; border-radius: 9px; color: var(--panel-gold); }
.wm-panel-emblem svg { width: 26px; height: 26px; }
.wm-root-panel-close { width: 38px; height: 38px; flex-shrink: 0; font-size: 24px; line-height: 1; border: 1px solid #81967b66; border-radius: 7px; background: #10241e; color: #e4d3a8; }
.wm-root-panel-close:hover { background: #314b3a; border-color: #cfb377; }
.wm-root-panel-body { padding: 22px; scrollbar-gutter: stable; overscroll-behavior: contain; }
.wm-root-panel-body > .tab-content { min-width: 0; margin: 0; }

body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope, .stats-overlay) {
    --ui-text: #eee6ce;
    --ui-text-dim: #b9c9bc;
    --ui-text-mute: #a9bbad;
    --ui-border: #456454;
    --ui-border-strong: #78937d;
    --ui-surface-1: #10241e;
    --ui-surface-2: #1b352b;
    --ui-gold: #dfc58d;
    --ui-teal: #8ed5b9;
    --ui-danger: #f2a291;
    --ui-red: #ee9b87;
    --panel: #10241e;
    --panel-2: #1c352b;
    scrollbar-color: #6d8c73 #0d1d18;
    scrollbar-width: thin;
    font-variant-numeric: tabular-nums;
}

body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-card, .ui-card, .sect-panel) {
    background: linear-gradient(145deg, #1a342b, #10241e);
    border-radius: 9px;
    border-color: #456454;
    box-shadow: 0 3px 10px #0002;
    min-width: 0;
}

body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-card__title, .sect-section__title, .prof-title) {
    color: #e4d0a0;
    line-height: 1.4;
    letter-spacing: .025em;
}

body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-btn, .ui-btn) {
    min-height: 36px;
    border-radius: 6px;
    line-height: 1.35;
    white-space: normal;
    box-shadow: none;
}

body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-btn--primary, .ui-btn--primary) {
    background: #34664f;
    border: 1px solid #83b99a;
    color: #f3f2d9;
    text-shadow: none;
}
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) .sect-btn--primary::before,
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) .sect-btn--primary::after { content: none; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-btn--primary, .ui-btn--primary):hover:not(:disabled) { background: #417d60; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-btn--gold, .ui-btn--gold) { background: #554a2d; border-color: #bda268; color: #f6e4b6; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-btn--danger, .ui-btn--danger) { background: #482a26; border-color: #a36b5d; color: #ffd1bd; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-btn--ghost, .ui-btn--ghost) { background: #10241e; color: #c8d9cc; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) button:disabled { cursor: not-allowed; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope, .stats-overlay) :is(button, input, select, [tabindex]):focus-visible { outline: 2px solid #edcd82; outline-offset: 3px; }

body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-toolbar, .fc-toolbar) { flex-wrap: wrap; gap: 10px; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) .sect-segment { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: #071a14; border-color: #46614e; border-radius: 8px; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) .sect-segment__btn { min-height: 34px; padding: 7px 13px; border-radius: 5px; color: #bccdbc; white-space: normal; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-segment__btn.active, .sect-segment__btn--active) { background: #3b5d44; color: #f6e4b6; box-shadow: inset 0 -2px #cfb377; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-input, .sect-select, input[type="search"], input[type="text"], select) { min-height: 36px; max-width: 100%; color: #e9e4cf; background: #091c15; border: 1px solid #55765e; border-radius: 6px; padding: 7px 10px; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-stat__label, .equipment-muted, .text-gray-400, .text-gray-500, .text-gray-600) { color: #b0c2b4; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-stat__value, .equipment-stat-row strong) { color: #efe0b6; overflow-wrap: anywhere; white-space: normal; text-overflow: clip; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-empty, .fc-empty, .chal-empty) { padding: 32px 22px; border: 1px dashed #6a876e; border-radius: 9px; background: #11291f; color: #c1d0be; line-height: 1.7; text-align: center; }
body.worldmap-root-active :is(.wm-root-panel, .ui-modal-scope) :is(.sect-slot-empty, .db-empty-slot) { border: 1px dashed #52745f; background: #13291f; color: #abc3af; border-radius: 9px; }

body.worldmap-root-active .wm-panel-purchase-controls { margin: 0; padding: 9px 22px; background: #0d2119; border: 0; border-bottom: 1px solid #45645480; border-radius: 0; flex-shrink: 0; }
body.worldmap-root-active .wm-panel-purchase-controls .buy-buttons-group { justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
body.worldmap-root-active .wm-panel-purchase-controls .buy-btn { min-width: 45px; min-height: 32px; border-radius: 5px; color: #baceba; }
body.worldmap-root-active .wm-panel-purchase-controls .buy-btn.active { background: #34533d; color: #f5e2ac; border-color: #b59c63; }

body.worldmap-root-active .stats-overlay {
    width: min(960px, calc(100vw - 40px));
    max-height: calc(100dvh - 48px);
    min-height: 0;
    border-radius: 12px;
    background: linear-gradient(140deg, #193329, #0d1d18);
    box-shadow: 0 24px 80px #000b;
    border-color: #a08b5e;
}
body.worldmap-root-active .stats-overlay-header { padding: 18px 22px; background: #20392c; border-bottom: 1px solid #cfb37745; }
body.worldmap-root-active .stats-overlay-header .overlay-title { color: #f0deb3; font: 600 23px/1.2 Georgia, serif; }
body.worldmap-root-active .stats-overlay-close { width: 36px; height: 36px; border-radius: 6px; }
body.worldmap-root-active .stats-overlay-tabs { position: static; padding: 10px 22px; gap: 6px; background: #10271d; border-bottom: 1px solid #456454; flex-shrink: 0; }
body.worldmap-root-active .stats-overlay-tabs button { min-height: 40px; border: 0; border-radius: 6px; background: transparent; color: #bdd0be; }
body.worldmap-root-active .stats-overlay-tabs button[aria-selected="true"] { background: #35543d; box-shadow: inset 0 -2px #cfb377; color: #f6e4b6; }
body.worldmap-root-active #statsTab-overview { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: 'identity cultivation' 'identity attributes' 'lifetime action'; gap: 14px; align-items: start; }
body.worldmap-root-active :is(#statsTab-overview, #statsTab-combat, #statsTab-cultivation, #statsTab-resources) .proficiencies { background: #152e24; border: 1px solid #496b5480; border-radius: 9px; padding: 16px; }
body.worldmap-root-active :is(#statsTab-overview, #statsTab-combat, #statsTab-cultivation, #statsTab-resources) .prof-title { color: #93cdb0; font-size: 11px; font-weight: 700; letter-spacing: .1em; border-bottom-color: #79997840; margin-bottom: 12px; padding-bottom: 10px; }
body.worldmap-root-active #statsTab-overview .wm-overview-identity > [data-action="openWardrobe"] { align-items: center !important; gap: 18px !important; padding: 8px 0 16px; }
body.worldmap-root-active .wm-overview-row { padding: 9px 0; gap: 14px; color: #b3c8b6; font-size: 13px; line-height: 1.5; border-bottom-color: #496b544d; }
body.worldmap-root-active .wm-overview-row strong { color: #eee2bd; }
body.worldmap-root-active .stats-overlay .stat-card { border-radius: 7px; background: #0c2118; border-color: #54745966; padding: 12px; }
body.worldmap-root-active .stats-overlay .stat-name { color: #b4c7b7; font-size: 12px; }
body.worldmap-root-active .stats-overlay .stat-value { color: #f3e7c6; font-size: 17px; overflow-wrap: anywhere; }
body.worldmap-root-active #statsTab-combat .wm-combat-summary-card { border-radius: 9px; border-color: #68876a; background: #1c382a; }
body.worldmap-root-active #statsTab-overview .wm-overview-cultivation .wm-overview-row:first-of-type strong { color: #ead297; font: 600 17px/1.4 Georgia, serif; }

body.worldmap-root-active #modalContainer .ui-modal { border-radius: 12px; background: linear-gradient(140deg, #193329, #0d1d18); box-shadow: 0 24px 80px #000b; }
body.worldmap-root-active #modalContainer .ui-modal__title { color: #f0deb3; font: 600 23px/1.3 Georgia, serif; text-align: left; padding-bottom: 16px; border-bottom: 1px solid #cfb37745; }
body.worldmap-root-active #modalContainer .ui-modal__content { line-height: 1.6; }
body.worldmap-root-active .ui-modal__header { display:flex;align-items:center;gap:16px;flex:0 0 auto;margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid #cfb37745; }
body.worldmap-root-active #modalContainer .ui-modal__header .ui-modal__title { flex:1;min-width:0;margin:0 !important;padding:0;border:0;overflow-wrap:anywhere; }
body.worldmap-root-active .ui-modal__close { display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:1px solid #638168;border-radius:7px;background:#142b21;color:#f0deb3;font:26px/1 sans-serif;font-size:26px !important;cursor:pointer; }
body.worldmap-root-active .ui-modal__close:hover { background:#294838; }
body.worldmap-root-active .ui-modal__close:focus-visible { outline:2px solid #ead297;outline-offset:3px; }
body.worldmap-root-active #sect-inv-grid :is([data-action="sectInventoryDeposit"],[data-action="sectInventoryWithdraw"]) { overflow-wrap:normal;word-break:normal;white-space:normal;min-height:44px; }
body.worldmap-root-active #owned-structures-modal > .sect-card { border:1px solid #a38b57 !important;border-radius:12px;background:linear-gradient(140deg,#193329,#0d1d18);box-shadow:0 24px 80px #000b; }
body.worldmap-root-active #owned-structures-title { font:600 23px/1.3 Georgia,serif; }
body.worldmap-root-active .equipment-slot { background: #142b21; border-radius: 9px; border-color: #638168; }
body.worldmap-root-active .equipment-slot-label { color: #9bc6a8; letter-spacing: .06em; }
body.worldmap-root-active .equipment-totals { gap: 10px; padding: 14px; background: #10251b; border-radius: 8px; }

.wm-root-panel[data-panel="actions"] .wm-root-panel-inner { max-width: 700px; }
.wm-root-panel #actions .actions-container { gap: 16px; }
.wm-root-panel #actions .sect-card { padding: 24px !important; }
.wm-root-panel #actions .sect-card > div:first-child { font: 600 23px/1.4 Georgia, serif !important; color: #ead49d !important; }
.wm-root-panel #actions .sect-card > div:nth-child(2) { color: #bdd0bf !important; font-size: 14px !important; line-height: 1.7; margin: 12px 0 22px !important; }

.wm-root-panel #inventoryContent .inv-grid { gap: 14px !important; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)) !important; max-height: none !important; overflow: visible !important; padding: 4px 0; }
.wm-root-panel #inventoryContent .inv-grid > .sect-card { padding: 16px !important; border-width: 1px !important; border-top-width: 3px !important; box-shadow: none !important; font-size: 16px !important; line-height: 1.55; overflow-wrap: anywhere; }
.wm-root-panel #inventoryContent .inv-grid .sect-btn { margin-top: 4px; min-height: 36px; }
.wm-root-panel #inventoryContent .equipment-compare { text-align: left; }
.wm-root-panel .inventory-pagination { position: sticky; bottom: -22px; z-index: 2; padding: 12px; background: #0d231b; border-top: 1px solid #6e896b; border-radius: 8px 8px 0 0; flex-wrap: wrap; box-shadow: 0 -8px 18px #08171066; }
.wm-root-panel #manuals .ui-card { padding: 18px !important; line-height: 1.6; }
.wm-root-panel #quests .quest-card { padding: 20px !important; border-left: 3px solid #99b278; margin-bottom: 14px !important; }
.wm-root-panel #quests .quest-card h3 { color: #ead6a4; font: 600 19px/1.4 Georgia, serif; }
.wm-root-panel #quests .quest-card p { line-height: 1.7; color: #bed0c0; margin: 10px 0 16px; }
.wm-root-panel #eating .eating-layout { padding-top: 0; }
.wm-root-panel #eating .sect-stat { background: #142d22; padding: 12px 18px; border: 1px solid #496b54; border-radius: 8px; min-width: 0; }
.wm-root-panel #eating .sect-stat__value { font-size: 17px; }
.wm-root-panel #eating .eating-layout > .flex { flex-wrap: wrap; }
.wm-root-panel #spirits .sect-card { padding: 18px !important; line-height: 1.65; }
.wm-root-panel #soulWeapon .sect-card { padding: 16px !important; line-height: 1.6; }
.wm-root-panel .soul-dist-card { background: #122c21; border: 1px solid #53745c; border-radius: 8px; padding: 16px; }
.wm-root-panel #soulStats .min-w-\[320px\] { min-width: 0; }
.wm-root-panel #soulDistribution { background: #11291e; border: 1px solid #7f9468; border-radius: 10px; box-shadow: none; }
.wm-root-panel #soulStats .text-game-gold { color: #e4ce93; text-shadow: none; }
.wm-root-panel #soulStats :is(.text-purple-500, .soul-dist-value.talent) { color: #d0abe6; text-shadow: none; }
.wm-root-panel #soulStats .text-red-500 { color: #f0a394; }
.wm-root-panel #soulStats .soul-dist-card { text-shadow: none; }
.wm-root-panel #meridian .sect-card { padding: 16px !important; border-radius: 8px; line-height: 1.6; }
.wm-root-panel #laws .sect-card { padding: 20px !important; }
.wm-root-panel .db-grid { gap: 16px; }
.wm-root-panel .db-card { border-width: 1px; overflow-wrap: anywhere; }
.wm-root-panel .db-stat { padding: 9px 11px; border-radius: 6px; background: #0c2119; }
.wm-root-panel .db-actions { gap: 7px; }

.wm-root-panel .dantian-parent-container { max-width: none; padding: 0; gap: 18px; }
.wm-root-panel .dantian-stats-panel { padding: 18px; gap: 12px; background: #10271d; border-color: #52755a; border-radius: 10px; }
.wm-root-panel .dantian-stats-panel .dantian-stat-row { padding: 9px 12px; background: #1c3628; border-radius: 6px; gap: 10px; }
.wm-root-panel .dantian-stat-label { color: #b6cdb9; }
.wm-root-panel .dantian-stats-panel .dantian-stat-value { font-size: 14px; }
.wm-root-panel .dantian-stats-panel .dantian-stat-percent { color: #c5d8c7; }
.wm-root-panel .dantian-stats-panel .dantian-develop-btn { min-height: 38px; border-radius: 6px; background: #39785c; color: #f3efd5; }
.wm-root-panel .dantian-stats-panel .dtn-element-shares { padding-top: 14px; gap: 12px; }

.wm-root-panel :is(.fc-wrap, .dm-wrap, .chal-wrap) { max-width: none; padding: 0; }
.wm-root-panel :is(.fc-header, .fate-header) { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid #54745966; }
.wm-root-panel :is(.fc-title, .fate-title, .chal-title) { font: 600 24px/1.3 Georgia, serif; color: #e9d6a3; text-shadow: none; }
.wm-root-panel .fc-viewtabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
.wm-root-panel .fc-header:has(> .fc-title:only-child) { display: none; }
.wm-root-panel .fc-viewtab { padding: 9px 16px; border: 1px solid #56735c; border-radius: 6px; background: #0e241b; color: #bed0bf; min-height: 38px; }
.wm-root-panel .fc-viewtab--active { background: #36553e; border-color: #b99e64; color: #f1dfb1; }
.wm-root-panel .fc-ring { display: none; }
.wm-root-panel :is(.fc-connecting, .dm-subtitle, .chal-sub) { line-height: 1.7; color: #bdcfbd; }
.wm-root-panel .fc-connecting { padding: 14px 18px; background: #263a28; border: 1px solid #8c925866; border-left: 3px solid #c0a66b; border-radius: 6px; text-align: left; }
.wm-root-panel .fc-inv-grid { gap: 16px; }
.wm-root-panel .fc-inv-card { overflow: hidden; border-width: 1px; }
.wm-root-panel .fc-inv-head { padding: 14px; }
.wm-root-panel .fc-inv-name { line-height: 1.45; overflow-wrap: anywhere; }
.wm-root-panel .fc-inv-foot { padding: 12px 14px; background: #0b2118; }
.wm-root-panel :is(.fc-stats, .ah-controls, .fate-balance-box) { padding: 16px; border-radius: 9px; background: #162f23; border: 1px solid #496b54; }
.wm-root-panel .fate-balance-box { position:static; }
.wm-root-panel .ah-control-row { flex-wrap: wrap; gap: 10px; }
.wm-root-panel .fate-cultivation-ui > h2 { font: 600 24px/1.3 Georgia, serif; color: #e9d6a3; margin: 0 0 18px; }
.wm-root-panel .fate-cultivation-ui .fc-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.wm-root-panel .fate-cultivation-ui :is(input, select) { min-width: 0; max-width: 100%; }
.wm-root-panel .fate-lobby-overview { border-radius: 10px; border-color: #59765c; }
.wm-root-panel .fate-battle-mode { border-radius: 10px; border-color: #65836a; }
.wm-root-panel .fate-battle-mode-desc { color: #b8cdb9; line-height: 1.65; }
.wm-root-panel .achievements-header { padding: 20px; background: #173326; border: 1px solid #58755a; border-radius: 10px; margin-bottom: 16px; }
.wm-root-panel .achievements-header-row { gap: 12px; flex-wrap: wrap; }
.wm-root-panel .achievement-badge-group { border: 1px solid #456454; border-radius: 9px; background: #10271d; padding: 16px; }
.wm-root-panel .achievement-badge-group-header { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid #53765a66; }
.wm-root-panel .chal-grid { gap: 16px; }
.wm-root-panel .chal-card { padding: 20px; border: 1px solid #58765d; border-radius: 10px; background: #132d22; }
.wm-root-panel .chal-desc { color: #b8cbb9; line-height: 1.7; }
.wm-root-panel .chal-goal { padding: 12px; border-radius: 6px; background: #213b29; color: #ead7a6; }
.wm-root-panel .chal-start { min-height: 38px; border-radius: 6px; background: #34664f !important; color: #f0e8cb !important; }
.wm-root-panel .rir-header { gap: 12px; padding: 14px; background: #10271d; border: 1px solid #547459; border-radius: 9px; }
.wm-root-panel .rir-hstat .l { color: #bbceb8; }
.wm-root-panel :is(.rir-scene, .sk-scene) { border-radius: 10px; border: 1px solid #547459; }
.wm-root-panel #weaponSkills .weapon-subtabs { gap: 6px; }
.wm-root-panel #weaponSkills .weapon-subtabs .tab { min-height: 54px; border-radius: 7px; background: #142d22; border: 1px solid #506e57; color: #d4dfc9; }
.wm-root-panel #weaponSkills .weapon-subtabs .tab.active { background: #35543d; border-color: #cfb377; color: #f4dfb1; }
.wm-root-panel #bloodlineCraftingPanel { background: #10271d; border: 1px solid #496b54; border-radius: 9px; }
.wm-root-panel[data-panel="bloodline"] .wm-root-panel-inner { height: min(850px, calc(100dvh - 48px)); }
.wm-root-panel[data-panel="bloodline"] .wm-root-panel-body { display: flex; flex: 1; min-height: 0; }
.wm-root-panel #bloodline { flex: 1; display: flex !important; min-height: 0; }
.wm-root-panel #builderCanvas { min-height: 340px; }
.wm-root-panel #weaponSkills:not(.weapon-skills-fullscreen) #weaponSkillTreeContainer { height: min(650px, 65dvh); min-height: 340px; }
.wm-root-panel :is(.fc-title, .fate-title, .chal-title), .wm-root-panel .fate-cultivation-ui > h2 { display: none; }
body.worldmap-root-active #rebirthConfirmModal_content > div:last-child { position: sticky; bottom: 0; padding: 12px 0 0; background: #10271e; }
body.worldmap-root-active #rebirthConfirmModal [data-action="gameConfirmRebirth"] { background: #5d4530 !important; color: #f7e5bd !important; border: 1px solid #c3a169 !important; }
body.worldmap-root-active #rebirthConfirmModal [data-action="modalCloseId"] { background: #203d2d !important; color: #dfe9d5 !important; border: 1px solid #729579 !important; }
.wm-root-panel .fate-shop-wrap { padding: 0; }
.wm-root-panel .fate-grid { gap: 16px; }
.wm-root-panel .fs-card { border-radius: 10px; }

@media (max-width: 720px) {
    .wm-root-panel { padding: 10px; }
    .wm-root-panel-inner { max-height: calc(100dvh - 20px); border-radius: 9px; }
    .wm-root-panel-inner > header { padding: 12px 14px; }
    .wm-panel-heading { gap: 10px; }
    .wm-panel-heading h2 { font-size: 20px; }
    .wm-panel-emblem { width: 34px; height: 34px; flex-basis: 34px; }
    .wm-panel-emblem svg { width: 22px; height: 22px; }
    .wm-root-panel-body { padding: 14px; }
    body.worldmap-root-active .wm-panel-purchase-controls { padding: 8px 14px; }
    body.worldmap-root-active .stats-overlay { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
    body.worldmap-root-active .stats-overlay-header { padding: 14px; }
    body.worldmap-root-active .stats-overlay-tabs { padding: 8px 12px; flex-wrap: wrap; }
    body.worldmap-root-active .stats-overlay-tabs button { min-width: 100px; flex-basis: 40%; }
    body.worldmap-root-active #statsTab-overview { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'identity' 'cultivation' 'attributes' 'lifetime' 'action'; }
    body.worldmap-root-active #statsTab-cultivation { grid-template-columns: minmax(0, 1fr); }
    .wm-root-panel #inventoryContent .inv-grid > .sect-card { padding: 14px !important; }
    .wm-root-panel .inventory-pagination { bottom: -14px; padding: 10px 4px; }
    .wm-root-panel .dantian-stats-panel { padding: 12px; gap: 8px; }
    .wm-root-panel .dantian-stats-panel .dantian-stat-row { flex: 1 1 120px; }
    .wm-root-panel .fc-inv-grid { gap: 10px; }
    .wm-root-panel .fc-header { align-items: flex-start; }
    .wm-root-panel #bloodlineCraftingPanel { max-width: 100%; }
    .wm-root-panel[data-panel="bloodline"] .wm-root-panel-inner { height: calc(100dvh - 20px); }
    body.worldmap-root-active #modalContainer .modal-inner.ui-modal { font-size: 14px !important; padding: 14px !important; max-height: calc(100dvh - 24px) !important; }
    body.worldmap-root-active #modalContainer .modal-inner .ui-modal__title { font-size: 20px !important; margin-bottom: 12px !important; white-space: normal; }
}

/* Purchase/upgrade quantity occupies the same row below each panel header. */
body.worldmap-root-active .wm-quantity-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    flex-shrink: 0;
    gap: 6px;
    margin: 0 0 12px;
    padding: 10px 0;
    background: #10271e;
    border: 0;
    border-bottom: 1px solid #45645480;
    border-radius: 0;
}
body.worldmap-root-active .wm-quantity-toolbar .buy-buttons-group {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    width: auto;
    gap: 6px;
}
body.worldmap-root-active .wm-quantity-toolbar button {
    flex: 0 0 auto !important;
    min-width: 48px !important;
    min-height: 36px !important;
    height: auto !important;
    margin: 0;
    padding: 7px 10px !important;
    border: 1px solid #789486;
    border-radius: 5px;
    background: #142d23;
    color: #c9d8ca;
    font-size: 12px !important;
    line-height: 1.3;
    cursor: pointer;
}
body.worldmap-root-active .wm-quantity-toolbar button.active,
body.worldmap-root-active .wm-quantity-toolbar button.sect-btn--primary {
    background: #34533d;
    color: #f5e2ac;
    border-color: #b59c63;
}
body.worldmap-root-active .wm-quantity-toolbar button:focus-visible {
    outline: 2px solid #e5c982;
    outline-offset: 2px;
}
body.worldmap-root-active .wm-panel-purchase-controls.wm-quantity-toolbar {
    position: relative;
    inset: auto;
    padding: 10px 22px;
    margin: 0;
}
body.worldmap-root-active .structure-ui--quantities .structure-ui__controls {
    position: relative;
    padding-bottom: 16px;
}
body.worldmap-root-active .structure-ui--quantities .wm-quantity-toolbar {
    position: relative;
    padding: 10px 24px;
    margin: 0;
}
body.worldmap-root-active .structure-ui--quantities .ui-modal__content {
    padding-top: 16px;
}
@media (max-width: 600px) {
    body.worldmap-root-active .wm-panel-purchase-controls.wm-quantity-toolbar,
    body.worldmap-root-active .structure-ui--quantities .wm-quantity-toolbar { padding: 8px 12px; }
    body.worldmap-root-active .wm-quantity-toolbar button { min-height: 44px !important; }
}
