.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.67fr) minmax(0, 1fr);
    grid-template-areas: 'intro sidebar' 'feed sidebar' 'bottom sidebar';
    grid-template-rows: auto auto 1fr;
    gap: 16px;
    margin-top: 16px;
    align-items: start;
}
.profile-layout:not(:has(>.profile-zone--intro)) { grid-template-areas: 'feed sidebar' 'bottom sidebar'; grid-template-rows: auto 1fr; }
.profile-layout>.profile-main { grid-area: feed; }
.profile-zone { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; align-content: start; }
.profile-zone--intro { grid-area: intro; }
.profile-zone--bottom { grid-area: bottom; }
.profile-zone--sidebar { grid-area: sidebar; grid-template-columns: minmax(0, 1fr); }
.profile-module-wrap { min-width: 0; }
.profile-module-wrap.module-wide { grid-column: 1 / -1; }
.profile-layout[data-layout=left] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.67fr); grid-template-areas: 'sidebar intro' 'sidebar feed' 'sidebar bottom'; }
.profile-layout[data-layout=left]:not(:has(>.profile-zone--intro)) { grid-template-areas: 'sidebar feed' 'sidebar bottom'; }
.profile-layout[data-layout=journal], .profile-layout[data-has-sidebar=false] { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'intro' 'feed' 'sidebar' 'bottom'; }
.profile-layout[data-layout=journal]:not(:has(>.profile-zone--intro)), .profile-layout[data-has-sidebar=false]:not(:has(>.profile-zone--intro)) { grid-template-areas: 'feed' 'sidebar' 'bottom'; }
.profile-layout[data-layout=journal]>.profile-zone--sidebar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-module--custom .module-image, .module-caption { margin-bottom: 12px; }
.profile-theme-rose { --paper: #f5e7e9; --surface: #fff7f5; --surface-soft: #f5e7e7; --line: #e3c9ce; --primary: #a13e59; --primary-hover: #843047; --ink: #432235; --muted: #735466; }
.profile-theme-forest { --paper: #e5ecdf; --surface: #f9faef; --surface-soft: #eaf0df; --line: #c9d5bc; --primary: #3b6548; --primary-hover: #294a32; --ink: #213c30; --muted: #526751; }
.profile-theme-lavender { --paper: #ece6f3; --surface: #fcf8ff; --surface-soft: #eee7f4; --line: #d7cbe2; --primary: #765189; --primary-hover: #5d3d6e; --ink: #352443; --muted: #71627b; }
.profile-theme-midnight { --paper: #262334; --surface: #332f42; --surface-soft: #40394f; --line: #625775; --primary: #f0b4a4; --primary-hover: #f8cdbf; --ink: #fff3df; --muted: #d0c5dc; --surface-white: #262334; --sage: #404c48; --green: #bbd9a9; --peach: #5e4553; --line-strong: #9683a2; }
.profile-page[class*=profile-theme-] { background: var(--paper); color: var(--ink); }
.profile-theme-midnight .profile-module .module-heading { background: var(--surface-soft); }
.profile-theme-midnight .badge, .profile-theme-midnight .book-cover--text { background: var(--surface-soft); color: var(--ink); }
.profile-font-modern { --font-body: 'Trebuchet MS', Arial, sans-serif; --font-ui: var(--font-body); font-family: var(--font-body); }
.profile-font-typewriter { --font-body: 'Courier New', monospace; --font-ui: var(--font-body); font-family: var(--font-body); }
.palette-rose { --module-surface: #f4e0e5; }
.palette-lavender { --module-surface: #e9e2f1; }
.palette-sky { --module-surface: #dfeaf1; }
@container profile (max-width: 680px) {
    .profile-layout, .profile-layout[data-layout=left] { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'intro' 'feed' 'sidebar' 'bottom'; }
    .profile-layout:not(:has(>.profile-zone--intro)), .profile-layout[data-layout=left]:not(:has(>.profile-zone--intro)) { grid-template-areas: 'feed' 'sidebar' 'bottom'; }
    .profile-zone, .profile-layout[data-layout=journal]>.profile-zone--sidebar { grid-template-columns: minmax(0, 1fr); }
    .profile-main .article-preview { grid-template-columns: minmax(0, 1fr); }
    .profile-main .book-preview { grid-template-columns: 95px minmax(0, 1fr); gap: 12px; }
    .profile-main .book-preview .book-cover { width: 95px; height: 145px; }
}
