:root {
  color-scheme: dark;
  --bg: #050816;
  --panel: rgba(8, 18, 32, 0.76);
  --panel-strong: rgba(8, 18, 32, 0.94);
  --line: rgba(34, 211, 238, 0.22);
  --cyan: #00e5ff;
  --mint: #2dd4bf;
  --pink: #f472b6;
  --amber: #f59e0b;
  --text: #f8fafc;
  --muted: rgba(203, 213, 225, 0.7);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 229, 255, 0.28), transparent 18rem),
    radial-gradient(circle at 78% 8%, rgba(244, 114, 182, 0.2), transparent 20rem),
    radial-gradient(circle at 52% 92%, rgba(45, 212, 191, 0.16), transparent 20rem),
    linear-gradient(145deg, #050816, #071426 55%, #020617);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(34, 211, 238, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 5px);
  opacity: 0.22;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 72px minmax(260px, 340px) minmax(0, 1fr);
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.auth-screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(94vw, 440px);
  padding: 1.2rem;
  border: 1px solid rgba(0, 229, 255, 0.36);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(8, 18, 32, 0.94), rgba(8, 47, 73, 0.72)),
    var(--panel-strong);
  box-shadow: 0 0 44px rgba(0, 229, 255, 0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}

.wavee-mark.big {
  width: 68px;
  height: 68px;
  margin-bottom: 1rem;
  font-size: 1.45rem;
}

.auth-card h1 {
  font-size: 2rem;
}

.auth-copy {
  margin: 0.55rem 0 1rem;
  color: var(--muted);
  line-height: 1.45;
}

.auth-card form {
  display: grid;
  gap: 0.75rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0.8rem 0 1rem;
}

.auth-tabs button,
.link-btn {
  min-height: 40px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 10px;
  color: var(--text);
  background: rgba(8, 47, 73, 0.42);
  font-weight: 900;
}

.auth-tabs button.active {
  border-color: rgba(45, 212, 191, 0.62);
  color: #ecfeff;
  background: rgba(8, 145, 178, 0.72);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.16);
}

.link-btn {
  min-height: 34px;
  color: var(--cyan);
  background: transparent;
}

.auth-card label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-card input,
.add-contact input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: rgba(2, 6, 23, 0.56);
  padding: 0 0.85rem;
}

.auth-card button {
  min-height: 44px;
  border: 1px solid rgba(45, 212, 191, 0.54);
  border-radius: 10px;
  color: #ecfeff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.9), rgba(244, 114, 182, 0.72));
  font-weight: 950;
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.22);
}

.rail {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0.7rem;
  border-right: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(18px);
}

.rail-logo,
.rail-item,
.rail-settings {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 12px;
  color: var(--text);
  background: rgba(8, 47, 73, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.62rem;
  font-weight: 950;
  text-align: center;
}

.rail-settings {
  font-size: 0.54rem;
  line-height: 1;
}

.rail-logo {
  margin-bottom: 0.8rem;
  background: rgba(2, 6, 23, 0.32);
  font-weight: 950;
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  padding: 0.28rem;
}

.rail-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 10px;
}

.rail-item.active,
.rail-item:hover,
.rail-settings:hover {
  border-color: rgba(45, 212, 191, 0.72);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.22);
}

.rail-item {
  position: relative;
}

.rail-item.has-badge::after {
  content: attr(data-badge);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #f59e0b);
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.48);
  font-size: 0.62rem;
  font-weight: 950;
}

.rail-settings {
  margin-top: auto;
}

.sidebar {
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 1rem;
  border-right: 1px solid var(--line);
  background: rgba(8, 18, 32, 0.58);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.brand-card,
.conversation-top,
.glass-panel,
.composer,
.chat-item,
.message {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 48px rgba(0, 0, 0, 0.22);
}

.brand-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

.wavee-mark,
.profile-photo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid rgba(0, 229, 255, 0.55);
  border-radius: 14px;
  color: #ecfeff;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.95), rgba(244, 114, 182, 0.72)),
    #071426;
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.36), inset 0 1px 0 rgba(255,255,255,0.22);
  font-weight: 950;
}

.brand-card {
  gap: 0.8rem;
  justify-content: flex-start;
}

.brand-card.compact-title {
  min-height: 66px;
  padding: 1rem 1.05rem;
}

.brand-card.compact-title .eyebrow {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.58);
}

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

.mobile-more,
.mobile-more-panel {
  display: none;
}

.profile-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
}

.profile-photo {
  background-size: cover;
  background-position: center;
}

.profile-card strong,
.profile-card span {
  display: block;
}

.profile-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.mini-btn {
  min-height: 34px;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 9px;
  color: var(--text);
  background: rgba(8, 47, 73, 0.68);
  font-size: 0.72rem;
  font-weight: 950;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.brand-card h1 {
  font-size: 1.55rem;
}

.live-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.85);
}

.live-dot.offline {
  background: #f59e0b;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.72);
}

.search-wrap {
  margin: 0.9rem 0;
}

.add-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.add-contact button {
  min-height: 44px;
  border: 1px solid rgba(45, 212, 191, 0.42);
  border-radius: 10px;
  color: var(--text);
  background: rgba(8, 145, 178, 0.72);
  font-weight: 950;
}

.search-wrap input,
.composer input,
.composer textarea {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: rgba(2, 6, 23, 0.46);
  padding: 0 0.9rem;
  font: inherit;
}

.composer textarea {
  resize: none;
  line-height: 1.25;
  padding-top: 0.72rem;
  padding-bottom: 0.5rem;
  overflow-y: auto;
}

.chat-list {
  display: grid;
  gap: 0.65rem;
  overflow: auto;
  max-height: calc(100% - 235px);
  padding-right: 0.15rem;
}

.empty-list {
  padding: 0.85rem;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(2, 6, 23, 0.36);
  font-size: 0.85rem;
}

.hidden-lock {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem;
  border: 1px solid rgba(244, 114, 182, 0.28);
  border-radius: 12px;
  color: var(--text);
  background: rgba(76, 5, 25, 0.2);
  box-shadow: 0 0 24px rgba(244, 114, 182, 0.1);
}

.hidden-lock span {
  color: var(--muted);
  font-size: 0.82rem;
}

.hidden-lock button {
  min-height: 38px;
  border: 1px solid rgba(244, 114, 182, 0.42);
  border-radius: 9px;
  color: var(--text);
  background: rgba(8, 47, 73, 0.72);
  font-weight: 900;
}

.request-title {
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.request-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 12px;
  background: rgba(3, 18, 32, 0.68);
}

.request-card.outgoing {
  opacity: 0.78;
}

.request-actions {
  display: flex;
  gap: 0.35rem;
}

.request-actions button {
  min-height: 32px;
  border: 1px solid rgba(45, 212, 191, 0.38);
  border-radius: 8px;
  color: var(--text);
  background: rgba(8, 145, 178, 0.72);
  font-size: 0.72rem;
  font-weight: 950;
}

.request-actions button[data-action="decline"] {
  border-color: rgba(244, 114, 182, 0.35);
  background: rgba(76, 5, 25, 0.58);
}

.group-create {
  gap: 0.75rem;
  align-items: stretch;
}

.group-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.25rem 0 0.35rem;
}

.group-toolbar button {
  min-height: 42px;
  border: 1px solid rgba(34, 211, 238, 0.48);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.88), rgba(14, 116, 144, 0.72));
  font-weight: 950;
}

.group-toolbar span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.group-room-list {
  display: grid;
  gap: 0.65rem;
}

.group-create-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}

.group-create-head span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.group-create input[type="text"] {
  min-height: 40px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 10px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.62);
  padding: 0 0.75rem;
}

#groupContactChoices {
  display: grid;
  gap: 0.5rem;
  max-height: min(48dvh, 420px);
  overflow: auto;
  padding-right: 0.2rem;
}

.group-choice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.36);
  color: var(--text);
  font-weight: 850;
}

.group-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.chat-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.72rem;
  color: var(--text);
  text-align: left;
}

.chat-item.active,
.chat-item:hover {
  border-color: rgba(45, 212, 191, 0.58);
  background: rgba(8, 47, 73, 0.56);
}

.chat-item.unread {
  border-color: rgba(34, 211, 238, 0.72);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.36), rgba(2, 6, 23, 0.74));
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.16), inset 3px 0 0 var(--cyan);
}

.chat-item.unread .chat-meta strong {
  color: #f8feff;
}

.chat-item.unread .chat-meta span {
  color: #bae6fd;
  font-weight: 850;
}

.chat-item.unread .pill {
  border-color: rgba(45, 212, 191, 0.72);
  color: #ecfeff;
  background: rgba(8, 145, 178, 0.58);
}

.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid rgba(34, 211, 238, 0.42);
  border-radius: 12px;
  color: #ecfeff;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.96), rgba(244, 114, 182, 0.42));
  font-weight: 950;
}

.avatar.photo {
  background-size: cover;
  background-position: center;
  color: transparent;
}

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

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

.chat-meta span,
.room-title p,
.glass-panel p {
  color: var(--muted);
  font-size: 0.82rem;
}

.pill {
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 999px;
  padding: 0.16rem 0.42rem;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 900;
}

.conversation {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 1rem;
}

.conversation-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 72px;
  padding: 0.8rem;
}

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

.room-title h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  gap: 0.45rem;
}

.top-actions button,
.composer button,
.wide-btn,
.mobile-menu {
  min-height: 40px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 10px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.86), rgba(15, 23, 42, 0.84));
  font-weight: 850;
}

.top-actions button,
.mobile-menu {
  min-width: 54px;
  padding: 0 0.55rem;
}

.mobile-menu {
  display: none;
}

.messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: auto;
  padding: 1rem 0.2rem;
  scroll-behavior: auto;
  overflow-anchor: none;
  contain: layout paint;
}

.messages.drag-over {
  outline: 2px solid rgba(0, 229, 255, 0.58);
  outline-offset: -8px;
  background-color: rgba(0, 229, 255, 0.05);
}

.pinned-message {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 0.25rem 0.7rem;
  align-items: center;
  margin-bottom: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(34, 211, 238, 0.38);
  border-radius: 12px;
  background: rgba(3, 12, 27, 0.94);
  box-shadow: 0 10px 26px rgba(0, 229, 255, 0.12);
}

.pinned-message strong,
.pinned-message span {
  grid-column: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pinned-message strong {
  color: var(--cyan);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.pinned-message button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(244, 114, 182, 0.45);
  border-radius: 50%;
  color: var(--text);
  background: rgba(76, 5, 25, 0.76);
}

.message {
  position: relative;
  flex: 0 0 auto;
  width: fit-content;
  max-width: min(72%, 720px);
  padding: 0.75rem 0.85rem;
}

.message p {
  padding-right: 1.4rem;
}

.message-link {
  color: #67e8f9;
  font-weight: 850;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.message.me {
  align-self: flex-end;
  border-color: rgba(45, 212, 191, 0.38);
  background: rgba(8, 145, 178, 0.32);
}

.message.them {
  align-self: flex-start;
}

.photo-message,
.video-message {
  margin: 0;
}

.photo-message img,
.video-message video {
  display: block;
  max-width: min(320px, 68vw);
  max-height: 360px;
  border-radius: 12px;
  object-fit: cover;
  cursor: zoom-in;
}

.video-message video {
  background: #020617;
}

.photo-message figcaption,
.video-message figcaption {
  margin-top: 0.38rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.message.secret {
  border-color: rgba(244, 114, 182, 0.45);
  box-shadow: 0 0 22px rgba(244, 114, 182, 0.12);
}

.message small {
  display: block;
  margin-top: 0.38rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.forwarded-label {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.reply-quote {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.46rem 0.55rem;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  color: var(--text);
  text-align: left;
  background: rgba(2, 6, 23, 0.46);
}

.reply-quote span {
  color: var(--muted);
  font-size: 0.72rem;
}

.message-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.48rem;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
}

.message-actions button {
  min-height: 24px;
  padding: 0 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.26);
  color: var(--cyan);
  background: rgba(8, 47, 73, 0.52);
  font-size: 0.68rem;
  font-weight: 900;
}

.message-highlight {
  box-shadow: 0 0 0 2px rgba(103, 232, 249, 0.46), 0 0 24px rgba(103, 232, 249, 0.22);
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.45rem;
}

.reaction-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 24px;
  padding: 0 0.38rem;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 999px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.62);
  font-size: 0.82rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 64px 64px 88px;
  gap: 0.6rem;
  padding: 0.7rem;
}

.reply-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-left: 3px solid var(--cyan);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.62);
}

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

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

.reply-preview span {
  color: var(--muted);
  font-size: 0.76rem;
}

.reply-preview button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
}

.emoji-panel {
  position: absolute;
  right: 6.7rem;
  bottom: 4.5rem;
  display: block;
  width: min(420px, calc(100vw - 2rem));
  max-height: 315px;
  overflow: auto;
  padding: 0.65rem;
  border: 1px solid rgba(0, 229, 255, 0.36);
  border-radius: 12px;
  background: rgba(8, 18, 32, 0.96);
  box-shadow: 0 0 34px rgba(0, 229, 255, 0.2);
}

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

.emoji-group {
  margin-bottom: 0.65rem;
}

.emoji-group strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--cyan);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.emoji-group div {
  display: grid;
  grid-template-columns: repeat(8, minmax(32px, 1fr));
  gap: 0.35rem;
}

.emoji-panel button {
  min-height: 36px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 9px;
  color: var(--text);
  background: rgba(8, 47, 73, 0.62);
  font-weight: 900;
  font-size: 1.05rem;
}

.forward-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.66);
  backdrop-filter: blur(10px);
}

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

.forward-panel {
  width: min(430px, calc(100vw - 2rem));
  max-height: min(620px, calc(100dvh - 2rem));
  overflow: auto;
  padding: 0.9rem;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 14px;
  background: rgba(6, 18, 32, 0.98);
  box-shadow: 0 0 42px rgba(0, 229, 255, 0.18);
}

.forward-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.forward-panel header button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
}

.forward-list {
  display: grid;
  gap: 0.55rem;
}

.forward-list button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  padding: 0.62rem;
  text-align: left;
}

.forward-list small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.glass-panel {
  padding: 1rem;
  margin-bottom: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.stat-grid div {
  padding: 0.75rem;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.38);
}

.stat-grid strong,
.stat-grid span {
  display: block;
}

.stat-grid strong {
  color: var(--mint);
  font-size: 1.2rem;
}

.stat-grid span {
  color: var(--muted);
  font-size: 0.75rem;
}

.wide-btn {
  width: 100%;
  margin-top: 0.55rem;
  padding: 0 0.8rem;
}

.wide-btn.danger {
  border-color: rgba(244, 114, 182, 0.42);
}

.call-panel.calling {
  border-color: rgba(45, 212, 191, 0.58);
  box-shadow: 0 0 30px rgba(45, 212, 191, 0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}

.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  display: grid;
  gap: 0.55rem;
  width: min(92vw, 330px);
}

.update-banner {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(92vw, 460px);
  padding: 0.75rem;
  border: 1px solid rgba(0, 229, 255, 0.42);
  border-radius: 14px;
  color: var(--text);
  background: rgba(6, 18, 34, 0.96);
  box-shadow: 0 0 34px rgba(0, 229, 255, 0.22);
  transform: translateX(-50%);
}

.update-banner[hidden] {
  display: none;
}

.update-banner div {
  min-width: 0;
  flex: 1;
}

.update-banner strong,
.update-banner span {
  display: block;
}

.update-banner span {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.update-banner button {
  min-height: 34px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 10px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.9), rgba(15, 23, 42, 0.86));
  font-weight: 850;
  padding: 0 0.75rem;
}

#dismissUpdate {
  width: 34px;
  padding: 0;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 12px;
  color: var(--text);
  background: rgba(8, 18, 32, 0.92);
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.18);
}

.toast-avatar {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.85), rgba(244, 114, 182, 0.5));
  background-size: cover;
  background-position: center;
}

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

.toast strong,
.toast span {
  display: block;
}

.call-event-message {
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.message.system {
  align-self: center;
  max-width: min(86%, 620px);
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.62);
}

.message.system small {
  text-align: center;
}

.toast span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.context-menu {
  position: fixed;
  z-index: 50;
  width: 218px;
  padding: 0.35rem;
  border: 1px solid rgba(0, 229, 255, 0.34);
  border-radius: 10px;
  background: rgba(8, 18, 32, 0.96);
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.2);
}

.context-menu button {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 0 0.6rem;
}

.context-menu button:hover {
  background: rgba(8, 145, 178, 0.56);
}

.message-context-reactions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.message-context-reactions button {
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 999px;
  text-align: center;
  font-size: 1rem;
  background: rgba(8, 145, 178, 0.22);
}

.context-menu button:last-child {
  color: #fecdd3;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 64px minmax(240px, 320px) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
    background:
      radial-gradient(circle at 50% -12%, rgba(0, 229, 255, 0.24), transparent 16rem),
      linear-gradient(180deg, #04111f, #050816 58%, #020617);
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: 100dvh;
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
  }

  .app-shell.mobile-chat-open {
    padding-bottom: 0;
  }

  .rail {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 24;
    height: calc(66px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 0.16rem;
    padding: 0.38rem 0.22rem max(0.38rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-right: 0;
    background: rgba(2, 6, 23, 0.96);
    backdrop-filter: blur(18px);
    box-shadow: 0 -16px 34px rgba(0, 0, 0, 0.28);
  }

  .rail-logo {
    display: none;
  }

  .rail-item[data-view="hidden"],
  .rail-settings {
    display: none;
  }

  .rail-item,
  .rail-settings {
    width: 100%;
    height: 44px;
    min-width: 0;
    margin: 0;
    border-radius: 11px;
    font-size: clamp(0.43rem, 2.05vw, 0.54rem);
    line-height: 1;
    padding: 0 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(8, 47, 73, 0.5);
  }

  .rail-item.active {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.96), rgba(45, 212, 191, 0.42));
  }

  .sidebar {
    position: fixed;
    inset: 0 0 calc(66px + env(safe-area-inset-bottom)) 0;
    z-index: 18;
    display: block;
    padding: max(0.8rem, env(safe-area-inset-top)) 0.85rem 0.85rem;
    transform: none;
    border-right: 0;
    background:
      linear-gradient(180deg, rgba(8, 47, 73, 0.42), transparent 14rem),
      rgba(4, 10, 24, 0.98);
    overflow: auto;
  }

  .settings-overlay,
  .pin-overlay {
    place-items: start center;
    padding: max(0.55rem, env(safe-area-inset-top)) 0.55rem max(0.55rem, env(safe-area-inset-bottom));
    overflow: auto;
  }

  .settings-panel,
  .pin-panel {
    width: 100%;
    max-width: calc(100vw - 1.1rem);
    max-height: calc(100dvh - max(1.1rem, env(safe-area-inset-top)) - max(1.1rem, env(safe-area-inset-bottom)));
    box-sizing: border-box;
    overflow: auto;
    border-radius: 16px;
  }

  .settings-panel {
    gap: 0.72rem;
    padding: 0.9rem;
  }

  .settings-panel header,
  .settings-actions {
    min-width: 0;
    flex-wrap: wrap;
  }

  .settings-panel label,
  .settings-account,
  .settings-actions,
  .settings-panel input {
    min-width: 0;
  }

  .settings-panel input[type="file"] {
    width: 100%;
    max-width: 100%;
    font-size: 0.78rem;
  }

  .settings-actions button {
    flex: 1 1 9rem;
    min-width: 0;
  }

  .app-shell.mobile-chat-open .sidebar {
    display: none;
  }

  .conversation {
    display: none;
    height: calc(100dvh - 74px);
    padding: 0.55rem;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .app-shell.mobile-chat-open .conversation {
    display: grid;
    height: 100dvh;
  }

  .app-shell.mobile-chat-open .rail {
    display: none;
  }

  .brand-card.compact-title {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 64px;
    border-radius: 18px;
    background: rgba(4, 14, 28, 0.9);
    backdrop-filter: blur(16px);
  }

  .mobile-more {
    display: inline-grid;
  }

  .mobile-more-panel {
    position: sticky;
    top: 76px;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin: 0.65rem 0;
    padding: 0.55rem;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 16px;
    background: rgba(4, 14, 28, 0.92);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.28);
  }

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

  .mobile-more-panel button {
    min-height: 42px;
    border: 1px solid rgba(34, 211, 238, 0.36);
    border-radius: 12px;
    color: var(--text);
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.78), rgba(8, 47, 73, 0.72));
    font-weight: 950;
  }

  .brand-card.compact-title .eyebrow {
    font-size: 1rem;
  }

  .profile-card {
    grid-template-columns: 48px minmax(0, 1fr) 42px;
    margin-top: 0.75rem;
    border-radius: 18px;
  }

  .profile-photo {
    width: 48px;
    height: 48px;
  }

  .add-contact {
    margin-top: 0.75rem;
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  .add-contact input,
  .search-wrap input {
    height: 46px;
    border-radius: 15px;
    background: rgba(2, 6, 23, 0.62);
  }

  .chat-list {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    gap: 0.55rem;
  }

  .chat-item {
    min-height: 76px;
    border-radius: 18px;
    background: rgba(8, 18, 32, 0.68);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.055), 0 12px 28px rgba(0,0,0,0.18);
  }

  .chat-item.active {
    background: rgba(8, 81, 99, 0.58);
  }

  .conversation-top {
    min-height: 112px;
    padding: max(0.5rem, env(safe-area-inset-top)) 0.55rem 0.55rem;
    gap: 0.5rem;
    border-radius: 16px;
    background: rgba(4, 14, 28, 0.88);
    backdrop-filter: blur(16px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 44px;
    grid-template-areas:
      "back title avatar"
      "actions actions actions";
    align-items: center;
  }

  #roomAvatar {
    grid-area: avatar;
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .room-title {
    grid-area: title;
    text-align: center;
  }

  .room-title h2 {
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .room-title p {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
  }

  .top-actions button,
  .mobile-menu {
    min-width: 42px;
    min-height: 34px;
    padding: 0 0.45rem;
    border-radius: 9px;
    font-size: 0.72rem;
  }

  .mobile-menu {
    grid-area: back;
    display: block;
    font-size: 0;
  }

  .mobile-menu::before {
    content: "Back";
    font-size: 0.72rem;
  }

  .messages {
    gap: 0.45rem;
    padding: 0.65rem 0.15rem 0.9rem;
  }

  .message {
    max-width: 86%;
    padding: 0.65rem 0.72rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  }

  .message p {
    padding-right: 1.1rem;
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .message small {
    font-size: 0.62rem;
  }

  .composer {
    grid-template-columns: 38px minmax(0, 1fr) 38px 42px 54px;
    grid-template-areas:
      "reply reply reply reply reply"
      "attach input voice emoji send";
    align-items: center;
    gap: 0.28rem;
    padding: 0.44rem;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(5, 18, 34, 0.94), rgba(3, 10, 24, 0.96));
    backdrop-filter: blur(16px);
    border: 1px solid rgba(34, 211, 238, 0.26);
    box-shadow: 0 -8px 28px rgba(0, 229, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: max(0.25rem, env(safe-area-inset-bottom));
  }

  .reply-preview {
    grid-area: reply;
    font-size: 0.76rem;
    padding: 0.48rem 0.55rem;
  }

  .message-actions {
    opacity: 1;
  }

  .message-actions button {
    min-height: 26px;
    font-size: 0.66rem;
  }

  #attachBtn {
    grid-area: attach;
  }

  #messageInput {
    grid-area: input;
  }

  #emojiBtn {
    grid-area: emoji;
  }

  #voiceBtn {
    grid-area: voice;
  }

  .composer button[type="submit"] {
    grid-area: send;
    height: 42px;
    min-height: 42px;
    border-radius: 14px;
    font-size: 0.72rem;
  }

  .composer input,
  .composer textarea {
    height: 42px;
    padding: 0.65rem 0.8rem 0.45rem;
    font-size: 0.9rem;
    border-radius: 15px;
    background: rgba(2, 6, 23, 0.72);
    scroll-margin-bottom: calc(9rem + env(safe-area-inset-bottom));
  }

  .composer button {
    min-height: 38px;
    min-width: 0;
    padding: 0;
    border-radius: 13px;
    font-size: 0.7rem;
  }

  #attachBtn,
  #emojiBtn,
  #voiceBtn {
    width: 38px;
    height: 38px;
    overflow: hidden;
    color: transparent;
    line-height: 0;
    position: relative;
  }

  #attachBtn::before,
  #emojiBtn::before,
  #voiceBtn::before {
    color: var(--text);
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    line-height: 1;
  }

  #attachBtn::before {
    content: "+";
    font-size: 1.1rem;
  }

  #emojiBtn::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 1.8px solid currentColor;
    border-radius: 50%;
    background:
      radial-gradient(circle at 35% 39%, currentColor 0 1.35px, transparent 1.55px),
      radial-gradient(circle at 65% 39%, currentColor 0 1.35px, transparent 1.55px);
    box-shadow: 0 0 12px rgba(103, 232, 249, 0.3);
  }

  #emojiBtn::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 22px;
    width: 8px;
    height: 4px;
    border: 1.8px solid currentColor;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    transform: translateX(-50%);
  }

  #voiceBtn::before {
    content: "";
    width: 18px;
    height: 18px;
    background: var(--text);
    border: 0;
    border-radius: 0;
    box-shadow: 0 0 12px rgba(103, 232, 249, 0.28);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3Zm5-3a1 1 0 1 0-2 0 3 3 0 0 1-6 0 1 1 0 1 0-2 0 5 5 0 0 0 4 4.9V18H8.5a1 1 0 1 0 0 2h7a1 1 0 1 0 0-2H13v-2.1A5 5 0 0 0 17 11Z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3Zm5-3a1 1 0 1 0-2 0 3 3 0 0 1-6 0 1 1 0 1 0-2 0 5 5 0 0 0 4 4.9V18H8.5a1 1 0 1 0 0 2h7a1 1 0 1 0 0-2H13v-2.1A5 5 0 0 0 17 11Z'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  #voiceBtn::after {
    display: none;
  }

  #voiceBtn.recording::before {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 4px;
    background: #fb7185;
    box-shadow: 0 0 16px rgba(251, 113, 133, 0.5);
  }

  #voiceBtn.recording::after {
    display: none;
  }

  .emoji-panel {
    right: 0.65rem;
    bottom: calc(4.5rem + env(safe-area-inset-bottom));
    width: calc(100vw - 1.3rem);
    max-height: 48dvh;
  }

  .emoji-group div {
    grid-template-columns: repeat(6, minmax(30px, 1fr));
  }
}

.voice-note {
  display: grid;
  gap: 0.35rem;
  min-width: min(320px, 62vw);
  padding-right: 1.4rem;
}

.voice-note audio {
  width: 100%;
  max-width: 320px;
  height: 34px;
  accent-color: var(--cyan);
}

.voice-note span {
  color: var(--muted);
  font-size: 0.82rem;
}

#voiceBtn.recording {
  border-color: rgba(244, 114, 182, 0.72);
  background: linear-gradient(135deg, rgba(190, 18, 60, 0.94), rgba(15, 23, 42, 0.84));
  box-shadow: 0 0 24px rgba(244, 114, 182, 0.24);
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(18px);
}

.call-window {
  width: min(92vw, 760px);
  border: 1px solid rgba(0, 229, 255, 0.36);
  border-radius: 14px;
  background: rgba(8, 18, 32, 0.96);
  box-shadow: 0 0 44px rgba(0, 229, 255, 0.18);
  overflow: hidden;
}

.call-window header,
.call-window footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.call-window footer {
  justify-content: center;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.call-window header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.call-window button {
  min-height: 38px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 10px;
  color: var(--text);
  background: rgba(8, 145, 178, 0.72);
  font-weight: 900;
  padding: 0 0.8rem;
}

.call-window button.danger,
#closeCallOverlay {
  border-color: rgba(244, 114, 182, 0.5);
  background: rgba(76, 5, 25, 0.52);
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(16px);
}

.media-viewer[hidden] {
  display: none;
}

.media-viewer-panel {
  width: min(96vw, 980px);
  max-height: min(92dvh, 820px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(34, 211, 238, 0.38);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(5, 12, 24, 0.98);
  box-shadow: 0 0 46px rgba(0, 229, 255, 0.22);
}

.media-viewer-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(34, 211, 238, 0.24);
}

.media-viewer-panel header div {
  display: flex;
  gap: 0.5rem;
}

.media-viewer-panel a,
.media-viewer-panel button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 10px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.9), rgba(15, 23, 42, 0.86));
  font-weight: 850;
  text-decoration: none;
  padding: 0 0.75rem;
}

.media-viewer-body {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  overflow: auto;
}

.media-viewer-body img,
.media-viewer-body video {
  max-width: 100%;
  max-height: calc(92dvh - 92px);
  border-radius: 10px;
  object-fit: contain;
}

.video-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  background:
    linear-gradient(rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    #020617;
  background-size: 28px 28px;
}

.video-stage video {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
}

#remoteVideo {
  grid-area: 1 / 1;
  z-index: 1;
  min-height: 420px;
  border-radius: 12px;
  background: #020617;
}

#localVideo {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  width: min(190px, 34%);
  height: auto;
  aspect-ratio: 16 / 10;
  min-height: 0;
  border: 2px solid rgba(34, 211, 238, 0.55);
  border-radius: 12px;
  background: #020617;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34);
}

#remoteVideo:not([hidden]) ~ .remote-placeholder {
  display: none;
}

.remote-placeholder {
  position: absolute;
  inset: auto 1rem 1rem auto;
  display: grid;
  gap: 0.2rem;
  min-width: 220px;
  padding: 0.8rem;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.78);
}

.remote-placeholder span {
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(14px);
}

.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(14px);
}

.pin-panel {
  width: min(92vw, 380px);
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(34, 211, 238, 0.36);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: 0 0 44px rgba(0, 229, 255, 0.18);
}

.pin-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pin-panel label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 850;
}

.pin-panel input {
  min-height: 42px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 10px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.56);
  padding: 0 0.85rem;
}

.settings-panel {
  width: min(94vw, 560px);
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: 0 0 44px rgba(0, 229, 255, 0.18);
}

.settings-panel header,
.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.settings-panel label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 850;
}

.settings-panel input[type="password"],
.settings-panel input[type="text"],
.settings-panel input[type="file"] {
  min-height: 42px;
  color: var(--text);
}

.settings-panel input[type="password"],
.settings-panel input[type="text"] {
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.56);
  padding: 0 0.85rem;
}

.settings-account {
  display: grid;
  gap: 0.65rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(34, 211, 238, 0.18);
}
