.bpw-wrap{max-width:980px;margin:20px auto;padding:20px;border:1px solid #ddd;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.08)}


/* If a site editor accidentally leaves the BPW shortcode in a Preformatted/Code
   block, neutralize preformatted whitespace around the shortcode so Firefox does
   not display indentation-only lines as pink markers. The PHP cleanup unwraps
   these in normal shortcode rendering; this CSS is a safe fallback. */
pre:has(> .bpw-wrap),
code:has(> .bpw-wrap),
pre:has(.bpw-wrap),
code:has(.bpw-wrap){white-space:normal!important;font-family:inherit!important;margin-top:0!important;margin-bottom:0!important;padding-top:0!important;padding-bottom:0!important;background:transparent!important;border:0!important;}
pre > .bpw-wrap,
code > .bpw-wrap{white-space:normal!important;font-family:inherit!important;}

/* Force BPW shortcode screens to render template indentation as ordinary HTML
   whitespace. Some themes/browser combinations expose newline-only text nodes
   as visible pink blank lines; this removes those artifacts without changing
   command-center content. */
.bpw-wrap,
.bpw-wrap *{white-space:normal;}
.bpw-wrap .bpw-force-nowrap,
.bpw-wrap [style*="white-space:nowrap"]{white-space:nowrap;}

/* Keep the command-center header/menu horizontal and stable after whitespace
   cleanup. */
.bpw-command-center-header{display:block!important;margin-top:0!important;}
.bpw-command-center-header h2{margin:8px 0 8px 0!important;line-height:1.25;}
.bpw-command-center-actions{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important;justify-content:center!important;margin:8px 0 0 0!important;}
.bpw-command-center-actions > *{flex:0 0 auto;}
.bpw-empire-menu-panel{margin-top:8px!important;padding:0!important;overflow:visible;background:#fff;}
.bpw-empire-menu-panel>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:38px;padding:8px 11px;cursor:pointer;list-style:none;color:#1d2327;font-size:12px;font-weight:700;line-height:1.2;}
.bpw-empire-menu-panel>summary::-webkit-details-marker{display:none;}
.bpw-empire-menu-panel>summary::after{content:'Collapse';flex:0 0 auto;padding:2px 8px;border:1px solid #9ec5e8;border-radius:999px;background:#fff;color:#2271b1;font-size:10px;font-weight:600;line-height:1.3;white-space:nowrap;}
.bpw-empire-menu-panel:not([open])>summary::after{content:'Expand';}
.bpw-empire-menu-panel-body{padding:7px;border-top:1px solid #e5e5e5;}
.bpw-empire-menu-grid{display:flex!important;flex-wrap:nowrap!important;align-items:stretch!important;gap:6px!important;width:100%!important;min-width:0!important;margin:0!important;}
.bpw-empire-menu-grid>.bpw-empire-action-card{flex:1 1 0;min-width:0;}
.bpw-empire-menu-grid .bpw-card{min-width:0;}
.bpw-empire-menu-grid .bpw-empire-road-map-card{border-color:#22c8c8;background:#f2ffff;box-shadow:0 0 0 1px rgba(34,200,200,.38),0 5px 14px rgba(20,184,166,.28);}
.bpw-empire-menu-grid .bpw-empire-road-map-card:hover,.bpw-empire-menu-grid .bpw-empire-road-map-card:focus-visible{border-color:#0891b2;background:#fff;box-shadow:0 0 0 2px rgba(34,211,238,.55),0 6px 16px rgba(8,145,178,.32);}


/* Tight BPW shortcode spacing.
   The Graphene/theme content area gives empty shortcode lines a visible trace in
   Firefox-derived browsers. Collapse the vertical space made by BPW wrapper
   margin/padding and by empty paragraph/line nodes
   around BPW output. */
.bpw-wrap.bpw-command-center-wrap,
.bpw-wrap.bpw-logged-out-onboarding,
.bpw-wrap.bpw-start-realm-wrap{margin-top:0!important;padding-top:0!important}
.bpw-wrap.bpw-command-center-wrap > :first-child,
.bpw-wrap.bpw-logged-out-onboarding > :first-child,
.bpw-wrap.bpw-start-realm-wrap > :first-child{margin-top:0!important}
.bpw-wrap.bpw-command-center-wrap > p:empty,
.bpw-wrap.bpw-logged-out-onboarding > p:empty,
.bpw-wrap.bpw-start-realm-wrap > p:empty,
.bpw-wrap.bpw-command-center-wrap > br:first-child,
.bpw-wrap.bpw-logged-out-onboarding > br:first-child,
.bpw-wrap.bpw-start-realm-wrap > br:first-child{display:none!important;margin:0!important;padding:0!important;height:0!important;line-height:0!important}
.bpw-wrap.bpw-command-center-wrap > p:first-child,
.bpw-wrap.bpw-command-center-wrap > p:first-child + p,
.bpw-wrap.bpw-logged-out-onboarding > p:first-child,
.bpw-wrap.bpw-start-realm-wrap > p:first-child{margin-top:0!important;margin-bottom:0!important;padding:0!important}
.entry-content > p:empty,.page-content > p:empty,.post-content > p:empty{margin-top:0!important;margin-bottom:0!important;padding:0!important;height:0!important;line-height:0!important}
.entry-content > p:empty + .bpw-wrap,.page-content > p:empty + .bpw-wrap,.post-content > p:empty + .bpw-wrap{margin-top:0!important}
.entry-content > .bpw-wrap:first-child,.page-content > .bpw-wrap:first-child,.post-content > .bpw-wrap:first-child{margin-top:0!important}
.bpw-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:16px}
.bpw-card{border:1px solid #e5e5e5;padding:12px;background:#fafafa}
.bpw-grid .bpw-card h3{font-size:14px;line-height:1.25;margin:0 0 6px}
.bpw-grid .bpw-card p{font-size:15px;line-height:1.3;margin:0}
.bpw-message{padding:10px 12px;background:#eef7ee;border-left:4px solid #46b450;margin-bottom:16px}
.bpw-error{padding:10px 12px;background:#fff1f0;border-left:4px solid #dc3232;margin-bottom:16px}
.bpw-form-row{margin-bottom:12px}.bpw-form-row label{display:block;font-weight:600;margin-bottom:6px}
.bpw-form-row input,.bpw-form-row select,.bpw-form-row textarea{width:100%;padding:8px}
.bpw-mt20{margin-top:20px}
@media (max-width: 900px){.bpw-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width: 560px){.bpw-grid{grid-template-columns:1fr}}

.bpw-command-center-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.bpw-notifications-details{position:relative}
.bpw-notifications-button{display:inline-block;padding:10px 14px;border-radius:6px;color:#fff;cursor:pointer;list-style:none;font-weight:600}
.bpw-notifications-button::-webkit-details-marker{display:none}
.bpw-notifications-button-has-unread{background:#b91c1c}
.bpw-notifications-button-clear{background:#15803d}
.bpw-notifications-panel{margin-top:8px;padding:12px;border:1px solid #ddd;background:#fff;min-width:320px;max-width:520px;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.bpw-notifications-list{display:grid;gap:10px}
.bpw-notification-item{padding:10px;border:1px solid #ddd;background:#fafafa}
.bpw-notification-item.is-unread{border-left:4px solid #b91c1c;background:#fff7f7}
.bpw-notification-item.is-read{border-left:4px solid #15803d;background:#f7fff8}
.bpw-notification-meta{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:#666;margin:6px 0}

.bpw-notifications-widget{position:relative}
.bpw-notifications-real-button{
    display:inline-block !important;
    padding:10px 14px;
    border-radius:6px;
    border:1px solid transparent;
    font-weight:700;
    line-height:1.2;
    cursor:pointer;
}
.bpw-notifications-real-button.bpw-notifications-button-has-unread{
    background:#b91c1c !important;
    border-color:#991b1b !important;
    color:#fff !important;
}
.bpw-notifications-real-button.bpw-notifications-button-clear{
    background:#15803d !important;
    border-color:#166534 !important;
    color:#fff !important;
}
.bpw-notifications-panel-hidden{display:none}

/* Keep short command-center tabs, such as Global Market and Road Builder, from
   allowing Graphene/theme footer or sidebar widgets to rise immediately under
   the game panel.  This preserves the BPW shortcode as a self-contained visual
   block even when the active tab has only a small amount of content.  The
   command-center view also includes an inline copy of this guard so it remains
   effective when browser/theme CSS caching is behind the latest plugin files. */
.bpw-wrap.bpw-command-center-wrap{
    box-sizing:border-box;
    display:block;
    width:100%;
    max-width:980px;
    min-width:0;
    min-height:max(560px, calc(100vh - 130px));
    margin-bottom:36px!important;
    overflow-x:hidden;
    overflow-y:visible;
    clear:both;
}
.bpw-wrap.bpw-command-center-wrap::after{
    content:"";
    display:block;
    clear:both;
}
#bpw-command-center-dynamic-region{
    display:flow-root;
    width:100%;
    max-width:100%;
    min-width:0;
    clear:both;
    overflow-x:hidden;
    overflow-y:visible;
    box-sizing:border-box;
    contain:inline-size;
}
#bpw-command-center-dynamic-region > *,
#bpw-command-center-dynamic-region .bpw-card,
#bpw-command-center-dynamic-region .bpw-player-subsection,
#bpw-command-center-dynamic-region .bpw-player-subsection-body,
#bpw-command-center-dynamic-region details,
#bpw-command-center-dynamic-region form{
    box-sizing:border-box;
    max-width:100%;
    min-width:0;
}
.bpw-command-table-scroll{
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    overflow-x:auto;
    overflow-y:visible;
    box-sizing:border-box;
    -webkit-overflow-scrolling:touch;
}
.bpw-command-table-scroll > table{
    margin-left:0!important;
    margin-right:0!important;
}
#bpw-command-center-dynamic-region input,
#bpw-command-center-dynamic-region select,
#bpw-command-center-dynamic-region textarea{
    max-width:100%;
    box-sizing:border-box;
}
.bpw-wrap.bpw-command-center-wrap .bpw-global-market-panel{
    margin-bottom:28px!important;
    clear:both;
}
.bpw-wrap.bpw-command-center-wrap .bpw-global-market-panel,
.bpw-wrap.bpw-command-center-wrap .bpw-global-market-panel *{
    box-sizing:border-box;
}
@media (max-width: 760px){
    .bpw-wrap.bpw-command-center-wrap{min-height:auto!important;margin-bottom:20px!important;}
}

/* Battle notification report layout.
   The notification renderer emits an aligned before/after comparison grid; keep
   these styles in the shared front-end stylesheet so AJAX notification refreshes
   and full Command Center renders use the same presentation. */
.bpw-battle-report{
    display:block;
    width:100%;
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
    line-height:1.45;
}
.bpw-battle-report-intro,
.bpw-battle-report-outcome{
    margin:0 0 12px;
}
.bpw-battle-report-outcome{
    padding:9px 11px;
    border-left:4px solid #64748b;
    background:#f8fafc;
}
.bpw-battle-report-heading,
.bpw-battle-report-title{
    display:block;
    margin:0 0 6px;
    font-weight:700;
    line-height:1.3;
}
.bpw-battle-report-section{
    margin:12px 0 0;
    min-width:0;
}
.bpw-battle-report-section ul{
    margin:5px 0 0 20px;
    padding:0;
}
.bpw-battle-report-section li{
    margin:3px 0;
    overflow-wrap:anywhere;
}
.bpw-battle-comparison-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    width:100%;
    max-width:100%;
    min-width:0;
    margin:14px 0;
    box-sizing:border-box;
}
.bpw-battle-comparison-grid > div{
    display:flex;
    flex-direction:column;
    min-width:0;
    padding:10px;
    border:1px solid #d7dce2;
    border-radius:4px;
    background:#f8fafc;
    box-sizing:border-box;
}
.bpw-battle-comparison-grid > div:nth-child(-n+2){
    border-top:3px solid #b91c1c;
}
.bpw-battle-comparison-grid > div:nth-child(n+3){
    border-top:3px solid #2563a8;
}
.bpw-battle-unit-box{
    flex:1 1 auto;
    min-width:0;
    margin-top:2px;
    padding:7px 9px;
    border:1px solid #e1e5ea;
    border-radius:3px;
    background:#fff;
    box-sizing:border-box;
}
.bpw-battle-unit-row{
    display:grid;
    grid-template-columns:minmax(2.75em,auto) minmax(0,1fr);
    column-gap:8px;
    align-items:baseline;
    min-width:0;
    padding:3px 0;
    border-bottom:1px solid #edf0f2;
}
.bpw-battle-unit-row:last-child{
    border-bottom:0;
}
.bpw-battle-unit-quantity{
    text-align:right;
    font-weight:700;
    font-variant-numeric:tabular-nums;
    white-space:nowrap!important;
}
.bpw-battle-unit-name{
    min-width:0;
    overflow-wrap:anywhere;
}
.bpw-battle-unit-box-empty{
    display:flex;
    align-items:center;
    min-height:38px;
    color:#68727d;
    font-style:italic;
    font-weight:600;
}
.bpw-battle-report-summary{
    margin:14px 0 0;
    padding-top:12px;
    border-top:1px solid #d7dce2;
}
.bpw-battle-report-summary .bpw-battle-report-section{
    margin-top:10px;
}
@media (max-width: 620px){
    .bpw-battle-comparison-grid{
        grid-template-columns:1fr;
        gap:10px;
    }
}

/* Mobile-responsive player UI foundation (0.7.275).
   These utilities are deliberately opt-in outside the Command Center so later
   module slices can adopt one consistent mobile policy without changing desktop
   layouts or gameplay behavior. */
.bpw-mobile-stack,
.bpw-mobile-action-grid,
.bpw-compact-metric-grid{
    min-width:0;
}
.bpw-mobile-only{
    display:none!important;
}
.bpw-touch-target{
    box-sizing:border-box;
}
.bpw-mobile-window-shell{
    box-sizing:border-box;
}
.bpw-mobile-window{
    box-sizing:border-box;
    min-width:0;
}
.bpw-mobile-window-header{
    box-sizing:border-box;
    flex:0 0 auto;
}
.bpw-mobile-window-body{
    box-sizing:border-box;
    min-width:0;
    min-height:0;
}
.bpw-mobile-window-close{
    box-sizing:border-box;
}
:root{
    --bpw-mobile-window-chrome-top:8px;
    --bpw-mobile-window-chrome-bottom:8px;
    --bpw-mobile-window-reserved-y:16px;
}
body.admin-bar{
    --bpw-mobile-window-chrome-top:54px;
    --bpw-mobile-window-reserved-y:62px;
}
.bpw-selected-city-overview-grid{
    display:grid;
    grid-template-columns:minmax(220px,1fr) minmax(260px,1.2fr);
    gap:12px;
    align-items:start;
    min-width:0;
}
.bpw-selected-city-overview-grid > *{
    min-width:0;
}
.bpw-selected-city-paradigm-form{
    margin:0;
    display:flex;
    gap:8px;
    align-items:end;
    flex-wrap:wrap;
    min-width:0;
}
.bpw-selected-city-paradigm-field{
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
}
.bpw-paradigm-strength-weakness-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    margin-top:8px;
    color:#4b5563;
    min-width:0;
}

@media (max-width: 700px){
    .bpw-wrap.bpw-command-center-wrap{
        padding-right:10px!important;
        padding-bottom:12px!important;
        padding-left:10px!important;
    }
    .bpw-mobile-only{
        display:initial!important;
    }
    .bpw-desktop-only{
        display:none!important;
    }
    .bpw-mobile-stack{
        display:flex!important;
        flex-direction:column!important;
        align-items:stretch!important;
        width:100%!important;
    }
    .bpw-mobile-action-grid{
        display:grid!important;
        grid-template-columns:1fr!important;
        gap:8px!important;
        width:100%!important;
    }
    .bpw-compact-metric-grid{
        display:grid!important;
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:8px!important;
        width:100%!important;
    }
    .bpw-touch-target,
    .bpw-wrap.bpw-command-center-wrap button:not(.bpw-no-touch-size),
    .bpw-wrap.bpw-command-center-wrap .button:not(.bpw-no-touch-size),
    .bpw-wrap.bpw-command-center-wrap input[type="submit"]:not(.bpw-no-touch-size),
    .bpw-wrap.bpw-command-center-wrap input[type="button"]:not(.bpw-no-touch-size),
    .bpw-wrap.bpw-command-center-wrap input[type="reset"]:not(.bpw-no-touch-size){
        min-height:40px;
        line-height:1.25;
        font-size:14px;
    }
    .bpw-wrap.bpw-command-center-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .bpw-wrap.bpw-command-center-wrap select,
    .bpw-wrap.bpw-command-center-wrap textarea{
        font-size:16px;
    }
    .bpw-mobile-window-shell{
        padding:0;
    }
    .bpw-mobile-window{
        position:fixed!important;
        top:8px!important;
        right:8px!important;
        bottom:8px!important;
        left:8px!important;
        top:var(--bpw-mobile-window-chrome-top, 8px)!important;
        top:max(var(--bpw-mobile-window-chrome-top, 8px), env(safe-area-inset-top, 0px))!important;
        right:max(8px, env(safe-area-inset-right, 0px))!important;
        bottom:var(--bpw-mobile-window-chrome-bottom, 8px)!important;
        bottom:max(var(--bpw-mobile-window-chrome-bottom, 8px), env(safe-area-inset-bottom, 0px))!important;
        left:max(8px, env(safe-area-inset-left, 0px))!important;
        width:auto!important;
        height:auto!important;
        max-width:none!important;
        max-height:calc(100vh - var(--bpw-mobile-window-reserved-y, 16px))!important;
        max-height:calc(100dvh - var(--bpw-mobile-window-reserved-y, 16px))!important;
        min-width:0!important;
        min-height:0!important;
        transform:none!important;
        resize:none!important;
        border-radius:8px!important;
    }
    .bpw-mobile-window-header{
        position:sticky;
        top:0;
        z-index:2;
        cursor:default!important;
        padding:8px 10px!important;
    }
    .bpw-mobile-window-header h2,
    .bpw-mobile-window-header h3,
    .bpw-mobile-window-header h4{
        min-width:0;
        overflow-wrap:anywhere;
    }
    .bpw-mobile-window-body{
        flex:1 1 auto;
        overflow:auto!important;
        overscroll-behavior:contain;
        -webkit-overflow-scrolling:touch;
        padding:12px!important;
    }
    .bpw-mobile-window-close{
        display:inline-flex!important;
        align-items:center!important;
        justify-content:center!important;
        min-width:44px!important;
        min-height:44px!important;
        padding:0!important;
        flex:0 0 44px;
    }
    .bpw-selected-city-overview-grid,
    .bpw-paradigm-strength-weakness-grid{
        grid-template-columns:1fr;
    }
    .bpw-selected-city-paradigm-form{
        align-items:stretch;
    }
    .bpw-selected-city-paradigm-field,
    .bpw-selected-city-paradigm-field select,
    .bpw-selected-city-paradigm-form button{
        width:100%;
        max-width:none;
    }
}

@media (max-width: 420px){
    .bpw-wrap.bpw-command-center-wrap{
        padding-right:8px!important;
        padding-left:8px!important;
    }
    .bpw-compact-metric-grid{
        grid-template-columns:1fr!important;
    }
}


/* Mobile-responsive action cards and stacked gameplay forms (0.7.276).
   Modules opt in with .bpw-mobile-card-table and data-label attributes so the
   same authoritative form and AJAX markup is used on desktop and mobile. */
.bpw-mobile-card-table{
    width:100%;
    max-width:100%;
}
.bpw-mobile-card-table td,
.bpw-mobile-card-table th,
.bpw-mobile-card-table > tbody,
.bpw-mobile-card-table > tfoot,
.bpw-mobile-card-table > tbody > tr,
.bpw-mobile-card-table > tfoot > tr{
    box-sizing:border-box;
}
@media (max-width: 700px){
    .bpw-mobile-card-table{
        display:block!important;
        width:100%!important;
        min-width:0!important;
        max-width:100%!important;
        table-layout:auto!important;
        border:0!important;
        background:transparent!important;
        box-shadow:none!important;
    }
    .bpw-mobile-card-table colgroup,
    .bpw-mobile-card-table > thead{
        position:absolute!important;
        width:1px!important;
        height:1px!important;
        padding:0!important;
        margin:-1px!important;
        overflow:hidden!important;
        clip:rect(0,0,0,0)!important;
        white-space:nowrap!important;
        border:0!important;
    }
    .bpw-mobile-card-table > tbody,
    .bpw-mobile-card-table > tfoot{
        display:block!important;
        width:100%!important;
        min-width:0!important;
    }
    .bpw-mobile-card-table > tbody > tr{
        display:block!important;
        width:100%!important;
        min-width:0!important;
        margin:0 0 12px!important;
        padding:10px 12px!important;
        border:1px solid #dcdcde!important;
        border-radius:7px!important;
        background:#fff!important;
        box-shadow:0 1px 2px rgba(0,0,0,.04)!important;
    }
    .bpw-mobile-card-table > tbody > tr:last-child{
        margin-bottom:0!important;
    }
    .bpw-mobile-card-table > tbody > tr > td{
        display:grid!important;
        grid-template-columns:minmax(96px,34%) minmax(0,1fr)!important;
        gap:8px!important;
        align-items:start!important;
        width:100%!important;
        max-width:none!important;
        min-width:0!important;
        padding:8px 0!important;
        border:0!important;
        border-bottom:1px solid #edf0f2!important;
        text-align:left!important;
        white-space:normal!important;
        overflow:visible!important;
        overflow-wrap:anywhere!important;
    }
    .bpw-mobile-card-table > tbody > tr > td:last-child{
        border-bottom:0!important;
    }
    .bpw-mobile-card-table > tbody > tr > td::before{
        content:attr(data-label);
        display:block;
        min-width:0;
        color:#50575e;
        font-weight:700;
        line-height:1.3;
        overflow-wrap:anywhere;
    }
    .bpw-mobile-card-table > tbody > tr > td[data-bpw-mobile-full="1"]{
        display:block!important;
    }
    .bpw-mobile-card-table > tbody > tr > td[data-bpw-mobile-full="1"]::before{
        margin-bottom:6px;
    }
    .bpw-mobile-card-table > tbody > tr > td[data-bpw-mobile-no-label="1"]::before{
        display:none!important;
    }
    .bpw-mobile-card-table > tbody > tr > td[data-bpw-mobile-no-label="1"]{
        display:block!important;
    }
    .bpw-mobile-card-table > tfoot > tr{
        display:block!important;
        width:100%!important;
        margin:8px 0 0!important;
        padding:10px 12px!important;
        border:1px solid #d6c9df!important;
        border-radius:7px!important;
        background:#f6f3f8!important;
    }
    .bpw-mobile-card-table > tfoot > tr > td,
    .bpw-mobile-card-table > tfoot > tr > th{
        display:block!important;
        width:100%!important;
        max-width:none!important;
        padding:5px 0!important;
        border:0!important;
        text-align:left!important;
        white-space:normal!important;
    }
    .bpw-mobile-card-table input[type="number"],
    .bpw-mobile-card-table input[type="text"],
    .bpw-mobile-card-table select{
        width:100%!important;
        max-width:none!important;
    }
}

/* Mobile-responsive secondary modules and popup adoption (0.7.277).
   These utilities keep the existing authoritative forms, AJAX fragments, and
   desktop windows while giving secondary actions and read-only logs a deliberate
   narrow-screen presentation. */
.bpw-contained-scroll{
    width:100%;
    max-width:100%;
    min-width:0;
    overflow:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
}
.bpw-mobile-form,
.bpw-mobile-inline-actions,
.bpw-mobile-window-actions{
    min-width:0;
}
.bpw-mobile-inline-actions{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}

@media (max-width: 700px){
    .bpw-mobile-window{
        display:flex!important;
        flex-direction:column!important;
        overflow:hidden!important;
        pointer-events:auto!important;
    }
    .bpw-mobile-form{
        display:grid!important;
        grid-template-columns:1fr!important;
        gap:8px!important;
        align-items:stretch!important;
        width:100%!important;
        max-width:none!important;
    }
    .bpw-mobile-form > label,
    .bpw-mobile-form > .bpw-mobile-form-field,
    .bpw-mobile-form .bpw-mobile-form-field{
        display:grid!important;
        grid-template-columns:1fr!important;
        gap:4px!important;
        align-items:stretch!important;
        width:100%!important;
        max-width:none!important;
        margin:0!important;
    }
    .bpw-mobile-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .bpw-mobile-form select,
    .bpw-mobile-form textarea{
        width:100%!important;
        max-width:none!important;
        min-width:0!important;
        box-sizing:border-box!important;
    }
    .bpw-mobile-form > button,
    .bpw-mobile-form > .button,
    .bpw-mobile-form > input[type="submit"],
    .bpw-mobile-form .bpw-mobile-form-actions button,
    .bpw-mobile-form .bpw-mobile-form-actions .button{
        width:100%!important;
        max-width:none!important;
    }
    .bpw-mobile-inline-actions{
        display:grid!important;
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:8px!important;
        width:100%!important;
        margin-left:0!important;
    }
    .bpw-mobile-inline-actions > form,
    .bpw-mobile-inline-actions > button,
    .bpw-mobile-inline-actions > .button{
        width:100%!important;
        margin:0!important;
    }
    .bpw-mobile-inline-actions > form > button,
    .bpw-mobile-inline-actions > form > .button{
        width:100%!important;
    }
    .bpw-mobile-window-actions{
        display:grid!important;
        grid-template-columns:1fr!important;
        gap:8px!important;
        width:100%!important;
    }
    .bpw-mobile-window-actions > button,
    .bpw-mobile-window-actions > .button{
        width:100%!important;
        max-width:none!important;
    }
    .bpw-contained-scroll{
        scrollbar-gutter:stable both-edges;
    }
}

@media (max-width: 420px){
    .bpw-mobile-inline-actions{
        grid-template-columns:1fr!important;
    }
}

/* Slice 3 narrow-screen refinements for secondary actions, logs, and shared windows. */
@media (max-width: 700px){
    .bpw-mobile-window-body{
        min-height:0!important;
        max-height:none!important;
    }
    .bpw-touch-target{
        touch-action:manipulation;
    }
    .bpw-mobile-form > p{
        width:100%!important;
        max-width:none!important;
        margin:0!important;
    }
    .bpw-mobile-form > p + p{
        margin-top:8px!important;
    }
    .bpw-mobile-form > p > label,
    .bpw-mobile-form > p > label > span{
        max-width:100%!important;
    }
    .bpw-mobile-form > p > button,
    .bpw-mobile-form > p > .button,
    .bpw-mobile-form > p > input[type="submit"]{
        width:100%!important;
        max-width:none!important;
    }
    .bpw-message-known-actions,
    .bpw-league-directory-actions{
        grid-template-columns:1fr!important;
    }
    .bpw-message-known-actions > small{
        white-space:normal!important;
    }
    .bpw-discovered-player-row{
        flex-direction:column!important;
        align-items:stretch!important;
    }
    .bpw-discovered-player-row span{
        white-space:normal!important;
        overflow-wrap:anywhere;
    }
    .bpw-discovered-player-row button,
    .bpw-league-directory-actions form,
    .bpw-league-directory-actions form button{
        width:100%!important;
        max-width:none!important;
    }
    .bpw-devcom-count,
    .bpw-devcom-refresh-label,
    .bpw-league-chat-count{
        margin-left:0!important;
        white-space:normal!important;
        overflow-wrap:anywhere;
    }
    .bpw-player-activity-log-footer > div{
        display:grid!important;
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:8px!important;
        width:100%!important;
    }
    .bpw-player-activity-log-footer > div > button{
        width:100%!important;
    }
    .bpw-leagues-empire-page .bpw-mobile-form label{
        white-space:normal!important;
    }
    .bpw-leagues-empire-page .bpw-mobile-form button,
    .bpw-leagues-create-collapsible-body .bpw-mobile-form button{
        width:100%!important;
        max-width:none!important;
    }
}

@media (max-width: 420px){
    .bpw-player-activity-log-footer > div{
        grid-template-columns:1fr!important;
    }
}

/* Mobile-responsive Slice 5 acceptance hardening (0.7.279).
   The viewport rules above remain authoritative for phones. These additional
   selectors also activate the same safe presentation when a desktop/tablet
   theme constrains the Command Center content column below 700px. This prevents
   Graphene/sidebar layouts from clipping desktop tables inside an overflow-hidden
   game shell merely because the browser viewport itself is wider. */
@media (max-width: 700px){
    .bpw-mobile-window button:not(.bpw-no-touch-size),
    .bpw-mobile-window .button:not(.bpw-no-touch-size),
    .bpw-mobile-window input[type="submit"]:not(.bpw-no-touch-size),
    .bpw-mobile-window input[type="button"]:not(.bpw-no-touch-size),
    .bpw-mobile-window input[type="reset"]:not(.bpw-no-touch-size){
        min-height:40px!important;
        line-height:1.25!important;
        font-size:14px!important;
    }
    .bpw-mobile-window input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .bpw-mobile-window select,
    .bpw-mobile-window textarea,
    .bpw-mobile-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .bpw-mobile-form select,
    .bpw-mobile-form textarea{
        font-size:16px!important;
    }
    .bpw-mobile-window-header,
    .bpw-mobile-window-header > *{
        min-width:0;
    }
}

.bpw-wrap.bpw-command-center-wrap.bpw-command-center-is-narrow{
    padding-right:10px!important;
    padding-bottom:12px!important;
    padding-left:10px!important;
}
.bpw-command-center-is-narrow .bpw-mobile-only{display:initial!important;}
.bpw-command-center-is-narrow .bpw-desktop-only{display:none!important;}
.bpw-command-center-is-narrow .bpw-mobile-stack{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    width:100%!important;
}
.bpw-command-center-is-narrow .bpw-mobile-action-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    width:100%!important;
}
.bpw-command-center-is-narrow .bpw-compact-metric-grid{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
}
.bpw-command-center-is-narrow .bpw-touch-target,
.bpw-command-center-is-narrow button:not(.bpw-no-touch-size),
.bpw-command-center-is-narrow .button:not(.bpw-no-touch-size),
.bpw-command-center-is-narrow input[type="submit"]:not(.bpw-no-touch-size),
.bpw-command-center-is-narrow input[type="button"]:not(.bpw-no-touch-size),
.bpw-command-center-is-narrow input[type="reset"]:not(.bpw-no-touch-size){
    min-height:40px!important;
    line-height:1.25!important;
    font-size:14px!important;
}
.bpw-command-center-is-narrow input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.bpw-command-center-is-narrow select,
.bpw-command-center-is-narrow textarea{
    font-size:16px!important;
}
.bpw-command-center-is-narrow .bpw-selected-city-overview-grid,
.bpw-command-center-is-narrow .bpw-paradigm-strength-weakness-grid{
    grid-template-columns:1fr!important;
}
.bpw-command-center-is-narrow .bpw-selected-city-paradigm-form{
    align-items:stretch!important;
}
.bpw-command-center-is-narrow .bpw-selected-city-paradigm-field,
.bpw-command-center-is-narrow .bpw-selected-city-paradigm-field select,
.bpw-command-center-is-narrow .bpw-selected-city-paradigm-form button{
    width:100%!important;
    max-width:none!important;
}

/* Theme-width activation of the shared action-table card pattern. */
.bpw-command-center-is-narrow .bpw-mobile-card-table{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    table-layout:auto!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
}
.bpw-command-center-is-narrow .bpw-mobile-card-table colgroup,
.bpw-command-center-is-narrow .bpw-mobile-card-table > thead{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody,
.bpw-command-center-is-narrow .bpw-mobile-card-table > tfoot{
    display:block!important;
    width:100%!important;
    min-width:0!important;
}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody > tr{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    margin:0 0 12px!important;
    padding:10px 12px!important;
    border:1px solid #dcdcde!important;
    border-radius:7px!important;
    background:#fff!important;
    box-shadow:0 1px 2px rgba(0,0,0,.04)!important;
}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody > tr:last-child{margin-bottom:0!important;}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody > tr > td{
    display:grid!important;
    grid-template-columns:minmax(96px,34%) minmax(0,1fr)!important;
    gap:8px!important;
    align-items:start!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    padding:8px 0!important;
    border:0!important;
    border-bottom:1px solid #edf0f2!important;
    text-align:left!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody > tr > td:last-child{border-bottom:0!important;}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody > tr > td::before{
    content:attr(data-label);
    display:block;
    min-width:0;
    color:#50575e;
    font-weight:700;
    line-height:1.3;
    overflow-wrap:anywhere;
}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody > tr > td[data-bpw-mobile-full="1"]{display:block!important;}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody > tr > td[data-bpw-mobile-full="1"]::before{margin-bottom:6px;}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody > tr > td[data-bpw-mobile-no-label="1"]::before{display:none!important;}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tbody > tr > td[data-bpw-mobile-no-label="1"]{display:block!important;}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tfoot > tr{
    display:block!important;
    width:100%!important;
    margin:8px 0 0!important;
    padding:10px 12px!important;
    border:1px solid #d6c9df!important;
    border-radius:7px!important;
    background:#f6f3f8!important;
}
.bpw-command-center-is-narrow .bpw-mobile-card-table > tfoot > tr > td,
.bpw-command-center-is-narrow .bpw-mobile-card-table > tfoot > tr > th{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    padding:5px 0!important;
    border:0!important;
    text-align:left!important;
    white-space:normal!important;
}
.bpw-command-center-is-narrow .bpw-mobile-card-table input[type="number"],
.bpw-command-center-is-narrow .bpw-mobile-card-table input[type="text"],
.bpw-command-center-is-narrow .bpw-mobile-card-table select{
    width:100%!important;
    max-width:none!important;
}

/* Theme-width activation of shared stacked forms/actions. */
.bpw-command-center-is-narrow .bpw-mobile-form{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    align-items:stretch!important;
    width:100%!important;
    max-width:none!important;
}
.bpw-command-center-is-narrow .bpw-mobile-form > label,
.bpw-command-center-is-narrow .bpw-mobile-form > .bpw-mobile-form-field,
.bpw-command-center-is-narrow .bpw-mobile-form .bpw-mobile-form-field{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:4px!important;
    align-items:stretch!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
}
.bpw-command-center-is-narrow .bpw-mobile-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.bpw-command-center-is-narrow .bpw-mobile-form select,
.bpw-command-center-is-narrow .bpw-mobile-form textarea,
.bpw-command-center-is-narrow .bpw-mobile-form > button,
.bpw-command-center-is-narrow .bpw-mobile-form > .button,
.bpw-command-center-is-narrow .bpw-mobile-form > input[type="submit"],
.bpw-command-center-is-narrow .bpw-mobile-form .bpw-mobile-form-actions button,
.bpw-command-center-is-narrow .bpw-mobile-form .bpw-mobile-form-actions .button{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    box-sizing:border-box!important;
}
.bpw-command-center-is-narrow .bpw-mobile-inline-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
    margin-left:0!important;
}
.bpw-command-center-is-narrow .bpw-mobile-inline-actions > form,
.bpw-command-center-is-narrow .bpw-mobile-inline-actions > button,
.bpw-command-center-is-narrow .bpw-mobile-inline-actions > .button,
.bpw-command-center-is-narrow .bpw-mobile-inline-actions > form > button,
.bpw-command-center-is-narrow .bpw-mobile-inline-actions > form > .button{
    width:100%!important;
    margin:0!important;
}

/* Theme-width activation of Slice 2/4 module-specific refinements. */
.bpw-command-center-is-narrow .bpw-command-tabs{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
    margin-top:0!important;
}
.bpw-command-center-is-narrow .bpw-command-tab{width:100%!important;min-height:42px!important;padding:8px 10px!important;}
.bpw-command-center-is-narrow .bpw-empire-summary{margin-top:12px!important;padding:10px!important;}
.bpw-command-center-is-narrow .bpw-empire-summary-heading{align-items:center!important;margin-bottom:8px!important;}
.bpw-command-center-is-narrow .bpw-empire-summary-player{max-width:48%!important;font-size:10px!important;}
.bpw-command-center-is-narrow .bpw-empire-resource-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;}
.bpw-command-center-is-narrow .bpw-empire-resource{padding:7px 8px!important;}
.bpw-command-center-is-narrow .bpw-empire-menu-panel>summary{min-height:42px!important;padding:9px 10px!important;font-size:13px!important;}
.bpw-command-center-is-narrow .bpw-empire-menu-panel-body{padding:7px!important;}
.bpw-command-center-is-narrow .bpw-empire-action-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;}
.bpw-command-center-is-narrow .bpw-empire-action-grid>.bpw-empire-action-card{min-width:0!important;}
.bpw-command-center-is-narrow .bpw-empire-action-card{min-height:70px!important;padding:9px!important;}
.bpw-command-center-is-narrow .bpw-empire-action-card h3,
.bpw-command-center-is-narrow .bpw-empire-action-title{font-size:12px!important;}
.bpw-command-center-is-narrow .bpw-empire-action-card p,
.bpw-command-center-is-narrow .bpw-empire-action-description,
.bpw-command-center-is-narrow .bpw-empire-action-metric{font-size:10px!important;}
.bpw-command-center-is-narrow .bpw-city-selector-panel{margin-top:12px!important;}
.bpw-command-center-is-narrow .bpw-city-selector-panel-body{padding:8px!important;}
.bpw-command-center-is-narrow .bpw-city-selector{grid-template-columns:1fr!important;gap:8px!important;}
.bpw-command-center-is-narrow .bpw-city-selector-button{min-height:0!important;padding:10px!important;}
.bpw-command-center-is-narrow .bpw-city-selector-action-hint{font-size:12px!important;}
.bpw-command-center-is-narrow .bpw-city-selector-details > summary{min-height:40px!important;padding:8px 10px!important;}
.bpw-command-center-is-narrow .bpw-city-selector-details-body{padding:0 10px 10px!important;}
.bpw-command-center-is-narrow .bpw-city-selector-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px 8px!important;}
.bpw-command-center-is-narrow .bpw-city-selector-metrics.is-deltas{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.bpw-command-center-is-narrow .bpw-selected-city-summary{margin-top:10px!important;padding:10px!important;}
.bpw-command-center-is-narrow .bpw-selected-city-summary-header{align-items:flex-start!important;margin-bottom:8px!important;}
.bpw-command-center-is-narrow .bpw-selected-city-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;}
.bpw-command-center-is-narrow .bpw-selected-city-summary-metric.is-wide{grid-column:1/-1!important;}
.bpw-command-center-is-narrow .bpw-collapsible-ui > summary,
.bpw-command-center-is-narrow .bpw-auto-collapsible-card > .bpw-auto-collapsible-summary{padding:10px 11px!important;}
.bpw-command-center-is-narrow .bpw-collapsible-ui-body,
.bpw-command-center-is-narrow .bpw-auto-collapsible-card > .bpw-auto-collapsible-body{padding:10px 11px 11px!important;}
.bpw-command-center-is-narrow .bpw-food-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;}
.bpw-command-center-is-narrow .bpw-food-status-item.is-status{grid-column:1/-1!important;}

.bpw-command-center-is-narrow .bpw-city-building-table-wrap,
.bpw-command-center-is-narrow .bpw-conquest-table-wrap,
.bpw-command-center-is-narrow .bpw-ru-movement-bottom,
.bpw-command-center-is-narrow .bpw-ru-assign-table-wrap{overflow:visible!important;}
.bpw-command-center-is-narrow .bpw-city-building-user-table{font-size:14px!important;}
.bpw-command-center-is-narrow .bpw-city-building-user-table .bpw-contribution-cell{padding:8px 0!important;}
.bpw-command-center-is-narrow .bpw-city-building-contribution{align-items:flex-start!important;padding:7px 9px!important;}
.bpw-command-center-is-narrow .bpw-city-building-contribution strong{font-size:14px!important;}
.bpw-command-center-is-narrow .bpw-city-building-contribution small{font-size:12px!important;}
.bpw-command-center-is-narrow .bpw-city-building-action-buttons{gap:8px!important;}
.bpw-command-center-is-narrow .bpw-city-building-action-buttons button{min-height:42px!important;font-size:14px!important;padding:8px 10px!important;}
.bpw-command-center-is-narrow .bpw-conquest-table-wrap .bpw-conquest-assaults,
.bpw-command-center-is-narrow .bpw-ru-movement-bottom table,
.bpw-command-center-is-narrow .bpw-ru-assign-multi-table{min-width:0!important;}
.bpw-command-center-is-narrow .bpw-conquest-action-form{width:100%!important;margin-top:8px!important;}
.bpw-command-center-is-narrow .bpw-conquest-action-button{width:100%!important;min-height:42px!important;padding:8px 10px!important;font-size:14px!important;}
.bpw-command-center-is-narrow .bpw-global-market-grid{grid-template-columns:1fr!important;}
.bpw-command-center-is-narrow .bpw-global-market-trade-form{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;align-items:stretch!important;}
.bpw-command-center-is-narrow .bpw-global-market-amount-field,
.bpw-command-center-is-narrow .bpw-global-market-amount-field input{width:100%!important;max-width:none!important;}
.bpw-command-center-is-narrow .bpw-global-market-impact{align-self:auto!important;white-space:normal!important;overflow-wrap:anywhere!important;}
.bpw-command-center-is-narrow .bpw-global-market-sell-presets{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;width:100%!important;}
.bpw-command-center-is-narrow .bpw-global-market-sell-presets .button{width:100%!important;min-width:0!important;}
.bpw-command-center-is-narrow .bpw-global-market-submit{width:100%!important;min-height:42px!important;}
.bpw-command-center-is-narrow .bpw-ru-produce-actions{display:grid!important;grid-template-columns:1fr!important;align-items:stretch!important;text-align:left!important;}
.bpw-command-center-is-narrow .bpw-ru-produce-actions button{width:100%!important;}
.bpw-command-center-is-narrow .bpw-realm-units-produce-form{overflow:visible!important;}
.bpw-command-center-is-narrow .bpw-ru-production-table td[data-label="Quantity"] input{width:100%!important;max-width:none!important;}
.bpw-command-center-is-narrow .bpw-ru-action-stack,
.bpw-command-center-is-narrow .bpw-ru-action-secondary{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;width:100%!important;min-width:0!important;}
.bpw-command-center-is-narrow .bpw-ru-action-form,
.bpw-command-center-is-narrow .bpw-ru-action-form-primary,
.bpw-command-center-is-narrow .bpw-ru-action-form-secondary{width:100%!important;}
.bpw-command-center-is-narrow #bpw-realm-units-section .bpw-ru-action-btn,
.bpw-command-center-is-narrow #bpw-realm-units-section .bpw-ru-action-btn-small{width:100%!important;max-width:none!important;min-height:42px!important;font-size:14px!important;padding:8px 10px!important;}
.bpw-command-center-is-narrow .bpw-ru-select-convoy-form{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;align-items:stretch!important;}
.bpw-command-center-is-narrow .bpw-ru-select-convoy-form select,
.bpw-command-center-is-narrow .bpw-ru-select-convoy-form button{width:100%!important;max-width:none!important;}
.bpw-command-center-is-narrow .bpw-ru-assign-quick-wrap{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;width:100%!important;}
.bpw-command-center-is-narrow .bpw-ru-assign-shortcut{min-height:40px!important;font-size:14px!important;padding:7px 8px!important;}
.bpw-command-center-is-narrow .bpw-ru-assign-multi-btn,
.bpw-command-center-is-narrow .bpw-ru-assign-reset{width:100%!important;min-height:42px!important;font-size:14px!important;}
.bpw-command-center-is-narrow #bpw-player-create-movement-form .form-table,
.bpw-command-center-is-narrow #bpw-player-create-movement-form .form-table tbody,
.bpw-command-center-is-narrow #bpw-player-create-movement-form .form-table tr,
.bpw-command-center-is-narrow #bpw-player-create-movement-form .form-table th,
.bpw-command-center-is-narrow #bpw-player-create-movement-form .form-table td{display:block!important;width:100%!important;}
.bpw-command-center-is-narrow #bpw-player-create-movement-form .form-table th{padding:8px 0 2px!important;}
.bpw-command-center-is-narrow #bpw-player-create-movement-form .form-table td{padding:2px 0 8px!important;}

.bpw-wrap.bpw-command-center-wrap.bpw-command-center-is-compact{padding-right:8px!important;padding-left:8px!important;}
.bpw-command-center-is-compact .bpw-compact-metric-grid{grid-template-columns:1fr!important;}
.bpw-command-center-is-compact .bpw-empire-summary-heading,
.bpw-command-center-is-compact .bpw-selected-city-summary-header{flex-direction:column!important;align-items:stretch!important;}
.bpw-command-center-is-compact .bpw-empire-summary-player{max-width:100%!important;align-self:flex-start!important;}
.bpw-command-center-is-compact .bpw-selected-city-summary-statuses{justify-content:flex-start!important;}
.bpw-command-center-is-compact .bpw-city-selector-metrics.is-deltas,
.bpw-command-center-is-compact .bpw-food-status-grid,
.bpw-command-center-is-compact .bpw-mobile-inline-actions{grid-template-columns:1fr!important;}
.bpw-command-center-is-compact .bpw-food-status-item.is-status{grid-column:auto!important;}
.bpw-command-center-is-very-narrow .bpw-empire-action-grid,
.bpw-command-center-is-very-narrow .bpw-command-tabs{display:grid!important;grid-template-columns:1fr!important;}

/* Command Center utility menu cleanup — 0.7.281.
   Keep every utility action visually consistent on desktop, while collapsing
   only the launch controls behind one remembered mobile toggle. Popup descendants
   stay mounted so onboarding and other external open triggers continue to work. */
.bpw-command-center-header{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    align-items:stretch!important;
    gap:6px!important;
    width:100%!important;
    margin:0 0 4px!important;
}
.bpw-command-center-header h2{
    margin:4px 0 6px!important;
    font-size:clamp(24px,3.4vw,32px)!important;
    line-height:1.12!important;
    letter-spacing:-.02em;
}
.bpw-command-tools{
    display:block;
    width:100%;
    min-width:0;
    margin:0;
    padding:0;
    border:0;
    background:transparent;
}
.bpw-command-tools-toggle{display:none!important;}
.bpw-command-tools > .bpw-command-tools-grid{
    display:grid!important;
    grid-template-columns:repeat(auto-fill,minmax(96px,1fr))!important;
    gap:6px!important;
    align-items:stretch!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
}
.bpw-command-tools-grid > *{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    align-self:stretch!important;
    box-sizing:border-box!important;
}
.bpw-command-tools-grid .bpw-devcom-command-widget,
.bpw-command-tools-grid .bpw-moderator-console-widget,
.bpw-command-tools-grid .bpw-league-chat-widget,
.bpw-command-tools-grid .bpw-league-directory-widget,
.bpw-command-tools-grid .bpw-notifications-widget,
.bpw-command-tools-grid .bpw-player-activity-log-widget,
.bpw-command-tools-grid .bpw-rankings-widget,
.bpw-command-tools-grid .bpw-player-messages-widget{
    display:flex!important;
    align-items:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    position:relative;
    box-sizing:border-box!important;
}
.bpw-command-tools-grid > .bpw-profile-button,
.bpw-command-tools-grid > .bpw-new-player-faq-button,
.bpw-command-tools-grid .bpw-devcom-open-button,
.bpw-command-tools-grid .bpw-moderator-console-open-button,
.bpw-command-tools-grid .bpw-league-chat-open-button,
.bpw-command-tools-grid .bpw-league-directory-open-button,
.bpw-command-tools-grid .bpw-notifications-real-button,
.bpw-command-tools-grid .bpw-player-activity-log-button,
.bpw-command-tools-grid .bpw-rankings-open-button,
.bpw-command-tools-grid .bpw-messages-button,
.bpw-command-tools-grid > .bpw-command-road-map-button{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    min-height:40px!important;
    height:100%!important;
    margin:0!important;
    padding:6px 8px!important;
    border-radius:5px!important;
    box-sizing:border-box!important;
    font-size:13px!important;
    font-weight:700!important;
    line-height:1.15!important;
    text-align:center!important;
    text-decoration:none!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
}
.bpw-command-tools-grid > .bpw-command-road-map-button{
    border:1px solid #22c8c8!important;
    background:#f2ffff!important;
    color:#0f4c5c!important;
    box-shadow:0 0 0 1px rgba(34,200,200,.38),0 3px 9px rgba(20,184,166,.18)!important;
    cursor:pointer!important;
}
.bpw-command-tools-grid > .bpw-command-road-map-button:hover,
.bpw-command-tools-grid > .bpw-command-road-map-button:focus-visible{
    border-color:#0891b2!important;
    background:#fff!important;
    color:#073b4c!important;
    box-shadow:0 0 0 2px rgba(34,211,238,.55),0 4px 12px rgba(8,145,178,.24)!important;
    outline:none!important;
}
.bpw-command-center-welcome{
    margin:6px 0 10px!important;
    font-size:15px;
    line-height:1.35;
}

@media (max-width:700px){
    .bpw-command-center-header h2{
        margin:2px 0 5px!important;
        font-size:27px!important;
        line-height:1.08!important;
    }
    .bpw-command-tools-toggle{
        display:flex!important;
        align-items:center!important;
        justify-content:space-between!important;
        gap:10px!important;
        width:100%!important;
        min-height:42px!important;
        padding:8px 11px!important;
        border:1px solid #8c8f94!important;
        border-radius:6px!important;
        background:#f6f7f7!important;
        color:#1d2327!important;
        box-sizing:border-box!important;
        cursor:pointer!important;
        font-size:14px!important;
        font-weight:700!important;
        line-height:1.2!important;
        text-align:left!important;
    }
    .bpw-command-tools-toggle-state{
        flex:0 0 auto;
        padding:2px 8px;
        border:1px solid #9ec5e8;
        border-radius:999px;
        background:#fff;
        color:#2271b1;
        font-size:11px;
        font-weight:700;
    }
    .bpw-command-tools.is-collapsed > .bpw-command-tools-grid{
        height:0!important;
        min-height:0!important;
        gap:0!important;
        margin:0!important;
        padding:0!important;
        overflow:visible!important;
    }
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid > .bpw-profile-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid > .bpw-new-player-faq-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-devcom-open-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-moderator-console-open-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-league-chat-open-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-league-directory-open-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-notifications-real-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-player-activity-log-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-rankings-open-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-messages-button,
    .bpw-command-tools.is-collapsed .bpw-command-tools-grid > .bpw-command-road-map-button{
        display:none!important;
    }
    .bpw-command-tools:not(.is-collapsed) > .bpw-command-tools-grid{
        grid-template-columns:repeat(3,minmax(0,1fr))!important;
        gap:6px!important;
        padding-top:7px!important;
    }
    .bpw-command-tools-grid > .bpw-profile-button,
    .bpw-command-tools-grid > .bpw-new-player-faq-button,
    .bpw-command-tools-grid .bpw-devcom-open-button,
    .bpw-command-tools-grid .bpw-moderator-console-open-button,
    .bpw-command-tools-grid .bpw-league-chat-open-button,
    .bpw-command-tools-grid .bpw-league-directory-open-button,
    .bpw-command-tools-grid .bpw-notifications-real-button,
    .bpw-command-tools-grid .bpw-player-activity-log-button,
    .bpw-command-tools-grid .bpw-rankings-open-button,
    .bpw-command-tools-grid .bpw-messages-button,
    .bpw-command-tools-grid > .bpw-command-road-map-button{
        min-height:44px!important;
        padding:6px!important;
        font-size:12px!important;
    }
    .bpw-command-center-welcome{
        margin:6px 0 9px!important;
        font-size:14px;
    }
}

/* Rendered-width activation for Graphene/sidebar columns whose browser viewport
   is wider than the available Command Center content column. */
.bpw-command-center-is-narrow .bpw-command-center-header h2{
    margin:2px 0 5px!important;
    font-size:27px!important;
    line-height:1.08!important;
}
.bpw-command-center-is-narrow .bpw-command-tools-toggle{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:10px!important;
    width:100%!important;
    min-height:42px!important;
    padding:8px 11px!important;
    border:1px solid #8c8f94!important;
    border-radius:6px!important;
    background:#f6f7f7!important;
    color:#1d2327!important;
    box-sizing:border-box!important;
    cursor:pointer!important;
    font-size:14px!important;
    font-weight:700!important;
    line-height:1.2!important;
    text-align:left!important;
}
.bpw-command-center-is-narrow .bpw-command-tools-toggle-state{
    flex:0 0 auto;
    padding:2px 8px;
    border:1px solid #9ec5e8;
    border-radius:999px;
    background:#fff;
    color:#2271b1;
    font-size:11px;
    font-weight:700;
}
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed > .bpw-command-tools-grid{
    height:0!important;
    min-height:0!important;
    gap:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
}
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid > .bpw-profile-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid > .bpw-new-player-faq-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-devcom-open-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-moderator-console-open-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-league-chat-open-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-league-directory-open-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-notifications-real-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-player-activity-log-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-rankings-open-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid .bpw-messages-button,
.bpw-command-center-is-narrow .bpw-command-tools.is-collapsed .bpw-command-tools-grid > .bpw-command-road-map-button{
    display:none!important;
}
.bpw-command-center-is-narrow .bpw-command-tools:not(.is-collapsed) > .bpw-command-tools-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
    padding-top:7px!important;
}
.bpw-command-center-is-narrow .bpw-command-tools-grid > .bpw-profile-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid > .bpw-new-player-faq-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid .bpw-devcom-open-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid .bpw-moderator-console-open-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid .bpw-league-chat-open-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid .bpw-league-directory-open-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid .bpw-notifications-real-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid .bpw-player-activity-log-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid .bpw-rankings-open-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid .bpw-messages-button,
.bpw-command-center-is-narrow .bpw-command-tools-grid > .bpw-command-road-map-button{
    min-height:44px!important;
    padding:6px!important;
    font-size:12px!important;
}
.bpw-command-center-is-narrow .bpw-command-center-welcome{
    margin:6px 0 9px!important;
    font-size:14px;
}

/* The existing button classes remain authoritative for unread status. Surface
   that status on the compact toggle while the launch controls are collapsed. */
.bpw-command-tools:has(.bpw-devcom-open-button.is-unread, .bpw-moderator-console-open-button.is-unread, .bpw-league-chat-has-unread, .bpw-notifications-button-has-unread, .bpw-messages-button-has-unread) > .bpw-command-tools-toggle{
    border-color:#2271b1!important;
    box-shadow:inset 4px 0 0 #2271b1;
}
.bpw-command-tools:has(.bpw-devcom-open-button.is-unread, .bpw-moderator-console-open-button.is-unread, .bpw-league-chat-has-unread, .bpw-notifications-button-has-unread, .bpw-messages-button-has-unread) > .bpw-command-tools-toggle > span:first-child:after{
    content:' · New activity';
    color:#b32d2e;
    font-size:12px;
    font-weight:700;
}

/* Mobile admin-bar safe modal offset (0.7.334).
   Logged-in WordPress phones show the admin bar above the game shell. Keep BPW
   popups below that chrome instead of relying on dragging to expose close buttons. */
@media (max-width: 700px){
    body.admin-bar .bpw-battle-confirm-overlay{
        align-items:flex-start!important;
        padding-top:var(--bpw-mobile-window-chrome-top, 54px)!important;
        padding-bottom:var(--bpw-mobile-window-chrome-bottom, 8px)!important;
    }
    body.admin-bar .bpw-battle-confirm-modal{
        max-height:calc(100vh - var(--bpw-mobile-window-reserved-y, 62px))!important;
        max-height:calc(100dvh - var(--bpw-mobile-window-reserved-y, 62px))!important;
    }
    body.admin-bar .bpw-league-attack-dialog{
        margin:var(--bpw-mobile-window-chrome-top, 54px) 8px var(--bpw-mobile-window-chrome-bottom, 8px)!important;
        max-height:calc(100vh - var(--bpw-mobile-window-reserved-y, 62px))!important;
        max-height:calc(100dvh - var(--bpw-mobile-window-reserved-y, 62px))!important;
    }
}


/* Player-facing Paradigm Overviews modal and discreet inline trigger (0.7.485). */
.bpw-selected-city-paradigm-label{
    display:flex;
    align-items:baseline;
    flex-wrap:wrap;
    gap:6px;
}
.bpw-paradigm-overviews-trigger{
    display:inline;
    margin:0;
    padding:0;
    color:#6b2d8f;
    font-size:12px;
    font-weight:400;
    line-height:1.35;
    text-decoration:underline;
    text-underline-offset:2px;
    cursor:pointer;
}
.bpw-paradigm-overviews-trigger:hover,
.bpw-paradigm-overviews-trigger:focus{
    color:#4f1f6c;
    outline-offset:2px;
}
body.bpw-paradigm-overviews-modal-open{overflow:hidden;}
.bpw-paradigm-overviews-modal{
    position:fixed;
    inset:0;
    z-index:100000;
    width:100vw;
    height:100vh;
    max-width:none;
    max-height:none;
    margin:0;
    padding:0;
    overflow:hidden;
    border:0;
    background:transparent;
}
.bpw-paradigm-overviews-modal::backdrop{
    background:transparent;
}
.bpw-paradigm-overviews-modal[data-bpw-fallback-open="1"]{
    display:block;
}
.bpw-paradigm-overviews-backdrop{
    position:absolute;
    inset:0;
    background:rgba(15,23,42,.58);
}
.bpw-paradigm-overviews-window{
    position:relative;
    display:flex;
    flex-direction:column;
    width:min(920px,calc(100vw - 32px));
    max-height:calc(100vh - 64px);
    margin:32px auto;
    overflow:hidden;
    border:1px solid #8c8f94;
    border-radius:10px;
    background:#fff;
    box-shadow:0 20px 60px rgba(0,0,0,.35);
}
.bpw-paradigm-overviews-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    padding:14px 18px;
    border-bottom:1px solid #dcdcde;
    background:#f6f7f7;
}
.bpw-paradigm-overviews-header h3{margin:0 0 4px;}
.bpw-paradigm-overviews-header p{margin:0;color:#50575e;font-size:13px;}
.bpw-paradigm-overviews-close{
    flex:0 0 auto;
    min-width:38px;
    min-height:38px;
    padding:0 9px 3px;
    border:1px solid #b32d2e;
    border-radius:4px;
    background:#fff;
    color:#b32d2e;
    font-size:28px;
    line-height:1;
    cursor:pointer;
}
.bpw-paradigm-overviews-close:hover,
.bpw-paradigm-overviews-close:focus{background:#b32d2e;color:#fff;outline:2px solid #2271b1;outline-offset:1px;}
.bpw-paradigm-overviews-body{
    flex:1 1 auto;
    min-height:0;
    padding:16px 18px 20px;
    overflow:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
}
.bpw-paradigm-overviews-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}
.bpw-paradigm-overview-card{
    min-width:0;
    padding:14px;
    border:1px solid #dcdcde;
    border-radius:8px;
    background:#fff;
}
.bpw-paradigm-overview-card.is-current{
    border-color:#6b2d8f;
    box-shadow:0 0 0 2px rgba(107,45,143,.12);
}
.bpw-paradigm-overview-card-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    margin-bottom:8px;
}
.bpw-paradigm-overview-card-heading h4{margin:0;font-size:17px;line-height:1.3;}
.bpw-paradigm-overview-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;}
.bpw-paradigm-overview-badges span{
    display:inline-block;
    padding:2px 7px;
    border:1px solid #c3c4c7;
    border-radius:999px;
    background:#f6f7f7;
    color:#3c434a;
    font-size:11px;
    font-weight:600;
    white-space:nowrap;
}
.bpw-paradigm-overview-description{margin:0 0 10px;color:#3c434a;}
.bpw-paradigm-overview-core{display:grid;gap:6px;}
.bpw-paradigm-overview-core p,
.bpw-paradigm-overview-garrison p{margin:0;}
.bpw-paradigm-overview-specials,
.bpw-paradigm-overview-garrison{
    margin-top:12px;
    padding-top:10px;
    border-top:1px solid #e5e5e5;
}
.bpw-paradigm-overview-specials ul{margin:6px 0 0 20px;padding:0;}
.bpw-paradigm-overview-specials li+li{margin-top:4px;}
.bpw-paradigm-overview-garrison{display:grid;gap:4px;}
.bpw-paradigm-overview-garrison-note{margin-top:4px!important;color:#50575e;font-size:12px;line-height:1.4;}
@media (max-width:700px){
    .bpw-paradigm-overviews-window{width:calc(100vw - 16px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);margin:12px auto;}
    body.admin-bar .bpw-paradigm-overviews-window{
        max-height:calc(100vh - var(--bpw-mobile-window-reserved-y, 62px));
        max-height:calc(100dvh - var(--bpw-mobile-window-reserved-y, 62px));
        margin:var(--bpw-mobile-window-chrome-top, 54px) 8px var(--bpw-mobile-window-chrome-bottom, 8px);
    }
    .bpw-paradigm-overviews-header{padding:12px;}
    .bpw-paradigm-overviews-body{padding:12px;}
    .bpw-paradigm-overviews-grid{grid-template-columns:1fr;}
}
