/* Shared geometry for the first paint and the hydrated popout. Static ownership
   lets both the opener's about:blank shell and app HTML use the same rules. */
html[data-secondary-tab] { scrollbar-gutter: stable; }
body .app-shell.popout-host { padding: 0; }
body .popout-shell {
 box-sizing: border-box;
 margin: 0 auto;
 max-width: 1400px;
 min-height: 100vh;
 padding: 0.8rem 1.1rem 1rem;
 width: 100%;
}
body .popout-shell.calendar-popout { max-width: none; }
body .popout-shell .popout-frame,
body .popout-shell > :is(.detail-page, .list-page) {
 box-sizing: border-box;
 margin: 0;
 max-width: none;
 min-width: 0;
 padding: 1rem;
 border: 1px solid var(--c-card-border, #c9d3df);
 border-radius: 0.75rem;
 background: var(--c-card-bg, #fcfdff);
 box-shadow: var(--c-card-shadow, 0 3px 10px rgba(13, 34, 54, 0.08));
}
/* Keep density changes inside the surface from moving its outer anchors. */
body :is(.app-shell, .popout-shell).spacing-compact .popout-frame,
body .popout-shell.spacing-compact > :is(.detail-page, .list-page) { padding: 1rem; }
/* List wrappers around an explicit frame provide structure, not a second shell. */
body .popout-shell > :is(.detail-page, .list-page):has(> .popout-frame) {
 padding: 0; border: 0; background: none; box-shadow: none;
}
.popout-loading-shell:not([hidden]) {
 position: fixed; inset: 0; z-index: 1000; overflow: auto; margin: 0;
 background: var(--app-body-bg, #f8fafc);
 color: var(--app-body-color, #122033);
 font-family: 'Segoe UI', Arial, sans-serif;
}
.popout-loading-shell * { box-sizing: border-box; }
.popout-loading-shell .popout-frame { display: grid; gap: 0.75rem; }
.popout-loading-header { display: flex; align-items: center; min-height: 1.7rem; }
body .popout-shell :is(.popout-loading-header, .popout-header-title) :is(h2, h3) {
 margin: 0; font-size: 1.17rem; line-height: 1.2;
}
.popout-loading-shell p { margin: 0; color: var(--c-muted, #48627c); font-size: var(--density-message-size, 0.78rem); line-height: var(--density-message-leading, normal); }
@media (max-width: 760px) {
 body .popout-shell { padding: 1rem; }
}
