:root {
  color-scheme: light;
  --ink: #0e2942;
  --muted: #456a84;
  --soft: #5c9dc2;
  --line: rgba(20, 124, 190, 0.44);
  --paper: rgba(255, 255, 255, 0.94);
  --glass: rgba(255, 255, 255, 0.78);
  --canvas: #8edfff;
  --accent: #007fd1;
  --accent-deep: #005f9d;
  --green: #18b957;
  --green-deep: #08783b;
  --amber: #f5a400;
  --orange: #f27012;
  --pink: #d92886;
  --blue: #0f66d1;
  --danger: #b42318;
  --shadow: 0 18px 46px rgba(18, 83, 132, 0.28);
  --inset-shine: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --radius: 8px;
  font-family: "Segoe UI", Tahoma, Inter, ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.56) 0 15%, transparent 15% 58%, rgba(255, 199, 64, 0.42) 58% 72%, transparent 72%),
    linear-gradient(180deg, #1baee8 0%, #a4eaff 38%, #ddffd8 72%, #ffe28c 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 139, 209, 0.22), transparent 32%),
    linear-gradient(270deg, rgba(17, 185, 83, 0.2), transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px 90px);
}

body.is-dev-environment::after {
  content: "DEV";
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 10000;
  pointer-events: none;
  min-width: 52px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffb12e, #ef4f17);
  box-shadow: 0 8px 20px rgba(116, 38, 10, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  padding: 7px 9px;
  text-align: center;
  text-shadow: 0 1px 1px rgba(90, 27, 0, 0.42);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.left-rail,
.chat-panel {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(51, 126, 181, 0.42);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--inset-shine);
}

.left-rail {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(205, 241, 255, 0.9) 34%, rgba(184, 222, 250, 0.92)),
    linear-gradient(90deg, rgba(24, 185, 87, 0.2), transparent 46%, rgba(255, 181, 40, 0.2));
}

.left-rail {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.is-main-window .app-shell {
  width: min(430px, 100vw);
  grid-template-columns: minmax(0, 1fr);
}

.is-main-window .left-rail {
  width: 100%;
}

.is-main-window .chat-panel {
  display: none;
}

.is-web-client.is-main-window .app-shell {
  width: min(1240px, 100vw);
  margin: 0 auto;
  grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
}

.is-web-client.is-main-window .left-rail {
  overflow-x: hidden;
  overflow-y: auto;
}

.is-web-client.is-main-window .profile-card {
  align-items: flex-start;
  flex-wrap: wrap;
}

.is-web-client.is-main-window .profile-actions {
  flex: 1 0 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.is-web-client.is-main-window .chat-panel {
  display: grid;
}

.is-chat-window .app-shell {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 8px;
}

.is-chat-window .left-rail {
  display: none;
}

.is-chat-window .chat-panel {
  min-height: 0;
}

.brand-strip,
.profile-card,
.section-title,
.chat-header,
.presence-item,
.conversation-item,
.file-item,
.composer {
  display: flex;
  align-items: center;
}

.brand-strip {
  min-height: 58px;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.3)),
    linear-gradient(90deg, #008fe8, #18bd67 52%, #ffb629);
  box-shadow: var(--inset-shine), 0 8px 24px rgba(9, 93, 154, 0.28);
  padding: 10px;
}

.download-page-button,
.download-back-link,
.download-option-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.2)),
    linear-gradient(180deg, #31d56b, #0c8a44);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(7, 73, 36, 0.45);
  box-shadow: var(--inset-shine), 0 6px 14px rgba(7, 73, 36, 0.18);
}

.download-page-button {
  margin-left: auto;
  padding: 0 12px;
  white-space: nowrap;
}

.is-desktop-shell .download-page-button {
  display: none;
}

.download-page-button:hover,
.download-back-link:hover,
.download-option-button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.24)),
    linear-gradient(180deg, #4be87c, #08783b);
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), transparent 48%),
    linear-gradient(135deg, #096fd3, #00b9ef 47%, #38d660);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 50, 90, 0.44);
  box-shadow: 0 8px 18px rgba(7, 96, 171, 0.34);
}

.brand-strip h1,
.chat-header h2,
.section-title h2,
.profile-dialog h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-strip h1 {
  color: #fff;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(3, 62, 105, 0.44);
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.app-version-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 1px 1px rgba(8, 76, 127, 0.42);
}

.update-progress {
  width: min(186px, 100%);
  display: grid;
  gap: 3px;
}

.update-progress-bar {
  height: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(0, 76, 128, 0.22);
  box-shadow: inset 0 1px 2px rgba(0, 56, 96, 0.2);
}

.update-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #fff59a, #ffb12e);
  box-shadow: 0 0 8px rgba(255, 181, 48, 0.5);
  transition: width 180ms ease;
}

#updateProgressText {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(8, 76, 127, 0.42);
  white-space: nowrap;
}

.update-progress.is-error .update-progress-bar span {
  background: linear-gradient(180deg, #ffd6d6, #e34b46);
}

.download-page {
  min-height: 100%;
  overflow: auto;
}

.download-shell {
  width: min(980px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  margin: 0 auto;
  padding: 12px;
}

.download-topbar {
  position: relative;
  z-index: 1;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.3)),
    linear-gradient(90deg, #008fe8, #18bd67 52%, #ffb629);
  box-shadow: var(--shadow), var(--inset-shine);
  padding: 10px;
}

.download-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.download-brand strong,
.download-brand small {
  display: block;
}

.download-brand strong {
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(3, 62, 105, 0.44);
}

.download-brand small {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.9;
  text-shadow: 0 1px 1px rgba(8, 76, 127, 0.42);
}

.download-back-link {
  flex: 0 0 auto;
  padding: 0 12px;
}

.download-panel {
  position: relative;
  z-index: 1;
  align-self: start;
  display: grid;
  gap: 18px;
  border: 1px solid rgba(74, 149, 194, 0.34);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow), var(--inset-shine);
  padding: clamp(18px, 4vw, 34px);
}

.download-heading {
  display: grid;
  gap: 6px;
}

.download-heading h1 {
  margin: 0;
  color: #075f97;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1;
}

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

.download-option {
  min-height: 220px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
  border: 1px solid rgba(57, 137, 190, 0.36);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(220, 244, 255, 0.92)),
    linear-gradient(135deg, rgba(0, 143, 232, 0.12), rgba(24, 185, 87, 0.1) 58%, rgba(255, 182, 41, 0.12));
  box-shadow: var(--inset-shine), 0 8px 20px rgba(44, 113, 157, 0.12);
  padding: 18px;
}

.download-platform {
  margin: 0 0 10px;
  color: #08783b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.download-option h2,
.download-option p {
  margin: 0;
}

.download-option h2 {
  color: #075f97;
  font-size: 22px;
  line-height: 1.1;
}

.download-option p:not(.download-platform) {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.download-option-button {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: rgba(19, 48, 74, 0.7);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-strip .eyebrow {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 1px rgba(8, 76, 127, 0.42);
}

.profile-card,
.add-contact-card,
.drop-card,
.presence-card,
.files-panel {
  border: 1px solid rgba(74, 149, 194, 0.34);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--inset-shine), 0 8px 20px rgba(44, 113, 157, 0.12);
}

.profile-card {
  position: relative;
  gap: 12px;
  padding: 12px;
}

.profile-card::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 99px 99px 0 0;
  background: linear-gradient(90deg, #008fe8, #18b957, #ffb629, #d92886);
}

.profile-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.profile-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.is-main-window .profile-card {
  gap: 10px;
}

.is-main-window .profile-actions {
  gap: 5px;
}

.is-main-window .profile-actions .ghost-button {
  min-width: 0;
  padding: 0 10px;
}

.find-people-button {
  min-height: 30px;
  border: 1px solid rgba(8, 120, 59, 0.54);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), transparent 48%),
    linear-gradient(180deg, #3ee56f, #108947);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
  text-shadow: 0 1px 1px rgba(7, 73, 36, 0.45);
  box-shadow: var(--inset-shine), 0 7px 16px rgba(14, 126, 64, 0.24);
}

.find-people-button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 48%),
    linear-gradient(180deg, #5cf082, #08783b);
}

.invite-button {
  min-width: 72px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 48%),
    linear-gradient(180deg, #42d96f, #13924b);
  color: #fff;
  text-shadow: 0 1px 1px rgba(7, 73, 36, 0.42);
}

.invite-button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), transparent 48%),
    linear-gradient(180deg, #62ec89, #0d7f40);
}

.profile-copy strong,
.presence-item span,
.conversation-copy strong,
.conversation-copy span,
.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy span,
.quiet,
.file-meta,
.message-meta,
.upload-progress p,
.drop-zone span,
.section-title span,
.device-panel,
.chat-empty span,
.file-empty span {
  color: var(--muted);
  font-size: 13px;
}

.profile-message {
  color: #0b6fae !important;
  font-style: italic;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  box-shadow: 0 2px 7px rgba(28, 82, 124, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.avatar.small {
  width: 30px;
  height: 30px;
  border-width: 1px;
  font-size: 11px;
}

.avatar.large {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

.avatar.has-photo {
  background: #d8f0ff;
  padding: 0;
  text-shadow: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.ghost-button,
.secondary-button,
.mini-button,
.icon-button {
  min-height: 36px;
  border: 1px solid rgba(20, 124, 190, 0.48);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #cceeff);
  color: #064f86;
  font-weight: 800;
  box-shadow: var(--inset-shine), 0 1px 2px rgba(41, 104, 148, 0.1);
}

.ghost-button {
  padding: 0 12px;
}

.ghost-button:hover,
.secondary-button:hover,
.mini-button:hover,
.icon-button:hover {
  background: linear-gradient(180deg, #fff, #afe2ff);
  border-color: rgba(0, 127, 209, 0.76);
}

.icon-button {
  width: 36px;
  padding: 0;
  display: grid;
  place-items: center;
}

.alerts-button span {
  position: relative;
  width: 16px;
  height: 17px;
  border: 2px solid #0b6fae;
  border-top: 0;
  border-radius: 4px 4px 8px 8px;
}

.alerts-button span::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -7px;
  width: 8px;
  height: 8px;
  border: 2px solid #0b6fae;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.alerts-button span::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0b6fae;
}

.volume-button {
  position: relative;
}

.volume-button img {
  width: 25px;
  height: 23px;
  display: block;
  object-fit: contain;
}

.volume-button.is-muted img {
  opacity: 0.48;
  filter: grayscale(0.32);
}

.volume-button.is-muted::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 17px;
  width: 22px;
  height: 3px;
  border-radius: 99px;
  background: #b42318;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.76);
  transform: rotate(-42deg);
}

.volume-panel {
  position: absolute;
  z-index: 12;
  top: calc(100% + 8px);
  right: 0;
  width: 190px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(57, 137, 190, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(225, 246, 255, 0.96));
  box-shadow: var(--shadow), var(--inset-shine);
  padding: 10px;
}

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

.volume-panel input[type="range"] {
  width: 100%;
  accent-color: #118bd0;
}

.volume-panel span {
  color: #075f97;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.code-button span {
  position: relative;
  width: 17px;
  height: 13px;
  border: 2px solid #0b6fae;
  border-radius: 3px;
}

.code-button span::before,
.code-button span::after {
  content: "";
  position: absolute;
  background: #0b6fae;
}

.code-button span::before {
  left: 3px;
  right: 3px;
  top: 3px;
  height: 2px;
}

.code-button span::after {
  left: 3px;
  bottom: -6px;
  width: 7px;
  height: 2px;
  box-shadow: 0 3px 0 #0b6fae;
}

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

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

.section-title.compact {
  min-height: 24px;
  padding-bottom: 6px;
}

.section-title.compact h2 {
  font-size: 14px;
}

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

.add-contact-form input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(57, 137, 190, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  outline: none;
  padding: 0 11px;
  text-transform: uppercase;
  box-shadow: inset 0 1px 3px rgba(33, 91, 136, 0.1);
}

.contact-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.contact-hint button {
  border: 0;
  background: transparent;
  color: #075f97;
  font: inherit;
  font-weight: 900;
  padding: 0;
}

.primary-button,
.send-button {
  min-height: 42px;
  border: 1px solid rgba(0, 95, 157, 0.7);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 46%),
    linear-gradient(180deg, #05b4f1, #0070b8);
  color: #fff;
  font-weight: 900;
  padding: 0 16px;
  text-shadow: 0 1px 1px rgba(3, 64, 107, 0.48);
  box-shadow: var(--inset-shine), 0 8px 16px rgba(0, 100, 166, 0.3);
}

.primary-button:hover,
.send-button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 46%),
    linear-gradient(180deg, #31c4ff, #005f9d);
}

.drop-zone {
  min-height: 106px;
  display: grid;
  place-items: center;
  gap: 5px;
  border: 1px dashed rgba(8, 121, 191, 0.62);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(231, 249, 255, 0.88)),
    repeating-linear-gradient(45deg, rgba(24, 162, 232, 0.08) 0 8px, transparent 8px 16px);
  text-align: center;
  outline: none;
  padding: 16px;
}

.drop-zone strong {
  color: #0b6fae;
}

.drop-zone.is-dragging {
  border-color: var(--green);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(232, 255, 237, 0.92)),
    repeating-linear-gradient(45deg, rgba(47, 184, 90, 0.14) 0 8px, transparent 8px 16px);
}

.upload-progress {
  display: grid;
  gap: 6px;
}

.upload-progress p {
  margin: 0;
  overflow-wrap: anywhere;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 127, 209, 0.28);
  border-radius: 999px;
  background: #bfe9ff;
  box-shadow: inset 0 1px 2px rgba(21, 78, 120, 0.13);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent),
    linear-gradient(90deg, #009fe8, #18b957, #ffb629);
}

.presence-card,
.files-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.conversations-card {
  min-height: 0;
  overflow: hidden;
}

.roster-card {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(207, 241, 255, 0.9) 42%, rgba(190, 226, 250, 0.92)),
    linear-gradient(90deg, rgba(0, 143, 232, 0.14), transparent 44%, rgba(24, 185, 87, 0.14));
}

.roster-title {
  align-items: center;
}

.roster-heading {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.roster-title .find-people-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.roster-title h2 {
  font-size: 18px;
}

.roster-search {
  position: relative;
}

.roster-search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 2px solid #0b6fae;
  border-radius: 50%;
  transform: translateY(-60%);
}

.roster-search::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 25px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: #0b6fae;
  transform: rotate(45deg);
}

.roster-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(57, 137, 190, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 248, 255, 0.94));
  color: var(--ink);
  outline: none;
  padding: 0 11px 0 36px;
  box-shadow: inset 0 1px 3px rgba(33, 91, 136, 0.1), var(--inset-shine);
}

.roster-list {
  border: 1px solid rgba(74, 149, 194, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(235, 248, 255, 0.34));
  padding: 6px;
}

.section-title {
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  border-bottom: 1px solid rgba(77, 155, 199, 0.18);
  padding-bottom: 9px;
}

.section-title h2 {
  color: #075f97;
  font-size: 16px;
  text-shadow: 0 1px 0 #fff;
}

.section-title span {
  border: 1px solid rgba(47, 184, 90, 0.28);
  border-radius: 999px;
  background: rgba(235, 255, 239, 0.72);
  color: #15783e;
  font-weight: 800;
  padding: 3px 8px;
}

.presence-list,
.file-list {
  min-height: 0;
  overflow: auto;
  scrollbar-color: rgba(17, 139, 208, 0.52) transparent;
}

.presence-list {
  display: grid;
  align-content: start;
  gap: 7px;
}

.conversation-list {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.presence-item,
.conversation-item {
  gap: 9px;
  min-width: 0;
  border-radius: var(--radius);
}

.conversation-item {
  width: 100%;
  min-height: 56px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 7px 8px;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.conversation-item:hover {
  border-color: rgba(0, 127, 209, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(194, 236, 255, 0.84));
}

.conversation-item.is-active {
  border-color: rgba(0, 127, 209, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(166, 226, 255, 0.88)),
    linear-gradient(90deg, rgba(0, 127, 209, 0.22), transparent);
  box-shadow: inset 3px 0 0 var(--accent), var(--inset-shine);
}

.conversation-item.just-online {
  border-color: rgba(24, 185, 87, 0.82);
  background: linear-gradient(180deg, rgba(246, 255, 248, 0.96), rgba(178, 250, 195, 0.9));
}

.conversation-item.just-online .conversation-copy strong {
  color: var(--green-deep);
}

.conversation-item.has-activity {
  border-color: rgba(245, 158, 11, 0.8);
  background: linear-gradient(180deg, #fff9d6, #ffe49a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.54), 0 0 0 2px rgba(255, 201, 71, 0.22);
}

.conversation-item.has-activity .conversation-copy strong {
  display: inline-block;
  justify-self: start;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(199, 112, 0, 0.3);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 52%),
    linear-gradient(180deg, #fff15c, #ffc247);
  color: #7a3606;
  padding: 1px 7px;
  animation: activity-pulse 950ms ease-in-out infinite;
}

.conversation-item.activity-file .conversation-copy strong {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 52%),
    linear-gradient(180deg, #c9ecff, #78c9f4);
  color: #084c86;
}

.conversation-item.activity-nudge .conversation-copy strong {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 52%),
    linear-gradient(180deg, #ffd39d, #ff9a35);
  color: #7c2d12;
}

.conversation-item.activity-game .conversation-copy strong {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 52%),
    linear-gradient(180deg, #bdf7ff, #6bdc9a);
  color: #075f67;
}

.conversation-item.is-group {
  border-color: rgba(126, 87, 194, 0.18);
}

.conversation-item.is-group:hover {
  border-color: rgba(126, 87, 194, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(225, 219, 255, 0.84)),
    linear-gradient(90deg, rgba(0, 168, 232, 0.1), rgba(255, 194, 50, 0.12));
}

.group-size-pill {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(92, 62, 178, 0.26);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), transparent 48%),
    linear-gradient(180deg, #d8f4ff, #bca9ff);
  color: #3f2f7c;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--inset-shine);
}

.conversation-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.conversation-copy strong {
  color: #123858;
  font-size: 14px;
  line-height: 1.15;
}

.conversation-copy span,
.contact-empty {
  color: var(--muted);
  font-size: 12px;
}

.contact-group-label {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 8px 0 3px;
  border: 1px solid rgba(74, 149, 194, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(210, 239, 255, 0.88));
  color: #075f97;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 4px 8px 4px 22px;
  text-shadow: 0 1px 0 #fff;
}

.contact-group-label::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  border-left: 6px solid #0b6fae;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: translateY(-50%);
}

.contact-empty {
  margin: 2px 8px 7px 22px;
}

.friend-row {
  position: relative;
}

.friend-row.is-offline {
  opacity: 0.72;
}

.friend-row.is-offline .avatar {
  filter: grayscale(0.82);
}

.roster-empty {
  display: grid;
  gap: 4px;
  margin: 10px 4px 4px;
  border: 1px dashed rgba(74, 149, 194, 0.38);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  text-align: center;
  padding: 16px 12px;
}

.roster-empty strong {
  color: #075f97;
}

.roster-empty span {
  font-size: 12px;
}

.online-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: #a9bdcb;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.online-dot.is-online,
.online-dot.is-available {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 184, 90, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.72);
}

.online-dot.is-busy {
  background: #d92d20;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.16), inset 0 1px 1px rgba(255, 255, 255, 0.72);
}

.online-dot.is-away {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.72);
}

.unread-pill {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(173, 73, 4, 0.34);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), transparent 48%),
    linear-gradient(180deg, #ffdf62, #f08a24);
  color: #7c2d12;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--inset-shine), 0 0 0 2px rgba(255, 198, 71, 0.22);
  animation: activity-pulse 950ms ease-in-out infinite;
}

.chat-panel {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(226, 247, 255, 0.96)),
    linear-gradient(120deg, rgba(0, 158, 232, 0.14), transparent 50%, rgba(255, 182, 41, 0.16));
}

.chat-header {
  grid-row: 1;
}

.party-panel {
  grid-row: 2;
}

.message-list {
  grid-row: 3;
}

.chat-upload-progress {
  grid-row: 4;
}

.composer {
  grid-row: 5;
}

.chat-panel.is-file-dragging::after {
  content: "Drop file to send";
  position: absolute;
  z-index: 4;
  inset: 94px 18px 86px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(17, 139, 208, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(220, 246, 255, 0.88));
  color: #075f97;
  font-size: 24px;
  font-weight: 900;
  text-shadow: 0 1px 0 #fff;
  pointer-events: none;
  box-shadow: var(--inset-shine), 0 18px 46px rgba(34, 88, 130, 0.2);
}

.chat-header {
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  border-bottom: 1px solid rgba(37, 137, 197, 0.42);
  border-radius: var(--radius) var(--radius) 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.2) 42%, rgba(255, 255, 255, 0.52) 43%),
    linear-gradient(90deg, #00a7ec, #35d86b 50%, #ffc232);
  box-shadow: var(--inset-shine), 0 9px 18px rgba(8, 93, 154, 0.2);
  padding: 18px clamp(18px, 3vw, 34px);
}

.chat-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 52px;
  height: 52px;
  border-width: 2px;
  font-size: 16px;
  box-shadow: 0 7px 18px rgba(7, 96, 171, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

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

.chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.chat-header h2 {
  color: #063d70;
  font-size: 22px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.chat-header h2.just-online-title {
  color: var(--green-deep);
}

.chat-header h2.activity-title {
  display: inline-block;
  border: 1px solid rgba(199, 112, 0, 0.3);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 52%),
    linear-gradient(180deg, #fff15c, #ffc247);
  color: #7a3606;
  padding: 1px 8px;
  animation: activity-pulse 950ms ease-in-out infinite;
}

.conversation-subline {
  max-width: min(680px, 58vw);
  margin: 6px 0 0;
  color: rgba(6, 63, 114, 0.76);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.54);
}

.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(20, 124, 190, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #064f86;
  font-size: 13px;
  font-weight: 900;
  padding: 0 12px;
  box-shadow: var(--inset-shine);
}

.status-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--soft);
}

.status-pill.is-online::before {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 184, 90, 0.18);
}

.status-pill.is-connecting::before {
  background: var(--amber);
}

.status-pill.is-offline::before {
  background: var(--pink);
}

.party-panel {
  margin: 14px clamp(18px, 3vw, 34px) 0;
  border: 1px solid rgba(52, 150, 207, 0.46);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(221, 247, 255, 0.72)),
    linear-gradient(135deg, rgba(119, 216, 247, 0.24), rgba(255, 230, 117, 0.28));
  box-shadow: 0 14px 32px rgba(27, 105, 158, 0.18), var(--inset-shine);
  overflow: hidden;
}

.party-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(83, 166, 212, 0.34);
}

.party-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.party-copy strong,
.party-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-copy strong {
  color: #063d70;
  font-size: 15px;
}

.party-copy span {
  color: rgba(6, 63, 114, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.party-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.party-fullscreen-button span {
  position: relative;
  width: 17px;
  height: 17px;
}

.party-fullscreen-button span::before,
.party-fullscreen-button span::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: #0b6fae;
  border-style: solid;
}

.party-fullscreen-button span::before {
  left: 0;
  top: 0;
  border-width: 2px 0 0 2px;
}

.party-fullscreen-button span::after {
  right: 0;
  bottom: 0;
  border-width: 0 2px 2px 0;
}

.party-fullscreen-button.is-active span::before {
  left: 8px;
  top: 8px;
  border-width: 0 2px 2px 0;
}

.party-fullscreen-button.is-active span::after {
  right: 8px;
  bottom: 8px;
  border-width: 2px 0 0 2px;
}

.party-peer-progress {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(83, 166, 212, 0.26);
  background: rgba(234, 249, 255, 0.72);
}

.party-peer-progress[hidden] {
  display: none;
}

.party-peer-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.party-peer-avatar {
  width: 30px;
  height: 30px;
}

.party-peer-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.party-peer-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(6, 63, 114, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.party-peer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-peer-state {
  flex: 0 0 auto;
  color: rgba(6, 63, 114, 0.62);
}

.party-peer-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(33, 128, 190, 0.16);
  box-shadow: inset 0 1px 2px rgba(10, 58, 94, 0.16);
}

.party-peer-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9f1c, #28b7ff);
  transition: width 180ms ease;
}

.party-peer-row.is-ready .party-peer-state {
  color: #05865d;
}

.party-peer-row.is-ready .party-peer-bar span {
  background: linear-gradient(90deg, #13b981, #00a5ff);
}

.party-peer-row.is-error .party-peer-state {
  color: #b42318;
}

.party-peer-row.is-error .party-peer-bar span {
  background: #d92d20;
}

.party-video {
  display: block;
  width: 100%;
  max-height: min(38vh, 360px);
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(135deg, #062c4c, #0b658c 56%, #173553);
}

.party-video.is-empty {
  display: none;
  min-height: 0;
}

.party-panel:fullscreen,
.party-panel.is-party-fallback-fullscreen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(226, 250, 255, 0.98), rgba(213, 243, 255, 0.94)),
    #041521;
}

.party-panel:fullscreen .party-toolbar,
.party-panel.is-party-fallback-fullscreen .party-toolbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(221, 247, 255, 0.86));
}

.party-panel:fullscreen .party-video,
.party-panel.is-party-fallback-fullscreen .party-video {
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: contain;
  background: #02070d;
}

body.is-party-fallback-fullscreen {
  overflow: hidden;
}

body.is-party-fallback-fullscreen .party-panel.is-party-fallback-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  box-shadow: none;
}

.message-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(210, 242, 255, 0.48)),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(0, 127, 209, 0.055) 35px 36px);
  padding: 24px clamp(18px, 4vw, 56px);
  scrollbar-color: rgba(17, 139, 208, 0.52) transparent;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: min(760px, 88%);
}

.message-row.is-own {
  align-self: flex-end;
}

.message-row.is-system {
  align-self: center;
  justify-content: center;
  max-width: min(560px, 92%);
}

.message-bubble {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(20, 124, 190, 0.4);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(211, 241, 255, 0.98));
  box-shadow: var(--inset-shine), 0 8px 22px rgba(18, 83, 132, 0.16);
  padding: 11px 13px;
}

.message-row:not(.is-own) .message-bubble::before,
.message-row.is-own .message-bubble::before {
  content: "";
  position: absolute;
  bottom: 10px;
  width: 12px;
  height: 12px;
  border: inherit;
  background: inherit;
  transform: rotate(45deg);
}

.message-row:not(.is-own) .message-bubble::before {
  left: -6px;
  border-width: 0 0 1px 1px;
}

.message-row.is-own .message-bubble::before {
  right: -6px;
  border-width: 1px 1px 0 0;
}

.message-row.is-system .message-bubble::before {
  display: none;
}

.message-row.is-own .message-bubble {
  border-color: rgba(24, 185, 87, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(194, 255, 207, 0.98));
}

.message-bubble.is-file {
  border-color: rgba(42, 95, 215, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(224, 232, 255, 0.98));
}

.message-bubble.is-game {
  width: min(380px, 80vw);
  border-color: rgba(0, 127, 209, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(223, 248, 255, 0.98)),
    linear-gradient(90deg, rgba(24, 185, 87, 0.14), rgba(255, 181, 40, 0.16));
}

.message-bubble.is-nudge {
  border-color: rgba(199, 112, 0, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 48%),
    linear-gradient(180deg, #fff5b7, #ffd678);
  color: #7a3606;
  text-align: center;
  padding: 8px 14px;
  box-shadow: var(--inset-shine), 0 7px 18px rgba(230, 132, 24, 0.16);
}

.message-bubble.is-system-note {
  border-color: rgba(20, 124, 190, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), transparent 48%),
    linear-gradient(180deg, #e9f8ff, #d3edff);
  color: #075f97;
  text-align: center;
  padding: 8px 14px;
  box-shadow: var(--inset-shine), 0 7px 18px rgba(34, 112, 170, 0.12);
}

.message-bubble.is-system-note .message-text {
  font-weight: 800;
}

.message-sender {
  display: block;
  margin-bottom: 4px;
  color: #075f97;
  font-size: 13px;
}

.message-bubble.is-nudge .message-text {
  font-weight: 900;
}

.message-bubble.is-nudge .message-meta {
  justify-content: center;
  margin: 3px 0 0;
  color: rgba(122, 54, 6, 0.62);
  font-size: 12px;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  color: #47708d;
  font-weight: 800;
}

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

.message-link {
  color: #005f9d;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.message-row.is-own .message-link {
  color: #013f69;
}

.game-card {
  display: grid;
  gap: 12px;
}

.game-card-header,
.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-card-footer {
  flex-wrap: wrap;
}

.game-card-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.game-card-title strong {
  color: #064f86;
  font-size: 15px;
  line-height: 1.15;
}

.game-card-title span,
.game-card-footer {
  color: #456a84;
  font-size: 12px;
  font-weight: 800;
}

.game-turn-pill {
  flex: 0 0 auto;
  max-width: 128px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(8, 120, 59, 0.34);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(214, 255, 225, 0.88));
  color: #08783b;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  padding: 0 9px;
  text-align: center;
}

.game-card.is-won .game-turn-pill,
.game-card.is-draw .game-turn-pill {
  border-color: rgba(199, 112, 0, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 238, 188, 0.9));
  color: #8a5200;
}

.tic-tac-toe-board {
  width: min(250px, 100%);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  justify-self: center;
  overflow: hidden;
  border: 1px solid rgba(17, 139, 208, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(208, 245, 255, 0.76));
  box-shadow: var(--inset-shine), 0 8px 18px rgba(17, 104, 165, 0.12);
}

.tic-tac-toe-cell {
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 4px solid rgba(7, 95, 151, 0.38);
  border-bottom: 4px solid rgba(7, 95, 151, 0.38);
  border-radius: 0;
  background: transparent;
  color: #075f97;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.tic-tac-toe-cell:nth-child(3n) {
  border-right: 0;
}

.tic-tac-toe-cell:nth-child(n + 7) {
  border-bottom: 0;
}

.tic-tac-toe-cell:not(:disabled):hover,
.tic-tac-toe-cell:not(:disabled):focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(216, 255, 225, 0.82));
  outline: none;
  transform: none;
}

.tic-tac-toe-cell.is-x {
  color: #007fd1;
}

.tic-tac-toe-cell.is-o {
  color: #f27012;
}

.tic-tac-toe-cell.is-winning {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(188, 255, 208, 0.86));
  color: #08783b;
}

.tic-tac-toe-cell:disabled {
  cursor: default;
}

.game-player-badge {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.game-player-badge strong {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(0, 127, 209, 0.12);
  color: #007fd1;
  font-size: 12px;
  line-height: 1;
}

.game-player-badge.is-o strong {
  background: rgba(242, 112, 18, 0.14);
  color: #c25400;
}

.game-player-badge span {
  min-width: 0;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.game-score-pill {
  min-width: 0;
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid rgba(57, 137, 190, 0.26);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(223, 248, 255, 0.76));
  color: #456a84;
  font-size: 11px;
  font-weight: 900;
  padding: 0 8px;
}

.game-score-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-score-pill strong {
  color: #064f86;
  font-size: 14px;
}

.game-result-banner {
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(8, 120, 59, 0.34);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(203, 255, 218, 0.86));
  color: #08783b;
  font-weight: 900;
  text-align: center;
}

.game-result-banner.is-draw {
  border-color: rgba(199, 112, 0, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 236, 180, 0.9));
  color: #8a5200;
}

.game-rematch-button {
  min-height: 28px;
  border: 1px solid rgba(0, 95, 157, 0.48);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(191, 236, 255, 0.88));
  color: #075f97;
  font-size: 12px;
  font-weight: 900;
  padding: 0 9px;
  box-shadow: var(--inset-shine);
}

.game-rematch-button:hover,
.game-rematch-button:focus-visible {
  border-color: rgba(8, 120, 59, 0.56);
  background:
    linear-gradient(180deg, #fff, #d8ffe1);
  outline: none;
}

.message-file {
  display: grid;
  gap: 5px;
}

.message-file-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: #47708d;
  font-weight: 800;
}

.message-file a {
  color: var(--blue);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.transfer-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(48, 119, 163, 0.22);
  border-radius: 999px;
  background: #e8f6ff;
  color: #086596;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.transfer-badge.is-p2p {
  border-color: rgba(27, 146, 75, 0.26);
  background: #eaffef;
  color: #16733a;
}

.transfer-badge.is-relay {
  border-color: rgba(213, 133, 0, 0.28);
  background: #fff4d4;
  color: #8a5200;
}

.chat-empty,
.file-empty {
  margin: auto;
  display: grid;
  gap: 5px;
  color: var(--ink);
  text-align: center;
}

.chat-empty strong,
.file-empty strong {
  color: #075f97;
}

.composer {
  position: relative;
  display: grid;
  align-items: stretch;
  gap: 10px;
  border-top: 1px solid rgba(37, 137, 197, 0.28);
  border-radius: 0 0 var(--radius) var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(197, 235, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  padding: 14px clamp(18px, 3vw, 34px);
}

.composer-toolbar {
  position: relative;
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-input-row {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.composer textarea {
  min-height: 46px;
  max-height: 168px;
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid rgba(57, 137, 190, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
  box-shadow: inset 0 1px 3px rgba(33, 91, 136, 0.1);
}

.emoji-button,
.games-button,
.party-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 139, 208, 0.5);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(218, 243, 255, 0.96) 52%, rgba(173, 220, 248, 0.98)),
    linear-gradient(90deg, rgba(255, 218, 83, 0.2), transparent 56%);
  color: #075f97;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--inset-shine), 0 6px 14px rgba(31, 113, 169, 0.12);
  padding: 0;
}

.games-button {
  position: relative;
  font-size: 0;
}

.games-icon {
  display: block;
  width: 31px;
  height: 31px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(60, 23, 145, 0.22));
  pointer-events: none;
}

.party-button {
  overflow: hidden;
  border-color: rgba(117, 92, 217, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(230, 244, 255, 0.92) 52%, rgba(181, 222, 249, 0.98)),
    linear-gradient(90deg, rgba(255, 218, 83, 0.2), transparent 56%);
  color: #073a73;
}

.party-button.is-open {
  border-color: rgba(242, 159, 33, 0.74);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), transparent),
    linear-gradient(180deg, #ffed93, #66d5fa);
  box-shadow: 0 0 0 3px rgba(255, 202, 75, 0.22), var(--inset-shine);
}

.party-icon {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 2px 4px rgba(58, 17, 136, 0.24));
  pointer-events: none;
}

.emoji-button:hover,
.emoji-button.is-open,
.games-button:hover,
.games-button.is-open,
.party-button:hover {
  border-color: rgba(17, 139, 208, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(218, 243, 255, 0.98) 52%, rgba(145, 209, 246, 0.98)),
    linear-gradient(90deg, rgba(255, 218, 83, 0.32), transparent 56%);
  transform: translateY(-1px);
}

.emoji-panel {
  position: absolute;
  z-index: 5;
  left: 0;
  bottom: calc(100% + 6px);
  width: min(336px, calc(100% - 36px));
  max-height: min(260px, 48vh);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(57, 137, 190, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(220, 245, 255, 0.96));
  box-shadow: var(--shadow), var(--inset-shine);
  padding: 8px;
}

.games-panel {
  position: absolute;
  z-index: 5;
  left: 46px;
  bottom: calc(100% + 6px);
  width: min(260px, calc(100% - 36px));
  display: grid;
  gap: 8px;
  border: 1px solid rgba(57, 137, 190, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(220, 245, 255, 0.96));
  box-shadow: var(--shadow), var(--inset-shine);
  padding: 8px;
}

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

.emoji-choice,
.game-choice {
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(74, 149, 194, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 22px;
  line-height: 1;
  box-shadow: var(--inset-shine);
}

.game-choice {
  aspect-ratio: auto;
  min-height: 64px;
  justify-items: start;
  gap: 3px;
  color: #064f86;
  font-size: 13px;
  line-height: 1.2;
  padding: 10px 12px;
  text-align: left;
}

.game-choice strong {
  color: #064f86;
  font-size: 14px;
}

.game-choice span {
  color: #456a84;
  font-weight: 700;
}

.emoji-choice:hover,
.emoji-choice:focus-visible,
.game-choice:hover,
.game-choice:focus-visible {
  border-color: rgba(0, 127, 209, 0.7);
  background: #fff7d6;
  outline: none;
}

.composer textarea:disabled,
.emoji-button:disabled,
.games-button:disabled,
.party-button:disabled,
.send-button:disabled {
  cursor: default;
  opacity: 0.56;
}

.chat-upload-progress {
  margin: 0 clamp(18px, 3vw, 34px) 12px;
}

.send-button {
  height: 46px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 48%),
    linear-gradient(180deg, #35dc68, #108947);
  border-color: rgba(8, 120, 59, 0.7);
  box-shadow: var(--inset-shine), 0 8px 16px rgba(14, 126, 64, 0.28);
}

.send-button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 48%),
    linear-gradient(180deg, #52ea7b, #08783b);
}

.nudge-button {
  position: relative;
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(57, 137, 190, 0.46);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(206, 238, 255, 0.94) 52%, rgba(166, 219, 249, 0.98)),
    linear-gradient(90deg, rgba(255, 194, 50, 0.24), transparent 56%);
  box-shadow: var(--inset-shine), 0 5px 12px rgba(18, 83, 132, 0.2);
}

.nudge-button::before,
.nudge-button::after {
  content: none;
  position: absolute;
  top: 14px;
  width: 16px;
  height: 18px;
  color: rgba(16, 93, 147, 0.72);
  font-size: 17px;
  font-weight: 900;
  line-height: 7px;
  white-space: pre;
  text-align: center;
  pointer-events: none;
  opacity: 0.9;
}

.nudge-button::before {
  left: 0;
  transform: rotate(90deg);
}

.nudge-button::after {
  right: 0;
  transform: rotate(90deg);
}

.nudge-button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(218, 243, 255, 0.96) 52%, rgba(173, 220, 248, 0.98)),
    linear-gradient(90deg, rgba(255, 218, 83, 0.26), transparent 56%);
  border-color: rgba(17, 139, 208, 0.72);
  transform: translateY(-1px);
}

.nudge-button:hover .nudge-icon,
.nudge-button.is-nudging .nudge-icon {
  animation: nudge-icon-wiggle 430ms steps(2, end) infinite;
}

.nudge-button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.nudge-icon {
  position: relative;
  width: 40px;
  height: auto;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  object-position: center;
  transform: translateY(-1px) rotate(-3deg);
}

.nudge-icon::before {
  content: none;
  position: absolute;
  left: 6px;
  top: 4px;
  width: 10px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  transform: rotate(-24deg);
}

.nudge-icon::after {
  content: none;
  position: absolute;
  right: 5px;
  bottom: 4px;
  width: 7px;
  height: 5px;
  border-radius: 50%;
  background: rgba(161, 72, 5, 0.12);
}

.nudge-eye {
  position: absolute;
  z-index: 2;
  top: 8px;
  width: 8px;
  height: 7px;
  border: 2px solid rgba(92, 43, 9, 0.88);
  border-radius: 50%;
  background: #fff7bf;
}

.nudge-eye::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 1px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #5c2b09;
}

.nudge-eye.left {
  left: 6px;
  transform: rotate(15deg);
}

.nudge-eye.left::after {
  left: 3px;
  top: 0;
}

.nudge-eye.right {
  right: 5px;
  top: 8px;
  width: 8px;
  height: 7px;
  transform: rotate(-15deg);
}

.nudge-eye.right::after {
  left: 3px;
  top: 4px;
}

.nudge-mouth {
  position: absolute;
  z-index: 2;
  left: 7px;
  bottom: 6px;
  width: 15px;
  height: 9px;
  pointer-events: none;
}

.nudge-mouth::before,
.nudge-mouth::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 5px;
  border-color: rgba(92, 43, 9, 0.9);
  border-style: solid;
}

.nudge-mouth::before {
  left: 0;
  top: 0;
  border-width: 2px 0 0 2px;
  border-radius: 9px 0 0 0;
  transform: rotate(8deg);
}

.nudge-mouth::after {
  right: 0;
  bottom: 0;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 9px 0;
  transform: rotate(8deg);
}

.nudge-eye,
.nudge-mouth {
  display: none;
}

.composer textarea:focus,
.profile-dialog input:focus,
.profile-dialog select:focus,
.add-contact-form input:focus,
.roster-search input:focus,
.directory-search input:focus,
.drop-zone:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 139, 208, 0.18), inset 0 1px 3px rgba(33, 91, 136, 0.1);
}

.files-panel {
  height: 100%;
}

.file-list {
  display: grid;
  align-content: start;
  gap: 9px;
  padding-right: 2px;
}

.file-item {
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(74, 149, 194, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(235, 248, 255, 0.84));
  box-shadow: var(--inset-shine), 0 5px 13px rgba(44, 113, 157, 0.1);
  padding: 10px;
}

.file-type {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(10, 111, 174, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 50%),
    linear-gradient(180deg, #bceaff, #78c9f4);
  color: #084c86;
  font-size: 11px;
  font-weight: 900;
  box-shadow: var(--inset-shine);
}

.file-content {
  min-width: 0;
  display: grid;
  gap: 5px;
  flex: 1;
}

.file-name {
  color: #064f86;
  font-weight: 900;
  text-decoration: none;
}

.file-name:hover {
  text-decoration: underline;
}

.file-name.is-disabled {
  color: #4c6b83;
  text-decoration: none;
  cursor: default;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  text-decoration: none;
  font-size: 12px;
  padding: 0 9px;
}

.mini-button.danger {
  color: var(--danger);
}

.modal-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(4, 65, 111, 0.36), rgba(5, 80, 120, 0.22)),
    rgba(6, 37, 63, 0.22);
  padding: 18px;
  backdrop-filter: blur(8px);
}

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

.profile-dialog {
  width: min(470px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid rgba(70, 145, 190, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(229, 248, 255, 0.94));
  box-shadow: var(--shadow), var(--inset-shine);
  padding: 24px;
}

.directory-dialog {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  min-height: 360px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 13px;
  border: 1px solid rgba(70, 145, 190, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(229, 248, 255, 0.95));
  box-shadow: var(--shadow), var(--inset-shine);
  padding: 18px;
}

.directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.directory-header h2 {
  margin: 0;
  color: #075f97;
  font-size: 24px;
}

.close-button span {
  position: relative;
  width: 16px;
  height: 16px;
}

.close-button span::before,
.close-button span::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  width: 2px;
  height: 16px;
  border-radius: 2px;
  background: #0b6fae;
}

.close-button span::before {
  transform: rotate(45deg);
}

.close-button span::after {
  transform: rotate(-45deg);
}

.directory-search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(57, 137, 190, 0.42);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
  box-shadow: inset 0 1px 3px rgba(33, 91, 136, 0.1);
}

.directory-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(74, 149, 194, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  padding: 8px;
}

.directory-user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(74, 149, 194, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(235, 248, 255, 0.84));
  padding: 8px;
}

.invite-user {
  cursor: pointer;
}

.invite-user input {
  width: 17px;
  height: 17px;
  accent-color: #15944b;
}

.directory-user.is-offline {
  opacity: 0.74;
}

.directory-user-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.directory-user-copy strong,
.directory-user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-user-copy strong {
  color: #123858;
}

.directory-user-copy span,
.directory-empty {
  color: var(--muted);
  font-size: 13px;
}

.directory-empty {
  margin: auto;
  text-align: center;
}

.profile-dialog h2 {
  color: #075f97;
  font-size: 26px;
}

.profile-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid rgba(57, 137, 190, 0.34);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(218, 241, 255, 0.82));
  padding: 5px;
}

.profile-mode-tabs button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: #0b5f94;
  font-weight: 900;
}

.profile-mode-tabs button.is-active {
  border-color: rgba(18, 132, 204, 0.42);
  background:
    linear-gradient(180deg, #fff, #cbefff);
  box-shadow: var(--inset-shine), 0 2px 7px rgba(31, 113, 169, 0.16);
}

.profile-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.profile-dialog input,
.profile-dialog select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(57, 137, 190, 0.42);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
}

.password-field {
  position: relative;
  display: block;
}

.profile-dialog .password-field input {
  padding-right: 48px;
}

.password-toggle-button {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #0b6fae;
  transform: translateY(-50%);
}

.password-toggle-button:hover,
.password-toggle-button:focus-visible {
  background: rgba(18, 132, 204, 0.12);
  outline: none;
}

.password-toggle-icon {
  position: relative;
  width: 20px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 80% 18%;
  transform: rotate(45deg);
}

.password-toggle-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.password-toggle-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0;
  transform: translateY(-50%) rotate(90deg);
}

.password-toggle-button.is-showing .password-toggle-icon::after {
  opacity: 1;
}

.profile-avatar-edit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(74, 149, 194, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(233, 249, 255, 0.76));
  padding: 12px;
}

.profile-avatar-edit > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-upload-button {
  min-height: 36px;
  display: inline-flex !important;
  align-items: center;
  border: 1px solid rgba(57, 137, 190, 0.42);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #dff3ff);
  color: #13517b !important;
  cursor: pointer;
  font-size: 13px !important;
  font-weight: 900;
  padding: 0 12px;
  box-shadow: var(--inset-shine), 0 1px 2px rgba(41, 104, 148, 0.1);
}

.device-panel {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(74, 149, 194, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  padding: 11px 12px;
}

.device-panel code {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.secondary-button {
  padding: 0 14px;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.online-notice-stack {
  position: fixed;
  z-index: 31;
  right: 18px;
  bottom: 72px;
  width: min(300px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.online-notice-card {
  width: 100%;
  min-height: 58px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 127, 209, 0.58);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(219, 248, 255, 0.94)),
    linear-gradient(90deg, rgba(0, 143, 232, 0.16), rgba(24, 185, 87, 0.14) 54%, rgba(255, 182, 41, 0.1));
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(18, 83, 132, 0.24), var(--inset-shine);
  padding: 8px 10px 8px 16px;
  pointer-events: auto;
  text-align: left;
  animation: online-notice-in 180ms ease-out both;
}

.online-notice-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 7px;
  border-radius: 0 5px 5px 0;
  background: linear-gradient(180deg, #008fe8, #18b957 58%, #ffb629);
}

.online-notice-card:hover {
  border-color: rgba(24, 185, 87, 0.82);
  transform: translateY(-1px);
}

.online-notice-card.is-message {
  border-color: rgba(0, 127, 209, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(224, 246, 255, 0.96)),
    linear-gradient(90deg, rgba(0, 143, 232, 0.18), rgba(255, 182, 41, 0.14));
  box-shadow: 0 14px 34px rgba(18, 83, 132, 0.28), var(--inset-shine);
}

.online-notice-card.is-message::before {
  background: linear-gradient(180deg, #008fe8, #00a6d6 52%, #ffb629);
}

.online-notice-card.is-message:hover {
  border-color: rgba(0, 127, 209, 0.9);
}

.online-notice-card.is-leaving {
  animation: online-notice-out 160ms ease-in both;
}

.online-notice-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.online-notice-copy strong,
.online-notice-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-notice-copy strong {
  color: #005f9d;
  font-size: 14px;
  line-height: 1.1;
}

.online-notice-copy span {
  color: #08783b;
  font-size: 12px;
  font-weight: 800;
}

.online-notice-card.is-message .online-notice-copy strong {
  color: #005f9d;
}

.online-notice-card.is-message .online-notice-copy span {
  color: #8a6100;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent),
    #075f97;
  color: #fff;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-size: 14px;
}

.toast[hidden] {
  display: none;
}

@keyframes online-notice-in {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes online-notice-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  to {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
}

body.is-shaking .app-shell,
body.is-shaking .modal-overlay:not([hidden]),
body.is-shaking .online-notice-stack,
body.is-shaking .toast:not([hidden]) {
  animation: screen-shake 620ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes screen-shake {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }

  10%, 30%, 50%, 70%, 90% {
    transform: translate3d(-8px, 0, 0);
  }

  20%, 40%, 60%, 80% {
    transform: translate3d(8px, 0, 0);
  }
}

@keyframes activity-pulse {
  0%, 100% {
    filter: brightness(1);
    transform: translateY(0);
  }

  50% {
    filter: brightness(1.12);
    transform: translateY(-1px);
  }
}

@keyframes nudge-icon-wiggle {
  0% {
    transform: rotate(-13deg) translate(-1px, 0);
  }

  33% {
    transform: rotate(9deg) translate(2px, -1px);
  }

  66% {
    transform: rotate(-17deg) translate(-2px, 1px);
  }

  100% {
    transform: rotate(6deg) translate(1px, 0);
  }
}

@keyframes nudge-button-kick {
  0%, 100% {
    transform: translateX(0);
  }

  18% {
    transform: translateX(-2px);
  }

  36% {
    transform: translateX(2px);
  }

  54% {
    transform: translateX(-1px);
  }

  72% {
    transform: translateX(1px);
  }
}

.nudge-button.is-nudging {
  animation: nudge-button-kick 520ms steps(2, end) both;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 294px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow: auto;
  }

  .online-notice-stack {
    display: none;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 8px;
  }

  .is-web-client.is-main-window .app-shell {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .left-rail,
  .chat-panel {
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  .left-rail {
    grid-template-rows: auto auto auto;
  }

  .conversations-card {
    max-height: min(48vh, 420px);
  }

  .brand-strip {
    min-height: 54px;
  }

  .download-page-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .download-shell {
    padding: 8px;
  }

  .download-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .download-back-link {
    width: 100%;
  }

  .download-options {
    grid-template-columns: 1fr;
  }

  .download-option {
    min-height: 176px;
  }

  .presence-card:not(.conversations-card) {
    display: none;
  }

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

  .chat-header {
    min-height: 68px;
    padding: 14px;
  }

  .chat-identity {
    gap: 10px;
  }

  .chat-avatar {
    width: 44px;
    height: 44px;
    font-size: 14px;
  }

  .chat-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .conversation-subline {
    max-width: 100%;
    white-space: normal;
  }

  .online-notice-stack {
    right: 12px;
    bottom: 72px;
    width: min(300px, calc(100vw - 24px));
  }

  .message-list {
    min-height: 340px;
    max-height: 58vh;
    padding: 16px 14px;
  }

  .message-row {
    max-width: 96%;
  }

  .composer {
    padding: 12px 14px;
    align-items: flex-end;
  }

  .emoji-panel {
    left: 0;
    right: 0;
    width: auto;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .games-panel {
    left: 0;
    right: 0;
    width: auto;
  }

  .message-bubble.is-game {
    width: min(330px, 82vw);
  }

  .send-button {
    padding: 0 12px;
  }
}
