@font-face{font-family:Manrope;src:url('/app/assets/Manrope-Variable.ttf') format('truetype');font-weight:200 800;font-display:swap}
/* Gravity member Mini App — approved concept B "Спокійний довідник" (calm directory): soft grey page, white grouped
   surfaces with hairline dividers, compact Manrope, discreet initials. Red fills only the primary action of a screen.
   Contrast (WCAG, computed): light ink/page 15.4, muted/page 6.9, subtle/page 5.1, subtle/surface 5.6, muted/track 6.2,
   white on red 6.7, control border/surface 3.4; dark ink/page 15.2, muted/surface 7.5, subtle/surface 5.7,
   white on red 5.7, control border/surface 3.6. */
:root{color-scheme:light;
  --paper:#f4f3f1;--surface:#ffffff;--raised:#ecebe8;--track:#e9e7e3;--hover:#faf9f8;--skeleton:#e3e0db;--chip:#ffffff;--initials:#f4f3f1;
  --ink:#1d1c1a;--muted:#57534e;--subtle:#6b6762;--line:#e8e6e2;--control:#8f8b85;--chevron:#a8a49e;
  --action:#b7140f;--action-hover:#96100c;--on-action:#ffffff;--focus:#1d1c1a;
  --danger:#b7140f;--notice:#f6e9e6;--notice-ink:#1d1c1a;--nav-bg:rgb(244 243 241 / .96);--lift:0 1px 2px rgb(60 50 40 / .10);
  --radius:14px;--radius-sm:10px;--tap:2.75rem;--ease:cubic-bezier(.2,.7,.2,1);
  --display:Manrope,'Avenir Next','Segoe UI',sans-serif;
  --safe-top:max(env(safe-area-inset-top),var(--tg-content-safe-area-inset-top,0px));
  --safe-bottom:max(env(safe-area-inset-bottom),var(--tg-safe-area-inset-bottom,0px));
  --tabbar:3.75rem;
  /* 100%, not px: honours the reader's browser text-size preference; rem-based layout scales with it. */
  font:400 100%/1.45 var(--display);font-feature-settings:'tnum' 0}
:root[data-theme=dark]{color-scheme:dark;
  --paper:#171615;--surface:#22211f;--raised:#2c2a28;--track:#2c2a28;--hover:#272624;--skeleton:#33312e;--chip:#3d3b38;--initials:#2c2a28;
  --ink:#ecebe8;--muted:#b5b1ab;--subtle:#9d9993;--line:#33312e;--control:#7a766f;--chevron:#7a766f;
  --action:#c42a22;--action-hover:#a8221b;--on-action:#ffffff;--focus:#ecebe8;
  --danger:#ff8a7e;--notice:#3a2522;--notice-ink:#ecebe8;--nav-bg:rgb(23 22 21 / .96);--lift:0 1px 2px rgb(0 0 0 / .4)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;
  --paper:#171615;--surface:#22211f;--raised:#2c2a28;--track:#2c2a28;--hover:#272624;--skeleton:#33312e;--chip:#3d3b38;--initials:#2c2a28;
  --ink:#ecebe8;--muted:#b5b1ab;--subtle:#9d9993;--line:#33312e;--control:#7a766f;--chevron:#7a766f;
  --action:#c42a22;--action-hover:#a8221b;--on-action:#ffffff;--focus:#ecebe8;
  --danger:#ff8a7e;--notice:#3a2522;--notice-ink:#ecebe8;--nav-bg:rgb(23 22 21 / .96);--lift:0 1px 2px rgb(0 0 0 / .4)}}

*{box-sizing:border-box}
/* Keyboard focus and in-page scrolling stop clear of the sticky top bar (and, on phones, the fixed tab bar below). */
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;scroll-padding-top:calc(4.75rem + var(--safe-top));scroll-padding-bottom:1rem}
body{margin:0;min-height:100dvh;background:var(--paper);color:var(--ink);font-size:.9375rem;overflow-wrap:break-word}
button,input,textarea,select{font:inherit;color:inherit}
button,a,select,summary,label{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
a{color:var(--ink);text-decoration-color:var(--control);text-underline-offset:.22em;text-decoration-thickness:1px}
a:hover{text-decoration-color:currentColor}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:6px}
main:focus{outline:none}
.visually-hidden,.label-full{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.skip{position:fixed;top:-5rem;left:1rem;z-index:30;padding:.7rem 1rem;background:var(--ink);color:var(--paper);border-radius:var(--radius-sm);text-decoration:none}
.skip:focus{top:calc(1rem + var(--safe-top))}

/* ---------- Shell ---------- */
/* --nav-height is the measured phone navigation (tabs + TEST strip + safe area, at the current text size), set by app.mjs. */
.layout{--gutter:min(1.25rem,5vw);width:min(100% - 2 * var(--gutter),48rem);margin:auto;padding:0 0 calc(var(--nav-height,calc(var(--tabbar) + var(--safe-bottom))) + 2rem)}
/* No backdrop-filter on phones: it would become the containing block of the fixed tab bar. */
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:0 calc(-1 * var(--gutter));padding:calc(.4rem + var(--safe-top)) var(--gutter) .4rem;background:var(--paper);border-bottom:1px solid var(--line)}
/* Plain-text brand label, not a reproduction of the official mark. */
.wordmark{display:inline-flex;align-items:center;min-height:var(--tap);font-weight:600;font-size:.8125rem;letter-spacing:.02em;white-space:nowrap;text-decoration:none;color:var(--muted)}
.wordmark:hover{color:var(--ink)}

/* Bottom tab bar on phones (Telegram-native thumb reach), quiet text links on wide screens. */
.nav{position:fixed;inset:auto 0 0 0;z-index:20;display:flex;flex-direction:column;background:var(--nav-bg);border-top:1px solid var(--line);padding-bottom:var(--safe-bottom)}
/* Equal fifths at ordinary sizes; when enlarged text needs more than a fifth, each tab keeps its whole label and the strip scrolls sideways. */
.tabs{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(max-content,1fr);list-style:none;width:100%;margin:0 auto;padding:0 .25rem;max-width:36rem;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tab{position:relative;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.2rem;min-height:var(--tabbar);padding:.35rem .15rem;color:var(--subtle);text-decoration:none;font-size:.6875rem;font-weight:500;text-align:center;line-height:1.15}
.tab:hover{color:var(--ink)}
.tab-icon{width:1.375rem;height:1.375rem;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.tab-label{display:block;white-space:nowrap}
/* The strip clips overflow, so the phone tab focus ring sits inside the tab. */
.tab:focus-visible{outline-offset:-2px;border-radius:10px}
.tab[aria-current=page]{color:var(--ink);font-weight:700}
.tab[aria-current=page] .tab-icon{stroke-width:2}
.nav-test:not(:empty){order:-1;display:flex;justify-content:center;padding:.3rem 1rem;border-bottom:1px solid var(--line);background:var(--track)}
.nav-test a{display:inline-flex;align-items:center;min-height:2.25rem;font-weight:600;font-size:.8rem;color:var(--ink);text-decoration:none}
.nav-test a:hover{text-decoration:underline}

/* Account + settings popover keeps profile, offers, language, appearance and sign-out one tap away. */
.account{position:relative}
.account>summary{display:flex;align-items:center;gap:.6rem;min-height:var(--tap);min-width:var(--tap);padding:.15rem;border-radius:999px;cursor:pointer;list-style:none;font-weight:600;font-size:.875rem;color:var(--muted)}
.account>summary::-webkit-details-marker{display:none}
.account-label{display:none}
.account>summary:hover .monogram,.account[open]>summary .monogram{background:var(--raised);color:var(--ink)}
.account-panel{position:absolute;z-index:25;right:0;top:calc(100% + .4rem);width:min(21rem,calc(100vw - 2rem));max-height:calc(100dvh - 5rem - var(--safe-top));overflow-y:auto;overscroll-behavior:contain;padding:.75rem;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 12px 32px -16px rgb(29 28 26 / .35);animation:pop .18s var(--ease) both}
.account-name{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;margin:0 0 .25rem;padding:.25rem .25rem .75rem;border-bottom:1px solid var(--line)}
.account-name strong{font-weight:650;overflow-wrap:anywhere}
.account-links{list-style:none;margin:0 0 .75rem;padding:0}
.account-links li+li{border-top:1px solid var(--line)}
.account-links a{display:flex;align-items:center;justify-content:space-between;min-height:var(--tap);padding:0 .25rem;font-weight:600;color:var(--ink);text-decoration:none;border-radius:var(--radius-sm)}
.account-links a::after{content:'›' / '';color:var(--chevron);font-size:1.25rem;font-weight:400}
.account-links a:hover{background:var(--hover)}
.account-links a[aria-current=page]{font-weight:700}
.preferences{display:grid;gap:.5rem}
.preferences .quiet{width:100%}

/* ---------- Type ---------- */
main{display:block;min-height:50dvh;padding:1rem 0 2rem}
h1,h2,h3,h4,p{margin-top:0}
h1{font-size:1.375rem;line-height:1.2;letter-spacing:-.01em;font-weight:700;margin-bottom:.35rem}
h2{font-size:1.0625rem;line-height:1.3;font-weight:650}
h3{font-size:.9375rem;line-height:1.3;font-weight:650;margin:1.25rem 0 .4rem}
h4{font-size:.9375rem;font-weight:650;margin:1rem 0 .3rem}
p{max-width:65ch}
.page-title{padding:.25rem 0 .9rem}
.page-title>p:last-child{color:var(--muted);font-size:.875rem;margin-bottom:0}
.page-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.25rem 1rem}
.page-head h1{margin:0}
.eyebrow{margin-bottom:.3rem;font-size:.8125rem;font-weight:600;color:var(--subtle)}
.muted,.challenge{color:var(--muted)}
.meta{margin:0;font-size:.8125rem;color:var(--subtle);font-variant-numeric:tabular-nums}

/* ---------- Controls ---------- */
label{display:block;font-size:.8125rem;font-weight:600;color:var(--muted)}
label span{display:block;margin-bottom:.3rem}
input:not([type=checkbox]):not([type=radio]),select,textarea{width:100%;min-height:var(--tap);border:1px solid var(--control);border-radius:var(--radius-sm);padding:.55rem .75rem;background:var(--surface);color:var(--ink);font-size:.9375rem;font-weight:500;transition:border-color .16s var(--ease),box-shadow .16s var(--ease)}
textarea{min-height:6.5rem;resize:vertical;line-height:1.45}
input:hover,select:hover,textarea:hover{border-color:var(--muted)}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--focus);outline-offset:1px;border-color:var(--focus)}
input::placeholder,textarea::placeholder{color:var(--subtle)}
input::placeholder{text-overflow:ellipsis}
input[type=file]{padding:.5rem;font-size:.85rem}
input:disabled,select:disabled,textarea:disabled{opacity:.6;cursor:not-allowed}
/* Primary action: the one red element of a screen. Secondary actions use .quiet. */
button{max-width:100%;overflow-wrap:anywhere;display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:var(--tap);padding:.55rem 1.1rem;border:0;border-radius:var(--radius-sm);background:var(--action);color:var(--on-action);font-size:.9375rem;font-weight:600;cursor:pointer;transition:background-color .16s var(--ease),transform .12s var(--ease)}
button:hover{background:var(--action-hover)}
button:active{transform:translateY(1px)}
.quiet,.soft{background:var(--raised);color:var(--ink)}
.quiet:hover,.soft:hover{background:var(--track);color:var(--ink)}
button:disabled,button:disabled:hover{background:var(--raised);color:var(--subtle);opacity:.7;cursor:not-allowed;transform:none}
.check{display:flex;align-items:center;gap:.65rem;min-height:var(--tap);margin:0;color:var(--ink)}
.check span{margin:0;font-weight:500}
.check input{width:1.25rem;height:1.25rem;flex:none;accent-color:var(--ink)}
fieldset{min-width:0;margin:0;padding:1rem;border:1px solid var(--line);border-radius:var(--radius-sm)}
legend{padding:0 .35rem;font-weight:600;font-size:.8125rem;color:var(--muted)}
/* Either/or filter choices: radios whose labels wrap, unlike a native select's selected text. */
.choice-group{min-width:0;padding:0;border:0}
.choice-group>legend{padding:0;margin-bottom:.3rem;font-size:.8125rem;font-weight:600}
.choice-row{display:flex;flex-wrap:wrap;gap:.5rem}
.choice{flex:1 1 9rem;min-width:0;display:flex;align-items:center;gap:.5rem;min-height:var(--tap);margin:0;padding:.45rem min(.75rem,3vw);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);color:var(--ink);font-weight:500;cursor:pointer;transition:border-color .16s var(--ease),background-color .16s var(--ease)}
.choice:hover{border-color:var(--control)}
.choice:has(input:checked){border-color:var(--ink);font-weight:600}
.choice>span{display:block;margin:0;min-width:0;hyphens:auto;overflow-wrap:anywhere}
.choice>input{flex:none;width:1.1rem;height:1.1rem;min-height:0;margin:0;padding:0;border:0;accent-color:var(--ink)}
/* Segmented control (directory level): one track, the chosen option lifted onto a white chip. Options wrap to a
   second row rather than clip when enlarged text needs more than a quarter of the width. */
.segment{position:relative}
.segment>legend{position:absolute!important;top:0;left:0;width:1px;height:1px;margin:0;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.segment .choice-row{gap:2px;padding:3px;border-radius:11px;background:var(--track)}
.segment .choice{position:relative;flex:1 1 0;min-width:max-content;justify-content:center;min-height:var(--tap);padding:.25rem .75rem;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:.8125rem;font-weight:600}
.segment .choice:hover{color:var(--ink)}
.segment .choice>input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.segment .choice:has(input:checked){background:var(--chip);color:var(--ink);box-shadow:var(--lift)}
.segment .choice:has(input:focus-visible){outline:2px solid var(--focus);outline-offset:1px}
summary{cursor:pointer;font-weight:600}

/* Link rows: quiet text links; the screen's create action is the single red button. */
.subnav{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem 1.25rem;margin:0 0 1rem}
.chip{flex:0 1 auto;max-width:100%;display:inline-flex;align-items:center;min-height:var(--tap);color:var(--muted);font-weight:600;font-size:.875rem;text-decoration:none}
.chip:hover{color:var(--ink)}
.chip[aria-current=page]{color:var(--ink);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:.4em}
.chip-primary{order:-1;flex-basis:100%;justify-content:center;padding:0 1.1rem;border-radius:var(--radius-sm);background:var(--action);color:var(--on-action)}
.chip-primary:hover{background:var(--action-hover);color:var(--on-action)}
.back-link,main section>a:first-child{display:inline-flex;align-items:center;gap:.3rem;min-height:var(--tap);margin-bottom:.25rem;font-weight:600;font-size:.875rem;color:var(--muted);text-decoration:none}
.back-link:hover,main section>a:first-child:hover{color:var(--ink)}
.back-link::before,main section>a:first-child::before{content:'‹' / '';font-size:1.25rem;line-height:1;font-weight:400}

/* ---------- Directory ---------- */
.result-count{margin:0;font-size:.8125rem;font-weight:500;color:var(--subtle);font-variant-numeric:tabular-nums}
.directory-filters{display:grid;gap:.625rem;margin:0 0 .25rem}
.search-field{position:relative;color:var(--subtle)}
.search-field span{margin:0}
.search-icon{position:absolute;left:.75rem;top:50%;width:1.25rem;height:1.25rem;transform:translateY(-50%);fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.search-field input[type=search]{padding-left:2.4rem;border:0;background:var(--surface)}
.search-field input[type=search]:hover{border:0}
.search-field input[type=search]:focus-visible{outline:2px solid var(--focus);outline-offset:0}
.search-field input::-webkit-search-cancel-button{cursor:pointer}
.filters-more>summary{display:inline-flex;align-items:center;gap:.4rem;min-height:var(--tap);padding:0 .25rem;color:var(--muted);font-size:.875rem;list-style:none}
.filters-more>summary:hover{color:var(--ink)}
.filters-more>summary::-webkit-details-marker{display:none}
.filters-more>summary::after{content:'';width:.4rem;height:.4rem;margin-left:.25rem;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .2s var(--ease)}
.filters-more[open]>summary::after{transform:rotate(-135deg) translateY(-1px)}
.filters-panel{display:grid;gap:.75rem;padding:1rem min(1rem,4vw);background:var(--surface);border-radius:var(--radius)}
.filters-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr));gap:.75rem;align-items:end}
.badge-count{color:var(--subtle);font-weight:500;font-variant-numeric:tabular-nums}
.filters-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr));gap:.5rem}
.filters-actions button{padding-inline:.75rem}
.group{margin-top:1.125rem}
.group>h2{margin:0 .25rem .375rem;font-size:.8125rem;font-weight:600;color:var(--subtle)}
.people{list-style:none;margin:0;padding:0;background:var(--surface);border-radius:var(--radius);overflow:hidden}
/* Row: initials beside the body while the body has ~10rem; with enlarged text it drops below instead of squeezing words. */
.person-card{position:relative;display:flex;flex-wrap:wrap;gap:.25rem .75rem;align-items:flex-start;min-width:0;padding:.875rem 2.25rem .875rem 1rem;transition:background-color .14s var(--ease)}
.person-card+.person-card::before{content:'';position:absolute;top:0;left:1rem;right:0;height:1px;background:var(--line)}
.person-card:hover{background:var(--hover)}
.person-card:active{background:var(--paper)}
.person-body{flex:1 1 10rem;min-width:0}
.person-name{margin:0;font-size:.9375rem;font-weight:650;line-height:1.3}
.person-name a{color:var(--ink);text-decoration:none}
.person-name a::after{content:'';position:absolute;inset:0}
.person-name a:focus-visible{outline:none}
.person-card:has(.person-name a:focus-visible){outline:2px solid var(--focus);outline-offset:-2px;border-radius:var(--radius)}
.person-role{margin:.1rem 0 0;font-size:.875rem;color:var(--muted)}
.person-card .challenge{margin:.2rem 0 0;font-size:.8125rem;color:var(--subtle);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.person-card p,.person-name{overflow-wrap:anywhere}
.row-chevron{position:absolute;right:.75rem;top:50%;width:1.125rem;height:1.125rem;transform:translateY(-50%);fill:none;stroke:var(--chevron);stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.monogram{display:inline-grid;place-items:center;flex:none;width:2.25rem;height:2.25rem;border-radius:var(--radius-sm);background:var(--initials);color:var(--muted);font-weight:700;font-size:.75rem;letter-spacing:.02em}
.monogram:has(.avatar-photo){position:relative;overflow:hidden}
.avatar-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:var(--initials)}
.account .monogram{width:2.25rem;height:2.25rem;border-radius:999px;background:var(--track)}
.tier,.detail .tier{overflow-wrap:normal;white-space:nowrap}
.tier{display:inline;margin:0;font-size:.8125rem;font-weight:600;color:var(--subtle)}
.tags{list-style:none;display:flex;flex-wrap:wrap;gap:.3rem;padding:0;margin:.3rem 0 0}
.tags li{max-width:100%;overflow-wrap:anywhere;font-size:.8125rem;font-weight:500;padding:.15rem .5rem;border-radius:6px;background:var(--paper);color:var(--muted)}
.pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem .75rem;margin-top:1.25rem;font-variant-numeric:tabular-nums;font-weight:500;font-size:.8125rem;color:var(--subtle)}
.pagination button{flex:1 1 8rem;min-width:0;background:var(--surface);color:var(--ink);text-align:center}
.pagination button:hover{background:var(--hover)}
.pagination>span{flex:0 1 auto;text-align:center}
.pagination>a{display:inline-flex;align-items:center;min-height:var(--tap)}
.pagination button:disabled{background:transparent;color:var(--subtle)}

/* ---------- Detail, profile ---------- */
.profile-head{display:flex;flex-wrap:wrap;align-items:center;gap:.875rem;margin-bottom:.75rem;min-width:0}
.profile-head>div{flex:1 1 8rem;min-width:0}
.profile-head h2{margin:0;font-size:1.1875rem;font-weight:700;overflow-wrap:anywhere}
.profile-head .tier{display:block;margin-bottom:.15rem}
.profile-mark{width:3rem;height:3rem;font-size:.9375rem;border-radius:12px}
.detail{display:grid;grid-template-columns:minmax(0,1fr);gap:.75rem}
.detail p,.detail li{overflow-wrap:anywhere}
.detail>div,.detail>form,.detail>aside{min-width:0;padding:1rem min(1.25rem,4vw);background:var(--surface);border-radius:var(--radius)}
/* Section labels inside a profile read like the field captions of a settings sheet. */
.detail h3,.contact-actions h3,.photo-controls h3,.privacy h3{margin:1.125rem 0 .2rem;font-size:.75rem;font-weight:600;color:var(--subtle)}
.detail>div>h3:first-of-type,.contact-actions h3,.photo-controls h3{margin-top:.5rem}
.detail aside>p,.membership-details p{display:flex;justify-content:space-between;gap:1rem;margin:0;padding:.6rem 0;border-bottom:1px solid var(--line);font-size:.875rem}
.detail aside>p:last-child{border-bottom:0}
.portrait{display:block;width:min(100%,12rem);aspect-ratio:1;object-fit:cover;margin:0 0 .75rem;border-radius:var(--radius)}
.detail+a,.contact-actions+a{display:inline-flex;align-items:center;min-height:var(--tap);margin-top:.5rem;font-weight:600}
main section>.detail~a:not(.back-link){display:inline-flex;align-items:center;min-height:var(--tap);margin-top:.5rem;font-weight:600}
.contact-actions{margin-top:.75rem;padding:1rem min(1.25rem,4vw);background:var(--surface);border-radius:var(--radius)}
.contact-actions>p{color:var(--muted);font-size:.875rem}
.contact-actions button,.record button{margin:.25rem .4rem .25rem 0}
.profile-form{display:grid;grid-template-columns:minmax(0,1fr);gap:.875rem}
.profile-form>*{min-width:0}
.profile-form>button[type=submit],.profile-form>button:last-child{justify-self:start}
.photo-controls,.privacy{margin-bottom:1.25rem}
.photo-controls input{margin:.75rem 0}
.photo-controls[aria-busy=true]{opacity:.7}
.privacy form{display:grid;gap:.5rem}
.membership-details{margin-bottom:.75rem}

/* ---------- Records, threads: grouped white surfaces with hairline dividers ---------- */
.inbox,.messages{max-width:48rem}
.inbox{display:grid;gap:0;padding:0;margin:0 0 1rem;list-style:none;background:var(--surface);border-radius:var(--radius);overflow:hidden}
.record{padding:.875rem 1rem;margin:0 0 .75rem;background:var(--surface);border-radius:var(--radius);min-width:0}
.inbox>.record{margin:0;border-radius:0;background:none}
.inbox>.record+.record{border-top:1px solid var(--line)}
.record h2{margin:.1rem 0 .3rem;font-size:.9375rem;font-weight:650}
.record h2 a{color:var(--ink);text-decoration:none}
.record h2 a:hover{text-decoration:underline}
.record p{margin-bottom:.3rem}
.record>*:last-child{margin-bottom:0}
.introduction{overflow-wrap:anywhere}
.introduction-channels{margin:.75rem 0;font-size:.9375rem}
.introduction-channels dt{color:var(--muted);font-size:.8125rem;margin-top:.6rem}
.introduction-channels dd{margin:.15rem 0 0;font-weight:600}
.introduction>button,.introduction>.card-link{margin:.35rem .5rem .35rem 0;max-width:100%;white-space:normal}
.byline{display:flex;align-items:center;gap:.5rem;margin:.4rem 0 0;font-size:.8125rem}
.byline .monogram{width:1.75rem;height:1.75rem;border-radius:8px;font-size:.6875rem}
.messages{display:grid;gap:.5rem;padding:0;list-style:none}
.messages li{padding:.75rem 1rem;background:var(--surface);border-radius:4px var(--radius) var(--radius) var(--radius)}
.messages li p,.record-text{white-space:pre-wrap;overflow-wrap:anywhere}
.messages li p{margin:.2rem 0}
.messages small{color:var(--subtle);font-size:.75rem;font-variant-numeric:tabular-nums}
.editor{display:grid;gap:.75rem;max-width:48rem;margin:1rem 0}
.editor button{justify-self:start}
main section>form:not(.filters):not(.profile-form):not(.editor){display:grid;grid-template-columns:minmax(0,1fr);gap:.75rem;max-width:48rem;margin:1rem 0}
main section>form:not(.filters):not(.editor)>*{min-width:0}
select{max-width:100%;text-overflow:ellipsis}
main section>form:not(.filters):not(.profile-form):not(.editor)>button{justify-self:start}
/* Other screens' filter forms sit on one white surface. */
form.filters:not(.directory-filters){display:grid;gap:.75rem;margin:0 0 1rem;padding:1rem min(1rem,4vw);background:var(--surface);border-radius:var(--radius)}
.filters>button{align-self:end}
/* Applying a filter is not the screen's primary action, so it stays neutral. */
form.filters>button[type=submit]{background:var(--raised);color:var(--ink)}
form.filters>button[type=submit]:hover{background:var(--track)}

/* ---------- Events ---------- */
.event-hero{margin-bottom:.75rem;padding:1rem min(1.25rem,4vw);background:var(--surface);border-radius:var(--radius)}
.event-hero h2{font-size:1.1875rem;font-weight:700;margin-bottom:.4rem}
.facts{display:grid;gap:0;margin-bottom:.75rem;padding:0 min(1.25rem,4vw);background:var(--surface);border-radius:var(--radius)}
.facts>p{margin:0;padding:.7rem 0;border-bottom:1px solid var(--line);font-size:.9375rem}
.facts>p:last-child{border-bottom:0}
.event-card{display:grid;grid-template-columns:3rem minmax(0,1fr);gap:.875rem;align-items:start}
.event-date{display:grid;place-items:center;align-content:center;width:3rem;height:3.25rem;margin:0;border-radius:var(--radius-sm);background:var(--paper);text-align:center;line-height:1}
.event-date strong{font-size:1.125rem;font-weight:700;font-variant-numeric:tabular-nums}
.event-date span{margin-top:.2rem;font-size:.6875rem;font-weight:600;color:var(--subtle)}
.event-body{min-width:0}
.event-when{font-weight:500;font-size:.875rem;font-variant-numeric:tabular-nums}
.capacity{display:grid;gap:.3rem;margin:.5rem 0 .25rem}
meter{width:100%;height:.3rem;border:0;border-radius:999px;background:var(--track);-webkit-appearance:none;appearance:none}
meter::-webkit-meter-bar{height:.3rem;border:0;border-radius:999px;background:var(--track)}
meter::-webkit-meter-optimum-value,meter::-webkit-meter-suboptimum-value,meter::-webkit-meter-even-less-good-value{border-radius:999px;background:var(--muted)}
meter::-moz-meter-bar{border-radius:999px;background:var(--muted)}
.card-link{display:inline-flex;align-items:center;min-height:var(--tap);font-weight:600;font-size:.875rem}
.badge{display:grid;justify-items:start;gap:.5rem;margin:1rem 0;padding:1rem;background:#fff;color:#1d1c1a;border-radius:var(--radius)}
.badge a{color:#1d1c1a}

/* ---------- Feedback, loading, gate ---------- */
.notice{padding:.75rem 1rem;margin:.75rem 0;border-radius:var(--radius-sm);background:var(--notice);color:var(--notice-ink);box-shadow:inset 3px 0 0 var(--danger);overflow-wrap:anywhere;max-width:48rem}
.notice.info{background:var(--surface);color:var(--muted);box-shadow:none}
main>.notice.error+button{margin-top:.25rem}
/* Loading: sign-in orbit, busy-button hairlines and quiet route-shaped skeletons.
   Skeletons are decorative (aria-hidden); timing lives in app.mjs. No percentages. */
.loading{display:grid;gap:.75rem;padding:.25rem 0}
.loading-hold{display:none}
main[aria-busy=true]{cursor:progress}
.loading-note{min-height:1.45em;margin:.25rem 0 0;font-size:.875rem;color:var(--muted)}
.loading-shape{display:grid;gap:.75rem;animation:bones-in .18s var(--ease) both}
.skeleton{display:block;border-radius:6px;background:var(--skeleton)}
@media(prefers-reduced-motion:no-preference){.loading-shape{animation:bones-in .18s var(--ease) both,pulse 1.6s ease-in-out .18s infinite alternate}}
.sk-title{width:min(11rem,55%);height:1.65rem;border-radius:8px}
.sk-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem 1rem;padding:.25rem 0 .65rem}
.sk-count{width:6.5rem;height:.8rem}
.sk-search{height:var(--tap);border-radius:var(--radius-sm);background:var(--surface)}
.sk-segment{height:calc(var(--tap) + 6px);border-radius:11px;background:var(--track)}
.sk-label{width:4.5rem;height:.8rem;margin:.6rem .25rem 0}
.sk-action{width:100%;height:var(--tap);border-radius:var(--radius-sm)}
.sk-back{width:7rem;height:.9rem;margin:.9rem 0 .4rem}
.sk-surface{display:grid;background:var(--surface);border-radius:var(--radius);overflow:hidden}
.sk-row{display:flex;gap:.75rem;align-items:flex-start;padding:.875rem 2.25rem .875rem 1rem}
.sk-surface>.sk-row+.sk-row,.sk-surface>.sk-record+.sk-record{border-top:1px solid var(--line)}
.sk-row-plain{padding:0 0 .5rem}
.sk-mark{flex:none;width:2.25rem;height:2.25rem;border-radius:var(--radius-sm)}
.sk-mark-lg{width:3rem;height:3rem;border-radius:12px}
.sk-lines{flex:1;display:grid;gap:.45rem;padding-top:.2rem}
.sk-line{height:.85rem}
.sk-small{height:.65rem}
.sk-record{display:grid;gap:.5rem;padding:.95rem 1rem}
.sk-card{display:grid;gap:.7rem;padding:1rem min(1.25rem,4vw);background:var(--surface);border-radius:var(--radius)}
.sk-field{display:grid;gap:.4rem}
.sk-input{height:var(--tap);border-radius:var(--radius-sm);background:transparent;box-shadow:inset 0 0 0 1px var(--line)}
.sk-input-tall{height:6.5rem}
.sk-button{width:7rem;height:var(--tap);border-radius:var(--radius-sm)}
.sk-thread{display:grid;gap:.5rem}
.sk-bubble{display:grid;gap:.45rem;padding:.75rem 1rem;background:var(--surface);border-radius:4px var(--radius) var(--radius) var(--radius)}
.sk-bubble.own{margin-left:min(2.5rem,10%);background:var(--raised);border-radius:var(--radius) 4px var(--radius) var(--radius)}
.w25{width:25%}.w30{width:30%}.w40{width:40%}.w45{width:45%}.w50{width:50%}.w55{width:55%}.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}
/* Busy action: the pressed control keeps its label, size and focus; a hairline runs along its lower edge. */
button[aria-busy=true]{position:relative;overflow:hidden;cursor:progress}
button[aria-busy=true]:active{transform:none}
button[aria-busy=true]::after{content:'';position:absolute;left:0;right:0;bottom:0;height:2px;background:currentColor;opacity:.55;transform-origin:left;animation:hairline 1.1s var(--ease) infinite}
select[aria-busy=true]{cursor:progress;opacity:.7}
/* A form whose success opens another record holds its fields while sending (their edits could not follow). */
form[data-leaves]:has(button[aria-busy=true]) :is(input,textarea):read-only{color:var(--muted);cursor:progress}
.gate{max-width:30rem;margin:10dvh auto 0;padding:1.5rem;background:var(--surface);border-radius:var(--radius)}
.gate .page-title{padding-bottom:.25rem}
.gate-mark{margin:0 0 1.25rem;min-height:0}
/* The official mark keeps its original proportions and fixed server/client geometry. */
.gate-loading{background:transparent;text-align:center;margin:max(1rem,calc(50dvh - 11rem)) auto 0}
.gate-loading .gate-mark{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.gate-bar{position:relative;display:block;width:176px;max-width:100%;aspect-ratio:500/393;margin:1.5rem auto 2rem;isolation:isolate;filter:invert(1)}
.gate-bar::before,.gate-bar::after{content:'';position:absolute;inset:0;background:url('/app/assets/gravity-logo.png') center/contain no-repeat}
.gate-bar::before{opacity:.52}
.gate-bar::after{clip-path:inset(0 100% 0 0);animation:gravity-illuminate 3.8s ease-in-out infinite}
.gate-loading .gate-status::after{content:'';display:block;width:4px;height:4px;margin:18px auto 0;border-radius:50%;background:var(--muted);box-shadow:-10px 0 var(--muted),10px 0 var(--action);animation:gravity-breathe 1.8s ease-in-out infinite}
:root[data-theme=dark] .gate-bar{filter:none}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .gate-bar{filter:none}}
@keyframes gravity-illuminate{0%,15%{clip-path:inset(0 100% 0 0);opacity:0}25%{opacity:1}60%{clip-path:inset(0 0 0 0);opacity:1}85%,100%{clip-path:inset(0 0 0 0);opacity:0}}
@keyframes gravity-breathe{0%,100%{opacity:.35;transform:translateY(0)}50%{opacity:1;transform:translateY(-2px)}}
.gate-status{position:relative;min-height:1.45em;margin:.9rem 0 0;font-size:.875rem;color:var(--muted)}
/* Server boot frame only: if the app never starts, the still-loading line appears at 8 s without JavaScript. It is
   absolutely placed so the boot box is exactly the size of the client's (empty, one-line) status line. */
.boot-slow{position:absolute;inset:0 0 auto;visibility:hidden;animation:boot-slow 0s linear 8s forwards}
/* The waiting box is replaced by an identical one when the app starts; replaying the entrance would flicker. */
main>.gate.gate-loading{animation:none}
.gate .notice{margin-bottom:1rem}
.gate>a{display:inline-flex;align-items:center;min-height:var(--tap);font-weight:600}
.gate>a::before{content:none}
/* ---------- Artwork (DESIGN.md "Artwork") ----------
   One local illustration on the settled sign-in welcome and genuine empty states only. The image's own ground is
   exactly the card surface in each theme (light #ffffff, dark #22211f), so it reads as part of the card, never as a
   pasted rectangle. The frame reserves 4:3 before the image arrives (no layout shift); a failed image collapses it. */
.artwork{display:block;width:min(100%,15rem);aspect-ratio:4/3;margin:0 auto;pointer-events:none}
.artwork img{display:block;width:100%;height:auto;aspect-ratio:4/3}
.artwork-missing{display:none}
.artwork-gate{margin:-.5rem auto .25rem}
.empty-state{display:grid;justify-items:center;gap:.25rem;max-width:30rem;margin:.75rem auto 1rem;padding:1rem min(1.25rem,4vw) 1.25rem;background:var(--surface);border-radius:var(--radius);text-align:center}
.empty-state .artwork{width:min(100%,13rem)}
.empty-state>.notice{margin:0;padding:0 .25rem;background:none;max-width:24rem}
.empty-state>button{margin-top:.75rem}
/* Short landscape keeps the copy and actions in view: the illustration steps aside. */
@media(max-height:480px){.artwork{display:none}}
.layout:not(:has(.topbar)){padding-bottom:3rem}

/* ---------- Screen modules ---------- */
.club-screen>a:not(:first-child){display:inline-flex;align-items:center;min-height:var(--tap);margin-bottom:.75rem;padding:0 1rem;border-radius:var(--radius-sm);background:var(--surface);color:var(--ink);font-weight:600;text-decoration:none}
.club-screen>a:not(:first-child)::after{content:'›' / '';margin-left:.5rem;color:var(--chevron);font-size:1.25rem}
.club-screen>a:not(:first-child):hover{background:var(--hover)}
.club-screen>h2,.protocol-screen>h2,section>h2{margin-top:1.5rem}
.club-screen>.record h2{margin-top:0}
.club-rows a{align-items:center}
.club-row-text{display:grid;gap:.15rem;min-width:0}
.club-row-title{font-weight:600}
.club-row-body{min-width:0;color:var(--muted);font-size:.875rem;font-weight:400;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.club-row-more{padding:0 1rem .5rem}
.club-row-more>summary{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;min-height:var(--tap);padding:.25rem 0;list-style:none}
.club-row-more>summary::-webkit-details-marker{display:none}
.club-row-more>summary::after{content:'';flex:none;width:.4rem;height:.4rem;margin:.35rem .2rem 0;border-right:1.5px solid var(--chevron);border-bottom:1.5px solid var(--chevron);transform:rotate(45deg);transition:transform .2s var(--ease)}
.club-row-more[open]>summary::after{transform:rotate(-135deg)}
.club-row-more[open] .club-row-body{display:block;overflow:visible;white-space:pre-line}
.club-nav{margin-bottom:.5rem}
.club-note{margin:0 .25rem .5rem}
main section.club-section>form.club-search:not(.filters){grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.5rem;margin:0 0 .5rem}
.club-search .search-field input[type=search]{padding-left:.75rem}
main section.club-section>form.club-search:not(.filters)>button{justify-self:stretch;background:var(--raised);color:var(--ink)}
.club-search>button:hover{background:var(--track)}
.club-screen>a.club-reset{min-height:var(--tap);margin:0 0 .25rem;padding:0;background:none;color:var(--muted);font-size:.875rem}
.club-screen>a.club-reset::after{content:none}
.club-screen .result-count{margin:0 .25rem .5rem}
.club-article h1{margin:0 0 .75rem;font-size:1.25rem;overflow-wrap:anywhere}
article.person{padding:.875rem 1rem;margin:0 0 .75rem;background:var(--surface);border-radius:var(--radius);overflow-wrap:anywhere}
article.person>h4:first-child{margin-top:0}
article.person>a{display:inline-flex;align-items:center;min-height:var(--tap);margin:0 1rem 0 0;font-weight:600}
article.person h4,article.person li,article.person p{overflow-wrap:anywhere}
.protocol-screen{max-width:48rem;overflow-wrap:anywhere}
.protocol-screen form{margin:1rem 0 1.5rem}
.protocol-screen details{margin:1rem 0;padding:.25rem 1rem;background:var(--surface);border-radius:var(--radius-sm)}
.protocol-screen summary{display:flex;align-items:center;min-height:var(--tap)}
.protocol-screen dl{padding:1rem;background:var(--surface);border-radius:var(--radius-sm)}
.protocol-screen dd{margin:0 0 1rem;white-space:pre-wrap}
.protocol-screen dt{font-weight:600;font-size:.75rem;color:var(--subtle)}
.protocol-screen .record p{white-space:pre-wrap}
section>ul:not([class]),section>ol:not([class]){padding-left:1.15rem}
section>ul:not([class]) li,section>ol:not([class]) li{margin:.3rem 0}

/* ---------- Remaining screens: same calm grammar as the directory ---------- */
/* Forms on detail/inbox/thread/club/protocol screens sit on one white surface; label sits directly above its control. */
.form-card,.protocol-screen form.profile-form,.club-screen form.profile-form,main section>form.form-card{display:grid;grid-template-columns:minmax(0,1fr);gap:.75rem;max-width:48rem;margin:.75rem 0 1rem;padding:1rem min(1rem,4vw);background:var(--surface);border-radius:var(--radius)}
.form-card>*,.protocol-screen form.profile-form>*,.club-screen form.profile-form>*{min-width:0}
.form-card>button,.protocol-screen form.profile-form>button,.club-screen form.profile-form>button{justify-self:start}
.form-card>.notice,.protocol-screen form .notice{margin:0}
.form-card h3,.club-screen form.profile-form>h3{margin:0;font-size:.9375rem}
.form-card fieldset,.protocol-screen form fieldset{display:grid;gap:.75rem;padding:.75rem min(.875rem,3vw);border-color:var(--line)}
.form-card fieldset>legend{padding:0 .25rem}
.event-time-field{min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:.5rem;align-content:start}
.event-time-field>*{min-width:0}
.event-time-field [hidden]{display:none}
.event-time-fields .help{margin:0;color:var(--muted);font-size:.875rem;overflow-wrap:anywhere}
.event-time-fields input,.event-time-fields select{min-width:0;width:100%;max-width:100%}
@media(min-width:760px){.form-card .event-time-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.event-time-fields>label,.event-time-fields>p{grid-column:1/-1}}
/* A long event-proposal form reads as two compact columns on wide screens; textareas, notices and the submit span both. */
@media(min-width:760px){.form-card.form-wide{grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}.form-card.form-wide>label:has(textarea),.form-card.form-wide>button,.form-card.form-wide>.notice,.form-card.form-wide>fieldset{grid-column:1/-1}}
/* Repeated actions that are not the screen's single primary action stay neutral. */
button.secondary,.record button:not(.danger),.inbox button:not(.danger),.form-card button.secondary{background:var(--raised);color:var(--ink)}
button.secondary:hover,.record button:not(.danger):hover,.inbox button:not(.danger):hover{background:var(--track);color:var(--ink)}
.record button:disabled{background:var(--raised);color:var(--subtle)}
/* Destructive actions read as destructive text, not as another red fill. */
button.danger{background:transparent;color:var(--danger);box-shadow:inset 0 0 0 1px var(--control)}
button.danger:hover{background:var(--notice);color:var(--danger)}
/* Section heading inside a screen: a quiet caption row rather than another big title. */
.section-label{margin:1.5rem .25rem .375rem;font-size:.8125rem;font-weight:600;color:var(--subtle)}
main section>h2.section-label{margin-top:1.5rem}
/* Meta lines: key facts as hairline rows on a white surface. */
.meta-list{display:grid;gap:0;margin:0 0 .75rem;padding:0 min(1.25rem,4vw);background:var(--surface);border-radius:var(--radius);list-style:none}
.meta-list>li,.meta-list>p{margin:0;padding:.65rem 0;border-bottom:1px solid var(--line);font-size:.9375rem;overflow-wrap:anywhere}
.meta-list>:last-child{border-bottom:0}
.meta-list .meta-key{display:block;font-size:.75rem;font-weight:600;color:var(--subtle)}
/* Plain link lists (calendar, protocol, threads, notifications): rows with a chevron instead of bullets. */
.link-list{list-style:none;margin:0 0 1rem;padding:0;background:var(--surface);border-radius:var(--radius);overflow:hidden}
.link-list>li{position:relative;border-top:1px solid var(--line)}
.link-list>li:first-child{border-top:0}
.link-list a,.link-list>li>span{display:flex;align-items:center;justify-content:space-between;gap:.75rem;min-height:var(--tap);padding:.6rem 1rem;color:var(--ink);font-weight:500;text-decoration:none;overflow-wrap:anywhere}
.link-list a::after{content:'›' / '';flex:none;color:var(--chevron);font-size:1.25rem}
.link-list a:hover{background:var(--hover)}
.link-list a:focus-visible{outline-offset:-2px;border-radius:var(--radius-sm)}
.link-list .unread{font-weight:650}
.link-list .row-action{display:flex;justify-content:flex-end;padding:0 1rem .6rem}
.link-list .row-action button{min-height:2.25rem;padding:.3rem .8rem;font-size:.8125rem}
/* Event detail actions row: calendar/download stay quiet text links grouped on one card. */
.action-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin:0 0 .75rem}
.action-row>button{flex:0 0 auto}
/* Status lines that report the member's own state. */
.status-line{display:flex;align-items:center;gap:.5rem;margin:.5rem 0;padding:.65rem 1rem;background:var(--surface);border-radius:var(--radius-sm);font-weight:600;font-size:.9375rem}
.status-line::before{content:'';flex:none;width:.5rem;height:.5rem;border-radius:999px;background:var(--muted)}
/* Roster, attendance and attendee lists inside a card. */
.plain-list{list-style:none;margin:.25rem 0 .75rem;padding:0}
.plain-list>li{padding:.45rem 0;border-top:1px solid var(--line);font-size:.875rem;overflow-wrap:anywhere}
.plain-list>li:first-child{border-top:0}
/* Group meeting card: title + facts + actions grouped, materials and decision as captioned blocks. */
article.person>h4:first-child{font-size:1rem}
article.person>.meta{margin:.1rem 0}
article.person h4:not(:first-child){margin:1rem 0 .2rem;font-size:.75rem;font-weight:600;color:var(--subtle)}
article.person>p.help,.help-text{margin:.25rem 0;font-size:.8125rem;color:var(--subtle)}
article.person>.editor{margin:.5rem 0;padding:.75rem 0 0;border-top:1px solid var(--line)}
article.person>.editor button{background:var(--raised);color:var(--ink)}
article.person>.editor button:hover{background:var(--track)}
article.person .link-row{display:flex;flex-wrap:wrap;gap:0 1rem}
article.person .link-row a{display:inline-flex;align-items:center;min-height:var(--tap);font-weight:600;font-size:.875rem}
.group-head{padding:1rem min(1.25rem,4vw);margin-bottom:.75rem;background:var(--surface);border-radius:var(--radius)}
.group-head h2{margin:0 0 .2rem;font-size:1.1875rem;font-weight:700}
.group-head>p{margin:0;color:var(--muted);font-size:.875rem}
.group-head h3{margin:1rem 0 .2rem;font-size:.75rem;font-weight:600;color:var(--subtle)}
.next-meeting{display:flex;flex-direction:column;align-items:flex-start;gap:.1rem;width:100%;margin:0 0 .75rem;padding:.75rem 1rem;border-radius:var(--radius);background:var(--surface);color:var(--ink);text-align:left;font-weight:600}
.next-meeting:hover{background:var(--hover)}
.next-meeting small{font-size:.75rem;font-weight:600;color:var(--subtle)}
/* Threads: own messages offset and tinted, others plain, so authorship reads at a glance without colour. */
.messages li.own{margin-left:min(2.5rem,10%);background:var(--raised);border-radius:var(--radius) 4px var(--radius) var(--radius)}
.messages li strong{font-size:.8125rem;font-weight:650;color:var(--muted)}
/* Protocol pinned decision: a captioned card, not a black banner. */
.pinned{padding:.875rem 1rem;margin:0 0 .75rem;background:var(--surface);border-radius:var(--radius);box-shadow:inset 3px 0 0 var(--muted)}
.pinned p{margin:0 0 .25rem;white-space:pre-wrap}
.pinned small{color:var(--subtle);font-size:.75rem}
.protocol-screen details>ol{padding-left:1.15rem}
.protocol-screen details li{margin:.5rem 0}
.protocol-screen details small{color:var(--subtle);font-size:.75rem}
/* Offer detail head: summary, parties and status as one card; terms as captioned rows. */
.offer-head{padding:1rem min(1.25rem,4vw);margin-bottom:.75rem;background:var(--surface);border-radius:var(--radius)}
.offer-head h2{margin:0 0 .5rem;font-size:1.125rem;font-weight:700}
.offer-head p{margin:.15rem 0;font-size:.875rem;color:var(--muted)}
.offer-head a{font-weight:600}
/* Inbox preference toggles grouped with their save. */
.prefs{display:grid;gap:.25rem;max-width:48rem;margin:0 0 1rem;padding:.5rem min(1rem,4vw) 1rem;background:var(--surface);border-radius:var(--radius)}
.prefs>button{justify-self:start;margin-top:.25rem}
.prefs>.muted,.prefs>p{margin:.25rem 0;font-size:.8125rem}
/* Club cards: kind caption, title, body; the external link is quiet. */
.club-screen>.record h2{font-size:1rem}
.club-screen .record>a{display:inline-flex;align-items:center;min-height:var(--tap);font-weight:600;font-size:.875rem}
.mentor-card .tier{display:block;margin:.1rem 0 .3rem}

@keyframes pulse{from{opacity:1}to{opacity:.6}}
@keyframes bones-in{from{opacity:0}to{opacity:1}}
@keyframes hairline{0%{transform:translateX(-100%) scaleX(.35)}60%{transform:translateX(60%) scaleX(.5)}100%{transform:translateX(100%) scaleX(.35)}}
@keyframes boot-slow{to{visibility:visible}}
@keyframes pop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@keyframes rise{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
main>section,main>.gate{animation:rise .24s var(--ease) both}

/* ---------- Wider screens: one calm column, text links in the top bar ---------- */
@media(min-width:760px){
  .layout{width:min(100% - 3rem,48rem);padding-bottom:4rem}
  .topbar{margin:0 -1.5rem;padding:calc(.5rem + var(--safe-top)) 1.5rem .5rem;gap:1.5rem;border-bottom-color:transparent}
  .nav{position:static;flex:1;display:flex;align-items:center;gap:.75rem;background:none;border:0;padding:0;min-width:0}
  .tabs{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.15rem;width:auto;max-width:none;margin:0;padding:0;overflow:visible}
  .tab:focus-visible{outline-offset:2px;border-radius:8px}
  .tab{flex-direction:row;gap:.4rem;min-height:var(--tap);padding:0 .75rem;border-radius:8px;font-size:.875rem;color:var(--muted)}
  .tab:hover{background:var(--track)}
  .tab-icon{display:none}
  .topbar{flex-wrap:wrap}
  .nav{flex-direction:row;flex-wrap:wrap}
  .nav-test:not(:empty){order:3;flex-basis:100%;justify-content:flex-end;padding:.25rem 0 0;border:0;background:none}
  .nav-test a{padding:0 .75rem;border-radius:8px;background:var(--track)}
  .account-label{display:inline;max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .account>summary{padding:.15rem .75rem .15rem .15rem}
  .account>summary:hover{background:var(--track)}
  main{padding-top:1.5rem}
  h1{font-size:1.5rem}
  .filters-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .filters-actions{display:flex;flex-wrap:wrap}
  .detail{grid-template-columns:minmax(0,1.6fr) minmax(15rem,1fr);gap:1rem;align-items:start}
  .detail>aside{position:sticky;top:5rem}
  .chip-primary{flex-basis:auto;order:0;margin-right:.5rem}
  main section>form.filters:not(.directory-filters){grid-template-columns:repeat(4,minmax(0,1fr));align-items:end}
}
@media(min-width:760px) and (max-width:1179px){.account-label{display:none}.account>summary{padding:.15rem}.tab{padding:0 .55rem}}
/* Full section names need more than the 48rem reading column: the top bar alone widens so they stay on one row. */
@media(min-width:1180px){.topbar{flex-wrap:nowrap}.layout>.topbar{margin-inline:calc((min(100vw - 3rem,74rem) - 100%) / -2);padding-inline:1.5rem}.tabs{flex-wrap:nowrap}.tab{white-space:nowrap}.nav{flex-wrap:nowrap}.nav-test:not(:empty){order:0;flex-basis:auto;padding:0}.label-full{position:static!important;width:auto;height:auto;margin:0;clip:auto;overflow:visible}.label-short{display:none}}
@media(max-width:759px){
  main section>form.filters:not(.directory-filters){grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr))}
  main section>form.filters:not(.directory-filters)>button{grid-column:1/-1}
  html{scroll-padding-bottom:calc(var(--nav-height,calc(var(--tabbar) + var(--safe-bottom))) + 1rem)}
  /* Above the tab bar and capped to the visible height, so sign-out stays reachable in short landscape. */
  .account-panel{position:fixed;left:1rem;right:1rem;top:calc(3.4rem + var(--safe-top));width:auto;max-height:calc(100dvh - 4.4rem - var(--safe-top) - var(--safe-bottom))}
  main section>form.filters>.choice-group{grid-column:1/-1}
}
@media(max-width:380px){.tab{font-size:.625rem}}
/* Short landscape: the top bar scrolls away so enlarged text keeps a usable reading band above the tab bar. */
@media(max-height:480px) and (max-width:759px){.topbar{position:relative}html{scroll-padding-top:1rem}
  /* The TEST strip sits beside the tabs instead of above them, so the fixed navigation stays one row tall. */
  .nav{flex-direction:row;align-items:stretch}
  .tabs{flex:1 1 auto;min-width:0;width:auto;max-width:none;margin:0}
  .nav-test:not(:empty){order:1;flex:0 1 auto;max-width:34%;align-items:center;padding:.25rem .6rem;border-bottom:0;border-left:1px solid var(--line)}
  .nav-test a{font-size:.72rem;line-height:1.15;text-align:center}
}
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  .skeleton,.loading-shape{animation:none}
  /* Keep the status indicator visible without movement. */
  .gate-bar::before,.gate-loading .gate-status::after{animation:none!important;transform:none;opacity:1}
  .gate-bar::after{display:none}
  button[aria-busy=true]::after{animation:none}
}
@media(forced-colors:active){.gate-loading .gate-mark{position:static;width:auto;height:auto;clip-path:none;overflow:visible}.gate-bar{display:none}.gate-loading .gate-status::after{background:CanvasText;box-shadow:none}.artwork{display:none}.empty-state{border:1px solid CanvasText}.skeleton,.sk-surface,.sk-card{border:1px solid GrayText}button[aria-busy=true]::after{background:CanvasText}.monogram,.people,.record,.notice,.segment .choice:has(input:checked),.form-card,.link-list,.meta-list,.pinned,.status-line,button.danger{border:1px solid CanvasText}.tab[aria-current=page]{text-decoration:underline}}
