/*
 * Drop-in Space — front-end styles.
 *
 * Two things this file is careful about, both learned the hard way.
 *
 * It declares its own font stack and sizes rather than inheriting. A plugin
 * that inherits typography looks different on every site it is installed on,
 * and on a theme that sets a monospace or display face for its content area
 * it looks broken.
 *
 * Key rules double the root class (.ds-root.ds-root) to raise specificity.
 * A theme selector like `.entry-content h3` or `.content button` otherwise
 * beats a single-class rule and the interface comes apart — buttons stop
 * looking like buttons, headings resize, controls fall back to browser
 * defaults. Doubling costs nothing and settles it.
 */

/* ===================================================== width and wrapper */

.ds-wrap { margin: 1.5rem 0; }

/*
 * Wide and full break out of a narrow theme column — but the amount they can
 * pull out is measured in JavaScript, not assumed here.
 *
 * The obvious CSS trick (left:50% + translateX(-50%)) centres the element on
 * its PARENT. In a theme whose content column is not itself centred — one
 * with a sidebar, say — that throws the whole thing off the left edge of the
 * window. CSS cannot see where the parent sits in the viewport, so the pull
 * is computed from the real geometry and clamped to what is actually there.
 *
 * Until that runs, and if scripting is off, the space simply fills its column.
 * Narrow but correct is the right way to fail.
 */
.ds-wrap { max-width: none; }

/* ============================================================== the root */

.ds-root {
  /* colour, rewritten per theme at runtime */
  --ds-accent: #2f5fa8;
  --ds-accent-ink: #fff;
  --ds-live: #14683f;
  --ds-live-bg: #e8f3ed;
  --ds-danger: #b02a30;
  --ds-ink: #1a1d23;
  --ds-dim: #5f6773;
  --ds-line: #d9dde3;
  --ds-paper: #fff;
  --ds-soft: #f1f3f6;
  --ds-shadow: 0 1px 2px rgba(16, 20, 28, .06), 0 4px 14px rgba(16, 20, 28, .05);

  --ds-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --ds-radius: 10px;
}

.ds-root.ds-root {
  font-family: var(--ds-font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  font-style: normal;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ds-ink);
}

.ds-root *, .ds-root *::before, .ds-root *::after { box-sizing: border-box; }
.ds-root :focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.ds-root [hidden] { display: none !important; }

/* ========================================================== the layout */

/*
 * On a wide screen the call takes the room it needs and presence + notes sit
 * beside it. Stacked below 60rem, with the call first — it is the thing
 * people came for.
 */
.ds-root { container-type: inline-size; container-name: ds; }
.ds-root .ds-layout { display: grid; gap: 1rem; grid-template-columns: 1fr; }

/* Older browsers without container queries fall back to the window width. */
@supports not (container-type: inline-size) {
  @media (min-width: 62rem) {
    .ds-w-wide .ds-root .ds-layout,
    .ds-w-full .ds-root .ds-layout {
      grid-template-columns: minmax(0, 1.55fr) minmax(19rem, 1fr);
      align-items: start;
    }
  }
}

.ds-root .ds-main, .ds-root .ds-side { min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }

/* ========================================================== typography */

.ds-root.ds-root .ds-h {
  font-family: var(--ds-font);
  font-size: 1.3rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 0;
  padding: 0;
  color: var(--ds-ink);
  text-transform: none;
}
.ds-root.ds-root .ds-sub {
  font-family: var(--ds-font);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ds-dim);
  margin: 0.4rem 0 0;
  padding: 0;
}
.ds-root.ds-root p { font-size: 1rem; margin: 0 0 0.7rem; padding: 0; }
.ds-root.ds-root p:last-child { margin-bottom: 0; }
.ds-root .ds-muted { color: var(--ds-dim); font-size: 0.92rem; }
.ds-root .ds-small { font-size: 0.82rem; }
.ds-root .ds-error { color: var(--ds-danger); font-size: 0.9rem; font-weight: 500; }
.ds-root .ds-notice {
  font-size: 0.82rem; line-height: 1.45; color: var(--ds-dim);
  border-left: 3px solid var(--ds-line); padding-left: 0.8rem; margin-top: 1rem;
}

.ds-root .ds-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem;
}
.ds-root .ds-me { color: var(--ds-dim); font-size: 0.85rem; }

.ds-root .ds-card {
  background: var(--ds-paper);
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  padding: 1rem;
}
.ds-root .ds-desc {
  background: var(--ds-paper); border: 1px solid var(--ds-line);
  border-left: 4px solid var(--ds-accent); border-radius: 8px;
  padding: 0.85rem 1rem; margin-bottom: 0.9rem; font-size: 0.96rem;
}
.ds-root .ds-desc a { color: var(--ds-accent); }
.ds-root .ds-desc ul, .ds-root .ds-desc ol { margin: 0.4rem 0 0.4rem 1.2rem; padding: 0; }
.ds-root.ds-root .ds-desc h3, .ds-root.ds-root .ds-desc h4 {
  font-size: 1rem; font-weight: 650; margin: 0.3rem 0 0.4rem; font-family: var(--ds-font);
}
.ds-root .ds-hours { font-weight: 600; font-size: 0.9rem; }

/* ============================================ buttons and form controls */

.ds-root.ds-root .ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-family: var(--ds-font);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  text-decoration: none;
  letter-spacing: normal;
  cursor: pointer;
  min-height: 2.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--ds-line);
  border-radius: 8px;
  background: var(--ds-paper);
  color: var(--ds-ink);
  box-shadow: 0 1px 1px rgba(16, 20, 28, .04);
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.ds-root.ds-root .ds-btn:hover { background: var(--ds-soft); border-color: #c3c9d2; }
.ds-root.ds-root .ds-btn:active { transform: translateY(1px); }
.ds-root.ds-root .ds-btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; transform: none; }

.ds-root.ds-root .ds-primary {
  background: var(--ds-accent); color: var(--ds-accent-ink); border-color: var(--ds-accent);
}
.ds-root.ds-root .ds-primary:hover { background: var(--ds-accent); border-color: var(--ds-accent); filter: brightness(1.08); }

.ds-root .ds-chip .ds-mini {
  border: 0; background: transparent; color: var(--ds-dim);
  min-width: 1.3rem; min-height: 1.3rem; padding: 0 0.15rem; font-size: 0.75rem;
  opacity: 0; width: 0; overflow: hidden; transition: opacity .12s ease;
}
@media (hover: none) {
  /* No hover to reveal them on a touch screen, so they stay visible. */
  .ds-root .ds-chip .ds-mini { opacity: 0.55; width: auto; }
}
.ds-root .ds-chip:hover .ds-mini,
.ds-root .ds-chip:focus-within .ds-mini { opacity: 0.75; width: auto; }
.ds-root .ds-chip .ds-mini:hover { opacity: 1; color: var(--ds-ink); background: var(--ds-line); }

.ds-root.ds-root .ds-mini {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--ds-font); font-size: 0.8rem; font-weight: 600; line-height: 1;
  cursor: pointer; min-height: 1.75rem; min-width: 1.9rem;
  padding: 0.3rem 0.5rem; border: 1px solid var(--ds-line);
  border-radius: 6px; background: var(--ds-soft); color: var(--ds-ink);
}
.ds-root.ds-root .ds-mini:hover { background: var(--ds-paper); border-color: #c3c9d2; }
.ds-root input.ds-minsbox { width: 4rem; text-align: center; }

.ds-root.ds-root input[type="text"], .ds-root.ds-root input[type="password"],
.ds-root.ds-root input[type="number"], .ds-root.ds-root select, .ds-root.ds-root textarea {
  font-family: var(--ds-font);
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 400;
  color: var(--ds-ink);
  background: var(--ds-paper);
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--ds-line);
  border-radius: 8px;
  max-width: 100%;
  box-shadow: none;
}
.ds-root.ds-root textarea { width: 100%; resize: vertical; min-height: 4.5rem; display: block; }
.ds-root.ds-root input:focus, .ds-root.ds-root textarea:focus, .ds-root.ds-root select:focus {
  border-color: var(--ds-accent); outline: 2px solid color-mix(in srgb, var(--ds-accent) 28%, transparent);
  outline-offset: 0;
}
.ds-root .ds-descedit { width: 100%; }

.ds-root .ds-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.ds-root .ds-toolbar { gap: 0.4rem; }
.ds-root .ds-toolbar .ds-btn { flex: 1 1 auto; min-width: 8.5rem; }
.ds-root.ds-root .ds-btn.ds-locked { border-color: #9a6327; background: #fcf7f0; color: #7d4f18; }
.ds-root .ds-label { font-size: 0.82rem; font-weight: 600; color: var(--ds-dim); }

/* ============================================================= the gate */

.ds-root .ds-gate { max-width: 26rem; box-shadow: var(--ds-shadow); }
.ds-root .ds-form { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.9rem; }
.ds-root .ds-field { display: flex; flex-direction: column; gap: 0.3rem; }
.ds-root .ds-field input { width: 100%; }
.ds-root .ds-details summary { cursor: pointer; color: var(--ds-dim); font-size: 0.88rem; }
.ds-root .ds-details input { margin-top: 0.4rem; width: 100%; }

/* =========================================================== presence */

.ds-root .ds-presence { display: flex; gap: 0.75rem; align-items: flex-start; }
.ds-root .ds-presence.busy { background: var(--ds-live-bg); border-color: #bfd8ca; }
.ds-root .ds-pulse {
  width: 0.6rem; height: 0.6rem; border-radius: 50%;
  background: var(--ds-dim); flex: none; margin-top: 0.42rem;
}
.ds-root .ds-presence.busy .ds-pulse { background: var(--ds-live); }
.ds-root .ds-presence-body { flex: 1; min-width: 0; }
.ds-root .ds-who-line { font-weight: 600; font-size: 0.95rem; }
.ds-root .ds-who { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }

.ds-root .ds-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; line-height: 1.3;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  border-radius: 999px; background: var(--ds-soft); border: 1px solid var(--ds-line);
  max-width: 100%;
}
.ds-root .ds-presence.busy .ds-chip { background: var(--ds-paper); }
.ds-root .ds-chip.host { border-color: #c3d2ea; background: #eef3fb; }
.ds-root .ds-av {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 700; color: #fff; background: #6b7280;
  overflow: hidden; object-fit: cover; font-family: var(--ds-font);
}
.ds-root .ds-tag { color: var(--ds-dim); font-size: 0.72rem; font-weight: 400; }

/* ====================================================== banner and door */

.ds-root .ds-banner {
  border-left: 4px solid var(--ds-live); background: var(--ds-live-bg);
  border-color: #bfd8ca; font-size: 0.93rem; padding: 0.8rem 1rem;
}
.ds-root .ds-banner.quiet {
  border-left-color: var(--ds-line); background: var(--ds-paper); color: var(--ds-dim);
}
.ds-root .ds-door { font-size: 0.93rem; padding: 0.85rem 1rem; }
.ds-root .ds-door.shut { border-left: 4px solid #9a6327; background: #fcf7f0; }
.ds-root .ds-knock {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  padding: 0.55rem 0 0.2rem; border-top: 1px solid var(--ds-line); margin-top: 0.6rem;
}
.ds-root .ds-knock-who { font-weight: 700; }
.ds-root .ds-waitrow {
  display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; padding: 0.3rem 0 0.4rem;
}
.ds-root .ds-told { font-size: 0.85rem; color: var(--ds-live); font-weight: 600; margin-right: 0.3rem; }

/* ============================================================== notes */

.ds-root .ds-notes-scroll { display: flex; flex-direction: column; gap: 0.55rem; }

.ds-root .ds-note {
  background: var(--ds-paper); border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius); padding: 0.75rem 0.85rem;
}
.ds-root .ds-note-head {
  display: flex; gap: 0.45rem; align-items: baseline; font-size: 0.8rem; margin-bottom: 0.3rem;
}
.ds-root .ds-note-name { font-weight: 700; }
.ds-root .ds-note-name.host { color: var(--ds-accent); }
.ds-root .ds-when { color: var(--ds-dim); }
.ds-root .ds-note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.95rem; }
.ds-root.ds-root .ds-del {
  margin-left: auto; background: none; border: 0; color: var(--ds-dim);
  cursor: pointer; font-size: 0.78rem; font-family: var(--ds-font); padding: 0.1rem 0.3rem;
  font-weight: 500;
}
.ds-root .ds-del:hover { color: var(--ds-danger); }
.ds-root .ds-empty {
  text-align: center; color: var(--ds-dim); padding: 1.6rem 1rem; font-size: 0.92rem;
  border: 1px dashed var(--ds-line); border-radius: var(--ds-radius);
}

.ds-root .ds-reacts { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.5rem; align-items: center; }
.ds-root.ds-root .ds-react {
  font-family: var(--ds-font); font-size: 0.82rem; line-height: 1; cursor: pointer;
  padding: 0.3rem 0.5rem; border: 1px solid var(--ds-line);
  border-radius: 999px; background: var(--ds-soft); color: var(--ds-ink);
  min-height: 1.75rem; display: inline-flex; align-items: center;
}
.ds-root .ds-react.on { border-color: var(--ds-accent); background: #e9effa; font-weight: 700; }
.ds-root .ds-react .ds-n { font-size: 0.74rem; color: var(--ds-dim); margin-left: 0.25rem; }
.ds-root .ds-addreact { opacity: 0.6; }
.ds-root .ds-addreact:hover { opacity: 1; }
.ds-root .ds-picker { display: inline-flex; gap: 0.25rem; }

/* ====================================================== the call stage */

.ds-root #ds-call { container-type: inline-size; container-name: dscall; }

.ds-root .dc-stage {
  position: relative; background: #0f1218; border-radius: 12px; overflow: hidden;
  border: 1px solid #0b0e13;
}
.ds-root .dc-grid { display: grid; gap: 2px; grid-template-columns: 1fr; padding: 2px; }
.ds-root .dc-grid[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.ds-root .dc-grid[data-n="3"], .ds-root .dc-grid[data-n="4"] { grid-template-columns: repeat(2, 1fr); }
.ds-root .dc-grid[data-n="many"] { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }

.ds-root .dc-tile {
  position: relative; background: #171b22; border-radius: 8px; overflow: hidden;
  aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center;
}
.ds-root .dc-grid[data-n="1"] .dc-tile { aspect-ratio: 16 / 9; }
.ds-root .dc-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ds-root .dc-tile.dc-local video { transform: scaleX(-1); }
/* visibility, not display: WebKit will not decode or start playback on a
   display:none video, and can leave it at zero size when later revealed. */
.ds-root .dc-tile.dc-novideo video { visibility: hidden; }
.ds-root .dc-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.ds-root .dc-tile.dc-novideo .dc-pic { display: block; }
.ds-root .dc-tile.dc-novideo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(transparent 50%, rgba(0, 0, 0, .6));
}
.ds-root .dc-name {
  position: absolute; left: 0.5rem; bottom: 0.45rem; right: 0.5rem; z-index: 2;
  color: #fff; font-size: 0.78rem; font-weight: 600; font-family: var(--ds-font);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ds-root .dc-recbanner {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.8rem;
  background: rgba(176, 42, 48, .95); color: #fff;
  font-weight: 600; font-size: 0.85rem; position: relative; z-index: 3;
}
.ds-root .dc-recdot {
  width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #fff; flex: none;
  animation: ds-blink 1.6s ease-in-out infinite;
}
.ds-root .dc-rectime { margin-left: auto; font-weight: 400; font-variant-numeric: tabular-nums; }
@keyframes ds-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* --- the control bar, in the shape people know from meeting apps ------- */

.ds-root .dc-controls {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 0.6rem; flex-wrap: wrap;
  padding: 0.6rem 0.7rem;
  background: #1a1f28; border-radius: 0 0 12px 12px;
  margin-top: -1px;
}
.ds-root .dc-group { display: flex; align-items: flex-end; gap: 0.2rem; flex: none; }
/* Leaving sits apart from the controls you use while staying. */
.ds-root .dc-group:last-child { margin-left: 0.5rem; }

/* The reaction tray opens over the video rather than living in the bar —
   six permanent emoji buttons pushed Mute and Leave off the end of it.
   It is anchored to the BAR, not to its own button: centred on a button near
   the left edge it would hang off a narrow screen. */
.ds-root .dc-controls { position: relative; }
.ds-root .dc-reactwrap { display: inline-flex; }
.ds-root .dc-reacts {
  position: absolute; bottom: calc(100% + 0.4rem); left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem; padding: 0.35rem;
  background: #2a313d; border-radius: 1.4rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
  z-index: 5; width: max-content; max-width: min(17rem, 80vw);
}

.ds-root.ds-root .dc-ctl {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.2rem; flex: none;
  min-width: 3.9rem; min-height: 3.1rem;
  padding: 0.4rem 0.5rem;
  font-family: var(--ds-font); font-size: 0.68rem; font-weight: 600; line-height: 1.15;
  text-transform: none; letter-spacing: normal;
  border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: #e8eaef;
  transition: background .12s ease;
}
.ds-root.ds-root .dc-ctl:hover { background: rgba(255, 255, 255, .1); }
.ds-root.ds-root .dc-ctl:disabled { opacity: 0.4; cursor: default; background: transparent; }
.ds-root .dc-ctl svg { width: 1.3rem; height: 1.3rem; display: block; fill: none;
  stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ds-root .dc-ctl .dc-lbl { white-space: nowrap; }

/* A control that is OFF — muted, camera stopped — is the state people most
   need to see at a glance, so it is the one that gets colour. */
.ds-root.ds-root .dc-ctl.off { color: #ffb3b6; }
.ds-root.ds-root .dc-ctl.off:hover { background: rgba(176, 42, 48, .28); }
.ds-root.ds-root .dc-ctl.active { color: #9fd0ff; }
.ds-root.ds-root .dc-ctl.dc-leave { color: #fff; background: var(--ds-danger); }
.ds-root.ds-root .dc-ctl.dc-leave:hover { background: #c7333a; }
.ds-root.ds-root .dc-ctl.dc-rec.on { color: #fff; background: var(--ds-danger); }

.ds-root .dc-micwrap { display: inline-flex; align-items: flex-end; }
.ds-root.ds-root .dc-chev {
  min-width: 1.4rem; min-height: 3.1rem; padding: 0 0.1rem;
  border: 0; background: transparent; color: #aab1bd; cursor: pointer; border-radius: 9px;
}
.ds-root.ds-root .dc-chev:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.ds-root .dc-joinbar {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; padding: 2rem 1rem; text-align: center;
  background: #15191f; border: 1px solid #0f1318; border-radius: 12px;
  min-height: 13rem;
}

.ds-root.ds-root .dc-joinbtn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--ds-font); font-size: 1rem; font-weight: 650; line-height: 1.2;
  padding: 0.8rem 1.6rem; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--ds-live); color: #fff;
}
.ds-root.ds-root .dc-joinbtn:hover { filter: brightness(1.12); }
.ds-root.ds-root .dc-joinbtn:disabled { opacity: 0.5; cursor: default; }
.ds-root .dc-joinbtn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ds-root .dc-joinnote { color: #c9a84c; font-size: 0.85rem; font-weight: 600; }
.ds-root .dc-joinhint { color: #8b93a0; font-size: 0.82rem; max-width: 22rem; }

.ds-root .dc-status { color: var(--ds-dim); font-size: 0.86rem; min-height: 1.1rem; padding: 0.1rem 0; }

.ds-root .dc-picmenu {
  display: flex; gap: 0.4rem; flex-wrap: wrap; padding: 0.6rem;
  background: var(--ds-soft); border: 1px solid var(--ds-line); border-radius: 8px;
}
.ds-root.ds-root .dc-picmenu button {
  font-family: var(--ds-font); font-size: 0.85rem; font-weight: 600; cursor: pointer;
  padding: 0.45rem 0.8rem; border: 1px solid var(--ds-line); border-radius: 7px;
  background: var(--ds-paper); color: var(--ds-ink); min-height: 2.2rem;
}
.ds-root.ds-root .dc-picmenu button:hover { border-color: #c3c9d2; }

.ds-root.ds-root .dc-micpick {
  font-family: var(--ds-font); font-size: 0.85rem; max-width: 14rem;
}

.ds-root.ds-root .dc-react {
  font-family: var(--ds-font); font-size: 1.05rem; line-height: 1;
  min-width: 2.2rem; min-height: 2.2rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: #fff;
}
.ds-root.ds-root .dc-react:hover { background: rgba(255, 255, 255, .2); }

.ds-root .dc-float {
  position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  font-size: 2rem; pointer-events: none; animation: ds-float 2.2s ease-out forwards; z-index: 4;
}
@keyframes ds-float {
  0% { opacity: 0; transform: translate(-50%, 0.6rem) scale(0.7); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -4.5rem) scale(1); }
}

.ds-root .dc-chat {
  border: 1px solid var(--ds-line); border-radius: var(--ds-radius);
  background: var(--ds-paper); padding: 0.65rem;
}
.ds-root .dc-chatlog {
  max-height: 9rem; overflow-y: auto; font-size: 0.9rem;
  display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.5rem;
}
.ds-root .dc-chatlog:empty { display: none; }
.ds-root .dc-line { line-height: 1.4; }
.ds-root .dc-who { font-weight: 700; color: var(--ds-accent); }
.ds-root .dc-line.mine .dc-who { color: var(--ds-dim); }
.ds-root .dc-chatform { display: flex; gap: 0.4rem; }
.ds-root .dc-chatinput { flex: 1; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  .ds-root .dc-float { animation: none; opacity: 1; }
  .ds-root .dc-recdot { animation: none; }
  .ds-root.ds-root .ds-btn { transition: none; }
}

/* ============================================================ dark mode */

@media (prefers-color-scheme: dark) {
  .ds-root {
    --ds-ink: #e8eaef;
    --ds-dim: #9aa2b1;
    --ds-line: #343a45;
    --ds-paper: #1b1f27;
    --ds-soft: #232833;
    --ds-live-bg: #16281f;
    --ds-danger: #e0686e;
    --ds-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
  .ds-root .ds-chip.host { background: #222c3c; border-color: #39506f; }
  .ds-root .ds-door.shut { background: #2a2118; border-left-color: #a97b3c; }
  .ds-root .ds-banner.quiet { background: var(--ds-paper); }
  .ds-root .ds-react.on { background: #22304a; }
  .ds-root.ds-root .ds-btn:hover { background: #2a303c; border-color: #454d5c; }
}

/* ===================================================== container queries ==
 *
 * These sit at the end and mirror the specificity of the rules they override.
 * Both matter: a single `.ds-root` loses to the doubled `.ds-root.ds-root`
 * used elsewhere to outrank theme CSS, and an equal-specificity rule placed
 * earlier in the file loses on source order. Either mistake fails silently.
 *
 * Layout follows the SPACE's width; the call controls follow the width of the
 * COLUMN they sit in, which on a two-column screen is considerably narrower.
 */

@container ds (min-width: 54rem) {
  .ds-root.ds-root .ds-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(19rem, 1fr);
    align-items: start;
  }
  .ds-root.ds-root .ds-notes-scroll { max-height: 34rem; overflow-y: auto; padding-right: 0.2rem; }
  .ds-root.ds-root .dc-joinbar { aspect-ratio: 16 / 9; min-height: 0; }
}

@container dscall (max-width: 34rem) {
  .ds-root.ds-root .dc-ctl { min-width: 3.2rem; padding: 0.35rem 0.25rem; font-size: 0.62rem; }
  .ds-root.ds-root .dc-ctl svg { width: 1.15rem; height: 1.15rem; }
  .ds-root.ds-root .dc-controls { gap: 0.25rem; padding: 0.5rem 0.3rem; }
  .ds-root.ds-root .dc-group { gap: 0.1rem; }
  .ds-root.ds-root .dc-group:last-child { margin-left: 0.2rem; }
}

@container dscall (max-width: 23rem) {
  .ds-root.ds-root .dc-ctl .dc-lbl { display: none; }
  .ds-root.ds-root .dc-ctl { min-width: 2.6rem; min-height: 2.6rem; }
}
