/* ================================================
   Sirr - Channels & Groups Styles
   Colors: bg=#07090F s1=#0D1117 s2=#141B26 s3=#1C2535 s4=#243045
           gold=#C9902A gold2=#E8B450 teal=#0FB8A0 red=#E05050 blue=#3B7CF4
           text=#EAF0FF t2=#7A8FAD t3=#3A4A65
   RTL default. Font: Sora.
   ================================================ */

/* ---- Overlay & Dialog ---- */
.sirr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 15, 0.82);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.sirr-dialog {
  background: #0D1117;
  border-radius: 18px;
  width: 92%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s ease;
}

.sirr-modal-sheet {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 15, 0.7);
  z-index: 9500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-sheet-content {
  background: #0D1117;
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s ease;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #1C2535;
}

.sheet-title {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #EAF0FF;
}

.sheet-action-btn {
  background: none;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #C9902A;
  cursor: pointer;
  padding: 4px 8px;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---- Dialog Header ---- */
.dialog-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #0D1117;
  border-bottom: 1px solid #1C2535;
  gap: 10px;
  min-height: 52px;
}

.dialog-back-btn,
.dialog-save-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s;
}

.dialog-back-btn:hover,
.dialog-save-btn:hover {
  background: #141B26;
}

.dialog-title {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #EAF0FF;
  flex: 1;
}

.dialog-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dialog-subtitle {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: #7A8FAD;
}

.dialog-step-label {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  color: #7A8FAD;
}

.dialog-next-btn {
  background: none;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #C9902A;
  cursor: pointer;
  padding: 6px 12px;
}

/* ---- Dialog Body ---- */
.dialog-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.settings-body {
  padding: 16px;
}

.dialog-footer {
  padding: 16px;
  border-top: 1px solid #1C2535;
}

/* ---- Gold Button ---- */
.sirr-btn-gold {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #C9902A, #E8B450);
  color: #000;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.sirr-btn-gold:hover {
  opacity: 0.92;
}

.sirr-btn-gold:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dialog-action-btn {
  width: 100%;
}

/* ---- Wizard Steps ---- */
.wizard-step-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.wizard-icon-wrap {
  margin-bottom: 8px;
}

.wizard-icon {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-icon.circle {
  border-radius: 50%;
}

.wizard-title {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #EAF0FF;
  margin: 0;
}

.wizard-subtitle {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #7A8FAD;
  margin: 0 0 12px 0;
  text-align: center;
}

/* ---- Type Option ---- */
.type-option {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #1C2535;
  background: transparent;
  cursor: pointer;
  gap: 14px;
  transition: all 0.2s;
}

.type-option:hover {
  border-color: #243045;
}

.type-option.selected {
  background: rgba(201, 144, 42, 0.1);
  border-color: #C9902A;
}

.type-option-icon {
  flex-shrink: 0;
}

.type-option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.type-option-label {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #EAF0FF;
}

.type-option.selected .type-option-label {
  color: #C9902A;
}

.type-option-desc {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: #7A8FAD;
}

.type-option-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #3A4A65;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.type-option-radio.checked {
  border-color: #C9902A;
  background: #C9902A;
}

.type-option-radio.checked::after {
  content: '';
  display: block;
  width: 8px;
  height: 5px;
  border-left: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: rotate(-45deg);
  margin-top: -2px;
}

/* ---- Form Fields ---- */
.form-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #C9902A;
  padding-right: 4px;
}

.sirr-input {
  width: 100%;
  background: #141B26;
  border: 1px solid #1C2535;
  border-radius: 12px;
  padding: 14px 16px;
  color: #EAF0FF;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.sirr-input:focus {
  border-color: #C9902A;
}

.sirr-input::placeholder {
  color: #3A4A65;
}

.sirr-textarea {
  resize: vertical;
  min-height: 60px;
}

/* ---- Username Field ---- */
.username-field {
  align-items: center;
}

.username-input-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  background: #141B26;
  border: 1px solid #1C2535;
  border-radius: 12px;
  padding: 0 16px;
  gap: 4px;
}

.username-input-wrap:focus-within {
  border-color: #C9902A;
}

.username-at {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #C9902A;
  flex-shrink: 0;
}

.username-input {
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 14px 4px !important;
  flex: 1;
}

.username-status {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.username-hint {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  margin: 4px 0 0;
}

.username-hint.available {
  color: #0FB8A0;
}

.username-hint.taken {
  color: #E05050;
}

/* ---- Spinner ---- */
.spinner-small {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: #C9902A;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-gold {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid transparent;
  border-top-color: #C9902A;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  width: 100%;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Search Bar ---- */
.search-bar {
  display: flex;
  align-items: center;
  background: #141B26;
  border-radius: 22px;
  padding: 0 14px;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 0;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #EAF0FF;
}

.search-input::placeholder {
  color: #3A4A65;
}

/* ---- Selected Chips Row ---- */
.selected-chips-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  overflow-x: auto;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.selected-chips-row::-webkit-scrollbar {
  display: none;
}

.selected-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  flex-shrink: 0;
}

.chip-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.chip-name {
  font-family: 'Sora', sans-serif;
  font-size: 10px;
  color: #7A8FAD;
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-remove {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #E05050;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ---- Contact List ---- */
.contacts-list {
  display: flex;
  flex-direction: column;
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 10px 4px;
  gap: 12px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
}

.contact-item:hover {
  background: #141B26;
}

.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

.online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0FB8A0;
  border: 2px solid #0D1117;
}

.contact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-name {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #EAF0FF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-phone {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  color: #7A8FAD;
}

.contact-check {
  width: 24px;
  height: 24px;
  border: 2px solid #3A4A65;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.contact-check.checked {
  background: #C9902A;
  border-color: #C9902A;
}

.contact-check-icon {
  flex-shrink: 0;
}

/* ---- Members Count Label ---- */
.members-count-label {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #7A8FAD;
  margin-top: 8px;
}

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 8px;
  height: 100%;
  min-height: 200px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.empty-title {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #7A8FAD;
  margin: 0;
}

.empty-sub {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #3A4A65;
  margin: 0;
}

.empty-state-small {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.empty-state-small p {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #7A8FAD;
  margin: 0;
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 16px;
}

.error-state p {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #7A8FAD;
  margin: 0;
}

/* ============================================
   CHANNEL VIEW
   ============================================ */

.channel-view,
.group-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #07090F;
}

/* ---- Channel/Group Header ---- */
.channel-header,
.group-header {
  display: flex;
  align-items: center;
  padding: 8px;
  background: #0D1117;
  gap: 4px;
  flex-shrink: 0;
}

.header-back-btn,
.header-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.header-back-btn:hover,
.header-action-btn:hover {
  background: #141B26;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
}

.header-info:hover {
  background: #141B26;
}

.header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.header-text {
  flex: 1;
  min-width: 0;
}

.header-name {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #EAF0FF;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-channel-icon {
  flex-shrink: 0;
}

.header-sub {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: #7A8FAD;
}

/* ---- Posts Area / Messages Area ---- */
.channel-posts-area,
.group-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: #1C2535 transparent;
}

.channel-posts-area::-webkit-scrollbar,
.group-messages-area::-webkit-scrollbar {
  width: 4px;
}

.channel-posts-area::-webkit-scrollbar-thumb,
.group-messages-area::-webkit-scrollbar-thumb {
  background: #1C2535;
  border-radius: 2px;
}

/* ---- Channel Post Card ---- */
.channel-post-card {
  background: #141B26;
  border-radius: 14px;
  border: 0.5px solid #1C2535;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

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

.post-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.post-channel-name {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #C9902A;
}

.post-content {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #EAF0FF;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #3A4A65;
}

.post-views {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: #3A4A65;
}

/* ---- Pinned Post ---- */
.channel-post-card.pinned {
  border-color: rgba(201, 144, 42, 0.5);
  border-width: 1.5px;
}

.post-pinned-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #C9902A;
}

/* ---- Media in Posts ---- */
.post-media {
  width: 100%;
  overflow: hidden;
}

.post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.post-video-placeholder {
  height: 180px;
  background: #1C2535;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #1C2535;
  border-radius: 10px;
}

.file-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 144, 42, 0.15);
  border-radius: 10px;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-name {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #EAF0FF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: #3A4A65;
}

.file-download {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(122, 143, 173, 0.1);
  flex-shrink: 0;
  transition: background 0.2s;
}

.file-download:hover {
  background: rgba(122, 143, 173, 0.2);
}

/* ---- Attach Button ---- */
.attach-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s;
}

.attach-btn:hover {
  background: rgba(122, 143, 173, 0.1);
}

/* ---- Channel Bottom Bars ---- */
.channel-input-bar,
.group-input-bar {
  display: flex;
  align-items: center;
  padding: 8px;
  background: #0D1117;
  gap: 6px;
  flex-shrink: 0;
}

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: #141B26;
  border-radius: 22px;
  padding: 0 12px;
  gap: 8px;
  height: 42px;
}

.input-icon {
  flex-shrink: 0;
}

.message-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #EAF0FF;
  padding: 10px 0;
}

.message-input::placeholder {
  color: #3A4A65;
  font-size: 13px;
}

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #141B26;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7A8FAD;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn.active {
  background: linear-gradient(135deg, #C9902A, #E8B450);
  color: #000;
}

.attach-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-subscribe-bar {
  padding: 8px 16px;
  background: #0D1117;
  flex-shrink: 0;
}

.subscribe-btn {
  width: 100%;
  height: 42px;
  border-radius: 22px;
}

.channel-subscribed-bar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #0D1117;
  gap: 8px;
  flex-shrink: 0;
}

.subscribed-label {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #7A8FAD;
  flex: 1;
}

.unsubscribe-link {
  background: none;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  color: #E05050;
  cursor: pointer;
  padding: 4px 8px;
}

.group-no-send-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  background: #0D1117;
  flex-shrink: 0;
}

.group-no-send-bar span {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #3A4A65;
}

/* ============================================
   GROUP MESSAGES
   ============================================ */

.group-message {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  padding: 2px 0;
}

.group-message.outgoing {
  justify-content: flex-end;
}

.group-message.incoming {
  justify-content: flex-start;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-bubble.in-bubble {
  background: #141B26;
  border-radius: 16px 16px 16px 4px;
}

.msg-bubble.out-bubble {
  background: linear-gradient(135deg, #1a3a28, #1e4530);
  border-radius: 16px 16px 4px 16px;
}

.msg-sender-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.msg-sender-name {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 600;
}

.msg-role-badge {
  font-family: 'Sora', sans-serif;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
}

.msg-role-badge.owner {
  background: rgba(201, 144, 42, 0.2);
  color: #C9902A;
}

.msg-role-badge.admin {
  background: rgba(59, 124, 244, 0.2);
  color: #3B7CF4;
}

.msg-content {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #EAF0FF;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #3A4A65;
  align-self: flex-end;
}

/* ============================================
   SETTINGS PANEL
   ============================================ */

.settings-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid #1C2535;
  margin-bottom: 16px;
}

.settings-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
}

.settings-name {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #EAF0FF;
  margin: 0;
}

.settings-info-text {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #7A8FAD;
  margin: 0;
}

.settings-desc {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #3A4A65;
  text-align: center;
  margin: 0;
  padding: 0 16px;
}

/* ---- Settings Sections (Accordion style) ---- */
.settings-section {
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #C9902A;
  margin: 0 0 10px 0;
  padding: 0 4px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title-row .section-title {
  margin: 0;
}

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-card {
  background: #141B26;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.stat-label {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: #7A8FAD;
}

/* ---- Invite Link Card ---- */
.invite-link-card {
  background: #141B26;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.invite-link-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.invite-link-label {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: #7A8FAD;
}

.invite-link-url {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #C9902A;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  transition: background 0.15s;
}

.copy-btn:hover {
  background: #1C2535;
}

.regen-link-btn {
  background: none;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  color: #C9902A;
  cursor: pointer;
  padding: 8px 4px 0;
}

/* ---- Member List ---- */
.member-list {
  display: flex;
  flex-direction: column;
}

.member-item {
  display: flex;
  align-items: center;
  padding: 8px 4px;
  gap: 10px;
  min-height: 56px;
  border-radius: 10px;
  transition: background 0.15s;
}

.member-item:hover {
  background: #141B26;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.member-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.member-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-name {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #EAF0FF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.you-tag {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: #3A4A65;
  flex-shrink: 0;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'Sora', sans-serif;
  font-size: 12px;
}

.role-badge.owner {
  color: #C9902A;
}

.role-badge.admin {
  color: #3B7CF4;
}

.member-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.member-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s;
}

.member-action-btn:hover {
  background: #1C2535;
}

.add-member-btn {
  background: none;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #C9902A;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.add-member-btn:hover {
  background: rgba(201, 144, 42, 0.1);
}

/* ---- Permission Toggles ---- */
.permission-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #141B26;
  border-radius: 10px;
}

.permission-label {
  flex: 1;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #EAF0FF;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #1C2535;
  border-radius: 24px;
  transition: all 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  right: 3px;
  bottom: 3px;
  background: #3A4A65;
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(201, 144, 42, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
  background: #C9902A;
  transform: translateX(-18px);
}

/* ---- Danger Button ---- */
.settings-actions {
  padding-top: 8px;
  border-top: 1px solid #1C2535;
}

.danger-btn {
  width: 100%;
  background: none;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #E05050;
  cursor: pointer;
  padding: 12px;
  border-radius: 10px;
  transition: background 0.15s;
}

.danger-btn:hover {
  background: rgba(224, 80, 80, 0.08);
}

/* ============================================
   BROWSE PUBLIC CHANNELS
   ============================================ */

.public-channels-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #07090F;
}

.browse-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #0D1117;
  gap: 8px;
  flex-shrink: 0;
}

.browse-title {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #EAF0FF;
}

.browse-search {
  display: flex;
  align-items: center;
  margin: 12px;
  background: #141B26;
  border-radius: 22px;
  padding: 0 14px;
  gap: 8px;
  flex-shrink: 0;
}

.browse-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 0;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #EAF0FF;
}

.browse-search-input::placeholder {
  color: #3A4A65;
}

.browse-channels-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.channels-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.channel-browse-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #141B26;
  border-radius: 14px;
  border: 0.5px solid #1C2535;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.channel-browse-card:hover {
  background: #1C2535;
  border-color: #243045;
}

.cbc-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.cbc-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cbc-name {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #EAF0FF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cbc-username {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  color: #7A8FAD;
}

.cbc-desc {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  color: #3A4A65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cbc-subs {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  color: #7A8FAD;
}

.cbc-subscribe-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(135deg, #C9902A, #E8B450);
  color: #000;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.cbc-subscribe-btn:hover {
  opacity: 0.9;
}

.cbc-subscribe-btn.subscribed {
  background: #141B26;
  border: 1px solid #1C2535;
  color: #7A8FAD;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 768px) {
  .sirr-dialog {
    max-width: 520px;
  }

  .settings-dialog {
    max-width: 560px;
    max-height: 85vh;
  }

  .channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== MOBILE (max 768px) ===== */
@media (max-width: 768px) {
  /* Dialogs full width */
  .sirr-dialog {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  .sirr-overlay {
    padding: 0;
  }

  /* Dialog header */
  .dialog-header {
    min-height: 48px;
    padding: 0 12px;
  }

  /* Dialog body scroll */
  .dialog-body {
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Form inputs */
  .sirr-input,
  .sirr-textarea {
    font-size: 16px; /* prevents iOS zoom */
    padding: 10px 12px;
  }

  /* Stats grid - 2 columns on mobile */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* Member list */
  .member-item {
    min-height: 52px;
    padding: 8px 12px;
  }

  .member-avatar {
    width: 40px;
    height: 40px;
  }

  /* Channel posts */
  .channel-post-card {
    padding: 12px;
    margin: 0 0 8px 0;
  }

  /* Public channels grid - single column */
  .channels-grid {
    grid-template-columns: 1fr;
  }

  /* Invite link */
  .invite-link-card {
    padding: 12px;
  }

  .invite-link-url {
    font-size: 13px;
    word-break: break-all;
  }

  /* Permission items */
  .permission-item {
    min-height: 48px;
    padding: 8px 12px;
  }

  /* Type option buttons */
  .type-option {
    padding: 14px 12px;
  }

  /* Buttons touch-friendly */
  .sirr-btn-gold {
    min-height: 44px;
    font-size: 15px;
  }

  /* Toast full width on mobile */
  .cg-toast {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    transform: none !important;
    max-width: calc(100vw - 16px);
  }

  /* Channel header */
  .channel-header,
  .group-header {
    padding: 12px;
  }

  /* Settings sections */
  .settings-section {
    padding: 12px;
  }

  .section-title {
    font-size: 13px;
  }

  /* Action buttons */
  .member-action-btn,
  .header-action-btn {
    min-height: 44px;
    padding: 10px 12px;
  }

  /* Message bubble wider on mobile */
  .msg-bubble {
    max-width: 82%;
  }

  /* Search & browse inputs prevent iOS zoom */
  .search-input,
  .browse-search-input,
  .message-input {
    font-size: 16px;
  }
}

/* ===== SMALL PHONES (max 414px) ===== */
@media (max-width: 414px) {
  .dialog-body { padding: 8px; }

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

  .stat-card {
    padding: 10px 8px;
  }

  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }

  .member-item { padding: 6px 10px; }
  .channel-post-card { padding: 10px; }

  .channels-grid { gap: 8px; }
}

/* ===== VERY SMALL (max 320px) ===== */
@media (max-width: 320px) {
  .dialog-header { min-height: 44px; }
  .stats-grid { grid-template-columns: 1fr; }
  .member-avatar { width: 36px; height: 36px; }
  .channel-post-card { padding: 8px; }
}
