/* Chat (views/chat.js, chat-thread.js) and meetings (meeting-room.js, views/meeting.js, meet.html). Classes start with
   tchat- (the team's chat) so they never meet the assistant's .chat-* or the support inbox's bubbles. */

.btn--small {
  min-height: 2rem;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-s);
}

/* --- Chat --------------------------------------------------------------------------------------------------- */

/* The page fills the workspace (view--fill, shell.css) with a margin of its own, and the sidebar and conversation take
   all the height left, so the field to write in sits at the bottom. */
.tchat-view {
  padding: var(--space-3);
}

.tchat-view > :not(.tchat):not(:empty) {
  margin-bottom: var(--space-3);
}

.tchat {
  display: grid;
  grid-template-columns: minmax(14rem, 17rem) 1fr;
  gap: var(--space-4);
}

/* The way back from a conversation is a phone's only, and the drawer's button and shade the narrow panel's (drawer.js). */
.tchat .drawer-toggle,
.tchat > .drawer-shade,
.tchat .tchat-back {
  display: none;
}

@media (max-width: 819.98px) {
  .tchat .tchat-back {
    display: inline-flex;
  }

  /* An open conversation has the whole screen (views/chat.js focus, and Support's, views/support.js): no top bar, no
     bottom menu, no page margin, and its field sits on the bottom edge, clear of the home indicator. */
  body.chat-focus .topbar,
  body.chat-focus .bottomnav {
    display: none;
  }

  body.chat-focus .main {
    padding: 0;
  }

  body.chat-focus .tchat-main {
    height: 100dvh;
  }

  body.chat-focus .tchat-compose {
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  }

  /* Bubbles may take most of a phone's width (Jeppe, 2026-11-12). */
  .tchat-view .tchat-msg__main {
    max-width: 80vw;
  }
}

.tchat-main > .drawer-toggle,
.tchat-main > .tchat-back {
  align-self: flex-start;
  margin: var(--space-2);
}

.tchat-main__lead {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  .tchat-side,
  .tchat > .drawer-shade {
    transition: none !important;
  }
}

@media (min-width: 820px) {
  .tchat-view {
    padding: var(--space-4) var(--space-5);
  }

  .tchat {
    flex: 1 1 0;
    min-height: 0;
  }
}

.tchat-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
  padding-right: var(--space-2);
}

.tchat-side__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tchat-side__title h2 {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tchat-side__list {
  display: grid;
  gap: 1px;
  margin: var(--space-1) 0 0;
  padding: 0;
  list-style: none;
}

.tchat-side__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.25rem;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-s);
  color: var(--ink);
  text-decoration: none;
}

.tchat-side__item:hover {
  background: var(--hover);
}

.tchat-side__item.is-current {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.tchat-side__item.is-unread .tchat-side__name {
  font-weight: 700;
}

.tchat-side__item--other {
  color: var(--ink-muted);
}

.tchat-side__hash {
  display: inline-flex;
  justify-content: center;
  width: 1.5rem;
  color: var(--ink-muted);
  font-weight: 700;
}

.tchat-side__hash svg {
  width: 1rem;
  height: 1rem;
}

.tchat-side__name {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* A meeting in the list, with a ⋯ menu (edit, remove) for its host, creator or an admin that shows on hover or focus
   (views/chat.js). */
.tchat-side__row {
  position: relative;
  display: flex;
  align-items: center;
}

.tchat-side__row .tchat-side__item {
  flex: 1;
  min-width: 0;
}

.tchat-side__actions {
  position: absolute;
  right: var(--space-1);
}

.tchat-side__more {
  width: 1.75rem;
  height: 1.75rem;
  background: var(--surface);
  opacity: 0;
}

.tchat-side__row:hover .tchat-side__more,
.tchat-side__more:focus-visible,
.tchat-side__more[aria-expanded='true'] {
  opacity: 1;
}

.tchat-side__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  display: grid;
  min-width: 10rem;
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-raised);
  box-shadow: var(--shadow-2);
}

.tchat-side__menu[hidden] {
  display: none;
}

.tchat-side__choice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tchat-side__choice:hover {
  background: var(--hover);
}

@media (hover: none) {
  .tchat-side__actions {
    position: relative;
  }

  .tchat-side__more {
    opacity: 1;
  }
}

/* Who is in a live meeting, as overlapping faces (views/chat.js). */
.tchat-faces {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.tchat-faces__face {
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.55rem;
  box-shadow: 0 0 0 2px var(--surface);
}

.tchat-faces__face + .tchat-faces__face {
  margin-left: -0.35rem;
}

.tchat-faces__more {
  margin-left: var(--space-1);
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.tchat-live {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--success);
  color: var(--surface);
  font-size: var(--text-xs);
  font-weight: 700;
}

.tchat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.tchat-main__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}

.tchat-main__title h2 {
  margin: 0;
  font-size: var(--text-l);
}

.tchat-main__title p {
  margin: 0;
}

.tchat-main__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* The pinned conversation (views/chat.js): its pin pressed in the header, and a small pin in the list. */
.tchat-main__actions .icon-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

.tchat-side__pin {
  display: inline-flex;
  color: var(--ink-muted);
}

.tchat-side__pin svg {
  width: 0.9rem;
  height: 0.9rem;
}

.tchat-welcome,
.tchat-search {
  margin: auto;
  padding: var(--space-6);
  text-align: center;
}

.tchat-search {
  width: 100%;
  margin: 0;
  overflow-y: auto;
  text-align: left;
}

.tchat-search__list {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.tchat-search__list a {
  display: block;
  padding: var(--space-3);
  border-radius: var(--radius-s);
  color: var(--ink);
  text-decoration: none;
}

.tchat-search__list a:hover {
  background: var(--hover);
}

.tchat-welcome svg {
  width: 3rem;
  height: 3rem;
  color: var(--ink-muted);
}

.tchat-thread {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.tchat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-3) 0;
}

/* Files dragged over the thread, its field included (chat-attach.js). */
.tchat-thread.is-dropping {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
  background: color-mix(in srgb, var(--accent-soft) 40%, transparent);
}

.tchat-messages {
  margin: 0;
  padding: 0 0 var(--typing-room);
  list-style: none;
}

.tchat-empty {
  padding: var(--space-6);
  text-align: center;
}

/* Bubbles (Jeppe, 2026-11-11): others on the left with their picture, the reader's own on the right in the accent. */
.tchat-msg {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) 0;
}

.tchat-msg--follow {
  padding-top: 2px;
}

.tchat-msg--mine {
  justify-content: flex-end;
}

.tchat-msg__avatar,
.tchat-msg__gutter {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
}

/* A bubble is as wide as its words, up to about two thirds of the thread, so the sides stay apparent. */
.tchat-msg__main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: min(34rem, 70%);
}

.tchat-msg--mine .tchat-msg__main {
  align-items: flex-end;
}

.tchat-bubble {
  max-width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-wash);
}

.tchat-msg:not(.tchat-msg--follow) .tchat-bubble {
  border-top-left-radius: var(--radius-s);
}

.tchat-msg--mine .tchat-bubble {
  border-color: transparent;
  border-radius: var(--radius-m);
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

/* White in dark, as the support inbox's own bubbles (support.css .bubble--mine). */
:root[data-theme="dark"] .tchat-msg--mine .tchat-bubble {
  color: var(--ink);
}

.tchat-msg--mine:not(.tchat-msg--follow) .tchat-bubble {
  border-top-right-radius: var(--radius-s);
}

.tchat-bubble .bubble__image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-s);
}

.tchat-msg__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: 2px;
  font-size: var(--text-s);
}

.tchat-msg__head time {
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.tchat-msg__name {
  font-weight: 700;
}

.tchat-msg__foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-1);
  margin-top: 2px;
}

.tchat-msg__edited {
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.tchat-sent {
  display: inline-flex;
  color: var(--ink-muted);
}

.tchat-sent svg {
  width: 1rem;
  height: 1rem;
}

.tchat-seen {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
}

.tchat-seen__face {
  width: 1rem;
  height: 1rem;
  font-size: 0.5rem;
}

.tchat-seen__more {
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.tchat-thread--compact .tchat-msg {
  padding-inline: var(--space-2);
}

.tchat-thread--compact .tchat-msg__avatar,
.tchat-thread--compact .tchat-msg__gutter {
  width: 1.5rem;
  height: 1.5rem;
}

.tchat-thread--compact .tchat-msg__main {
  max-width: 75%;
}

.tchat-msg__guest {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--surface-wash);
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.tchat-msg__body {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.tchat-msg__body--deleted {
  color: var(--ink-muted);
  font-style: italic;
}

.tchat-msg__status {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.tchat-msg__status--failed {
  color: var(--danger);
}

/* Reactions and the writer's edit and delete appear on hover or focus, above the bubble at its outer edge: the left
   for others' messages, the right for one's own. */
.tchat-msg__tools {
  position: absolute;
  top: calc(-1 * var(--space-5));
  left: 0;
  z-index: 1;
  display: none;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface-raised);
  box-shadow: var(--shadow-1);
}

.tchat-msg--mine .tchat-msg__tools {
  right: 0;
  left: auto;
}

.tchat-msg:hover .tchat-msg__tools,
.tchat-msg:focus-within .tchat-msg__tools {
  display: flex;
}

.tchat-msg__quick {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
}

.tchat-msg__quick:hover {
  background: var(--hover);
}

.tchat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.tchat-reaction {
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-s);
  cursor: pointer;
}

.tchat-reaction.is-mine {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tchat-msg__editing {
  display: grid;
  gap: var(--space-1);
}

.tchat-meeting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-wash);
}

.tchat-meeting__text {
  flex: 1;
  min-width: 0;
}

.tchat-meeting svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent-text);
}

.tchat-compose {
  position: relative;
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-top: 1px solid var(--line);
}

/* A reply's quote (chat-thread.js): the answered message's writer, the start of its text and its file, in the answer's
   bubble and above the field while it is written. It is a card in Miira's look (Jeppe, 2026-11-13): the surface with a
   thin line and the card radius, so it stands out from the green of one's own bubble and the grey of others'. Lys and
   Mørk put it on Miira's 3D shelf (components.css). */
.tchat-quote {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  margin: 0 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-s);
  line-height: 1.35;
  text-align: left;
}

button.tchat-quote {
  cursor: pointer;
}

button.tchat-quote:hover {
  border-color: var(--line-hover);
}

.tchat-quote__main {
  display: block;
  flex: 1;
  min-width: 0;
}

.tchat-quote__name {
  display: block;
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tchat-quote__text {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tchat-quote__file {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  color: var(--ink-muted);
}

.tchat-quote__file .ui-icon {
  flex: none;
}

.tchat-quote__file-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tchat-quote__file-size {
  flex: none;
  font-size: var(--text-xs);
}

.tchat-quote__thumb {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-s);
  object-fit: cover;
}

.tchat-quote--deleted .tchat-quote__text {
  font-style: italic;
}

.tchat-reply {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  color: var(--ink-muted);
}

.tchat-reply .tchat-quote {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--ink);
}

/* The original a quote was clicked on, marked for a moment. */
.tchat-msg.is-flash .tchat-bubble {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tchat-compose__row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.tchat-compose__input {
  flex: 1;
  min-height: 2.5rem;
  max-height: 10rem;
  resize: none;
}

.tchat-people {
  display: grid;
  gap: var(--space-1);
  max-height: 18rem;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.tchat-people__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
}

.tchat-people__row .btn {
  margin-left: auto;
}

.tchat-choice {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.tchat-choice__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

@media (max-width: 819.98px) {
  .tchat {
    grid-template-columns: 1fr;
    height: auto;
  }

  /* On a phone the list is the page while no conversation is open, and an open one is the page in its place, with its
     way back (Jeppe, 2026-11-13; views/chat.js): the drawer's open class says which, as in the narrow panel. */
  .tchat--drawer-open > .tchat-main,
  .tchat:not(.tchat--drawer-open) > .tchat-side {
    display: none;
  }

  .tchat-side {
    padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
    overflow: visible;
  }

  /* On a phone the open conversation is the page itself, edge to edge with no card around it (Jeppe, 2026-11-12). */
  .tchat-view {
    padding: 0;
  }

  .tchat-main {
    height: calc(100dvh - 10.5rem - env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
  }
}

/* --- Meetings ------------------------------------------------------------------------------------------------- */

.meeting-host {
  height: 100%;
}

.meeting {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-3);
  height: calc(100dvh - 8rem - env(safe-area-inset-bottom));
  min-height: 26rem;
}

.meet-page .meeting {
  height: calc(100dvh - 2 * var(--space-4));
}

.meeting-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.meeting-head h1 {
  margin: 0;
  font-size: var(--text-xl);
}

.meeting-recording {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: var(--surface);
  font-size: var(--text-xs);
  font-weight: 700;
}

.meeting-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  min-height: 0;
}

.meeting-view {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  min-height: 0;
  padding: var(--space-3);
  border-radius: var(--radius-m);
  background: #111418;
  overflow: hidden;
}

.meeting-banner {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-s);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: var(--text-s);
}

.meeting-start-audio {
  align-self: center;
}

.meeting-stage {
  position: relative;
  flex: 3;
  min-height: 0;
}

.meeting-stage__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.meeting-stage__label {
  position: absolute;
  bottom: var(--space-2);
  left: var(--space-2);
  margin: 0;
  padding: 0 var(--space-2);
  border-radius: var(--radius-s);
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  font-size: var(--text-s);
}

/* The grid fits its tiles: one fills the view, more share it in rows; beside a shared screen it is a strip. */
.meeting-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  grid-auto-rows: minmax(8rem, 1fr);
  gap: var(--space-2);
  min-height: 0;
}

.meeting-stage:not([hidden]) + .meeting-grid {
  flex: 1;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  grid-auto-rows: 7rem;
  overflow-y: auto;
}

.meeting-tile {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: var(--radius-m);
  background: #232830;
}

.meeting-tile.is-speaking {
  border-color: var(--success);
}

.meeting-tile__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meeting-tile__photo {
  width: 4.5rem;
  height: 4.5rem;
  font-size: var(--text-xl);
}

.meeting-tile__label {
  position: absolute;
  bottom: var(--space-1);
  left: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  max-width: calc(100% - 2 * var(--space-1));
  padding: 0 var(--space-2);
  border-radius: var(--radius-s);
  background: rgb(0 0 0 / 0.6);
  color: #fff;
  font-size: var(--text-s);
}

.meeting-tile__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.meeting-tile__state {
  display: inline-flex;
  gap: var(--space-1);
}

.meeting-tile__state svg {
  width: 1rem;
  height: 1rem;
}

.meeting-tile__hand {
  color: #ffd166;
}

.meeting-tile__weak {
  color: #ffd166;
  font-size: var(--text-xs);
}

.meeting-overflow {
  margin: 0;
  color: #cfd6df;
}

.meeting-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 22rem;
  min-height: 0;
}

.meeting-people,
.meeting-settings,
.meeting-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.meeting-chat {
  flex: 1;
}

.meeting-people {
  max-height: 40%;
  padding: var(--space-3);
  overflow-y: auto;
}

.meeting-people h2,
.meeting-settings h2,
.meeting-chat__title {
  margin: 0;
  font-size: var(--text-m);
}

.meeting-chat__title {
  padding: var(--space-3) var(--space-3) 0;
}

.meeting-settings {
  flex-shrink: 0;
  gap: var(--space-3);
  max-height: 60%;
  padding: var(--space-3);
  overflow-y: auto;
}

.meeting-settings__field {
  display: grid;
  gap: var(--space-1);
}

.meeting-settings__check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.meeting-settings .hint {
  margin: 0;
}

.meeting-people__list {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.meeting-people__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.meeting-people__tools {
  display: flex;
  gap: var(--space-1);
  margin-left: auto;
}

.meeting-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}

.meeting-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--surface-wash);
}

/* A microphone or camera that is off is red, as in other meeting apps; other buttons show only when pressed. */
.meeting-btn.is-off {
  background: var(--danger);
  color: var(--surface);
}

.meeting-btn[aria-pressed="true"] {
  background: var(--accent-soft);
}

.meeting-leave {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-pill);
}

.meeting-leave svg {
  width: 1.25rem;
  height: 1.25rem;
}

.meeting-audio {
  display: none;
}

.prejoin,
.meeting-left,
.meet-guest__card,
.meeting-summary {
  display: grid;
  gap: var(--space-4);
  max-width: 44rem;
  margin: var(--space-6) auto;
  padding: 0 var(--space-4);
}

.prejoin__preview {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: #111418;
  aspect-ratio: 16 / 9;
}

.prejoin__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.prejoin__toggles {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  display: flex;
  gap: var(--space-3);
  transform: translateX(-50%);
}

.prejoin__devices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.prejoin__devices label {
  display: grid;
  gap: var(--space-1);
}

.prejoin__level {
  grid-column: 1 / -1;
  width: 100%;
}

.prejoin__join {
  justify-self: start;
}

.meeting-left {
  justify-items: center;
  text-align: center;
}

.meeting-left svg {
  width: 3rem;
  height: 3rem;
  color: var(--ink-muted);
}

.meeting-left__actions {
  display: flex;
  gap: var(--space-3);
}

.meeting-recording__video {
  width: 100%;
  border-radius: var(--radius-m);
  background: #111418;
}

.meeting-transcript {
  display: grid;
  gap: var(--space-2);
  max-height: 24rem;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.meeting-transcript li {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: var(--space-3);
}

.meeting-summary .meeting-chat {
  min-height: 24rem;
}

.meet-page {
  margin: 0;
  padding: var(--space-4);
  background: var(--bg);
}

@media (max-width: 819.98px) {
  .meeting {
    height: auto;
  }

  .meeting-body {
    grid-template-columns: 1fr;
  }

  .meeting-view {
    min-height: 60vh;
  }

  .meeting-side {
    width: auto;
  }

  .meeting-chat {
    min-height: 20rem;
  }

  .prejoin__devices {
    grid-template-columns: 1fr;
  }
}

/* --- A meeting beside other pages (meeting-dock.js) --------------------------------------------------------------
   Like the assistant's panel: on a wide screen a column at the right of the app grid, left of the assistant when both
   are open, so the page narrows instead of being covered; on a phone a small window above the bottom bar. The room is
   the same element as on the meeting's page, laid out compactly. */
:root {
  --meeting-dock-width: clamp(300px, 24vw, 380px);
}

.meeting-dock {
  position: fixed;
  right: var(--space-2);
  bottom: calc(var(--bottomnav-height, 64px) + var(--space-2) + env(safe-area-inset-bottom));
  z-index: 34;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100vw - 2 * var(--space-2)));
  height: min(60dvh, 30rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.meeting-dock__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-bottom: 1px solid var(--line);
}

.meeting-dock__title {
  flex: 1;
  margin: 0;
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.meeting--docked {
  flex: 1;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--space-2);
  height: auto;
  min-height: 0;
  padding: var(--space-2);
}

.meeting--docked .meeting-head {
  display: none;
}

.meeting--docked .meeting-body {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
}

.meeting--docked .meeting-view {
  padding: var(--space-2);
}

.meeting--docked .meeting-grid,
.meeting--docked .meeting-stage:not([hidden]) + .meeting-grid {
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  grid-auto-rows: 6rem;
  overflow-y: auto;
}

.meeting--docked .meeting-tile__photo {
  width: 2.5rem;
  height: 2.5rem;
  font-size: var(--text-m);
}

.meeting--docked .meeting-side {
  width: auto;
  max-height: 45%;
}

.meeting--docked .meeting-chat {
  min-height: 12rem;
}

/* The panel shows the video or the chat, as its segment toggle says (meeting-dock.js); the room's own chat button
   would only repeat it. */
.meeting-dock__views {
  align-self: stretch;
  justify-self: stretch;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: var(--space-2) var(--space-2) 0;
}

.meeting--docked .meeting-btn--chat,
.meeting--docked .meeting-chat__title,
.meeting--docked[data-dock-view="chat"] .meeting-view {
  display: none;
}

.meeting--docked[data-dock-view="chat"] .meeting-side {
  max-height: none;
}

.meeting--docked[data-dock-view="chat"] .meeting-chat {
  min-height: 0;
}

.meeting--docked .meeting-controls {
  gap: var(--space-1);
}

.meeting--docked .meeting-btn {
  width: 2.5rem;
  height: 2.5rem;
}

/* In the narrow panel the hang-up is a round icon like the buttons beside it; its name stays in aria-label. Only the
   word is hidden: the icon is a span too (dom.js iconOf). */
.meeting--docked .meeting-leave {
  width: 2.5rem;
  height: 2.5rem;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
}

.meeting--docked .meeting-leave__label,
.meeting--docked .meeting-end {
  display: none;
}

@media (min-width: 820px) {
  .app:is(.app--meeting, .app--chat) {
    grid-template-columns: 240px minmax(0, 1fr) var(--meeting-dock-width);
    grid-template-areas: "offline offline offline" "sidebar topbar meeting" "sidebar main meeting";
  }

  .app:is(.app--meeting, .app--chat).app--assistant {
    grid-template-columns: 240px minmax(0, 1fr) var(--meeting-dock-width) var(--ai-panel-width);
    grid-template-areas: "offline offline offline offline" "sidebar topbar meeting assistant" "sidebar main meeting assistant";
  }

  .app--rail-collapsed:is(.app--meeting, .app--chat) {
    grid-template-columns: auto minmax(0, 1fr) var(--meeting-dock-width);
  }

  .app--rail-collapsed:is(.app--meeting, .app--chat).app--assistant {
    grid-template-columns: auto minmax(0, 1fr) var(--meeting-dock-width) var(--ai-panel-width);
  }

  .meeting-dock {
    position: static;
    grid-area: meeting;
    width: auto;
    height: auto;
    min-height: 0;
    border-width: 0 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }
}

/* --- The chat beside other pages (chat-dock.js) ---------------------------------------------------------------------
   The meeting's column (above) on a wide screen; with a meeting there too, one of them shows at a time, as the
   segment control at the column's top says (side-pane.js). A window narrower than that has no room for it: the chat
   waits, still running, until the window is wide again or Chat is opened. */
.chat-dock {
  display: none;
}

@media (min-width: 820px) {
  .chat-dock {
    container: chat-dock / inline-size;
    grid-area: meeting;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border-left: 1px solid var(--line);
    background: var(--surface);
  }

  .chat-dock .tchat-view {
    padding: 0;
  }

  .chat-dock .tchat-view > :not(.tchat):not(:empty) {
    margin: var(--space-2);
  }

  .chat-dock .tchat-side {
    padding: var(--space-2);
  }

  .chat-dock .tchat-main {
    border: 0;
    border-radius: 0;
  }

  /* As on a phone, by the panel's width: the list, or the open conversation with its way back to the list. */
  @container chat-dock (max-width: 34rem) {
    .tchat {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
    }

    .tchat .drawer-toggle,
    .tchat .tchat-back {
      display: inline-flex;
    }

    .tchat--drawer-open > .tchat-main,
    .tchat:not(.tchat--drawer-open) > .tchat-side {
      display: none;
    }
  }
}

.tchat-side__top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tchat-side__top > .input {
  flex: 1;
  min-width: 0;
}

/* Chat or the meeting, when both are in the column (side-pane.js). */
.side-pane__switch {
  align-self: stretch;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: var(--space-2) var(--space-2) 0;
}

/* The chat goes beside the pages on a wide screen only. */
@media (max-width: 819.98px) {
  .tchat-side__beside {
    display: none;
  }
}
