/* The dashboard: top bar, server list on the left, the server on the right. */
.page-center {
  max-width: 440px;
  margin: 0 auto;
  padding: 80px 16px 40px;
  text-align: center;
}
.page-center h1 {
  margin: 16px 0 6px;
}
.page-center small,
h1 small {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.7em;
}
.page-center .btn.big {
  margin-top: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.brand .muted {
  font-weight: 400;
}
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 57px);
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  position: sticky;
  top: 57px;
  align-self: start;
  max-height: calc(100vh - 57px);
  overflow: auto;
}
.side-title {
  padding: 0 10px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.side-item:hover {
  background: var(--card);
}
.side-item.on {
  background: var(--card-hover);
}
.side-item.add {
  color: var(--muted);
}
.side-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plus {
  color: var(--muted);
  font-weight: 700;
}
.guild-letter {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--card-hover);
  font-weight: 700;
  font-size: 0.8rem;
  flex: none;
}
.guild-letter.lg {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  font-size: 1.4rem;
}
.avatar.sm.square {
  border-radius: 8px;
}
.content {
  padding: 24px 28px 60px;
  max-width: 1180px;
  min-width: 0;
}
.content > h1 {
  margin-top: 0;
}
.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.guild-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.guild-card > div {
  min-width: 0;
}
.guild-card:hover {
  background: var(--card-hover);
}
.guild-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.guild-head h1 {
  margin: 0;
  font-size: 1.5rem;
}
.guild-banner {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  padding: 9px 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
}
.tab.on {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
}
.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 16px 0 0;
  font-size: 0.92rem;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.channel-cat {
  margin-top: 12px;
}
.channel-cat-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.channel-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
}
.channel-line:hover {
  background: var(--field);
}
.channel-sym {
  width: 20px;
  text-align: center;
  color: var(--muted);
}
.member-roles {
  justify-content: flex-end;
  max-width: 45%;
}
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.field-like .hint {
  margin-top: 4px;
}

/* ---- Bot profile preview ---- */
.profile-card {
  border-radius: 14px;
  overflow: hidden;
  background: #232428;
  border: 1px solid var(--line);
}
.profile-banner {
  height: 120px;
  background-size: cover;
  background-position: center;
}
.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 6px solid #232428;
  margin: -46px 0 0 14px;
  display: block;
  background: #232428;
  object-fit: cover;
}
.profile-info {
  padding: 6px 16px 16px;
}
.profile-name {
  font-size: 1.2rem;
  font-weight: 700;
}
.profile-bio {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
  font-size: 0.9rem;
}

/* ---- Composer + Discord-like preview ---- */
.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.composer-preview {
  position: sticky;
  top: 72px;
}
.embed-editor:not(:empty) {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--field);
}
.embed-field {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.preview-wrap {
  margin-top: 6px;
  padding: 16px 14px;
  border-radius: 10px;
  background: #313338;
  border: 1px solid #1e1f22;
}
.dc {
  display: flex;
  gap: 14px;
  color: #dbdee1;
  font-size: 0.95rem;
  line-height: 1.375;
}
.dc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
}
.dc-body {
  min-width: 0;
  flex: 1;
}
.dc-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dc-name {
  font-weight: 600;
  color: #f2f3f5;
}
.dc-tag {
  padding: 0 4px;
  border-radius: 4px;
  background: #5865f2;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 15px;
}
.dc-time {
  font-size: 0.72rem;
  color: #949ba4;
}
.md {
  overflow-wrap: anywhere;
}
.md a {
  color: #00a8fc;
  text-decoration: none;
}
.md-mention {
  padding: 0 2px;
  border-radius: 3px;
  background: #5865f24d;
  color: #c9cdfb;
  font-weight: 500;
}
.md-emoji {
  width: 22px;
  height: 22px;
  vertical-align: -5px;
  object-fit: contain;
}
.md-h1 {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}
.md-h2 {
  font-size: 1.25rem;
  font-weight: 700;
  display: block;
}
.md-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: block;
}
.md-sub {
  font-size: 0.78rem;
  color: #949ba4;
}
.md-quote {
  display: block;
  border-left: 4px solid #4e5058;
  padding-left: 10px;
}
.md-spoiler {
  background: #1e1f22;
  color: transparent;
  border-radius: 3px;
}
.md-spoiler:hover {
  color: inherit;
}
.md-pre {
  margin: 4px 0;
  padding: 7px;
  border-radius: 4px;
  background: #2b2d31;
  border: 1px solid #1e1f22;
  white-space: pre-wrap;
  font-size: 0.85em;
}
.dc-embed {
  display: flex;
  gap: 14px;
  max-width: 520px;
  margin-top: 6px;
  padding: 10px 14px 14px 12px;
  border-radius: 4px;
  border-left: 4px solid #202225;
  background: #2b2d31;
}
.dc-embed-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
}
.dc-author,
.dc-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  color: #f2f3f5;
}
.dc-footer {
  font-weight: 500;
  font-size: 0.75rem;
  color: #b5bac1;
}
.dc-author img,
.dc-footer img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.dc-footer img {
  width: 18px;
  height: 18px;
}
.dc-title {
  font-weight: 700;
  color: #f2f3f5;
  font-size: 0.95rem;
}
.dc-title a {
  color: #00a8fc;
  text-decoration: none;
}
.dc-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.dc-field {
  flex: 1 1 100%;
  min-width: 0;
}
.dc-field.inline {
  flex: 1 1 28%;
}
.dc-field-name {
  font-weight: 600;
  color: #f2f3f5;
  margin-bottom: 2px;
}
.dc-image {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 6px;
}
.dc-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex: none;
}
.dc-buttons,
.dc-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  max-width: 520px;
}
.dc-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 2px 16px;
  border-radius: 8px;
  background: #4e5058;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
}
.dc-button.primary {
  background: #5865f2;
}
.dc-button.success {
  background: #248046;
}
.dc-button.danger {
  background: #da373c;
}
.dc-reaction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #3b3d44;
  border: 1px solid #5865f2;
  font-size: 0.85rem;
}
.panel-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
}
.emoji-input {
  display: flex;
  align-items: center;
  gap: 4px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 40px);
  width: 300px;
  left: auto;
  right: 0;
  padding: 6px;
}
.emoji-grid button {
  width: 40px;
  height: 40px;
  padding: 8px;
  justify-content: center;
  border-radius: 7px;
}

@media (max-width: 1000px) {
  .composer,
  .two-col {
    grid-template-columns: 1fr;
  }
  .composer-preview {
    position: static;
  }
}
@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 10px 12px;
  }
  .sidebar .side-title,
  .sidebar .hint {
    display: none;
  }
  .side-item {
    flex: none;
    max-width: 200px;
  }
  .content {
    padding: 18px 16px 48px;
  }
  .hide-sm {
    display: none;
  }
  .member-roles {
    display: none;
  }
  .list-item {
    flex-wrap: wrap;
  }
}
