/* Direct messages, notifications and video. Loaded after app.css and built only
   from its variables: no new colours, no new fonts. */

/* The unread count on the Messages tab. client-src/dm.js adds and removes it. */
.dm-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--button); color: var(--button-text);
  font-family: var(--head); font-weight: 800; font-size: 0.7rem; letter-spacing: 0; line-height: 1;
}

/* Messages list and the New message page */
.dm-head { margin-bottom: 10px; }
.dm-head h1 { margin: 0; }
.dm-list, .dm-people { padding: 4px 0; }
.dm-list { padding: 4px 16px; }
.dm-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 64px;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line);
}
.dm-row:last-child { border-bottom: 0; }
.dm-row:hover b { text-decoration: underline; text-decoration-color: var(--accent); }
.dm-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.dm-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dm-row-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-row-top .muted { white-space: nowrap; }
.dm-row-snippet { color: var(--muted); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-row.unread .dm-row-snippet { color: var(--text); font-weight: 700; }
.dm-people { margin-top: 8px; }

/* One conversation */
.dm-with { margin-bottom: 12px; }
.dm-name { display: inline; margin: 0; font: 700 1.05rem/1.3 var(--body); text-transform: none; letter-spacing: 0; color: var(--text); }
.dm-thread { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.dm-msg {
  max-width: 86%; padding: 10px 14px 4px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card);
}
.dm-msg.theirs { align-self: flex-start; }
.dm-msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent-soft); }
.dm-msg .att { margin-top: 6px; min-width: min(64vw, 300px); }
.dm-msg .body + .att { margin-top: 10px; }
.dm-msg-foot { min-height: 28px; display: flex; gap: 14px; align-items: center; justify-content: flex-end; font-size: 0.78rem; color: var(--muted); }
.dm-msg.theirs .dm-msg-foot { justify-content: flex-start; min-height: 0; }
/* --muted is too faint on the tinted bubble. */
.dm-msg.mine .dm-msg-foot, .dm-msg.mine .att-meta, .dm-msg.mine .rec-details,
.dm-msg.mine .dm-msg-foot button.link.danger { color: var(--muted-strong); }
.dm-msg-foot button.link.danger { font-size: 0.78rem; min-height: 44px; margin: -8px -8px -8px 0; }

/* Notifications card */
.push-card h2 { margin-bottom: 4px; }
.push-card .row { margin-top: 10px; }
.push-card .btn { flex: 1 1 auto; }

/* Video recorder */
.vrec { margin-top: 10px; }
/* The message box stays at the foot of the screen while you read back through a conversation. */
.dm-compose { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 10; margin-bottom: 8px; }
/* With the room bar up the box sits directly on it. --ca-bar is the bar's real height, measured
   by client-src/room.js (it includes the home-indicator padding and changes when the bar wraps
   to two lines), so there is no guessed number and no gap for the feed to show through. */
body.has-roombar .dm-compose { bottom: var(--ca-bar, 112px); margin-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }

/* ---- the message box with the software keyboard open ----
   iOS Safari does not shrink the layout viewport for the keyboard, so a box held at the foot of
   that viewport ends up with dead space between it and the keyboard. client-src/keyboard.js
   measures window.visualViewport and writes --ca-kb (the keyboard's height), --ca-vshift (how
   far up the box has to come to sit on top of it), --ca-vvh (the height of what is visible) and
   --ca-compose (the box's own height), and puts kb-open on <html> while the keyboard is up over
   a conversation. Nothing here applies without that class, so every desktop browser, and any
   browser with no visualViewport, keeps the sticky box above. */
html.kb-open .dm-compose,
html.kb-open body.has-roombar .dm-compose {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px;
  /* Flush against the top of the keyboard. No safe-area padding: the keyboard covers it. */
  transform: translateY(calc(-1 * var(--ca-vshift, 0px)));
  /* Above the voice room bar (z-index 40), which the keyboard is covering anyway. */
  z-index: 41; border-radius: 0; padding-bottom: 8px;
  box-shadow: 0 -2px 12px rgba(31, 35, 43, 0.12);
}
/* Room underneath for the box, so the newest message is never behind it. The room bar's own
   space is not kept: it is behind the keyboard until the keyboard goes away. */
html.kb-open body { padding-bottom: calc(var(--ca-kb, 0px) + var(--ca-compose, 72px) + 12px); }
/* The video dock comes up with the box rather than hiding behind the keyboard. */
html.kb-open .vdock { transform: translateY(calc(-1 * var(--ca-vshift, 0px))); }
/* Anything tall inside the box is sized against what is visible, not the whole page. */
html.kb-open .c-gifs-grid { max-height: calc(var(--ca-vvh, 60vh) * 0.38); }
html.kb-open .c-menu { max-height: calc(var(--ca-vvh, 60vh) * 0.62); overflow-y: auto; }
html.kb-open .dm-compose textarea { max-height: calc(var(--ca-vvh, 60vh) * 0.3); }
/* A picture in a message keeps to a sensible size. */
.dm-msg .att.image { min-width: 0; }
.dm-msg .att.image img { max-height: 320px; }
.vrec-view { display: block; width: 100%; max-height: 56vh; max-height: 56dvh; border-radius: var(--radius); background: var(--dark); }
.vrec-view.mirror { transform: scaleX(-1); }
.vrec .row { margin-top: 10px; }
.vrec-note { margin-top: 6px; }

/* ---- spaces ----
   Phone: the Spaces tab opens the list, a space opens its feed, "Spaces" at the top goes back.
   Wide screens: the same list sits beside the feed, so switching is one click. */
.space-list { display: flex; flex-direction: column; }
.card.space-list { padding: 4px 16px; }
.space-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line);
}
.space-row:last-child { border-bottom: 0; }
.space-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.space-row-name { font-weight: 700; overflow-wrap: anywhere; }
.space-row:hover .space-row-name { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.space-row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.82rem; color: var(--muted-strong); }
.in-voice { display: inline-flex; align-items: center; gap: 8px; }
.in-voice .dot { width: 8px; height: 8px; }
.new-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.space-title { margin-top: 0; overflow-wrap: anywhere; }
.space-title .badge, .space-row .badge { letter-spacing: 0.08em; }
.h-sub { font-weight: 400; color: var(--muted-strong); white-space: nowrap; }
.space-side { display: none; }
@media (min-width: 900px) {
  .spaces .main { max-width: 940px; }
  .space-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
  .space-side {
    display: block; position: sticky; top: 72px; max-height: calc(100vh - 88px); max-height: calc(100dvh - 88px); overflow-y: auto;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 6px 6px;
  }
  .space-side h2 { margin: 0 10px 6px; font-size: 0.72rem; font-weight: 400; letter-spacing: 0.1em; color: var(--muted-strong); }
  .space-side .space-row { min-height: 44px; padding: 8px 10px; border-bottom: 0; border-radius: 8px; border-left: 3px solid transparent; font-size: 0.95rem; }
  .space-side .space-row-name { font-weight: 400; }
  .space-side .space-row.unread .space-row-name { font-weight: 700; }
  .space-side .space-row:hover { background: var(--bg); }
  .space-side .space-row[aria-current] { background: var(--accent-soft); border-left-color: var(--accent); }
  .space-side .space-row[aria-current] .space-row-name { font-weight: 700; }
  .space-back { display: none; }
}

/* The room bar says which space's room you are in. The name gets the room; "with ..." gives way first. */
.roombar .label { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.roombar .who-in { flex: 0 1 auto; max-width: 40%; }
@media (min-width: 641px) {
  .roombar .inner { max-width: 940px; }
  .roombar .label { flex: 0 1 auto; }
  .roombar .who-in { max-width: 30%; }
}

/* ---- pictures in posts, comments and messages ----
   A picture sits in the page and does nothing until it is tapped. A tap puts "zoomed" on the box
   around it (client-src/app.js) and it covers the screen, still inside the page: nothing
   navigates and the browser's own full screen is never asked for, so the app is still there
   underneath and one more tap, Escape or a tap outside closes it. */
.att.image a, .att.image .att-zoom { display: block; width: 100%; padding: 0; border: 0; background: none; text-decoration: none; cursor: zoom-in; }
.att.image img { display: block; max-width: 100%; max-height: 70vh; max-height: 70dvh; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); }
.att.image.zoomed {
  position: fixed; inset: 0; z-index: 70; margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--dark); padding: calc(8px + env(safe-area-inset-top)) 0 calc(8px + env(safe-area-inset-bottom));
}
.att.image.zoomed .att-zoom { width: auto; cursor: zoom-out; }
/* Named twice on purpose: a picture in a message has its own smaller height further up. */
.att.image.zoomed img, .dm-msg .att.image.zoomed img {
  max-width: 100%; max-height: calc(100vh - 56px); max-height: calc(100dvh - 56px);
  border: 0; border-radius: 0; background: transparent;
}
.att.image.zoomed::after {
  content: "Tap anywhere to close"; position: absolute; left: 0; right: 0;
  bottom: calc(10px + env(safe-area-inset-bottom)); text-align: center;
  color: var(--nav-quiet); font-size: 0.8rem; pointer-events: none;
}
.att.file { font-size: 0.92rem; }

/* ---- profiles ---- */
img.avatar { object-fit: cover; background: var(--line); }
.avatar-link { display: inline-flex; flex: none; text-decoration: none; border-radius: 50%; }
.who-name { text-decoration: none; }
.who-name:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.who-sub { overflow-wrap: anywhere; }
.profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.profile-top .avatar, .profile-pic .avatar { width: 72px; height: 72px; font-size: 1.3rem; }
.profile-name { display: inline; margin: 0; font: 700 1.2rem/1.3 var(--body); text-transform: none; letter-spacing: 0; color: var(--text); overflow-wrap: anywhere; }
.profile-headline { margin: 2px 0 0; color: var(--muted-strong); }
.profile-actions { margin-top: 14px; }
.profile-pic { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; }
.profile-pic .status { flex: 1 1 100%; margin: 0; }
.profile-pic .status:empty { display: none; }
.admin .table input.tiny { min-width: 0; width: 4.5em; flex: none; }
.admin .table input { margin: 0; padding: 6px 8px; min-width: 150px; }

/* Safety: report links, the rules page, blocks, the admin member page. Variables from app.css only. */
a.link.quiet, button.link.quiet {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; margin: 0 -8px 0 0;
  color: var(--muted); font-size: 0.85rem; font-weight: 400; text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit;
}
a.link.quiet:hover, a.link.quiet:focus-visible, button.link.quiet:hover, button.link.quiet:focus-visible { color: var(--dark); text-decoration: underline; text-decoration-color: var(--accent); }
.dm-msg-foot a.link.quiet { font-size: 0.78rem; }
.dm-msg.mine a.link.quiet { color: var(--muted-strong); }
.profile-block { margin-top: 10px; }
.rules-body { margin: 12px 0 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.rules-body p:last-child { margin-bottom: 0; }
.card.narrow.rules { max-width: 620px; }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; min-height: 44px; cursor: pointer; }
label.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.plain-list { list-style: none; margin: 0 0 12px; padding: 0; }
.plain-list li { display: flex; align-items: center; gap: 14px; min-height: 44px; border-bottom: 1px solid var(--line); }
.admin textarea.rules-edit { width: 100%; min-height: 260px; font: inherit; }
.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }
.danger-zone ul { margin: 6px 0 12px; padding-left: 20px; }
.report-excerpt { margin: 4px 0 0; padding-left: 10px; border-left: 3px solid var(--line-strong); color: var(--muted-strong); white-space: normal; }
.admin .table td.wrap-ok { white-space: normal; min-width: 220px; }

/* ---- voice rooms: waiting, video, and the list beside the room ---- */
.in-voice[hidden] { display: none; }
/* Waiting, not connected: a hollow dot. The filled green one means a live connection. */
.dot.wait { background: transparent; border: 2px solid var(--muted); }
.roombar .dot.wait { border-color: var(--nav-quiet); }
.inroom.waiting .participants li { background: var(--bg); }
.room-page .controls .btn { flex: 1 1 auto; }

/* Pictures. Cameras share a grid, a shared screen takes the full width above them. */
/* A tile takes the shape of the picture in it (client-src/room.js sets --vw and --vh from the
   video's own size), so a portrait phone picture is drawn whole in a tall box. object-fit is
   contain, never cover: cover is what cut the top of a face off when a portrait picture was
   drawn into a wide box. A very tall picture is held to most of the screen's height, and the
   box narrows with it, so it never grows past what a phone can show. */
.vstage { position: relative; display: grid; grid-template-columns: 1fr; gap: 8px; justify-items: center; }
.vtile {
  position: relative; background: var(--dark); border-radius: var(--radius); overflow: hidden;
  width: 100%; aspect-ratio: var(--vw, 3) / var(--vh, 4); max-height: min(66vh, 66dvh, 640px);
}
.vtile[data-shape="landscape"] { max-height: none; }
.vtile[data-shape="portrait"] { width: min(100%, calc(min(66vh, 66dvh, 640px) * var(--vw, 3) / var(--vh, 4))); }
.vtile video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--dark); }
.vtile.mine.camera video { transform: scaleX(-1); } /* your own camera reads like a mirror */
/* Your own picture while someone else is on camera: a small inset in the corner, like a video call.
   Alone, it is the full-size picture, so you can see what you are sending. */
.vstage:has(.vtile.camera:not(.mine)) .vtile.mine.camera {
  position: absolute; right: 8px; bottom: 8px; z-index: 2; width: 28%; max-width: 120px; max-height: none;
  border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: 0 2px 10px rgba(31, 35, 43, 0.4);
}
.vstage:has(.vtile.camera:not(.mine)) .vtile.mine.camera .vname { display: none; }
.vtile.screen { grid-column: 1 / -1; aspect-ratio: auto; max-height: none; }
.vtile.screen video { object-fit: contain; max-height: 68vh; }
.vtile.placeholder { aspect-ratio: auto; min-height: 56px; }
.vtile .vname {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 2px 8px; border-radius: 999px;
  background: rgba(31, 35, 43, 0.78); color: #ffffff; font-size: 0.78rem; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vtile.placeholder .vname { position: static; display: inline-block; margin: 14px 12px; background: transparent; white-space: normal; }
.vtile .vbig {
  position: absolute; right: 8px; top: 8px; min-height: 32px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--button); background: var(--button); color: var(--button-text);
  font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem;
}
[data-stage-slot]:empty { display: none; }

/* The dock: the pictures follow you while you read and post elsewhere. Above the room bar. */
.vdock {
  position: fixed; right: 12px; bottom: calc(var(--ca-bar, 112px) + var(--ca-compose, 0px) + 10px); z-index: 39; width: min(46vw, 220px);
  background: var(--dark); border-radius: var(--radius); padding: 6px; box-shadow: 0 6px 22px rgba(31, 35, 43, 0.3);
}
.vdock .vstage { gap: 6px; max-height: 46vh; overflow-y: auto; }
.vdock .vtile { max-height: 30vh; }
.vdock .vtile[data-shape="portrait"] { width: min(100%, calc(30vh * var(--vw, 3) / var(--vh, 4))); }
.vdock .vtile.screen video { max-height: 30vh; }
.vdock .vbig { display: none; }
.vdock-toggle {
  display: block; width: 100%; min-height: 32px; margin: 0 0 6px; padding: 0 10px; cursor: pointer;
  background: transparent; color: #ffffff; border: 1px solid var(--nav-line); border-radius: 999px;
  font-family: var(--head); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem;
}
.vdock [data-dock-body][hidden] + *, .vdock-toggle:last-child { margin-bottom: 0; }
@media (min-width: 641px) {
  .vdock { width: 300px; }
}
/* A phone in a room: one or two pictures across, never a wall of thumbnails. */
@media (max-width: 640px) {
  .sheet-panel .vtile.screen video { max-height: 50vh; }
}
/* Someone is waiting in the room: the Join button is lit, the dot stays hollow until it connects. */
.room-banner.waiting .go { background: var(--button); border-color: var(--button); }
.room-banner.waiting .dot { background: transparent; border: 2px solid var(--muted); }

/* A pinned post's label, above the author line. */
.pinned-note { margin: 0 0 8px; }

/* ---- the features of 2026-11-28 ---- */
/* Palette and type from app.css only: no new colours and no emoji anywhere. Phone first. */

/* Like. One word and a number, in the site's own type. There is no reaction set because the
   brand has no emoji and no picked icon set to draw one from. */
button.link.like {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; margin: 0 0 0 -8px;
  background: none; border: 0; cursor: pointer; font-family: var(--head); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-strong); text-decoration: none;
}
button.link.like:hover, button.link.like:focus-visible { color: var(--dark); }
button.link.like.liked { color: var(--dark); font-weight: 700; }
button.link.like .like-n {
  font-family: var(--body); font-size: 0.8rem; letter-spacing: 0; text-transform: none;
  min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
}
button.link.like.liked .like-n { background: var(--accent-soft); border-color: var(--accent-soft); }
button.link.quiet.saved, button.link.quiet.muted-on { color: var(--dark); font-weight: 700; }
.like-form, .save-form { display: inline-flex; }

/* Search, Saved and Mute under a space's name. */
.space-tools { gap: 10px; align-items: center; margin: 0 0 10px; }
.search-form { margin-bottom: 10px; }
.search-hit mark { background: var(--accent-soft); color: var(--text); padding: 0 2px; border-radius: 3px; }
.search-hit .dm-row-snippet { white-space: normal; }

/* "edited", and a mention as a link to the profile. */
.edited { font-style: normal; }
a.mention { text-decoration: none; font-weight: 700; color: var(--dark); background: var(--accent-soft); border-radius: 4px; padding: 0 3px; }
a.mention:hover, a.mention:focus-visible { text-decoration: underline; text-decoration-color: var(--accent); }

/* A comment that answers another one sits under it, once, never deeper. */
.replies { margin: 10px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--line-strong); }
.replies .comment { margin-bottom: 6px; }
.comment.reply { background: var(--bg); }

/* "At 0:42" on a comment: taps back to that moment in the recording. */
button.moment {
  display: inline-flex; align-items: center; min-height: 32px; margin: 2px 0 6px; padding: 0 12px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--accent-soft); color: var(--dark);
  font-family: var(--head); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
}
button.moment:hover, button.moment:focus-visible { border-color: var(--accent); }
.moment-pin { align-self: flex-start; }
.c-moment, .c-reply {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 6px 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.85rem; color: var(--muted-strong);
}
.c-moment [data-moment-text], .c-reply .c-reply-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.att-meta button.skip-back { margin: 0; padding: 0; }

/* The list of names that appears while you type @. Above the box, so a keyboard cannot cover it. */
.c-people {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 5; max-height: 42vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
}
.compose { position: relative; }
button.c-person {
  display: block; width: 100%; min-height: 48px; padding: 0 14px; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: var(--text);
}
button.c-person:last-child { border-bottom: 0; }
button.c-person.on, button.c-person:hover { background: var(--accent-soft); }

/* "Waiting for a teacher" on a feedback post, and the one-time notifications question. */
.waiting-note { margin: 0 0 8px; }
.badge.waiting { border-color: var(--accent); color: var(--dark); }
.notif-form fieldset.plain { border: 0; padding: 0; margin: 0 0 18px; }
.notif-form legend {
  font-family: var(--head); font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  font-size: 0.8rem; color: var(--dark); padding: 0 0 6px;
}
.check.switch { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check.switch:last-child { border-bottom: 0; }
.check.switch input { margin-top: 4px; width: 22px; height: 22px; flex: 0 0 auto; }
.muted.small.block { display: block; }

/* Events. A date, what it is, and the way in. */
.event-when { font-family: var(--head); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; color: var(--dark); }
.event-title { margin: 4px 0 2px; }
.card.event { margin-bottom: 10px; }

/* "Seen" under your own last message, and a quoted message above a reply. */
.dm-seen { font-size: 0.78rem; color: var(--muted); text-align: right; margin: 2px 2px 8px; }
.dm-quote {
  display: block; margin: 0 0 6px; padding: 4px 0 4px 10px; border-left: 3px solid var(--line-strong);
  color: var(--muted-strong); font-size: 0.85rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dm-msg.mine .dm-quote { border-left-color: var(--nav-quiet); color: var(--muted-strong); }
.row.wrap.center { justify-content: center; }

/* The moments marked in one recording, in the order they happen in it. The part of this app
   that is worth more to a singer than a thread of comments. */
.card.moments { margin-bottom: 12px; }
.moment-list { gap: 8px; }
.moment-list button.moment { margin: 0; }
.moment-who { font-family: var(--body); text-transform: none; letter-spacing: 0; color: var(--muted-strong); }
.comment.moment-lit { box-shadow: 0 0 0 2px var(--accent); }

/* Several files on one post: one chip each, above the field. */
.c-attach { display: flex; flex-direction: column; gap: 6px; }
.c-attach-one { display: flex; align-items: center; gap: 8px; min-width: 0; }
.c-attach-one .c-attach-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post .att + .att, .comment .att + .att, .dm-msg .att + .att { margin-top: 8px; }

/* A YouTube link plays where it was pasted, rather than throwing you into the YouTube app. */
.att.youtube { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; margin-top: 10px; border-radius: var(--radius); overflow: hidden; background: var(--dark); }
.att.youtube iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* In a voice room: a video is stopped rather than left to resume over the microphone. */
.att.youtube.yt-quiet::after {
  content: 'Stopped while you are in the voice room'; position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6px 10px; background: rgba(31, 35, 43, 0.82); color: #ffffff; font: 0.78rem/1.4 var(--body);
}

/* A post's own title: what someone scanning the feed reads first. */
.post-title { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.25; text-transform: none; letter-spacing: 0; }
.post-title a { text-decoration: none; color: var(--dark); }
.post-title a:hover, .post-title a:focus-visible { text-decoration: underline; text-decoration-color: var(--accent); }
.search-title { display: block; font-family: var(--head); font-weight: 700; color: var(--dark); }
.c-title { width: 100%; margin: 0 0 8px; }

/* What a lapsed member can do about it, under the sign-in message. */
.denied-help { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.denied-help p { margin: 0 0 8px; }
.denied-help form { margin: 0; }

/* How loud each person is, for this listener only. One hot microphone can be turned down. */
/* Its own row under the name, the full width of the card, so a thumb has the whole screen to
   travel and the slider is not squeezed between a name and a mute label. The touch target is
   48px tall and the knob 34px; the rail is 10px so it reads as a rail you can hit. */
.participants li { flex-wrap: wrap; }
.participants .plevel { flex: 1 1 100%; order: 9; display: flex; align-items: center; gap: 12px; margin: 0; min-height: 48px; }
.participants .plevel-lbl { flex: none; width: 3.6em; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-strong); }
.participants .plevel-val { flex: none; width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.95rem; }
.participants .plevel input[type=range] {
  -webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 0; width: 100%; height: 48px; margin: 0; padding: 0;
  background: transparent; accent-color: var(--accent); touch-action: pan-y; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.participants .plevel input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: var(--line-strong); }
.participants .plevel input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 34px; height: 34px; margin-top: -12px; border-radius: 50%;
  background: var(--accent); border: 3px solid #ffffff; box-shadow: 0 1px 5px rgba(31, 35, 43, 0.45);
}
.participants .plevel input[type=range]::-moz-range-track { height: 10px; border-radius: 999px; background: var(--line-strong); }
.participants .plevel input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); border: 3px solid #ffffff; box-shadow: 0 1px 5px rgba(31, 35, 43, 0.45); }
.participants .plevel input[type=range]:focus-visible { outline: 3px solid var(--button); outline-offset: 2px; border-radius: 8px; }

/* The chat beside a voice room: the space's own messages, drawn as a strip rather than cards. */
.roomchat { margin-top: 12px; }
.roomchat-list { max-height: 46vh; overflow-y: auto; margin: 8px 0 10px; padding-right: 4px; }
.roomchat-msg { padding: 8px 0; border-bottom: 1px solid var(--line); }
.roomchat-msg:last-child { border-bottom: 0; }
.roomchat-who { display: flex; align-items: center; gap: 8px; }
.roomchat-who .avatar { width: 28px; height: 28px; font-size: 0.66rem; }
.roomchat-msg .body { margin-left: 36px; }
.roomchat-msg .body p { margin: 0.2rem 0; }

/* The footer of a post now carries Comment, Like, Save, Reply, Edit, Report, Pin and Delete.
   That is more than fits across a 375px phone, so it wraps: the things you do often on the
   first line, and the rest underneath. The spacer takes a whole line, which is what pushes
   the quieter half down. */
.post-foot { flex-wrap: wrap; row-gap: 0; }
.post-foot .spacer { flex: 1 0 auto; min-width: 12px; }
@media (max-width: 560px) {
  .post-foot { gap: 6px 14px; }
  .post-foot .spacer { flex-basis: 100%; min-width: 0; height: 0; }
}

/* ---- a post and its conversation are one thing ----
   On a post's own page the post, the moments marked in its recording and its comments sit in one
   card. The comments are rows inside it, divided by thin lines, and a reply hangs under its
   comment on a rail. The eye reads one post and then its thread, not four separate cards. */
.thread { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.thread > div > .post.card, .thread > .card.moments { border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.thread > .card.moments { border-top: 1px solid var(--line); background: var(--bg); padding: 12px 16px; }
.thread .comments { margin: 0; border-top: 1px solid var(--line); }
.thread .comments h2 { margin: 0; padding: 12px 16px 6px; }
.thread .comment { background: transparent; border: 0; border-radius: 0; margin: 0; padding: 10px 16px 4px; }
.thread .comments > .comment + .comment { border-top: 1px solid var(--line); }
.thread .comment .post-head { margin-bottom: 4px; }
.thread .comment .body p:first-child { margin-top: 0; }
.thread .comment .post-foot { min-height: 36px; margin: 0 0 0; }
.thread .comment .post-foot .link, .thread .comment .post-foot button { min-height: 36px; }
.thread .replies { margin: 2px 0 6px 15px; padding: 0 0 0 12px; border-left: 2px solid var(--accent-soft); }
.thread .replies .comment, .thread .comment.reply { background: transparent; padding: 8px 0 2px; border-top: 0; }
.thread .replies .comment + .comment { border-top: 1px solid var(--line); }
.thread .comment.moment-lit { box-shadow: inset 3px 0 0 var(--accent); }
.thread .post .post-foot { margin-bottom: -4px; }

/* ---- the box at the foot of a space ----
   Chat spaces and posts spaces both get it. In a chat it ends the conversation, newest message
   just above. In a posts space the feed has no end to put a box after, so it floats over the
   feed instead, and the feed keeps room underneath it. It is the same element as a
   conversation's box (.dm-compose), so client-src/keyboard.js sits it on the iPhone keyboard
   in exactly the same way. */
html:not(.kb-open) .space-bar {
  position: fixed; left: 0; right: 0; margin: 0 auto; width: calc(100% - 24px); max-width: 616px;
  bottom: calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 14px rgba(31, 35, 43, 0.14);
}
/* In a voice room: the box is the top of the room bar, edge to edge, flush with it. */
html:not(.kb-open) body.has-roombar .space-bar {
  bottom: var(--ca-bar, 112px); width: 100%; max-width: 640px; border-radius: 0;
  border-left: 0; border-right: 0; border-bottom: 0;
}
@media (min-width: 641px) { html:not(.kb-open) body.has-roombar .space-bar { max-width: 940px; } }
@media (min-width: 900px) {
  /* Beside the list of spaces: lined up with the feed, not the middle of the screen. */
  html:not(.kb-open) .space-bar { left: calc(50% - 470px + 294px); right: auto; margin: 0; width: 630px; max-width: none; }
  html:not(.kb-open) body.has-roombar .space-bar { left: calc(50% - 470px + 294px); right: auto; margin: 0; width: 630px; max-width: none; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
}
.space-main.has-bar { padding-bottom: calc(var(--ca-compose, 72px) + 28px); }
.chat-thread { margin-bottom: 0; }
/* A title is there when you start writing, not before: the bar is one line at rest. */
html.js .space-bar:not(:focus-within) .c-title { display: none; }
.space-bar .c-title { margin-bottom: 6px; }

/* ---- editing in place ---- */
.inline-edit { margin: 4px 0 6px; gap: 8px; }
.inline-edit textarea, .inline-edit input[type=text] { width: 100%; font-size: 1rem; background: #ffffff; }
.inline-edit textarea { min-height: 84px; resize: none; }
.inline-edit-actions { gap: 8px; }
.inline-edit-actions .btn { min-height: 40px; }
.dm-msg .inline-edit { min-width: min(64vw, 280px); }

/* ---- the voice room join screen: one choice, two big options ---- */
.mode-pick { border: 0; margin: 0; padding: 0; min-width: 0; }
.mode-pick legend { padding: 0; margin: 0 0 8px; font-weight: 700; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-pick legend { grid-column: 1 / -1; }
.mode-opt { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 76px; padding: 12px 14px; border: 2px solid var(--line-strong); border-radius: var(--radius); background: #ffffff; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mode-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mode-name { font-family: var(--head); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; color: var(--dark); }
.mode-note { font-size: 0.85rem; line-height: 1.3; color: var(--muted-strong); }
.mode-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-opt:has(input:checked) .mode-name::before { content: "\2713\00a0"; }
.mode-opt:has(input:focus-visible) { outline: 3px solid var(--button); outline-offset: 2px; }

/* ---- the voice room sheet ----
   The room is not a page. Its controls open as a sheet over the space's own chat, and joining
   closes it again. The room bar (below) brings it back. Without scripts the sheet is shown
   above the chat when the address asks for it. */
.room-sheet:not([data-open]) { display: none; }
.room-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(31, 35, 43, 0.5); }
.sheet-panel {
  position: relative; width: 100%; max-width: 640px; max-height: 88vh; max-height: 88dvh; overflow-y: auto;
  background: var(--card); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(31, 35, 43, 0.25);
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px;
}
.sheet-head h2 { margin: 0; font-size: 0.95rem; letter-spacing: 0.1em; }
.sheet-panel .prejoin, .sheet-panel .inroom { gap: 12px; }
html.room-sheet-open body { overflow: hidden; }
html:not(.js) .room-sheet[data-open] { position: static; display: block; margin-bottom: 12px; }
html:not(.js) .room-sheet .sheet-backdrop { display: none; }
html:not(.js) .sheet-panel { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
@media (min-width: 900px) { .room-sheet { align-items: center; } .sheet-panel { border-radius: 16px; max-width: 520px; } }
/* A banner that now opens the sheet. */
.room-banner[data-room-open] { cursor: pointer; }
/* In that room already: the room bar is where it lives, so the card that invited you in goes. */
.room-banner[hidden] { display: none; }
/* In a comment the actions stay on one row, tight under the words. */
.thread .comment .post-foot { flex-wrap: nowrap; gap: 4px 14px; }
.thread .comment .post-foot .spacer { flex: 1 1 0; min-width: 0; height: auto; }
.thread .comment .post-foot > * { white-space: nowrap; }
.mode-note { text-transform: none; letter-spacing: 0; }
