/* Story and Global Settings layout only. Shared components: window-components.css. */
#story-settings-form { flex: 1 1 auto; min-height: 0; grid-template-columns: minmax(0, 1fr); overflow-x: hidden; scrollbar-gutter: stable; }
#story-settings-form > section:not([hidden]) { display: grid; align-content: start; min-width: 0; gap: 18px; }
.story-context-advanced { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.story-context-advanced .ui-section-title { flex: 1 1 140px; }
.story-context-fields:not([hidden]) { display: grid; min-width: 0; gap: 16px; }
#story-context-author_note { white-space: pre-wrap; }
#story-settings-profile-actions { display: grid; justify-items: start; gap: 8px; min-width: 0; }
.global-settings-form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
.global-settings-panel { display: block; flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; padding: var(--window-content-padding); }
.global-settings-panel > .ui-hint, .global-settings-panel > .ui-field { margin-bottom: 14px; }
.global-settings-form > .ui-message { flex: 0 0 auto; padding-inline: 12px; }
.global-main-prompt { min-height: 82px; resize: vertical; white-space: pre-wrap; }
@media (min-width: 768px) {
    .story-context-fields:not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .story-context-fields > p, .story-context-fields > ol { grid-column: 1 / -1; }
    .story-context-fields > label:has(#story-context-history_policy) { grid-column: 1 / -1; }
}

/* Membook layout; typography and controls use the shared window components. */
.membook-panel, .membook-panel > div:not(.ui-actions), .membook-panel details { display: grid; gap: 12px; }
.membook-panel [hidden] { display: none; }
.membook-panel textarea { resize: vertical; }
.membook-panel details:not([open]) > :not(summary) { display: none; }
