:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fbfb;
  --surface-strong: #edf7f6;
  --ink: #18202f;
  --muted: #667085;
  --line: #dfe7ea;
  --line-strong: #cbd9dd;
  --teal: #079a9a;
  --teal-dark: #087a7a;
  --green: #16a34a;
  --coral: #f04444;
  --amber: #f59e0b;
  --violet: #8b5cf6;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.12);
  --radius: 8px;
  --topbar-h: 72px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    linear-gradient(180deg, rgba(7, 154, 154, 0.04), transparent 260px),
    var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.app-shell {
  min-height: 100vh;
  min-width: 320px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 318px minmax(390px, 1fr) minmax(260px, 440px) 220px;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 18px 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0;
}

.brand span span {
  color: var(--teal);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal), #12b8b2);
  box-shadow: 0 8px 20px rgba(7, 154, 154, 0.24);
}

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

.brand-mark svg path:first-child {
  fill: currentColor;
  stroke: currentColor;
}

.brand-mark svg path:last-child {
  color: var(--teal);
  stroke-width: 2.2;
}

.main-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  height: 100%;
  min-width: 0;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 104px;
  height: 100%;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.nav-item.active::after {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 4px;
  border-radius: 99px 99px 0 0;
  background: var(--teal);
  content: "";
}

.nav-item b {
  position: absolute;
  top: 12px;
  right: 9px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.global-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

kbd {
  padding: 3px 7px;
  border-radius: 6px;
  background: #eef2f4;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
}

.icon-button,
.ghost-icon,
.rail-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.icon-button {
  width: 44px;
  height: 44px;
  margin-left: 12px;
  border-radius: var(--radius);
}

.icon-button:hover,
.ghost-icon:hover,
.rail-button:hover {
  background: var(--surface-strong);
  color: var(--teal-dark);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.auth-link.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.admin-link[hidden],
.auth-link[hidden],
.logout-form[hidden] {
  display: none;
}

.logout-form {
  margin: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 54px 266px 244px minmax(460px, 1fr) 278px;
  height: calc(100vh - var(--topbar-h));
  min-height: 680px;
  overflow: hidden;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 7px;
  background: linear-gradient(180deg, #058f8e, #047776);
  color: #fff;
}

.rail-button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  color: #e9ffff;
}

.rail-button.active {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.9);
}

.buddy-pane,
.rooms-pane,
.people-pane {
  min-width: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.people-pane {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.buddy-pane {
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
}

.profile-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.avatar,
.mini-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, #b7ebe7, #f8b5bd);
  color: var(--teal-dark);
  font-weight: 850;
  letter-spacing: 0;
}

.avatar.large {
  width: 68px;
  height: 68px;
  border: 4px solid #e9fbf9;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.05);
}

.profile-copy label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-copy input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.profile-copy input:focus {
  border-bottom-color: var(--teal);
}

.status-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 38px;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.status-control button {
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-control button:last-child {
  border-right: 0;
}

.status-control button.selected {
  background: linear-gradient(180deg, #17b857, var(--green));
  color: #fff;
}

.pane-section {
  margin-bottom: 24px;
}

.section-title,
.people-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.section-title h2,
.people-head h2,
.rooms-head h2,
.room-controls h2,
.private-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.section-actions {
  display: flex;
  gap: 4px;
}

.ghost-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--muted);
}

.ghost-icon svg {
  width: 18px;
  height: 18px;
}

.buddy-group {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.buddy-group:last-child {
  border-bottom: 0;
}

.group-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.group-label svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.buddy-row,
.person-row,
.recent-row,
.room-row {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.buddy-row {
  gap: 8px;
  min-height: 34px;
  padding: 3px 0;
  color: var(--ink);
  font-size: 13px;
}

.presence {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a3aab6;
}

.presence.Online {
  background: var(--green);
}

.presence.Away {
  background: var(--amber);
}

.presence.Busy {
  background: var(--coral);
}

.presence.Offline {
  border: 1px solid #9aa3b2;
  background: var(--surface);
}

.mini-avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.buddy-row strong,
.person-row strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 720;
}

.buddy-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.buddy-row em.Online {
  color: var(--green);
}

.buddy-row em.Away {
  color: #d97706;
}

.buddy-row em.Busy {
  color: var(--coral);
}

.star {
  color: var(--amber);
  font-size: 16px;
  line-height: 1;
}

.recent-row {
  gap: 9px;
  min-height: 36px;
  padding: 4px 0;
  color: var(--ink);
  font-size: 13px;
}

.empty-note {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.recent-row span:nth-child(2) {
  flex: 1;
}

.recent-row b,
.room-row b,
.room-tab b {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.recent-row b.hot,
.room-row b {
  background: var(--coral);
}

.mini-room {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 850;
}

.mini-room.alert {
  background: var(--coral);
}

.add-buddy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  margin-top: auto;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #12b8b2, var(--teal));
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 12px 22px rgba(7, 154, 154, 0.2);
}

.rooms-pane {
  padding: 18px 12px 20px;
}

.rooms-head h2 {
  margin-bottom: 10px;
}

.room-search {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.room-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.room-search svg {
  width: 18px;
  height: 18px;
}

.join-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 38px;
  margin-bottom: 14px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #11b7b0, var(--teal));
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 12px 22px rgba(7, 154, 154, 0.18);
}

.room-group {
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.room-group:first-child {
  padding-top: 0;
}

.room-group:last-child {
  border-bottom: 0;
}

.room-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.room-group-title svg {
  width: 16px;
  height: 16px;
  color: var(--teal);
}

.room-row {
  gap: 8px;
  min-height: 29px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
}

.room-row:hover,
.room-row.active {
  background: var(--surface-strong);
}

.room-row.active {
  background: linear-gradient(180deg, #12aaa5, var(--teal));
  color: #fff;
  font-weight: 850;
}

.room-row span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-row small {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.room-row.active small {
  color: rgba(255, 255, 255, 0.88);
}

.room-row small svg {
  width: 14px;
  height: 14px;
}

.chat-pane {
  display: grid;
  grid-template-rows: 54px 92px minmax(0, 1fr) 164px;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.room-tabs {
  display: flex;
  align-items: end;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.room-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
  color: #344054;
  font-size: 13px;
  font-weight: 780;
}

.room-tab.active {
  height: 48px;
  min-width: 168px;
  border-color: transparent;
  background: linear-gradient(180deg, #11b8b2, var(--teal));
  color: #fff;
}

.room-tab span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-tab b {
  min-width: 20px;
  height: 20px;
  background: var(--coral);
}

.room-tab.add {
  min-width: 48px;
  justify-content: center;
}

.room-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 12px 16px 16px;
  border-bottom: 1px solid var(--line);
}

.room-header h1 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.1;
}

.room-header p {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.room-tools {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
}

.room-tools button {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: #344054;
  font-size: 12px;
  font-weight: 720;
}

.room-tools button:hover {
  background: var(--surface-strong);
}

.room-tools button span {
  margin-top: 4px;
}

.messages {
  min-height: 0;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(7, 154, 154, 0.03), transparent 34%),
    repeating-linear-gradient(
      180deg,
      #fff 0,
      #fff 61px,
      #f8fafb 61px,
      #f8fafb 122px
    );
}

.message-row {
  display: grid;
  grid-template-columns: 68px 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 61px;
  padding: 8px 18px;
  color: var(--ink);
}

.message-time {
  color: var(--muted);
  font-size: 12px;
}

.message-author {
  margin-right: 7px;
  font-weight: 850;
}

.message-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.45;
}

.message-row.system {
  grid-template-columns: 68px 38px minmax(0, 1fr);
  color: #667085;
}

.message-row.system .avatar {
  background: #e6ecef;
  color: #344054;
}

.message-row.buzz {
  animation: buzz 260ms linear 2;
}

.message-row.buzz .message-text {
  color: var(--coral);
  font-weight: 800;
}

.room-empty {
  margin: 24px 18px;
  color: var(--muted);
  font-size: 14px;
}

@keyframes buzz {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

.composer {
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.format-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.format-bar button {
  display: grid;
  width: 32px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #344054;
  font-size: 14px;
}

.format-bar button:hover {
  background: var(--surface-strong);
}

.format-bar span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.message-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 12px;
  padding: 12px;
}

.message-input-row textarea {
  width: 100%;
  min-width: 0;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.send-button {
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #12b8b2, var(--teal));
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}

.send-button:hover,
.join-button:hover,
.add-buddy:hover {
  background: linear-gradient(180deg, #0ea7a1, var(--teal-dark));
}

.people-pane {
  padding: 18px 14px 14px;
}

.people-list {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.person-row {
  gap: 9px;
  min-height: 34px;
  padding: 4px 0;
  color: var(--ink);
  font-size: 13px;
}

.person-row small {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 760;
}

.person-row .crown {
  color: var(--amber);
  font-weight: 900;
}

.people-more {
  margin: 8px 0 0 31px;
  color: var(--muted);
  font-size: 12px;
}

.room-controls {
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--line);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.control-grid button {
  display: grid;
  gap: 5px;
  place-items: center;
  min-width: 0;
  min-height: 62px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: #344054;
  font-size: 11px;
  font-weight: 760;
}

.control-grid button:last-child {
  border-right: 0;
}

.control-grid .danger {
  color: var(--coral);
}

.control-grid button:hover {
  background: var(--surface-strong);
}

.private-panel {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
}

.private-panel.collapsed {
  display: none;
}

.private-panel header,
.private-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}

.private-panel header {
  justify-content: space-between;
}

.private-panel h2 {
  color: var(--teal-dark);
}

.private-panel h2 span {
  color: var(--muted);
}

.private-person strong {
  font-size: 13px;
}

.private-messages {
  display: grid;
  gap: 8px;
  min-height: 174px;
  max-height: 214px;
  overflow: auto;
  padding: 12px;
  background: #fbfcfd;
}

.private-bubble {
  max-width: 86%;
  padding: 10px 11px;
  border-radius: var(--radius);
  background: #ffe3e8;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.private-bubble.mine {
  justify-self: end;
  background: #d9f8e8;
}

.private-bubble small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.private-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
}

.feature-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  right: 18px;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100vh - var(--topbar-h) - 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-panel.collapsed {
  display: none;
}

.feature-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.feature-panel header p {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.feature-panel h2 {
  margin: 0;
  font-size: 18px;
}

.feature-body {
  min-height: 220px;
  overflow: auto;
  padding: 14px;
}

.feature-list {
  display: grid;
  gap: 8px;
}

.feature-row,
.feature-action,
.feature-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.feature-row,
.feature-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
}

.feature-row strong,
.feature-card strong {
  display: block;
  font-size: 13px;
}

.feature-row span,
.feature-card span,
.feature-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.feature-action {
  justify-content: center;
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.feature-action.secondary {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--teal-dark);
}

.feature-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

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

.feature-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
}

.feature-score {
  display: grid;
  place-items: center;
  min-height: 64px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--teal-dark);
  font-size: 28px;
  font-weight: 900;
}

.feature-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.private-composer input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  font-size: 12px;
}

.private-composer input:focus {
  border-color: var(--teal);
}

.private-composer button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
}

.private-composer button svg {
  width: 18px;
  height: 18px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: 260px minmax(280px, 1fr) minmax(220px, 360px) 148px;
  }

  .workspace {
    grid-template-columns: 54px 236px 226px minmax(430px, 1fr);
  }

  .people-pane {
    display: none;
  }
}

@media (max-width: 980px) {
  :root {
    --topbar-h: 64px;
  }

  .topbar {
    grid-template-columns: auto 1fr 132px;
    gap: 12px;
  }

  .brand {
    font-size: 23px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .main-nav {
    display: none;
  }

  .global-search {
    height: 40px;
  }

  .workspace {
    grid-template-columns: 52px 230px minmax(0, 1fr);
    min-height: calc(100vh - var(--topbar-h));
  }

  .rooms-pane {
    display: none;
  }

  .chat-pane {
    grid-template-rows: 52px 92px minmax(0, 1fr) 160px;
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 0 10px;
  }

  .admin-link {
    display: none !important;
  }

  .auth-link {
    height: 32px;
    padding: 0 8px;
  }

  .topbar .top-actions .icon-button {
    width: 40px;
    height: 40px;
    margin-left: 0;
  }

  .global-search {
    display: none;
  }

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

  .rail {
    position: sticky;
    top: var(--topbar-h);
    z-index: 10;
    flex-direction: row;
    justify-content: center;
    height: 52px;
    padding: 6px 8px;
  }

  .buddy-pane,
  .rooms-pane,
  .people-pane {
    display: none;
  }

  .chat-pane {
    display: grid;
    width: 100%;
    max-width: 100vw;
    height: calc(100vh - var(--topbar-h) - 52px);
    min-height: 560px;
    overflow: hidden;
    grid-template-rows: 50px auto minmax(0, 1fr) 154px;
  }

  .room-tabs {
    width: 100%;
    max-width: 100vw;
  }

  .room-tab {
    flex: 0 0 auto;
  }

  .room-header {
    display: block;
    padding: 14px 12px;
  }

  .room-header h1 {
    font-size: 20px;
  }

  .room-header p {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .room-header p span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .room-header p span[aria-hidden="true"] {
    display: none;
  }

  .room-tools {
    margin-top: 12px;
    border-top: 1px solid var(--line);
  }

  .room-tools button:first-child {
    border-left: 0;
  }

  .message-row {
    grid-template-columns: 42px 28px minmax(0, 1fr);
    gap: 6px;
    padding: 8px 10px;
  }

  .message-time {
    font-size: 10px;
  }

  .message-text {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 13px;
  }

  .message-author {
    margin-right: 4px;
  }

  .message-input-row {
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .feature-panel {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    max-height: min(70vh, 620px);
  }

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