/* Huddles: drop-in audio rooms inside a Clubhouse (assets/js/sections/social-huddle.js). Demo only, no sound.
   Colour keeps its Social meaning: red is live (--shot-live, through the shared live badge and .sc-live-mark), purple is the
   Clubhouse (--accent-purple-text), gold is people (the ring round a speaker), teal is the speaking ring and the main action.
   Tokens only, so Dark, Mixed and Light all follow. No cards: one calm screen, with a hairline only where a list needs one.
   Loaded directly before social-system.css, which owns tabs, chips and the .sc-live-line strip this page reuses. */

/* The shell's "Home > Huddle" crumb is wrong for a page that belongs to Social, and every Huddle page has its own way back. */
#main:has(.sch) .route-breadcrumbs { display:none; }
/* The room fills the screen so its bar sits at the foot. Anything focused scrolls clear of the bar. */
#main:has(.sch-room) { scroll-padding-bottom:168px; }
#main:has(.sch-room) .main-inner { display:flex; flex-direction:column; min-height:100%; padding-bottom:0; }

.sch { width:100%; max-width:720px; margin-inline:auto; gap:var(--s4); padding-block:var(--s2) var(--s6); }
.sch.sch-room { display:flex; flex-direction:column; flex:1 1 auto; padding-bottom:0; }
.sch [data-sch-region]:empty { display:none; }
:is(.sch,.sch-sheet) :is(a,button,[tabindex]):focus-visible { outline:2px solid var(--status-upcoming-text); outline-offset:2px; }

/* Header: the Clubhouse in purple, the title, then Live, Not recorded and the sample count on one quiet line. */
.sch-head { display:grid; grid-template-columns:44px minmax(0,1fr); gap:var(--s1); align-items:start; }
.sch .sch-back { display:grid; place-items:center; width:44px; height:44px; border-radius:50%; color:var(--shot-text); }
.sch .sch-back:hover { background:var(--shot-surface-hover); }
.sch-back svg { width:20px; height:20px; }
.sch-head-main, .sch-list-head { display:grid; gap:var(--s1); min-width:0; }
.sch .sch-club { justify-self:start; display:inline-flex; align-items:center; min-height:44px; color:var(--accent-purple-text);
  font-size:var(--fs-small); font-weight:700; line-height:1.3; text-decoration:none; overflow-wrap:anywhere; }
.sch .sch-club:hover { text-decoration:underline; }
.sch .sch-title { margin:0; color:var(--shot-text); font-family:var(--font-heading); font-size:var(--fs-xl); font-weight:700; line-height:1.2; overflow-wrap:anywhere; }
.sch .sch-topic { color:var(--shot-text-secondary); font-size:var(--fs-small); line-height:1.45; overflow-wrap:anywhere; }
.sch .sch-meta { display:flex; flex-wrap:wrap; align-items:center; gap:var(--s1) var(--s3); color:var(--shot-text-secondary); font-size:var(--fs-caption); line-height:1.4; }
:is(.sch,.sch-sheet) :is(.sch-demo,.sch-quiet,.sch-more) { color:var(--shot-text-secondary); font-size:var(--fs-caption); line-height:1.5; }
.sch .sch-note { padding-left:var(--s3); border-left:3px solid var(--status-upcoming-text); color:var(--shot-text); font-size:var(--fs-small); line-height:1.5; }
:is(.sch,.sch-sheet) .sch-sec { display:grid; gap:var(--s2); min-width:0; }
:is(.sch,.sch-sheet) .sch-h { margin:0; color:var(--shot-text-secondary); font-family:var(--font-body); font-size:var(--fs-caption); font-weight:700;
  line-height:1.3; letter-spacing:.06em; text-transform:uppercase; }

/* People. A speaker is a picture with a gold ring, a name and, for the people running the room, a role tag. */
.sch-stage { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--s3) var(--s1); margin:0; padding:0; list-style:none; }
.sch-crowd { display:flex; flex-wrap:wrap; gap:var(--s2); margin:0; padding:0; list-style:none; }
.sch-stage > li, .sch-crowd > li { min-width:0; }
.sch-person { position:relative; display:grid; justify-items:center; align-content:start; gap:var(--s1); width:100%; min-width:44px; min-height:44px; padding:var(--s1);
  border:0; border-radius:var(--r-md); background:transparent; color:var(--shot-text); font:inherit; text-align:center; }
button.sch-person { cursor:pointer; }
button.sch-person:hover { background:var(--shot-surface-hover); }
.sch-pic { position:relative; display:block; }
.sch-face { display:grid; place-items:center; width:60px; height:60px; border-radius:50%; overflow:hidden; background:var(--shot-surface-light); color:var(--shot-text);
  font:700 var(--fs-body)/1 var(--font-heading); }
.sch-face img { display:block; width:100%; height:100%; object-fit:cover; }
.sch-pic .sch-face { box-shadow:0 0 0 2px var(--shot-gold); }
.sch-name { max-width:100%; font-size:var(--fs-caption); font-weight:600; line-height:1.25; overflow-wrap:anywhere; }
.sch-person.sch-person--sm { width:auto; gap:2px; padding:0; }
.sch-person.sch-person--sm .sch-face { width:44px; height:44px; box-shadow:none; font-size:var(--fs-small); }

/* The small marks on a picture: muted, speaking, hand raised. Each has an icon, so none relies on colour alone. */
.sch-mark { position:absolute; display:grid; place-items:center; width:22px; height:22px; border-radius:50%; box-shadow:0 0 0 2px var(--shot-background); }
.sch-mark svg { width:12px; height:12px; }
.sch-mark--mic { right:-4px; bottom:-4px; background:var(--shot-surface-light); color:var(--shot-text); }
.sch-mark--talk { display:none; right:-4px; bottom:-4px; background:var(--shot-teal); color:#000; }
.sch-mark--hand { right:-4px; top:-4px; background:var(--shot-teal); color:#000; }

/* Whoever is speaking wears a teal ring. It pulses, and stays still for anyone who asks for less motion. */
.sch-person[data-speaking] .sch-pic .sch-face { box-shadow:0 0 0 3px var(--status-upcoming-text); }
.sch-person[data-speaking] .sch-pic::after { content:''; position:absolute; inset:-7px; border:2px solid var(--status-upcoming-text); border-radius:50%; opacity:.45; pointer-events:none; }
.sch-person[data-speaking] .sch-mark--talk { display:grid; }
.sch-person[data-speaking] .sch-mark--mic { display:none; }
@media (prefers-reduced-motion:no-preference) { .sch-person[data-speaking] .sch-pic::after { animation:sch-ring 1.6s ease-out infinite; } }
@keyframes sch-ring { 0% { transform:scale(.9); opacity:.7; } 100% { transform:scale(1.12); opacity:0; } }

/* Joining, and the Clubhouse Code shown in place the first time. */
.sch-gate, .sch-code { display:grid; gap:var(--s3); justify-items:start; }
.sch-code .scr-code-rules { justify-self:stretch; }
.sch-stop { align-content:start; }
.sch-center { display:flex; justify-content:center; }

/* Captions: sample lines only, marked as sample. */
.sch-caps { display:grid; gap:var(--s2); margin-top:var(--s2); padding-left:var(--s3); border-left:3px solid var(--shot-border); }
.sch .sch-caps-tag { color:var(--shot-text-secondary); font-size:var(--fs-caption); font-weight:700; line-height:1.4; }
.sch .sch-caps-line { color:var(--shot-text); font-size:var(--fs-small); line-height:1.5; }
.sch-caps-who { display:block; color:var(--shot-text-secondary); font-size:var(--fs-caption); font-weight:700; }
.sch .sch-foot { margin:0; }

/* The bar at the foot: what this person can do, then the four reactions. */
.sch-bar { position:sticky; bottom:0; z-index:3; margin-top:auto; padding:var(--s2) 0 calc(var(--s2) + env(safe-area-inset-bottom,0px));
  background:var(--shot-background); border-top:1px solid var(--shot-border); }
.sch-bar > [data-sch-region] { display:grid; gap:var(--s1); }
.sch-bar-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--s2); }
.sch-ctls { display:flex; flex-wrap:wrap; gap:var(--s2); }
.sch .sch-ctl { position:relative; flex-direction:column; gap:2px; min-width:64px; min-height:56px; padding:var(--s1) var(--s2); font-size:var(--fs-caption); letter-spacing:0; }
.sch-ctl-n { position:absolute; top:-6px; right:-6px; min-width:20px; height:20px; padding:0 5px; border-radius:var(--r-full); background:var(--shot-teal); color:#000;
  font:700 var(--fs-caption)/20px var(--font-body); }
.sch-reacts { display:flex; gap:var(--s1); }
.sch-react { display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:50%; background:var(--shot-surface); color:var(--shot-text);
  box-shadow:inset 0 0 0 1px var(--shot-border); font-size:var(--fs-xl); line-height:1; cursor:pointer; }
.sch-react:hover { background:var(--shot-surface-hover); }
/* Reactions float up from the bar for a moment. With less motion they simply show and go. */
.sch-floats { position:absolute; left:0; right:0; bottom:100%; height:0; pointer-events:none; }
.sch-float { position:absolute; bottom:var(--s1); font-size:var(--fs-2xl); line-height:1; }
@media (prefers-reduced-motion:no-preference) { .sch-float { animation:sch-float 1.6s ease-out forwards; } }
@keyframes sch-float { 0% { transform:translateY(0) scale(.8); opacity:0; } 15% { opacity:1; } 100% { transform:translateY(-140px) scale(1.15); opacity:0; } }

/* The list: Live now reuses the Clubhouse page's live line; Starting soon is a title, one line and a Remind me switch. */
.sch-club-name { color:var(--accent-purple-text); font-weight:700; }
.sch .sch-live-list { margin:0; }
.sch-soon-list { display:grid; margin:0; padding:0; list-style:none; }
.sch-soon { display:grid; gap:2px; padding-top:var(--s2); border-top:1px solid var(--shot-border); }
.sch-soon:first-child { padding-top:0; border-top:0; }
.sch-soon strong { font-weight:700; line-height:1.3; overflow-wrap:anywhere; }
.sch-soon small { color:var(--shot-text-secondary); font-size:var(--fs-caption); line-height:1.5; overflow-wrap:anywhere; }
.sch-soon .w-toggle-row { min-height:44px; border-bottom:0; }

/* Sheets: a person, Manage, the room log and Start a Huddle. Rows come from the shared list row. */
.sch-sheet { gap:var(--s4); max-width:none; padding-block:0; }
.sch-who { display:flex; align-items:center; gap:var(--s3); }
.sch-who .sch-face { flex:none; width:56px; height:56px; box-shadow:0 0 0 2px var(--shot-gold); }
.sch-who > div { display:grid; gap:2px; min-width:0; }
.sch-who > div > strong { font-family:var(--font-heading); font-size:var(--fs-body); line-height:1.3; overflow-wrap:anywhere; }
.sch-who > div > span { color:var(--shot-text-secondary); font-size:var(--fs-caption); line-height:1.4; }
.sch-rows { display:grid; }
:is(.sch-rows,.sch-hands) .sch-face { flex:none; width:36px; height:36px; font-size:var(--fs-caption); }
.sch-hands { display:grid; gap:var(--s2); margin:0; padding:0; list-style:none; }
.sch-hands li { display:flex; align-items:center; gap:var(--s2); min-height:44px; }
.sch-hands-name { flex:1 1 auto; min-width:0; font-size:var(--fs-small); font-weight:600; overflow-wrap:anywhere; }
.sch-room-acts { display:flex; flex-wrap:wrap; gap:var(--s2); }
.sch-log { display:grid; margin:0; padding:0; list-style:none; }
.sch-log li { display:flex; justify-content:space-between; gap:var(--s3); padding:var(--s2) 0; border-bottom:1px solid var(--shot-border); font-size:var(--fs-small); line-height:1.4; }
.sch-log li:last-child { border-bottom:0; }
.sch-log time { flex:none; color:var(--shot-text-secondary); font-size:var(--fs-caption); }
.sch-sheet .sch-error { color:var(--shot-error-text); font-size:var(--fs-small); line-height:1.4; }
.sch-sheet .sch-error:empty { display:none; }
.sch-busy { display:grid; gap:var(--s1); }

/* Phones: the bar runs edge to edge. Wider screens: bigger pictures, and the room stays in the Social column. */
@media (max-width:767px) {
  .sch-bar { margin-inline:calc(-1 * var(--s3)); padding-inline:var(--s3); }
  .sch-bar-row { justify-content:center; }
}
@media (min-width:768px) {
  .sch .sch-title { font-size:var(--fs-2xl); }
  .sch-stage { grid-template-columns:repeat(auto-fill,minmax(112px,1fr)); }
  .sch-pic .sch-face { width:72px; height:72px; }
  .sch-person.sch-person--sm .sch-pic .sch-face { width:44px; height:44px; }
}
