* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #0b0e12;
  --panel: #101625;
  --border: #2b354c;
  --text: #e6eaf4;
  --muted: #8796b9;
  --accent: #1a01fc;
  --cyan: #a1dbe2;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter,"Segoe UI",Arial,sans-serif;
  font-size: 13px;
  line-height: 1.65;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  outline-offset: 4px;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .6;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

#app {
  position: relative;
  min-height: calc(100vh - 75px);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.loading {
  text-align: center;
  padding: 25vh 20px;
}

.login-wrap {
  padding: clamp(35px,12vh,125px) 20px 0;
  display: flex;
  justify-content: center;
}

.login {
  width: 440px;
  border: 1px solid #024591;
  border-radius: 17px;
  background: radial-gradient(ellipse at 50% 15%,#262630aa,transparent 60%),#10151de8;
  box-shadow: 0 0 0 2px #34363e80,0 12px 45px #0005;
  overflow: hidden;
  text-align: center;
}

.login-top {
  padding: 30px 28px 24px;
}

.server-icon {
  width: 112px;
  height: 112px;
  object-fit: cover;
  box-shadow: 0 0 36px #c59cc533;
  margin-bottom: 5px;
}

.login h1 {
  font-size: 21px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.login h3 {
  color: var(--accent);
  font-size: 13px;
  text-decoration: underline;
  margin: 20px 0 4px;
}

.login p {
  color: #bfcce2;
  line-height: 1.7;
}

.login-form {
  padding: 20px 26px 23px;
  border-top: 1px solid #ffffff12;
}

.login-form label {
  display: block;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 8px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  width: 100%;
  height: 47px;
  border: 1px solid #1100ff;
  border-radius: 8px;
  background: #19191d;
  color: var(--text);
  text-align: center;
  padding: 0 45px;
  font-size: 14px;
}

.password-wrap input::placeholder {
  color: #78849f;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 20px;
  width: 32px;
  height: 35px;
}

.submit {
  width: 100%;
  height: 46px;
  border-radius: 8px;
  border: 1px solid #0019f8;
  background: linear-gradient(110deg,#282b37,#1c2530);
  color: #e6f4fa;
  font-weight: 700;
  margin-top: 16px;
  box-shadow: inset 0 0 0 1px #53657888;
}

.submit:hover {
  background: #323749;
}

.privacy-note {
  font-size: 11px!important;
  color: var(--muted)!important;
  margin-top: 16px!important;
}

.login-bottom {
  padding: 16px;
  background: #141b25;
  border-top: 1px solid #ffffff14;
}

.login-bottom h2 {
  font-size: 14px;
}

.login-bottom p {
  font-size: 11px;
  color: var(--muted);
}

.login-bottom a {
  display: inline-block;
  font-size: 11px;
  margin-top: 6px;
}

.error {
  color: #ffaaa9;
  font-size: 12px;
  margin-top: 10px;
  min-height: 0;
}

.error:empty {
  display: none;
}

#footer {
  text-align: center;
  color: #8190aa;
  font-size: 11px;
  padding: 28px 16px 36px;
}

#demo-banner {
  background: #292036;
  border-bottom: 1px solid #674d73;
  color: #e9d1ea;
  padding: 8px;
  text-align: center;
  font-size: 12px;
}

body.transcript {
  background: linear-gradient(115deg,#0c1927,#0c1020 68%);
}

.shell {
  max-width: 1252px;
  margin: auto;
  padding: 0 20px;
}

.topbar {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-top: 5px;
}

.topbar h1 {
  font-size: 26px;
  letter-spacing: -.7px;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.topbar p {
  color: var(--muted);
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 5px;
  flex-shrink: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #16523f;
  border-radius: 5px;
  background: #0e312547;
  color: #7edea5;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 9px;
}

.status:before {
  content: '●';
  color: #43df92;
  font-size: 9px;
}

.subtle-button {
  border: 1px solid var(--border);
  background: #151f30;
  color: #b6c2dc;
  padding: 8px 12px;
  border-radius: 8px;
}

.subtle-button:hover {
  background: #233047;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 14px;
  margin-bottom: 19px;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #101626f2;
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 78px;
}

.stat img {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.stat-icon {
  width: 37px;
  height: 37px;
  border: 1px solid #34415c;
  border-radius: 9px;
  background: #1e2941;
  display: grid;
  place-items: center;
  color: #a8beef;
  font-size: 21px;
}

.stat:nth-child(3) .stat-icon {
  background: #29263d;
  color: #c2b1e1;
}

.stat small {
  font-size: 11px;
  color: var(--muted);
}

.stat strong {
  font-size: 20px;
  line-height: 1.2;
  display: inline-block;
}

.stat .stat-note {
  color: var(--muted);
  font-size: 11px;
  margin-left: 6px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) 282px;
  gap: 18px;
  align-items: start;
}

.card {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #101625f5;
  overflow: hidden;
}

.card-head {
  padding: 17px 19px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-head h2 {
  font-size: 15px;
  font-weight: 800;
}

.card-head p {
  font-size: 11px;
  color: var(--muted);
}

.read-only {
  font-size: 10px;
  color: var(--muted);
}

.toolbar {
  padding: 13px 19px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #101a2af0;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 11px;
}

.tab.active {
  background: #183d47aa;
  border-color: #295366;
  color: #b0e5ec;
  font-weight: 700;
}

.search {
  background: #0c1221;
  border: 1px solid #29334b;
  border-radius: 8px;
  height: 34px;
  padding: 0 11px;
  color: var(--text);
  font-size: 11px;
  width: 205px;
}

.conversation {
  padding: 0 19px;
}

.date-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 21px 0 28px;
  color: var(--muted);
  font-size: 10px;
}

.date-line:before,
.date-line:after {
  content: '';
  height: 1px;
  background: #2b354c;
  flex: 1;
}

.chat-message {
  padding: 8px 0 18px;
  border-bottom: 1px solid #20293b;
  display: flex;
  gap: 12px;
  scroll-margin-top: 20px;
}

.chat-message+.chat-message {
  padding-top: 12px;
}

.avatar {
  width: 33px;
  height: 33px;
  object-fit: cover;
  border-radius: 9px;
  flex-shrink: 0;
}

.chat-body {
  flex: 1;
  min-width: 0;
}

.message-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 12px;
}

.message-meta strong {
  font-weight: 700;
}

.bot-badge {
  font-size: 9px;
  background: #153c52;
  color: #95d5ed;
  border: 1px solid #25516a;
  padding: 0 4px;
  line-height: 16px;
  border-radius: 3px;
}

.timestamp {
  font-size: 10px;
  color: var(--muted);
}

.message-text {
  color: #bdcbe3;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-text strong {
  color: #eef0f6;
}

.component-box {
  border: 1px solid #2b435b;
  background: #131f30;
  border-radius: 9px;
  padding: 14px;
  margin: 9px 0 10px;
  color: #bdcbe3;
  font-size: 12px;
}

.component-box h1,
.component-box h2,
.component-box h3 {
  font-size: 14px;
  color: #e6eaf4;
  margin: 4px 0 17px;
  font-weight: 800;
}

.component-box hr {
  border: 0;
  height: 1px;
  background: #2b3c51;
  margin: 16px 0;
}

.component-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.component-text p {
  margin-bottom: 8px;
}

.component-section {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
}

.component-section>div {
  flex: 1;
  min-width: 0;
}

.thumbnail {
  width: 86px;
  height: 86px;
  border-radius: 9px;
  object-fit: cover;
}

.component-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.component-button {
  font-size: 10px;
  color: #aebbd2;
  background: #121d2e;
  border: 1px solid #2b3e57;
  border-radius: 8px;
  padding: 7px 10px;
  line-height: 1.5;
}

.component-button:disabled {
  opacity: .68;
}

.component-select {
  border: 1px solid #324057;
  border-radius: 6px;
  padding: 8px;
  width: 100%;
  color: var(--muted);
}

code {
  background: #080f1c;
  border: 1px solid #23314a66;
  border-radius: 3px;
  padding: 1px 3px;
  color: #e2e9f7;
  font-family: Consolas,monospace;
  font-size: .92em;
}

blockquote {
  margin: 10px 0 7px;
  border-left: 3px solid #375269;
  padding-left: 12px;
  font-weight: 600;
}

.mention {
  background: #15485c88;
  color: #91d8ea;
  border-radius: 3px;
  padding: 1px 3px;
  font-weight: 600;
}

.spoiler {
  background: #758097;
  color: transparent;
  border-radius: 3px;
  cursor: pointer;
}

.spoiler:focus,
.spoiler:hover {
  color: #fff;
  background: #343f56;
}

.card-foot {
  font-size: 10px;
  color: var(--muted);
  padding: 12px 20px;
  background: #111929;
  border-top: 1px solid var(--border);
}

.side .card+.card {
  margin-top: 15px;
}

.side .card-head {
  padding: 14px 16px;
}

.side h2 {
  font-size: 12px;
}

.side-content {
  padding: 16px;
}

.info-block {
  margin: 11px 0 14px;
}

.info-block small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}

.info-block p {
  font-size: 11px;
  color: #b8c7e1;
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.side hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.person {
  display: flex;
  gap: 8px;
  align-items: center;
}

.person img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.person small {
  font-size: 9px;
}

.policy p {
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 10px;
  line-height: 1.9;
}

.policy .important {
  color: #c2cee2;
}

.policy a {
  font-size: 10px;
}

.policy .subtle-button {
  display: block;
  text-align: center;
  font-size: 11px;
  margin-top: 13px;
}

.policy details {
  font-size: 10px;
  color: #a6d9e0;
  margin-top: 9px;
}

.attachments {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.attachment {
  border: 1px solid #304058;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  background: #0c1525;
}

.attachment img {
  display: block;
  max-width: 100%;
  max-height: 350px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.attachment small {
  color: var(--muted);
}

.empty {
  text-align: center;
  padding: 60px 12px;
  color: var(--muted);
}

.reply {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
}

.inline-link {
  color: #91d8ea;
  text-decoration: underline;
}

.root-notice {
  max-width: 440px;
  margin: auto;
  padding: 25vh 20px;
  text-align: center;
}

.root-notice h1 {
  font-size: 22px;
}

.root-notice p {
  margin-top: 15px;
  color: var(--muted);
}

@media(min-width:1500px) {
  .shell {
    max-width: 1252px;
  }

}

@media(max-width:900px) {
  .grid {
    grid-template-columns: minmax(0,1fr) 245px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .stat {
    padding: 12px;
  }

  .stat strong {
    font-size: 16px;
  }

  .stat-note {
    display: block;
    margin-left: 0!important;
  }

  .thumbnail {
    width: 65px;
    height: 65px;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search {
    flex: 1;
    min-width: 140px;
  }

}

@media(max-width:680px) {
  .shell {
    padding: 15px 12px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stat {
    min-height: 65px;
  }

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

  .side {
    order: 2;
  }

  .topbar h1 {
    font-size: 19px;
  }

  .top-actions {
    padding-top: 0;
  }

  .conversation {
    padding: 0 12px;
  }

  .card-head,
  .toolbar {
    padding: 12px;
  }

  .read-only {
    display: none;
  }

  .message-meta {
    gap: 5px;
  }

  .chat-message {
    gap: 8px;
  }

  .avatar {
    width: 28px;
    height: 28px;
  }

  .component-box {
    padding: 11px;
  }

  .login-wrap {
    padding-top: 35px;
  }

  .login {
    width: 100%;
    max-width: 440px;
  }

  .component-section {
    flex-direction: column-reverse;
  }

  .thumbnail {
    align-self: flex-end;
    width: 60px;
    height: 60px;
  }

  .stats .stat-note {
    display: inline;
    margin-left: 6px!important;
  }

}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto!important;
  }

}

.line-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  display: inline-block;
}

.read-only .line-icon {
  width: 11px;
  height: 11px;
}

.discord-emoji {
  width: 1.35em;
  height: 1.35em;
  object-fit: contain;
  vertical-align: -.25em;
  display: inline-block;
}
