/* WORK04 shared spacing: 8 control / 16 component / 24 group / 32 section. */
:root{--space-control:8px;--space-item:16px;--space-group:24px;--space-section:32px}
:where(.panel,.content-card,.person-content,.request-card,.admin-dialog,.intro-dialog){overflow-wrap:anywhere;min-width:0}
:where(.row-actions,.form-actions,.editor-actions,.pagination,.page-nav,.person-actions){gap:var(--space-control);flex-wrap:wrap}
:where(.account-list,.request-list,.content-grid,.people-grid,.communication-grid){gap:var(--space-group)}
:where(.panel,.content-card) + :where(.panel,.content-card){margin-top:var(--space-item)}
:where(.account-list,.content-grid,.communication-grid)>*+*{margin-top:0}
:where(.admin-wrap,.member-wrap) :is(.secondary,.small-button,.row-actions button,.chip){min-height:44px}
:where(.publication-form,.form-grid) label{gap:var(--space-control)}
:where(.inline-error,.dialog-error,[role=alert]):not(:empty){margin-block:var(--space-control);line-height:1.5}
:where(.admin-dialog,.intro-dialog) :is(.row-actions,.form-actions){margin-top:var(--space-group)}
:where(.filters,.directory-controls,.request-tabs){gap:var(--space-control)}
:where(.filters,.directory-controls)>*{min-width:0;max-width:100%}
.member-wrap .member-menu{gap:var(--space-control)}
.member-wrap .member-menu button{min-height:44px}
.member-wrap .chat-compose{gap:var(--space-item)}
.member-wrap .message button{min-height:32px;padding:6px 8px}
.admin-wrap #workspace>article.panel{padding:24px}
.admin-wrap .table-scroll .row-actions{min-width:150px}
.admin-wrap .filters input{min-width:min(220px,100%)}
.admin-wrap .admin-nav{gap:var(--space-control)}
.content-wrap .public-profile .row-actions{margin-block:var(--space-item) var(--space-group)}
.content-wrap .public-profile>h2{font-size:clamp(24px,3vw,32px);letter-spacing:-.7px}
.content-wrap :is(.content-card,.event-info) .button{margin-top:var(--space-control)}
footer nav{flex-wrap:wrap;gap:12px 20px}
@media(max-width:750px){
 :where(.member-wrap,.content-wrap){padding-inline:20px}
 :where(.panel,.login-box,.request-card,.event-info){padding:20px}
 .member-wrap .member-menu{margin-right:0;padding-right:0;position:static;overflow:visible}
 .member-wrap .member-row{flex-wrap:wrap}
 .member-wrap .member-row .row-body{flex:1 1 190px}
 .member-wrap .member-row>.row-actions{flex-basis:100%}
 .admin-wrap #workspace>article.panel{padding:20px}
 .content-wrap .content-grid{margin-block:24px}
 .content-wrap :is(h1,.article h1){font-size:clamp(32px,8vw,44px);overflow-wrap:anywhere}
 body:has(.content-wrap)>header{height:auto;min-height:84px;flex-wrap:wrap;padding:16px 20px;gap:12px}
 body:has(.content-wrap)>header nav{order:3;flex-basis:100%;display:flex;gap:20px;flex-wrap:wrap}
 body:has(.content-wrap)>header nav a{min-height:44px;display:flex;align-items:center}
}

/* Public catalogue cards use a direct div, unlike editorial cards with a link wrapper. */
.content-card>div:not(.card-mark){padding:24px}
.content-card>div>h2:first-child{margin-top:0}
.content-card>div>p:last-child{margin-bottom:0}
.public-profile .profile-intro{display:grid;grid-template-columns:160px minmax(0,1fr);gap:24px;align-items:start;margin-bottom:32px}
.public-profile .community-portrait{float:none;margin:0;background:#e9eedb}
.public-profile .profile-info{min-width:0}
.public-profile .profile-info h1{font-size:clamp(30px,4vw,48px);line-height:1.15;letter-spacing:-1.5px;margin:8px 0 16px}
.public-profile .profile-info p:empty,.public-profile .profile-info nav:empty{display:none}
.public-profile .profile-info p:last-child{margin-bottom:0}
.public-profile>h2:has(+.content-grid:empty){display:none}
@media(max-width:600px){.content-card>div:not(.card-mark){padding:20px}.public-profile .profile-intro{grid-template-columns:96px minmax(0,1fr);gap:16px}.public-profile .community-portrait{width:96px;height:96px}.public-profile .profile-info h1{font-size:28px}.public-profile .profile-info .button{padding:12px 16px;font-size:13px;gap:8px}}

:where(.admin-dialog,.intro-dialog)>button:first-child{margin-bottom:16px}
:where(.admin-dialog,.intro-dialog)>h2{font-size:26px;line-height:1.25;letter-spacing:-.6px;overflow-wrap:anywhere}
:where(.admin-dialog,.intro-dialog)>form{display:grid;gap:16px}
:where(.admin-dialog,.intro-dialog)>form>label{margin-block:0}
@media(max-width:600px){:where(.admin-dialog,.intro-dialog)>h2{font-size:24px}}

.admin-wrap h1{letter-spacing:-.04em;line-height:1.15;overflow-wrap:anywhere}
.admin-wrap .section-head{gap:16px}

/* Shared corner system: controls 12, cards 20, dialogs 24, actions pill. */
:root{--radius-control:12px;--radius-card:20px;--radius-dialog:24px;--radius-pill:999px}
body :is(.panel,.login-box,.person,.person-card,.request-card,.request-example,.content-card,.home-content-card,.member-row,.experience-section,.event-info,.empty-state,.metric,.table-scroll,.status-banner,.handoff-card,.chat-log){border-radius:var(--radius-card)}
body :is(.admin-dialog,.intro-dialog,dialog){border-radius:var(--radius-dialog)}
body :is(.button,.secondary,.small-button,.oauth,.chip,.hello,.person-hello,.member-menu button,.request-tabs button){border-radius:var(--radius-pill)}
body :is(.member-wrap,.admin-wrap,.admin-dialog,.intro-dialog,.publication-form) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),select,textarea){border-radius:var(--radius-control)}
body :is(.search,.city-label,fieldset,.intro-reasons,.person-requests,.message){border-radius:var(--radius-control)}
body :is(.home-page .request-example,.home-page .person,.home-page .photo-card,.home-page .founder-photo img,.community-art img,.cover,.prose img){border-radius:var(--radius-card)}
#request-filter input[name=location]{display:block;min-width:0;min-height:48px;padding:12px;border:1px solid var(--line);background:var(--cream);color:var(--green);font:inherit;margin:0;border-radius:var(--radius-control)}
#request-filter{align-items:center}
#request-filter select{margin-top:0;min-height:48px}
/* WORK06 profile: same 4:3 image shape and corner scale as participant cards. */
.public-profile.profile-landing .profile-intro { grid-template-columns:minmax(0,1fr); gap:24px; align-items:center; }
.public-profile.profile-landing .community-portrait { width:100%; height:auto; aspect-ratio:4/3; object-fit:contain; border-radius:24px; max-width:520px; }
.profile-landing .profile-copy,.profile-landing .profile-publications,.profile-landing .profile-contacts { margin-block:32px; }
.profile-landing .profile-copy { max-width:760px; }
.profile-landing .profile-copy h2,.profile-landing .profile-publications h2,.profile-landing .profile-contacts h2 { margin:0 0 16px; }
@media(min-width:768px) { .public-profile.profile-landing .profile-intro { grid-template-columns:minmax(240px, .85fr) minmax(0,1.15fr); gap:32px; } }

/* Shared control defaults also cover dynamically mounted controls outside main. */
:root { --control-surface:#fffdf7; --control-focus:#ba7953; --control-disabled:#edf0e7; }
:where(button,input[type=button],input[type=submit],input[type=reset]) {
 font:inherit; font-size:14px; font-weight:700; line-height:1.4;
 min-height:44px; padding:11px 19px; border:1px solid var(--green);
 border-radius:var(--radius-pill); background:var(--cream); color:var(--green);
 max-width:100%; white-space:normal; overflow-wrap:anywhere; cursor:pointer;
}
body :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not([type=color]):not([type=button]):not([type=submit]):not([type=reset]),select,textarea) {
 font:inherit; font-size:16px; line-height:1.5; color:var(--green);
 background-color:var(--control-surface); border:1px solid var(--line);
 border-radius:var(--radius-control); min-height:44px; padding:10px 12px;
 max-width:100%; min-width:0;
}
body textarea { font-family:inherit; resize:vertical; }
body :is(.admin-wrap,.member-wrap,dialog,header) :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]):not([type=color]):not([type=button]):not([type=submit]):not([type=reset]),select,textarea) {
 color:var(--green); background-color:var(--control-surface); border-color:var(--line);
 border-radius:var(--radius-control); font-family:inherit; font-size:16px; min-height:44px;
}
body select { cursor:pointer; }
body select option { color:var(--green); background:var(--control-surface); }
body input::placeholder,body textarea::placeholder { color:var(--muted); opacity:1; }
body :is(input[type=checkbox],input[type=radio]) {
 accent-color:var(--green); width:20px; height:20px; min-height:20px;
 padding:0; margin:0; flex:0 0 20px; vertical-align:middle;
}
body label:has(>input:is([type=checkbox],[type=radio])) {
 display:flex; align-items:flex-start; gap:var(--space-control); min-height:44px;
}
body input[type=file] { font:inherit; color:var(--green); max-width:100%; min-width:0; }
body input[type=file]::file-selector-button {
 font:inherit; font-size:14px; font-weight:700; color:var(--green); background:var(--cream);
 border:1px solid var(--green); border-radius:var(--radius-pill);
 min-height:44px; padding:10px 16px; margin-inline-end:12px; cursor:pointer;
}
body :is(button,a,input,select,textarea,[role=switch]):focus-visible {
 outline:3px solid var(--control-focus); outline-offset:3px;
}
body :is(button,input,select,textarea):disabled {
 cursor:not-allowed; opacity:.6;
}
body :is(input,select,textarea):disabled { background-color:var(--control-disabled); }
@media(forced-colors:active) {
 body :is(button,a,input,select,textarea,[role=switch]):focus-visible { outline-color:Highlight; }
 body :is(input[type=checkbox],input[type=radio]) { forced-color-adjust:auto; }
}

/* Flow spacing contract: label 8, fields 16, groups 24, sections 32.
   Grid/flex containers own their gaps; never add margins to their children. */
:root { --space-field:16px; --space-card-inset:clamp(20px,2.5vw,28px); }
body :is(form,.panel,.login-box) > label:not(:has(>input:is([type=checkbox],[type=radio]))) {
 display:grid; gap:var(--space-control); min-width:0;
}
body :is(form,.panel,.login-box,.form-grid) > label > :is(input,select,textarea) {
 margin-block:0;
}
body :is(.form-grid,.publication-form) { gap:var(--space-field); }
body :is(.form-grid,.publication-form) > :is(label,fieldset,.row-actions) { margin-block:0; }
body .form-grid > label:not(:has(>input:is([type=checkbox],[type=radio]))) {
 display:grid; align-content:start; gap:var(--space-control);
}
body :is(form,.panel,.login-box):not(:is(.form-grid,.publication-form,.row-actions,.filters,.directory-controls,.chat-compose)) >
 :not([hidden]) + :is(label,fieldset,textarea,select,input,button,form,.row-actions,.form-actions,.status-banner) {
 margin-block-start:var(--space-field);
}
body :is(form,.panel,.login-box):not(:is(.form-grid,.publication-form,.row-actions,.filters,.directory-controls,.chat-compose)) >
 :is(label,fieldset,textarea,select,input,button,form,.row-actions,.form-actions) {
 margin-block-end:0;
}
body :is(.row-actions,.form-actions,.editor-actions) {
 display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-control);
}
body :is(.row-actions,.form-actions,.editor-actions) > :is(button,a,input) { margin:0; }
body .member-wrap #panel .row-actions { gap:var(--space-control); }
body :is(.member-wrap,.admin-wrap,.content-wrap) :is(form,button,.row-actions) + .panel,
body :is(.member-wrap,.admin-wrap,.content-wrap) > button + form {
 margin-block-start:var(--space-group);
}
body :is(.panel,.login-box) { padding:var(--space-card-inset); }
body :is(.panel,.login-box) > :is(h2,h3) { margin-block:0 var(--space-field); }
body :is(.panel,.login-box) > :is(p,h2,h3):last-child { margin-block-end:0; }
body .geography-fields legend { padding:0; margin-block-end:var(--space-control); }
body :is(.panel,.login-box,form) > label:has(>input:is([type=checkbox],[type=radio])) {
 align-items:center;
}
.community-totals { display:flex; flex-wrap:wrap; gap:24px 32px; padding-block:24px; }
.community-totals p { display:grid; gap:8px; margin:0; }
.community-totals strong { font-size:28px; line-height:1.2; }
.community-totals span { font-size:14px; }
