.profile-cover-art{position:absolute;inset:0;display:block;overflow:hidden;background:linear-gradient(145deg,var(--cover-top),var(--cover-bottom));pointer-events:none;isolation:isolate;container-type:inline-size}
.profile-cover-art img{position:absolute!important;inset:0;width:100%!important;height:100%!important;max-width:none;object-fit:cover!important;object-position:50% 42%;border-radius:0!important}
.cover-motifs{position:absolute;inset:0;display:block;mask-image:radial-gradient(ellipse at 50% 50%,#0006,#000 75%)}
.cover-motifs i{position:absolute;font-style:normal;font-family:system-ui;font-size:clamp(16px,8cqw,38px);line-height:1;filter:grayscale(1) brightness(.15);opacity:.25;color:#07131d}
.cover-shade{position:absolute;inset:0;background:linear-gradient(#0d162b22,#0d162b11 30%,#0d162bba)}
.cover-tint{position:absolute;inset:0;background:var(--cover-top);opacity:.48;mix-blend-mode:color}
.profile-hero{position:relative;isolation:isolate}
.profile-hero:has(.profile-cover-art){border-radius:26px;overflow:hidden;padding:36px 20px 26px;color:#fff;margin-bottom:12px;background:#253441}
.profile-hero>[data-cover-person]{position:absolute;inset:0;z-index:-1;pointer-events:none}
.profile-hero:has(.profile-cover-art) .profile-username{color:#fff;opacity:.82}
.profile-hero:has(.profile-cover-art) .profile-photo{box-shadow:0 0 0 4px #ffffff25,0 8px 30px #0004}
.profile-hero:has(.profile-cover-art) h1{text-shadow:0 2px 12px #0005}
.profile-cover-edit{position:absolute;top:10px;right:10px;border:1px solid #ffffff30;border-radius:30px;padding:9px 12px;min-height:36px;background:#253441b8;color:white;font-size:12px;z-index:2;backdrop-filter:blur(12px)}
.profile-hero:not(:has(.profile-cover-art)) .profile-cover-edit{background:var(--panel);color:var(--ink);border-color:var(--line)}
.profile-cover-dialog[open]{display:flex;flex-direction:column;gap:12px;width:min(640px,calc(calc(100 * var(--ui-vw)) - 20px));height:min(900px,calc(calc(100 * var(--ui-dvh)) - 24px));max-height:calc(calc(100 * var(--ui-dvh)) - 24px);padding:18px;border:1px solid var(--line);border-radius:28px;color:var(--ink);background:var(--bg);overflow:hidden;box-sizing:border-box}
.profile-cover-dialog::backdrop{background:#061019aa;backdrop-filter:blur(8px)}
.cover-picker-heading{display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.cover-picker-heading small{font-size:10px;letter-spacing:2px;color:var(--green)}.cover-picker-heading h2{font-size:22px;margin:3px 0 0}.cover-picker-heading button{width:38px;height:38px;border-radius:50%;background:var(--panel);color:inherit;font-size:26px;padding:0}
.profile-cover-dialog .cover-live-preview{flex-shrink:0;height:194px;min-height:0;border-radius:20px;box-sizing:border-box;margin:0;padding:22px 12px 14px;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;background:var(--panel)}
.cover-live-preview .profile-photo .avatar{width:80px;height:80px;font-size:28px}.cover-live-preview h1{font-size:22px;margin:10px 0 3px}.cover-live-preview .profile-username{font-size:13px;margin:0}.cover-live-preview .profile-bio{display:none}
.cover-palette{display:flex;overflow-x:auto;gap:9px;flex-shrink:0;padding:3px 1px;scrollbar-width:none}.cover-palette button{flex:0 0 51px;padding:0;background:none;color:inherit;display:flex;align-items:center;flex-direction:column;gap:5px}.cover-palette button>span{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:white;box-sizing:border-box}.cover-palette small{font-size:9px;white-space:nowrap}.cover-palette [aria-pressed=true]>span{outline:2px solid var(--green);outline-offset:3px}
.cover-categories{display:flex;gap:4px;flex-shrink:0;background:var(--panel);padding:4px;border-radius:14px}.cover-categories button{flex:1;padding:9px 3px;min-height:36px;border-radius:10px;background:none;color:var(--muted);font-size:12px;white-space:nowrap}.cover-categories [aria-pressed=true]{background:var(--green);color:var(--bg);font-weight:700}
.cover-options{min-height:0;flex:1;overflow:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 9px;align-content:start;padding:3px;overscroll-behavior:contain}.cover-option{background:none;border:0;padding:0;min-width:0;color:inherit;text-align:left;display:flex;flex-direction:column;gap:5px}.cover-thumbnail{position:relative;isolation:isolate;width:100%;aspect-ratio:1.5;overflow:hidden;border-radius:13px;display:block;border:2px solid transparent;box-sizing:border-box}.cover-option-name{font-size:11px;line-height:1.3;padding:0 3px}.cover-option[aria-pressed=true] .cover-thumbnail{border-color:var(--green);box-shadow:0 0 0 1px var(--green)}.cover-option-check{display:none;position:absolute;right:5px;bottom:5px;background:var(--green);color:var(--bg);width:20px;height:20px;border-radius:50%;place-items:center;font-size:13px;font-weight:800}.cover-option[aria-pressed=true] .cover-option-check{display:grid}
.cover-picker-footer{display:flex;gap:10px;flex-shrink:0;padding-top:8px;border-top:1px solid var(--line)}.cover-picker-footer button{flex:1;min-height:44px;border-radius:14px}.cover-picker-footer [data-cover-clear]{background:var(--panel);color:inherit}.cover-picker-error{margin:0;color:#d9526c;font-size:13px;flex-shrink:0}.cover-picker-error:empty{display:none}
@media(max-height:700px){.profile-cover-dialog[open]{gap:8px;padding:12px}.profile-cover-dialog .cover-live-preview{height:148px;padding:12px}.cover-live-preview .profile-photo .avatar{width:62px;height:62px}.cover-live-preview h1{font-size:19px;margin-top:6px}}
@media(max-height:500px) and (orientation:landscape){.profile-cover-dialog[open]{display:grid;grid-template-columns:220px minmax(0,1fr);grid-template-rows:40px 1fr 55px;width:min(850px,calc(calc(100 * var(--ui-vw)) - 20px))}.cover-picker-heading{grid-column:1}.profile-cover-dialog .cover-live-preview{grid-column:1;grid-row:2;height:100%}.cover-palette{grid-column:1;grid-row:3}.cover-categories{grid-column:2;grid-row:1}.cover-options{grid-column:2;grid-row:2;height:100%}.cover-picker-footer{grid-column:2;grid-row:3}.cover-picker-error:not(:empty){position:absolute;left:240px;right:20px;bottom:66px;background:var(--panel);padding:8px;border-radius:10px}}

/* Catalog values are CSS rules so strict CSP never blocks cover colors or layout. */
[data-cover-palette="original"]{--cover-top:#344653;--cover-bottom:#16242f}
[data-cover-palette="slate"]{--cover-top:#536778;--cover-bottom:#253441}
[data-cover-palette="mint"]{--cover-top:#378377;--cover-bottom:#123f3b}
[data-cover-palette="blue"]{--cover-top:#427cab;--cover-bottom:#183653}
[data-cover-palette="violet"]{--cover-top:#80649e;--cover-bottom:#352c58}
[data-cover-palette="rose"]{--cover-top:#b87191;--cover-bottom:#613448}
[data-cover-palette="amber"]{--cover-top:#b38843;--cover-bottom:#5e4325}
[data-cover-palette="sand"]{--cover-top:#a88b74;--cover-bottom:#554236}
[data-cover-palette="midnight"]{--cover-top:#324b80;--cover-bottom:#101b38}
.cover-motifs i:nth-child(1){left:-2%;top:-5%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(2){left:18%;top:-5%;transform:rotate(12deg)}
.cover-motifs i:nth-child(3){left:38%;top:-5%;transform:rotate(0deg)}
.cover-motifs i:nth-child(4){left:58%;top:-5%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(5){left:78%;top:-5%;transform:rotate(12deg)}
.cover-motifs i:nth-child(6){left:98%;top:-5%;transform:rotate(0deg)}
.cover-motifs i:nth-child(7){left:8%;top:19%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(8){left:28%;top:19%;transform:rotate(12deg)}
.cover-motifs i:nth-child(9){left:48%;top:19%;transform:rotate(0deg)}
.cover-motifs i:nth-child(10){left:68%;top:19%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(11){left:88%;top:19%;transform:rotate(12deg)}
.cover-motifs i:nth-child(12){left:108%;top:19%;transform:rotate(0deg)}
.cover-motifs i:nth-child(13){left:-2%;top:43%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(14){left:18%;top:43%;transform:rotate(12deg)}
.cover-motifs i:nth-child(15){left:38%;top:43%;transform:rotate(0deg)}
.cover-motifs i:nth-child(16){left:58%;top:43%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(17){left:78%;top:43%;transform:rotate(12deg)}
.cover-motifs i:nth-child(18){left:98%;top:43%;transform:rotate(0deg)}
.cover-motifs i:nth-child(19){left:8%;top:67%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(20){left:28%;top:67%;transform:rotate(12deg)}
.cover-motifs i:nth-child(21){left:48%;top:67%;transform:rotate(0deg)}
.cover-motifs i:nth-child(22){left:68%;top:67%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(23){left:88%;top:67%;transform:rotate(12deg)}
.cover-motifs i:nth-child(24){left:108%;top:67%;transform:rotate(0deg)}
.cover-motifs i:nth-child(25){left:-2%;top:91%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(26){left:18%;top:91%;transform:rotate(12deg)}
.cover-motifs i:nth-child(27){left:38%;top:91%;transform:rotate(0deg)}
.cover-motifs i:nth-child(28){left:58%;top:91%;transform:rotate(-18deg)}
.cover-motifs i:nth-child(29){left:78%;top:91%;transform:rotate(12deg)}
.cover-motifs i:nth-child(30){left:98%;top:91%;transform:rotate(0deg)}
 .cover-palette button>span{background:linear-gradient(135deg,var(--cover-top),var(--cover-bottom))}
.profile-hero:has(.profile-cover-art) h1,.profile-hero:has(.profile-cover-art) .person-name:not([data-name-accent]){color:#fff}

/* The profile cover replaces the app header only on the Profile tab. */
:root .workspace[data-section=profile]>.app-header{display:none}
:root .workspace[data-section=profile]>.profile-panel{grid-row:1/3;padding:0 0 max(24px,var(--ui-safe-bottom));scrollbar-gutter:auto}
.profile-panel>.profile-content{max-width:none}
.profile-panel .profile-content>.profile-hero{border-radius:0;margin:0;padding:calc(32px + var(--ui-safe-top)) 20px 44px}
.profile-panel .profile-content>.profile-tabs,.profile-panel .profile-content>.profile-sections{max-width:660px;margin-left:auto;margin-right:auto}
.profile-panel .profile-content>.profile-sections{padding:0 18px}

/* Person card: profile artwork, primary actions and a compact action row. */
:root .public-profile-dialog{padding:0;width:min(600px,calc(calc(100 * var(--ui-vw)) - 24px));overflow:auto;border-radius:28px;background:var(--bg)}
.public-profile-dialog .dialog-top{position:absolute;top:12px;left:14px;right:14px;z-index:3;display:flex;justify-content:space-between;pointer-events:none}
.public-profile-dialog .dialog-top button{pointer-events:auto;background:var(--surface);border:1px solid var(--line);border-radius:50%;width:38px;height:38px;backdrop-filter:blur(12px)}
.public-profile-dialog .dialog-top #close-dialog{margin-left:auto}
.public-profile-dialog .profile-hero{position:relative;border-radius:0;margin:0;padding:44px 22px 22px;background:radial-gradient(ellipse at 50% 40%,var(--accent-glow),transparent 72%)}
.public-profile-dialog .profile-photo{box-shadow:0 0 0 3px var(--green),0 0 25px var(--accent-glow)}
.public-profile-dialog .profile-bio{display:table;margin:12px auto 0;padding:8px 16px;border:1px solid #8799a633;border-radius:24px;font-size:13px;background:#17293533}
.profile-presence{display:table;margin:12px auto 0;color:var(--green);background:var(--panel);border:1px solid var(--line);border-radius:24px;padding:6px 12px;font-size:12px}
.person-main-actions{display:flex;gap:10px;padding:16px 18px}.person-main-actions button{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;gap:10px;min-height:64px;padding:12px;border-radius:20px;font-size:14px;font-weight:600}.person-main-actions svg{flex:none;width:24px;height:24px}.person-media{background:var(--glass);border:1px solid var(--line);color:var(--ink);text-align:left}
.person-quick-actions{margin:0 18px;padding:16px 0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;border-top:1px solid var(--line)}.person-quick-actions button{display:flex;flex-direction:column;align-items:center;gap:7px;padding:0;color:var(--muted)}.person-quick-actions button>span{display:grid;place-items:center;width:44px;height:44px;background:var(--glass);border:1px solid var(--line);border-radius:16px}.person-quick-actions small{font-size:10px}
.person-moments{margin:0 18px}.person-moments [data-moment-status]:not(:empty){font-size:13px;color:var(--muted);padding:16px;border:1px solid var(--line);border-radius:18px;background:var(--glass);line-height:1.5}.person-moments .profile-stories:empty{display:none}
.person-safety-actions{display:flex;flex-direction:column;gap:16px;padding:20px 22px 24px}.person-safety-actions>button,.person-safety-actions .text-button{display:flex;align-items:center;gap:12px;justify-content:flex-start;text-align:left;font-size:13px}.person-safety-actions svg{flex:none}
/* Keep modal headings below the iPhone status-bar blur. */
html.ios-web-frame .profile-cover-dialog[open]{margin-top:calc(var(--safe-top,var(--ui-safe-top)) + 12px);height:min(900px,calc(calc(100 * var(--ui-dvh)) - var(--safe-top,var(--ui-safe-top)) - var(--ui-safe-bottom) - 24px));max-height:calc(calc(100 * var(--ui-dvh)) - var(--safe-top,var(--ui-safe-top)) - var(--ui-safe-bottom) - 24px)}
html.ios-web-frame .public-profile-dialog[open]{margin-top:calc(var(--safe-top,var(--ui-safe-top)) + 12px);max-height:calc(calc(100 * var(--ui-dvh)) - var(--safe-top,var(--ui-safe-top)) - var(--ui-safe-bottom) - 24px)}

.profile-panel .profile-content>.profile-hero{padding-top:calc(32px + max(var(--ui-safe-top),var(--krug-safe-top,0px)))}
:root .workspace[data-section=profile]:has(.profile-panel .profile-cover-art){--nav-safe-bottom:max(var(--ui-safe-bottom),var(--krug-safe-bottom,0px))}
:root .workspace[data-section=profile]:has(.profile-panel .profile-cover-art)>.rail{padding-bottom:calc(6px + var(--nav-safe-bottom))}
@media(max-width:740px){:root .workspace[data-section=profile]:has(.profile-panel .profile-cover-art){grid-template-rows:0 minmax(0,1fr) calc(70px + var(--nav-safe-bottom))}}
html .profile-cover-dialog[open]{--cover-modal-top:max(var(--safe-top,0px),var(--krug-safe-top,0px));margin-top:calc(var(--cover-modal-top) + 12px);height:min(900px,calc(calc(100 * var(--ui-dvh)) - var(--cover-modal-top) - max(var(--ui-safe-bottom),var(--krug-safe-bottom,0px)) - 24px));max-height:calc(calc(100 * var(--ui-dvh)) - var(--cover-modal-top) - max(var(--ui-safe-bottom),var(--krug-safe-bottom,0px)) - 24px)}

/* Equal, generous touch targets for profile safety actions. */
.public-profile-dialog .person-safety-actions{gap:10px;padding:18px 18px 24px}
.public-profile-dialog .person-safety-actions button{width:100%;min-height:54px;margin:0;padding:14px 16px;display:flex;align-items:center;justify-content:center;gap:10px;text-align:center;font-size:13px;font-weight:600;line-height:1.4;border:1px solid var(--line);border-radius:16px;background:var(--glass)}
.public-profile-dialog .person-safety-actions button.danger{background:#ed536b12;border-color:#ed536b40;color:#ff6578}
.public-profile-dialog .person-safety-actions [role=status]:empty{display:none}

.profile-panel .profile-content>.profile-tabs{top:0;box-shadow:none}
/* Scroll-driven avatar expansion stays inside the profile header. */
.profile-panel .profile-stretch{padding:0!important;overflow:hidden;position:relative}
.profile-panel .profile-stretch>.profile-photo{position:absolute;z-index:1;margin:0;box-shadow:none}
.profile-panel .profile-stretch>.profile-photo .avatar{width:100%;height:100%;border-radius:inherit;object-fit:cover}
.profile-panel .profile-stretch>.profile-photo::after{content:'';position:absolute;inset:60% 0 0;background:linear-gradient(transparent,#0009);pointer-events:none}
.profile-panel .profile-stretch>h1,.profile-panel .profile-stretch>.profile-username{position:absolute;z-index:2;margin:0;color:white;text-shadow:0 1px 10px #0008;pointer-events:none}
.profile-panel .profile-stretch>.profile-bio{position:absolute;bottom:4px;left:20px;right:20px}
.profile-compact-title{position:sticky;top:0;height:0;z-index:5;text-align:center;pointer-events:none;visibility:hidden}
.profile-compact-title.visible{visibility:visible;height:auto;margin-bottom:calc(-44px - max(var(--ui-safe-top),var(--krug-safe-top,0px)));min-height:calc(44px + max(var(--ui-safe-top),var(--krug-safe-top,0px)));padding:calc(12px + max(var(--ui-safe-top),var(--krug-safe-top,0px))) 18px 12px;background:var(--bg);font-size:16px;font-weight:600}
.profile-panel:has(.profile-compact-title.visible) .profile-tabs{top:calc(44px + max(var(--ui-safe-top),var(--krug-safe-top,0px)))}
