#studio-home [hidden] { display:none !important; }
.home-view-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:14px; }
.home-display-picker { display:flex; align-items:center; gap:8px; color:var(--home-text); font-size:13px; margin:0; }
.home-display-picker select { min-height:38px; max-width:100%; padding:6px 10px; border:1px solid var(--home-border); border-radius:3px; background:var(--home-surface); color:var(--home-text); }
.home-display-picker select:focus-visible { outline:2px solid #3c8dbc; outline-offset:2px; }
/* The launcher follows the wrapped shared header instead of a fixed desktop offset. */
body[data-sysimple-shell="true"]:has(#studio-home) > .sys-studio-header { height:auto !important; max-height:none !important; flex-shrink:0; }
body[data-sysimple-shell="true"] #studio-home { padding-top:16px !important; }
@media(max-width:767px) {
 body:has(#studio-home) > .sys-studio-header { display:flex !important; flex-wrap:wrap !important; gap:10px !important; }
 body:has(#studio-home) > .sys-studio-header > * { min-width:0; max-width:100%; }
 body:has(#studio-home) .sys-studio-right { flex-wrap:wrap; flex:1 1 100%; justify-content:flex-start; }
 body:has(#studio-home) .sys-studio-theme-wrap { position:relative; min-width:0; max-width:100%; }
 body:has(#studio-home) .sys-studio-nav { position:static !important; height:auto !important; flex-wrap:wrap; }
 #studio-home .studio-shell { width:100%; padding:0 10px; }
 #studio-home .home-view-toolbar > strong { flex-basis:100%; }
 #studio-home .home-display-picker { flex:1 1 100%; justify-content:space-between; }
 #studio-home .home-display-picker select { flex:1; font-size:16px; }
 #studio-home .home-view-toolbar > a, #studio-home .home-view-toolbar > button { max-width:100%; white-space:normal; }
}

/* Both the authorized catalogue and its loading/fallback cards use the same modes. */
body[data-home-display="compact"] #home-module-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin:0; }
body[data-home-display="list"] #home-module-cards { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; margin:0; }
body[data-home-display="compact"] #home-module-cards > *, body[data-home-display="list"] #home-module-cards > * { width:100%; padding:0; margin:0; min-width:0; }
body[data-home-display="compact"] #studio-home .studio-card, body[data-home-display="list"] #studio-home .studio-card { padding:12px; height:100%; min-height:0; border-radius:3px !important; }
body[data-home-display="compact"] #studio-home .studio-card h4, body[data-home-display="list"] #studio-home .studio-card h4 { font-size:14px; gap:8px; margin-bottom:8px; }
body[data-home-display="compact"] #studio-home .studio-card h4 > :is(i,img), body[data-home-display="list"] #studio-home .studio-card h4 > :is(i,img) { width:32px !important; height:32px !important; min-width:32px; flex-basis:32px; font-size:26px; }
body[data-home-display="compact"] #studio-home .studio-card > p, body[data-home-display="list"] #studio-home .studio-card > p { display:block; font-size:12px; line-height:1.45; margin-bottom:10px; }
body[data-home-display="compact"] #home-catalog .hc-grid { grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:8px; }
body[data-home-display="compact"] #home-catalog .hc-tile { padding:10px; }
body[data-home-display="compact"] #home-catalog .hc-link { flex-direction:column; align-items:flex-start; gap:6px; }
body[data-home-display="compact"] #home-catalog .hc-link[href] .hc-description { display:block; }
body[data-home-display="list"] #home-catalog .hc-grid { grid-template-columns:minmax(0,1fr); gap:6px; }
body[data-home-display="list"] #home-catalog .hc-tile { padding:9px 12px; }
body[data-home-display="list"] #home-catalog .hc-commercial { margin:0; padding-top:5px; }
@media(max-width:380px) {
 body[data-home-display="compact"] #home-module-cards, body[data-home-display="compact"] #home-catalog .hc-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 #studio-home .home-legacy-link { flex-wrap:wrap; }
}
.home-view-toolbar > strong { margin-right:auto; font-size:14px; }
.home-view-toolbar button, .home-view-toolbar > a, #home-module-menu button {
    min-height:34px; border:1px solid var(--home-border); border-radius:3px;
    background:var(--home-surface); color:var(--home-text); padding:7px 10px; font-size:13px;
}
.home-view-toolbar button[aria-pressed="true"], #home-module-menu button[aria-current="page"] {
    background:var(--home-hover-surface) !important; border-color:#3c8dbc !important; box-shadow:inset 3px 0 #3c8dbc !important;
}
.home-view-toolbar button:hover, #home-module-menu button:hover { background:var(--home-hover-surface); }
.home-view-toolbar button:focus-visible, #home-module-menu button:focus-visible, #home-module-open:focus-visible { outline:2px solid #3c8dbc; outline-offset:2px; }
body.home-sidebar-view #studio-home { padding:calc(var(--home-header-h) + 14px) 14px 14px !important; }
/* The shared header is in normal flow; only the legacy fixed header needs an offset. */
body.home-sidebar-view[data-sysimple-shell="true"] #studio-home { padding-top:14px !important; }
body.home-sidebar-view #studio-home .studio-shell { max-width:none; padding:0; }
body.home-sidebar-view #studio-home::before, body.home-sidebar-view #studio-home::after,
body.home-sidebar-view #footer, body.home-sidebar-view .back-to-top { display:none !important; }
#home-module-workspace { display:grid; grid-template-columns:250px minmax(0,1fr); gap:14px; height:calc(100dvh - var(--home-header-h) - 82px); min-height:420px; }
#home-module-menu, .home-module-panel { border:1px solid var(--home-border); background:var(--home-surface); min-width:0; min-height:0; }
#home-module-menu { overflow:auto; padding:8px; }
#home-module-menu button { display:flex; align-items:center; justify-content:flex-start !important; gap:10px; width:100%; text-align:left !important; margin-bottom:4px; }
#home-module-menu button span { flex:1; min-width:0; text-align:left !important; }
#home-module-menu button i, #home-module-menu button img { width:20px; height:20px; flex-shrink:0; object-fit:contain; }
.home-module-panel { display:flex; flex-direction:column; }
.home-module-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; min-height:44px; padding:8px 12px; border-bottom:1px solid var(--home-border); background:var(--home-surface-2); font-size:13px; }
#home-module-open { color:var(--home-primary); font-size:12px; }
#home-module-content { flex:1; min-height:0; overflow:auto; }
#home-module-content iframe { display:block; width:100%; height:100%; border:0; background:var(--home-surface); }
#home-module-content > .home-sysimple-module { width:100%; padding:14px; }
@media(max-width:767px) {
    #home-module-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:150px minmax(420px,1fr); height:auto; }
    #home-module-menu { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
    #home-module-menu button { margin:0; }
    #home-module-content { min-height:420px; }
    #home-module-content iframe { height:70dvh; min-height:420px; }
}

#home-module-menu .home-module-description{display:block;margin-top:4px;font-size:12px;line-height:1.4;font-weight:400;color:var(--home-muted,var(--home-text));overflow-wrap:anywhere}
