:root {
  --bg: #070707;
  --panel: rgba(18, 18, 18, 0.82);
  --panel-solid: #101010;
  --panel-soft: #171717;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f6f6f3;
  --muted: #a8aaa4;
  --muted-2: #72746f;
  --red: #ff3154;
  --mint: #2ef2bd;
  --lime: #a8ff5d;
  --gold: #ffd166;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
  --mobile-nav-height: 74px;
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 49, 84, 0.24), transparent 26rem),
    radial-gradient(circle at 88% 88%, rgba(46, 242, 189, 0.16), transparent 30rem),
    linear-gradient(135deg, #060606 0%, #101010 50%, #050505 100%);
  color: var(--text);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.day-mode {
  --bg: #eef5f2;
  --panel: rgba(250, 253, 251, 0.96);
  --panel-solid: #ffffff;
  --panel-soft: #e8f1ee;
  --line: rgba(20, 37, 33, 0.18);
  --text: #10201c;
  --muted: #465650;
  --muted-2: #66736e;
  --red: #d82748;
  --mint: #0a9f80;
  --lime: #2caa4e;
  --gold: #9b7314;
  --shadow: 0 22px 48px rgba(19, 45, 39, 0.14);
  color-scheme: light;
  background:
    radial-gradient(circle at 14% 10%, rgba(10, 159, 128, 0.12), transparent 23rem),
    radial-gradient(circle at 88% 82%, rgba(216, 39, 72, 0.08), transparent 27rem),
    linear-gradient(135deg, #edf5f2 0%, #e6f0ec 54%, #f8fbfa 100%);
}

body.day-mode .rail,
body.day-mode .sidebar,
body.day-mode .chat-panel,
body.day-mode .details-panel,
body.day-mode .login-card,
body.day-mode .profile-editor,
body.day-mode .action-card {
  background: var(--panel);
}

body.day-mode .brand-mark,
body.day-mode .chat-item img,
body.day-mode .room-avatar,
body.day-mode .online-person img {
  background: #fff;
}

body.day-mode input,
body.day-mode textarea {
  color: var(--text);
  background: #ffffff;
  border-color: rgba(20, 37, 33, 0.2);
}

body.day-mode input::placeholder,
body.day-mode textarea::placeholder {
  color: #75837e;
}

body.day-mode .tab.active,
body.day-mode .mobile-nav-button.active,
body.day-mode .send-button,
body.day-mode .join-button,
body.day-mode .room-admin-chip,
body.day-mode .mention {
  color: #06110f;
}

body.day-mode .message.mine .bubble {
  border-color: rgba(10, 159, 128, 0.28);
  background: linear-gradient(135deg, #d9f3ec, #f8fffc);
}

body.day-mode .bubble,
body.day-mode .chat-item,
body.day-mode .me-card,
body.day-mode .search-box,
body.day-mode .composer-card {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 26px rgba(20, 37, 33, 0.06);
}

body.day-mode .chat-panel {
  background:
    linear-gradient(180deg, rgba(10, 159, 128, 0.05), transparent 28%),
    #eef5f2;
}

body.day-mode .chat-header,
body.day-mode .mobile-nav {
  background: rgba(250, 253, 251, 0.96);
}

body.day-mode .message-stage {
  background-color: #edf5f2;
  background-image:
    linear-gradient(rgba(20, 37, 33, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 37, 33, 0.045) 1px, transparent 1px);
}

body.day-mode .bubble {
  background: #ffffff;
}

body.day-mode .day-pill,
body.day-mode .attachment-chip,
body.day-mode .reply-composer,
body.day-mode .reply-preview,
body.day-mode .chat-search-strip,
body.day-mode .reaction-button,
body.day-mode .message-actions button,
body.day-mode .tool-button,
body.day-mode .chat-tools button,
body.day-mode .forward-room-list button,
body.day-mode .quick-command-bar button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(20, 37, 33, 0.16);
}

body.day-mode .reaction-button.active,
body.day-mode .reaction-button:hover,
body.day-mode .quick-command-bar button:hover,
body.day-mode .tool-button:hover,
body.day-mode .back-button:hover {
  background: rgba(10, 159, 128, 0.12);
  border-color: rgba(10, 159, 128, 0.34);
}

body.day-mode .back-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
}

body.day-mode .room-badge {
  color: #9c1830;
  background: rgba(216, 39, 72, 0.08);
}

body.day-mode .attachment-icon {
  color: #9c1830;
  background: rgba(216, 39, 72, 0.1);
}

body.day-mode .voice-recording {
  background:
    linear-gradient(135deg, rgba(216, 39, 72, 0.1), rgba(10, 159, 128, 0.1)),
    #ffffff;
}

body.day-mode .voice-recording time {
  color: #ffffff;
  background: var(--red);
}

body.day-mode .soft-notice {
  color: #06110f;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(20, 37, 33, 0.16);
  box-shadow: 0 18px 40px rgba(20, 37, 33, 0.14);
}

body.day-mode .incoming-notice {
  color: #10201c;
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(10, 159, 128, 0.22);
  box-shadow: 0 18px 46px rgba(20, 37, 33, 0.16);
}

body.day-mode .pull-refresh-indicator {
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(20, 37, 33, 0.14);
  box-shadow: 0 18px 38px rgba(19, 45, 39, 0.16);
}

body.day-mode .profile-editor,
body.day-mode .action-card {
  border-color: rgba(20, 37, 33, 0.16);
}

body.day-mode .action-buttons {
  background: linear-gradient(180deg, transparent, rgba(250, 253, 251, 0.98) 28%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

button:active {
  transform: scale(0.98);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 76px minmax(270px, 360px) minmax(0, 1fr) minmax(260px, 330px);
  height: 100dvh;
  padding: 14px;
  gap: 14px;
}

body.no-chat-selected .app-shell {
  grid-template-columns: 76px minmax(320px, 430px) minmax(0, 1fr);
}

.rail,
.sidebar,
.chat-panel,
.details-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 22px;
  padding: 12px 10px;
  gap: 12px;
}

.brand-mark,
.rail-button,
  .icon-button,
  .tool-button,
  .send-button,
  .back-button,
  .danger-button {
  border: 1px solid var(--line);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  padding: 5px;
  background: #050505;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.rail-button {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

.rail-button span {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.rail-button.active,
.rail-button:hover,
.icon-button:hover,
.tool-button:hover {
  border-color: rgba(46, 242, 189, 0.75);
  color: var(--text);
  background: rgba(46, 242, 189, 0.12);
}

.rail-spacer {
  flex: 1;
}

.sidebar,
.details-panel,
.chat-panel {
  border-radius: 24px;
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  overflow: hidden;
}

.sidebar-header,
.chat-header,
.room-title-row,
.composer-row,
.status-card > div,
.message-meta,
.attachment-chip,
.online-person,
.me-card,
.person-pill,
.member-row {
  display: flex;
  align-items: center;
}

.sidebar-header,
.chat-header {
  justify-content: space-between;
  gap: 12px;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.theme-toggle-button {
  color: var(--gold);
}

body.day-mode .theme-toggle-button {
  color: var(--mint);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--mint);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 2.2vw, 2.3rem);
  line-height: 1;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 900;
}

.search-box {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-box input,
.login-card input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input {
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

.quick-connect {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(46, 242, 189, 0.22);
  border-radius: 18px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(46, 242, 189, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.18);
}

.quick-connect[hidden] {
  display: none;
}

.quick-connect-head,
.quick-connect-list button {
  display: flex;
  align-items: center;
}

.quick-connect-head {
  justify-content: space-between;
  color: var(--mint);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quick-connect-head small {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: none;
}

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

.quick-connect-list button {
  width: 100%;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
}

.quick-connect-list button:hover {
  border-color: rgba(46, 242, 189, 0.55);
  background: rgba(46, 242, 189, 0.1);
}

.quick-connect-list img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 14px;
  object-fit: cover;
}

.quick-connect-list span {
  display: grid;
  min-width: 0;
}

.quick-connect-list strong,
.quick-connect-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-connect-list em {
  margin-left: auto;
  border-radius: 999px;
  padding: 5px 8px;
  color: #050505;
  background: var(--mint);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 900;
}

.status-card {
  border: 1px solid rgba(46, 242, 189, 0.25);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(46, 242, 189, 0.12), rgba(255, 49, 84, 0.08));
}

.status-card p,
.room-copy p,
.composer-note,
.details-panel p,
.message-time,
.fine-print,
.login-copy {
  color: var(--muted);
}

.status-card p {
  margin: 7px 0 0;
  font-size: 0.9rem;
}

.me-card {
  width: 100%;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 10px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 49, 84, 0.13), rgba(46, 242, 189, 0.08)),
    rgba(255, 255, 255, 0.04);
  text-align: left;
}

.me-card:hover {
  border-color: rgba(46, 242, 189, 0.62);
}

.me-card img {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  object-fit: cover;
}

.me-card span {
  display: grid;
  min-width: 0;
}

.me-card strong,
.person-pill strong,
.member-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-card small,
.person-pill small,
.member-row small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-card em {
  margin-left: auto;
  max-width: 96px;
  color: var(--mint);
  font-size: 0.76rem;
  font-style: normal;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-live-card {
  display: none;
}

.profile-drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  justify-items: end;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  transition: opacity 160ms ease;
}

.profile-drawer[hidden] {
  display: none;
}

.profile-drawer.open {
  opacity: 1;
}

.profile-editor {
  width: min(520px, 100vw);
  height: 100%;
  overflow: auto;
  border-left: 1px solid rgba(46, 242, 189, 0.16);
  padding: 22px;
  background:
    radial-gradient(circle at 20% 0%, rgba(46, 242, 189, 0.16), transparent 17rem),
    radial-gradient(circle at 90% 22%, rgba(255, 49, 84, 0.1), transparent 15rem),
    rgba(9, 9, 9, 0.98);
  box-shadow:
    -30px 0 70px rgba(0, 0, 0, 0.36),
    inset 1px 0 0 rgba(255, 255, 255, 0.06);
  transform: translateX(26px);
  transition: transform 160ms ease;
}

.profile-drawer.open .profile-editor {
  transform: translateX(0);
}

.soft-notice {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 60;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--text);
  background: rgba(12, 12, 12, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px) scale(0.96);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  font-size: 0.86rem;
  font-weight: 900;
}

.soft-notice.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.pull-refresh-indicator {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 72;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid rgba(46, 242, 189, 0.22);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(46, 242, 189, 0.18), transparent 7rem),
    rgba(12, 12, 12, 0.94);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px) scale(0.94);
  transition:
    opacity 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 160ms ease;
  backdrop-filter: blur(18px);
}

.pull-refresh-indicator.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.pull-refresh-indicator.ready {
  border-color: rgba(46, 242, 189, 0.62);
}

.pull-refresh-indicator span {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--mint);
  border-radius: 999px;
  transform: rotate(var(--pull-rotate, 0deg));
  transition: transform 100ms linear;
}

.pull-refresh-indicator.refreshing span {
  animation: refreshSpin 760ms linear infinite;
}

.pull-refresh-indicator strong {
  font-size: 0.82rem;
  font-weight: 1000;
  white-space: nowrap;
}

@keyframes refreshSpin {
  to {
    transform: rotate(360deg);
  }
}

.incoming-notice {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 61;
  display: grid;
  gap: 2px;
  width: min(330px, calc(100vw - 28px));
  border: 1px solid rgba(46, 242, 189, 0.22);
  border-radius: 20px;
  padding: 13px 15px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(46, 242, 189, 0.18), transparent 8rem),
    rgba(12, 12, 12, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  opacity: 0;
  text-align: left;
  transform: translateY(18px) scale(0.97);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  backdrop-filter: blur(18px);
}

.incoming-notice.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.incoming-notice span {
  color: var(--mint);
  font-size: 0.72rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.incoming-notice strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-notice small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-modal {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  transition: opacity 160ms ease;
}

.action-modal[hidden] {
  display: none;
}

.action-modal.open {
  opacity: 1;
}

.action-card {
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 20px;
  background:
    radial-gradient(circle at top left, rgba(46, 242, 189, 0.14), transparent 16rem),
    rgba(13, 13, 13, 0.98);
  box-shadow: var(--shadow);
  transform: translateY(18px) scale(0.98);
  transition: transform 160ms ease;
}

.action-modal.open .action-card {
  transform: translateY(0) scale(1);
}

.action-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.action-head h2 {
  margin: 0 0 8px;
  font-size: 1.9rem;
  line-height: 1;
}

.action-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.action-fields {
  display: grid;
  gap: 14px;
}

.action-fields[hidden] {
  display: none;
}

.action-fields label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.action-fields input,
.action-fields textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 14px 15px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.action-fields textarea {
  min-height: 136px;
  max-height: 280px;
  resize: vertical;
}

.accent-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.accent-choice {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.78rem;
  font-weight: 900;
}

.accent-choice::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto 5px;
  border-radius: 999px;
  background: var(--accent-choice);
}

.accent-choice.active {
  border-color: var(--accent-choice);
  background: rgba(46, 242, 189, 0.09);
}

.delete-fields,
.info-fields {
  justify-items: center;
  text-align: center;
}

.delete-icon,
.info-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: #050505;
  background: var(--red);
  font-size: 1.3rem;
  font-weight: 1000;
}

.info-icon {
  color: #06110f;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.88), transparent 0.46rem),
    linear-gradient(135deg, var(--mint), var(--lime));
  box-shadow: 0 14px 32px rgba(46, 242, 189, 0.22);
}

.delete-fields h3,
.info-fields h3 {
  margin: 0;
  font-size: 1.35rem;
}

.delete-fields p,
.info-fields p {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.action-feedback {
  min-height: 20px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.action-feedback.error {
  color: #ff8da0;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.danger-submit {
  color: #fff;
  background: var(--red);
}

.profile-editor-head,
.profile-preview-row,
.profile-actions {
  display: flex;
  gap: 12px;
}

.profile-editor-head {
  align-items: center;
  justify-content: space-between;
}

.profile-editor h2 {
  margin: 4px 0 0;
  font-size: 2rem;
}

.profile-hero-card {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 22px 0 18px;
  border: 1px solid rgba(46, 242, 189, 0.16);
  border-radius: 28px;
  padding: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(46, 242, 189, 0.18), transparent 13rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.profile-glow {
  position: absolute;
  inset: -35% -20% auto auto;
  width: 210px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(46, 242, 189, 0.16);
  filter: blur(34px);
  pointer-events: none;
}

.profile-preview-row {
  position: relative;
  z-index: 1;
  align-items: center;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.profile-preview-row img {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  object-fit: cover;
}

.profile-preview-row strong,
.profile-preview-row small {
  display: block;
}

.profile-preview-row small,
.profile-feedback {
  color: var(--muted);
  line-height: 1.4;
}

.profile-qr-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(46, 242, 189, 0.18);
  border-radius: 24px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(46, 242, 189, 0.09), rgba(255, 255, 255, 0.045)),
    rgba(0, 0, 0, 0.22);
}

.profile-qr-code {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 24px;
  padding: 10px;
  background: #f8fffc;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(46, 242, 189, 0.18);
}

.profile-qr-code svg {
  display: block;
  width: 100%;
  height: 100%;
}

.profile-qr-card h3 {
  margin: 4px 0 6px;
  font-size: 1.24rem;
}

.profile-qr-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.profile-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-qr-actions .ghost-button {
  flex: 1 1 110px;
  min-height: 40px;
}

.profile-editor label {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: var(--muted);
  font-weight: 800;
}

.profile-editor input {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.profile-editor input:focus,
textarea:focus {
  border-color: rgba(46, 242, 189, 0.65);
}

.profile-avatar-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.profile-avatar-choice {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.profile-avatar-choice.active {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(46, 242, 189, 0.12);
}

.profile-avatar-choice img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
}

.profile-upload-row {
  display: grid;
  gap: 8px;
  margin: 14px 0 4px;
}

.profile-upload-row small {
  color: var(--muted);
  line-height: 1.4;
}

.profile-feedback {
  min-height: 20px;
  margin: 10px 0;
  font-size: 0.84rem;
}

.profile-feedback.success {
  color: var(--mint);
}

.profile-feedback.error {
  color: #ff8da0;
}

.profile-actions {
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.profile-actions .join-button {
  flex: 1 1 100%;
}

.profile-actions .ghost-button,
.profile-actions .danger-button {
  flex: 1 1 calc(50% - 6px);
}

.danger-button {
  border-radius: 14px;
  padding: 12px 14px;
  color: #ffd6dc;
  background: rgba(255, 49, 84, 0.12);
  font-weight: 900;
}

.scanner-modal {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  transition: opacity 160ms ease;
}

.scanner-modal[hidden] {
  display: none;
}

.scanner-modal.open {
  opacity: 1;
}

.scanner-card {
  width: min(460px, 100%);
  border: 1px solid rgba(46, 242, 189, 0.18);
  border-radius: 28px;
  padding: 18px;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(46, 242, 189, 0.16), transparent 14rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035)),
    rgba(10, 10, 10, 0.98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  transform: translateY(18px) scale(0.98);
  transition: transform 160ms ease;
}

.scanner-modal.open .scanner-card {
  transform: translateY(0) scale(1);
}

.scanner-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.scanner-head h2 {
  margin: 4px 0 6px;
  font-size: 2rem;
  line-height: 1;
}

.scanner-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.scanner-view {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 0.78;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(46, 242, 189, 0.08), transparent 12rem),
    #050505;
}

.scanner-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-frame {
  position: absolute;
  inset: 15%;
  border: 2px solid rgba(46, 242, 189, 0.78);
  border-radius: 24px;
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, 0.26),
    0 0 32px rgba(46, 242, 189, 0.2);
}

.scanner-feedback {
  min-height: 22px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.scanner-manual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.scanner-manual input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.scanner-manual input:focus {
  border-color: rgba(46, 242, 189, 0.62);
}

.scanner-share-button {
  width: 100%;
  margin-top: 10px;
}

.live-dot {
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(255, 49, 84, 0.14);
}

.live-dot.online {
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(46, 242, 189, 0.14);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: max-content;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 800;
}

.tab.active {
  color: #080808;
  background: var(--mint);
  border-color: var(--mint);
}

.chat-home {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 220px;
}

.chat-list {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-title span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--mint);
  background: rgba(46, 242, 189, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
}

.people-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

body.mobile-people-open .chat-home,
body.mobile-people-open .tabs {
  display: none;
}

body.mobile-people-open .people-panel {
  display: block;
}

.people-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: none;
  overflow: auto;
}

.person-pill,
.member-row {
  width: 100%;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 8px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  text-align: left;
}

.person-pill:hover,
.member-row:hover {
  border-color: rgba(46, 242, 189, 0.55);
  background: rgba(46, 242, 189, 0.08);
}

.person-pill span:last-child,
.member-row span:last-child {
  display: grid;
  min-width: 0;
}

.avatar-wrap,
.chat-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.avatar-wrap img {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  object-fit: cover;
}

.avatar-wrap i,
.chat-avatar-wrap i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border: 2px solid #0b0b0b;
  border-radius: 999px;
  background: var(--muted-2);
}

.avatar-wrap i.online,
.chat-avatar-wrap i.online {
  background: var(--mint);
}

.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.chat-item {
  display: grid;
  position: relative;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  touch-action: pan-y;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.chat-action-trigger {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.28);
  opacity: 0.72;
  pointer-events: auto;
  transform: translateY(-2px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    background 140ms ease;
  font-weight: 1000;
  letter-spacing: 0.05em;
}

.chat-item:hover .chat-action-trigger,
.chat-item:focus-within .chat-action-trigger,
.chat-item.actions-open .chat-action-trigger {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-action-trigger:hover {
  color: #06110f;
  background: var(--mint);
}

.chat-open-button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 2px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.chat-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.065);
}

.chat-item.swiping .chat-open-button {
  transform: translateX(-12px);
}

.chat-item.actions-open {
  min-height: 118px;
  border-color: rgba(46, 242, 189, 0.35);
  background:
    linear-gradient(135deg, rgba(46, 242, 189, 0.08), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.045);
}

.chat-item.active {
  border-color: rgba(255, 49, 84, 0.55);
  background: rgba(255, 49, 84, 0.12);
}

.chat-item.unread {
  border-color: rgba(46, 242, 189, 0.45);
  background:
    linear-gradient(135deg, rgba(46, 242, 189, 0.11), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.04);
}

.chat-item.pinned {
  border-color: rgba(255, 209, 102, 0.22);
}

.chat-item img,
.room-avatar,
.online-person img {
  border-radius: 16px;
  object-fit: cover;
  background: #050505;
}

.chat-item img {
  width: 48px;
  height: 48px;
}

.chat-item h3 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 5px;
  min-width: 0;
  overflow: hidden;
  font-size: 0.98rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-item h3 i {
  flex: 0 0 auto;
  border: 1px solid rgba(46, 242, 189, 0.25);
  border-radius: 999px;
  padding: 2px 5px;
  color: var(--mint);
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 1000;
  text-transform: uppercase;
}

.chat-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-copy {
  min-width: 0;
}

.chat-side {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.chat-side b {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  color: #06110f;
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(46, 242, 189, 0.12);
  font-size: 0.68rem;
  font-weight: 1000;
}

.chat-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  overflow: hidden;
  height: 0;
  max-height: 0;
  padding: 0 2px 0 62px;
  opacity: 0;
  scrollbar-width: none;
  transform: translateX(14px) scale(0.98);
  transform-origin: right center;
  pointer-events: none;
  transition:
    height 180ms ease,
    max-height 180ms ease,
    opacity 160ms ease,
    padding 160ms ease,
    transform 160ms ease;
}

.chat-item.actions-open .chat-tools {
  height: 33px;
  max-height: 42px;
  opacity: 1;
  padding-bottom: 1px;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.chat-tools::-webkit-scrollbar {
  display: none;
}

.chat-tools button {
  min-width: 0;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 6px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.chat-tools button:hover {
  color: #06110f;
  background: var(--mint);
}

.chat-tools .danger-chat-tool {
  color: #ff8ea1;
  border-color: rgba(255, 49, 84, 0.26);
  background: rgba(255, 49, 84, 0.08);
}

.chat-tools .danger-chat-tool:hover {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.chat-side small {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--mint);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-side em {
  color: var(--muted-2);
  font-size: 0.78rem;
  font-style: normal;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 8%, rgba(46, 242, 189, 0.08), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 30%),
    rgba(10, 10, 10, 0.92);
}

.empty-chat-state {
  display: none;
}

body.no-chat-selected .chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

body.no-chat-selected .empty-chat-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 100%;
  padding: 28px;
  text-align: center;
}

body.no-chat-selected .empty-chat-state img {
  width: 118px;
  height: 118px;
  border-radius: 30px;
  object-fit: cover;
  opacity: 0.92;
}

body.no-chat-selected .empty-chat-state h2 {
  margin: 10px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

body.no-chat-selected .empty-chat-state p {
  max-width: 410px;
  color: var(--muted);
  line-height: 1.5;
}

body.no-chat-selected .chat-header,
body.no-chat-selected .chat-search-strip,
body.no-chat-selected .message-stage,
body.no-chat-selected .typing-line,
body.no-chat-selected .composer-card,
body.no-chat-selected .details-panel {
  display: none;
}

.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.74);
  backdrop-filter: blur(18px);
}

.chat-search-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(18px);
}

.chat-search-strip[hidden] {
  display: none;
}

.chat-search-strip label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.06);
}

.chat-search-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.chat-search-strip input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.chat-search-strip button {
  border: 1px solid rgba(46, 242, 189, 0.34);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(46, 242, 189, 0.08);
  font-weight: 900;
}

.back-button {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  border-radius: 999px;
  padding: 8px 12px 8px 9px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-weight: 900;
}

.back-button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #050505;
  background: var(--mint);
  font-size: 1.65rem;
  line-height: 0.7;
}

.back-button:hover {
  border-color: rgba(46, 242, 189, 0.75);
  background: rgba(46, 242, 189, 0.12);
}

.room-avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.room-copy {
  flex: 1;
  min-width: 0;
}

.room-title-row {
  gap: 10px;
}

.room-copy h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-copy p {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.room-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 49, 84, 0.45);
  border-radius: 999px;
  padding: 5px 9px;
  color: #ffc7d0;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.message-stage {
  overflow: auto;
  padding: 22px clamp(16px, 3vw, 40px);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 49, 84, 0.045), transparent 18rem),
    radial-gradient(circle at 90% 16%, rgba(46, 242, 189, 0.055), transparent 21rem);
  scroll-behavior: smooth;
}

.day-pill {
  width: max-content;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.34);
  font-size: 0.8rem;
}

.message {
  display: grid;
  grid-template-columns: 38px minmax(0, 680px);
  gap: 10px;
  margin: 0 0 16px;
  animation: messageIn 160ms ease both;
}

.message.mine {
  grid-template-columns: minmax(0, 680px) 38px;
  justify-content: end;
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  object-fit: cover;
}

.message.mine .message-avatar {
  grid-column: 2;
}

.bubble {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px 22px 22px 7px;
  padding: 12px 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
}

.message.mine .bubble {
  grid-column: 1;
  grid-row: 1;
  border-radius: 22px 22px 7px 22px;
  border-color: rgba(46, 242, 189, 0.32);
  background:
    linear-gradient(135deg, rgba(46, 242, 189, 0.2), rgba(255, 255, 255, 0.075)),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 14px 34px rgba(46, 242, 189, 0.08);
}

.message-meta {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 7px;
}

.message-meta-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.message-meta-right em {
  color: var(--muted-2);
  font-size: 0.72rem;
  font-style: normal;
}

.message-meta-right .message-status {
  color: var(--mint);
  font-weight: 1000;
}

.message.pending .bubble {
  opacity: 0.72;
}

.message.pending .message-status {
  color: var(--muted);
}

.message-actions {
  position: absolute;
  top: auto;
  right: 8px;
  bottom: calc(100% + 8px);
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(360px, calc(100vw - 34px));
  max-width: min(360px, calc(100vw - 34px));
  gap: 6px;
  border: 1px solid rgba(46, 242, 189, 0.16);
  border-radius: 24px;
  padding: 7px;
  background:
    radial-gradient(circle at 12% 16%, rgba(46, 242, 189, 0.18), transparent 8rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.04)),
    rgba(9, 9, 9, 0.94);
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
  transition:
    opacity 140ms ease,
    transform 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.message.actions-open .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.message-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.22);
  font-size: 0.7rem;
  font-weight: 900;
  backdrop-filter: blur(10px);
  transition:
    transform 130ms ease,
    border-color 130ms ease,
    background 130ms ease,
    color 130ms ease;
}

.message-actions button:hover {
  color: #050505;
  border-color: rgba(46, 242, 189, 0.58);
  background:
    radial-gradient(circle at 35% 15%, rgba(255, 255, 255, 0.48), transparent 1.8rem),
    linear-gradient(135deg, var(--mint), #0ec69f);
  box-shadow: 0 10px 24px rgba(46, 242, 189, 0.24);
  transform: translateY(-2px);
}

.message-actions button:active {
  transform: translateY(0) scale(0.97);
}

.message-actions button:focus-visible {
  outline: 2px solid rgba(46, 242, 189, 0.55);
  outline-offset: 2px;
}

.message-actions .danger-message-action {
  color: #ff9aad;
  border-color: rgba(255, 49, 84, 0.26);
}

.message-actions .danger-message-action:hover {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.message-reaction-picker {
  grid-column: 1 / -1;
  display: inline-flex;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 2px;
  border: 1px solid rgba(46, 242, 189, 0.16);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.045);
}

.message-reaction-picker button {
  display: grid;
  place-items: center;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: 38px;
  padding: 0;
  font-size: 1.28rem;
  transition:
    transform 130ms ease,
    background 130ms ease;
}

.message-reaction-picker button:hover {
  transform: translateY(-5px) scale(1.18);
}

.message-more-button:hover,
.chat-action-trigger:hover {
  color: #050505;
  border-color: rgba(46, 242, 189, 0.5);
  background: var(--mint);
  box-shadow: 0 10px 24px rgba(46, 242, 189, 0.18);
  transform: translateY(-1px);
}

.message-more-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  opacity: 0.72;
  pointer-events: auto;
  transition:
    opacity 120ms ease,
    background 120ms ease,
    color 120ms ease;
  font-weight: 1000;
}

.message:hover .message-more-button,
.message:focus-within .message-more-button,
.message.actions-open .message-more-button {
  opacity: 1;
  pointer-events: auto;
}

.message-more-button:hover {
  color: #06110f;
  background: var(--mint);
}

.message.swiped-reply .bubble {
  transform: translateX(10px);
  box-shadow:
    0 0 0 3px rgba(46, 242, 189, 0.12),
    0 18px 44px rgba(46, 242, 189, 0.12);
}

.message-name {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
}

.identity-line {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  gap: 4px;
  line-height: 1;
  vertical-align: middle;
}

.identity-line.compact {
  gap: 4px;
}

.identity-text {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verified-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  color: #050505;
  background: var(--mint);
  line-height: 1;
  vertical-align: middle;
}

.identity-line.compact .verified-badge {
  width: 13px;
  height: 13px;
}

.verified-badge svg {
  display: block;
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.identity-line.compact .verified-badge svg {
  width: 9px;
  height: 9px;
}

.message-time {
  font-size: 0.76rem;
}

.message-body {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.reply-preview {
  display: grid;
  gap: 3px;
  width: 100%;
  margin: 0 0 9px;
  border: 1px solid rgba(46, 242, 189, 0.22);
  border-left: 3px solid var(--mint);
  border-radius: 14px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(46, 242, 189, 0.08);
  text-align: left;
}

.reply-preview strong {
  color: var(--mint);
  font-size: 0.78rem;
}

.reply-preview span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message.deleted .bubble {
  border-style: dashed;
  opacity: 0.74;
}

.message.fresh .bubble {
  border-color: rgba(46, 242, 189, 0.58);
  box-shadow:
    0 0 0 3px rgba(46, 242, 189, 0.1),
    0 18px 44px rgba(46, 242, 189, 0.12);
}

body.incoming-pulse .chat-panel {
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(46, 242, 189, 0.2),
    inset 0 0 80px rgba(46, 242, 189, 0.045);
}

.deleted-copy {
  color: var(--muted);
  font-style: italic;
}

.mention {
  border: 0;
  border-radius: 999px;
  padding: 1px 6px;
  color: #050505;
  background: var(--mint);
  font: inherit;
  font-weight: 900;
}

.reaction-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.2);
}

.reaction-button {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.9rem;
}

.reaction-button span {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.reaction-button.active,
.reaction-button:hover {
  border-color: rgba(46, 242, 189, 0.72);
  background: rgba(46, 242, 189, 0.12);
}

.attachments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.attachment-image,
.attachment-video {
  width: min(100%, 420px);
  max-height: 320px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #050505;
}

.media-open {
  display: block;
  width: fit-content;
  max-width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.attachment-audio {
  width: min(100%, 420px);
}

.attachment-chip {
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.forward-preview {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
}

.forward-room-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.forward-room-list button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.forward-room-list button.active {
  border-color: rgba(46, 242, 189, 0.6);
  background: rgba(46, 242, 189, 0.12);
}

.forward-room-list img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
}

.forward-room-list strong,
.forward-room-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-room-list small {
  color: var(--muted);
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(18px);
}

.media-viewer-card {
  display: grid;
  gap: 12px;
  width: min(980px, 100%);
  max-height: 92dvh;
}

.media-viewer-head,
.media-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 9px;
  color: var(--text);
  background: rgba(12, 12, 12, 0.92);
}

.media-viewer-head strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-viewer-head a,
.media-viewer-head button,
.media-viewer-actions button {
  border: 1px solid rgba(46, 242, 189, 0.28);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--text);
  background: rgba(46, 242, 189, 0.08);
  text-decoration: none;
  font-weight: 900;
}

.media-viewer-stage {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  background: #050505;
}

.media-viewer-stage img,
.media-viewer-stage video {
  display: block;
  max-width: 100%;
  max-height: 72dvh;
  object-fit: contain;
}

.media-viewer-actions {
  justify-content: center;
}

.attachment-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 49, 84, 0.18);
  color: #ffc7d0;
  font-size: 0.75rem;
  font-weight: 900;
}

.typing-line {
  min-height: 24px;
  padding: 0 24px;
  color: var(--mint);
  font-size: 0.9rem;
}

.composer-card {
  margin: 0 18px 18px;
  position: relative;
  border: 1px solid rgba(46, 242, 189, 0.14);
  border-radius: 24px;
  padding: 12px;
  background:
    radial-gradient(circle at 12% 0%, rgba(46, 242, 189, 0.14), transparent 12rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.04)),
    rgba(8, 8, 8, 0.9);
  box-shadow:
    0 20px 58px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.composer-card::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-50%);
}

.mention-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
}

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

.mention-suggestions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(46, 242, 189, 0.35);
  border-radius: 999px;
  padding: 6px 9px 6px 6px;
  color: var(--text);
  background: rgba(46, 242, 189, 0.08);
  font-size: 0.82rem;
  font-weight: 900;
}

.mention-suggestions img {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
}

.quick-command-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
}

.quick-command-bar::-webkit-scrollbar {
  display: none;
}

.quick-command-bar button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.2);
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.quick-command-bar button:hover {
  border-color: rgba(46, 242, 189, 0.55);
  background: rgba(46, 242, 189, 0.1);
  transform: translateY(-1px);
}

.reply-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  border: 1px solid rgba(46, 242, 189, 0.28);
  border-left: 4px solid var(--mint);
  border-radius: 16px;
  padding: 9px 10px 9px 12px;
  background: rgba(46, 242, 189, 0.08);
}

.reply-composer[hidden] {
  display: none;
}

.reply-composer span {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.reply-composer strong {
  color: var(--mint);
  font-size: 0.8rem;
}

.reply-composer small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-composer button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  font-weight: 1000;
}

.voice-recording {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 10px;
  border: 1px solid rgba(255, 49, 84, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 49, 84, 0.17), rgba(46, 242, 189, 0.08)),
    rgba(255, 255, 255, 0.055);
  box-shadow: 0 14px 30px rgba(255, 49, 84, 0.12);
}

.voice-recording[hidden] {
  display: none;
}

.voice-recording strong {
  font-size: 0.86rem;
  line-height: 1;
}

.voice-recording time {
  min-width: 42px;
  border-radius: 999px;
  padding: 4px 7px;
  color: #fff;
  background: rgba(255, 49, 84, 0.32);
  font-size: 0.82rem;
  font-weight: 1000;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.recording-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 49, 84, 0.45);
}

.voice-recording.is-recording .recording-dot {
  animation: recordingPulse 1.15s ease-out infinite;
}

.voice-recording.is-saving {
  border-color: rgba(46, 242, 189, 0.34);
  background:
    linear-gradient(135deg, rgba(46, 242, 189, 0.15), rgba(255, 209, 102, 0.09)),
    rgba(255, 255, 255, 0.055);
  box-shadow: 0 14px 30px rgba(46, 242, 189, 0.12);
}

.voice-recording.is-saving .recording-dot {
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(46, 242, 189, 0.12);
}

.voice-recording.is-saving time {
  color: #06110f;
  background: var(--mint);
}

@keyframes recordingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 49, 84, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 49, 84, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 49, 84, 0);
  }
}

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

.tool-button,
.send-button,
.join-button,
.ghost-button {
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
}

.tool-button {
  display: inline-grid;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.24);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.16);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.tool-button.icon-tool {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  padding: 0;
  border-radius: 16px;
  font-size: 1.18rem;
}

.tool-button.icon-tool.recording {
  color: #fff;
  background: rgba(255, 49, 84, 0.76);
  box-shadow: 0 10px 24px rgba(255, 49, 84, 0.24);
}

.tool-button.icon-tool:hover {
  border-color: rgba(46, 242, 189, 0.44);
  background: rgba(46, 242, 189, 0.1);
  transform: translateY(-1px);
}

.ghost-button {
  width: 100%;
  border: 1px solid rgba(46, 242, 189, 0.45);
  color: var(--text);
  background: rgba(46, 242, 189, 0.08);
}

.ghost-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.send-button,
.join-button {
  border: 0;
  color: #060606;
  background: var(--mint);
}

.send-button {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  padding: 0;
  border-radius: 17px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.55), transparent 1.8rem),
    linear-gradient(135deg, var(--mint), #0ebf9d);
  box-shadow:
    0 12px 28px rgba(46, 242, 189, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.send-button svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: currentColor;
  transform: translateX(1px);
}

.send-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(46, 242, 189, 0.24);
}

.send-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.join-button.danger-submit {
  color: #fff;
  background: var(--red);
}

textarea {
  flex: 1;
  min-height: 46px;
  max-height: 140px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  padding: 12px 14px;
  outline: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.045)),
    rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

textarea:focus {
  border-color: rgba(46, 242, 189, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 4px rgba(46, 242, 189, 0.08);
}

.composer-note {
  margin: 10px 4px 0;
  font-size: 0.82rem;
}

.attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
}

.preview-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
}

.preview-pill button {
  border: 0;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  color: var(--text);
  background: rgba(255, 49, 84, 0.4);
}

.details-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  overflow: auto;
}

.profile-card {
  text-align: center;
  padding: 12px 0 4px;
}

.profile-card img {
  width: 112px;
  height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  object-fit: cover;
}

.profile-card h2 {
  margin: 14px 0 4px;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.detail-block h3 {
  margin-bottom: 12px;
  font-size: 0.94rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.media-grid a,
.media-empty {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.055);
}

.media-grid img,
.media-grid video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.online-list {
  display: grid;
  gap: 10px;
}

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

.online-person {
  gap: 10px;
  color: var(--text);
}

.online-person img {
  width: 34px;
  height: 34px;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 16px;
}

.avatar-choice {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.avatar-choice.active {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(46, 242, 189, 0.12);
}

.avatar-choice img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
  display: block;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 450px);
  align-items: center;
  gap: clamp(20px, 6vw, 80px);
  padding: clamp(22px, 5vw, 70px);
  background:
    radial-gradient(circle at 26% 50%, rgba(255, 49, 84, 0.3), transparent 24rem),
    radial-gradient(circle at 75% 20%, rgba(46, 242, 189, 0.18), transparent 26rem),
    rgba(5, 5, 5, 0.96);
  overflow: auto;
}

.login-screen.hidden {
  display: none;
}

.login-art {
  min-width: 0;
}

.login-art img {
  width: min(100%, 680px);
  max-height: 82vh;
  object-fit: contain;
  filter: drop-shadow(0 38px 80px rgba(255, 49, 84, 0.18));
}

.login-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(22px, 4vw, 34px);
  background: rgba(14, 14, 14, 0.86);
  box-shadow: var(--shadow);
}

.auth-panel {
  display: grid;
  gap: 2px;
}

.auth-panel.hidden {
  display: none;
}

.signup-intro {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 4px;
}

.auth-step {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.auth-step.active {
  border-color: var(--mint);
  color: #050505;
  background: var(--mint);
}

.login-logo {
  width: 76px;
  height: 76px;
  margin-bottom: 12px;
  border-radius: 22px;
  object-fit: contain;
  object-position: center;
  padding: 6px;
  background: #050505;
}

.login-card h2 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 0.94;
}

.login-card label {
  display: grid;
  gap: 8px;
  margin: 14px 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.login-card label small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.login-card label small.good {
  color: var(--mint);
}

.login-card label small.bad {
  color: #ff8da0;
}

.username-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.username-suggestions button {
  border: 1px solid rgba(46, 242, 189, 0.45);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--mint);
  background: rgba(46, 242, 189, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
}

.username-suggestions button:hover {
  color: #050505;
  background: var(--mint);
}

.login-card input {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.055);
}

.join-button {
  width: 100%;
  min-height: 50px;
}

.join-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-feedback {
  min-height: 20px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-feedback.success {
  color: var(--mint);
}

.auth-feedback.error {
  color: #ff8da0;
}

.switch-auth {
  border: 0;
  margin-top: 8px;
  color: var(--mint);
  background: transparent;
  font-weight: 900;
}

.switch-auth.muted {
  color: var(--muted);
}

.switch-auth:hover {
  color: var(--text);
}

.fine-print {
  margin: 14px 0 0;
  font-size: 0.82rem;
  text-align: center;
}

.glow-soft {
  --red: #ff4668;
  --mint: #7cffd8;
  --panel: rgba(25, 25, 25, 0.84);
}

.mobile-nav {
  display: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 72px minmax(250px, 330px) minmax(0, 1fr);
  }

  .details-panel {
    position: fixed;
    top: 14px;
    right: 14px;
    bottom: 14px;
    width: min(330px, calc(100vw - 28px));
    z-index: 10;
    transform: translateX(calc(100% + 18px));
    transition: transform 180ms ease;
  }

  .details-panel.open {
    transform: translateX(0);
  }
}

@media (max-width: 760px) {
  :root {
    --mobile-nav-height: 72px;
  }

  body {
    overflow: hidden;
    width: 100vw;
    background: #070707;
  }

  body.no-chat-selected .app-shell,
  .app-shell {
    grid-template-columns: 1fr;
    height: 100dvh;
    padding: 0;
    gap: 0;
  }

  .rail {
    display: none;
  }

  .sidebar,
  .chat-panel {
    width: 100vw;
    max-width: 100vw;
    height: calc(100dvh - var(--mobile-nav-height));
    border-radius: 0;
    border: 0;
    overflow-x: hidden;
  }

  .sidebar {
    display: flex;
    padding: calc(16px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom));
    gap: 12px;
    background: #080808;
  }

  body.day-mode .sidebar {
    background: #eef5f2;
  }

  body.day-mode .mobile-nav {
    background: rgba(250, 253, 251, 0.96);
  }

  .sidebar-header {
    flex: 0 0 auto;
    min-height: 48px;
    align-items: center;
  }

  .sidebar-header .eyebrow,
  .status-card {
    display: none;
  }

  .sidebar-header h1 {
    font-size: clamp(1.45rem, 7vw, 1.85rem);
    line-height: 1.04;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .icon-button {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 14px;
  }

  .search-box {
    flex: 0 0 auto;
    border-radius: 20px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.07);
  }

  .search-box span {
    display: none;
  }

  .search-box input {
    min-height: 28px;
    font-size: 0.98rem;
  }

  .quick-connect {
    flex: 0 0 auto;
    padding: 10px;
  }

  .me-card {
    min-height: 66px;
    flex: 0 0 auto;
    border-radius: 20px;
  }

  .me-card em {
    display: none;
  }

  .mobile-live-card {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(46, 242, 189, 0.18);
    border-radius: 20px;
    padding: 11px 12px;
    background:
      radial-gradient(circle at 12% 20%, rgba(46, 242, 189, 0.16), transparent 9rem),
      linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  }

  .mobile-live-card div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    min-width: 0;
  }

  .mobile-live-card strong,
  .mobile-live-card small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-live-card strong {
    font-size: 0.88rem;
  }

  .mobile-live-card small {
    grid-column: 2;
    color: var(--muted);
    font-size: 0.75rem;
  }

  .mobile-live-card button {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(46, 242, 189, 0.26);
    border-radius: 15px;
    color: var(--mint);
    background: rgba(46, 242, 189, 0.08);
    font-size: 1.12rem;
    font-weight: 1000;
  }

  .tabs {
    flex: 0 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    min-height: 42px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .chat-home {
    min-height: 0;
  }

  .chat-list {
    gap: 8px;
    padding: 0 2px 12px 0;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
  }

  .chat-item {
    min-height: 72px;
    border-radius: 18px;
    padding: 9px;
    background: rgba(255, 255, 255, 0.055);
  }

  .chat-action-trigger {
    top: 13px;
    right: 72px;
    width: 30px;
    height: 26px;
  }

  .chat-item:hover {
    transform: none;
  }

  .chat-open-button {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .chat-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0 1px 0 55px;
  }

  .chat-tools button {
    min-height: 30px;
    padding: 5px 6px;
    font-size: 0.66rem;
  }

  .chat-side small {
    padding: 4px 8px;
  }

  body.no-chat-selected .chat-panel,
  .chat-panel {
    display: none;
  }

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

  body.chat-open .chat-panel {
    display: grid;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    animation: mobileChatIn 180ms ease both;
  }

  .mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 18;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: calc(var(--mobile-nav-height) - 10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 7px;
    background:
      radial-gradient(circle at 15% 10%, rgba(46, 242, 189, 0.12), transparent 8rem),
      linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
      rgba(9, 9, 9, 0.92);
    box-shadow:
      0 18px 48px rgba(0, 0, 0, 0.36),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-button {
    display: grid;
    place-items: center;
    gap: 3px;
    border: 0;
    border-radius: 17px;
    color: var(--muted);
    background: transparent;
    font-weight: 900;
    transition:
      transform 150ms ease,
      background 150ms ease,
      color 150ms ease;
  }

  .mobile-nav-button span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 24px;
    font-size: 1.2rem;
    line-height: 1;
  }

  .mobile-nav-button small {
    font-size: 0.62rem;
  }

  .mobile-nav-button.active {
    color: #050505;
    background:
      radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.52), transparent 2rem),
      linear-gradient(135deg, var(--mint), #0ec69f);
    box-shadow:
      0 10px 28px rgba(46, 242, 189, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.36);
    transform: translateY(-1px);
  }

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

  .profile-editor {
    width: 100vw;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
  }

  .profile-hero-card {
    padding: 12px;
  }

  .profile-preview-row {
    width: 100%;
    min-width: 0;
  }

  .profile-preview-row img {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
  }

  .profile-preview-row div {
    min-width: 0;
  }

  .profile-qr-card {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
    text-align: center;
  }

  .profile-qr-code {
    width: min(176px, 76vw);
    height: min(176px, 76vw);
    border-radius: 21px;
  }

  .profile-qr-card > div:not(.profile-qr-code) {
    width: 100%;
    min-width: 0;
  }

  .profile-qr-card h3 {
    font-size: 1.18rem;
  }

  .profile-qr-actions .ghost-button {
    flex-basis: 100%;
  }

  .scanner-card {
    max-height: calc(100dvh - 24px);
    overflow: auto;
    border-radius: 24px;
    padding: 15px;
  }

  .scanner-view {
    aspect-ratio: 1;
  }

  .scanner-manual {
    grid-template-columns: 1fr;
  }

  body.mobile-people-open .people-panel {
    display: block;
    flex: 1 1 auto;
    overflow: auto;
  }

  body.mobile-people-open .people-list {
    max-height: none;
  }

  .back-button {
    display: inline-flex;
    min-width: 76px;
    min-height: 42px;
    padding: 7px 10px 7px 7px;
  }

  .chat-header {
    position: sticky;
    top: 0;
    z-index: 3;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 64px;
    gap: 8px;
    padding: calc(8px + env(safe-area-inset-top)) 8px 8px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
      rgba(9, 9, 9, 0.94);
    backdrop-filter: blur(18px);
  }

  .room-avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .room-copy h2 {
    font-size: 1rem;
  }

  .room-copy p {
    font-size: 0.78rem;
  }

  .room-badge {
    display: none;
  }

  .chat-header .icon-button {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .chat-search-strip {
    padding: 8px 10px;
    gap: 7px;
  }

  .chat-search-strip span {
    display: none;
  }

  .chat-search-strip label {
    padding: 8px 11px;
  }

  .chat-search-strip button {
    padding: 8px 10px;
  }

  .message-stage {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px 10px 10px;
    overflow-x: hidden;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
  }

  .message,
  .message.mine {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 10px;
  }

  .message-avatar {
    display: none;
  }

  .bubble {
    max-width: min(88vw, 560px);
    border-radius: 19px 19px 19px 6px;
    padding: 10px 11px;
  }

  .message.mine .bubble {
    grid-column: auto;
    justify-self: end;
    border-radius: 19px 19px 6px 19px;
  }

  .message-actions {
    top: auto;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(304px, calc(100vw - 24px));
    max-width: min(304px, calc(100vw - 24px));
    gap: 6px;
    border-radius: 24px;
    padding: 7px;
    overflow: visible;
    scrollbar-width: none;
    justify-content: stretch;
  }

  .message-actions::-webkit-scrollbar {
    display: none;
  }

  .message-actions button {
    justify-content: center;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .message-reaction-picker {
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 6px;
    margin: 0 0 2px;
    border: 1px solid rgba(46, 242, 189, 0.16);
    border-radius: 999px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.045);
  }

  .message-reaction-picker button {
    flex: 1 1 0;
    width: auto;
    height: 38px;
    min-width: 0;
    font-size: 1.18rem;
  }

  .message-more-button,
  .chat-action-trigger {
    opacity: 1;
    pointer-events: auto;
  }

  .message-meta {
    gap: 8px;
  }

  .message-meta-right {
    gap: 5px;
  }

  .reaction-button {
    min-height: 28px;
    padding: 3px 7px;
  }

  .typing-line {
    min-height: 20px;
    padding: 0 14px;
    font-size: 0.82rem;
  }

  .composer-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
      rgba(8, 8, 8, 0.96);
    backdrop-filter: blur(18px);
    box-shadow: 0 -18px 45px rgba(0, 0, 0, 0.28);
  }

  .incoming-notice {
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    border-radius: 18px;
  }

  .composer-row {
    gap: 7px;
    align-items: flex-end;
  }

  textarea {
    min-height: 46px;
    max-height: 112px;
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 18px;
    padding: 12px 13px;
  }

  .tool-button.icon-tool,
  .send-button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 15px;
  }

  .send-button {
    margin-left: 0;
  }

  .composer-note {
    display: none;
  }

  .attachment-preview,
  .reply-composer,
  .mention-suggestions,
  .quick-command-bar {
    max-height: 86px;
    overflow: auto;
  }

  .reply-composer {
    max-height: none;
    overflow: hidden;
  }

  .voice-recording {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 8px 10px;
  }

  .voice-recording strong {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .quick-command-bar {
    padding-bottom: 8px;
  }

  .details-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 22;
    width: 100%;
    max-height: 72dvh;
    border-radius: 22px 22px 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    transform: translateY(calc(100% + 18px));
  }

  .details-panel.open {
    transform: translateY(0);
  }

  .action-modal {
    align-items: end;
    place-items: end center;
    padding: 0;
  }

  .action-card {
    width: 100%;
    max-height: 86dvh;
    overflow: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }

  .action-modal.open .action-card {
    transform: translateY(0);
  }

  .action-head h2 {
    font-size: 1.65rem;
  }

  .action-buttons {
    position: sticky;
    bottom: 0;
    margin: 0 -2px;
    padding-top: 8px;
    background: linear-gradient(180deg, transparent, rgba(13, 13, 13, 0.98) 28%);
  }

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

  .profile-editor {
    width: 100vw;
    border-left: 0;
  }

  .profile-actions .ghost-button,
  .profile-actions .danger-button {
    flex-basis: 100%;
  }

  .login-screen {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    padding: 14px;
    overflow: auto;
  }

  .login-art {
    display: none;
  }

  .login-card {
    width: 100%;
    max-width: 460px;
    margin: auto;
    border-radius: 22px;
  }

  .login-card h2 {
    font-size: 2.5rem;
  }

  .auth-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .tool-button.icon-tool,
  .send-button {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  textarea {
    min-height: 42px;
    padding: 10px 11px;
  }

  .back-button strong {
    display: none;
  }

  .back-button {
    min-width: 42px;
    padding: 7px;
  }
}

@keyframes mobileChatIn {
  from {
    opacity: 0.72;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
