/* Social Communities, Phase 3 (web): switcher, chooser tiles, browse, join, community home and its admin area.
   Built on social.css / ledger.css (same look as Social today); only new pieces live here. */
.cmsw{position:relative;display:inline-block;margin:.1rem 0 .6rem}
.cmsw>summary{list-style:none;display:inline-flex;align-items:center;gap:.45rem;padding:.4rem .8rem;border:1px solid var(--border,rgba(255,255,255,.15));border-radius:999px;cursor:pointer;font:600 .86rem system-ui;background:rgba(255,255,255,.03);max-width:80vw}
.cmsw>summary::-webkit-details-marker{display:none}
.cmsw__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cmsw__caret{opacity:.7}
.cmsw__menu{position:absolute;z-index:30;top:calc(100% + .3rem);left:0;min-width:15rem;max-width:min(22rem,90vw);background:#12121a;border:1px solid var(--border,rgba(255,255,255,.15));border-radius:.8rem;padding:.35rem;box-shadow:0 12px 30px rgba(0,0,0,.45)}
.cmsw__menu a{display:block;padding:.45rem .65rem;border-radius:.5rem;color:inherit;text-decoration:none;overflow-wrap:anywhere}
.cmsw__menu a:hover,.cmsw__menu a.on{background:rgba(240,193,75,.12)}
.cmsw__menu hr{border:0;border-top:1px solid rgba(255,255,255,.1);margin:.3rem 0}
/* cover tiles (same look as the admin pages) */
.cm-cover{display:block;flex:none;object-fit:cover;border-radius:.6rem;background:#222}
.cm-cover--md{width:7.5rem;height:4.5rem}.cm-cover--lg{width:9rem;height:5.5rem}
.cm-cover--tile{width:100%;height:auto;aspect-ratio:16/9;border-radius:.6rem .6rem 0 0}
.cm-cover--hero{width:13rem;height:8rem}
.cm-cover-fallback{display:grid;place-items:center;color:#fff;font-weight:800;letter-spacing:.06em;font-size:1.6rem;background:linear-gradient(135deg,hsl(var(--cm-hue,210) 55% 38%),hsl(calc(var(--cm-hue,210) + 40) 60% 24%));box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
.cm-cover--tile.cm-cover-fallback,.cm-cover--hero.cm-cover-fallback{font-size:2.4rem}
/* chooser */
.cmt-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:1rem}
.cmt{display:flex;flex-direction:column;padding:0!important;overflow:hidden;color:inherit;text-decoration:none;transition:border-color .15s}
.cmt:hover{border-color:rgba(240,193,75,.5)}
.cmt__body{display:flex;flex-direction:column;gap:.2rem;padding:.75rem .9rem .9rem;min-width:0}
.cmt__name{font-size:1.05rem;overflow-wrap:anywhere}
.cmt__meta{font-size:.8rem;opacity:.75}
.cmt__desc{font-size:.85rem;opacity:.85;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.cmt__door{display:grid;place-items:center;aspect-ratio:16/9;font-size:2.4rem;background:rgba(255,255,255,.03);border-bottom:1px dashed rgba(255,255,255,.12)}
/* browse */
.cmb-search{display:flex;gap:.5rem;margin:0 0 1rem;max-width:32rem}.cmb-search .inp{flex:1;min-width:0}
.cmb-list{display:grid;gap:.7rem}
.cmb{display:flex;gap:.9rem;align-items:center}
.cmb__body{flex:1;min-width:0;display:flex;flex-direction:column;gap:.2rem}
.cmb__act{display:flex;flex-wrap:wrap;gap:.4rem;justify-content:flex-end;flex:none}
/* join */
.cmj{max-width:40rem}
.cmj__card h1{margin:.6rem 0 .4rem;font-size:1.5rem}
.cmj__head{display:flex;gap:.9rem;align-items:center}.cmj__head h1{margin:0}
.cmj__form{display:flex;flex-direction:column;gap:.35rem;margin-top:.6rem}
.cmj__row{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}.cmj__row .inp{flex:1;min-width:10rem}
.cmj__q{margin-top:.5rem;font-weight:600}.cmj__q .req{color:#fca5a5}
/* community home */
.cmh{display:flex;gap:1.1rem;align-items:center}
.cmh__body{flex:1;min-width:0}.cmh__body h1{margin:.1rem 0 .3rem}
.cmh__act{display:flex;flex-direction:column;gap:.45rem;align-items:stretch;flex:none}
/* community admin area */
.cma-tabs{display:flex;flex-wrap:wrap;gap:.4rem;margin:0 0 1rem}
.cma-app{padding:.8rem 0;border-bottom:1px solid rgba(255,255,255,.08)}.cma-app:last-child{border-bottom:0}
.cma-ans{margin:.4rem 0 0 .2rem;padding-left:.6rem;border-left:2px solid rgba(240,193,75,.35)}
.cma-decide,.cma-inline{display:flex;flex-wrap:wrap;gap:.45rem;align-items:center;margin-top:.55rem}
.cma-decide .inp[name=note]{flex:1 1 14rem;min-width:0}
.cma-body{white-space:pre-wrap;overflow-wrap:anywhere;margin:.35rem 0}
.cma-scroll{overflow-x:auto}
.cma-add,.cma-codeform{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-top:1rem}
.cma-add .inp[name=userName],.cma-add .inp[name=prompt]{flex:1 1 14rem;min-width:0}
.cma-codeform{flex-direction:column;align-items:stretch;margin:0 0 1rem}
.cma-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));gap:.6rem;align-items:end}
.cma-grid label{display:flex;flex-direction:column;gap:.25rem}.cma-grid .cma-check{flex-direction:row;align-items:center;gap:.4rem}
.cma-q{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;padding:.6rem 0;border-bottom:1px solid rgba(255,255,255,.08)}.cma-q:last-child{border-bottom:0}
.cma-q.off .inp{opacity:.6;text-decoration:line-through}
.cma-q__form{flex:1 1 20rem;display:flex;flex-wrap:wrap;gap:.45rem;align-items:center;min-width:0}.cma-q__form .inp{flex:1 1 12rem;min-width:0}
.cma-q__n{width:1.6rem;height:1.6rem;border-radius:50%;display:grid;place-items:center;font-size:.8rem;font-weight:700;background:rgba(255,255,255,.08);flex:none}
.cma-q__move{display:flex;gap:.3rem}
tr.dead td{opacity:.6}
[data-join-to-reply]{margin-top:1rem}
@media (max-width:640px){
  .cmb{flex-wrap:wrap}.cmb .cm-cover--md{width:5rem;height:3.2rem}.cmb__act{width:100%;justify-content:flex-start}
  .cmh{flex-direction:column;align-items:stretch}.cm-cover--hero{width:100%;height:auto;aspect-ratio:16/9}.cmh__act{flex-direction:row;flex-wrap:wrap}
  .cmj__head{flex-direction:column;align-items:flex-start}
  .cmt-grid{grid-template-columns:1fr 1fr;gap:.6rem}.cmt__desc{display:none}
}
.cm-cover-bg{background-size:cover;background-position:center;background-repeat:no-repeat;background-color:#1f2937}
