:root {
  color-scheme: dark;
  --bg: #05070b;
  --panel: rgba(11, 15, 23, 0.78);
  --panel-strong: rgba(17, 23, 34, 0.94);
  --line: rgba(176, 232, 255, 0.16);
  --line-strong: rgba(124, 247, 212, 0.42);
  --text: #eef8ff;
  --muted: #94a9ba;
  --muted-2: #657887;
  --cyan: #6ee7ff;
  --green: #8dff8a;
  --amber: #ffd166;
  --pink: #ff8bd1;
  --danger: #ff6e7f;
  --player: #6ee7ff;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(110, 231, 255, 0.18), transparent 30%),
    radial-gradient(circle at 78% 18%, rgba(141, 255, 138, 0.11), transparent 26%),
    linear-gradient(135deg, #05070b 0%, #071016 48%, #08070d 100%);
  color: var(--text);
  font-family: var(--font);
}

body.bg-void {
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 139, 209, 0.12), transparent 30%),
    linear-gradient(135deg, #020306, #090910 58%, #020306);
}

body.bg-aurora {
  background:
    radial-gradient(circle at 20% 12%, rgba(141, 255, 138, 0.18), transparent 32%),
    radial-gradient(circle at 70% 24%, rgba(255, 209, 102, 0.13), transparent 26%),
    linear-gradient(135deg, #06100d, #070b12 54%, #0b050b);
}

body.bg-grid {
  background:
    linear-gradient(rgba(110, 231, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 255, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #05070b, #0a1014);
  background-size: 36px 36px, 36px 36px, auto;
}

body.font-tech {
  --font: "Trebuchet MS", Inter, ui-sans-serif, system-ui, sans-serif;
}

body.font-wide {
  --font: Verdana, Inter, ui-sans-serif, system-ui, sans-serif;
}

body.font-mono {
  --font: "Cascadia Mono", Consolas, ui-monospace, monospace;
}

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

button {
  cursor: pointer;
}

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

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

#ambientCanvas,
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#ambientCanvas {
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

.scanline {
  z-index: 1;
  background: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: 0.16;
  mix-blend-mode: screen;
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 260px minmax(420px, 1fr) 300px;
  gap: 12px;
  width: min(1460px, calc(100vw - 28px));
  height: min(930px, calc(100vh - 28px));
  margin: 14px auto;
}

.rail,
.chat-panel,
.identity-panel {
  min-height: 0;
}

.rail,
.chat-panel,
.identity-card,
.activity-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
}

.brand,
.identity-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.avatar,
.lock-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(110, 231, 255, 0.42);
  border-radius: 8px;
  color: var(--cyan);
  background: linear-gradient(145deg, rgba(110, 231, 255, 0.18), rgba(141, 255, 138, 0.08));
  box-shadow: inset 0 0 22px rgba(110, 231, 255, 0.08), 0 12px 32px rgba(110, 231, 255, 0.12);
}

.brand strong,
.identity-head strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.brand small,
.identity-head small,
.room small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.rooms {
  display: grid;
  gap: 8px;
}

.room {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  background: transparent;
}

.room.is-active {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.12), rgba(141, 255, 138, 0.075));
  box-shadow: inset 0 0 28px rgba(110, 231, 255, 0.06);
}

.room-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--green);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.room-code {
  color: var(--amber);
  font-size: 10px;
  font-weight: 800;
}

.room strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.join-panel {
  display: grid;
  gap: 8px;
}

.wide-button,
.join-row button,
.invite-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.wide-button:hover,
.join-row button:hover,
.invite-actions button:hover {
  border-color: rgba(110, 231, 255, 0.55);
}

.join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
}

.join-row input,
.style-form select,
.login-card input {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  padding: 0 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
}

.section-title b {
  color: var(--green);
  font-weight: 800;
}

.online-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: calc(100vh - 410px);
  padding-right: 4px;
}

.online-user {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  border: 0;
  color: var(--text);
  text-align: left;
  background: transparent;
  font-size: 13px;
}

.online-user:hover {
  color: var(--cyan);
}

.user-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px currentColor;
}

.invite-mini {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--amber);
  opacity: 0;
}

.online-user:hover .invite-mini {
  opacity: 1;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
}

h1,
h2,
p {
  margin: 0;
}

.chat-topbar h1 {
  font-size: 25px;
  line-height: 1.1;
  font-weight: 820;
}

.chat-topbar p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  text-transform: uppercase;
}

.connection-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 16px currentColor;
}

.connection-pill.is-online {
  color: var(--green);
  border-color: rgba(141, 255, 138, 0.35);
}

.connection-pill.is-offline {
  color: var(--amber);
  border-color: rgba(255, 209, 102, 0.35);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.icon-button:hover,
.send-button:hover {
  border-color: rgba(110, 231, 255, 0.55);
  transform: translateY(-1px);
}

.message-stream {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 20px;
  scroll-behavior: smooth;
}

.message-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  width: min(78%, 760px);
}

.message-row.own {
  align-self: end;
  grid-template-columns: minmax(0, 1fr) 36px;
}

.message-row.own .bubble {
  order: 1;
  border-color: color-mix(in srgb, var(--player) 58%, white 0%);
  background: linear-gradient(135deg, color-mix(in srgb, var(--player) 24%, transparent), rgba(255, 255, 255, 0.07));
}

.message-row.own .mini-avatar {
  order: 2;
}

.message-row.pop-in .bubble {
  animation: popMessage 420ms cubic-bezier(0.2, 1.5, 0.4, 1);
}

.mini-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  color: #051015;
  font-size: 12px;
  font-weight: 900;
}

.bubble {
  position: relative;
  min-width: 0;
  padding: 11px 12px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--player) 70%, transparent);
  opacity: 0.22;
  pointer-events: none;
}

body.neon-scan .bubble::after,
body.neon-spark .bubble::after,
body.neon-pulse .bubble::after {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--player) 75%, transparent), transparent);
  opacity: 0.18;
  transform: translateX(-100%);
  animation: scanBorder 3.4s infinite;
  pointer-events: none;
}

body.neon-pulse .message-row.own .bubble {
  box-shadow: 0 0 24px color-mix(in srgb, var(--player) 23%, transparent), 0 14px 34px rgba(0, 0, 0, 0.2);
}

body.neon-spark .bubble {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--player) 12%, transparent), 0 0 18px rgba(255, 255, 255, 0.04);
}

body.bubble-blade .bubble {
  border-radius: 3px 8px 3px 8px;
}

body.bubble-plasma .bubble {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.11), rgba(255, 139, 209, 0.09));
}

body.bubble-crystal .bubble,
.bubble.bubble-crystal {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--player) 18%, transparent), rgba(255, 255, 255, 0.055)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 34%, rgba(255, 255, 255, 0.06));
}

body.bubble-solid .bubble {
  background: rgba(24, 31, 43, 0.94);
}

body.border-sharp .bubble,
.bubble.border-sharp {
  border-radius: 3px;
  border-width: 2px;
}

body.border-double .bubble,
.bubble.border-double {
  border: 1px solid color-mix(in srgb, var(--player) 70%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 22px color-mix(in srgb, var(--player) 18%, transparent),
    0 14px 34px rgba(0, 0, 0, 0.2);
}

body.border-glow .bubble,
.bubble.border-glow {
  border-color: color-mix(in srgb, var(--player) 76%, white 0%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--player) 24%, transparent),
    0 0 24px color-mix(in srgb, var(--player) 26%, transparent),
    0 14px 34px rgba(0, 0, 0, 0.2);
}

body.border-glow .bubble::before,
.bubble.border-glow::before {
  inset: -1px;
  border-width: 2px;
  border-color: color-mix(in srgb, var(--player) 86%, white 8%);
  opacity: 0.78;
  animation: pulseRing 2.2s ease-in-out infinite;
}

body.border-dash .bubble,
.bubble.border-dash {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--player) 78%, transparent);
}

body.fill-deep .bubble,
.bubble.fill-deep {
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--player) 24%, transparent), transparent 34%),
    linear-gradient(145deg, rgba(12, 17, 26, 0.98), rgba(30, 37, 52, 0.94));
}

body.fill-neon .bubble,
.bubble.fill-neon {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--player) 28%, transparent), rgba(255, 255, 255, 0.08)),
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.16), transparent 28%);
}

body.fill-ghost .bubble,
.bubble.fill-ghost {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    color-mix(in srgb, var(--player) 8%, transparent);
  backdrop-filter: blur(18px) saturate(130%);
}

body.fill-carbon .bubble,
.bubble.fill-carbon {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 8px),
    linear-gradient(150deg, rgba(8, 11, 18, 0.98), rgba(27, 29, 39, 0.96));
}

body.effect-aura .bubble,
.bubble.effect-aura {
  box-shadow:
    inset 0 0 30px color-mix(in srgb, var(--player) 10%, transparent),
    0 0 28px color-mix(in srgb, var(--player) 16%, transparent),
    0 14px 34px rgba(0, 0, 0, 0.2);
}

body.effect-shimmer .bubble::after,
.bubble.effect-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0 34%, rgba(255, 255, 255, 0.22) 46%, transparent 60% 100%);
  transform: translateX(-120%);
  animation: shimmerSweep 4.5s ease-in-out infinite;
  pointer-events: none;
}

body.effect-wave .bubble,
.bubble.effect-wave {
  background-image:
    radial-gradient(circle at var(--wave-x, 10%) 20%, color-mix(in srgb, var(--player) 22%, transparent), transparent 25%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  animation: waveFill 5.5s ease-in-out infinite;
}

body.effect-matrix .bubble,
.bubble.effect-matrix {
  background-image:
    linear-gradient(90deg, color-mix(in srgb, var(--player) 11%, transparent) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  background-size: 18px 18px, 18px 18px, auto;
}

.bubble.text-large .message-text,
body.text-large .message-text {
  font-size: 16px;
  line-height: 1.55;
}

.bubble.text-xl .message-text,
body.text-xl .message-text {
  font-size: 18px;
  line-height: 1.58;
}

.message-meta,
.receipt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.message-meta strong {
  color: var(--text);
  font-size: 12px;
}

.message-text {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: var(--bubble-text, #f8fdff);
  font-size: 14px;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.edited-note {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  color: color-mix(in srgb, var(--player) 62%, var(--muted));
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.message-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 10px;
}

.message-actions button,
.reaction-pill {
  min-width: 28px;
  min-height: 26px;
  border: 1px solid color-mix(in srgb, var(--player) 38%, var(--line));
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--player) 14%, transparent), rgba(255, 255, 255, 0.055));
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 900;
}

.message-actions button:hover,
.reaction-pill:hover {
  border-color: color-mix(in srgb, var(--player) 74%, white 8%);
  transform: translateY(-1px);
}

.message-actions .danger {
  color: #ffb0bc;
  border-color: rgba(255, 110, 127, 0.45);
}

.reaction-strip {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
}

.reaction-pill b {
  color: var(--muted);
  font-size: 10px;
}

.message-attachment {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 10px;
}

.message-attachment img {
  display: block;
  max-width: min(360px, 100%);
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.receipt {
  justify-content: flex-end;
  margin-top: 8px;
  color: var(--amber);
}

.receipt.read {
  color: var(--green);
}

.receipt.delivered {
  color: var(--cyan);
}

.typing-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
}

.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.composer {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-strong);
}

.composer-body {
  min-width: 0;
}

.edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--player) 52%, var(--line));
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--player) 18%, transparent), rgba(255, 255, 255, 0.06));
  font-size: 12px;
  font-weight: 800;
}

.edit-banner button {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--amber);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 900;
}

.attachment-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: rgba(110, 231, 255, 0.07);
  font-size: 12px;
}

.attachment-preview button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--danger);
  background: rgba(255, 255, 255, 0.06);
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 140px;
  min-height: 42px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 14px;
  line-height: 1.35;
}

.composer textarea:focus,
.login-card input:focus,
.join-row input:focus,
.style-form select:focus {
  border-color: rgba(110, 231, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.10);
}

.composer-meta {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 7px 10px;
}

#charCount,
.shortcut {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.shortcut {
  color: var(--amber);
}

.send-button {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  min-width: 116px;
  border: 1px solid rgba(141, 255, 138, 0.42);
  border-radius: 8px;
  color: #06120c;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-size: 13px;
  font-weight: 900;
  transition: transform 160ms ease, border-color 160ms ease;
}

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

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

.identity-card,
.activity-card {
  border-radius: var(--radius);
  padding: 16px;
}

.avatar {
  color: #041010;
  background: linear-gradient(135deg, var(--player), var(--green));
  font-weight: 900;
}

.identity-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.identity-grid span {
  color: var(--muted);
  text-transform: uppercase;
}

.identity-grid b {
  justify-self: end;
  color: var(--text);
}

.style-form {
  display: grid;
  gap: 10px;
}

.style-form label {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.style-form input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

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

.meters div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.meters span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.meters strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.receipt-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.receipt-list li {
  display: grid;
  grid-template-columns: 10px auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-size: 12px;
}

.receipt-list b {
  justify-self: end;
  color: var(--muted);
  font-weight: 500;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 14px currentColor;
}

.dot.delivered {
  background: var(--cyan);
}

.dot.read {
  background: var(--green);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 4, 7, 0.64);
  backdrop-filter: blur(18px);
}

.login-overlay.is-hidden {
  display: none;
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 24px;
  background: rgba(12, 17, 24, 0.94);
  box-shadow: var(--shadow);
}

.login-card .lock-mark {
  margin-bottom: 18px;
}

.login-card h2 {
  font-size: 26px;
  line-height: 1.12;
}

.login-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-card label {
  display: block;
  margin-top: 18px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 8px;
}

.login-card input {
  height: 44px;
}

.login-card button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: #051015;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-weight: 900;
}

#loginError {
  display: block;
  min-height: 20px;
  margin-top: 10px;
  color: var(--danger);
  font-size: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 100%;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  margin-bottom: 6px;
}

.invite-toast {
  position: fixed;
  z-index: 6;
  right: 22px;
  bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(520px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: rgba(10, 15, 23, 0.95);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.46), 0 0 30px rgba(110, 231, 255, 0.12);
  backdrop-filter: blur(18px);
  animation: popMessage 360ms cubic-bezier(0.2, 1.5, 0.4, 1);
}

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

.invite-toast span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.invite-actions {
  display: flex;
  gap: 8px;
}

.invite-actions button:first-child {
  color: #041010;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-weight: 900;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes scanBorder {
  0% {
    transform: translateX(-120%);
  }
  55%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes popMessage {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.025);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes softGlow {
  0%,
  100% {
    box-shadow: 0 0 16px color-mix(in srgb, var(--player) 12%, transparent), 0 14px 34px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 30px color-mix(in srgb, var(--player) 28%, transparent), 0 14px 34px rgba(0, 0, 0, 0.22);
  }
}

@keyframes pulseRing {
  0%,
  100% {
    opacity: 0.38;
    box-shadow: inset 0 0 0 color-mix(in srgb, var(--player) 0%, transparent), 0 0 10px color-mix(in srgb, var(--player) 16%, transparent);
  }
  50% {
    opacity: 0.92;
    box-shadow: inset 0 0 18px color-mix(in srgb, var(--player) 18%, transparent), 0 0 26px color-mix(in srgb, var(--player) 42%, transparent);
  }
}

@keyframes shimmerSweep {
  0%,
  42% {
    opacity: 0;
    transform: translateX(-120%);
  }
  52% {
    opacity: 0.65;
  }
  68%,
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

@keyframes waveFill {
  0%,
  100% {
    --wave-x: 8%;
  }
  50% {
    --wave-x: 92%;
  }
}

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

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

  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
    height: auto;
    min-height: calc(100vh - 28px);
  }

  .identity-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: calc(100vw - 18px);
    margin: 9px auto;
  }

  .rail {
    min-height: auto;
  }

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

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

  .chat-panel {
    min-height: 72vh;
  }

  .chat-topbar,
  .invite-toast {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .message-row {
    width: 100%;
  }

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

  .composer-meta {
    grid-column: 1 / -1;
    grid-template-columns: 1fr auto auto;
  }

  .send-button {
    grid-column: auto;
  }
}
