* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--orion-ground);
  color: var(--orion-ink);
  font: 15px var(--orion-font-ui);
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--orion-accent);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
button {
  color: inherit;
}
svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  vertical-align: middle;
}
button svg {
  pointer-events: none;
}
input,
textarea {
  color: var(--orion-ink);
  background: var(--orion-surface);
  border: 1px solid var(--orion-line);
  border-radius: 10px;
  padding: 13px 14px;
  min-width: 0;
}
input::placeholder,
textarea::placeholder {
  color: var(--orion-muted);
}
[hidden] {
  display: none !important;
}
.shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: 76px 356px minmax(0, 1fr);
  max-width: 1800px;
  margin: auto;
}
.rail {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 23px 12px 19px;
  gap: 16px;
  background: var(--orion-surface);
  border-right: 1px solid var(--orion-line);
}
.rail-brand {
  margin-bottom: 27px;
}
.rail-brand svg {
  width: 46px;
  height: 46px;
}
.rail-action,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  color: var(--orion-muted);
  flex-shrink: 0;
}
.rail-action:hover,
.icon-button:hover {
  background: var(--orion-raised);
  color: var(--orion-ink);
}
.rail-action.selected {
  background: var(--orion-raised);
  color: var(--orion-accent);
}
.rail-spacer {
  flex: 1;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--orion-raised);
  color: var(--orion-accent);
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid var(--orion-line);
}
.avatar.own {
  width: 39px;
  height: 39px;
  font-size: 13px;
}
.sidebar {
  border-right: 1px solid var(--orion-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-head {
  padding: 32px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.1px;
  font-weight: 600;
  color: var(--orion-muted);
}
h1 {
  font-size: 27px;
  letter-spacing: -0.8px;
  font-weight: 600;
  margin: 9px 0 0;
}
.count {
  font-size: 12px;
  letter-spacing: 0;
  background: var(--orion-raised);
  padding: 4px 7px;
  border-radius: 7px;
  vertical-align: middle;
  margin-left: 10px;
  color: var(--orion-muted);
}
.search {
  display: flex;
  align-items: center;
  background: var(--orion-surface);
  border: 1px solid var(--orion-line);
  border-radius: 12px;
  margin: 0 20px;
  padding: 0 12px;
  color: var(--orion-muted);
}
.search svg {
  width: 17px;
}
.search input {
  border: 0;
  background: none;
  font-size: 12px;
  padding: 14px 9px;
  width: 100%;
  outline-offset: -2px;
}
.search kbd {
  font: 10px var(--orion-font-ui);
  white-space: nowrap;
  border: 1px solid var(--orion-line);
  border-radius: 4px;
  padding: 3px;
}
.filters {
  display: flex;
  gap: 8px;
  padding: 18px 20px 20px;
}
.chip {
  border: 1px solid var(--orion-line);
  background: transparent;
  border-radius: 18px;
  padding: 7px 12px;
  color: var(--orion-muted);
  font-size: 12px;
}
.chip.active {
  color: var(--orion-accent);
  background: var(--orion-raised);
  border-color: var(--orion-raised);
}
.chat-list {
  flex: 1;
  overflow: auto;
  padding: 0 10px;
}
.chat-row {
  width: 100%;
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 14px;
  padding: 15px 12px;
  min-height: 83px;
}
.chat-row:hover {
  background: var(--orion-surface);
}
.chat-row.active {
  background: var(--orion-raised);
}
.chat-summary {
  flex: 1;
  min-width: 0;
}
.chat-top,
.chat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-time {
  font-size: 10px;
  color: var(--orion-muted);
  white-space: nowrap;
}
.chat-preview {
  font-size: 12px;
  color: var(--orion-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 7px;
}
.unread {
  background: var(--orion-accent);
  color: var(--orion-on-accent);
  font-size: 10px;
  border-radius: 10px;
  padding: 3px 6px;
  min-width: 17px;
  text-align: center;
}
.pin {
  color: var(--orion-muted);
  font-size: 11px;
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 23px;
  font-size: 11px;
  color: var(--orion-muted);
  border-top: 1px solid var(--orion-line);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orion-muted);
}
.status-dot.online {
  background: var(--orion-accent);
}
.web-label {
  margin-left: auto;
  letter-spacing: 2px;
  font-size: 9px;
}
.empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 65px 20px;
  text-align: center;
  color: var(--orion-muted);
  font-size: 13px;
  line-height: 1.7;
}
.empty-list svg {
  width: 30px;
  height: 30px;
  margin-bottom: 15px;
}
.empty-list strong {
  color: var(--orion-ink);
  font-weight: 500;
}
.empty-list p {
  margin: 5px 0;
}
.empty-list button {
  margin-top: 16px;
}
main {
  min-width: 0;
  min-height: 0;
}
.welcome {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: radial-gradient(
    ellipse at 50% 36%,
    var(--orion-surface),
    var(--orion-ground) 66%
  );
}
.welcome-top {
  padding: 29px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font: 600 16px var(--orion-font-brand);
  letter-spacing: 3.5px;
}
.wordmark span {
  font: 10px var(--orion-font-ui);
  letter-spacing: 2px;
  color: var(--orion-muted);
  margin-left: 10px;
}
.pill {
  font-size: 9px;
  letter-spacing: 2px;
  border: 1px solid var(--orion-line);
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--orion-muted);
}
.welcome-content {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 26px 24px;
}
#hero-mark {
  height: 98px;
  margin: 0 0 18px;
}
#hero-mark svg {
  width: 98px;
  height: 98px;
}
.welcome h2 {
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 500;
  letter-spacing: -1.9px;
  line-height: 1.12;
  margin: 17px 0;
}
.intro {
  color: var(--orion-muted);
  line-height: 1.7;
  font-size: 14px;
  margin: 0 0 24px;
}
.login-form {
  width: 300px;
  max-width: 100%;
  text-align: left;
}
.login-form label {
  display: block;
  font-size: 12px;
  color: var(--orion-muted);
  margin-bottom: 13px;
}
.login-form input {
  width: 100%;
  margin-top: 7px;
  font-size: 13px;
}
.primary {
  border: 0;
  border-radius: 10px;
  background: var(--orion-accent);
  color: var(--orion-on-accent);
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 600;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.login-form .primary {
  width: 100%;
  margin-top: 4px;
}
.primary svg {
  width: 16px;
}
.text-button {
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--orion-muted);
  padding: 10px;
}
.text-button:hover {
  color: var(--orion-ink);
}
.welcome-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 18px 24px;
  font-size: 11px;
  color: var(--orion-muted);
  border-top: 1px solid var(--orion-line);
}
.welcome-foot svg {
  width: 14px;
  height: 14px;
}
.welcome-foot button {
  font-size: 11px;
  margin-left: 10px;
}
.error {
  color: var(--orion-danger);
  font-size: 12px;
  line-height: 1.5;
  min-height: 1px;
  margin: 10px 0;
}
.hint {
  font-size: 12px;
  color: var(--orion-muted);
  line-height: 1.6;
  max-width: 340px;
}
.qr-box:empty {
  display: none;
}
.qr-box {
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  width: 228px;
  height: 228px;
  margin: 0 auto 16px;
}
.qr-box img {
  width: 196px;
  height: 196px;
}
.thread {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.thread-head {
  height: 88px;
  display: flex;
  align-items: center;
  padding: 16px 30px;
  gap: 14px;
  background: var(--orion-surface);
  border-bottom: 1px solid var(--orion-line);
}
.thread-person {
  flex: 1;
  min-width: 0;
}
.thread-person h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}
.thread-person span {
  color: var(--orion-muted);
  font-size: 12px;
}
.back {
  display: none;
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 28px clamp(20px, 5vw, 80px);
  display: flex;
  flex-direction: column;
  gap: 11px;
  background-image: radial-gradient(
    var(--orion-line) 0.65px,
    transparent 0.65px
  );
  background-size: 26px 26px;
}
.day-divider {
  align-self: center;
  background: var(--orion-surface);
  border: 1px solid var(--orion-line);
  font-size: 10px;
  letter-spacing: 0.3px;
  color: var(--orion-muted);
  padding: 7px 13px;
  border-radius: 7px;
  margin: 4px 0 21px;
}
.bubble {
  max-width: 76%;
  width: fit-content;
  border-radius: 18px 18px 18px 5px;
  padding: 13px 15px 8px;
  background: var(--orion-bubble-incoming);
  align-self: flex-start;
  min-width: 100px;
}
.bubble.outgoing {
  align-self: flex-end;
  border-radius: 18px 18px 5px 18px;
  background: var(--orion-bubble-outgoing);
  color: #fff;
}
.bubble p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
  margin: 0;
  font-size: 14px;
}
.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 10px;
  color: var(--orion-muted);
  margin-top: 5px;
}
.outgoing .bubble-meta {
  color: #d3e3db;
}
.bubble-meta svg {
  width: 14px;
  height: 14px;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 13px 17px;
  background: var(--orion-surface);
  border: 1px solid var(--orion-line);
  border-radius: 15px;
  margin: 0 25px;
}
.composer textarea {
  background: none;
  border: 0;
  resize: none;
  flex: 1;
  line-height: 1.5;
  padding: 10px 0;
  max-height: 140px;
  min-height: 44px;
  font-size: 14px;
}
.send-button {
  background: var(--orion-accent);
  color: var(--orion-on-accent);
  border: 0;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.composer-foot {
  text-align: center;
  font-size: 10px;
  color: var(--orion-muted);
  padding: 13px;
}
.composer-foot span {
  margin: 0 8px;
}
.thread-notice {
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  color: var(--orion-muted);
  padding: 12px 20px;
}
.demo-banner {
  background: var(--orion-raised);
  padding: 10px 20px;
  font-size: 11px;
  color: var(--orion-accent);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.demo-banner button {
  background: transparent;
  border: 0;
  text-decoration: underline;
  color: inherit;
}
.in-chat-search {
  display: flex;
  padding: 12px 24px;
  gap: 10px;
  border-bottom: 1px solid var(--orion-line);
}
.in-chat-search input {
  flex: 1;
}
dialog {
  width: 440px;
  max-width: calc(100% - 32px);
  border: 1px solid var(--orion-line);
  border-radius: 22px;
  background: var(--orion-surface);
  color: var(--orion-ink);
  padding: 28px;
}
dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(5px);
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 12px;
}
dialog h2 {
  font-size: 22px;
  font-weight: 500;
  margin: 6px 35px 20px 0;
}
dialog p {
  line-height: 1.7;
  font-size: 13px;
  color: var(--orion-muted);
}
dialog input {
  width: 100%;
}
dialog .primary {
  margin-top: 16px;
  width: 100%;
}
.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dialog-actions button {
  background: var(--orion-raised);
  border: 1px solid var(--orion-line);
  padding: 13px;
  border-radius: 10px;
  text-align: left;
}
.danger {
  color: var(--orion-danger);
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--orion-line);
  border-radius: 12px;
  background: var(--orion-raised);
  color: var(--orion-ink);
  padding: 14px 22px;
  font-size: 13px;
  max-width: 90%;
  box-shadow: 0 8px 30px #0004;
  z-index: 10;
}
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-thumb {
  background: var(--orion-line);
  border-radius: 6px;
}
@media (min-width: 1500px) {
  .shell {
    grid-template-columns: 80px 400px minmax(0, 1fr);
  }
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 64px 300px minmax(0, 1fr);
  }
  .sidebar-head {
    padding: 25px 20px;
  }
  .search kbd {
    display: none;
  }
  .welcome-foot {
    flex-wrap: wrap;
    gap: 5px;
  }
  .welcome-foot button {
    width: 100%;
    padding: 5px;
  }
  .welcome-top {
    padding: 25px;
  }
  .bubble {
    max-width: 90%;
  }
}
@media (max-width: 720px) {
  .shell {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  main {
    display: none;
  }
  .shell.show-main {
    grid-template-columns: 1fr;
  }
  .shell.show-main .rail,
  .shell.show-main .sidebar {
    display: none;
  }
  .shell.show-main main {
    display: block;
  }
  .back {
    display: inline-flex;
  }
  .thread-head {
    padding: 12px;
    height: 78px;
    gap: 8px;
  }
  .composer {
    margin: 0 10px;
    padding: 8px;
  }
  .messages {
    padding: 20px 15px;
  }
  .composer-foot {
    padding: 10px;
  }
  .welcome-top {
    padding: 20px;
  }
  .welcome-content {
    padding-top: 5px;
  }
  .rail {
    padding: 20px 6px;
  }
  .rail-brand svg {
    width: 40px;
    height: 40px;
  }
  .welcome-foot {
    padding: 12px;
  }
  .sidebar-head {
    padding-top: 30px;
  }
  .bubble {
    max-width: 88%;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .welcome-content {
    animation: arrive 0.5s ease-out;
  }
  .bubble {
    animation: arrive 0.18s ease-out;
  }
  @keyframes arrive {
    from {
      opacity: 0;
      transform: translateY(7px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
