[data-theme="classic"]{--profile-tint:#f6f4ec;--profile-accent:#176c60;--profile-border:#cad9cd}
[data-theme="rose"]{--profile-tint:#fff2f4;--profile-accent:#933d5b;--profile-border:#eac1cc}
[data-theme="ocean"]{--profile-tint:#eff8fc;--profile-accent:#256681;--profile-border:#b9d8e5}
[data-theme="lavender"]{--profile-tint:#f5f0fc;--profile-accent:#705092;--profile-border:#d6c6e7}
[data-theme="sunset"]{--profile-tint:#fff4e9;--profile-accent:#925321;--profile-border:#e9ccac}
[data-theme="forest"]{--profile-tint:#eef5ec;--profile-accent:#3d6740;--profile-border:#c3d8bd}
#profile-detail[data-theme]{background:linear-gradient(145deg,var(--profile-tint),#fff 70%);border-color:var(--profile-border);border-top:5px solid var(--profile-accent)}
#profile-detail[data-theme] #profileDetailTitle{color:var(--profile-accent)}
#profile-detail[data-frame="round"] #profileImage{aspect-ratio:1;width:min(100%,260px);height:auto;border-radius:50%;object-fit:cover}
#profile-detail[data-frame="outline"] #profileImage{border:4px solid var(--profile-accent);padding:4px;background:white}
#profile-detail[data-frame="soft"] #profileImage{border-radius:20px}
#profile-design-editor{margin:18px 0;padding:14px;border:1px solid var(--profile-border);border-radius:14px;background:#ffffffc9}
#profile-design-editor summary{cursor:pointer;font-weight:700;color:var(--profile-accent)}
.profile-theme-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:8px;margin:14px 0}
.profile-theme-choice{background:var(--profile-tint);color:var(--profile-accent);border:2px solid var(--profile-border);padding:14px 10px;min-height:48px}
.profile-theme-choice[aria-pressed="true"]{outline:2px solid var(--profile-accent);outline-offset:2px}
#profile-design-editor label{display:block}#profile-frame{display:block;max-width:100%;margin:8px 0 14px}
#privacy-settings fieldset{border:1px solid var(--color-border,#d5ddd5);border-radius:14px;margin:20px 0;padding:16px;min-width:0}
#privacy-settings fieldset label{display:flex;align-items:center;gap:10px;margin:12px 0}#privacy-settings fieldset input{width:auto;flex:none}
.own-profile-layout{grid-template-columns:minmax(150px,24%) minmax(0,1fr) minmax(180px,28%)!important}.profile-actions{display:flex;flex-direction:column;gap:8px;min-width:0}.profile-actions>button,.profile-actions>details{width:100%;box-sizing:border-box;text-align:left;margin:0}.profile-actions[hidden]{display:none}.profile-voice{display:flex;flex-direction:column;gap:6px;margin:12px 0}.profile-voice audio{max-width:100%;height:36px}.profile-completion{display:grid;gap:6px;margin:16px 0}.profile-completion progress{width:100%;accent-color:#176c60}.profile-completion strong{font-size:.9rem}.profile-actions .social-actions{display:flex;flex-wrap:wrap}
@media(max-width:900px){.own-profile-layout{grid-template-columns:minmax(100px,30%) minmax(0,1fr)!important}.profile-actions{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.profile-actions details{grid-column:1/-1}}@media(max-width:400px){.profile-actions{grid-template-columns:1fr}.profile-actions button{font-size:.85rem}}
#profile-detail[data-font=serif] .profile-copy,#profile-detail[data-font=serif] #profile-social{font-family:Georgia,serif}#profile-detail[data-font=rounded] .profile-copy,#profile-detail[data-font=rounded] #profile-social{font-family:ui-rounded,system-ui,sans-serif}#profile-design-editor label{display:flex;flex-direction:column;gap:5px;margin:10px 0}#profile-design-editor select{max-width:100%;min-width:0}
#profile-detail.profile-preview .profile-actions,#profile-detail.profile-preview .profile-completion,#profile-detail.profile-preview #editProfileForm,#profile-detail.profile-preview #editOwnProfileBtn{display:none!important}#profile-detail.profile-preview .profile-layout{grid-template-columns:minmax(150px,30%) minmax(0,1fr)!important}
#profile-detail.profile-preview .delete-btn,#profile-detail.profile-preview #delete-account-details{display:none!important}
#profile-detail.profile-preview .profile-copy p:has(#profilePostalCode){display:none!important}
#profile-detail .profile-actions>button,#profile-detail .profile-voice>button,#profile-preview-back{border:1px solid var(--profile-border,#cad9cd);border-radius:12px;background:rgba(255,255,255,.9);color:var(--profile-accent,#176c60);padding:.65rem .8rem;font:inherit;font-size:.85rem;line-height:1.3;min-height:40px;cursor:pointer;box-shadow:none}#profile-detail .profile-actions>button:hover,#profile-detail .profile-voice>button:hover{background:var(--profile-tint,#f6f4ec)}#profile-detail .profile-actions>#editOwnProfileBtn{background:var(--profile-accent,#176c60);color:white}#profile-detail .profile-actions>button:focus-visible,#profile-detail .profile-voice>button:focus-visible{outline:2px solid var(--profile-accent,#176c60);outline-offset:2px}
.match-center-card{display:flex;flex-direction:column;gap:.45rem;padding:.65rem;border-radius:1rem;background:var(--surface,#fffaf2);min-width:0}.match-center-card .match-profile{width:100%;margin:0}.match-center-card>button:last-child{background:#176c60;color:white;border:0;border-radius:.7rem;padding:.65rem}.match-center-card small{color:#655e55}
.catalogue-filters{display:flex;flex-wrap:wrap;align-items:end;gap:.6rem;margin:1rem 0}.catalogue-filters label{display:flex;flex:1 1 9rem;flex-direction:column;gap:.3rem;min-width:0}.catalogue-filters input,.catalogue-filters select{width:100%;box-sizing:border-box;min-width:0;padding:.55rem}.catalogue-filters button{padding:.65rem;background:#176c60;color:#fff;border:0;border-radius:.6rem}
.gallery-sort{padding:.3rem .7rem;border:0;border-radius:.4rem;background:#e4f3eb;color:#17483f}.profile-preview .gallery-sort,.profile-preview .gallery-add{display:none}.gallery-add{border:1px dashed #176c60;border-radius:.8rem;background:#edf5ee;color:#17483f;padding:1rem}.gallery-image-container img{object-fit:cover;aspect-ratio:1}

/* Profile management: desktop columns, tablet two zones, phone portrait first. */
.profile-portrait,.profile-copy,.profile-extras{min-width:0}
.profile-copy{overflow-wrap:anywhere}
.profile-quick-actions,.profile-extras{display:grid;gap:8px}
#profile-detail .profile-actions button,.profile-more summary{min-height:44px;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;border:1px solid var(--profile-border);border-radius:12px;padding:.7rem .8rem;font:inherit;font-size:.85rem;cursor:pointer;background:#fff;color:var(--profile-accent);text-align:left}
#profile-detail .profile-quick-actions .profile-primary{background:#176c60;color:#fff;border-color:#176c60}
.profile-more{border:1px solid var(--profile-border);border-radius:12px;padding:4px}
.profile-more>button{display:block;width:100%;margin-top:8px}
.profile-extras{padding-top:8px}
.profile-voice,.profile-completion{min-width:0}
@media(min-width:641px) and (max-width:1100px){
 #profile-detail .own-profile-layout{grid-template-columns:minmax(0,2fr) minmax(0,3fr)!important;gap:24px}
 .own-profile-layout .profile-actions{grid-column:1/-1;display:flex}
 .profile-quick-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
 #profile-detail #profileImage{height:auto;aspect-ratio:4/5;max-width:100%}
}
@media(max-width:640px){
 #profile-detail{padding:16px}
 #profile-detail .profile-layout,#profile-detail.profile-preview .profile-layout{grid-template-columns:minmax(0,1fr)!important;gap:18px}
 #profile-detail #profileImage{display:block;width:100%;max-width:100%;height:auto;aspect-ratio:1;object-fit:cover;box-sizing:border-box}
 #profile-detail .profile-copy{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}
 .profile-copy p:has(#profileUsername){grid-column:1/-1}
 #profile-detail .profile-copy p{margin-bottom:8px}
 #profile-detail .profile-actions{display:flex;grid-column:1;gap:12px}
 .profile-quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
 .profile-voice,.profile-completion{padding:10px;border-radius:12px;background:#ffffffc9;margin:0;align-content:start}
 .profile-voice audio{width:100%;min-width:0}
 #profile-design-editor{order:2}
}
@media(max-width:360px){.profile-voice,.profile-completion{grid-column:1/-1}}

#profile-detail.profile-preview .profile-voice:has(>button:only-child){display:none}

.gallery-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:24px}.gallery-heading h3{margin:0}.gallery-heading button{min-height:44px}
#profileGallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(140px,100%),1fr));gap:12px;width:100%;margin-top:12px}
#profileGallery .gallery-image-container{display:block;position:relative;margin:0;min-width:0;aspect-ratio:1;overflow:hidden;border-radius:14px}
#profileGallery .image-button{display:block;padding:0;margin:0;border:0;width:100%;height:100%;border-radius:inherit;overflow:hidden}
#profileGallery .image-button img{display:block;width:100%;max-width:none;height:100%;object-fit:cover;margin:0;border:0;border-radius:inherit}
#profileGallery .gallery-delete{position:absolute;top:6px;right:6px;width:44px;height:44px;min-width:44px;padding:0;border-radius:50%;background:#fff;color:#922e37;border:1px solid #ded8d0;box-shadow:0 2px 6px #0003}
#profileGallery .gallery-sort-controls{position:absolute;bottom:6px;left:6px;right:6px;display:flex;justify-content:space-between;gap:4px}
#profileGallery .gallery-sort{width:44px;height:44px;padding:0;background:#fff;border:1px solid #d5e7dd}
#profileGallery .gallery-add{min-height:110px;aspect-ratio:1;min-width:0;white-space:normal}
.gallery-confirm{max-width:min(420px,calc(100vw - 32px));box-sizing:border-box;border:1px solid #d5e7dd;border-radius:18px;padding:20px}.gallery-confirm button{min-height:44px;margin:6px}
@media(max-width:640px){#profileGallery{grid-template-columns:repeat(2,minmax(0,1fr))}}
#profile-detail.profile-preview .gallery-heading button,#profile-detail.profile-preview .gallery-delete,#profile-detail.profile-preview .gallery-sort-controls,#profile-detail.profile-preview .gallery-add{display:none!important}

.gallery-heading button{border:1px solid var(--profile-accent,#176c60);background:var(--profile-accent,#176c60);color:white;border-radius:12px;padding:10px 16px;font:inherit;cursor:pointer}.gallery-confirm button{border:1px solid #176c60;border-radius:10px;padding:10px 16px;background:#fff;color:#176c60}.gallery-confirm button:last-child{background:#176c60;color:white}
#profile-detail .profile-carousel-track>img{width:33.333333%!important;max-width:none!important;height:auto!important;aspect-ratio:4/5;object-fit:cover;margin:0;flex:0 0 33.333333%}
