:root {
  --navy-950: #17233e;
  --navy-900: #22345d;
  --navy-800: #2d4475;
  --navy-700: #3d5787;
  --navy-200: #c9d3e4;
  --navy-100: #e4e9f1;
  --teal-700: #14756f;
  --teal-600: #188c83;
  --teal-500: #22a69b;
  --teal-100: #d8f0ed;
  --coral-600: #d9574e;
  --coral-500: #ef7661;
  --coral-100: #ffe4de;
  --amber-500: #e6a83b;
  --cream-100: #fbfaf6;
  --cream-200: #f5f1e8;
  --cream-300: #ece6d8;
  --ink: #26334b;
  --muted: #707a8d;
  --line: #d7dce5;
  --white: #fff;
  --danger: #b33b43;
  --success: #268067;
  --shadow-sm: 0 2px 5px rgb(30 42 68 / 12%);
  --shadow-md: 0 10px 30px rgb(22 33 58 / 17%);
  --shadow-lg: 0 28px 80px rgb(22 33 58 / 25%);
  --radius-sm: 5px;
  --radius-md: 9px;
  --font-display: "Trebuchet MS", "Avenir Next", Avenir, sans-serif;
  --font-body: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  color-scheme: light;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  background: var(--cream-200);
  -webkit-font-smoothing: antialiased;
}

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

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled),
label[for] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(34 166 155 / 30%);
  outline-offset: 2px;
}

img {
  max-width: 100%;
}

.is-hidden {
  display: none !important;
}

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

.noscript {
  position: fixed;
  z-index: 999;
  inset: 0 0 auto;
  padding: 12px 20px;
  color: var(--white);
  font-weight: 700;
  text-align: center;
  background: var(--danger);
}

.page-width {
  width: min(1160px, calc(100% - 48px));
  margin-inline: auto;
}

/* Welcome and authentication */

.welcome-screen {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgb(255 255 255 / 76%), rgb(245 241 232 / 70%)),
    repeating-linear-gradient(135deg, transparent 0 30px, rgb(34 52 93 / 2.5%) 30px 31px),
    var(--cream-200);
}

.welcome-screen::before,
.welcome-screen::after {
  position: absolute;
  z-index: 0;
  display: block;
  content: "";
  pointer-events: none;
  border-radius: 50%;
}

.welcome-screen::before {
  top: -190px;
  right: -120px;
  width: 490px;
  height: 490px;
  border: 80px solid rgb(34 166 155 / 7%);
}

.welcome-screen::after {
  bottom: -260px;
  left: -180px;
  width: 560px;
  height: 560px;
  border: 110px solid rgb(239 118 97 / 6%);
}

.welcome-header,
.welcome-footer,
.welcome-main {
  position: relative;
  z-index: 1;
}

.welcome-header {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  padding-block: 15px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--navy-900);
  text-decoration: none;
}

.brand img {
  margin-right: 11px;
  filter: drop-shadow(0 2px 3px rgb(27 43 73 / 13%));
}

.brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand strong {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.5px;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #beded9;
  border-radius: 30px;
  background: rgb(255 255 255 / 65%);
}

.welcome-badge i,
.presence-label i,
.members-legend i {
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--teal-500);
  box-shadow: 0 0 0 1px var(--teal-500);
}

.welcome-main {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1.04fr) minmax(390px, 0.78fr);
  gap: clamp(50px, 8vw, 105px);
  align-items: center;
  padding-block: 40px 58px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--teal-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 27px;
  height: 3px;
  margin-right: 9px;
  content: "";
  background: var(--coral-500);
}

.welcome-copy h1 {
  max-width: 600px;
  margin: 13px 0 15px;
  color: var(--navy-950);
  font-family: var(--font-display);
  font-size: clamp(42px, 5.5vw, 66px);
  line-height: 0.98;
  letter-spacing: -3px;
}

.welcome-copy h1 span {
  color: var(--teal-600);
}

.welcome-copy > p {
  max-width: 550px;
  margin: 0;
  color: #5f6879;
  font-size: 17px;
  line-height: 1.65;
}

.preview-window,
.auth-window {
  border: 1px solid #cbd2dd;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.preview-window {
  max-width: 570px;
  margin-top: 31px;
  transform: rotate(-0.6deg);
  box-shadow: 0 16px 45px rgb(22 33 58 / 13%);
}

.preview-titlebar,
.window-titlebar {
  display: grid;
  height: 36px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  color: #56627a;
  font-size: 10px;
  font-weight: 700;
  border-bottom: 1px solid #ccd3de;
  background: linear-gradient(#f9fafc, #e5e9f0);
  box-shadow: inset 0 1px #fff;
}

.window-lights {
  display: flex;
  gap: 5px;
}

.window-lights i {
  width: 9px;
  height: 9px;
  border: 1px solid rgb(0 0 0 / 15%);
  border-radius: 50%;
  background: var(--coral-500);
}

.window-lights i:nth-child(2) {
  background: var(--amber-500);
}

.window-lights i:nth-child(3) {
  background: var(--teal-500);
}

.preview-online {
  justify-self: end;
  color: var(--teal-600);
}

.preview-body {
  display: grid;
  min-height: 155px;
  grid-template-columns: 138px 1fr;
  background: var(--cream-100);
}

.preview-rooms {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: #eff2f6;
}

.preview-rooms b {
  margin: 0 7px 5px;
  color: #7b8495;
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.preview-rooms span {
  padding: 5px 7px;
  color: #647087;
  font-size: 9px;
  border-radius: 3px;
}

.preview-rooms span.active {
  color: var(--white);
  font-weight: 700;
  background: var(--navy-800);
}

.preview-chat {
  padding: 13px 15px 9px;
}

.preview-chat p {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 10px;
  color: #515b6b;
  font-size: 9px;
}

.preview-chat p span {
  flex: 1;
}

.preview-chat strong {
  margin-right: 6px;
  color: var(--navy-900);
}

.preview-chat small {
  color: #a1a7b1;
  font-size: 7px;
}

.avatar-mini {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--white);
  border-radius: 50%;
}

.avatar-mini.coral {
  background: var(--coral-500);
}

.avatar-mini.teal {
  background: var(--teal-500);
}

.preview-input {
  display: flex;
  height: 29px;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px 0 9px;
  color: #9da4af;
  font-size: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}

.preview-input b {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: var(--white);
  border-radius: 3px;
  background: var(--teal-500);
}

.welcome-features {
  display: grid;
  max-width: 590px;
  grid-template-columns: repeat(3, 1fr);
  gap: 19px;
  padding: 0;
  margin: 27px 0 0;
  list-style: none;
}

.welcome-features li {
  display: flex;
  gap: 8px;
}

.welcome-features li > b {
  color: var(--coral-500);
  font-family: Georgia, serif;
  font-size: 10px;
  font-style: italic;
}

.welcome-features span {
  display: flex;
  flex-direction: column;
}

.welcome-features strong {
  color: var(--navy-900);
  font-size: 11px;
}

.welcome-features small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.auth-window {
  position: relative;
  width: 100%;
  max-width: 440px;
  justify-self: end;
  border-color: #b9c1cf;
}

.window-titlebar strong {
  justify-self: center;
  color: #4e5d75;
  font-size: 11px;
}

.window-year {
  justify-self: end;
  color: #9aa2b0;
  font-size: 9px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.auth-content {
  padding: 27px 34px 24px;
}

.auth-intro {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 22px;
}

.auth-intro img {
  filter: drop-shadow(0 3px 5px rgb(22 33 58 / 13%));
}

.auth-intro h2 {
  margin: 0 0 3px;
  color: var(--navy-950);
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.5px;
}

.auth-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  margin-bottom: 20px;
  border: 1px solid #d9dee7;
  border-radius: 6px;
  background: #eef1f5;
}

.auth-tabs button {
  min-height: 33px;
  padding: 5px 7px;
  color: #747e90;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: transparent;
}

.auth-tabs button[aria-selected="true"] {
  color: var(--navy-900);
  background: var(--white);
  box-shadow: 0 1px 4px rgb(25 42 73 / 15%);
}

.auth-status {
  display: none;
  padding: 9px 11px;
  margin: -8px 0 14px;
  color: var(--danger);
  font-size: 11px;
  border: 1px solid #efbfc0;
  border-radius: 4px;
  background: #fff2f0;
}

.auth-status:not(:empty) {
  display: block;
}

.auth-status.is-success {
  color: var(--success);
  border-color: #badfd5;
  background: #effaf6;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-form > label,
.label-line label,
.settings-content > label:not(.toggle-line) {
  margin-bottom: 6px;
  color: #4a566b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.auth-form > .field-with-icon + label,
.auth-form > .field-with-icon + .label-line {
  margin-top: 14px;
}

.label-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.link-button,
.inline-button {
  padding: 0;
  color: var(--teal-700);
  font-size: 10px;
  background: transparent;
}

.inline-button {
  font-size: inherit;
  text-decoration: underline;
}

.field-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.field-with-icon > span {
  position: absolute;
  z-index: 1;
  left: 12px;
  color: #99a2b0;
  font-size: 13px;
}

.field-with-icon input,
.settings-content > input {
  width: 100%;
  height: 42px;
  padding: 0 13px 0 36px;
  border: 1px solid #ccd2dc;
  border-radius: 5px;
  background: #fbfcfd;
  box-shadow: inset 0 1px 2px rgb(21 35 60 / 4%);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-with-icon input:hover,
.settings-content > input:hover {
  border-color: #abb4c2;
}

.field-with-icon input:focus,
.settings-content > input:focus {
  outline: 0;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgb(34 166 155 / 13%);
}

.field-with-icon input[type="password"] {
  padding-right: 70px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  padding: 5px;
  color: var(--teal-700);
  font-size: 9px;
  font-weight: 700;
  background: transparent;
}

.check-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 15px 0 17px !important;
  color: #6b7484 !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  line-height: 1.45;
  text-transform: none !important;
}

.check-line input {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--teal-600);
}

.primary-button {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 0 17px;
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #126d67;
  border-radius: 5px;
  background: linear-gradient(#28aa9f, #17877f);
  box-shadow: inset 0 1px rgb(255 255 255 / 23%), 0 2px 5px rgb(24 126 117 / 22%);
  transition: transform 0.12s, filter 0.12s;
}

.primary-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.5);
  opacity: 0.7;
}

.primary-button b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--teal-700);
  font-size: 17px;
  border-radius: 4px;
  background: rgb(255 255 255 / 88%);
}

.primary-button.compact {
  min-height: 38px;
  justify-content: center;
  padding: 0 18px;
}

.guest-note {
  display: flex;
  gap: 10px;
  padding: 11px;
  margin-bottom: 18px;
  color: #566679;
  font-size: 10px;
  border: 1px solid #c9e1dd;
  border-radius: 5px;
  background: #f1faf8;
}

.guest-note b {
  color: var(--teal-600);
  font-size: 16px;
}

.privacy-line {
  margin: 18px 0 0;
  color: #989faa;
  font-size: 8px;
  line-height: 1.45;
  text-align: center;
}

.welcome-footer {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  color: #949ba7;
  font-size: 9px;
  border-top: 1px solid rgb(41 58 88 / 9%);
}

.welcome-footer nav {
  display: flex;
  gap: 18px;
}

.welcome-footer button {
  padding: 4px 0;
  color: #7d8694;
  font-size: 9px;
  background: transparent;
}

/* Chat application window */

.chat-app {
  position: fixed;
  inset: 0;
  padding: clamp(12px, 2.2vw, 30px);
  background:
    radial-gradient(circle at 17% 17%, rgb(255 255 255 / 8%) 0 7%, transparent 7.2%),
    linear-gradient(135deg, #20345e, #182641 70%);
}

.chat-app::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.35;
  background-image: linear-gradient(45deg, transparent 48%, rgb(255 255 255 / 2%) 49% 51%, transparent 52%);
  background-size: 22px 22px;
}

.desktop-window {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1500px, 100%);
  height: 100%;
  min-height: 550px;
  flex-direction: column;
  margin: auto;
  overflow: hidden;
  border: 1px solid #0f1b31;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 22px 80px rgb(4 12 26 / 52%), inset 0 1px rgb(255 255 255 / 10%);
}

.app-titlebar {
  display: grid;
  min-height: 54px;
  flex: 0 0 auto;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 14px 0 18px;
  color: var(--white);
  border-bottom: 1px solid #0e1d35;
  background: linear-gradient(#304a7a, #22375f);
  box-shadow: inset 0 1px rgb(255 255 255 / 13%);
}

.app-brand {
  display: flex;
  align-items: center;
}

.app-brand img {
  margin-right: 8px;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 25%));
}

.app-brand > span {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.app-brand b {
  font-family: var(--font-display);
  font-size: 15px;
}

.app-brand small {
  margin-top: 3px;
  color: #aebbd0;
  font-size: 7px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.window-caption {
  color: #cfdaeb;
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px rgb(0 0 0 / 25%);
}

.app-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
}

.connection-pill {
  display: inline-flex;
  height: 25px;
  align-items: center;
  padding: 0 9px;
  color: #d4eee9;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.35px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 20px;
  background: rgb(6 18 38 / 25%);
  text-transform: uppercase;
}

.connection-pill i {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #5fd2b4;
  box-shadow: 0 0 7px #5fd2b4;
}

.connection-pill.is-connecting i {
  background: #edbd58;
  box-shadow: 0 0 7px #edbd58;
  animation: pulse 1.2s infinite;
}

.connection-pill.is-offline {
  color: #ffd7d2;
}

.connection-pill.is-offline i {
  background: #f47c72;
  box-shadow: none;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.icon-button {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: inherit;
  font-family: Georgia, serif;
  font-size: 14px;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 4px;
  background: rgb(3 14 31 / 18%);
}

.icon-button:hover {
  background: rgb(255 255 255 / 10%);
}

.profile-button {
  display: flex;
  height: 34px;
  gap: 7px;
  align-items: center;
  padding: 0 8px 0 4px;
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 4px;
  background: rgb(3 14 31 / 18%);
}

.profile-button b {
  color: #aebbd0;
  font-size: 8px;
}

.avatar {
  --avatar-color: #318f88;
  position: relative;
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  border: 2px solid rgb(255 255 255 / 88%);
  border-radius: 50%;
  background: var(--avatar-color);
  box-shadow: 0 1px 3px rgb(10 20 40 / 18%);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-bar {
  display: none;
}

.chat-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: 225px minmax(360px, 1fr) 215px;
}

.side-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #f1f3f6;
}

.rooms-panel {
  border-right: 1px solid #ccd2dc;
}

.members-panel {
  border-left: 1px solid #ccd2dc;
  background: #f6f7f9;
}

.panel-heading {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px 0 17px;
  border-bottom: 1px solid #d7dce4;
  background: linear-gradient(#f8f9fb, #edf0f4);
}

.panel-heading > span {
  display: flex;
  flex-direction: column;
}

.panel-heading small {
  color: #929baa;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.panel-heading strong {
  margin-top: 2px;
  color: var(--navy-900);
  font-family: var(--font-display);
  font-size: 14px;
}

.panel-heading em {
  display: inline-flex;
  min-width: 20px;
  height: 16px;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  padding-inline: 4px;
  color: var(--teal-700);
  font-family: var(--font-body);
  font-size: 8px;
  font-style: normal;
  border-radius: 9px;
  background: var(--teal-100);
}

.panel-action {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #6d788a;
  font-size: 17px;
  border: 1px solid #cbd1dc;
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.panel-action:hover {
  color: var(--teal-700);
  border-color: #a8cfc9;
}

.room-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 12px 12px 8px;
}

.room-search > span {
  position: absolute;
  left: 10px;
  color: #8e97a6;
  font-size: 14px;
}

.room-search input {
  width: 100%;
  height: 33px;
  padding: 0 30px 0 29px;
  border: 1px solid #cdd3dc;
  border-radius: 4px;
  background: #fff;
}

.room-search input::placeholder {
  color: #a2a9b5;
  font-size: 10px;
}

kbd {
  min-width: 18px;
  padding: 1px 4px;
  color: #8d96a4;
  font-family: inherit;
  font-size: 8px;
  text-align: center;
  border: 1px solid #d0d5dd;
  border-bottom-width: 2px;
  border-radius: 3px;
  background: #f8f9fa;
}

.room-search kbd {
  position: absolute;
  right: 7px;
}

.room-nav {
  min-height: 0;
  flex: 1;
  padding: 3px 8px 12px;
  overflow: auto;
}

.room-group-title {
  display: flex;
  align-items: center;
  padding: 12px 8px 5px;
  color: #8b94a2;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.room-group-title::after {
  height: 1px;
  flex: 1;
  margin-left: 8px;
  content: "";
  background: #d9dde4;
}

.room-button {
  display: grid;
  width: 100%;
  min-height: 42px;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  margin: 2px 0;
  color: #536074;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
}

.room-button:hover {
  border-color: #d7dce4;
  background: rgb(255 255 255 / 62%);
}

.room-button.is-active {
  color: var(--white);
  border-color: #1d3259;
  background: linear-gradient(100deg, var(--navy-800), var(--navy-700));
  box-shadow: 0 2px 5px rgb(31 52 91 / 22%);
}

.room-button .room-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--teal-700);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  border-radius: 5px;
  background: #dcece9;
}

.room-button.is-active .room-icon {
  color: var(--white);
  background: rgb(255 255 255 / 13%);
}

.room-button .room-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.room-button .room-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-button .room-copy small {
  overflow: hidden;
  margin-top: 2px;
  color: #959daa;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-button.is-active .room-copy small {
  color: #bdc9dc;
}

.room-button .room-count {
  min-width: 20px;
  padding: 2px 4px;
  color: #808999;
  font-size: 8px;
  text-align: center;
  border-radius: 8px;
  background: #e0e4ea;
}

.room-button.is-active .room-count {
  color: var(--white);
  background: rgb(255 255 255 / 14%);
}

.panel-loading,
.panel-empty {
  display: flex;
  min-height: 100px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #929baa;
  font-size: 9px;
  text-align: center;
}

.panel-loading i {
  width: 18px;
  height: 18px;
  margin-bottom: 9px;
  border: 2px solid #d4d9e1;
  border-top-color: var(--teal-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.rooms-footer {
  padding: 10px 12px;
  border-top: 1px solid #d6dbe3;
  background: #e9ecf1;
}

.rooms-footer button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 5px;
  color: #667186;
  font-size: 9px;
  font-weight: 700;
  border: 1px solid #ccd2dc;
  border-radius: 4px;
  background: #f8f9fa;
}

.rooms-footer button span {
  margin-right: 5px;
  color: var(--teal-600);
  font-size: 13px;
}

.rooms-footer small {
  display: block;
  margin-top: 5px;
  color: #9aa2af;
  font-size: 7px;
  text-align: center;
}

.conversation {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background:
    linear-gradient(rgb(255 255 255 / 92%), rgb(255 255 255 / 92%)),
    repeating-linear-gradient(0deg, transparent 0 25px, #eef0f3 25px 26px);
}

.conversation-header {
  display: flex;
  min-height: 66px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(#fff, #fafbfc);
  box-shadow: 0 2px 5px rgb(29 43 67 / 5%);
}

.room-symbol {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  margin-right: 10px;
  color: var(--white);
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  border: 1px solid #11766e;
  border-radius: 7px;
  background: linear-gradient(145deg, #31b4a8, #16847b);
  box-shadow: inset 0 1px rgb(255 255 255 / 20%), 0 2px 4px rgb(19 108 101 / 18%);
}

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

.room-title > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.room-title h1 {
  overflow: hidden;
  margin: 0;
  color: var(--navy-950);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: -0.2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-title p {
  overflow: hidden;
  margin: 2px 0 0;
  color: #858e9c;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-tag {
  padding: 2px 5px;
  color: var(--teal-700);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.6px;
  border: 1px solid #b7dcd7;
  border-radius: 3px;
  background: #ecf8f6;
}

.room-facts {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 12px;
}

.room-facts > span {
  color: #838d9d;
  font-size: 9px;
}

.room-facts > span b {
  color: #5c677a;
}

.room-facts .icon-button {
  width: 27px;
  height: 27px;
  color: var(--navy-700);
  font-weight: 700;
  border-color: #d1d6df;
  background: #f8f9fa;
}

.offline-banner {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 14px;
  color: #7b4b31;
  border-bottom: 1px solid #ecd0a1;
  background: #fff6df;
}

.offline-banner > span {
  color: var(--amber-500);
  font-size: 18px;
}

.offline-banner p {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin: 0;
  font-size: 9px;
}

.offline-banner small {
  color: #9b785b;
  font-size: 7px;
}

.offline-banner button {
  padding: 5px 8px;
  color: #765037;
  font-size: 8px;
  font-weight: 700;
  border: 1px solid #dfbc80;
  border-radius: 3px;
  background: #fffaf0;
}

.message-stream {
  position: relative;
  min-height: 0;
  flex: 1;
  padding: 17px 21px 14px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c1c7d1 transparent;
  scrollbar-width: thin;
}

.empty-state {
  display: flex;
  height: 100%;
  min-height: 190px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #929aa7;
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 11px;
  color: var(--teal-600);
  font-size: 23px;
  border: 1px solid #c6dedb;
  border-radius: 50%;
  background: #f0faf8;
}

.empty-state strong {
  color: var(--navy-800);
  font-family: var(--font-display);
  font-size: 14px;
}

.empty-state p {
  max-width: 300px;
  margin: 5px 0 0;
  font-size: 9px;
}

.date-divider {
  display: flex;
  align-items: center;
  margin: 5px 0 16px;
  color: #9aa2ae;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.date-divider::before,
.date-divider::after {
  height: 1px;
  flex: 1;
  content: "";
  background: #e3e6eb;
}

.date-divider span {
  padding: 0 10px;
}

.system-message {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}

.system-message span {
  padding: 4px 9px;
  color: #818998;
  font-size: 8px;
  border: 1px solid #e0e3e8;
  border-radius: 11px;
  background: #f8f9fa;
}

.chat-message {
  position: relative;
  display: grid;
  max-width: 850px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 5px 8px 7px 5px;
  margin: 0 0 5px;
  border-radius: 6px;
}

.chat-message:hover {
  background: #f7f8fa;
}

.chat-message.is-own {
  background: #f3f9f8;
}

.chat-message.is-pending {
  opacity: 0.68;
}

.chat-message.is-failed {
  border: 1px solid #f0bfc0;
  background: #fff6f5;
}

.chat-message .message-avatar {
  width: 32px;
  height: 32px;
  margin-top: 1px;
}

.message-main {
  min-width: 0;
}

.message-meta {
  display: flex;
  gap: 7px;
  align-items: baseline;
  margin-bottom: 2px;
}

.message-author {
  padding: 0;
  color: var(--navy-800);
  font-size: 10px;
  font-weight: 800;
  background: transparent;
}

.message-author:hover {
  color: var(--teal-700);
  text-decoration: underline;
}

.message-time {
  color: #a0a7b2;
  font-size: 7px;
}

body.hide-timestamps .message-time {
  display: none;
}

.message-state {
  color: #8b96a6;
  font-size: 7px;
}

.message-state.is-error {
  color: var(--danger);
}

.message-text {
  overflow-wrap: anywhere;
  color: #434e61;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message-text a {
  color: var(--teal-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-image-button {
  display: block;
  max-width: min(390px, 90%);
  padding: 4px;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid #cfd5de;
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.message-image-button img {
  display: block;
  width: auto;
  max-height: 270px;
  border-radius: 3px;
  object-fit: cover;
}

.new-messages-button {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 95px;
  padding: 7px 11px;
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  border: 1px solid #14776f;
  border-radius: 16px;
  background: var(--teal-600);
  box-shadow: var(--shadow-md);
}

.typing-line {
  min-height: 18px;
  padding: 2px 20px 0;
  color: #8992a1;
  font-size: 8px;
  font-style: italic;
}

.composer {
  position: relative;
  flex: 0 0 auto;
  padding: 0 14px 9px;
  border-top: 1px solid #e0e3e8;
  background: linear-gradient(#fafbfc, #f4f6f8);
}

.attachment-preview {
  display: flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 6px 8px 6px 6px;
  margin: 8px 0 0 72px;
  border: 1px solid #c9d9d6;
  border-radius: 5px;
  background: #f3faf9;
}

.attachment-preview img {
  width: 38px;
  height: 32px;
  object-fit: cover;
  border-radius: 3px;
}

.attachment-preview > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.attachment-preview strong {
  max-width: 210px;
  overflow: hidden;
  color: #546174;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview small {
  color: #8b96a4;
  font-size: 7px;
}

.attachment-preview button {
  padding: 2px 5px;
  color: #87909d;
  font-size: 14px;
  background: transparent;
}

.composer-row {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  padding-top: 8px;
}

.composer-tool {
  display: grid;
  width: 30px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #6e798a;
  font-size: 16px;
  border: 1px solid #ccd2dc;
  border-radius: 4px;
  background: #fff;
  box-shadow: inset 0 1px #fff;
}

.composer-tool:hover {
  color: var(--teal-700);
  border-color: #a8cbc6;
  background: #f5fbfa;
}

.composer textarea {
  min-width: 0;
  height: 34px;
  min-height: 34px;
  max-height: 112px;
  flex: 1;
  padding: 8px 10px;
  resize: none;
  color: #394659;
  font-size: 10px;
  line-height: 16px;
  border: 1px solid #c8cfd9;
  border-radius: 5px;
  background: #fff;
  box-shadow: inset 0 1px 3px rgb(31 44 65 / 5%);
}

.composer textarea:focus {
  outline: 0;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgb(34 166 155 / 11%);
}

.send-button {
  display: flex;
  height: 34px;
  align-items: center;
  padding: 0 7px 0 11px;
  color: var(--white);
  font-size: 9px;
  font-weight: 800;
  border: 1px solid #126e67;
  border-radius: 4px;
  background: linear-gradient(#29aa9f, #16877f);
  box-shadow: inset 0 1px rgb(255 255 255 / 20%), 0 1px 3px rgb(26 113 106 / 19%);
}

.send-button b {
  margin-left: 8px;
  font-size: 11px;
}

.send-button:disabled {
  cursor: not-allowed;
  color: #949ca9;
  border-color: #cfd4dc;
  background: #e6e9ed;
  box-shadow: none;
}

.composer-hint {
  display: flex;
  justify-content: space-between;
  padding: 5px 0 0 72px;
  color: #a0a7b1;
  font-size: 7px;
}

.composer-hint kbd {
  padding: 0 3px;
  font-size: 6px;
}

.emoji-picker {
  position: absolute;
  z-index: 4;
  bottom: 51px;
  left: 11px;
  display: grid;
  grid-template-columns: repeat(4, 32px);
  gap: 3px;
  padding: 7px;
  border: 1px solid #cbd1da;
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.emoji-picker button {
  display: grid;
  width: 32px;
  height: 30px;
  place-items: center;
  font-size: 17px;
  border-radius: 3px;
  background: transparent;
}

.emoji-picker button:hover {
  background: var(--cream-200);
}

.member-list {
  min-height: 0;
  flex: 1;
  padding: 8px;
  overflow: auto;
}

.member-section-title {
  padding: 8px 8px 5px;
  color: #939ba8;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.member-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 44px;
  grid-template-columns: 33px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 4px 7px;
  margin: 1px 0;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
}

.member-button:hover {
  border-color: #d7dce3;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.member-button .avatar {
  width: 31px;
  height: 31px;
}

.member-button .avatar::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 7px;
  height: 7px;
  content: "";
  border: 2px solid var(--white);
  border-radius: 50%;
  background: #54b99c;
}

.member-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.member-copy strong {
  overflow: hidden;
  color: #4a566a;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-copy small {
  overflow: hidden;
  margin-top: 2px;
  color: #989faa;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role {
  color: var(--coral-600);
  font-size: 9px;
}

.members-legend {
  display: flex;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  color: #969eaa;
  font-size: 7px;
  border-top: 1px solid #d9dde4;
  background: #edf0f3;
}

.members-legend i {
  width: 6px;
  height: 6px;
  margin-right: 5px;
}

.members-legend span {
  margin: 0 5px;
}

.app-statusbar {
  display: flex;
  min-height: 24px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  color: #9eabba;
  font-size: 7px;
  border-top: 1px solid #14233d;
  background: linear-gradient(#2a416c, #203559);
}

.app-statusbar > span {
  display: flex;
  align-items: center;
}

.app-statusbar i {
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--amber-500);
}

.app-statusbar i.is-online {
  background: #59c2a2;
}

.app-statusbar b {
  font-weight: 500;
}

body.compact-mode .chat-message {
  padding-block: 2px;
  margin-bottom: 1px;
}

body.compact-mode .chat-message .message-avatar {
  width: 27px;
  height: 27px;
}

/* Dialogs and feedback */

.modal {
  max-width: calc(100% - 28px);
  padding: 0;
  overflow: visible;
  color: var(--ink);
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgb(13 24 44 / 68%);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(390px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #aeb8c7;
  border-radius: 8px;
  background: #fff;
}

.modal-close {
  position: absolute;
  z-index: 3;
  top: 9px;
  right: 9px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #fff;
  font-size: 18px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 50%;
  background: rgb(10 24 48 / 25%);
}

.modal-close.static {
  position: static;
  flex: 0 0 auto;
  color: #677286;
  border-color: #cdd3dc;
  border-radius: 4px;
  background: #fff;
}

.profile-cover {
  display: flex;
  height: 112px;
  align-items: flex-end;
  padding: 0 24px;
  background:
    radial-gradient(circle at 80% 20%, rgb(255 255 255 / 15%) 0 15%, transparent 15.5%),
    linear-gradient(135deg, var(--navy-800), var(--teal-600));
}

.profile-avatar {
  width: 72px;
  height: 72px;
  margin-bottom: -29px;
  font-size: 23px;
  border-width: 4px;
  box-shadow: 0 3px 10px rgb(14 29 50 / 22%);
}

.profile-content {
  padding: 13px 24px 21px;
}

.presence-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--teal-700);
  font-size: 8px;
  font-weight: 700;
}

.presence-label i {
  display: block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
}

.profile-content h2 {
  margin: 9px 0 0;
  color: var(--navy-950);
  font-family: var(--font-display);
  font-size: 21px;
}

.profile-handle {
  margin: 0;
  color: #8a93a0;
  font-size: 9px;
}

.profile-bio {
  min-height: 38px;
  padding: 10px;
  margin: 14px 0;
  color: #626d7e;
  font-size: 10px;
  border-left: 3px solid var(--teal-500);
  background: #f6f8fa;
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0;
}

.profile-details div {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border: 1px solid #e0e4e9;
  border-radius: 4px;
}

.profile-details dt {
  color: #979faa;
  font-size: 7px;
  text-transform: uppercase;
}

.profile-details dd {
  margin: 2px 0 0;
  color: #566174;
  font-size: 9px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 17px;
}

.secondary-button,
.danger-button {
  min-height: 38px;
  padding: 0 15px;
  color: #606c80;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #cbd1da;
  border-radius: 4px;
  background: #f8f9fa;
}

.danger-button {
  min-height: 31px;
  color: var(--danger);
  border-color: #e0b8ba;
  background: #fff5f4;
}

.settings-card {
  width: min(500px, calc(100vw - 28px));
}

.modal-heading {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid #d1d7e0;
  background: linear-gradient(#f8f9fb, #eceff4);
}

.modal-heading span {
  color: #9099a8;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.modal-heading h2 {
  margin: 2px 0 0;
  color: var(--navy-900);
  font-family: var(--font-display);
  font-size: 16px;
}

.settings-content {
  padding: 18px;
}

.settings-content > p {
  margin: -4px 0 8px;
  color: #8b94a2;
  font-size: 8px;
}

.settings-content > input {
  height: 38px;
  padding: 0 11px;
  margin-bottom: 15px;
}

.toggle-line,
.settings-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-top: 1px solid #e3e6eb;
}

.toggle-line > span,
.settings-session > span {
  display: flex;
  flex-direction: column;
}

.toggle-line strong,
.settings-session strong {
  color: #505c70;
  font-size: 10px;
}

.toggle-line small,
.settings-session small {
  margin-top: 2px;
  color: #929aa7;
  font-size: 8px;
}

.toggle-line input {
  width: 32px;
  height: 18px;
  accent-color: var(--teal-600);
}

.settings-session {
  margin-top: 3px;
  padding-bottom: 0;
}

.settings-actions {
  padding: 12px 18px;
  margin: 0;
  border-top: 1px solid #d8dde5;
  background: #f5f7f9;
}

.info-card {
  padding: 29px 27px 25px;
  text-align: center;
}

.info-card .modal-close {
  color: #687386;
  border-color: #d3d8df;
  background: #f6f7f9;
}

.info-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin: 0 auto 10px;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 23px;
  border-radius: 9px;
  background: linear-gradient(145deg, #31b4a8, #16847b);
}

.info-card h2 {
  margin: 0;
  color: var(--navy-950);
  font-family: var(--font-display);
}

.info-card > p {
  color: #788293;
  font-size: 10px;
}

.info-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.info-stats span {
  display: flex;
  flex-direction: column;
  padding: 10px;
  color: #9199a5;
  font-size: 7px;
  text-transform: uppercase;
  border: 1px solid #dfe3e8;
  border-radius: 5px;
  background: #f7f8fa;
}

.info-stats b {
  margin-bottom: 2px;
  color: var(--navy-800);
  font-size: 11px;
  text-transform: none;
}

.info-card > .primary-button {
  margin: auto;
}

.image-card {
  position: relative;
  display: grid;
  max-width: min(1000px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  place-items: center;
  padding: 8px;
  border-radius: 8px;
  background: #17233e;
}

.image-card img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 46px);
  border-radius: 4px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: flex;
  width: min(330px, calc(100vw - 36px));
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 12px;
  color: #eef4f7;
  font-size: 10px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 5px;
  background: #253858;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease-out;
}

.toast::before {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  content: "i";
  color: var(--navy-900);
  font-family: Georgia, serif;
  font-weight: 700;
  border-radius: 50%;
  background: #82d1c4;
}

.toast.is-error::before {
  content: "!";
  background: #f69486;
}

.toast.is-success::before {
  content: "✓";
  background: #72ceb3;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* Responsive layout */

@media (max-width: 980px) {
  .welcome-main {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 0.8fr);
    gap: 42px;
  }

  .welcome-copy h1 {
    font-size: 48px;
  }

  .preview-window {
    display: none;
  }

  .welcome-features {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .chat-layout {
    grid-template-columns: 205px minmax(340px, 1fr) 190px;
  }

  .profile-button > span:nth-child(2),
  .profile-button b,
  .connection-pill span {
    display: none;
  }

  .connection-pill {
    width: 25px;
    justify-content: center;
    padding: 0;
  }

  .connection-pill i {
    margin: 0;
  }
}

@media (max-width: 760px) {
  .page-width {
    width: min(100% - 30px, 560px);
  }

  .welcome-header {
    min-height: 78px;
  }

  .welcome-badge {
    display: none;
  }

  .welcome-main {
    display: flex;
    flex-direction: column;
    gap: 31px;
    align-items: stretch;
    padding-block: 28px 42px;
  }

  .welcome-copy {
    text-align: center;
  }

  .eyebrow {
    justify-content: center;
  }

  .welcome-copy h1 {
    margin-inline: auto;
    font-size: clamp(39px, 12vw, 54px);
    letter-spacing: -2px;
  }

  .welcome-copy > p {
    margin-inline: auto;
    font-size: 15px;
  }

  .welcome-features {
    display: none;
  }

  .auth-window {
    max-width: 470px;
    justify-self: center;
    margin-inline: auto;
  }

  .welcome-footer {
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    padding-block: 11px;
  }

  .chat-app {
    padding: 0;
    background: #fff;
  }

  .desktop-window {
    min-height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-titlebar {
    min-height: 50px;
    grid-template-columns: 1fr auto;
    padding: 0 10px 0 12px;
  }

  .app-brand img {
    width: 27px;
    height: 27px;
  }

  .app-brand small,
  .window-caption,
  .connection-pill {
    display: none;
  }

  .mobile-bar {
    display: grid;
    min-height: 39px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 8px;
    color: #59657a;
    border-bottom: 1px solid #d2d8e1;
    background: linear-gradient(#f8f9fb, #e9edf2);
  }

  .mobile-bar button {
    padding: 5px;
    color: var(--navy-700);
    font-size: 10px;
    font-weight: 700;
    background: transparent;
  }

  .mobile-bar button:last-child {
    justify-self: end;
  }

  .mobile-bar strong {
    max-width: 180px;
    overflow: hidden;
    color: var(--navy-900);
    font-family: var(--font-display);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-layout {
    display: block;
    position: relative;
    min-height: 0;
    flex: 1;
  }

  .conversation {
    height: 100%;
  }

  .side-panel {
    position: absolute;
    z-index: 12;
    top: 0;
    bottom: 0;
    width: min(285px, 84vw);
    box-shadow: 8px 0 30px rgb(20 32 55 / 24%);
    transition: transform 0.2s ease;
  }

  .rooms-panel {
    left: 0;
    transform: translateX(-105%);
  }

  .members-panel {
    right: 0;
    transform: translateX(105%);
    box-shadow: -8px 0 30px rgb(20 32 55 / 24%);
  }

  .rooms-panel.is-open,
  .members-panel.is-open {
    transform: translateX(0);
  }

  .mobile-scrim {
    position: fixed;
    z-index: 10;
    inset: 89px 0 0;
    background: rgb(15 27 48 / 45%);
  }

  .conversation-header {
    min-height: 58px;
    padding-inline: 12px;
  }

  .room-symbol {
    width: 32px;
    height: 32px;
  }

  .message-stream {
    padding-inline: 12px;
  }

  .chat-message {
    grid-template-columns: 31px minmax(0, 1fr);
    gap: 7px;
    padding-inline: 2px 5px;
  }

  .chat-message .message-avatar {
    width: 29px;
    height: 29px;
  }

  .composer {
    padding-inline: 8px;
  }

  .composer-tool {
    width: 33px;
  }

  .composer-row .composer-tool:first-child {
    display: none;
  }

  .composer-hint {
    padding-left: 39px;
  }

  .composer-hint span:first-child {
    display: none;
  }

  .composer-hint span:last-child {
    margin-left: auto;
  }

  .attachment-preview {
    margin-left: 39px;
  }

  .app-statusbar {
    display: none;
  }
}

@media (max-width: 460px) {
  .brand strong {
    font-size: 19px;
  }

  .brand small {
    font-size: 8px;
  }

  .welcome-copy h1 {
    font-size: 39px;
  }

  .welcome-copy > p {
    font-size: 13px;
  }

  .auth-content {
    padding: 22px 19px 19px;
  }

  .auth-intro img {
    width: 49px;
    height: 49px;
  }

  .auth-intro h2 {
    font-size: 17px;
  }

  .profile-button {
    border: 0;
    background: transparent;
  }

  .conversation-header {
    min-height: 53px;
  }

  .room-title p,
  .room-tag,
  .room-facts > span {
    display: none;
  }

  .message-stream {
    padding: 12px 8px;
  }

  .message-image-button {
    max-width: 100%;
  }

  .composer-row {
    gap: 5px;
  }

  .composer-tool {
    width: 31px;
  }

  .send-button {
    width: 37px;
    padding: 0;
    justify-content: center;
  }

  .send-button span {
    display: none;
  }

  .send-button b {
    margin: 0;
  }

  .profile-details,
  .info-stats {
    grid-template-columns: 1fr;
  }
}

@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;
  }
}

/* --- User Rank System Styles --- */
.rank-red {
  color: #ef4444 !important;
}
.rank-green {
  color: #10b981 !important;
}
.rank-blue {
  color: #3b82f6 !important;
}
.rank-gray {
  color: #8b96a6 !important;
}

button.message-author.rank-red:hover {
  color: #dc2626 !important;
}
button.message-author.rank-green:hover {
  color: #059669 !important;
}
button.message-author.rank-blue:hover {
  color: #2563eb !important;
}
button.message-author.rank-gray:hover {
  color: #4b5563 !important;
}

.profile-admin-section select,
.profile-admin-section input[type="number"] {
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background-color: var(--white);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-admin-section select:focus,
.profile-admin-section input[type="number"]:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgb(34 166 155 / 15%);
}

.profile-admin-section label {
  user-select: none;
}

/* --- Knuddels Command & Whisper Styles --- */
.chat-message.is-whisper {
  background-color: #fdf2f8 !important;
  border-left: 3px solid #db2777 !important;
}

.chat-message.is-system-action {
  display: block !important;
  padding-left: 10px !important;
  border-left: 3px solid var(--teal-500);
}

.chat-message.is-system-action .message-avatar,
.chat-message.is-system-action .message-meta {
  display: none !important;
}

.chat-message.is-system-action .message-text {
  font-style: italic;
  color: var(--navy-900);
  font-size: 11px;
}
