:root {
  color-scheme: dark;
  --bg: #061014;
  --bg-deep: #03090d;
  --rail: #071119;
  --sidebar: #091722;
  --surface: rgba(12, 28, 39, 0.88);
  --surface-soft: rgba(18, 38, 52, 0.82);
  --surface-strong: rgba(25, 52, 68, 0.92);
  --bubble-own: rgba(10, 80, 94, 0.72);
  --line: rgba(128, 196, 216, 0.18);
  --line-strong: rgba(116, 218, 243, 0.36);
  --text: #eef8fb;
  --text-strong: #ffffff;
  --muted: #8da3ad;
  --muted-2: #5f7783;
  --cyan: #22d3ee;
  --cyan-strong: #11b7d3;
  --green: #7ee45a;
  --blue: #42a5ff;
  --amber: #f6aa2d;
  --purple: #a66cff;
  --danger: #ff5f67;
  --radius: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

/* Action item v0 */
.project-brief-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 10px 22px 0;
  padding: 12px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 10px;
  background: rgba(10, 27, 38, 0.78);
}

.project-brief-panel[hidden] {
  display: none;
}

.project-brief-panel.empty {
  border-style: dashed;
}

.project-brief-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-brief-copy span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-brief-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-brief-copy em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.side-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 15, 23, 0.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.side-tab.active {
  border-color: rgba(34, 211, 238, 0.58);
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}

.side-pane {
  display: none;
  min-height: 0;
}

.side-pane.active {
  display: block;
}

.actions-pane.active {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}

.action-toolbar,
.action-form,
.project-brief-form,
.action-detail {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 18, 27, 0.68);
}

.action-toolbar {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.action-filters,
.action-meta,
.action-caps,
.action-event-foot,
.action-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.action-filters button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 7px;
  background: rgba(3, 9, 13, 0.52);
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.action-filters button.active {
  border-color: rgba(34, 211, 238, 0.52);
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}

.action-form,
.project-brief-form {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.action-form[hidden],
.project-brief-form[hidden],
.action-detail[hidden] {
  display: none;
}

.action-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.action-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(128, 196, 216, 0.18);
  border-radius: 10px;
  background: rgba(8, 23, 33, 0.78);
}

.action-card.selected {
  border-color: rgba(34, 211, 238, 0.68);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.12);
}

.action-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.action-card strong,
.action-detail strong,
.action-event-card strong {
  color: var(--text);
}

.action-card p,
.action-detail p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.action-status {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 850;
}

.action-status.doing {
  background: rgba(66, 165, 255, 0.14);
  color: var(--blue);
}

.action-status.done {
  background: rgba(246, 170, 45, 0.14);
  color: var(--amber);
}

.action-status.confirmed {
  background: rgba(126, 228, 90, 0.14);
  color: var(--green);
}

.action-status.returned {
  background: rgba(255, 95, 103, 0.14);
  color: #ffc2c6;
}

.action-meta,
.action-event-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.action-caps em,
.settlement-chip,
.action-event-foot em {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.09);
  color: var(--cyan);
  font-style: normal;
}

.settlement-chip {
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  color: var(--amber);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-detail {
  display: grid;
  gap: 10px;
  padding: 12px;
  max-height: 42vh;
  overflow: auto;
}

.action-detail-head {
  display: grid;
  gap: 6px;
}

.action-detail-grid {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 4px 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.action-detail-grid dt {
  color: var(--muted-2);
}

.action-detail-grid dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-detail h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 12px;
}

.action-detail ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}

.message-to-action,
.view-action-from-event {
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 7px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 760;
}

.action-event-card {
  display: grid;
  gap: 6px;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 860px) {
  .chat-area {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }

  .project-brief-panel {
    grid-template-columns: 1fr;
    margin: 8px 12px 0;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(3, 9, 13, 0.96);
  }

  .mobile-bottom-nav button {
    min-height: 38px;
    border: 1px solid rgba(128, 196, 216, 0.22);
    border-radius: 9px;
    background: rgba(9, 23, 32, 0.88);
    color: var(--muted);
    font-weight: 820;
  }

  .mobile-bottom-nav button.active {
    border-color: rgba(34, 211, 238, 0.58);
    background: rgba(34, 211, 238, 0.14);
    color: var(--cyan);
  }

  body.mobile-actions-open .room-sidebar,
  body.mobile-actions-open .chat-area {
    display: none;
  }

  body.mobile-actions-open .member-sidebar {
    display: block;
    flex: 1 1 auto;
    width: 100vw;
    max-width: 100vw;
    min-height: 0;
    overflow: auto;
    padding: 12px 12px 70px;
    border: 0;
  }

  body.mobile-actions-open .member-panel {
    min-height: calc(100dvh - 90px);
  }

  body.mobile-actions-open .side-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.mobile-actions-open .actions-pane {
    display: grid;
  }

  body.mobile-actions-open .member-pane {
    display: none;
  }

  .action-detail {
    max-height: none;
  }

  body.has-active-room .composer {
    margin-bottom: 66px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.11), transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(126, 228, 90, 0.08), transparent 30%),
    linear-gradient(135deg, #03080c 0%, #07131a 48%, #050c11 100%);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

h1,
h2,
p {
  margin: 0;
}

.world-shell {
  display: grid;
  grid-template-columns: 340px minmax(620px, 1fr) 350px;
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
  background: rgba(3, 9, 13, 0.6);
}

.world-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(8, 22, 30, 0.95), rgba(3, 9, 13, 0.98)),
    var(--rail);
}

.rail-logo,
.rail-orb,
.rail-add {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(18, 40, 54, 0.94), rgba(8, 20, 29, 0.92));
  color: var(--text);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rail-logo {
  min-height: 60px;
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow:
    0 0 28px rgba(34, 211, 238, 0.18),
    inset 0 0 22px rgba(34, 211, 238, 0.08);
}

.orb-core {
  width: 31px;
  height: 31px;
  border: 2px solid rgba(34, 211, 238, 0.9);
  border-radius: 50%;
  background:
    radial-gradient(circle, #f0feff 0 9%, transparent 10%),
    radial-gradient(circle, rgba(34, 211, 238, 0.68) 0 24%, transparent 25%);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.78);
}

.rail-orb {
  gap: 7px;
  padding: 8px 4px;
  color: var(--muted);
}

.rail-orb.active,
.rail-orb:hover,
.rail-add:hover {
  border-color: rgba(34, 211, 238, 0.62);
  background: linear-gradient(180deg, rgba(19, 53, 68, 0.96), rgba(9, 29, 41, 0.96));
  color: var(--cyan);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.14);
}

.rail-orb.admin {
  color: #fbd37b;
}

.rail-orb em {
  max-width: 100%;
  overflow: hidden;
  color: currentColor;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-glyph {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
}

.rail-glyph.nexus,
.rail-glyph.mesh {
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  border-left-color: transparent;
}

.rail-glyph.crown::before {
  content: "";
  position: absolute;
  inset: 7px 3px 5px;
  background: linear-gradient(135deg, transparent 0 16%, currentColor 17% 34%, transparent 35% 45%, currentColor 46% 64%, transparent 65% 75%, currentColor 76% 100%);
  clip-path: polygon(0 100%, 12% 38%, 34% 62%, 50% 8%, 66% 62%, 88% 38%, 100% 100%);
}

.rail-glyph.mesh::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -13px 3px 0 currentColor, 13px 3px 0 currentColor, 0 -12px 0 currentColor;
}

.rail-glyph.cube {
  border: 2px solid currentColor;
  transform: rotate(45deg) scale(0.82);
}

.rail-glyph.cube::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.rail-glyph.research {
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.rail-glyph.research::before,
.rail-glyph.research::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.rail-glyph.research::before {
  width: 2px;
  height: 24px;
  left: 8px;
  top: 2px;
  transform: rotate(-30deg);
}

.rail-glyph.research::after {
  width: 24px;
  height: 2px;
  left: 1px;
  top: 16px;
  transform: rotate(-30deg);
}

.rail-add {
  min-height: 66px;
  margin-top: 2px;
  color: var(--text);
  font-size: 38px;
  font-weight: 600;
}

.rail-status {
  display: grid;
  grid-template-columns: repeat(3, 6px) 1fr;
  align-items: end;
  gap: 4px;
  width: 86px;
  margin-top: auto;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(10, 23, 32, 0.82);
  color: var(--muted);
  font-size: 11px;
}

.rail-status strong {
  display: block;
  width: 6px;
  border-radius: 6px;
  background: linear-gradient(180deg, #44f3d0, #16a9c7);
}

.rail-status strong:nth-child(1) {
  height: 12px;
}

.rail-status strong:nth-child(2) {
  height: 20px;
}

.rail-status strong:nth-child(3) {
  height: 28px;
}

.room-sidebar,
.member-sidebar {
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(11, 25, 35, 0.94), rgba(6, 15, 22, 0.94)),
    var(--sidebar);
}

.room-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 24px 20px 20px;
}

.member-sidebar {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 16px;
  padding: 24px 20px;
  border-right: 0;
  border-left: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(34, 211, 238, 0.54);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(16, 43, 56, 0.94), rgba(5, 18, 26, 0.92));
  box-shadow:
    0 0 28px rgba(34, 211, 238, 0.12),
    inset 0 0 18px rgba(34, 211, 238, 0.08);
}

.brand-mark .orb-core {
  width: 28px;
  height: 28px;
}

.brand-block h1 {
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 760;
}

.brand-block p,
.hint {
  color: var(--muted);
  font-size: 12px;
}

.start-panel,
.joined-panel,
.member-panel,
.api-panel,
.admin-hall-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(13, 31, 43, 0.88), rgba(9, 23, 33, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.start-panel {
  padding: 12px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(3, 10, 15, 0.72);
}

.mode-tab {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.mode-tab.active {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.11));
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.22);
}

.identity-grid {
  display: grid;
  gap: 10px;
}

.mode-panel {
  display: none;
  margin-top: 10px;
}

.mode-panel.active {
  display: block;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 15, 23, 0.86);
  color: var(--text);
  outline: none;
  padding: 9px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

textarea {
  resize: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#snapshotInput,
#attachmentInput {
  display: none;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.primary-button,
.secondary-button,
.icon-button,
.danger-button,
.close-icon-button,
.search-button,
.tiny-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  border-color: rgba(34, 211, 238, 0.62);
  background: linear-gradient(180deg, #28d4e9, #0797b4);
  color: #041318;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(34, 211, 238, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.secondary-button,
.icon-button,
.search-button,
.tiny-button {
  background: rgba(11, 27, 38, 0.88);
}

.danger-button {
  border-color: rgba(255, 95, 103, 0.34);
  background: rgba(255, 95, 103, 0.1);
  color: #ffc2c6;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.danger-button:hover,
.close-icon-button:hover,
.search-button:hover,
.tiny-button:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.56);
}

.full {
  width: 100%;
}

.joined-panel,
.member-panel,
.api-panel {
  min-height: 0;
  padding: 14px;
}

.joined-panel {
  overflow: hidden;
}

.panel-title,
.room-toolbar,
.toolbar-actions,
.topology-header,
.event-meta {
  display: flex;
  align-items: center;
}

.panel-title,
.room-toolbar,
.topology-header {
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  margin-bottom: 12px;
}

.panel-title h2 {
  color: #d7e8ed;
  font-size: 13px;
  font-weight: 780;
}

.count-badge {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-size: 12px;
  text-align: center;
}

.count-badge.online::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--cyan);
  vertical-align: 1px;
}

.room-list,
.member-list {
  display: grid;
  gap: 10px;
  max-height: 100%;
  overflow: auto;
  padding-right: 2px;
}

.room-row {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 30, 42, 0.82);
  color: var(--text);
  padding: 12px;
  cursor: pointer;
  text-align: left;
}

.room-row.closable {
  padding-right: 42px;
}

.room-row.active {
  border-color: rgba(34, 211, 238, 0.76);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.13), rgba(5, 18, 27, 0.92)),
    rgba(12, 30, 42, 0.88);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);
}

.room-card-close {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255, 95, 103, 0.42);
  border-radius: 7px;
  background: rgba(255, 95, 103, 0.12);
  color: #ffc2c6;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.room-card-close:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 95, 103, 0.72);
  background: rgba(255, 95, 103, 0.2);
}

.room-logo,
.room-icon,
.member-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.11);
  color: var(--cyan);
  font-size: 20px;
  font-weight: 850;
}

.room-logo {
  position: relative;
  overflow: hidden;
  border: 1px solid hsl(var(--room-hue) 84% 62% / 0.58);
  background:
    radial-gradient(circle at 50% 50%, hsl(var(--room-hue) 96% 70% / 0.72), transparent 24%),
    conic-gradient(from 140deg, hsl(var(--room-hue) 92% 62% / 0.9), hsl(calc(var(--room-hue) + 70deg) 86% 58% / 0.62), hsl(var(--room-hue) 92% 62% / 0.9)),
    rgba(8, 25, 34, 0.92);
  color: #f3feff;
  box-shadow: 0 0 18px hsl(var(--room-hue) 90% 56% / 0.22), inset 0 0 18px rgba(255, 255, 255, 0.08);
}

.room-logo.hue-0 { --room-hue: 0deg; }
.room-logo.hue-1 { --room-hue: 30deg; }
.room-logo.hue-2 { --room-hue: 60deg; }
.room-logo.hue-3 { --room-hue: 90deg; }
.room-logo.hue-4 { --room-hue: 120deg; }
.room-logo.hue-5 { --room-hue: 150deg; }
.room-logo.hue-6 { --room-hue: 180deg; }
.room-logo.hue-7 { --room-hue: 210deg; }
.room-logo.hue-8 { --room-hue: 240deg; }
.room-logo.hue-9 { --room-hue: 270deg; }
.room-logo.hue-10 { --room-hue: 300deg; }
.room-logo.hue-11 { --room-hue: 330deg; }

.room-logo::before {
  content: attr(data-initial);
  position: relative;
  z-index: 2;
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.36);
}

.room-logo > span {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  box-shadow: 0 0 18px hsl(var(--room-hue) 92% 70% / 0.46);
}

.room-row strong,
.member-row strong {
  display: block;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-title-line {
  display: flex !important;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 0 !important;
}

.room-title-line strong {
  min-width: 0;
}

.room-title-line.renaming {
  gap: 4px;
  padding-right: 0;
}

.room-name-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  padding: 2px 7px;
  border-color: rgba(34, 211, 238, 0.5);
  border-radius: 6px;
  background: rgba(4, 14, 21, 0.92);
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 760;
}

.room-name-edit {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.room-name-edit:hover {
  border-color: rgba(34, 211, 238, 0.48);
  color: var(--cyan);
}

.room-name-save,
.room-name-cancel {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(128, 196, 216, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.room-name-save {
  border-color: rgba(126, 228, 90, 0.38);
  color: var(--green);
}

.room-name-cancel {
  border-color: rgba(255, 95, 103, 0.32);
  color: #ffc2c6;
}

.room-row span,
.member-row span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(126, 228, 90, 0.72);
}

.room-tags,
.capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.tag,
.capability-list em {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.tag.green {
  background: rgba(126, 228, 90, 0.12);
  color: var(--green);
}

.tag.amber {
  background: rgba(246, 170, 45, 0.13);
  color: var(--amber);
}

.sidebar-service {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(11, 27, 38, 0.8);
}

.sidebar-service div {
  min-width: 0;
}

.sidebar-service span,
.sidebar-service strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-service span {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-service strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.chat-area {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 13, 19, 0.56), rgba(5, 13, 18, 0.92)),
    radial-gradient(circle at 50% 18%, rgba(34, 211, 238, 0.08), transparent 34%);
}

.chat-area.has-meeting {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
}

.room-toolbar {
  min-height: 86px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 9, 13, 0.4);
}

.room-toolbar h2 {
  color: var(--text-strong);
  font-size: 26px;
  font-weight: 820;
}

.room-toolbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.room-invite-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  margin-top: 7px;
  padding: 5px 7px;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 7px;
  background: rgba(34, 211, 238, 0.08);
}

.room-invite-panel[hidden] {
  display: none;
}

.room-invite-panel span,
.room-invite-panel em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.room-invite-panel .room-invite-url {
  max-width: min(420px, 54vw);
  overflow: hidden;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(3, 9, 13, 0.42);
  color: #b8d7df;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-invite-panel strong {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.room-invite-panel .tiny-button {
  min-height: 26px;
  padding: 3px 7px;
  color: var(--cyan);
  font-size: 11px;
}

.toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.danger-button,
.close-icon-button,
.search-button {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 760;
}

.close-icon-button {
  width: 42px;
  padding: 0;
  border-color: rgba(255, 95, 103, 0.42);
  background: rgba(255, 95, 103, 0.11);
  color: #ffc2c6;
  font-size: 24px;
  font-weight: 820;
  line-height: 1;
}

.search-button {
  width: 42px;
  padding: 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.meeting-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 14px;
  margin: 10px 22px 0;
  padding: 12px;
  border: 1px solid rgba(88, 101, 242, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(88, 101, 242, 0.12), rgba(34, 211, 238, 0.06) 42%, rgba(6, 18, 26, 0.9)),
    rgba(8, 20, 29, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.meeting-panel[hidden] {
  display: none;
}

.meeting-panel.disabled {
  background: rgba(13, 30, 41, 0.66);
}

.meeting-panel.active {
  border-color: rgba(34, 211, 238, 0.48);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.08),
    0 16px 34px rgba(0, 0, 0, 0.2);
}

.meeting-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 11px;
  min-width: 0;
}

.meeting-mark {
  grid-row: span 2;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(88, 101, 242, 0.18);
  color: #b8c1ff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.meeting-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-copy em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.meeting-actions button {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.meeting-actions button[hidden] {
  display: none;
}

.meeting-stage {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(148px, 210px) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.meeting-panel:not(.active) .meeting-stage {
  display: none;
}

.meeting-participant-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(128, 196, 216, 0.18);
  border-radius: 10px;
  background: rgba(6, 18, 26, 0.78);
}

.meeting-participant-card.connected,
.meeting-participant-card.speaking {
  border-color: rgba(126, 228, 90, 0.34);
}

.meeting-participant-card.agent {
  border-color: rgba(126, 228, 90, 0.24);
}

.meeting-participant-card.system {
  border-color: rgba(246, 170, 45, 0.26);
}

.meeting-participant-card[hidden] {
  display: none;
}

.meeting-avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
}

.meeting-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(34, 211, 238, 0.5);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(34, 211, 238, 0.28), rgba(88, 101, 242, 0.18));
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.16);
}

.meeting-avatar-wrap .meeting-avatar {
  width: 100%;
  height: 100%;
}

.meeting-mic-toggle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(34, 211, 238, 0.52);
  border-radius: 999px;
  background: rgba(3, 11, 17, 0.96);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.22);
}

.meeting-mic-toggle:disabled {
  opacity: 0.42;
}

.meeting-participant-card.mic-muted .meeting-avatar {
  border-color: rgba(255, 95, 103, 0.76);
  box-shadow: 0 0 0 4px rgba(255, 95, 103, 0.1), 0 0 18px rgba(255, 95, 103, 0.18);
}

.meeting-participant-card.mic-muted .meeting-mic-toggle {
  border-color: rgba(255, 95, 103, 0.58);
  background: rgba(72, 18, 24, 0.98);
  color: #ffc2c6;
}

.meeting-participant-card.speaking .meeting-avatar {
  border-color: rgba(126, 228, 90, 0.78);
  box-shadow: 0 0 0 4px rgba(126, 228, 90, 0.12), 0 0 18px rgba(126, 228, 90, 0.2);
}

.meeting-participant-card.agent .meeting-avatar {
  border-color: rgba(126, 228, 90, 0.58);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.14), transparent 28%),
    linear-gradient(145deg, rgba(126, 228, 90, 0.24), rgba(34, 211, 238, 0.12));
}

.meeting-participant-card.system .meeting-avatar {
  border-color: rgba(246, 170, 45, 0.62);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(246, 170, 45, 0.28), rgba(34, 211, 238, 0.1));
}

.meeting-participant-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.meeting-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.meeting-participant-meta strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-name-edit {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 7px;
  background: rgba(6, 18, 26, 0.76);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.meeting-name-input {
  min-width: 0;
  width: min(150px, 100%);
  height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(34, 211, 238, 0.42);
  border-radius: 7px;
  background: rgba(2, 7, 10, 0.9);
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
}

.meeting-name-input[hidden] {
  display: none;
}

.meeting-participant-meta em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-video,
.remote-video-card video {
  display: none;
  width: 100%;
  height: 100%;
  background: #02070a;
  object-fit: cover;
}

.meeting-video[hidden] {
  display: none !important;
}

.meeting-participant-card.has-video {
  grid-template-columns: 1fr;
  align-items: end;
  min-height: 132px;
  aspect-ratio: 16 / 9;
  padding: 0;
}

.meeting-participant-card.has-video .meeting-video,
.meeting-participant-card.has-video video {
  position: absolute;
  inset: 0;
  display: block;
}

.meeting-expand-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: none;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(238, 248, 251, 0.28);
  border-radius: 8px;
  background: rgba(3, 9, 13, 0.72);
  color: rgba(238, 248, 251, 0.9);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.meeting-participant-card.has-video .meeting-expand-button:not([hidden]) {
  display: grid;
}

.meeting-expand-button:hover,
.meeting-expand-button:focus-visible {
  border-color: rgba(34, 211, 238, 0.72);
  background: rgba(8, 22, 31, 0.9);
  color: var(--cyan);
}

.meeting-participant-card.has-video .meeting-avatar {
  display: none;
}

.meeting-participant-card.has-video .meeting-avatar-wrap {
  display: none;
}

.meeting-participant-card.has-video .meeting-participant-meta {
  display: none;
}

.remote-meeting-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 210px));
  gap: 8px;
  justify-content: start;
  min-width: 0;
}

.meeting-pagination {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.meeting-pagination[hidden] {
  display: none;
}

.meeting-page-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 8px;
  background: rgba(6, 18, 27, 0.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.meeting-page-button.active {
  border-color: rgba(34, 211, 238, 0.62);
  background: rgba(34, 211, 238, 0.14);
  color: var(--cyan);
}

.remote-video-card {
  min-width: 0;
}

.remote-video-card audio {
  display: none;
}

.meeting-maximize-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.92);
}

.meeting-maximize-overlay[hidden] {
  display: none;
}

.meeting-maximize-overlay video {
  width: min(100%, 1920px);
  height: min(100%, 1080px);
  max-width: 100%;
  max-height: 100%;
  background: #000;
  object-fit: contain;
}

.meeting-maximize-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 201;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(238, 248, 251, 0.26);
  border-radius: 50%;
  background: rgba(6, 18, 26, 0.86);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

body.meeting-maximized {
  overflow: hidden;
}

.topology-card {
  margin: 8px 22px 0;
  padding: 8px 14px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 27, 38, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.topology-header strong {
  color: #d7e8ed;
  font-size: 12px;
}

.view-toggles {
  display: flex;
  gap: 5px;
}

.view-toggles span {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 15, 23, 0.64);
}

.view-toggles span.active {
  border-color: rgba(34, 211, 238, 0.58);
  background: rgba(34, 211, 238, 0.12);
}

.topology-strip {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 58px;
  overflow-x: auto;
  padding: 3px 2px 0;
}

.topology-node {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 80px;
  gap: 3px;
  min-width: 80px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.topology-node::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.3), rgba(12, 32, 44, 0.92) 60%),
    rgba(11, 27, 38, 0.9);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.12);
}

.topology-node::after {
  content: attr(data-initial);
  position: absolute;
  top: 16px;
  left: 50%;
  color: var(--cyan);
  font-size: 15px;
  font-weight: 850;
  transform: translate(-50%, -50%);
}

.topology-node.agent::before {
  border-color: rgba(126, 228, 90, 0.54);
  background: radial-gradient(circle, rgba(126, 228, 90, 0.28), rgba(18, 38, 32, 0.92) 62%);
}

.topology-node.agent::after {
  color: var(--green);
}

.topology-node.system::before,
.topology-node.api::before {
  border-color: rgba(246, 170, 45, 0.48);
  background: radial-gradient(circle, rgba(246, 170, 45, 0.24), rgba(42, 30, 13, 0.92) 62%);
}

.topology-node.system::after,
.topology-node.api::after {
  color: var(--amber);
}

.topology-node span {
  overflow: hidden;
  max-width: 76px;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topology-node em {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.topology-line {
  flex: 0 0 34px;
  height: 1px;
  background:
    radial-gradient(circle, rgba(238, 248, 251, 0.85) 0 2px, transparent 3px) left center / 12px 12px no-repeat,
    linear-gradient(90deg, rgba(128, 196, 216, 0.12), rgba(238, 248, 251, 0.56), rgba(128, 196, 216, 0.12));
}

.event-list {
  min-height: 0;
  overflow: auto;
  margin: 8px 22px 8px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 14, 21, 0.48);
}

.event-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(128, 196, 216, 0.12);
}

.event-row:last-child {
  border-bottom: 0;
}

.event-row::before {
  content: attr(data-time);
  color: var(--muted-2);
  font-size: 11px;
}

.event-row > * {
  grid-column: 2;
}

.event-meta {
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.event-meta span:first-child {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-meta span:last-child {
  flex: none;
  color: var(--muted-2);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(66, 165, 255, 0.16);
  color: #83c2ff;
  font-size: 10px;
  font-weight: 850;
  vertical-align: 1px;
}

.role-badge.agent {
  background: rgba(126, 228, 90, 0.14);
  color: var(--green);
}

.role-badge.system {
  background: rgba(246, 170, 45, 0.16);
  color: var(--amber);
}

.event-text,
.system-event {
  margin-top: 4px;
  color: #d5e7ec;
  white-space: pre-wrap;
  word-break: break-word;
}

.system-event {
  color: var(--muted);
  font-size: 13px;
}

.system-event-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 8px;
  vertical-align: baseline;
}

.system-event-actions a {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.system-event-actions a:hover,
.system-event-actions a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.formatted-message {
  position: relative;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid rgba(128, 196, 216, 0.22);
  border-radius: 9px;
  background: rgba(7, 20, 29, 0.86);
}

.formatted-message-header,
.code-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  padding: 6px 8px 6px 10px;
  border-bottom: 1px solid rgba(128, 196, 216, 0.14);
  background: rgba(16, 37, 50, 0.86);
}

.formatted-message-header span,
.code-message-header span {
  min-width: 0;
  overflow: hidden;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-content-button {
  flex: none;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 780;
}

.formatted-message-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.markdown-message-text {
  display: grid;
  gap: 7px;
  color: #d5e7ec;
  white-space: normal;
  word-break: break-word;
}

.markdown-message-text p,
.markdown-message-text ul,
.markdown-message-text ol,
.markdown-message-text blockquote,
.markdown-message-text h1,
.markdown-message-text h2,
.markdown-message-text h3,
.markdown-message-text table {
  margin: 0;
}

.markdown-message-text ul,
.markdown-message-text ol {
  padding-left: 20px;
}

.markdown-message-text li + li {
  margin-top: 3px;
}

.markdown-message-text a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.42);
  text-underline-offset: 3px;
}

.markdown-message-text del {
  color: var(--muted);
}

.markdown-message-text blockquote {
  padding: 7px 10px;
  border-left: 3px solid rgba(34, 211, 238, 0.58);
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.06);
  color: var(--muted);
}

.markdown-heading {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.35;
}

.markdown-message-text code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-size: 0.94em;
}

.markdown-rule {
  width: 100%;
  height: 1px;
  border: 0;
  background: rgba(128, 196, 216, 0.2);
}

.markdown-task {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  color: inherit;
  font: inherit;
}

.markdown-task input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 3px 0 0;
  accent-color: var(--cyan);
}

.mention-highlight {
  display: inline-block;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  font-weight: 800;
}

.markdown-table-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(128, 196, 216, 0.18);
  border-radius: 8px;
  background: rgba(2, 8, 12, 0.66);
}

.markdown-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  padding: 6px 8px 6px 10px;
  border-bottom: 1px solid rgba(128, 196, 216, 0.14);
  background: rgba(16, 37, 50, 0.72);
}

.markdown-table-header span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 850;
}

.markdown-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.markdown-table-block table {
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.markdown-table-block th,
.markdown-table-block td {
  padding: 8px 10px;
  border: 1px solid rgba(128, 196, 216, 0.14);
  white-space: nowrap;
}

.markdown-table-block th {
  color: var(--text-strong);
  font-weight: 850;
}

.markdown-table-block td {
  color: #d5e7ec;
}

.markdown-table-block .align-left {
  text-align: left;
}

.markdown-table-block .align-center {
  text-align: center;
}

.markdown-table-block .align-right {
  text-align: right;
}

.markdown-image-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.06);
  color: var(--text);
  text-decoration: none;
}

.markdown-image-link span {
  display: grid;
  grid-row: span 2;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.14);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.markdown-image-link strong,
.markdown-image-link em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.markdown-image-link em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.markdown-image-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.code-message-block {
  overflow: hidden;
  border: 1px solid rgba(128, 196, 216, 0.18);
  border-radius: 8px;
  background: rgba(2, 8, 12, 0.86);
}

.code-message-block pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  padding: 12px;
}

.code-message-block code {
  color: #d8f7ff;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.message-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 260px));
  gap: 10px;
  margin-top: 8px;
}

.message-attachment {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 29, 40, 0.9);
  color: var(--text);
  overflow: hidden;
  text-decoration: none;
}

.message-attachment.image {
  display: grid;
  width: 100%;
  padding: 0;
  border-color: rgba(128, 196, 216, 0.24);
  cursor: zoom-in;
  text-align: left;
}

.message-attachment.image:hover {
  border-color: rgba(34, 211, 238, 0.54);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.08);
  transform: none;
}

.image-thumb-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(170px, 24vw, 260px);
  padding: 8px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25% 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25% 75%, rgba(255, 255, 255, 0.035) 75%),
    #02070a;
  background-position: 0 0, 10px 10px, 0 0;
  background-size: 20px 20px, 20px 20px, auto;
}

.message-attachment.image img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  border-radius: 6px;
  object-fit: contain;
  background: transparent;
}

.image-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.image-caption strong,
.image-caption em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-caption strong {
  color: var(--text);
  font-weight: 700;
}

.image-caption em {
  color: var(--muted);
  font-style: normal;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  background: rgba(1, 6, 9, 0.9);
  backdrop-filter: blur(18px);
}

.image-preview-overlay[hidden] {
  display: none;
}

.image-preview-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--text);
}

.image-preview-bar strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(128, 196, 216, 0.3);
  border-radius: 8px;
  background: rgba(12, 29, 40, 0.92);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.image-preview-close:hover {
  border-color: rgba(34, 211, 238, 0.58);
  color: var(--cyan);
}

.image-preview-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}

.image-preview-stage img {
  max-width: min(100%, 1400px);
  max-height: calc(100dvh - 106px);
  border: 1px solid rgba(128, 196, 216, 0.24);
  border-radius: 8px;
  background: #02070a;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.48);
  object-fit: contain;
}

.message-attachment.audio {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.message-attachment.audio div,
.message-attachment.file div {
  min-width: 0;
}

.message-attachment.audio strong,
.message-attachment.file strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment.audio span,
.message-attachment.file em {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment.audio audio {
  width: 100%;
}

.message-attachment.audio a {
  color: var(--cyan);
  font-size: 12px;
  text-decoration: none;
}

.message-attachment.file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.message-attachment.file > span,
.pending-attachment > span {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 30px;
  border-radius: 7px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0 22px 14px;
  padding: 12px 14px;
  border: 1px solid rgba(128, 196, 216, 0.44);
  border-radius: 10px;
  background: rgba(8, 22, 31, 0.88);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
}

.composer.dragging {
  outline: 2px solid rgba(34, 211, 238, 0.58);
  outline-offset: -6px;
}

.composer-box {
  display: grid;
  position: relative;
  gap: 8px;
  min-width: 0;
}

.mention-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 45;
  display: grid;
  max-height: min(280px, 44vh);
  overflow: auto;
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(34, 211, 238, 0.36);
  border-radius: 10px;
  background: rgba(5, 16, 24, 0.97);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), 0 0 22px rgba(34, 211, 238, 0.1);
  backdrop-filter: blur(16px);
}

.mention-menu[hidden] {
  display: none;
}

.mention-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.mention-item:hover,
.mention-item.selected {
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(34, 211, 238, 0.11);
}

.mention-item.agent:hover,
.mention-item.agent.selected {
  border-color: rgba(126, 228, 90, 0.32);
  background: rgba(126, 228, 90, 0.1);
}

.mention-item.system:hover,
.mention-item.system.selected {
  border-color: rgba(246, 170, 45, 0.32);
  background: rgba(246, 170, 45, 0.1);
}

.mention-item.offline {
  opacity: 0.62;
}

.mention-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.mention-copy strong,
.mention-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-copy strong {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 840;
}

.mention-copy em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.mention-kind {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(128, 196, 216, 0.12);
  color: var(--muted);
  font-size: 10px;
  font-weight: 860;
  text-transform: uppercase;
  white-space: nowrap;
}

.mention-empty {
  display: grid;
  gap: 3px;
  padding: 10px;
  color: var(--muted);
}

.mention-empty strong {
  color: var(--text-strong);
  font-size: 13px;
}

.mention-empty span {
  font-size: 12px;
}

.composer textarea {
  min-height: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.composer textarea:focus {
  box-shadow: none;
}

.composer-hint {
  color: var(--muted-2);
  font-size: 12px;
}

.composer-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.message-ttl-control {
  display: grid;
  align-items: center;
  gap: 3px;
  min-width: 104px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 840;
  letter-spacing: 0;
}

.message-ttl-control span {
  color: var(--cyan);
}

.message-ttl-control select {
  min-height: 42px;
  padding: 0 28px 0 10px;
  border: 1px solid rgba(128, 196, 216, 0.28);
  border-radius: 9px;
  background: rgba(4, 14, 21, 0.9);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 780;
}

.attach-button,
.mic-button {
  width: 42px;
  padding: 0;
  font-size: 17px;
}

.send-button {
  min-width: 90px;
}

.message-expiry-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 999px;
  background: rgba(251, 113, 133, 0.1);
  color: #fda4af;
  font-size: 10px;
  font-weight: 840;
  white-space: nowrap;
}

.attachment-tray {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.pending-attachment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 29, 40, 0.9);
}

.pending-attachment strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-attachment em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.pending-attachment button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 95, 103, 0.12);
  color: #ffc2c6;
}

.member-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

.member-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  max-height: min(62vh, calc(100dvh - 120px));
  overflow: hidden;
}

.member-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-section + .member-section {
  margin-top: 16px;
}

.member-section-title {
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.member-section-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.8);
}

.member-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  min-height: 36px;
  padding: 5px 8px 5px 5px;
  border: 1px solid rgba(128, 196, 216, 0.12);
  border-radius: 999px;
  background: rgba(12, 29, 40, 0.7);
}

.member-row.offline {
  opacity: 0.62;
}

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 13px;
}

.member-avatar.agent {
  background: rgba(126, 228, 90, 0.12);
  color: var(--green);
}

.member-avatar.system {
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}

.online-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(126, 228, 90, 0.72);
}

.member-row.offline .online-dot,
.room-user-row.offline .user-state-dot {
  background: var(--muted-2);
  box-shadow: none;
}

.member-pagination,
.room-user-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.member-pagination {
  margin-top: 2px;
}

.member-page-button,
.room-user-page-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 8px;
  background: rgba(6, 18, 27, 0.74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.member-page-button.active,
.room-user-page-button.active {
  border-color: rgba(34, 211, 238, 0.62);
  background: rgba(34, 211, 238, 0.14);
  color: var(--cyan);
}

.api-panel {
  flex: none;
}

.tiny-button {
  min-height: 28px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 12px;
}

.api-card {
  display: grid;
  gap: 7px;
}

.api-card code {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(4, 14, 21, 0.72);
  color: #b5cbd2;
  font-size: 12px;
  white-space: nowrap;
}

.api-card code span {
  color: var(--green);
  font-weight: 850;
}

.admin-hall-card {
  padding: 16px;
  border-color: rgba(246, 170, 45, 0.46);
  background:
    radial-gradient(circle at 20% 12%, rgba(246, 170, 45, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(44, 31, 14, 0.92), rgba(11, 24, 33, 0.88));
  box-shadow: 0 0 26px rgba(246, 170, 45, 0.1);
}

.admin-hall-card h2 {
  display: inline-block;
  margin-left: 8px;
  color: #ffd482;
  font-size: 16px;
}

.admin-hall-card p {
  margin: 8px 0 14px;
  color: #d8c39b;
  font-size: 12px;
  text-align: center;
}

.admin-crown {
  color: var(--amber);
  font-size: 24px;
}

.admin-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.admin-feature-grid div {
  display: grid;
  place-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 4px;
  border: 1px solid rgba(128, 196, 216, 0.16);
  border-radius: 8px;
  background: rgba(5, 16, 24, 0.72);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.admin-feature-grid strong {
  color: var(--cyan);
  font-size: 22px;
  line-height: 1;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1280px) {
  body {
    overflow: auto;
  }

  .world-shell {
    grid-template-columns: 310px minmax(0, 1fr);
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .member-sidebar {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 860px) {
  html,
  body {
    min-height: 100dvh;
  }

  body {
    overflow: hidden;
    background: #061014;
  }

  .world-shell {
    display: flex;
    flex-direction: column;
    grid-template-columns: minmax(0, 100vw);
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .room-sidebar,
  .chat-area,
  .member-sidebar {
    grid-column: auto;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .room-sidebar {
    display: block;
    flex: none;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .brand-block {
    min-height: 42px;
    margin-bottom: 10px;
  }

  .brand-mark {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .brand-mark .orb-core {
    width: 22px;
    height: 22px;
  }

  .brand-block h1 {
    font-size: 18px;
  }

  .brand-block p,
  .hint,
  .sidebar-service,
  .member-sidebar,
  .topology-card,
  .search-button,
  #exportRoomButton {
    display: none;
  }

  .start-panel {
    padding: 10px;
  }

  body.has-active-room .start-panel {
    display: none;
  }

  body.has-active-room .room-sidebar {
    padding: 8px 12px;
  }

  body.has-active-room .brand-block {
    display: none;
  }

  .mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-tab[data-mode-tab="admin"] {
    display: none;
  }

  .identity-grid {
    gap: 8px;
  }

  label {
    margin-bottom: 8px;
  }

  input,
  select,
  textarea {
    min-height: 42px;
    font-size: 16px;
  }

  .joined-panel {
    max-height: 108px;
    margin-top: 10px;
    padding: 10px;
  }

  body.has-active-room .joined-panel {
    max-height: 92px;
    margin-top: 0;
    padding: 8px;
  }

  .joined-panel .panel-title {
    margin-bottom: 8px;
  }

  body.has-active-room .joined-panel .panel-title {
    display: none;
  }

  .room-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 2px;
  }

  .room-row {
    flex: 0 0 210px;
    min-height: 68px;
    padding: 10px;
  }

  .room-row .room-tags {
    display: none;
  }

  .chat-area {
    flex: 1 1 auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
  }

  .room-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 12px;
  }

  .room-toolbar h2 {
    font-size: 20px;
  }

  .room-toolbar p {
    display: -webkit-box;
    max-height: 36px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .room-invite-panel {
    width: 100%;
    margin-top: 8px;
  }

  .toolbar-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
  }

  .meeting-panel,
  .event-list,
  .composer {
    margin-left: 12px;
    margin-right: 12px;
  }

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

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

  .meeting-mark {
    grid-row: auto;
    width: max-content;
  }

  .meeting-copy strong,
  .meeting-copy em {
    white-space: normal;
  }

  .meeting-actions {
    justify-content: stretch;
  }

  .meeting-actions button {
    flex: 1 1 44%;
  }

  .meeting-stage {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .remote-meeting-videos {
    grid-template-columns: repeat(auto-fill, minmax(132px, 200px));
  }

  .meeting-participant-card {
    min-height: 74px;
    padding: 10px;
  }

  .meeting-avatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .meeting-avatar-wrap {
    width: 42px;
    height: 42px;
  }

  .meeting-mic-toggle {
    right: -6px;
    bottom: -6px;
    width: 28px;
    height: 22px;
    font-size: 8px;
  }

  .meeting-participant-card.has-video {
    min-height: 118px;
  }

  .event-row {
    grid-template-columns: 1fr;
  }

  .event-row::before,
  .event-row > * {
    grid-column: 1;
  }

  .event-list {
    min-height: 0;
    margin-top: 10px;
    margin-bottom: 10px;
    border-radius: 9px;
  }

  .composer {
    grid-template-columns: 1fr;
    flex: none;
    margin-bottom: 12px;
    padding: 10px;
  }

  .composer textarea {
    min-height: 48px;
  }

  .composer-hint {
    display: none;
  }

  .composer-actions {
    justify-content: stretch;
  }

  .send-button {
    flex: 1;
  }

  .admin-feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Simple chat-first layout */
body {
  overflow: hidden;
}

.world-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.brand-block,
.start-panel,
.sidebar-service,
.member-sidebar,
.room-toolbar,
.meeting-panel,
.topology-card {
  display: none !important;
}

.room-sidebar {
  display: block;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(10, 24, 34, 0.96), rgba(5, 15, 22, 0.96)),
    var(--sidebar);
}

.joined-panel {
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.joined-panel .panel-title {
  display: none;
}

.room-strip {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.room-list {
  display: flex;
  flex: 0 1 auto;
  gap: 10px;
  min-width: 0;
  max-width: calc(100% - 82px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 2px 0;
}

.room-list.empty {
  flex: 0 1 auto;
}

.room-empty {
  display: grid;
  place-items: center;
  min-width: 190px;
  min-height: 72px;
  border: 1px dashed rgba(128, 196, 216, 0.28);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

.room-add-button {
  display: grid;
  place-items: center;
  flex: 0 0 72px;
  width: 72px;
  min-height: 72px;
  border: 1px solid rgba(34, 211, 238, 0.48);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.17), rgba(7, 24, 34, 0.92)),
    rgba(8, 22, 31, 0.9);
  color: var(--cyan);
  font-size: 34px;
  font-weight: 760;
  line-height: 1;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.room-add-button:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.76);
}

.room-status {
  min-height: 18px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-member-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 7px;
  min-width: 0;
  min-height: 32px;
  max-height: 76px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 2px 2px 0;
}

.online-member-strip:empty {
  display: none;
}

.online-member-summary,
.online-member-chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 28px;
  border: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 999px;
  background: rgba(6, 18, 27, 0.78);
}

.online-member-summary {
  gap: 6px;
  padding: 0 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 820;
}

.online-member-summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(126, 228, 90, 0.76);
}

.online-member-chip {
  gap: 6px;
  max-width: 220px;
  padding: 3px 7px 3px 4px;
  color: var(--text);
}

.online-member-chip.own {
  border-color: rgba(34, 211, 238, 0.46);
  background: rgba(34, 211, 238, 0.1);
}

.online-member-chip.agent {
  border-color: rgba(126, 228, 90, 0.28);
}

.online-member-chip.system {
  border-color: rgba(246, 170, 45, 0.3);
}

.online-member-chip.offline {
  opacity: 0.62;
}

.online-member-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.14);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.online-member-chip.agent .online-member-avatar {
  background: rgba(126, 228, 90, 0.13);
  color: var(--green);
}

.online-member-chip.system .online-member-avatar {
  background: rgba(246, 170, 45, 0.14);
  color: var(--amber);
}

.online-member-chip strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-member-chip em {
  color: var(--muted-2);
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}

.member-name-edit,
.member-name-save,
.member-name-cancel {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(128, 196, 216, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.member-name-edit:hover {
  border-color: rgba(34, 211, 238, 0.52);
  color: var(--cyan);
}

.member-name-save {
  border-color: rgba(126, 228, 90, 0.42);
  color: var(--green);
}

.member-name-cancel {
  border-color: rgba(255, 95, 103, 0.36);
  color: #ffc2c6;
}

.member-name-input {
  width: 116px;
  height: 24px;
  min-height: 24px;
  padding: 2px 8px;
  border-color: rgba(34, 211, 238, 0.52);
  border-radius: 999px;
  background: rgba(3, 12, 18, 0.92);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 760;
}

.room-row {
  flex: 0 0 292px;
  min-height: 72px;
  padding: 11px 12px;
  border-radius: 10px;
}

.room-row.closable {
  padding-right: 42px;
}

.room-row .room-logo,
.room-row .room-icon {
  width: 40px;
  height: 40px;
}

.room-row strong {
  font-size: 15px;
}

.room-row span {
  font-size: 12px;
}

.room-row .room-tags {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-height: 24px;
  overflow: hidden;
}

.room-card-copy,
.room-collapse-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 22px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 780;
}

.room-card-copy {
  padding: 1px 8px;
}

.room-collapse-toggle {
  width: 24px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}

.room-collapse-toggle:hover,
.room-collapse-toggle:focus-visible {
  border-color: rgba(34, 211, 238, 0.62);
  background: rgba(34, 211, 238, 0.16);
}

.room-card-close {
  top: 6px;
  right: 6px;
}

.chat-area {
  display: grid;
  grid-row: 2;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.event-list {
  min-height: 0;
  margin: 12px 14px 8px;
  border-radius: 10px;
}

.composer {
  flex: none;
  margin: 0 14px 14px;
}

@media (max-width: 860px) {
  .world-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    max-height: 100dvh;
  }

  .room-sidebar {
    width: 100%;
    max-width: none;
    padding: 10px 12px 8px;
  }

  .joined-panel {
    max-height: none;
    margin-top: 0;
    padding: 0;
  }

  body.has-active-room .joined-panel,
  body.has-active-room .room-sidebar {
    max-height: none;
    padding: 0;
  }

  body.has-active-room .room-sidebar {
    padding: 10px 12px 8px;
  }

  .room-row {
    flex: 0 0 260px;
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 68px;
    padding: 10px;
  }

  .room-row.closable {
    padding-right: 40px;
  }

  .room-row .room-logo,
  .room-row .room-icon {
    width: 36px;
    height: 36px;
  }

  .room-title-line {
    padding-right: 22px;
  }

  .room-title-line.renaming {
    padding-right: 0;
  }

  .room-name-input {
    height: 24px;
    min-height: 24px;
    font-size: 12px;
  }

  .room-name-save,
  .room-name-cancel {
    width: 22px;
    height: 22px;
  }

  .room-row span {
    font-size: 11px;
  }

  .room-card-close {
    top: 7px;
    right: 7px;
    width: 24px;
    height: 24px;
    font-size: 17px;
  }

  .room-add-button {
    flex-basis: 58px;
    width: 58px;
    min-height: 68px;
    font-size: 30px;
  }

  .room-list {
    max-width: calc(100% - 68px);
  }

  .room-card-copy {
    padding: 1px 7px;
  }

  .room-row .tag {
    display: none;
  }

  .room-status {
    display: none;
  }

  .online-member-strip {
    min-height: 30px;
    padding-bottom: 1px;
  }

  .online-member-chip {
    max-width: 220px;
  }

  .member-name-input {
    width: 96px;
  }

  .chat-area {
    width: 100%;
    max-width: none;
  }

  .event-list {
    margin: 10px 12px 8px;
  }

  .composer {
    margin: 0 12px 12px;
  }
}

@media (max-width: 520px) {
  body {
    overflow-x: hidden;
  }

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

  .mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    max-width: 100%;
  }

  .mode-tab[data-mode-tab="admin"] {
    display: none;
  }

  .mode-tab {
    min-width: 0;
    overflow: hidden;
    padding: 0 4px;
    font-size: 12px;
    text-overflow: ellipsis;
  }

  .toolbar-actions {
    display: flex;
    justify-content: flex-end;
  }

  .toolbar-actions button {
    min-width: 0;
  }

  .close-icon-button,
  .search-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
    font-size: 22px;
  }

  .room-invite-panel {
    display: flex;
    grid-template-columns: none;
    gap: 5px;
  }

  .room-invite-panel strong {
    font-size: 16px;
  }

  .room-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .room-dot {
    display: none;
  }

  .message-attachments {
    grid-template-columns: 1fr;
  }

  .image-thumb-frame {
    height: min(62vw, 280px);
  }

  .image-preview-overlay {
    gap: 10px;
    padding: 12px;
  }

  .image-preview-stage img {
    max-height: calc(100dvh - 82px);
  }

  .topology-node {
    flex-basis: 82px;
    min-width: 82px;
  }
}

body {
  overflow: hidden;
}

.world-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.brand-block,
.start-panel,
.sidebar-service,
.member-sidebar,
.meeting-panel,
.topology-card {
  display: none !important;
}

.room-toolbar {
  display: flex !important;
}

.room-sidebar {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(10, 24, 34, 0.96), rgba(5, 15, 22, 0.96)),
    var(--sidebar);
}

.joined-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.joined-panel .panel-title {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.joined-panel .panel-title h2 {
  flex: 0 0 auto;
  min-width: 0;
}

.room-panel-actions {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.room-search {
  display: grid;
  gap: 6px;
  margin: 0;
}

.room-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.room-search input {
  min-height: 38px;
}

.room-bulk-bar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  padding: 2px 3px 2px 7px;
  border: 1px solid rgba(128, 196, 216, 0.16);
  border-radius: 999px;
  background: rgba(3, 12, 18, 0.46);
}

.room-bulk-bar[hidden] {
  display: none;
}

.room-bulk-bar.active {
  border-color: rgba(34, 211, 238, 0.34);
  background: rgba(34, 211, 238, 0.07);
}

.room-bulk-bar span {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 56px;
  overflow: hidden;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-bulk-bar button {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 1px 7px;
  border: 1px solid rgba(128, 196, 216, 0.22);
  border-radius: 999px;
  background: rgba(8, 22, 31, 0.82);
  color: var(--text);
  font-size: 11px;
  font-weight: 780;
}

.room-bulk-bar button:hover:not(:disabled) {
  border-color: rgba(34, 211, 238, 0.56);
  color: var(--cyan);
}

.room-bulk-bar button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.room-bulk-bar button.danger {
  border-color: rgba(255, 95, 103, 0.34);
  background: rgba(255, 95, 103, 0.1);
  color: #ffc2c6;
}

.room-strip {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}

.room-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  max-width: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 2px 2px 0;
}

.room-list.empty {
  display: grid;
}

.room-empty {
  min-width: 0;
  min-height: 96px;
}

.room-add-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 100%;
  min-height: 44px;
  border-radius: 9px;
  font-size: 28px;
}

.room-status {
  min-height: 18px;
  white-space: nowrap;
}

.online-member-strip {
  display: none !important;
}

.room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-height: 0;
  padding: 10px;
  border-radius: 10px;
}

.room-row.selected {
  border-color: rgba(34, 211, 238, 0.82);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.18), 0 0 20px rgba(34, 211, 238, 0.1);
}

.room-row.closable {
  padding-right: 10px;
}

.room-main-line {
  display: grid;
  grid-template-columns: 26px 38px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.room-select-control {
  display: grid !important;
  place-items: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  margin-top: 7px !important;
  overflow: visible !important;
  cursor: pointer;
}

.room-select-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.room-select-control span {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 0 !important;
  overflow: visible;
  border: 1px solid rgba(128, 196, 216, 0.38);
  border-radius: 6px;
  background: rgba(2, 9, 14, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.room-select-control input:checked + span {
  border-color: rgba(34, 211, 238, 0.8);
  background: rgba(34, 211, 238, 0.18);
}

.room-select-control input:checked + span::after {
  content: "";
  width: 9px;
  height: 5px;
  border-bottom: 2px solid var(--cyan);
  border-left: 2px solid var(--cyan);
  transform: rotate(-45deg) translateY(-1px);
}

.room-select-control input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.room-row .room-logo,
.room-row .room-icon {
  width: 38px;
  height: 38px;
}

.room-copy {
  display: grid !important;
  gap: 4px;
  min-width: 0;
  margin-top: 0 !important;
}

.room-title-line {
  padding-right: 0;
}

.room-code-line {
  color: var(--muted);
  font-size: 12px;
}

.room-row .room-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 0;
  margin-top: 2px;
  overflow: visible;
}

.room-card-close {
  position: static;
  width: 25px;
  height: 25px;
}

.room-dot {
  justify-self: center;
  margin: 8px 4px 0 0;
}

.room-user-block {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin-left: 84px;
  overflow: hidden;
}

.room-user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.room-user-list.empty {
  margin-left: 84px;
  color: var(--muted-2);
  font-size: 12px;
}

.room-row .room-user-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  margin-top: 0;
  padding: 3px 7px 3px 4px;
  border: 1px solid rgba(128, 196, 216, 0.14);
  border-radius: 999px;
  background: rgba(3, 12, 18, 0.42);
  overflow: visible;
  white-space: nowrap;
}

.room-row .room-user-row.own {
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(34, 211, 238, 0.08);
}

.room-row .room-user-row.agent {
  border-color: rgba(126, 228, 90, 0.2);
}

.room-row .room-user-row.offline {
  opacity: 0.62;
}

.room-user-row .online-member-avatar {
  display: grid;
  flex: 0 0 22px;
  margin-top: 0;
  overflow: visible;
}

.room-row .room-user-row strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  margin-top: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-row .room-user-row .user-state-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(126, 228, 90, 0.72);
  margin-top: 0;
}

.room-user-pagination {
  min-width: 0;
}

.member-list::-webkit-scrollbar,
.online-member-strip::-webkit-scrollbar,
.room-user-block::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.member-list::-webkit-scrollbar-thumb,
.online-member-strip::-webkit-scrollbar-thumb,
.room-user-block::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(128, 196, 216, 0.45);
  background-clip: padding-box;
}

.member-list::-webkit-scrollbar-track,
.online-member-strip::-webkit-scrollbar-track,
.room-user-block::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
}

.chat-area {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.chat-area.has-meeting {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.room-toolbar {
  min-height: 92px;
  padding: 18px 22px;
}

.toolbar-actions .search-button {
  display: none;
}

.mobile-back-button {
  display: none;
}

.event-list {
  min-height: 0;
  margin: 10px 18px 8px;
}

.composer {
  margin: 0 18px 16px;
}

@media (max-width: 860px) {
  .world-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100dvh;
  }

  .room-sidebar {
    grid-column: 1;
    grid-row: 1;
    height: 100dvh;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 0;
  }

  .joined-panel {
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 8px;
  }

  body.has-active-room .joined-panel,
  body.has-active-room .room-sidebar {
    max-height: none;
    padding: 10px 12px;
  }

  .room-strip {
    grid-template-columns: minmax(0, 1fr) 54px;
    grid-template-rows: auto;
    align-items: start;
    gap: 8px;
    min-height: 0;
  }

  .room-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    max-width: none;
    overflow: auto;
  }

  .room-add-button {
    width: 54px;
    min-height: 92px;
    height: 92px;
    align-self: start;
    font-size: 28px;
  }

  .room-row {
    min-height: 0;
    padding: 10px;
  }

  .room-user-list {
    max-height: 74px;
    overflow: auto;
    margin-left: 46px;
  }

  .chat-area {
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: 100%;
    height: 100dvh;
    display: none;
  }

  body.mobile-chat-open .room-sidebar {
    display: none;
  }

  body.mobile-chat-open .chat-area {
    display: grid;
  }

  .mobile-back-button {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    min-height: 38px;
    margin-right: 8px;
    border: 1px solid rgba(128, 196, 216, 0.22);
    border-radius: 50%;
    background: rgba(8, 22, 31, 0.86);
    color: var(--cyan);
    font-size: 34px;
    line-height: 1;
  }

  .room-toolbar {
    min-height: 78px;
    padding: 12px;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .room-toolbar h2 {
    font-size: 20px;
  }

  .room-toolbar p {
    font-size: 12px;
  }

  .event-list {
    margin: 8px 12px;
  }

  .composer {
    margin: 0 12px 12px;
  }
}

@media (max-width: 520px) {
  .world-shell {
    grid-template-rows: minmax(0, 1fr);
  }

  .room-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .room-invite-panel {
    width: 100%;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr);
  }

  .composer-actions {
    align-items: stretch;
  }

  .message-ttl-control {
    flex: 0 0 116px;
    min-width: 116px;
  }

  .mention-menu {
    bottom: calc(100% + 6px);
    max-height: 38vh;
    padding: 6px;
  }

  .mention-item {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 42px;
    padding: 6px 7px;
  }

  .mention-kind {
    min-width: 38px;
    padding: 0 6px;
    font-size: 9px;
  }

  .send-button {
    flex: 1 1 auto;
  }
}

/* Phase 1: visual semantics and basic IM bubbles. */
.role-badge {
  background: rgba(126, 228, 90, 0.14);
  color: var(--green);
}

.role-badge.agent {
  background: rgba(66, 165, 255, 0.16);
  color: var(--blue);
}

.role-badge.system {
  background: rgba(246, 170, 45, 0.16);
  color: var(--amber);
}

.member-avatar,
.online-member-avatar {
  background: rgba(126, 228, 90, 0.13);
  color: var(--green);
}

.member-avatar.agent,
.online-member-chip.agent .online-member-avatar,
.room-row .room-user-row.agent .online-member-avatar {
  background: rgba(66, 165, 255, 0.14);
  color: var(--blue);
}

.member-avatar.system,
.online-member-chip.system .online-member-avatar,
.room-row .room-user-row.system .online-member-avatar {
  background: rgba(246, 170, 45, 0.14);
  color: var(--amber);
}

.online-member-chip.agent,
.room-row .room-user-row.agent {
  border-color: rgba(66, 165, 255, 0.26);
}

.online-member-chip.system,
.room-row .room-user-row.system {
  border-color: rgba(246, 170, 45, 0.3);
}

.event-list {
  padding: 12px 10px;
  background: var(--bg-deep);
}

.event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: fit-content;
  min-width: min(100%, 230px);
  max-width: min(86%, 760px);
  margin: 0 0 10px;
  padding: 10px 12px 8px;
  border: 1px solid rgba(128, 196, 216, 0.14);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
}

.event-row:last-child {
  border-bottom: 1px solid rgba(128, 196, 216, 0.14);
  margin-bottom: 0;
}

.event-row::before {
  grid-column: 1;
  justify-self: end;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 10px;
}

.event-row > * {
  grid-column: 1;
}

.event-row.own {
  max-width: min(72%, 680px);
  margin-left: auto;
  border-color: rgba(34, 211, 238, 0.28);
  background: var(--bubble-own);
}

.event-row.other {
  margin-right: auto;
}

.event-row.system {
  min-width: 0;
  max-width: min(86%, 620px);
  margin-right: auto;
  margin-left: auto;
  border-color: rgba(246, 170, 45, 0.2);
  background: rgba(246, 170, 45, 0.07);
  text-align: center;
}

.event-row.system::before {
  justify-self: center;
}

.event-row.system .event-meta {
  justify-content: center;
}

.event-row.system .event-meta span:last-child {
  display: none;
}

.event-meta {
  min-width: 0;
}

.event-text,
.formatted-message,
.message-attachments,
.system-event {
  min-width: 0;
}

@media (max-width: 520px) {
  .event-row,
  .event-row.other,
  .event-row.system {
    max-width: 92%;
  }

  .event-row.own {
    max-width: 86%;
  }
}

/* Message search and speaker filters. Kept at the end to override older responsive blocks. */
.chat-area {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.chat-area.has-meeting {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.message-filter-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 48px;
  margin: 10px 18px 0;
  padding: 8px 10px;
  border: 1px solid rgba(128, 196, 216, 0.18);
  border-radius: 10px;
  background: rgba(6, 18, 26, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.message-filter-bar.disabled {
  opacity: 0.58;
}

.message-search-box {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  flex: 1 1 260px;
  gap: 8px;
  min-width: 180px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid rgba(128, 196, 216, 0.16);
  border-radius: 8px;
  background: rgba(3, 11, 17, 0.82);
}

.message-search-box span,
.message-speaker-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  white-space: nowrap;
}

.message-search-box input,
.message-speaker-search input {
  min-width: 0;
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-strong);
  outline: 0;
}

.message-search-count {
  flex: none;
  min-width: 43px;
  color: var(--cyan);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.message-nav-button,
.message-clear-button,
.message-identity-filters button {
  flex: none;
  min-height: 32px;
  border: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 8px;
  background: rgba(9, 24, 34, 0.86);
  color: var(--text);
}

.message-nav-button {
  width: 34px;
  padding: 0;
  color: var(--cyan);
  font-size: 15px;
  font-weight: 850;
}

.message-clear-button {
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.message-identity-filters {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-width: 0;
  padding: 3px;
  border: 1px solid rgba(128, 196, 216, 0.16);
  border-radius: 9px;
  background: rgba(3, 11, 17, 0.54);
}

.message-identity-filters button {
  min-height: 28px;
  padding: 0 9px;
  border-color: transparent;
  color: var(--muted);
  font-size: 12px;
}

.message-identity-filters button.active {
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}

.message-speaker-filter {
  position: relative;
  flex: 0 1 230px;
  min-width: 150px;
}

.message-speaker-filter summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 8px;
  background: rgba(9, 24, 34, 0.86);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.message-speaker-filter summary::-webkit-details-marker {
  display: none;
}

.message-speaker-filter summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.72;
}

.message-speaker-filter[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.message-speaker-filter summary span {
  min-width: 0;
  overflow: hidden;
  color: var(--cyan);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-speaker-search,
.message-speaker-options {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 30;
  border-right: 1px solid rgba(128, 196, 216, 0.2);
  border-left: 1px solid rgba(128, 196, 216, 0.2);
  background: rgba(5, 16, 24, 0.98);
}

.message-speaker-search {
  top: calc(100% + 6px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  min-width: 260px;
  margin: 0;
  padding: 9px 10px 7px;
  border-top: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 9px 9px 0 0;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.message-speaker-search input {
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(128, 196, 216, 0.16);
  border-radius: 7px;
  background: rgba(2, 9, 14, 0.78);
}

.message-speaker-options {
  top: calc(100% + 86px);
  min-width: 260px;
  max-height: 280px;
  overflow: auto;
  padding: 4px 6px 8px;
  border-bottom: 1px solid rgba(128, 196, 216, 0.2);
  border-radius: 0 0 9px 9px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

.message-speaker-option {
  display: grid;
  grid-template-columns: auto 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  padding: 5px 7px;
  border-radius: 7px;
  cursor: pointer;
}

.message-speaker-option:hover {
  background: rgba(34, 211, 238, 0.08);
}

.message-speaker-option input {
  width: 15px;
  height: 15px;
  min-height: 0;
  accent-color: var(--cyan);
}

.message-speaker-option span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(126, 228, 90, 0.13);
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
}

.message-speaker-option.agent span {
  background: rgba(66, 165, 255, 0.14);
  color: var(--blue);
}

.message-speaker-option.system span {
  background: rgba(246, 170, 45, 0.14);
  color: var(--amber);
}

.message-speaker-option strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-speaker-option em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.message-speaker-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.event-row.search-match {
  border-color: rgba(34, 211, 238, 0.46);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.12);
}

.event-row.selected-search-match {
  border-color: rgba(246, 170, 45, 0.72);
  box-shadow:
    0 0 0 1px rgba(246, 170, 45, 0.22),
    0 0 24px rgba(246, 170, 45, 0.12);
}

@media (max-width: 1180px) {
  .message-filter-bar {
    flex-wrap: wrap;
  }

  .message-search-box {
    flex-basis: calc(100% - 172px);
  }

  .message-speaker-filter {
    flex: 1 1 230px;
  }
}

@media (max-width: 860px) {
  .chat-area {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .chat-area.has-meeting {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }

  .room-toolbar {
    flex-direction: row;
    align-items: center;
    gap: 7px;
    min-height: 56px;
    padding: 7px 10px;
  }

  .room-toolbar > div {
    flex: 1 1 auto;
    min-width: 0;
  }

  .mobile-back-button {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-height: 34px;
    margin-right: 0;
    font-size: 29px;
  }

  .room-toolbar h2 {
    max-width: 100%;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .room-toolbar p {
    display: none;
  }

  .room-invite-panel {
    width: auto;
    max-width: 100%;
    margin-top: 3px;
    padding: 2px 4px;
    gap: 3px;
    border-radius: 6px;
  }

  .room-invite-panel span,
  .room-invite-panel em {
    font-size: 10px;
  }

  .room-invite-panel strong {
    font-size: 11px;
  }

  .room-invite-panel .room-invite-url {
    display: none;
  }

  .room-invite-panel .tiny-button {
    min-height: 22px;
    padding: 1px 5px;
    font-size: 10px;
  }

  .toolbar-actions {
    display: none;
  }

  .message-filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 30px 30px;
    gap: 4px;
    min-height: 0;
    margin: 6px 10px 0;
    padding: 5px;
  }

  .message-search-box {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    padding: 0 8px;
  }

  .message-search-box span {
    display: none;
  }

  .message-search-box input {
    min-height: 28px;
    font-size: 13px;
  }

  .message-search-count {
    align-self: center;
    min-width: 0;
    font-size: 11px;
  }

  .message-nav-button {
    width: 30px;
    min-height: 28px;
  }

  .message-clear-button {
    display: none;
  }

  .message-identity-filters {
    grid-column: 1 / -1;
    overflow-x: auto;
    justify-content: stretch;
    padding: 2px;
  }

  .message-identity-filters button {
    flex: 1 0 58px;
    min-height: 24px;
    padding: 0 6px;
    font-size: 11px;
  }

  .message-speaker-filter {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .message-speaker-filter summary {
    min-height: 26px;
    font-size: 12px;
  }

  .message-speaker-search,
  .message-speaker-options {
    min-width: 0;
  }

  .message-speaker-options {
    max-height: 230px;
  }

  .event-list {
    margin: 6px 10px;
  }

  .composer {
    margin: 0 10px 10px;
  }
}

@media (max-width: 520px) {
  .room-toolbar {
    min-height: 52px;
    padding: 6px 8px;
  }

  .room-toolbar h2 {
    font-size: 16px;
  }

  .room-invite-panel > span:first-child,
  .room-invite-panel em {
    display: none;
  }

  .room-invite-panel .tiny-button {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .message-filter-bar {
    margin-right: 8px;
    margin-left: 8px;
  }

  .message-speaker-option {
    grid-template-columns: auto 26px minmax(0, 1fr);
  }

  .message-speaker-option em {
    display: none;
  }
}

/* Room capacity controls and dense multi-room lists. */
.room-list {
  grid-auto-rows: max-content;
  align-items: start;
}

.room-row {
  box-sizing: border-box;
  align-self: start;
  min-height: 126px;
  overflow: hidden;
}

.room-row.collapsed {
  gap: 0;
  min-height: 126px;
}

.room-row:not(.collapsed) {
  min-height: 164px;
}

.room-main-line {
  min-height: 104px;
}

.room-user-block {
  min-height: 30px;
  max-height: none;
  overflow: hidden;
}

.room-limit-edit,
.room-limit-save,
.room-limit-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 22px;
  border: 1px solid rgba(128, 196, 216, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 11px;
  font-weight: 780;
}

.room-limit-edit {
  padding: 1px 8px;
  color: #b8d7df;
}

.room-limit-edit:hover,
.room-limit-edit:focus-visible {
  border-color: rgba(34, 211, 238, 0.54);
  color: var(--cyan);
}

.room-limit-editor {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  flex: none;
  margin-top: 0 !important;
  overflow: visible !important;
}

.room-limit-input {
  width: 76px;
  height: 24px;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid rgba(34, 211, 238, 0.5);
  border-radius: 6px;
  background: rgba(4, 14, 21, 0.92);
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 760;
}

.room-limit-save,
.room-limit-cancel {
  width: 24px;
  padding: 0;
  font-size: 12px;
}

.room-limit-save {
  border-color: rgba(126, 228, 90, 0.38);
  color: var(--green);
}

.room-limit-cancel {
  border-color: rgba(255, 95, 103, 0.32);
  color: #ffc2c6;
}

@media (max-width: 860px) {
  .joined-panel .panel-title {
    gap: 6px;
  }

  .joined-panel .panel-title h2 {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .room-panel-actions {
    gap: 5px;
  }

  .room-bulk-bar {
    gap: 3px;
    padding: 2px;
  }

  .room-bulk-bar span {
    display: none;
  }

  .room-bulk-bar button {
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 10px;
  }

  .room-row,
  .room-row:not(.collapsed) {
    min-height: 68px;
    overflow: visible;
  }

  .room-row.collapsed {
    min-height: 62px;
  }

  .room-main-line {
    grid-template-columns: 24px 36px minmax(0, 1fr) auto;
    min-height: 0;
  }

  .room-user-block {
    min-height: 0;
    max-height: none;
    margin-left: 0;
  }

  .room-user-list.empty {
    margin-left: 0;
  }

  .room-select-control {
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 7px !important;
  }

  .room-select-control span {
    width: 18px;
    height: 18px;
  }

  .room-row .room-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    overflow: visible;
  }

  .room-limit-edit,
  .room-card-copy {
    padding-right: 7px;
    padding-left: 7px;
  }

  .room-limit-input {
    width: 68px;
  }
}

.chat-area.has-meeting .meeting-panel:not([hidden]) {
  display: grid !important;
}

@media (max-width: 860px) {
  .message-filter-bar {
    display: none !important;
  }

  .chat-area,
  .chat-area.has-meeting {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .chat-area.has-meeting .meeting-panel:not([hidden]) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    min-height: 0;
    margin: 6px 10px 0;
    padding: 8px;
    border-radius: 9px;
  }

  .meeting-copy {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .meeting-mark {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
  }

  .meeting-copy strong {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .meeting-copy em {
    display: none;
  }

  .meeting-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .meeting-actions button {
    min-height: 30px;
    padding: 4px 5px;
    font-size: 12px;
  }

  .meeting-panel:not(.active) .meeting-stage {
    display: none;
  }

  .meeting-stage {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .remote-meeting-videos {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 6px;
  }

  .meeting-pagination {
    grid-column: 1;
    gap: 5px;
  }

  .meeting-page-button {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 11px;
  }

  .meeting-participant-card {
    min-height: 62px;
    padding: 8px;
    border-radius: 9px;
  }

  .meeting-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .meeting-avatar-wrap {
    width: 36px;
    height: 36px;
  }

  .meeting-mic-toggle {
    right: -5px;
    bottom: -5px;
    width: 25px;
    height: 20px;
    font-size: 8px;
  }

  .meeting-participant-meta strong {
    font-size: 12px;
  }

  .meeting-name-row {
    gap: 4px;
  }

  .meeting-name-edit {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 10px;
  }

  .meeting-name-input {
    width: min(132px, 100%);
    height: 24px;
    padding: 3px 6px;
    font-size: 12px;
  }

  .meeting-participant-meta em {
    font-size: 10px;
  }

  .meeting-participant-card.has-video {
    min-height: 96px;
  }

  .event-list {
    margin: 8px 10px;
    padding: 8px 6px;
  }

  .event-row.system {
    max-width: 96%;
    padding: 8px 10px;
    border-radius: 12px;
  }

  .event-row.system .event-meta {
    display: none;
  }

  .system-event {
    font-size: 12px;
    line-height: 1.35;
  }

  .system-event-actions {
    gap: 5px;
    margin-left: 5px;
  }

  .composer {
    gap: 7px;
    margin: 0 10px 10px;
    padding: 8px;
    border-radius: 10px;
  }

  .composer-box {
    gap: 4px;
  }

  .composer textarea {
    min-height: 42px;
    max-height: 92px;
    font-size: 15px;
  }

  .composer-hint {
    display: none;
  }

  .composer-actions {
    gap: 6px;
  }

  .attach-button,
  .mic-button {
    width: 38px;
    min-height: 38px;
  }

  .send-button {
    min-width: 78px;
    min-height: 38px;
    padding-right: 12px;
    padding-left: 12px;
  }

  body.mobile-chat-open .chat-area:not(.has-meeting) {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body.mobile-chat-open .chat-area.has-meeting {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body.mobile-chat-open .event-list {
    min-height: 0;
    overflow: auto;
  }

  body.mobile-chat-open .composer {
    position: relative;
    z-index: 6;
    flex: none;
    margin-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body.mobile-chat-open #messageInput {
    display: block;
    min-height: 42px;
  }

  .meeting-expand-button {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 14px;
  }

  .meeting-maximize-overlay {
    padding: 8px;
  }

  .meeting-maximize-close {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }
}

/* Final action item layout overrides */
.chat-area {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto !important;
}

.chat-area.has-meeting {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto !important;
}

@media (max-width: 860px) {
  body.mobile-chat-open .chat-area:not(.has-meeting) {
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  }

  body.mobile-chat-open .chat-area.has-meeting {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto !important;
  }

  body.mobile-actions-open .room-sidebar,
  body.mobile-actions-open .chat-area {
    display: none !important;
  }

  body.mobile-actions-open .member-sidebar {
    display: block !important;
    flex: 1 1 auto;
    width: 100vw;
    max-width: 100vw;
    min-height: 0;
    overflow: auto;
    padding: 12px 12px 70px;
    border: 0;
  }
}

/* Action Item usability overrides.
   Later layout simplifications hide the member sidebar globally; keep the
   right action rail available on desktop and make the mobile Actions view a
   bounded full-screen surface instead of an off-screen sidebar. */
@media (min-width: 1180px) {
  .world-shell {
    grid-template-columns: 340px minmax(0, 1fr) minmax(320px, 360px) !important;
  }

  .member-sidebar {
    display: grid !important;
    grid-column: 3;
    grid-row: 1;
    grid-template-rows: minmax(0, 1fr);
    width: auto;
    height: 100dvh;
    min-width: 0;
    overflow: hidden;
    padding: 18px 16px;
    border-left: 1px solid var(--line);
    border-bottom: 0;
  }

  .member-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }

  .member-sidebar .side-pane.active {
    min-height: 0;
    overflow: hidden;
  }

  .member-sidebar .actions-pane.active {
    overflow: auto;
    padding-right: 2px;
  }
}

@media (max-width: 860px) {
  body.mobile-actions-open .world-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }

  body.mobile-actions-open .member-sidebar {
    display: grid !important;
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: minmax(0, 1fr);
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    min-height: 0;
    padding: 10px 10px calc(76px + env(safe-area-inset-bottom));
    overflow: hidden;
    border: 0;
  }

  body.mobile-actions-open .member-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.mobile-actions-open .actions-pane.active {
    display: grid !important;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    overflow: auto;
    padding-right: 2px;
  }

  body.mobile-actions-open .action-toolbar,
  body.mobile-actions-open .action-form,
  body.mobile-actions-open .project-brief-form,
  body.mobile-actions-open .action-detail,
  body.mobile-actions-open .action-card {
    max-width: 100%;
  }

  body.mobile-actions-open .action-form input,
  body.mobile-actions-open .action-form select,
  body.mobile-actions-open .action-form textarea {
    width: 100%;
    min-width: 0;
  }
}
