:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --panel-soft: #fbfcfa;
  --ink: #1d2523;
  --muted: #66716d;
  --line: #d9ddd6;
  --accent: #087f68;
  --accent-strong: #066452;
  --ai: #4f5f9f;
  --gold: #c88b2a;
  --warn: #a15c13;
  --shadow: 0 12px 32px rgba(29, 37, 35, 0.08);
  --deep-shadow: 0 18px 60px rgba(25, 31, 39, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
.secondary {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  touch-action: manipulation;
}

button:hover,
.secondary:hover {
  border-color: #aeb7b1;
}

.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.primary:hover {
  background: var(--accent-strong);
}

.shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.mode-video {
  overflow: hidden;
  background: #0c100e;
}

.mode-video .shell {
  width: 100vw;
  max-width: none;
  height: 100vh;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2vw, 2.3rem);
}

h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.room-actions,
.media-controls,
.command-row,
.quick-actions,
.view-toggle {
  display: flex;
  gap: 8px;
}

.secondary-row {
  margin-top: 8px;
}

.secondary-row button {
  width: 100%;
}

.room-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.room-title-row,
.room-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.room-title-row h2 {
  margin: 0;
}

.room-title-row h2[contenteditable="true"] {
  outline: 2px solid rgba(8, 127, 104, 0.28);
  border-radius: 6px;
  padding: 2px 6px;
  background: #ffffff;
}

.room-status-row span,
.small-action {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
}

.small-action {
  cursor: pointer;
}

.media-controls {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef0ec;
}

.media-controls button {
  min-height: 34px;
  border-color: transparent;
  background: #ffffff;
}

.media-controls button[aria-pressed="false"],
.media-controls .toggle-off {
  color: var(--muted);
  background: transparent;
}

.view-toggle {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef0ec;
}

.view-toggle button {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
}

.view-toggle .toggle-active {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 4px 12px rgba(29, 37, 35, 0.08);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  transition: all 180ms ease;
}

.screen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.screen-grid[hidden],
.screen-tile[hidden] {
  display: none;
}

.screen-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111614;
  box-shadow: var(--deep-shadow);
}

.screen-tile video {
  width: 100%;
  max-height: 68vh;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  background: #050706;
}

.screen-tile span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.82rem;
}

.video-tile {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #202622;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
  transition: all 180ms ease;
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-tile span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.82rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(520px, 1fr);
  gap: 12px;
  align-items: start;
}

.command-panel,
.stage,
.thread {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.mode-video .media-grid {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #050706;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.mode-video.has-screen-share .shell {
  grid-template-rows: auto minmax(0, 1.6fr) minmax(180px, 0.7fr);
}

.mode-video.has-screen-share .screen-grid {
  height: 100%;
  min-height: 0;
  margin-bottom: 12px;
}

.mode-video.has-screen-share .screen-tile,
.mode-video.has-screen-share .screen-tile video {
  height: 100%;
  max-height: none;
}

.mode-video.has-screen-share .media-grid {
  min-height: 0;
}

.mode-video .topbar {
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.mode-video .topbar > div:first-child {
  display: none;
}

.mode-video .video-tile {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.mode-video .video-tile video {
  object-fit: contain;
  background: #050706;
}

.mode-video .video-tile:first-child {
  z-index: 2;
}

.mode-video.has-remote-media .video-tile:first-child {
  inset: auto 24px 24px auto;
  width: clamp(220px, 18vw, 360px);
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.mode-video.has-remote-media .video-tile:first-child video {
  object-fit: cover;
}

.mode-video:not(.has-remote-media) .video-tile:nth-child(2) {
  display: none;
}

.mode-video.has-remote-media .video-tile:nth-child(2) {
  z-index: 1;
}

.mode-video .workspace {
  display: none;
}

.mode-canvas .shell {
  width: min(1720px, 100%);
}

.mode-canvas .media-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  width: min(520px, 100%);
  margin-left: auto;
}

.mode-canvas .video-tile {
  min-height: 0;
  box-shadow: 0 8px 22px rgba(29, 37, 35, 0.1);
}

.mode-canvas .workspace {
  grid-template-columns: minmax(260px, 340px) minmax(620px, 1fr);
}

.mode-canvas .stage {
  min-height: 68vh;
  background:
    radial-gradient(circle at 1px 1px, rgba(102, 113, 109, 0.18) 1px, transparent 0),
    linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  background-size: 22px 22px, auto;
  box-shadow: var(--deep-shadow);
}

.thread {
  display: none;
}

form + form,
.quick-actions,
.debug-panel {
  margin-top: 16px;
}

.voice-button {
  width: 100%;
  margin-top: 8px;
}

.ai-button {
  color: #ffffff;
  background: var(--ai);
  border-color: var(--ai);
}

.ai-button:hover {
  background: #404d86;
  border-color: #404d86;
}

.status-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfa;
}

.quick-actions {
  flex-wrap: wrap;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.stage-subtitle {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.conversation-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(74vh, 900px);
  overflow: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.message-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.message-chairly .message-avatar {
  background: var(--ai);
}

.message-bubble {
  width: min(820px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(29, 37, 35, 0.05);
}

.message-human .message-bubble {
  background: #f0faf5;
  border-color: #cfe7dc;
}

.message-voice .message-bubble {
  border-color: #d7c791;
  background: #fffaf0;
}

.message-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.message-meta strong {
  color: var(--ink);
}

.message-meta time {
  color: var(--muted);
}

.message-chip {
  border: 1px solid rgba(79, 95, 159, 0.22);
  border-radius: 999px;
  padding: 2px 8px;
  color: #38436f;
  background: #eef1ff;
  font-size: 0.74rem;
  font-weight: 700;
}

.message-text {
  margin: 0;
  white-space: pre-wrap;
}

.system-message {
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
}

.widget {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
  box-shadow: none;
}

.widget h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.widget p {
  margin-bottom: 8px;
  color: var(--muted);
}

.file-widget {
  background: #ffffff;
}

.file-card {
  display: grid;
  grid-template-columns: minmax(96px, 160px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.file-preview,
.file-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef0ec;
  object-fit: cover;
  display: block;
}

.file-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.file-details {
  display: grid;
  gap: 6px;
}

.file-details span,
.file-intent {
  color: var(--muted);
  font-size: 0.88rem;
}

.file-intent {
  margin: 0;
}

.ai-widget {
  border-color: rgba(79, 95, 159, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #f6f7fb 100%);
}

.ai-widget h3 {
  color: #26305d;
}

.ai-summary {
  color: var(--ink) !important;
  font-size: 1.02rem;
}

.ai-badge {
  display: inline-flex;
  margin: 0 0 12px;
  border: 1px solid rgba(79, 95, 159, 0.22);
  border-radius: 999px;
  padding: 4px 9px;
  color: #38436f;
  background: #eef1ff;
  font-size: 0.78rem;
  font-weight: 700;
}

.ai-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e5ef;
}

.ai-section h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.ai-section ul {
  margin: 0;
  padding-left: 18px;
}

.ai-section li + li {
  margin-top: 6px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.suggestions button {
  min-height: 34px;
  color: #26305d;
  background: #ffffff;
  border-color: #cbd1ea;
}

.map-frame {
  width: 100%;
  height: clamp(260px, 38vw, 440px);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  background: #eef0ec;
}

.map-link {
  margin-top: 8px;
  color: var(--accent);
  display: inline-flex;
  font-weight: 700;
  text-decoration: none;
}

.counter-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.counter-value strong {
  font-size: 2rem;
}

.days {
  margin: 0;
  padding-left: 18px;
}

.days li + li {
  margin-top: 8px;
}

.debug-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

dl {
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #eef0ec;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  text-align: right;
}

.thread ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.thread li {
  border-bottom: 1px solid #eef0ec;
  padding-bottom: 9px;
}

.thread time {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.event-type {
  color: var(--accent);
  font-weight: 700;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .mode-canvas .workspace,
  .mode-video .workspace {
    grid-template-columns: 1fr;
  }

  .mode-canvas .media-grid {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 12px;
  }

  .topbar,
  .room-actions,
  .command-row,
  .view-toggle {
    align-items: stretch;
    flex-direction: column;
  }

  .media-grid,
  .mode-canvas .media-grid {
    grid-template-columns: 1fr;
  }

  .mode-video .media-grid,
  .mode-video .video-tile {
    min-height: 0;
  }

  .mode-video .shell {
    padding: 8px;
  }

  .mode-video .topbar {
    justify-content: flex-start;
  }

  .mode-video.has-remote-media .video-tile:first-child {
    inset: auto 12px 12px auto;
    width: min(42vw, 180px);
  }

  .map-widget,
  .ai-widget,
  .file-widget {
    grid-column: auto;
  }

  .file-card {
    grid-template-columns: 1fr;
  }
}

/* Conversation-first sprint layout overrides. */
.shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.conversation-sidebar {
  min-height: 100vh;
  padding: 18px 14px;
  color: #f7f7f4;
  background: #3d1138;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-lockup h1 {
  margin: 0;
  font-size: 1.35rem;
}

.conversation-sidebar .eyebrow {
  color: #b8f4df;
}

.conversation-list {
  display: grid;
  gap: 6px;
}

.conversation-item {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.conversation-item:hover,
.conversation-item.active {
  color: #ffffff;
  background: #087f68;
}

.room-tree {
  display: grid;
  gap: 6px;
}

.room-nav-item,
.topic-select,
.topic-rename,
.sidebar-section-heading button {
  min-height: 34px;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  justify-content: flex-start;
}

.room-nav-item:hover,
.room-nav-item.active,
.topic-row.active .topic-select {
  color: #ffffff;
  background: rgba(8, 127, 104, 0.86);
}

.sidebar-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-section-heading button {
  width: 32px;
  min-height: 32px;
  justify-content: center;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.topic-list {
  display: grid;
  gap: 4px;
}

.topic-create-form,
.topic-rename-form {
  display: grid;
  gap: 6px;
}

.topic-create-form[hidden] {
  display: none;
}

.topic-create-form input,
.topic-rename-form input {
  min-height: 34px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.topic-create-form input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.topic-form-actions,
.topic-rename-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.topic-form-actions {
  display: grid;
  gap: 4px;
}

.topic-form-actions button,
.topic-rename-form button {
  min-height: 32px;
  padding: 0 8px;
  color: #ffffff;
  background: rgba(8, 127, 104, 0.86);
  border-color: rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
}

.topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
}

.topic-row:has(.topic-rename-form) {
  grid-template-columns: 1fr;
}

.topic-select {
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-rename {
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.72rem;
  opacity: 0.72;
}

.topic-empty {
  margin: 0;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.84rem;
}

.presence-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #20c997;
}

.presence-dot.idle {
  background: #d1b565;
}

.main-pane {
  min-width: 0;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.media-controls button[aria-pressed="false"],
.media-controls .toggle-off {
  color: #8a332b;
  background: #fff2f0;
  border-color: #efc2bc;
}

.screen-view {
  display: none;
}

.video-empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.78);
  background: #171d1a;
  font-weight: 700;
}

.video-empty[hidden] {
  display: none;
}

.workspace {
  min-height: 0;
  display: block;
}

.stage,
.thread,
.media-library,
.memory-panel,
.room-utility-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.mode-video .conversation-sidebar {
  display: none;
}

.mode-video .shell {
  grid-template-columns: 1fr;
}

.mode-video .main-pane {
  height: 100vh;
  padding: 12px;
  grid-template-rows: auto minmax(0, 1fr);
}

.mode-video .screen-view {
  display: none;
}

.mode-video.has-screen-share .main-pane {
  grid-template-rows: auto minmax(0, 1.6fr) minmax(180px, 0.7fr);
}

.mode-video.has-screen-share .screen-view {
  display: block;
}

.mode-canvas .shell,
.mode-media .shell,
.mode-memory .shell,
.mode-sessions .shell,
.mode-settings .shell,
.mode-screen .shell {
  width: 100%;
}

.mode-canvas .stage {
  height: calc(100vh - 118px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.mode-canvas .workspace {
  min-height: 0;
}

.mode-screen .screen-view {
  display: grid;
  min-height: calc(100vh - 118px);
}

.mode-screen .media-grid,
.mode-screen .workspace {
  display: none;
}

.mode-media .media-grid,
.mode-media .screen-view,
.mode-media .stage {
  display: none;
}

.mode-media .media-library {
  display: block;
  min-height: calc(100vh - 118px);
}

.mode-canvas .media-library,
.mode-video .media-library,
.mode-screen .media-library {
  display: none;
}

.memory-panel,
.room-utility-panel {
  display: none;
}

.mode-memory .media-grid,
.mode-memory .screen-view,
.mode-memory .stage,
.mode-memory .media-library,
.mode-memory .room-utility-panel,
.mode-sessions .media-grid,
.mode-sessions .screen-view,
.mode-sessions .stage,
.mode-sessions .media-library,
.mode-sessions .memory-panel,
.mode-settings .media-grid,
.mode-settings .screen-view,
.mode-settings .stage,
.mode-settings .media-library,
.mode-settings .memory-panel {
  display: none;
}

.mode-memory .memory-panel,
.mode-sessions .room-utility-panel,
.mode-settings .room-utility-panel {
  display: block;
  min-height: calc(100vh - 118px);
}

.voice-button {
  width: auto;
  margin-top: 0;
  background: #ffffff;
}

.voice-button.compact {
  min-height: 42px;
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

label {
  display: none;
}

.conversation-feed {
  max-height: none;
}

.composer {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
}

.composer-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto;
  gap: 8px;
}

.icon-action {
  color: var(--muted);
}

.message-actions {
  margin-top: 8px;
}

.message-actions button,
.danger-action {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: #ffffff;
}

.danger-action {
  color: #8a332b;
  border-color: #efc2bc;
}

.debug-panel {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 14px;
}

.debug-panel summary {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.conversation-sidebar dt {
  color: rgba(255, 255, 255, 0.68);
}

.conversation-sidebar dd {
  color: #ffffff;
}

.media-search {
  margin-bottom: 12px;
}

.media-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.media-library-item .widget {
  height: 100%;
}

.memory-list {
  display: grid;
  gap: 12px;
}

.memory-widget {
  border-color: #d8d1b9;
  background: #fffdf6;
}

.memory-text {
  color: var(--ink) !important;
  font-size: 1.02rem;
}

.room-utility-body {
  max-width: 760px;
  color: var(--ink);
}

.empty-view {
  min-height: 280px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.empty-view[hidden] {
  display: none;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .conversation-sidebar {
    min-height: auto;
  }

  .composer-row,
  .topbar,
  .room-actions,
  .view-toggle {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}
