@font-face {
  font-family: Inter;
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
html,
body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
body {
  font-size: 14px;
}
button,
input {
  touch-action: manipulation;
}
button {
  white-space: normal;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
input {
  max-width: 100%;
}
ul {
  list-style: none;
  padding: 0;
}
dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-hover);
  border-radius: 18px;
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 24px;
  box-shadow: var(--elevation-dialog);
}
dialog::backdrop {
  background: #000a;
}
dialog form {
  display: grid;
  gap: 14px;
}
dialog input {
  width: 100%;
}
dialog h2 {
  margin-top: 0;
}
dialog pre,
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.mono {
  font-family: var(--mono);
  overflow-wrap: anywhere;
}
.screen {
  overflow: auto;
}
#boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
#auth,
#pending {
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--void);
}
.card {
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid var(--line-hover);
  border-radius: 18px;
  background: var(--panel);
  display: grid;
  gap: 14px;
}
.card h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0;
}
.card p {
  margin: 0;
}
.card .auth-logo {
  border-radius: 18px;
}
.card input {
  width: 100%;
}
.card details {
  color: var(--muted);
  font-size: 13px;
}
.card details p {
  margin-top: 12px;
}
#username-help {
  font-size: 12px;
}
#auth-status:empty {
  display: none;
}
#app {
  height: 100dvh;
}
.server-rail {
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}
.rail-home img {
  border-radius: 50%;
}
.rail-home,
#server-avatars button {
  border-radius: 50%;
}
.rail-footer {
  font-size: 11px;
}
.sidebar .account-menu {
  display: block;
}
#me {
  font-size: 14px;
}
.section-heading {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-heading h2 {
  font-size: 14px;
  margin: 0;
}
.section-heading button {
  padding: 6px;
  font-size: 12px;
}
#public-note {
  margin: 0 12px 12px;
}
#dm-empty {
  padding: 8px;
  font-size: 12px;
}
#channels,
#convos {
  padding: 0 8px;
}
main {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
#chat-head {
  min-height: 68px;
}
#chat-mode {
  font-size: 12px;
  color: var(--accent);
}
#log {
  padding: 16px 0;
}
#connection {
  padding: 8px 16px;
  background: var(--error-soft);
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
#connection button {
  flex: none;
}
#chat-empty {
  position: absolute;
  inset: 110px 24px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
#chat-empty button {
  pointer-events: auto;
}
#chat-empty h1 {
  font-size: 26px;
}
#composer {
  position: relative;
  margin: 12px 16px max(16px, env(safe-area-inset-bottom));
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--raised);
  padding: 8px;
  border-radius: 12px;
}
#draft {
  flex: 1;
  min-width: 0;
  width: 0;
  background: transparent;
  border-color: transparent;
  padding: 8px;
}
#btn-send {
  display: none;
}
#btn-emoji {
  font-size: 24px;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}
#mention-list {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line-hover);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--elevation);
  z-index: 5;
}
#mention-list button {
  display: block;
  width: 100%;
  text-align: left;
}
#mention-list button[aria-selected="true"] {
  background: var(--selected);
}
#mention-list p {
  margin: 8px;
  color: var(--muted);
}
#emoji-picker {
  bottom: calc(100% + 8px);
  right: 0;
  left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 300px;
}
#emoji-picker button {
  font-size: 22px;
  padding: 6px;
}
.bubble .body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}
.bubble .mention {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0 2px;
}
.bubble .name {
  color: var(--text);
}
.bubble .who time {
  font-size: 12px;
}
#people-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
#people-status {
  font-size: 12px;
  line-height: 1.5;
}
#people-close {
  display: none;
}
#people-card {
  padding: 16px;
}
#people-banner {
  height: 70px;
  border-radius: 12px;
  margin: 12px 0;
}
#people-avatar {
  width: 56px;
  height: 56px;
}
.settings-card h3 {
  margin-top: 0;
}
#devices li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
#people-guild {
  font-size: 16px;
}
#people-list-view {
  padding: 12px;
}
#btn-people {
  display: none;
}
#btn-sidebar-toggle {
  font-size: 12px;
}
.message-pending {
  color: var(--muted);
  font-size: 12px;
}
@media (width<1180px) {
  #btn-people {
    display: block;
  }
  #people-panel.open {
    display: block;
    position: fixed;
    inset: 0 0 0 auto;
    width: min(340px, 100%);
    z-index: 10;
    box-shadow: var(--elevation-dialog);
    background: var(--panel);
    overflow: auto;
  }
  #people-panel.open #people-close {
    display: block;
  }
}
@media (width<860px) {
  .sidebar {
    grid-row: 1;
  }
  .sidebar > header {
    min-height: 58px;
  }
  #app {
    grid-template-columns: 60px minmax(0, 1fr);
  }
  .server-rail {
    gap: 8px;
  }
  .rail-home,
  .rail-home img,
  #server-avatars button {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }
  .account-avatar {
    width: 28px;
    height: 28px;
  }
  .sidebar-scroll {
    max-height: 42dvh;
  }
  .sidebar:not(:has(#btn-sidebar-toggle[aria-expanded="true"]))
    > .sidebar-scroll {
    display: none;
  }
  main {
    grid-row: 2;
    min-height: 0;
  }
  #chat-head {
    min-height: 62px;
    padding: 8px 12px;
    gap: 4px;
  }
  #chat-title {
    font-size: 14px;
  }
  #chat-mode {
    font-size: 11px;
  }
  #chat-head button {
    font-size: 12px;
    padding: 6px;
  }
  #composer {
    margin: 8px 8px max(8px, env(safe-area-inset-bottom));
    gap: 2px;
    padding: 4px;
  }
  #btn-send {
    display: block;
    min-height: 36px;
    padding: 6px 9px;
    font-size: 12px;
  }
  #draft {
    padding: 8px 6px;
    font-size: 16px;
  }
  #btn-emoji {
    width: 28px;
    min-width: 28px;
  }
  .bubble {
    padding-left: 48px;
    padding-right: 10px;
  }
  .bubble > .avatar {
    left: 10px;
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .bubble .body {
    font-size: 15px;
  }
  .bubble .who {
    gap: 6px;
  }
  #chat-empty {
    inset: 90px 16px 90px;
  }
  #chat-empty h1 {
    font-size: 22px;
  }
  #auth,
  #pending {
    padding: 12px;
  }
  .card {
    padding: 20px;
  }
  dialog {
    padding: 18px;
  }
}
#chat-head {
  grid-row: 1;
}
#connection {
  grid-row: 2;
}
#log {
  grid-row: 3;
}
#composer {
  grid-row: 4;
  align-self: end;
  height: auto;
  min-height: 52px;
  max-height: 80px;
}
#server-avatars button {
  border-radius: 50%;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
