/* Desktop profile card, channel views, poll and generic dialogs. */
/* Desktop: profile card sits in the layout so the chat shrinks to its left edge; keep the shadow. */
@media (min-width: 801px) {
  .app.profile-open .rhs.sheet {
    position: relative;
    inset: auto;
    width: 360px;
    max-width: 42vw;
    flex: 0 0 360px;
    z-index: 5;
    border-left: none;
    box-shadow: -12px 0 32px rgba(0,0,0,.18);
  }
  .app.profile-open .main {
    flex: 1 1 auto;
    min-width: 0;
  }
}
.rhs-backdrop { display: none; }
.rhs-head {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid rgba(216, 216, 220, 0.7);
  background: transparent;
  font-weight: 700;
}
.rhs-list { overflow: auto; flex: 1; }
.rhs-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #8b8e98; padding: 12px 16px 4px; text-transform: uppercase; }
.member {
  width: 100%; display: flex; gap: 10px; align-items: center; padding: 8px 16px;
  border: none; background: transparent; text-align: left; color: inherit; cursor: pointer;
}
.member:hover, .member.selected { background: var(--accent-soft); }
.member-meta { display: flex; flex-direction: column; min-width: 0; }
.member-name { font-weight: 700; font-size: 14px; }
.member-sub, .browse-topic { color: #8b8e98; font-size: 12px; }
.role {
  display: inline-flex; align-items: center; flex: none;
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; line-height: 1.5;
}
.role-admin { background: #f3e2b3; color: #6a4b00; }
.role-manager { background: var(--mention-bg); color: var(--text-strong); }
.role-user { background: #eceef3; color: #4b5160; }
.rhs-foot { padding: 12px 16px; border-top: 1px solid #ebebeb; }

.channel-card {
  display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
  background: transparent;
}
.channel-card.hidden { display: none !important; }
.channel-card-hero {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 18px 18px 14px;
  margin: 0;
}
.channel-card-hash {
  color: #9aa0a6; font-size: 22px; font-weight: 500; line-height: 1.15; flex: none;
}
.channel-card-hero-text { min-width: 0; flex: 1; }
.channel-card-hero-text h2 {
  margin: 0; font-size: 20px; font-weight: 700; color: #2c3038; line-height: 1.2;
  word-break: break-word;
}
.channel-card-hero-text p {
  margin: 4px 0 0; font-size: 13px; color: #8b8e98; line-height: 1.35;
  word-break: break-word;
}
.channel-rail-tools {
  margin: 0 14px 10px;
  width: auto;
  max-width: none;
  box-sizing: border-box;
}
.channel-card-section-label {
  padding: 8px 18px 4px; font-size: 15px; color: #6b707a; font-weight: 500;
}
.channel-card-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 16px 12px;
}
.channel-card-count { color: #8b8e98; font-size: 13px; }
.channel-card-actions { display: flex; gap: 8px; flex: none; }
.channel-card-add {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.channel-card-add:hover { background: var(--accent-hover); }
.channel-card-add.hidden { display: none !important; }
.channel-card-members { overflow: auto; flex: 1; padding-bottom: 16px; }
.channel-card-group {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #9aa0a6; padding: 14px 18px 6px;
}
.channel-card-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 16px; min-height: 48px;
}
.channel-card-row:hover { background: rgba(255, 255, 255, 0.35); }
.channel-card-row .avatar { width: 36px; height: 36px; font-size: 13px; flex: none; }
.channel-card-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.channel-card-name {
  font-weight: 600; font-size: 14px; color: #2c3038;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.channel-card-handle {
  font-size: 12px; color: #8b8e98;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.channel-card-role {
  appearance: none; border: none; background: transparent; cursor: pointer;
  color: var(--accent); font-size: 13px; font-weight: 500; padding: 4px 2px;
  display: inline-flex; align-items: center; gap: 2px; flex: none; max-width: 140px;
}
.channel-card-role:disabled {
  cursor: default; opacity: 1; color: var(--accent);
}
.channel-card-role .chevron {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; margin-left: 2px;
}
.channel-card-role-wrap { position: relative; flex: none; }
.channel-card-role-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 6;
  min-width: 160px; background: #fff; border: 1px solid #ebebeb; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; 
}
.channel-card-role-menu.hidden { display: none !important; }
.channel-card-role-menu button {
  width: 100%; border: none; background: transparent; text-align: left;
  padding: 8px 10px; border-radius: 6px; font-size: 13px; color: #2c3038; cursor: pointer;
}
.channel-card-role-menu button:hover { background: var(--accent-soft); }
.channel-card-role-menu button.is-active { color: var(--accent); font-weight: 600; }
.channel-card-remove {
  appearance: none; border: none; background: transparent; color: #a0a3ab;
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; flex: none;
  font-size: 18px; line-height: 1; display: grid; place-items: center;
}
.channel-card-remove:hover { background: #f0f1f4; color: #d24b4e; }
.channel-card-remove.hidden { display: none !important; }
.channel-card-empty { color: #8b8e98; font-size: 13px; padding: 12px 18px; }

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
  align-items: center; justify-content: center; z-index: 20; padding: 16px;
}
.dialog {
  width: 480px; max-width: 100%; background: #fff; border-radius: 8px;
  box-shadow: 0 16px 50px rgba(0,0,0,.3); max-height: calc(100% - 32px); overflow: auto;
}
.poll-dialog {
  width: min(440px, 100%);
}
.poll-dialog .polls-composer {
  margin-bottom: 0;
}
.poll-dialog .dialog-body {
  padding-top: 4px;
}
.poll-dialog .polls-setting {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  margin: 0 !important;
  padding: 8px 0;
  font-size: calc(13px * var(--text-scale, 1));
  font-weight: 400;
  line-height: 1.25;
  min-height: 34px;
}
.poll-dialog .polls-setting-label {
  flex: 1;
  min-width: 0;
  font-weight: 400;
  display: flex;
  align-items: center;
  line-height: 1.25;
}
.poll-dialog .polls-setting input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  pointer-events: none;
}
.poll-dialog .polls-toggle-ui {
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  margin-left: auto;
  align-self: center;
}
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 12px 4px 16px; }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-body { padding: 8px 16px 16px; }
.dialog-body label { display: block; margin: 12px 0 4px; font-size: 13px; font-weight: 700; }
.dialog-body input { width: 100%; }
.dialog-body .checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.dialog-body .checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--accent, #1c58d9);
}
.dialog-body .checkbox-row label {
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}
.dialog-body .hint {
  text-align: left;
  margin: 6px 0 0;
  font-size: 12px;
}
.hash.is-private { /* styled with .ico-lock */ }

.dialog.confirm-dialog {
  width: min(340px, 100%);
  border-radius: 16px;
  background: #f4f4f5;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.confirm-dialog-body { padding: 22px 18px 16px; text-align: center; }
.confirm-dialog-body h2 {
  margin: 0 0 16px; font-size: 17px; font-weight: 700; color: #1c1f26; line-height: 1.3;
}
.confirm-check {
  display: flex; align-items: center; gap: 10px; justify-content: flex-start;
  margin: 0 4px 18px; cursor: pointer; text-align: left; font-weight: 400;
}
.confirm-check input {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.confirm-check-mark {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2px solid #c5c8ce; background: #fff;
  display: grid; place-items: center;
}
.confirm-check-mark::after {
  content: ""; width: 10px; height: 6px; border: 2px solid #fff;
  border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
.confirm-check input:checked + .confirm-check-mark {
  background: var(--accent); border-color: var(--accent);
}
.confirm-check input:checked + .confirm-check-mark::after { opacity: 1; }
.confirm-check-text { font-size: 15px; color: #1c1f26; line-height: 1.3; }
.confirm-dialog-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.confirm-dialog-actions .btn {
  border-radius: 12px; padding: 12px 10px; font-size: 15px; font-weight: 700;
}
.browse-list { max-height: 360px; overflow: auto; margin-top: 8px; }
.forward-dialog .dialog-body { display: flex; flex-direction: column; gap: 8px; }
.forward-list { max-height: min(42vh, 320px); margin-top: 0; }
.forward-target { width: 100%; text-align: left; }
.forward-channel-mark {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eef0f4; color: #5b6170; font-weight: 700; flex: 0 0 auto;
}
.forward-share-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 4px; padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.forward-share-btn:hover { background: var(--accent-soft); }
.forward-share-btn:disabled {
  opacity: 0.65; cursor: wait;
}
.forward-share-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.browse-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.browse-info { min-width: 0; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #2a2d34; color: #fff; padding: 10px 16px; border-radius: 6px; z-index: 40; font-size: 14px;
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible {
  outline: 2px solid #d5d8de; outline-offset: 0; background: #f4f5f7;
}
.composer textarea:focus-visible,
.composer .composer-rich:focus-visible { outline: none; background: transparent; }

.menu-toggle { display: none; }
.nav-backdrop { display: none; }
.menu-drawer-backdrop { display: none; }
