:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
  --bg: #fff;
  --panel: #f5f5f7;
  --rail: #ededf0;
  --field: #e8e8ed;
  --hover: #e3e3e8;
  --selected: #006be6;
  --text: #1d1d1f;
  --muted: #68686e;
  --line: #d8d8de;
  --bubble: #e9e9eb;
  --accent: #006be6;
  --action: #006be6;
  --accent-hover: #005bc4;
  --blue-soft: #e5efff;
  --shadow: 0 24px 80px #00000024;
  --danger: #cb293b;
  --received-text: #1d1d1f;
  --card: #fff;
  --glass: rgba(245, 245, 247, 0.94);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1c1e;
  --panel: #242426;
  --rail: #202022;
  --field: #343437;
  --hover: #3a3a3e;
  --selected: #146ce0;
  --text: #f5f5f7;
  --muted: #acacb2;
  --line: #424245;
  --bubble: #37373b;
  --accent: #71adff;
  --action: #006be6;
  --accent-hover: #005bc4;
  --blue-soft: #283955;
  --danger: #ff7887;
  --received-text: #f5f5f7;
  --card: #2c2c2e;
  --glass: rgba(36, 36, 38, 0.95);
  --shadow: 0 24px 80px #0008;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: var(--accent);
}
[hidden] {
  display: none !important;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
input,
textarea,
select {
  min-width: 0;
}
svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  vertical-align: middle;
}
svg.symbol {
  fill: currentColor;
  stroke: none;
  stroke-width: 0;
}
button svg {
  pointer-events: none;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
p {
  line-height: 1.5;
}
button:focus:not(:focus-visible) {
  outline: none;
}
.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}
.icon-button:hover {
  color: var(--text);
  background: var(--hover);
}
.icon-button svg {
  width: 22px;
  height: 22px;
}
.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  white-space: nowrap;
}
.primary {
  background: var(--action);
  color: #fff;
  box-shadow: inset 0 1px 0 #ffffff15;
}
.primary:hover {
  background: var(--accent-hover);
}
.secondary {
  background: var(--field);
  color: var(--text);
  border: 1px solid transparent;
}
.secondary:hover {
  border-color: var(--line);
  background: var(--hover);
}
.primary svg,
.secondary svg {
  width: 20px;
  height: 20px;
}
.wide {
  width: 100%;
}
.danger {
  color: var(--danger) !important;
}
.text-button {
  color: var(--accent);
  font-size: 13px;
  padding: 5px 0;
}
.wordmark {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}
.wordmark svg {
  color: var(--accent);
  width: 25px;
  height: 25px;
}
.app-mark {
  width: 66px;
  height: 66px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(#1686ff, #0062d6);
  color: #fff;
  box-shadow:
    0 3px 8px #006be624,
    inset 0 1px 1px #ffffff55;
}
.app-mark svg {
  width: 44px;
  height: 44px;
}
.brand-mark {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  color: var(--accent);
  background: var(--blue-soft);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}
.tiny-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2a9872;
  display: inline-block;
}
.segmented {
  display: flex;
  align-items: center;
  background: var(--field);
  padding: 3px;
  border-radius: 9px;
  gap: 2px;
}
.segmented button {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 7px;
  color: var(--muted);
  white-space: nowrap;
}
.segmented button.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px #0002;
  font-weight: 600;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 17px;
  font-size: 13px;
  font-weight: 500;
}
input:not([type="checkbox"]),
textarea,
select {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 9px;
  padding: 11px 12px;
  width: 100%;
  color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
}
select {
  appearance: auto;
}
.input-prefix,
.password-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
}
.input-prefix > span {
  padding-left: 12px;
  color: var(--muted);
}
.input-prefix input,
.password-input input {
  border: 0;
  background: none;
}
.input-prefix:focus-within,
.password-input:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.input-prefix input:focus,
.password-input input:focus {
  outline: none;
}
.password-input .icon-button {
  margin-right: 3px;
}
#boot {
  display: grid;
  place-items: center;
  height: 100dvh;
  background: var(--panel);
}
/* Account entry: a focused sign-in, without marketing furniture. */
#auth {
  min-height: 100dvh;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  padding: 0 40px;
}
.auth-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}
.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 28px 0 50px;
}
.auth-card {
  width: 412px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 12px 45px #00000008;
  padding: 34px;
}
.auth-card > .app-mark {
  margin: 0 auto 23px;
}
.auth-card h1 {
  font-size: 27px;
  letter-spacing: -0.85px;
  text-align: center;
  font-weight: 650;
  margin: 0 0 9px;
  line-height: 1.2;
}
.auth-card > p {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin-bottom: 24px;
}
.auth-card > .segmented {
  margin-bottom: 26px;
}
.auth-card label {
  font-size: 12px;
}
.auth-card .primary {
  margin-top: 4px;
  min-height: 44px;
}
.auth-note {
  margin: 20px 0 0 !important;
}
.auth-note button {
  font-size: 12px;
}
#forgot-password {
  margin: 15px 0 0;
}
.auth-footer {
  display: flex;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  padding: 25px 0;
  font-size: 11px;
  color: var(--muted);
}
.form-error {
  font-size: 12px;
  line-height: 1.5;
  color: var(--danger);
  margin: 0 0 13px;
}
.form-error:empty {
  display: none;
}
/* Native proportions, explicit navigation, and a content-first split view. */
#app {
  height: 100dvh;
  display: grid;
  grid-template-columns: 76px 318px minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
}
.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 8px 18px;
  gap: 14px;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.rail-logo {
  display: grid;
  place-items: center;
  height: 38px;
  width: 42px;
  margin-bottom: 22px;
  color: var(--accent);
}
.rail-logo svg {
  height: 30px;
  width: 30px;
}
.rail-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  width: 58px;
  min-height: 56px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}
.rail-item svg {
  width: 25px;
  height: 25px;
}
.rail-item:hover {
  background: var(--hover);
}
.rail-item.selected {
  background: var(--blue-soft);
  color: var(--accent);
}
.rail-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.rail-bottom .rail-item {
  min-height: 38px;
}
.rail-profile {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.sidebar-heading {
  height: 84px;
  padding: 18px 19px 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sidebar-heading h1 {
  font-size: 24px;
  letter-spacing: -0.7px;
  flex: 1;
  margin: 0;
  font-weight: 700;
}
.sidebar-heading h1 span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 7px;
  vertical-align: middle;
}
.sidebar-heading .icon-button {
  color: var(--accent);
}
.search-field {
  margin: 5px 18px 16px;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid transparent;
  background: var(--field);
  border-radius: 9px;
  color: var(--muted);
}
.search-field svg {
  width: 17px;
  height: 17px;
}
.search-field input {
  padding: 8px 0;
  border: 0;
  background: none;
  font-size: 13px;
}
.search-field input:focus {
  outline: none;
}
.search-field:focus-within {
  outline: 2px solid var(--accent);
}
.search-field kbd {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.chat-filters {
  display: flex;
  gap: 4px;
  padding: 0 18px 14px;
}
.chat-filters button {
  font-size: 11px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 15px;
  color: var(--muted);
}
.chat-filters button.active {
  background: var(--text);
  color: var(--bg);
}
.chat-filters button:hover:not(.active) {
  background: var(--hover);
}
#conversation-list {
  overflow-y: auto;
  flex: 1;
  padding: 0 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.chat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 11px;
  margin-bottom: 2px;
  border-radius: 9px;
  min-width: 0;
}
.chat-row:hover {
  background: var(--hover);
}
.chat-row.active {
  background: var(--selected);
  color: white;
}
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 550;
  background: var(--avatar-bg, #dedee3);
  color: var(--avatar-fg, #4d4d57);
  position: relative;
  flex-shrink: 0;
}
.avatar svg {
  width: 24px;
  height: 24px;
}
.avatar.group {
  background: var(--blue-soft);
  color: var(--accent);
}
.avatar .online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: #2fa47a;
}
.chat-row.active .online-dot {
  border-color: var(--selected);
}
.chat-copy {
  flex: 1;
  min-width: 0;
}
.chat-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}
.chat-name {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.chat-time {
  font-size: 10px;
  white-space: nowrap;
  color: var(--muted);
}
.chat-bottom {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.chat-preview {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-row.active .chat-time,
.chat-row.active .chat-preview {
  color: #fff;
}
.row-pin {
  color: var(--muted);
  width: 12px;
  height: 12px;
  display: flex;
}
.row-pin svg {
  width: 12px;
  height: 12px;
}
.chat-row.active .row-pin {
  color: #fff;
}
.unread-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  line-height: 18px;
  background: var(--action);
  color: white;
}
.chat-row.active .unread-badge {
  background: #fff;
  color: var(--accent);
}
.sidebar-footer {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 19px 20px;
  font-size: 10px;
  color: var(--muted);
}
#connection {
  padding: 10px 12px;
  margin: 0 12px 12px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--text);
  font-size: 11px;
  line-height: 1.5;
}
.empty-list {
  padding: 45px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.empty-list strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 8px;
}
.empty-list .text-button {
  margin-top: 12px;
}
.chat-main {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.welcome {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px;
}
.welcome-art {
  color: var(--muted);
  margin-bottom: 24px;
}
.welcome-art svg {
  width: 65px;
  height: 65px;
  opacity: 0.5;
}
.welcome h2 {
  font-size: 25px;
  letter-spacing: -0.7px;
  font-weight: 600;
  margin-bottom: 11px;
}
.welcome p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 24px;
}
.welcome .primary {
  font-size: 13px;
}
.welcome-playroom {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.welcome-playroom svg {
  width: 20px;
  height: 20px;
}
#conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.conversation-header {
  min-height: 76px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
  flex-shrink: 0;
}
.conversation-header .avatar {
  width: 37px;
  height: 37px;
  font-size: 12px;
}
.header-person {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  text-align: left;
}
.header-person strong {
  font-size: 14px;
  font-weight: 650;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.header-person > span {
  font-size: 11px;
  color: var(--muted);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.header-actions .icon-button {
  color: var(--accent);
}
.back-button,
.mobile-settings,
.mobile-tabs {
  display: none;
}
.active-call-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 25px;
  background: var(--blue-soft);
  color: var(--text);
  font-size: 12px;
  text-align: left;
}
.active-call-banner svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}
.active-call-banner > span:nth-child(2) {
  flex: 1;
}
.active-call-banner strong {
  color: var(--accent);
  font-size: 12px;
}
#message-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 17px clamp(20px, 4vw, 60px) 9px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
#message-list {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  justify-content: flex-end;
}
.day-divider {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  margin: 12px 0 25px;
  flex-shrink: 0;
}
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 85%;
  min-width: 0;
  align-self: flex-start;
  margin-bottom: 13px;
  position: relative;
  scroll-margin-block: 65px;
  flex-shrink: 0;
}
.message-row.own {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.message-row > .avatar {
  width: 27px;
  height: 27px;
  font-size: 9px;
  margin-bottom: 1px;
}
.bubble-wrap {
  min-width: 0;
  max-width: 100%;
}
.bubble {
  padding: 10px 14px;
  border-radius: 18px 18px 18px 5px;
  background: var(--bubble);
  color: var(--received-text);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  min-width: 70px;
}
.own .bubble {
  background: var(--action);
  color: #fff;
  border-radius: 18px 18px 5px 18px;
}
.message-author {
  display: block;
  font-size: 11px;
  font-weight: 650;
  margin: 0 0 4px;
  color: var(--muted);
}
.message-body {
  white-space: pre-wrap;
}
.message-body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding-top: 5px;
  font-size: 10px;
  white-space: nowrap;
  color: var(--muted);
  line-height: 1.2;
}
.own .message-meta {
  color: #fff;
}
.message-meta svg {
  width: 14px;
  height: 14px;
}
.message-action {
  display: grid;
  place-items: center;
  width: 29px;
  height: 32px;
  flex-shrink: 0;
  color: var(--muted);
  border-radius: 8px;
  opacity: 0;
  align-self: center;
}
.message-action svg {
  width: 21px;
  height: 21px;
}
.message-row:hover .message-action,
.message-row:focus-within .message-action {
  opacity: 1;
}
.message-action:hover {
  background: var(--field);
}
.message-row.deleted .bubble {
  font-style: italic;
  font-size: 13px;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
}
.deleted.own .message-meta {
  color: var(--muted);
}
.reactions {
  display: flex;
  gap: 3px;
  margin: 4px 0 1px;
}
.reaction {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 12px;
  min-height: 28px;
  padding: 3px 8px;
}
.reaction.mine {
  border-color: var(--accent);
  background: var(--blue-soft);
}
.reply-preview {
  border-left: 2px solid currentColor;
  background: #00000008;
  padding: 7px 10px;
  margin: 0 0 8px;
  border-radius: 2px 8px 8px 2px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.reply-preview strong {
  display: block;
  font-size: 11px;
}
.reply-preview p {
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  white-space: nowrap;
}
.media-image {
  display: block;
  max-width: 100%;
  max-height: 310px;
  object-fit: contain;
  border-radius: 12px;
}
.media-button {
  display: block;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  margin-bottom: 5px;
}
.message-row video {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
}
.message-row audio {
  max-width: 100%;
  width: 255px;
  height: 40px;
  display: block;
}
.attachment-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 2px;
  color: inherit;
  text-decoration: none;
}
.attachment-link svg {
  width: 30px;
  height: 30px;
}
.attachment-link strong {
  display: block;
  font-size: 12px;
  word-break: break-all;
}
.attachment-link span {
  font-size: 11px;
}
.waveform {
  display: flex;
  gap: 2px;
  height: 22px;
  align-items: center;
  margin: 5px 0 10px;
}
.waveform:empty {
  display: none;
}
.waveform i {
  width: 3px;
  max-width: 5px;
  flex: 1;
  min-width: 2px;
  background: currentColor;
  border-radius: 2px;
  opacity: 0.7;
}
.wave-0 {
  height: 4px;
}
.wave-1 {
  height: 6px;
}
.wave-2 {
  height: 8px;
}
.wave-3 {
  height: 10px;
}
.wave-4 {
  height: 12px;
}
.wave-5 {
  height: 14px;
}
.wave-6 {
  height: 17px;
}
.wave-7 {
  height: 19px;
}
.wave-8 {
  height: 22px;
}
.link-card {
  display: flex;
  gap: 10px;
  padding: 11px;
  border-radius: 10px;
  margin-top: 10px;
  background: #0000000b;
  color: inherit;
  text-decoration: none;
  min-width: 160px;
  font-size: 11px;
}
.link-card svg {
  width: 19px;
  height: 19px;
}
.link-card strong {
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
}
.load-older {
  align-self: center;
  margin-bottom: 18px;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 12px;
  background: var(--panel);
  color: var(--muted);
}
.chat-start {
  text-align: center;
  padding: 45px 20px;
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.chat-start .avatar {
  margin: 0 auto 15px;
  width: 55px;
  height: 55px;
  font-size: 18px;
}
.chat-start strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}
.chat-start > p {
  margin: 7px 0;
}
.chat-start > span {
  font-size: 12px;
}
#typing-indicator {
  height: 20px;
  font-size: 11px;
  color: var(--muted);
  padding-top: 3px;
}
#typing-indicator:not(:empty)::before {
  content: "•••";
  letter-spacing: 2px;
  margin-right: 7px;
}
#composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 24px 22px;
  background: var(--bg);
  flex-shrink: 0;
}
.composer-input {
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 21px;
  padding-right: 4px;
  background: var(--bg);
}
.composer-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.composer-input textarea {
  border: 0;
  background: none;
  resize: none;
  padding: 10px 13px;
  font-size: 14px;
  line-height: 20px;
  border-radius: 21px;
  max-height: 130px;
  overflow: auto;
}
.composer-input textarea:focus {
  outline: none;
}
.composer-input .icon-button {
  height: 40px;
  color: var(--muted);
}
.send-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--action);
  color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
  margin-bottom: 1px;
}
.send-button svg {
  width: 23px;
  height: 23px;
}
.send-button:hover {
  background: var(--accent-hover);
}
#record-button,
.attach-button {
  height: 40px;
}
#record-button.recording {
  background: #cb293b16;
  color: var(--danger);
  animation: pulse 1s infinite;
}
#reply-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 75px 0 68px;
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--panel);
  font-size: 12px;
  min-width: 0;
}
#reply-bar > div {
  flex: 1;
  min-width: 0;
}
#reply-bar strong {
  display: block;
  font-size: 11px;
  margin-bottom: 3px;
  color: var(--accent);
}
#reply-bar p {
  color: var(--muted);
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#upload-status {
  padding: 7px 24px;
  font-size: 12px;
  color: var(--accent);
}
#message-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
#message-search-bar input {
  background: none;
  border: 0;
  font-size: 13px;
  padding: 8px;
}
#pinned-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 25px;
  min-height: 38px;
  background: var(--blue-soft);
  color: var(--text);
  font-size: 12px;
  text-align: left;
}
#pinned-bar svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}
#pinned-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.highlight .bubble {
  box-shadow: 0 0 0 3px #e3b55288;
}
.pending .bubble {
  opacity: 0.65;
}
/* Sheets and contextual controls. */
dialog {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 30px;
  width: 430px;
  max-width: calc(100vw - 30px);
  max-height: 90dvh;
  overflow: auto;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #10101455;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.7px;
  margin: 5px 0 12px;
  font-weight: 650;
}
dialog h3 {
  font-size: 13px;
  font-weight: 650;
  margin: 24px 0 12px;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
}
.modal-close {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 30px;
  height: 30px;
  background: var(--field);
  border-radius: 50%;
}
.modal-close svg {
  width: 17px;
  height: 17px;
}
#modal-content {
  padding-top: 8px;
}
.dialog-subtitle {
  margin-bottom: 23px;
}
.person-search {
  margin: 18px 0 10px;
}
.person-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 7px;
  text-align: left;
  border-radius: 9px;
}
.person-result:hover {
  background: var(--panel);
}
.person-result > div:nth-child(2) {
  flex: 1;
}
.person-result strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
}
.person-result small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.person-result.selected {
  background: var(--blue-soft);
}
.person-result > svg {
  color: var(--accent);
  width: 22px;
  height: 22px;
}
.search-results {
  min-height: 70px;
  max-height: 270px;
  overflow: auto;
  margin: 10px 0 20px;
}
.search-results > p {
  text-align: center;
  padding: 12px;
}
.selected-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.selected-person {
  padding: 6px 11px;
  background: var(--blue-soft);
  color: var(--accent);
  border-radius: 15px;
  font-size: 12px;
}
.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.privacy-note {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 20px 0;
}
.recovery-code {
  background: var(--panel);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font:
    14px ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  user-select: all;
  margin: 20px 0;
}
.recovery-save {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}
.recovery-save > button {
  flex: 1;
  font-size: 12px;
}
.settings-person {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 24px 0;
}
.settings-person .avatar {
  width: 56px;
  height: 56px;
  font-size: 18px;
}
.settings-person strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.settings-person small {
  font-size: 12px;
  color: var(--muted);
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.setting-row > div {
  flex: 1;
}
.setting-row small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.5;
}
.setting-row .segmented {
  margin: 0;
  flex: 0;
}
.setting-row .segmented button {
  font-size: 11px;
  padding: 7px 9px;
}
.setting-row button:not(.icon-button) {
  font-size: 12px;
}
.settings-footer {
  font-size: 11px;
  text-align: center;
  margin: 25px 0 0;
}
.invite-box {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}
.invite-box button {
  flex-shrink: 0;
}
.invite-box input {
  font-size: 13px;
}
.info-avatar .avatar {
  width: 60px;
  height: 60px;
  font-size: 20px;
  margin-bottom: 20px;
}
.info-members {
  padding-top: 4px;
}
.privacy-list {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.privacy-list li {
  margin-bottom: 11px;
}
.dialog-buttons {
  display: flex;
  gap: 10px;
  margin-top: 23px;
}
.dialog-buttons > button {
  flex: 1;
}
.media-viewer {
  width: min(100%, 900px);
}
.viewer-image {
  display: block;
  max-width: 100%;
  max-height: 70dvh;
  margin: 15px auto;
  border-radius: 10px;
}
.viewer-caption {
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}
#popover {
  position: fixed;
  z-index: 30;
  min-width: 210px;
  max-width: calc(100vw - 20px);
  max-height: 70dvh;
  overflow: auto;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: 0 8px 35px #0003;
  border-radius: 12px;
  padding: 5px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  border-radius: 7px;
}
.menu-item svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.menu-item:hover {
  background: var(--action);
  color: #fff;
}
.menu-item:hover svg {
  color: #fff;
}
.reaction-picker {
  display: flex;
  gap: 3px;
  padding: 4px 2px 9px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.reaction-picker button {
  font-size: 21px;
  padding: 5px;
  border-radius: 7px;
}
.reaction-picker button:hover {
  background: var(--field);
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 7px;
  width: 280px;
}
.emoji-grid button {
  font-size: 24px;
  padding: 6px;
  border-radius: 7px;
}
.emoji-grid button:hover {
  background: var(--field);
}
.gif-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.gif-grid img {
  width: 100%;
  border-radius: 8px;
}
.gif-grid button {
  padding: 0;
}
.giphy-credit {
  font-size: 10px;
  text-align: right;
  color: var(--muted);
  margin-top: 12px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  padding: 12px 19px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 12px;
  max-width: calc(100vw - 28px);
  text-align: center;
  box-shadow: var(--shadow);
}
.notification-prompt {
  position: fixed;
  z-index: 35;
  bottom: 23px;
  right: 24px;
  display: flex;
  gap: 13px;
  width: 372px;
  max-width: calc(100vw - 28px);
  padding: 20px;
  background: var(--glass);
  backdrop-filter: blur(22px);
  border: 1px solid var(--line);
  box-shadow: 0 12px 50px #0003;
  border-radius: 16px;
}
.notification-prompt > #notice-icon {
  width: 39px;
  height: 39px;
  background: var(--action);
  color: #fff;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.notification-prompt strong {
  font-size: 14px;
  font-weight: 650;
}
.notification-prompt p {
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0 14px;
  line-height: 1.5;
}
.notice-actions {
  display: flex;
  gap: 15px;
}
.notice-actions button {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0;
  min-height: 28px;
}
.notice-actions button:last-child {
  font-weight: 400;
  color: var(--muted);
}
/* Playroom: real game covers, simple choices, and invitation cards in the thread. */
#app.games-view {
  grid-template-columns: 76px minmax(0, 1fr);
}
.games-view .sidebar {
  display: none;
}
.games-main {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}
#games-hub {
  height: 100%;
  overflow: auto;
}
#games-content {
  max-width: 1150px;
  margin: 0 auto;
  padding: 45px 44px;
}
.games-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.section-eyebrow {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.games-heading h1 {
  font-size: 32px;
  letter-spacing: -1.15px;
  font-weight: 700;
  margin: 9px 0 10px;
  line-height: 1.15;
}
.games-heading p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.playroom-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.playroom-badge svg {
  width: 21px;
  height: 21px;
}
.game-feature {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  min-height: 300px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 19px;
  overflow: hidden;
  margin-bottom: 35px;
}
.game-feature-copy {
  padding: 31px 35px;
  position: relative;
  z-index: 1;
}
.game-feature-kicker {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.8px;
}
.game-feature h2 {
  font-size: 37px;
  line-height: 1.1;
  letter-spacing: -1.1px;
  margin: 11px 0 14px;
}
.game-feature p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 23px;
}
.game-feature > img {
  width: 100%;
  height: 300px;
  object-fit: contain;
  padding: 18px;
}
.games-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.games-section-heading h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.4px;
  margin: 0;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 27px 24px;
}
.game-card {
  min-width: 0;
}
.game-art {
  display: block;
  width: 100%;
  padding: 0;
  aspect-ratio: 1.65;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  transition: transform 0.16s ease;
}
.game-art:hover {
  transform: translateY(-2px);
}
.game-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-card-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 1px 0;
}
.game-card-copy > div {
  flex: 1;
  min-width: 0;
}
.game-card h3 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 5px;
}
.game-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.game-get {
  padding: 6px 17px;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--accent);
  font-weight: 650;
  font-size: 13px;
}
.game-get:hover {
  background: var(--action);
  color: white;
}
.games-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 35px 0 10px;
}
.games-loading {
  padding: 80px;
  text-align: center;
  color: var(--muted);
}
.games-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 20px;
}
.games-empty > svg {
  height: 65px;
  width: 65px;
  color: var(--muted);
  margin-bottom: 25px;
}
.games-empty h2 {
  font-size: 24px;
  letter-spacing: -0.5px;
}
.games-empty p {
  color: var(--muted);
  font-size: 14px;
}
.game-detail-art {
  height: 160px;
  background: var(--panel);
  border-radius: 12px;
  margin: 10px 0 23px;
}
.game-detail-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.game-detail-heading h2 {
  margin-bottom: 6px;
}
.game-detail-heading p {
  margin-bottom: 20px;
}
.game-detail-heading ~ .secondary {
  margin-top: 9px;
}
.game-invite-form {
  padding-top: 1px;
}
.game-invite-form h3 {
  margin: 26px 0 18px;
  font-size: 15px;
  letter-spacing: -0.2px;
}
.game-seats-note {
  font-size: 12px !important;
}
.game-setting {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  margin: 0;
  font-size: 12px;
}
.game-setting > span {
  flex: 1;
}
.game-setting select,
.game-setting input:not([type="checkbox"]) {
  width: 135px;
  padding: 7px;
  font-size: 12px;
}
.switch-setting input {
  appearance: none;
  position: relative;
  width: 38px;
  height: 23px;
  border: 0;
  border-radius: 15px;
  background: var(--field);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.switch-setting input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  background: #fff;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  box-shadow: 0 1px 3px #0003;
  transition: transform 0.15s;
}
.switch-setting input:checked {
  background: #248250;
}
.switch-setting input:checked::after {
  transform: translateX(15px);
}
#game-options {
  margin: 4px 0 17px;
}
.game-invitation {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  color: var(--text);
  width: 280px;
  max-width: 100%;
}
.invitation-cover {
  height: 120px;
  overflow: hidden;
  min-height: 0;
  background: var(--panel);
  display: grid;
  place-items: center;
}
.invitation-cover img {
  display: block;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.invitation-cover > svg {
  width: 49px;
  height: 49px;
  color: var(--accent);
}
.invitation-copy {
  padding: 15px;
}
.invitation-copy > span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.8px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 8px;
}
.invitation-copy > strong {
  display: block;
  font-size: 19px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.invitation-copy > small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}
.invitation-copy > button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  margin-top: 15px;
  border-radius: 8px;
  background: var(--action);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.invitation-copy button svg {
  width: 16px;
  height: 16px;
}
.bubble:has(.game-invitation) {
  padding: 0;
  background: transparent;
}
.bubble:has(.game-invitation) .message-meta {
  color: var(--muted);
  padding: 6px 4px 0;
}
.bubble:has(.game-invitation) .message-author {
  padding: 0 2px 5px;
  color: var(--muted);
}
#game-player {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.game-player-header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--panel);
}
.game-player-header > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.game-player-header strong {
  font-size: 14px;
  font-weight: 650;
}
.game-player-header span#game-room-code {
  font-size: 11px;
  color: var(--muted);
}
.game-player-header .secondary {
  min-height: 35px;
  padding: 7px 11px;
  font-size: 12px;
}
.game-frame-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--panel);
}
#playroom-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
#game-loading {
  position: absolute;
  z-index: 2;
  background: var(--panel);
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}
#game-player:fullscreen {
  height: 100dvh;
}
/* Group calls stay independent from the chat and game navigation. */
#call-dialog {
  width: 740px;
  max-width: calc(100vw - 28px);
  background: #242427;
  color: #f5f5f7;
  border: 1px solid #4b4b50;
  padding: 23px;
  border-radius: 23px;
}
.call-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
  font-weight: 500;
  color: #b3b3ba;
}
.call-top .icon-button {
  color: #e0e0e5;
}
.call-top .icon-button:hover {
  background: #3d3d42;
}
.call-person {
  text-align: center;
  padding: 30px 0 20px;
}
.call-person .avatar {
  width: 84px;
  height: 84px;
  font-size: 27px;
  margin: 0 auto 23px;
}
.call-person h2 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.7px;
  margin: 0 0 10px;
}
.call-person p {
  font-size: 13px;
  color: #b3b3ba;
  margin: 0;
}
.call-participants {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.call-joined .call-participants {
  display: grid;
}
.call-joined .call-person {
  padding: 13px 0 5px;
}
.call-joined .call-person > #call-avatar {
  display: none;
}
.call-joined .call-person h2 {
  font-size: 20px;
  margin-bottom: 7px;
}
.call-tile {
  aspect-ratio: 1.35;
  min-width: 0;
  background: #343438;
  border: 1px solid #45454a;
  border-radius: 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.call-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0;
}
.call-tile.self video {
  transform: scaleX(-1);
}
.call-tile.camera-on video {
  opacity: 1;
}
.call-tile-avatar .avatar {
  width: 68px;
  height: 68px;
  font-size: 22px;
}
.call-tile.camera-on .call-tile-avatar {
  opacity: 0;
}
.call-tile-label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  font-size: 11px;
  text-shadow: 0 1px 4px #000;
}
.call-tile-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #20202490;
  border-radius: 5px;
  padding: 4px 6px;
}
.call-tile-label i {
  display: flex;
}
.call-tile-label svg {
  width: 17px;
  height: 17px;
}
.call-participants[data-count="1"] {
  max-width: 350px;
  margin: 15px auto;
}
.call-participants[data-count="1"] {
  grid-template-columns: 1fr;
}
.call-participants[data-count="5"],
.call-participants[data-count="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 0 6px;
}
.call-control {
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  background: #45454a;
  color: #fff;
  border-radius: 50%;
}
.call-control svg {
  width: 25px;
  height: 25px;
}
.call-control:hover {
  filter: brightness(1.15);
}
.call-control.off {
  background: #f5f5f7;
  color: #1d1d1f;
}
.call-control.end-call {
  background: #d63346;
}
.call-control.accept-call {
  background: #267f48;
}
.call-limit {
  font-size: 10px;
  color: #b3b3ba;
  text-align: center;
  margin: 15px 0 0;
}
.call-dock {
  position: fixed;
  z-index: 32;
  bottom: 22px;
  left: 94px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 7px 26px #0002;
  width: 300px;
  max-width: calc(100vw - 28px);
}
#call-dock-open {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 5px;
}
#call-dock-icon {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #237f4c;
  color: white;
  flex-shrink: 0;
}
#call-dock-open > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}
#call-dock-open strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#call-dock-open small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
#call-dock-open > svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
#call-dock-end {
  color: var(--danger);
}
.a0 {
  --avatar-bg: #dee5f0;
  --avatar-fg: #4b648a;
}
.a1 {
  --avatar-bg: #e9e0d7;
  --avatar-fg: #7f5e42;
}
.a2 {
  --avatar-bg: #dbe8df;
  --avatar-fg: #426d50;
}
.a3 {
  --avatar-bg: #e5dfef;
  --avatar-fg: #715791;
}
.a4 {
  --avatar-bg: #dfe1eb;
  --avatar-fg: #586381;
}
.a5 {
  --avatar-bg: #eedddd;
  --avatar-fg: #915259;
}
.a6 {
  --avatar-bg: #dbe7e9;
  --avatar-fg: #3f6e75;
}
.a7 {
  --avatar-bg: #eae3cf;
  --avatar-fg: #77652f;
}
:root[data-theme="dark"] .avatar {
  background: color-mix(in srgb, var(--avatar-bg) 25%, #29292d);
  color: color-mix(in srgb, var(--avatar-fg) 40%, white);
}
@keyframes pulse {
  50% {
    opacity: 0.5;
  }
}
@media (min-width: 1550px) {
  #app {
    grid-template-columns: 80px 352px minmax(0, 1fr);
  }
  .chat-row {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .chat-name {
    font-size: 14px;
  }
  .chat-preview {
    font-size: 13px;
  }
  .games-view {
    grid-template-columns: 80px minmax(0, 1fr);
  }
}
@media (max-width: 1100px) {
  #app {
    grid-template-columns: 68px 286px minmax(0, 1fr);
  }
  .rail {
    padding-inline: 5px;
  }
  .sidebar-heading {
    padding-inline: 15px;
  }
  .sidebar-heading h1 {
    font-size: 23px;
  }
  .search-field {
    margin-inline: 15px;
  }
  .chat-filters {
    padding-inline: 15px;
  }
  .search-field kbd {
    display: none;
  }
  .conversation-header {
    padding-inline: 17px;
    gap: 9px;
  }
  .header-actions {
    gap: 0;
  }
  .header-actions .icon-button {
    width: 33px;
  }
  .message-row {
    max-width: 96%;
  }
  #composer {
    padding-inline: 16px;
    gap: 5px;
  }
  .games-view {
    grid-template-columns: 68px minmax(0, 1fr);
  }
  #games-content {
    padding: 34px 30px;
  }
  .games-grid {
    gap: 23px 20px;
  }
  .game-feature-copy {
    padding: 27px;
  }
  .game-feature h2 {
    font-size: 32px;
  }
  .game-feature > img {
    height: 280px;
  }
}
@media (max-width: 760px) {
  :root {
    font-size: 16px;
  }
  #auth {
    padding: 0 20px;
  }
  .auth-header {
    height: 76px;
  }
  .auth-layout {
    padding: 20px 0 55px;
    align-items: flex-start;
  }
  .auth-card {
    padding: 28px 23px;
    width: 390px;
  }
  .auth-card h1 {
    font-size: 27px;
  }
  .auth-card input {
    font-size: 16px;
  }
  .auth-card label {
    font-size: 13px;
  }
  .auth-card > .app-mark {
    margin-bottom: 22px;
  }
  .auth-footer {
    font-size: 10px;
    padding: 20px 0;
  }
  #app {
    display: block;
    height: 100dvh;
    padding-bottom: calc(65px + env(safe-area-inset-bottom));
    position: relative;
  }
  .rail {
    display: none;
  }
  .sidebar {
    height: 100%;
    border: 0;
  }
  .sidebar-heading {
    height: 88px;
    padding: 20px 20px 10px;
    padding-top: max(20px, env(safe-area-inset-top));
  }
  .sidebar-heading h1 {
    font-size: 30px;
    letter-spacing: -1px;
  }
  .sidebar-heading .icon-button {
    width: 44px;
    height: 44px;
  }
  .mobile-settings {
    display: none;
  }
  .search-field {
    margin: 0 20px 16px;
    border-radius: 10px;
  }
  .search-field input {
    font-size: 16px;
    padding: 10px 0;
  }
  .search-field svg {
    width: 19px;
    height: 19px;
  }
  .chat-filters {
    padding: 0 20px 16px;
    gap: 6px;
  }
  .chat-filters button {
    font-size: 13px;
    padding: 7px 15px;
  }
  .chat-row {
    padding: 15px 12px;
    gap: 13px;
    border-radius: 10px;
  }
  .chat-name {
    font-size: 16px;
    font-weight: 600;
  }
  .chat-time {
    font-size: 11px;
  }
  .chat-preview {
    font-size: 14px;
  }
  .avatar {
    width: 48px;
    height: 48px;
    font-size: 16px;
  }
  .chat-top {
    margin-bottom: 5px;
  }
  .unread-badge {
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    line-height: 20px;
  }
  .sidebar-footer {
    padding: 18px 20px;
    font-size: 11px;
  }
  .mobile-tabs {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 65px;
    padding: 6px 12px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(20px);
    z-index: 6;
  }
  .mobile-tabs button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    min-width: 75px;
    min-height: 47px;
    color: var(--muted);
  }
  .mobile-tabs button svg {
    width: 26px;
    height: 26px;
  }
  .mobile-tabs button.selected {
    color: var(--accent);
    font-weight: 600;
  }
  .chat-main {
    display: none;
    height: calc(100% - 65px - env(safe-area-inset-bottom));
    position: absolute;
    inset: 0 0 auto;
  }
  .chat-open .chat-main {
    display: block;
  }
  .chat-open .sidebar {
    display: none;
  }
  .chat-open {
    padding-bottom: 0 !important;
  }
  .chat-open .mobile-tabs {
    display: none;
  }
  .chat-open .chat-main {
    height: 100%;
  }
  .chat-open.games-view .mobile-tabs {
    display: flex;
  }
  .chat-open.games-view {
    padding-bottom: calc(65px + env(safe-area-inset-bottom)) !important;
  }
  .conversation-header {
    min-height: 70px;
    gap: 8px;
    padding: 10px 9px;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .conversation-header .avatar {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }
  .back-button {
    display: flex;
    width: 26px;
    color: var(--accent);
  }
  .header-person strong {
    font-size: 14px;
  }
  .header-person > span {
    font-size: 11px;
  }
  .header-actions {
    gap: 0;
  }
  .header-actions .icon-button {
    width: 34px;
    height: 40px;
  }
  .header-actions .icon-button svg {
    width: 22px;
    height: 22px;
  }
  #search-messages {
    display: none;
  }
  .message-row {
    gap: 5px;
    max-width: 100%;
    margin-bottom: 13px;
  }
  .message-row > .avatar {
    width: 25px;
    height: 25px;
    font-size: 8px;
  }
  .bubble {
    font-size: 17px;
    padding: 10px 13px;
    line-height: 1.4;
  }
  .message-meta {
    font-size: 10px;
    padding-top: 5px;
  }
  .message-author {
    font-size: 11px;
  }
  .message-action {
    opacity: 0.8;
    width: 28px;
    height: 36px;
  }
  .message-action svg {
    width: 20px;
    height: 20px;
  }
  #message-scroll {
    padding: 12px 12px 6px;
  }
  .day-divider {
    font-size: 11px;
    margin: 13px 0 22px;
  }
  #composer {
    padding: 9px 9px max(13px, env(safe-area-inset-bottom));
    gap: 3px;
  }
  .composer-input textarea {
    font-size: 17px;
    padding: 10px 12px;
    line-height: 22px;
  }
  .composer-input .icon-button {
    width: 31px;
    height: 42px;
  }
  .composer-input .icon-button svg {
    width: 23px;
    height: 23px;
  }
  .attach-button {
    width: 29px;
    height: 44px;
  }
  #record-button {
    width: 31px;
    height: 44px;
  }
  .send-button {
    width: 39px;
    height: 39px;
    margin-bottom: 3px;
  }
  .send-button svg {
    width: 25px;
    height: 25px;
  }
  .message-row audio {
    width: 210px;
  }
  #reply-bar {
    margin: 0 53px 0 43px;
  }
  #message-search-bar {
    padding: 9px 13px;
  }
  .active-call-banner {
    padding: 10px 16px;
    font-size: 12px;
  }
  .welcome {
    display: none;
  }
  dialog {
    padding: 28px 23px;
    max-width: calc(100vw - 24px);
    border-radius: 20px;
  }
  dialog h2 {
    font-size: 24px;
  }
  dialog p {
    font-size: 14px;
  }
  .modal-close {
    height: 32px;
    width: 32px;
  }
  dialog input,
  dialog select {
    font-size: 16px;
  }
  .person-result {
    padding: 11px 5px;
    min-height: 66px;
  }
  .person-result strong {
    font-size: 15px;
  }
  .person-result small {
    font-size: 12px;
  }
  .menu-item {
    font-size: 14px;
    min-height: 43px;
  }
  .setting-row {
    gap: 10px;
    font-size: 14px;
  }
  .setting-row .segmented button {
    font-size: 11px;
    padding: 8px 7px;
  }
  .setting-row small {
    font-size: 11px;
  }
  .game-setting {
    font-size: 13px;
  }
  .game-setting select,
  .game-setting input:not([type="checkbox"]) {
    font-size: 14px;
  }
  .reaction {
    font-size: 13px;
    min-height: 29px;
  }
  .notification-prompt {
    bottom: calc(81px + env(safe-area-inset-bottom));
    right: 14px;
    width: 362px;
    padding: 18px;
  }
  .notification-prompt p {
    font-size: 13px;
  }
  .notification-prompt strong {
    font-size: 15px;
  }
  .notice-actions button {
    font-size: 13px;
    min-height: 34px;
  }
  body:has(#auth:not([hidden])) .notification-prompt {
    bottom: 20px;
  }
  #toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
    font-size: 13px;
  }
  .games-main {
    height: 100%;
    position: absolute;
    inset: 0 0 auto;
    height: calc(100% - 65px - env(safe-area-inset-bottom));
  }
  #app.games-view .chat-main {
    display: none !important;
  }
  #games-content {
    padding: 29px 20px 25px;
  }
  .games-heading {
    margin-bottom: 23px;
    gap: 12px;
  }
  .games-heading h1 {
    font-size: 29px;
    letter-spacing: -0.9px;
    max-width: 270px;
    margin-top: 8px;
  }
  .games-heading p {
    font-size: 13px;
    line-height: 1.6;
    max-width: 290px;
  }
  .playroom-badge {
    display: none;
  }
  .section-eyebrow {
    font-size: 10px;
  }
  .game-feature {
    grid-template-columns: 1fr;
    position: relative;
    min-height: 0;
    margin-bottom: 28px;
  }
  .game-feature-copy {
    padding: 20px 24px 24px;
    grid-row: 2;
  }
  .game-feature h2 {
    font-size: 29px;
    margin-top: 9px;
    margin-bottom: 9px;
  }
  .game-feature p {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
  }
  .game-feature > img {
    height: 175px;
    width: 100%;
    object-fit: cover;
    grid-row: 1;
    padding: 0;
  }
  .game-feature-copy {
    z-index: 1;
    background: none;
  }
  .game-feature .primary {
    min-height: 40px;
    padding: 9px 15px;
    font-size: 13px;
  }
  .game-feature-kicker {
    position: relative;
    z-index: 1;
  }
  .games-section-heading {
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 19px;
  }
  .games-section-heading h2 {
    font-size: 21px;
  }
  .games-filter {
    width: 100%;
  }
  .games-filter button {
    font-size: 12px;
    padding: 7px 11px;
  }
  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 23px 15px;
  }
  .game-art {
    aspect-ratio: 1.3;
    border-radius: 13px;
  }
  .game-card-copy {
    padding-top: 10px;
    gap: 5px;
    align-items: flex-start;
  }
  .game-card h3 {
    font-size: 13px;
    white-space: normal;
    line-height: 1.25;
    min-height: 17px;
    margin-bottom: 4px;
  }
  .game-card p {
    font-size: 10px;
    line-height: 1.4;
  }
  .game-get {
    padding: 5px 10px;
    font-size: 11px;
    flex-shrink: 0;
  }
  .games-note {
    font-size: 11px;
    line-height: 1.7;
    padding-top: 28px;
  }
  .game-player-header {
    min-height: 62px;
    padding: 9px 10px;
    gap: 8px;
  }
  .game-player-header .icon-button {
    width: 34px;
    height: 40px;
  }
  .game-player-header strong {
    font-size: 13px;
  }
  .game-player-header .secondary {
    font-size: 0;
    width: 35px;
    height: 35px;
    padding: 6px;
    gap: 0;
  }
  .game-player-header .secondary svg {
    width: 22px;
    height: 22px;
  }
  .game-detail-art {
    height: 145px;
  }
  .game-detail-heading h2 {
    font-size: 25px;
  }
  .game-detail-heading ~ .primary,
  .game-detail-heading ~ .secondary {
    min-height: 44px;
  }
  .game-invitation {
    width: 248px;
  }
  .invitation-cover {
    height: 112px;
  }
  .invitation-copy {
    padding: 13px;
  }
  .invitation-copy > strong {
    font-size: 19px;
  }
  .invitation-copy > button {
    min-height: 38px;
    font-size: 13px;
  }
  #call-dialog {
    padding: 18px;
    border-radius: 22px;
    max-height: 94dvh;
  }
  .call-person {
    padding: 36px 0 22px;
  }
  .call-person h2 {
    font-size: 25px;
  }
  .call-joined .call-person {
    padding-top: 17px;
  }
  .call-participants {
    gap: 7px;
  }
  .call-participants[data-count="5"],
  .call-participants[data-count="6"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .call-tile {
    aspect-ratio: 1.2;
    border-radius: 12px;
  }
  .call-tile-avatar .avatar {
    width: 52px;
    height: 52px;
    font-size: 17px;
  }
  .call-tile-label {
    left: 7px;
    right: 7px;
    bottom: 7px;
    font-size: 10px;
  }
  .call-controls {
    padding-top: 17px;
    gap: 15px;
  }
  .call-control {
    width: 51px;
    height: 51px;
  }
  .call-dock {
    left: 14px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: calc(100vw - 28px);
    max-width: 370px;
  }
  .chat-open:not(.games-view) ~ .call-dock {
    bottom: 90px;
  }
  .media-viewer {
    padding: 25px 12px;
  }
  .viewer-image {
    max-height: 72dvh;
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass: var(--panel);
  }
  dialog::backdrop,
  #popover,
  .notification-prompt,
  .mobile-tabs,
  .call-dock {
    backdrop-filter: none;
  }
}
@media (prefers-contrast: more) {
  :root {
    --muted: #45454a;
    --line: #8a8a92;
  }
  :root[data-theme="dark"] {
    --muted: #d0d0d6;
    --line: #777780;
  }
  .chat-row.active {
    outline: 1px solid var(--text);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 760px) {
  .message-meta,
  .game-card p,
  .game-card .game-get,
  .call-limit,
  .call-tile-label,
  .section-eyebrow,
  .mobile-tabs button {
    font-size: 11px;
  }
}
.nav-unread {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 9px;
  background: var(--action);
  color: white;
  font-size: 10px;
  padding: 0 4px;
  font-weight: 600;
}
.rail-item,
.mobile-tabs button {
  position: relative;
}
#game-player:fullscreen {
  width: 100vw;
  height: 100dvh;
  background: var(--bg);
}

.update-prompt {
  position: fixed;
  left: 50%;
  top: max(12px, env(safe-area-inset-top));
  transform: translateX(-50%);
  width: min(500px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 8px 30px #0002;
  z-index: 500;
}
.update-prompt > div {
  flex: 1;
  min-width: 0;
}
.update-prompt strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.update-prompt span {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.update-prompt .primary {
  flex-shrink: 0;
  min-height: 44px;
  padding: 9px 14px;
  font-size: 13px;
}

.game-load-error {
  max-width: 330px;
  padding: 24px;
  text-align: center;
}
.game-load-error > svg {
  width: 36px;
  height: 36px;
  color: var(--accent);
}
.game-load-error h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 15px 0 10px;
}
.game-load-error p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 20px;
}
.game-load-error .primary {
  display: block;
  min-height: 44px;
  width: 100%;
  margin-bottom: 12px;
}
.game-load-error a {
  display: inline-block;
  min-height: 34px;
  padding: 8px 0;
  font-size: 12px;
}
