:root {
  color-scheme: light;
  --pine: #193d32;
  --pine-deep: #123028;
  --paper: #fcfbf7;
  --sidebar: #f1f0e8;
  --line: #e5e6dc;
  --ink: #253e35;
  --muted: #758077;
  --lime: #d9efb1;
  --selected: #e0e8d7;
  --white: #fff;
  --danger: #ad433c;
  --peach: #efb395;
  --shadow: 0 16px 60px #193d3226;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
button,
a {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #92b16f;
  outline-offset: 3px;
}
button {
  transition:
    background 0.15s,
    transform 0.15s;
}
input,
textarea,
select {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
  outline: none;
}
input:focus,
textarea:focus {
  border-color: #7d9870;
  box-shadow: 0 0 0 3px #8baa7620;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 20px 0 8px;
}
textarea {
  resize: vertical;
}
p {
  line-height: 1.65;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted {
  color: var(--muted);
}
.error {
  color: var(--danger);
  font-size: 13px;
  white-space: pre-wrap;
}
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  color: var(--muted);
}
.icon-btn:hover {
  background: var(--selected);
  color: var(--ink);
}
.primary,
.secondary,
.danger,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
}
.primary {
  background: var(--pine);
  color: #f8fbef;
}
.primary:hover {
  background: #2a5343;
}
.secondary {
  background: var(--white);
  border: 1px solid var(--line);
}
.secondary:hover {
  background: var(--sidebar);
}
.danger {
  background: #fbe5df;
  color: #923a32;
}
.wide {
  width: 100%;
}
.text-btn {
  padding: 0;
  color: var(--pine);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  font-size: inherit;
}
.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}
.loading {
  height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  justify-items: center;
  color: var(--muted);
  gap: 20px;
}
.loading img {
  border-radius: 14px;
}
.auth-layout {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  min-height: 100dvh;
}
.auth-story {
  padding: 46px 60px 32px;
  background: var(--pine);
  color: #f5f4e9;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -2px;
  text-decoration: none;
  align-self: flex-start;
}
.wordmark img {
  border: 1px solid #ffffff26;
  border-radius: 12px;
}
.wordmark-dot {
  font-size: 10px;
  letter-spacing: 0;
  align-self: flex-start;
  margin-top: 7px;
}
.auth-story-main {
  margin: auto 0;
  padding-top: 60px;
}
.auth-story .eyebrow {
  color: #b4cb99;
}
.auth-story h1 {
  font:
    normal clamp(48px, 4.7vw, 76px) / 1.06 Georgia,
    serif;
  letter-spacing: -3px;
  margin: 22px 0 24px;
}
.auth-story p {
  max-width: 380px;
  color: #c6d3c4;
  font-size: 15px;
  line-height: 1.8;
}
.auth-promises {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #c5d6bf;
  padding-top: 25px;
}
.orbit-art {
  height: 260px;
  position: relative;
  max-width: 440px;
}
.orbit {
  position: absolute;
  border: 1px solid #cfe5aa2c;
  border-radius: 50%;
  width: 330px;
  height: 170px;
  top: 40px;
  left: 25px;
  transform: rotate(-22deg);
}
.orbit-two {
  transform: rotate(23deg);
  width: 290px;
  height: 230px;
  top: 10px;
  left: 45px;
}
.orbit-core {
  position: absolute;
  top: 67px;
  left: 143px;
  width: 96px;
  height: 96px;
  background: var(--lime);
  color: var(--pine);
  border-radius: 28px;
  display: grid;
  place-items: center;
  transform: rotate(-9deg);
  font: normal 70px Georgia;
}
.orbit-note {
  position: absolute;
  font-size: 12px;
  border-radius: 8px;
  padding: 13px 17px;
  box-shadow: 0 10px 30px #0002;
  letter-spacing: 0.2px;
}
.note-one {
  background: #f2eade;
  color: var(--pine);
  top: 53px;
  left: -10px;
  transform: rotate(-7deg);
}
.note-two {
  background: var(--peach);
  color: #463827;
  top: 163px;
  left: 233px;
  transform: rotate(5deg);
  white-space: nowrap;
}
.orbit-spark {
  position: absolute;
  right: 34px;
  top: 22px;
  color: var(--lime);
  font-size: 48px;
}
.auth-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 40px 70px;
  position: relative;
}
.auth-form-wrap {
  width: 100%;
  max-width: 376px;
}
.little-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.5px;
  font-weight: 650;
  margin-bottom: 26px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #91a96b;
}
.auth-entry h2 {
  font:
    normal 32px/1.2 Georgia,
    serif;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.auth-entry .muted {
  font-size: 13px;
  margin-bottom: 30px;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 46px;
}
.password-field button {
  position: absolute;
  right: 6px;
  top: 5px;
}
#authErr {
  min-height: 18px;
  margin: 12px 0;
}
.auth-switch {
  text-align: center;
  font-size: 12px;
  margin: 25px 0 35px;
  color: var(--muted);
}
.privacy-note {
  border-top: 1px solid var(--line);
  padding-top: 23px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}
.privacy-note .icon {
  margin-top: 3px;
  width: 18px;
}
.privacy-note p {
  margin: 0;
  line-height: 1.8;
}
.privacy-note .text-btn {
  font-weight: 500;
}
.auth-footer {
  position: absolute;
  bottom: 25px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  color: var(--muted);
  margin: 24px 0;
}
.divider:before,
.divider:after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 72px 250px minmax(0, 1fr);
  overflow: hidden;
}
.server-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--pine);
  color: #cee1bf;
  padding: 23px 10px 20px;
}
.rail-home {
  padding: 0;
  height: 42px;
}
.rail-home img {
  border-radius: 13px;
}
.rail-rule {
  width: 28px;
  height: 1px;
  background: #d9e8cf26;
  margin: 7px 0;
}
.space-rail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  scrollbar-width: none;
  width: 100%;
  align-items: center;
}
.space-tile,
.rail-add {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: #ffffff0c;
  color: #d3e1ca;
  font-weight: 650;
  font-size: 16px;
  position: relative;
}
.space-tile:hover,
.rail-add:hover {
  background: #ffffff24;
}
.space-tile.active {
  background: var(--lime);
  color: var(--pine);
  border-radius: 14px;
}
.space-tile.active:before {
  content: "";
  position: absolute;
  left: -14px;
  height: 23px;
  width: 3px;
  background: var(--lime);
  border-radius: 0 3px 3px 0;
}
.space-tile.unread:after {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--peach);
  border-radius: 50%;
  position: absolute;
  right: 1px;
  top: 1px;
}
.rail-add {
  border: 1px dashed #cfdfbf4d;
  background: transparent;
}
.rail-bottom {
  margin-top: auto;
  color: #bfd1b3;
}
.rail-bottom:hover {
  background: #ffffff12;
  color: #fff;
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.space-heading {
  height: 90px;
  display: flex;
  align-items: center;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
}
#wsBtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  width: 100%;
  text-align: left;
  padding: 0;
  gap: 10px;
}
#wsBtn > span {
  min-width: 0;
}
#wsBtn small {
  font-size: 8px;
  letter-spacing: 1.6px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
#wsBtn strong {
  font-size: 17px;
  letter-spacing: -0.5px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#wsBtn .icon {
  width: 15px;
  color: var(--muted);
}
.sidebar-tools {
  padding: 18px 12px 14px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  width: 100%;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  border-radius: 7px;
}
.sidebar-link:hover {
  background: var(--selected);
  color: var(--ink);
}
.sidebar-link .icon {
  width: 17px;
}
.sidebar-link kbd {
  font: 9px system-ui;
  margin-left: auto;
  border: 1px solid #d7dbce;
  border-radius: 4px;
  padding: 2px 4px;
  color: #89917f;
}
.sidebar-scroll {
  padding: 0 12px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.4px;
  padding-left: 10px;
}
.section-label .icon-btn {
  width: 28px;
  height: 28px;
}
.section-label .icon {
  width: 15px;
}
.dm-label {
  margin-top: 24px;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 5px;
}
.nav-item {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  min-height: 37px;
}
.nav-item:hover {
  background: #e4e7dccc;
}
.nav-item.active {
  background: var(--selected);
  color: var(--pine);
  font-weight: 650;
}
.nav-item .hash {
  font-size: 17px;
  width: 18px;
  color: #91a180;
  font-weight: 400;
}
.nav-item .nav-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8ca268;
  margin-left: auto;
}
.nav-item.unread {
  font-weight: 650;
  color: var(--ink);
}
.nav-item .avatar {
  width: 25px;
  height: 25px;
  min-width: 25px;
  font-size: 10px;
  border-radius: 8px;
}
.side-hint {
  font-size: 11px;
  line-height: 1.7;
  margin: 16px 10px;
  color: var(--muted);
}
.invite-card {
  margin: 22px 17px 12px;
  padding: 14px 12px;
  background: #e5e9d8;
  border: 1px solid #dae1cb;
  border-radius: 10px;
  display: flex;
  gap: 11px;
  align-items: center;
  text-align: left;
}
.invite-card strong {
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
}
.invite-card small {
  font-size: 10px;
  color: #6e8060;
}
.invite-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: #d3dfbd;
  border-radius: 50%;
  color: #5c7548;
}
.quiet-control {
  margin: 0 15px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  color: var(--muted);
  padding: 6px 0;
}
.quiet-control .icon {
  width: 15px;
}
.toggle {
  margin-left: auto;
  width: 25px;
  height: 14px;
  border-radius: 20px;
  background: #d4d9ca;
  position: relative;
}
.toggle:after {
  content: "";
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  left: 2px;
  top: 2px;
  transition: transform 0.15s;
}
.quiet-control[aria-pressed="true"] .toggle {
  background: #6c8b57;
}
.quiet-control[aria-pressed="true"] .toggle:after {
  transform: translateX(11px);
}
.me-card {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  text-align: left;
  min-height: 77px;
}
.me-card > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.me-card strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.me-card small {
  font-size: 9px;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.me-card .icon {
  width: 16px;
  color: var(--muted);
}
.avatar {
  width: 35px;
  height: 35px;
  min-width: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eadbc8;
  border-radius: 11px;
  color: #686044;
  font-size: 13px;
  font-weight: 600;
}
.avatar.color-1 {
  background: #dce5d0;
  color: #567049;
}
.avatar.color-2 {
  background: #edcfbc;
  color: #8a6146;
}
.avatar.color-3 {
  background: #d6e1df;
  color: #537274;
}
.avatar.color-4 {
  background: #e6dcdf;
  color: #836974;
}
.main-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}
.topbar {
  height: 90px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  z-index: 1;
}
.header-symbol {
  font-size: 28px;
  color: #9eae84;
  font-weight: 300;
}
.channel-heading {
  min-width: 0;
  flex: 1;
}
.channel-heading h1 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.2px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.channel-title h1 { min-width: 0; }
.environment-badge { flex-shrink: 0; padding: 3px 6px; border-radius: 5px; background: #daeeb3; color: #193e33; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.channel-heading p {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-actions {
  display: flex;
  gap: 3px;
}
.top-actions .icon {
  width: 18px;
}
.connection {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}
.connection.live:before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8caa63;
  margin-right: 5px;
}
.connection.offline {
  color: #b27538;
}
.conversation-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.conversation-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
}
.history {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px 28px 20px;
  scrollbar-width: thin;
  scrollbar-color: #d7ddce transparent;
}
.conversation-intro {
  padding: 16px 0 23px;
  margin-bottom: 8px;
}
.intro-icon {
  width: 57px;
  height: 57px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background: #edf0e1;
  color: #8ca16c;
  font-size: 35px;
  margin-bottom: 18px;
}
.conversation-intro h2 {
  font:
    normal 27px Georgia,
    serif;
  margin: 0 0 10px;
  letter-spacing: -0.5px;
}
.conversation-intro p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  max-width: 520px;
}
.conversation-intro .text-btn {
  margin-top: 14px;
  font-size: 11px;
}
.date-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 9px;
  color: #929b8b;
  margin: 20px 0 25px;
  letter-spacing: 0.3px;
}
.date-separator:before,
.date-separator:after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.message {
  display: flex;
  gap: 12px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  position: relative;
  scroll-margin: 40px;
}
.message:hover {
  background: #edf0e459;
}
.message.highlight {
  background: #edf1d4;
}
.message-content {
  min-width: 0;
  flex: 1;
}
.message-header {
  display: flex;
  gap: 9px;
  align-items: baseline;
  margin: 0 0 5px;
}
.message-author {
  font-size: 12px;
  font-weight: 650;
  padding: 0;
  text-align: left;
}
.message-author:hover {
  text-decoration: underline;
}
.message-time {
  font-size: 9px;
  color: #9ca391;
}
.message-edited {
  font-size: 9px;
  color: var(--muted);
}
.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
  color: var(--ink);
}
.message-body a {
  color: #587742;
}
.message-tools {
  display: flex;
  gap: 2px;
  position: absolute;
  right: 8px;
  top: -15px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  box-shadow: 0 2px 6px #142d3210;
  opacity: 0;
  pointer-events: none;
}
.message:hover .message-tools,
.message:focus-within .message-tools {
  opacity: 1;
  pointer-events: auto;
}
.message-tools .icon-btn {
  width: 28px;
  height: 28px;
}
.message-tools .icon {
  width: 14px;
}
.reply-preview {
  font-size: 10px;
  color: var(--muted);
  border-left: 2px solid #bbcca5;
  padding: 4px 9px;
  margin-bottom: 8px;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: left;
}
.reactions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.reaction {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sidebar);
  padding: 3px 7px;
  font-size: 11px;
}
.reaction.mine {
  background: #e4edce;
  border-color: #aabe8d;
}
.attachment {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 310px;
  padding: 10px 12px;
  margin: 8px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  background: var(--white);
}
.attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 4px;
}
.load-older {
  display: block;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 10px;
  padding: 7px 15px;
}
.empty-state {
  padding: 45px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.compose-area {
  padding: 10px 28px 15px;
  flex-shrink: 0;
  background: var(--paper);
}
.composer {
  border: 1px solid #dce2d2;
  border-radius: 12px;
  background: var(--white);
  padding: 3px 8px;
  box-shadow: 0 2px 5px #193d3203;
}
.composer:focus-within {
  border-color: #9fb586;
  box-shadow: 0 0 0 2px #b4c39818;
}
#msgInput {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 15px 11px 7px;
  font-size: 13px;
  line-height: 1.5;
  min-height: 46px;
  max-height: 170px;
  resize: none;
  display: block;
}
.composer-bottom {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 3px 7px;
}
.composer-bottom .icon {
  width: 17px;
}
#composerRecipient {
  font-size: 9px;
  color: #98a08f;
  margin-left: 8px;
}
.send-btn {
  margin-left: auto;
  width: 34px;
  height: 31px;
  border-radius: 7px;
  background: var(--lime);
  color: var(--pine);
  display: grid;
  place-items: center;
}
.send-btn:hover {
  background: #c8e39a;
}
.composer-caption {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: #9ca493;
  padding: 9px 3px 0;
  gap: 12px;
}
.reply-banner {
  padding: 8px 12px;
  font-size: 11px;
  background: var(--selected);
  border-radius: 9px 9px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.reply-banner span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pending {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.file-chip {
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--sidebar);
  margin: 7px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-chip button {
  font-size: 15px;
}
.new-messages {
  position: absolute;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: var(--pine);
  color: #fff;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 11px;
  box-shadow: var(--shadow);
}
.failed-send {
  background: #fff1e9;
  border: 1px solid #f0d4c4;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  margin-top: 10px;
}
.failed-send button {
  font-weight: 600;
  text-decoration: underline;
  margin: 5px;
}
.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  overflow: auto;
  min-height: 0;
}
.welcome-art {
  width: 140px;
  height: 130px;
  position: relative;
  margin-bottom: 25px;
}
.welcome-art > span {
  position: absolute;
  inset: 15px 20px 10px;
  background: var(--selected);
  font:
    75px Georgia,
    serif;
  border-radius: 31px;
  transform: rotate(-8deg);
  display: grid;
  place-items: center;
  color: var(--pine);
}
.welcome-art i {
  font-style: normal;
  position: absolute;
  right: -2px;
  top: -4px;
  font-size: 43px;
  color: #d6ae70;
}
.welcome .eyebrow {
  color: #8f9e7d;
  font-size: 9px;
}
.welcome h2 {
  font:
    normal clamp(30px, 3vw, 43px) / 1.12 Georgia,
    serif;
  letter-spacing: -1.3px;
  margin: 19px 0;
}
.welcome p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.welcome-actions {
  display: flex;
  gap: 10px;
  margin: 15px 0 35px;
}
.welcome-actions button {
  font-size: 12px;
}
.welcome-note {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  color: #91a07f;
}
.welcome-note .icon {
  width: 14px;
}
.roster {
  width: 224px;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  padding: 21px 15px;
  overflow: auto;
}
.roster-note {
  font-size: 10px;
  color: var(--muted);
  padding: 0 10px;
  margin: 7px 0 22px;
  line-height: 1.7;
}
.member {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  width: 100%;
  text-align: left;
  border-radius: 8px;
}
.member:hover {
  background: var(--sidebar);
}
.member strong {
  font-size: 11px;
  display: block;
}
.member small {
  font-size: 9px;
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.search-panel {
  padding: 20px 28px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.search-panel input {
  flex: 1;
  min-width: 100px;
}
.search-panel p {
  width: 100%;
  margin: 0;
  font-size: 10px;
  color: var(--muted);
}
.search-result {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: left;
  width: 100%;
  background: var(--white);
}
.search-result:hover {
  border-color: #b0c294;
}
.search-result small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 9px;
}
.search-result p {
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0;
}
.incoming {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 28px;
  background: var(--selected);
  font-size: 12px;
}
.incoming .primary {
  min-height: 32px;
  padding: 7px 14px;
  margin-left: auto;
  font-size: 11px;
}
.incoming .text-btn {
  font-size: 11px;
}
.call-bar {
  background: var(--pine);
  color: #eff5e8;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.call-info {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.call-info > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.call-info strong {
  font-size: 12px;
  display: block;
}
.call-info small {
  font-size: 10px;
  color: #bed0ad;
  display: block;
  margin-top: 5px;
}
.call-pulse {
  width: 36px;
  height: 36px;
  background: #ffffff12;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.call-bar button {
  font-size: 11px;
  padding: 9px 12px;
  min-height: 34px;
}
.remote-tiles { display: none; }
.modal {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 25px;
  width: min(470px, calc(100vw - 32px));
  max-height: 85dvh;
  overflow: auto;
}
.modal::backdrop {
  background: #102b2580;
  backdrop-filter: blur(5px);
}
.modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  gap: 15px;
}
.modal h2 {
  font:
    normal 25px Georgia,
    serif;
  margin: 0;
  letter-spacing: -0.4px;
}
.modal h3 {
  font-size: 13px;
  margin: 22px 0 9px;
}
.modal p {
  font-size: 12px;
  color: var(--muted);
}
.modal .row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.modal .row > * {
  flex: 1;
}
.modal .stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.modal .stack > button {
  text-align: left;
  justify-content: flex-start;
}
.modal input,
.modal textarea,
.modal select {
  font-size: 12px;
}
.modal .error {
  margin: 12px 0 0;
}
.privacy-facts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 22px 0;
}
.privacy-fact {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
}
.privacy-fact > .icon {
  color: #849b6a;
}
.privacy-fact strong {
  font-size: 12px;
  display: block;
  margin-bottom: 4px;
}
.privacy-fact p {
  margin: 0;
  font-size: 11px;
}
.notice {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sidebar);
  font-size: 11px !important;
  line-height: 1.7;
}
.settings-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  font-size: 12px;
}
.settings-row label {
  margin: 0;
}
.settings-row select {
  width: 130px;
}
.token-value {
  font-size: 10px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  user-select: all;
  padding: 12px;
  background: var(--sidebar);
  border-radius: 8px;
}
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
}
.emoji-picker button {
  font-size: 25px;
  padding: 10px;
  border-radius: 8px;
}
.emoji-picker button:hover {
  background: var(--selected);
}
.toasts {
  position: fixed;
  right: 25px;
  bottom: 25px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  max-width: min(370px, calc(100vw - 40px));
}
.toast {
  background: var(--pine);
  color: #f4f6e9;
  border: 1px solid #ffffff20;
  box-shadow: var(--shadow);
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
}
.mobile-only {
  display: none;
}
.nav-backdrop {
  display: none;
}
[data-theme="dark"] {
  color-scheme: dark;
  --paper: #172c25;
  --sidebar: #1c332a;
  --line: #30463b;
  --ink: #e1e9d7;
  --muted: #a0ac98;
  --selected: #304734;
  --white: #1f362c;
  --danger: #f1a295;
  --shadow: 0 16px 60px #0004;
}
[data-theme="dark"] .primary {
  background: var(--lime);
  color: #193d32;
}
[data-theme="dark"] .nav-item.active {
  color: var(--lime);
}
[data-theme="dark"] .nav-item:hover {
  background: #314638;
}
[data-theme="dark"] .text-btn {
  color: #c5dda8;
}
[data-theme="dark"] .invite-card {
  background: #2b4130;
  border-color: #3b5237;
}
[data-theme="dark"] .invite-card small {
  color: #b4c89e;
}
[data-theme="dark"] .invite-icon {
  background: #3b5731;
  color: #caddb1;
}
[data-theme="dark"] .intro-icon {
  background: #2a4231;
}
[data-theme="dark"] .message:hover {
  background: #263c2b;
}
[data-theme="dark"] .message.highlight {
  background: #3a5030;
}
[data-theme="dark"] .reaction.mine {
  background: #36512a;
  color: #e0efbd;
}
[data-theme="dark"] .failed-send {
  background: #4a3029;
  border-color: #614438;
}
[data-theme="dark"] .welcome-art > span {
  color: #d9efb1;
}
@media (min-width: 1500px) {
  .shell {
    grid-template-columns: 80px 270px minmax(0, 1fr);
  }
  .history {
    padding-left: 40px;
    padding-right: 40px;
  }
  .compose-area {
    padding-left: 40px;
    padding-right: 40px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 64px 222px minmax(0, 1fr);
  }
  .server-rail {
    padding-left: 8px;
    padding-right: 8px;
  }
  .topbar {
    padding: 18px 20px;
    gap: 10px;
  }
  .connection.live {
    font-size: 0;
  }
  .connection.live:before {
    width: 6px;
    height: 6px;
  }
  .roster {
    width: 195px;
    padding: 15px 9px;
  }
  .auth-story {
    padding: 35px 35px 25px;
  }
  .auth-story h1 {
    font-size: 57px;
  }
  .orbit-art {
    transform: scale(0.88);
    transform-origin: left center;
  }
  .auth-promises {
    gap: 13px;
    font-size: 10px;
  }
}
@media (max-width: 900px) {
  .roster {
    position: absolute;
    right: 0;
    top: 90px;
    bottom: 0;
    background: var(--paper);
    box-shadow: -8px 0 25px #193d3210;
    z-index: 4;
    width: 230px;
  }
  .auth-layout {
    grid-template-columns: 0.9fr 1fr;
  }
  .auth-entry {
    padding: 45px 30px;
  }
  .auth-story {
    padding: 30px;
  }
  .auth-story h1 {
    font-size: 49px;
  }
  .auth-story p {
    font-size: 13px;
  }
  .orbit-art {
    transform: scale(0.7);
    width: 400px;
    height: 220px;
  }
  .auth-promises {
    font-size: 9px;
  }
  .sidebar-link kbd {
    display: none;
  }
  .top-actions {
    gap: 0;
  }
  .top-actions .icon-btn {
    width: 30px;
  }
  .topbar {
    padding: 16px;
  }
}
@media (max-width: 760px) {
  .mobile-only {
    display: inline-flex;
  }
  .shell {
    display: block;
  }
  .main-pane {
    height: 100dvh;
  }
  .server-rail,
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 21;
    transform: translateX(-340px);
    transition: transform 0.2s;
  }
  .server-rail {
    left: 0;
    width: 64px;
  }
  .sidebar {
    left: 64px;
    width: 250px;
  }
  .nav-open .server-rail,
  .nav-open .sidebar {
    transform: translateX(0);
  }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: #102b2570;
    z-index: 20;
    backdrop-filter: blur(3px);
  }
  .space-heading {
    height: 78px;
    padding: 17px;
  }
  .topbar {
    height: 78px;
    padding: 12px 12px 12px 8px;
    gap: 8px;
  }
  .header-symbol {
    display: none;
  }
  .channel-heading h1 {
    font-size: 14px;
  }
  .channel-heading p {
    font-size: 9px;
    max-width: 160px;
  }
  .top-actions .icon-btn {
    width: 29px;
  }
  .top-actions .icon {
    width: 17px;
  }
  #channelMenu {
    display: none;
  }
  .connection {
    display: none;
  }
  .history {
    padding: 15px 18px;
  }
  .compose-area {
    padding: 8px 12px 10px;
  }
  .composer-caption {
    font-size: 7px;
  }
  .composer-caption > span:last-child {
    display: none;
  }
  #composerRecipient {
    font-size: 8px;
  }
  .message {
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .message .avatar {
    width: 31px;
    height: 31px;
    min-width: 31px;
    border-radius: 10px;
    font-size: 11px;
  }
  .message-body {
    font-size: 13px;
  }
  .message-tools {
    opacity: 1;
    pointer-events: auto;
    position: static;
    display: flex;
    border: 0;
    box-shadow: none;
    background: none;
    justify-content: flex-start;
    margin: 6px 0 0;
    gap: 4px;
  }
  .message-tools .icon-btn {
    width: 28px;
    height: 26px;
    background: var(--sidebar);
  }
  .message-tools .icon {
    width: 13px;
  }
  .message-time {
    font-size: 8px;
  }
  .roster {
    top: 78px;
    width: 250px;
  }
  .conversation-intro {
    padding-top: 20px;
  }
  .conversation-intro h2 {
    font-size: 25px;
  }
  .welcome {
    justify-content: center;
    padding: 25px 18px;
  }
  .welcome-art {
    transform: scale(0.85);
    margin-bottom: 10px;
  }
  .welcome h2 {
    font-size: 34px;
  }
  .welcome p {
    font-size: 11px;
  }
  .welcome-actions {
    gap: 8px;
    margin-bottom: 25px;
  }
  .welcome-actions button {
    font-size: 11px;
    padding: 11px 14px;
  }
  .welcome-note {
    font-size: 8px;
  }
  .incoming {
    padding: 10px 12px;
    gap: 8px;
    font-size: 10px;
  }
  .call-bar {
    padding: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .call-info { flex-basis: 100%; }
  .call-bar .danger { margin-left: auto; }
  .call-bar button {
    font-size: 10px;
    padding: 8px 10px;
  }
  .search-panel {
    padding: 15px;
  }
  .search-panel p {
    font-size: 9px;
  }
  .auth-layout {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }
  .auth-story {
    min-height: 0;
    padding: 22px 26px 25px;
    display: block;
  }
  .wordmark {
    font-size: 27px;
    gap: 8px;
  }
  .wordmark img {
    width: 34px;
    height: 34px;
  }
  .auth-story-main {
    padding-top: 28px;
  }
  .auth-story h1 {
    font-size: 43px;
    letter-spacing: -1.7px;
    margin: 15px 0 10px;
  }
  .auth-story h1 br {
    display: none;
  }
  .auth-story p {
    font-size: 12px;
    margin: 0;
    max-width: 340px;
  }
  .auth-story .eyebrow {
    font-size: 8px;
  }
  .orbit-art,
  .auth-promises {
    display: none;
  }
  .auth-entry {
    padding: 35px 26px 65px;
    flex: 1;
    align-items: flex-start;
  }
  .auth-form-wrap {
    max-width: 420px;
  }
  .little-label {
    font-size: 8px;
    margin-bottom: 18px;
  }
  .auth-entry h2 {
    font-size: 29px;
  }
  .auth-entry .muted {
    margin-bottom: 24px;
  }
  .auth-switch {
    margin: 24px 0;
  }
  .privacy-note {
    padding-top: 18px;
  }
  .auth-footer {
    bottom: 21px;
  }
  .modal {
    padding: 21px;
  }
  .modal h2 {
    font-size: 23px;
  }
  .toasts {
    right: 16px;
    bottom: 16px;
  }
  .conversation-layout {
    min-height: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.sr-only {
  position: fixed;
  top: 0;
  left: 0;
}
.shell {
  position: fixed;
  inset: 0;
}
@media (max-width: 760px) {
  .message-tools {
    position: absolute;
    right: -6px;
    top: -3px;
    margin: 0;
  }
  .message-tools .icon-btn {
    display: none;
  }
  .message-tools .icon-btn:last-child {
    display: inline-flex;
    width: 44px;
    height: 44px;
    background: transparent;
  }
  .message-tools .icon-btn:last-child .icon {
    width: 18px;
  }
  .message-header {
    padding-right: 30px;
  }
}

/* Profiles and shared dialogs: keep labels, focus rings and controls separate. */
.modal .form-field { display: flex; flex-direction: column; gap: 9px; margin: 20px 0 8px; }
.modal > header { align-items: flex-start; }
.modal h2 { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.modal > header > button { flex: 0 0 36px; }
.modal input, .modal textarea, .modal select { font-size: 16px; }
.modal textarea { resize: vertical; min-height: 90px; }
.modal .field-help { margin: 6px 0 12px; line-height: 1.5; }
.modal .error { color: var(--danger, #a44432); }
.avatar { overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-summary, .profile-photo { display: flex; align-items: center; gap: 18px; margin: 18px 0; }
.profile-summary > div { min-width: 0; overflow-wrap: anywhere; }
.profile-summary .avatar { width: 56px; height: 56px; font-size: 20px; border-radius: 18px; }
.profile-summary p { margin: 5px 0 0; }
.profile-preview, .profile-preview .avatar, .profile-preview > img { width: 96px; height: 96px; min-width: 96px; border-radius: 28px; object-fit: cover; font-size: 28px; }
.profile-bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-photo .stack { align-items: flex-start; }
.profile-photo button[hidden] { display: none; }
.profile-status:empty, .modal .error:empty { display: none; }
.call-bar button { min-height: 44px; font-size: 13px; }
.call-bar .secondary { background: #f2f5ea; color: #173d32; border-color: #f2f5ea; }
.call-bar .secondary[aria-pressed="true"] { background: #d8eba9; color: #173d32; border-color: #d8eba9; }
@media (max-width: 600px) {
  .modal { padding: 20px; max-height: calc(100dvh - 24px); }
  .modal h2 { font-size: 24px; }
  .modal button { min-height: 44px; }
  .call-bar { flex-wrap: wrap; gap: 8px; }
  .call-info { flex-basis: 100%; }
}

@media (max-width: 760px) {
  .topbar { height: 112px; padding: 6px 12px 6px 8px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 8px; }
  #mobileMenu { width: 44px; height: 44px; }
  .channel-heading p { max-width: none; }
  .top-actions { grid-column: 1 / -1; justify-content: flex-end; gap: 4px; }
  .top-actions .icon-btn { width: 44px; height: 44px; }
  #channelMenu { display: inline-flex; }
  .roster { top: 112px; }
  .composer textarea, #searchInput { font-size: 16px; }
}

.profile-avatar { width: 72px; height: 72px; border-radius: 22px; font-size: 24px; margin: 8px 0; }

.modal { overflow-wrap: anywhere; }
.settings-row > span { min-width: 0; overflow-wrap: anywhere; }
.settings-row > button { flex-shrink: 0; }
