/* MWS shell = PEM structure (pem-shell.css) reused 1:1. This file only OVERRIDES
   the few layout differences MWS needs — NO colours, NO font-size, NO typography
   (all from pem-shell.css + Core UI tokens):
     - collapse PEM's 3-col grid (sidebar/main/rail) to 2 cols (sidebar/main)
     - drop the right rail + footer + rotator (single main)
     - make the left menu a variable scrolling list (not PEM's fixed 7-slot grid)
     - main hosts a full-bleed iframe (static-iframe content, Notlösung) */

.mws-shell{
  width:100%;height:auto;min-height:100vh;
  grid-template-columns:var(--w-sidebar) 1fr var(--w-rail);
  grid-template-rows:var(--h-topbar) 1fr var(--h-footer);
}
/* Full outer frame: topbar + sidebar + rail + footer all on (the "Bilderrahmen"). */
/* context block (PEM rotator) sits above the variable menu */
.mws-shell .rotator{grid-column:auto;grid-row:auto;height:auto}

/* left menu: variable list instead of the fixed 7-slot grid */
.mws-shell .sidebar{grid-column:1;grid-row:2;display:flex;flex-direction:column;
  gap:13px;padding:13px 21px;overflow:auto}
.mws-shell .tiles{display:flex;flex-direction:column;gap:13px;height:auto;overflow:visible}
.mws-shell .sidebar .tile{width:100%}

/* topbar areas: 4 tiles spread across the row */
.mws-shell .topbar-nav-row .tile{flex:1;width:auto}

/* main: clean STD-vs-legacy switch (runtime sets .shell[data-content]).
   - STD module  → centered 987×610 picture frame.
   - legacy/iframe → full remaining area, small <8px margin, scroll in the frame.
   The content header (main-frame-top) + old left context strip stay hidden; the
   rail (right) is the context sub-submenu. */
.mws-shell .main{grid-column:2;grid-row:2;padding:5px;overflow:hidden;position:relative;background:var(--c-bg)}
.mws-shell .main::before{display:none}
.mws-shell .main-frame-corner,
.mws-shell .main-frame-left,
.mws-shell .main-frame-top{display:none}
.mws-shell .main-frame{display:flex;flex-direction:column;overflow:hidden;border:0;padding:0;gap:0}
.mws-shell .mws-frame{width:100%;height:100%;border:0;display:block;background:var(--c-bg)}

/* legacy/iframe: full remaining area */
.mws-shell[data-content="legacy"] .main{display:block}
.mws-shell[data-content="legacy"] .main-frame{width:100%;height:100%}
.mws-shell[data-content="legacy"] .main-frame-content{flex:1 1 auto;width:auto;min-height:0;overflow:auto;padding:0}
.mws-shell[data-content="legacy"] .main-frame-content .main-context{width:100%;height:100%;margin:0;padding:0;border:0;border-radius:0;overflow:auto}

/* STD module: centered 987×610 picture frame */
.mws-shell[data-content="std"] .main{display:flex;align-items:center;justify-content:center}
.mws-shell[data-content="std"] .main-frame{flex:0 0 auto;width:auto;height:auto;max-width:100%;max-height:100%}
.mws-shell[data-content="std"] .main-frame-content{flex:0 0 auto;width:min(987px,100%);height:min(610px,100%);min-height:0;overflow:hidden;padding:0}
.mws-shell[data-content="std"] .main-frame-content .main-context{width:100%;height:100%;margin:0;padding:21px;border:1px solid var(--c-border);border-radius:8px;background:rgba(0,0,0,0.18);overflow:hidden;display:flex;align-items:stretch;justify-content:flex-start}

/* CSS styler panel (theme button) */
.mws-styler{position:fixed;top:var(--h-topbar);right:21px;width:377px;max-height:75vh;overflow:auto;
  z-index:1000;background:var(--c-panel);border:1px solid var(--c-border);border-radius:8px;
  padding:13px;display:flex;flex-direction:column;gap:13px}
.mws-styler[hidden]{display:none}
.mws-styler .style-choice-grid{display:flex;flex-wrap:wrap;gap:8px}
.mws-styler .theme-tile-btn.is-active{border-color:var(--c-accent);color:var(--c-accent)}

/* account menu (person button) */
.mws-account-menu{position:fixed;top:var(--h-topbar);right:21px;width:233px;z-index:1000;
  background:var(--c-panel);border:1px solid var(--c-border);border-radius:8px;padding:13px}
.mws-account-menu[hidden]{display:none}
.mws-account-role{color:var(--c-muted);text-transform:uppercase;letter-spacing:1px}
.mws-account-link{display:block;margin-top:13px;padding:8px 13px;text-align:center;text-decoration:none;
  border:1px solid var(--c-border);border-radius:4px;color:var(--c-text)}
.mws-account-link:hover{border-color:var(--c-accent);color:var(--c-accent)}

/* Light-Mode-Fix: das Camo-Backdrop (shell ::before, --bg-layer Nacht-Bild) folgt
   nicht dem mode-light. Im Light-Mode weg -> helles --c-bg zeigt sich (das "daneben"
   neben dem Content wird auch hell). Serverseitiger Light-Bug. */
.mws-shell.mode-light::before{background-image:none}

/* Browser color-scheme an den Mode koppeln: sonst malt der Browser bei System-Dark
   die UA-Flaechen (Canvas/Scrollbars/iframe-Default) dunkel, trotz Light-Mode. */
.mws-shell.mode-light{color-scheme:light}
.mws-shell.mode-dark{color-scheme:dark}
