:root {
  color-scheme: light dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg: var(--tg-theme-bg-color, #111318);
  --surface: var(--tg-theme-secondary-bg-color, #191c22);
  --surface-2: #20242c;
  --text: var(--tg-theme-text-color, #f7f8fb);
  --hint: var(--tg-theme-hint-color, #9098a8);
  --accent: var(--tg-theme-button-color, #7b5cff);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --border: rgba(255, 255, 255, 0.07);
  --danger: #d94b5d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(123, 92, 255, 0.18), transparent 30rem),
    var(--bg);
  color: var(--text);
}

body {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding:
    max(16px, env(safe-area-inset-top))
    14px
    28px;
}

.topbar {
  padding: 6px 2px 16px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo,
.avatar,
.state-icon,
.community-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: linear-gradient(145deg, #8d70ff, #5e3fd1);
  box-shadow: 0 14px 35px rgba(91, 61, 208, 0.28);
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  font-weight: 900;
}

.brand h1,
.brand p,
.profile-card h2,
.profile-card p,
.community-hero h2,
.community-hero p,
.member-profile-card h2,
.member-profile-card p {
  margin: 0;
}

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

.brand p,
.profile-card p,
.community-hero p,
.member-profile-card p,
.state-card p {
  color: var(--hint);
}

.card {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
}

.page-content {
  display: grid;
  gap: 14px;
}

.hidden {
  display: none !important;
}

.state-card {
  padding: 34px 24px;
  text-align: center;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 18px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.button {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
}

.button-primary {
  color: var(--accent-text);
  background: var(--accent);
  font-weight: 800;
}

.button-danger {
  width: 100%;
  color: white;
  background: var(--danger);
  font-weight: 900;
}

.profile-card,
.community-hero,
.member-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px;
}

.avatar {
  position: relative;
  width: 66px;
  height: 66px;
  overflow: hidden;
  border-radius: 22px;
  font-weight: 900;
}

.avatar img,
.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-lg {
  width: 78px;
  height: 78px;
  border-radius: 25px;
  font-size: 24px;
}

.profile-copy,
.member-profile-copy {
  min-width: 0;
}

.profile-copy h2,
.member-profile-copy h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  font-size: 26px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #a996ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-badge,
.counter,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: #ad9cff;
  background: rgba(123, 92, 255, 0.15);
  font-size: 12px;
  font-weight: 800;
}

.quick-grid,
.detail-grid,
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-card,
.detail-card,
.action-card {
  display: grid;
  gap: 7px;
  padding: 15px;
  color: inherit;
  text-align: left;
}

.quick-card {
  min-height: 110px;
}

.quick-card small,
.detail-card span {
  color: var(--hint);
  font-size: 12px;
}

.section {
  margin-top: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 3px 11px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.community-list,
.member-list,
.history-list {
  display: grid;
  gap: 8px;
}

.community {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.community-action {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 8px 11px;
  color: #ad9cff;
  background: rgba(123, 92, 255, 0.15);
  font-size: 12px;
  font-weight: 900;
}

.text-button {
  width: max-content;
  border: 0;
  background: transparent;
  color: #ad9cff;
  padding: 4px 2px;
  font-weight: 800;
}

.sticky-search {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 4px 0 8px;
  background: linear-gradient(var(--bg) 75%, transparent);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.search-box input {
  width: 100%;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.member-list.compact {
  gap: 6px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.member-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(145deg, #6f55dd, #42308f);
  font-size: 13px;
  font-weight: 900;
}

.member-main {
  min-width: 0;
  flex: 1;
}

.member-name {
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-subline {
  margin-top: 3px;
  color: var(--hint);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-arrow {
  color: #ad9cff;
  font-size: 20px;
}

.empty {
  padding: 20px;
  text-align: center;
  color: var(--hint);
}

.load-more {
  width: 100%;
  color: #ad9cff;
  background: rgba(123, 92, 255, 0.14);
  font-weight: 800;
}

.detail-card {
  min-height: 90px;
}

.detail-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-card {
  min-height: 58px;
  place-items: center;
  border: 0;
  font-weight: 800;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.history-item p {
  margin: 4px 0;
  color: var(--hint);
  font-size: 13px;
}

.history-item small {
  color: var(--hint);
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 720px);
  padding:
    8px
    10px
    max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--border);
  background: rgba(25, 28, 34, 0.96);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: grid;
  justify-items: center;
  gap: 3px;
  border: 0;
  border-radius: 14px;
  padding: 8px 4px;
  color: var(--hint);
  background: transparent;
}

.nav-item.active {
  color: var(--accent);
  background: rgba(123, 92, 255, 0.12);
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: min(calc(100% - 30px), 480px);
  padding: 13px 16px;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  text-align: center;
}

.sheet-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(4px);
}

.bottom-sheet {
  width: min(100%, 700px);
  max-height: 82vh;
  overflow: auto;
  padding: 10px 14px 20px;
  border: 1px solid var(--border);
  border-radius: 24px 24px 18px 18px;
  background: var(--surface);
  box-shadow: 0 -18px 55px rgba(0, 0, 0, 0.35);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sheet-heading h2 {
  margin: 0;
}

.icon-button {
  border: 0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  font-size: 24px;
}

.form-group {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}

.form-group label {
  color: var(--hint);
  font-size: 13px;
  font-weight: 800;
}

.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.form-group textarea {
  min-height: 96px;
  resize: vertical;
}

@media (max-width: 360px) {
  .quick-grid,
  .detail-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }
}


/* v1.8.0: статусы, фильтры, снятие наказаний и гибкий срок */
.filter-chips {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  overflow-x: auto;
  padding: 0 1px 3px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--hint);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
}
.filter-chip.active {
  color: #ad9cff;
  border-color: rgba(123, 92, 255, .36);
  background: rgba(123, 92, 255, .16);
}
.member-restrictions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.restriction-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  font-size: 14px;
  background: rgba(255, 255, 255, .05);
}
.restriction-ban { background: rgba(217, 75, 93, .15); }
.restriction-mute { background: rgba(95, 168, 255, .14); }
.restriction-warn { background: rgba(244, 197, 66, .14); }
.history-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}
.history-copy { min-width: 0; }
.revoke-button {
  border: 1px solid rgba(217, 75, 93, .28);
  border-radius: 10px;
  padding: 7px 10px;
  color: #ff909c;
  background: rgba(217, 75, 93, .11);
  font-size: 12px;
  font-weight: 900;
}
.revoke-button:disabled { opacity: .55; }
.duration-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.duration-field { display: grid; gap: 6px; min-width: 0; }
.duration-field span {
  color: var(--hint);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.duration-field input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 5px;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  text-align: center;
  font-weight: 850;
  outline: none;
  appearance: textfield;
}
.duration-field input::-webkit-inner-spin-button,
.duration-field input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.duration-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123, 92, 255, .14);
}
.quick-duration-buttons {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-duration-buttons::-webkit-scrollbar { display: none; }
.quick-duration-buttons button {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  color: #ad9cff;
  background: rgba(123, 92, 255, .1);
  font-size: 12px;
  font-weight: 850;
}
.duration-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #ad9cff;
  background: rgba(123, 92, 255, .12);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.duration-preview-error {
  color: #ff8d99;
  background: rgba(217, 75, 93, .12);
}
.role-options { display: grid; gap: 8px; margin-top: 16px; }
.role-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, .03);
  text-align: left;
}
.role-dot { width: 12px; height: 12px; border-radius: 50%; }
.role-option-name { flex: 1; font-weight: 800; }
.role-check { color: #ad9cff; font-size: 18px; font-weight: 900; }
@media (max-width: 360px) {
  .duration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* v2.0.0 — мобильная ширина, компактная навигация и история */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

.app-shell,
.page-content,
.page-content > *,
#community-page,
#member-page,
.sticky-search,
.search-box,
.member-list,
.member-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#community-page {
  overflow-x: clip;
}

.sticky-search {
  overflow: hidden;
}

.filter-chips {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding-bottom: 5px;
}

.filter-chip {
  white-space: nowrap;
}

.bottom-nav {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 720px;
  min-width: 0;
  margin: 0 auto;
  padding: 5px 8px max(5px, env(safe-area-inset-bottom));
  transform: none;
}

.nav-item {
  min-width: 0;
  gap: 1px;
  padding: 6px 2px;
  font-size: 15px;
}

.nav-item small {
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-card {
  min-width: 0;
  min-height: 64px;
  padding: 11px 8px;
  gap: 5px;
  justify-items: center;
  text-align: center;
  font-size: 13px;
  line-height: 1.15;
}

.action-warning {
  color: #ffd873;
  border: 1px solid rgba(244, 197, 66, .16);
  background: linear-gradient(145deg, rgba(244, 197, 66, .10), rgba(255, 255, 255, .025));
}

.action-warning .action-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 9px;
  color: #1b1606;
  background: #f4c542;
  font-size: 14px;
  font-weight: 900;
}

.history-heading {
  gap: 10px;
}

.history-clear-button,
.delete-history-button {
  border: 1px solid rgba(217, 75, 93, .26);
  color: #ff909c;
  background: rgba(217, 75, 93, .10);
  font-weight: 900;
}

.history-clear-button {
  flex: 0 0 auto;
  border-radius: 11px;
  padding: 8px 10px;
  font-size: 11px;
}

.delete-history-button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  padding: 0;
  font-size: 14px;
}

.history-clear-button:disabled,
.delete-history-button:disabled {
  opacity: .5;
}

@media (max-width: 360px) {
  .quick-grid,
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* v2.2.0: единый стиль кнопок модерации. */
#change-role-button,
#warn-button,
#mute-button,
#ban-button {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 8px;
  min-height: 66px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  text-align: left;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}

#change-role-button {
  color: #9fc8ff;
  border-color: rgba(95, 168, 255, 0.22);
  background: linear-gradient(145deg, rgba(95, 168, 255, 0.13), rgba(255,255,255,0.025));
}

#warn-button {
  color: #ffd873;
  border-color: rgba(244, 197, 66, 0.24);
  background: linear-gradient(145deg, rgba(244, 197, 66, 0.13), rgba(255,255,255,0.025));
}

#mute-button {
  color: #c5b8ff;
  border-color: rgba(123, 92, 255, 0.24);
  background: linear-gradient(145deg, rgba(123, 92, 255, 0.14), rgba(255,255,255,0.025));
}

#ban-button {
  color: #ff939e;
  border-color: rgba(217, 75, 93, 0.25);
  background: linear-gradient(145deg, rgba(217, 75, 93, 0.14), rgba(255,255,255,0.025));
}

#change-role-button::before,
#warn-button::before,
#mute-button::before,
#ban-button::before {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

#change-role-button::before {
  content: "🛡";
  background: rgba(95, 168, 255, 0.24);
}

#warn-button::before {
  content: "⚠";
  color: #211b08;
  background: #f4c542;
}

#mute-button::before {
  content: "🔇";
  background: rgba(123, 92, 255, 0.28);
}

#ban-button::before {
  content: "⛔";
  background: rgba(217, 75, 93, 0.28);
}

/* Скрываем старые emoji в тексте, если они остались в HTML. */
#change-role-button,
#warn-button,
#mute-button,
#ban-button {
  text-indent: 0;
}

/* v2.0.0 — staff reputation */
.staff-rating-inline{margin-top:8px;border:1px solid rgba(244,197,66,.24);border-radius:999px;padding:7px 10px;color:#ffd96f;background:rgba(244,197,66,.09);font-size:12px;font-weight:850}.staff-rating-card{display:grid;width:100%;gap:4px;text-align:left}.staff-rating-card strong{color:#ffd96f;font-size:22px}.staff-rating-card span{font-weight:800}.staff-rating-card small{color:var(--hint)}.staff-reviews-sheet{max-height:min(86vh,720px);overflow-y:auto}.staff-reviews-summary{margin-bottom:12px;padding:10px 12px;border-radius:14px;color:#ffd96f;background:rgba(244,197,66,.09);font-weight:900}.staff-reviews-list{display:grid;gap:9px}.staff-review-item{padding:12px;border:1px solid var(--border);border-radius:15px;background:var(--surface)}.staff-review-head{display:flex;justify-content:space-between;gap:10px}.staff-review-head strong{color:#ffd96f;letter-spacing:1px}.staff-review-head span{color:var(--hint);font-size:12px}.staff-review-item p{margin:8px 0;white-space:pre-wrap}.staff-review-item small{color:var(--hint)}

/* v2.1.0 — member center & staff team */
.staff-team-list,.profile-list{display:grid;gap:9px}.staff-team-row{width:100%;display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:11px;padding:12px;text-align:left;color:inherit}.staff-team-row .member-avatar{width:48px;height:48px}.staff-team-copy{display:grid;min-width:0;gap:2px}.staff-team-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.staff-team-copy span,.staff-team-copy small{color:var(--hint);font-size:12px}.staff-team-rating{white-space:pre-line;text-align:right;color:#ffd96f;font-size:12px;font-weight:850}.member-summary-grid{margin-top:10px}.profile-list-item{display:grid;gap:5px;padding:12px}.profile-list-item p{margin:0;color:var(--text)}.profile-list-item small{color:var(--hint)}.compact-profile-item{gap:3px}.moderation-required{color:var(--danger)}

/* v2.2.0 — role permissions */
.permission-role-list{display:grid;gap:14px;margin-top:14px}
.permission-role-card{padding:15px}
.permission-role-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.permission-role-heading h2{margin:2px 0 0;font-size:18px}
.permission-switch-list{display:grid;gap:1px;border-radius:14px;overflow:hidden;background:rgba(255,255,255,.04)}
.permission-switch-row{display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:8px;padding:11px 12px;background:rgba(10,13,19,.72)}
.permission-switch-row input{width:22px;height:22px;accent-color:#8068ff}
.permission-switch-copy{display:grid;gap:2px;min-width:0}
.permission-switch-copy strong{font-size:14px}
.permission-switch-copy small{color:var(--hint);font-size:11px;overflow:hidden;text-overflow:ellipsis}
.permission-save{width:100%;margin-top:12px}
.permission-note{margin-top:14px;padding:13px;color:var(--hint);font-size:12px;line-height:1.45}


/* v2.3.0 — рейтинг без обрезания */
.staff-rating-card{
  display:grid;
  width:100%;
  min-height:92px;
  height:auto;
  align-content:start;
  gap:5px;
  padding:13px 14px 14px;
  overflow:visible;
  white-space:normal;
  text-align:left;
}
.staff-rating-card strong,
.staff-rating-card span,
.staff-rating-card small{
  display:block;
  min-width:0;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.25;
}
.staff-rating-card strong{font-size:20px}
.staff-rating-card small{font-size:12px}

/* v2.3.0 — компактный раздел «Ещё» */
.compact-page-heading{margin-bottom:2px}
.more-menu-list{display:grid;gap:8px}
.more-menu-item,
.more-menu-placeholder{
  width:100%;
  min-height:62px;
  display:grid;
  grid-template-columns:40px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  color:inherit;
  text-align:left;
  border-radius:16px;
}
.more-menu-placeholder{grid-template-columns:40px minmax(0,1fr);opacity:.55}
.more-menu-icon{
  width:36px;height:36px;
  display:grid;place-items:center;
  border-radius:11px;
  background:rgba(123,92,255,.13);
}
.more-menu-copy{display:grid;gap:2px;min-width:0}
.more-menu-copy strong{font-size:14px}
.more-menu-copy small{
  color:var(--hint);
  font-size:11px;
  line-height:1.25;
  white-space:normal;
}
.more-menu-arrow{color:var(--hint);font-size:24px;line-height:1}

/* v2.3.0 — общие / персональные права */
.permission-page-head{display:grid;gap:4px}
.permission-page-head h2,.permission-page-head p{margin:0}
.permission-page-head p{color:var(--hint);font-size:12px;line-height:1.4}
.permission-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:4px;
  border-radius:14px;
  background:rgba(255,255,255,.045);
}
.permission-tab{
  border:0;
  border-radius:11px;
  padding:9px 10px;
  color:var(--hint);
  background:transparent;
  font-weight:800;
}
.permission-tab.active{
  color:var(--text);
  background:rgba(123,92,255,.2);
}
.permission-member-list{display:grid;gap:8px}
.permission-member-row{
  width:100%;
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto 18px;
  align-items:center;
  gap:9px;
  padding:9px 10px;
  border-radius:15px;
  color:inherit;
  text-align:left;
}
.permission-member-avatar{
  width:42px;height:42px;
  display:grid;place-items:center;
  border-radius:13px;
  color:white;
  background:linear-gradient(145deg,#8d70ff,#5e3fd1);
  background-size:cover;
  background-position:center;
  font-weight:900;
}
.permission-member-avatar.has-image{font-size:0}
.permission-member-copy{display:grid;gap:2px;min-width:0}
.permission-member-copy strong{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.permission-member-copy small{color:var(--hint);font-size:11px}
.permission-member-meta{
  padding:5px 7px;
  border-radius:999px;
  color:#b7aaff;
  background:rgba(123,92,255,.12);
  font-size:10px;
  font-weight:800;
  white-space:nowrap;
}
.permission-member-editor-head{display:grid;gap:8px}
.permission-member-summary{
  padding:11px 12px;
  border-radius:16px;
}
.permission-member-summary h3{margin:2px 0;font-size:16px}
.permission-member-summary small{color:var(--hint)}
.individual-permission-list{
  display:grid;
  gap:1px;
  margin-top:9px;
  border-radius:15px;
  overflow:hidden;
  background:rgba(255,255,255,.04);
}
.individual-permission-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(112px,138px);
  align-items:center;
  gap:9px;
  padding:10px 11px;
  background:rgba(10,13,19,.76);
}
.individual-permission-select{
  width:100%;
  min-width:0;
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 7px;
  color:var(--text);
  background:var(--surface-2);
  font-size:11px;
}
.individual-permission-select.effective-allow{border-color:rgba(66,200,125,.38)}
.individual-permission-select.effective-deny{border-color:rgba(217,75,93,.32)}
.permission-reset{
  width:100%;
  margin-top:7px;
  color:var(--hint);
  background:rgba(255,255,255,.05);
}
@media(max-width:390px){
  .individual-permission-row{
    grid-template-columns:minmax(0,1fr) 112px;
    padding:9px;
  }
  .permission-member-meta{display:none}
  .permission-member-row{grid-template-columns:42px minmax(0,1fr) 18px}
}


/* v2.4.0 — community settings */
.settings-card{display:grid;gap:12px;padding:13px 14px;border-radius:17px}
.settings-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.settings-card-head h3{margin:2px 0 0;font-size:15px}
.settings-status{
  padding:5px 8px;border-radius:999px;
  color:var(--hint);background:rgba(255,255,255,.06);
  font-size:10px;font-weight:800;white-space:nowrap
}
.settings-status.connected{color:#6fe3a5;background:rgba(70,194,127,.12)}
.settings-field{display:grid;gap:6px}
.settings-field>span{color:var(--hint);font-size:11px;font-weight:700}
.settings-field input,
.settings-field textarea{
  box-sizing:border-box;width:100%;min-width:0;
  border:1px solid var(--border);border-radius:12px;
  padding:10px 11px;color:var(--text);
  background:rgba(8,12,18,.72);font:inherit
}
.settings-field textarea{resize:vertical;min-height:72px}
.settings-help{margin:0;color:var(--hint);font-size:11px;line-height:1.4}
.settings-number-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.settings-toggle-list{display:grid;gap:1px;border-radius:13px;overflow:hidden;background:rgba(255,255,255,.035)}
.settings-toggle-list label{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 11px;background:rgba(8,12,18,.7)
}
.settings-toggle-list span{font-size:13px;font-weight:700}
.settings-toggle-list input{width:20px;height:20px;accent-color:#8068ff}
.mini-switch{position:relative;display:inline-flex;align-items:center}
.mini-switch input{position:absolute;opacity:0;pointer-events:none}
.mini-switch span{
  width:42px;height:24px;border-radius:999px;
  background:rgba(255,255,255,.12);position:relative;transition:.18s
}
.mini-switch span::after{
  content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;
  border-radius:50%;background:#fff;transition:.18s
}
.mini-switch input:checked+span{background:#775cff}
.mini-switch input:checked+span::after{transform:translateX(18px)}
.settings-save{width:100%;margin-top:2px}
.settings-audit-section{margin-top:4px}
.settings-audit-list{display:grid;gap:7px}
.settings-audit-item{padding:10px 11px;border-radius:14px}
.settings-audit-item strong,.settings-audit-item small,.settings-audit-item p{display:block;margin:0}
.settings-audit-item strong{font-size:12px}
.settings-audit-item small{margin-top:2px;color:var(--hint);font-size:10px}
.settings-audit-item p{margin-top:5px;color:var(--hint);font-size:11px;line-height:1.35}
@media(max-width:390px){
  .settings-number-grid{grid-template-columns:1fr 1fr}
  .settings-number-grid .settings-field:last-child{grid-column:1/-1}
}

/* v2.5.0 — advanced moderation filters */
.settings-field select{
  box-sizing:border-box;width:100%;min-width:0;
  border:1px solid var(--border);border-radius:12px;
  padding:10px 11px;color:var(--text);
  background:rgba(8,12,18,.72);font:inherit
}
.advanced-filter-block{
  display:grid;gap:8px;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.06)
}
.advanced-filter-block:last-of-type{border-bottom:0}
.settings-toggle-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 11px;border-radius:13px;background:rgba(8,12,18,.7)
}
.settings-toggle-row>span{display:grid;gap:2px;min-width:0}
.settings-toggle-row strong{font-size:12px}
.settings-toggle-row small{font-size:10px;color:var(--hint);line-height:1.3}
.settings-toggle-row input{width:20px;height:20px;accent-color:#8068ff;flex:0 0 auto}
.staff-moderation-row{margin-top:4px}
.settings-help-box{
  padding:10px 11px;border-radius:12px;
  color:#c7beff;background:rgba(123,92,255,.09);
  font-size:11px;line-height:1.4
}

/* v2.6.0 — moderation reactions */
.reaction-config{
  display:grid;gap:7px;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,.06)
}
.reaction-config:last-of-type{border-bottom:0}


/* v2.7.0 — compact community settings */
.settings-compact-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.settings-compact-head h2{margin:2px 0 0;font-size:22px}

.settings-category-tabs{
  display:flex;
  gap:6px;
  overflow-x:auto;
  padding:2px 0 8px;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  position:sticky;
  top:0;
  z-index:5;
  background:var(--bg);
}
.settings-category-tabs::-webkit-scrollbar{display:none}
.settings-category-tab{
  flex:0 0 auto;
  border:1px solid rgba(255,255,255,.07);
  border-radius:999px;
  padding:7px 10px;
  color:var(--hint);
  background:rgba(255,255,255,.04);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.settings-category-tab.active{
  color:#fff;
  border-color:rgba(128,104,255,.55);
  background:rgba(128,104,255,.2);
}

.settings-panel{
  display:grid;
  gap:9px;
  padding-bottom:76px;
}
.settings-panel.hidden{display:none}

.compact-settings-card{
  gap:9px;
  padding:11px 12px;
}
.compact-settings-card .settings-card-head h3{font-size:14px}
.compact-settings-card .settings-field input,
.compact-settings-card .settings-field textarea,
.compact-settings-card .settings-field select{
  padding:8px 9px;
  border-radius:10px;
  font-size:12px;
}
.compact-settings-card .settings-field textarea{min-height:58px}

.compact-command-row{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.compact-command-row code{
  padding:5px 7px;
  border-radius:8px;
  background:rgba(123,92,255,.1);
  color:#c9c1ff;
  font-size:10px;
}

.reaction-details{
  border:1px solid rgba(255,255,255,.06);
  border-radius:12px;
  overflow:hidden;
  background:rgba(8,12,18,.55);
}
.reaction-details summary{
  cursor:pointer;
  list-style:none;
  padding:9px 10px;
  font-size:12px;
  font-weight:800;
}
.reaction-details summary::-webkit-details-marker{display:none}
.reaction-details-body{
  display:grid;
  gap:8px;
  padding:0 10px 10px;
}

.settings-sticky-save{
  position:sticky;
  bottom:72px;
  z-index:6;
  padding-top:7px;
  background:linear-gradient(to top,var(--bg) 70%,transparent);
}
.settings-sticky-save .settings-save{
  box-shadow:0 8px 28px rgba(0,0,0,.28);
}

@media(max-width:390px){
  .settings-category-tab{padding:6px 9px;font-size:10px}
  .compact-settings-card{padding:10px}
}

/* v2.8.0 */
.connected-chat-card{
  display:grid;
  grid-template-columns:46px minmax(0,1fr);
  gap:10px;
  align-items:center;
  padding:9px 10px;
  border-radius:13px;
  background:rgba(123,92,255,.08);
}
.connected-chat-avatar{
  width:46px;height:46px;border-radius:14px;object-fit:cover;
  background:rgba(255,255,255,.08)
}
.connected-chat-copy{display:grid;gap:2px;min-width:0}
.connected-chat-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.connected-chat-copy small{color:var(--hint);font-size:10px}

.template-help{
  display:grid;gap:7px;
  padding:9px 10px;
  border-radius:12px;
  background:rgba(123,92,255,.07)
}
.template-help>strong{font-size:11px}
.template-chip-row{
  display:grid;
  grid-template-columns:max-content minmax(0,1fr);
  gap:5px 8px;
  align-items:center;
}
.template-chip-row code{
  padding:3px 6px;border-radius:7px;
  color:#d2caff;background:rgba(123,92,255,.13);
  font-size:10px
}
.template-chip-row span{color:var(--hint);font-size:10px;line-height:1.25}

/* v2.8.1 — human duration editor */
.duration-editor{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
}
.duration-editor label{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:3px;
  min-width:0;
  padding:6px;
  border:1px solid var(--border);
  border-radius:9px;
  background:rgba(8,12,18,.72);
}
.duration-editor input{
  width:100%!important;
  min-width:0;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  text-align:right;
}
.duration-editor span{color:var(--hint);font-size:9px}
@media(max-width:390px){
  .duration-editor{grid-template-columns:1fr 1fr}
}

/* v2.8.2 — chat title + readable duration editor */

/* Полное название подключённого Telegram-чата */
.connected-chat-copy strong{
  display:block;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
  line-height:1.25;
}
.connected-chat-copy small{
  white-space:normal;
  overflow-wrap:anywhere;
}

/* Редактор времени: 2×2 вместо четырёх крошечных ячеек */
.duration-editor{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:7px !important;
}
.duration-editor label{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:4px !important;
  min-width:0 !important;
  padding:7px 8px !important;
  border:1px solid var(--border) !important;
  border-radius:10px !important;
  background:rgba(8,12,18,.72) !important;
}
.duration-editor label > span{
  order:0;
  display:block;
  color:var(--hint) !important;
  font-size:10px !important;
  line-height:1.15 !important;
}
.duration-editor label > input{
  order:1;
  display:block !important;
  box-sizing:border-box !important;
  width:100% !important;
  min-width:0 !important;
  height:34px !important;
  padding:5px 7px !important;
  border:1px solid rgba(255,255,255,.08) !important;
  border-radius:8px !important;
  background:rgba(0,0,0,.18) !important;
  color:var(--text) !important;
  font-size:16px !important;
  font-weight:800 !important;
  line-height:1 !important;
  text-align:center !important;
  appearance:auto !important;
  -webkit-appearance:auto !important;
}
@media(min-width:700px){
  .duration-editor{
    grid-template-columns:repeat(4,minmax(90px,1fr)) !important;
  }
}

/* =========================================================
   v2.9.0 — compact settings layout redesign
   ========================================================= */

/* Cards are denser and don't reserve phantom space */
.compact-settings-card{
  padding:11px 12px !important;
  gap:10px !important;
}
.compact-settings-card .settings-field{
  gap:5px !important;
}
.compact-settings-card .settings-field > span{
  min-height:0 !important;
  line-height:1.2 !important;
}

/* Two genuinely useful columns, no third tiny duration column */
.compact-two-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  align-items:end;
}
.compact-two-grid .settings-field{
  min-width:0;
}
.compact-two-grid input,
.compact-two-grid select{
  height:38px;
}

/* Duration always gets the whole row */
.duration-field{
  width:100%;
  min-width:0;
}
.duration-editor{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:6px !important;
  width:100% !important;
}
.duration-editor label{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:3px !important;
  min-width:0 !important;
  padding:6px 6px !important;
  border:1px solid var(--border) !important;
  border-radius:9px !important;
  background:rgba(8,12,18,.72) !important;
}
.duration-editor label > span{
  display:block !important;
  order:0 !important;
  min-width:0;
  color:var(--hint) !important;
  font-size:9px !important;
  line-height:1 !important;
  text-align:center;
  white-space:nowrap;
}
.duration-editor label > input{
  order:1 !important;
  display:block !important;
  box-sizing:border-box !important;
  width:100% !important;
  min-width:0 !important;
  height:28px !important;
  padding:2px 3px !important;
  margin:0 !important;
  border:0 !important;
  border-radius:6px !important;
  background:rgba(255,255,255,.035) !important;
  color:#fff !important;
  font-size:15px !important;
  font-weight:800 !important;
  line-height:1 !important;
  text-align:center !important;
  -moz-appearance:textfield;
}
.duration-editor input::-webkit-outer-spin-button,
.duration-editor input::-webkit-inner-spin-button{
  margin:0;
}

/* Antiflood layout */
#settings-panel-antiflood .settings-card{
  overflow:visible;
}
#settings-panel-antiflood .settings-card-head{
  margin-bottom:0;
}
#settings-panel-antiflood .settings-field textarea{
  min-height:62px;
}

/* Warning layout */
.warning-settings-card{
  gap:11px !important;
}
.warning-top-grid{
  align-items:end;
}
.warning-top-grid .settings-field > span{
  min-height:26px !important;
}
.compact-help-box{
  margin-top:1px;
  padding:9px 10px !important;
}

/* Connected chat — compact and uses horizontal space efficiently */
.connected-chat-card{
  grid-template-columns:42px minmax(0,1fr) !important;
  gap:9px !important;
  padding:9px 10px !important;
}
.connected-chat-avatar{
  width:42px !important;
  height:42px !important;
  border-radius:12px !important;
}
.connected-chat-copy{
  min-width:0;
}
.connected-chat-copy strong{
  display:block !important;
  width:100%;
  max-width:none !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:clip !important;
  font-size:14px;
  line-height:1.2;
}
.connected-chat-copy small{
  white-space:nowrap !important;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* On very narrow phones keep 4 duration cells; only shrink text */
@media(max-width:390px){
  .duration-editor{
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    gap:4px !important;
  }
  .duration-editor label{
    padding:5px 3px !important;
  }
  .duration-editor label > span{
    font-size:8px !important;
  }
  .duration-editor label > input{
    font-size:14px !important;
    height:27px !important;
  }
  .compact-two-grid{
    gap:6px;
  }
}

/* Desktop keeps the same compact structure instead of stretching fields */
@media(min-width:700px){
  .compact-settings-card{
    max-width:760px;
  }
  .duration-editor{
    grid-template-columns:repeat(4,minmax(90px,120px)) !important;
    justify-content:start;
  }
}

/* v2.9.1 — connected chat must never truncate */
.connected-chat-card{
  grid-template-columns:42px minmax(0,1fr) !important;
  align-items:start !important;
  height:auto !important;
  min-height:0 !important;
  overflow:visible !important;
}
.connected-chat-copy{
  width:100% !important;
  min-width:0 !important;
  overflow:visible !important;
}
.connected-chat-copy strong{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:unset !important;
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
  font-size:14px !important;
  line-height:1.25 !important;
}
.connected-chat-copy small{
  display:block !important;
  width:100% !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:unset !important;
  overflow-wrap:anywhere !important;
  word-break:break-all !important;
  font-size:10px !important;
  line-height:1.25 !important;
}

/* Chat commands: command + explanation instead of unexplained chips */
.chat-command-help{
  display:grid;
  gap:5px;
}
.chat-command-help > div{
  display:grid;
  grid-template-columns:max-content minmax(0,1fr);
  align-items:start;
  gap:7px;
  padding:6px 7px;
  border-radius:9px;
  background:rgba(123,92,255,.055);
}
.chat-command-help code{
  color:#cfc7ff;
  font-size:10px;
  white-space:nowrap;
}
.chat-command-help span{
  color:var(--hint);
  font-size:10px;
  line-height:1.3;
  min-width:0;
}

/* Rules editor */
#setting-rules-text{
  min-height:180px;
  line-height:1.45;
}

/* v2.9.2 — connected chat flex layout */
.connected-chat-card{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:10px !important;
  width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}
.connected-chat-avatar{
  flex:0 0 42px !important;
  width:42px !important;
  height:42px !important;
}
.connected-chat-copy{
  display:flex !important;
  flex:1 1 0% !important;
  min-width:0 !important;
  width:auto !important;
  max-width:none !important;
  flex-direction:column !important;
  gap:2px !important;
}
.connected-chat-copy strong{
  display:block !important;
  flex:0 1 auto !important;
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
  white-space:nowrap !important;
  overflow:visible !important;
  text-overflow:clip !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  line-height:1.15 !important;
}
.connected-chat-copy small{
  display:block !important;
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
  white-space:nowrap !important;
  overflow:visible !important;
  text-overflow:clip !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
}

/* Voice range */
.voice-duration-range{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
.voice-duration-range.hidden{display:none}
@media(max-width:390px){
  .voice-duration-range{
    grid-template-columns:1fr;
  }
}

/* v3.0.0 — community notes */
.note-add-button{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:12px;
  color:#fff;
  background:#8068ff;
  font-size:24px;
  line-height:1;
}
.community-notes-list{
  display:grid;
  gap:7px;
}
.community-note-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 38px;
  gap:6px;
  align-items:stretch;
}
.community-note-open{
  display:grid;
  grid-template-columns:30px minmax(0,1fr) 18px;
  align-items:center;
  gap:7px;
  min-width:0;
  padding:9px 10px;
  border:1px solid rgba(255,255,255,.06);
  border-radius:13px;
  color:var(--text);
  background:rgba(8,12,18,.72);
  text-align:left;
}
.community-note-copy{
  display:grid;
  gap:2px;
  min-width:0;
}
.community-note-copy strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}
.community-note-copy small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--hint);
  font-size:10px;
}
.community-note-delete{
  border:0;
  border-radius:12px;
  color:#ff8f9b;
  background:rgba(217,75,93,.1);
  font-size:20px;
}
.community-note-editor{
  display:grid;
  gap:10px;
}
.community-note-editor-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.community-note-editor-head strong{
  font-size:14px;
}
#community-note-text{
  min-height:170px;
  line-height:1.45;
}

/* v3.1.0 — notes drag + images */
.community-note-row{
  grid-template-columns:34px minmax(0,1fr) 38px !important;
}
.community-note-drag{
  border:0;
  border-radius:11px;
  color:var(--hint);
  background:rgba(255,255,255,.045);
  font-size:18px;
  touch-action:none;
  cursor:grab;
}
.community-note-row.dragging{
  opacity:.68;
  transform:scale(.985);
}
.note-dragging{
  user-select:none;
}
.note-image-section{
  display:grid;
  gap:7px;
}
.note-image-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.note-image-head>span{
  color:var(--hint);
  font-size:11px;
  font-weight:700;
}
.note-image-add{
  position:relative;
  overflow:hidden;
  padding:6px 9px;
  border-radius:9px;
  color:#d1c9ff;
  background:rgba(123,92,255,.12);
  font-size:10px;
  font-weight:800;
}
.note-image-add input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
.note-image-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
}
.note-image-grid:empty{display:none}
.note-image-thumb{
  position:relative;
  aspect-ratio:1/1;
  overflow:hidden;
  border-radius:10px;
  background:rgba(255,255,255,.05);
}
.note-image-thumb img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.note-image-thumb button{
  position:absolute;
  top:3px;
  right:3px;
  width:24px;
  height:24px;
  border:0;
  border-radius:8px;
  color:#fff;
  background:rgba(0,0,0,.72);
  font-size:18px;
  line-height:1;
}
.note-image-section>small{
  color:var(--hint);
  font-size:10px;
}
@media(max-width:390px){
  .note-image-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* v3.1.1 — settings categories wrap instead of horizontal scrolling */
.settings-category-tabs{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:6px !important;
  overflow:visible !important;
  overflow-x:visible !important;
  padding:2px 0 8px !important;
  position:static !important;
  scrollbar-width:auto !important;
  background:transparent !important;
}
.settings-category-tab{
  flex:0 0 auto !important;
  min-width:0 !important;
}
.settings-category-tabs::-webkit-scrollbar{
  display:none !important;
}

/* Make rows compact on phone */
@media(max-width:480px){
  .settings-category-tabs{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }
  .settings-category-tab{
    width:100% !important;
    padding:7px 5px !important;
    font-size:10px !important;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}

/* v3.2.0 — numeric note ordering */
.community-note-row{
  grid-template-columns:46px minmax(0,1fr) 38px !important;
  gap:6px !important;
}
.community-note-position-input{
  box-sizing:border-box;
  width:46px;
  min-width:46px;
  height:100%;
  min-height:52px;
  padding:4px 3px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:11px;
  color:#fff;
  background:rgba(255,255,255,.045);
  text-align:center;
  font-size:14px;
  font-weight:900;
}
.community-note-drag{
  display:none !important;
}
.note-editor-top-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 78px;
  gap:8px;
  align-items:end;
}
.note-position-field input{
  text-align:center;
  font-weight:900;
}
@media(max-width:390px){
  .note-editor-top-grid{
    grid-template-columns:minmax(0,1fr) 68px;
  }
}

/* v3.3.0 */
.welcome-buttons-list{display:grid;gap:7px}
.simple-extra-row{grid-template-columns:minmax(0,1fr) 38px !important}
.static-row{cursor:default}
.welcome-button-preview-image{
  width:110px;height:110px;object-fit:cover;border-radius:12px;display:block
}
#subscription-restrict-wrap{display:grid;gap:9px}
#subscription-restrict-wrap.hidden{display:none}

/* v3.4.0 — native Telegram channel picker */
.telegram-channel-picker-button{
  width:100%;
  min-height:44px;
}

/* v3.5.0 — personal member restrictions */
.personal-restrictions-sheet{
  max-height:92vh;
  overflow-y:auto;
}
.personal-restriction-options{
  display:grid;
  gap:7px;
}
.personal-restriction-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
}
.personal-restriction-status{
  display:grid;
  gap:5px;
}
.personal-restriction-status strong{
  font-size:13px;
}
.personal-restriction-status small{
  color:var(--hint);
  font-size:10px;
}
.personal-restriction-status p{
  margin:0;
  color:var(--hint);
  font-size:11px;
}
.personal-forever-row{
  margin-top:2px;
}
#personal-restrictions-button{
  grid-column:1 / -1;
}

/* v3.6.0 — personal restriction card fix + chat rating */
.personal-restriction-status{
  gap:8px !important;
}
.personal-restriction-chips{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.personal-restriction-chips span{
  padding:5px 7px;
  border-radius:999px;
  background:rgba(128,104,255,.12);
  color:#ded9ff;
  font-size:10px;
  font-weight:800;
  line-height:1.2;
}
.personal-restriction-meta,
.personal-restriction-reason{
  color:var(--hint);
  font-size:10px;
  line-height:1.35;
  overflow-wrap:anywhere;
}

.chat-rating-home{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:3px 8px;
  align-items:center;
  width:100%;
  margin-bottom:10px;
  text-align:left;
}
.chat-rating-home span{
  font-size:11px;
  font-weight:800;
}
.chat-rating-home strong{
  grid-row:1 / span 2;
  grid-column:2;
  font-size:20px;
}
.chat-rating-home small{
  color:var(--hint);
  white-space:normal;
  overflow-wrap:anywhere;
}

.member-chat-rating-card{
  display:grid;
  gap:10px;
}
.member-chat-rating-main{
  display:grid;
  gap:4px;
}
.member-chat-rating-main strong{
  font-size:24px;
}
.member-chat-rating-main small{
  color:var(--hint);
  line-height:1.3;
}
.member-chat-rating-actions{
  display:grid;
  grid-template-columns:56px minmax(0,1fr) 56px;
  gap:7px;
}
.member-chat-rating-actions button{
  min-height:38px;
  border:1px solid rgba(128,104,255,.2);
  border-radius:10px;
  background:rgba(128,104,255,.08);
  color:var(--text);
  font-weight:800;
}
.member-chat-rating-actions button:disabled{
  opacity:.35;
}

.chat-rating-sheet{
  max-height:92vh;
  overflow-y:auto;
}
.chat-rating-big{
  display:grid;
  gap:9px;
  padding:12px;
  border-radius:14px;
  background:rgba(128,104,255,.08);
}
.chat-rating-big>strong{
  font-size:30px;
}
.rating-limit-list{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.rating-limit-chip{
  padding:5px 7px;
  border-radius:999px;
  background:rgba(255,184,77,.11);
  color:#ffdba0;
  font-size:10px;
  font-weight:800;
}
.rating-limit-empty{
  color:var(--hint);
  font-size:11px;
}
.chat-rating-admin-editor{
  display:grid;
  gap:8px;
}
.rating-history-item{
  display:grid;
  gap:5px;
}
.rating-history-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.rating-history-head strong{
  font-size:14px;
}
.rating-history-head span{
  color:#bdb3ff;
  font-size:10px;
}
.rating-history-item p{
  margin:0;
  font-size:11px;
}
.rating-history-item small{
  color:var(--hint);
  font-size:10px;
}

/* =========================================================
   v3.6.1 — compact chat rating UI
   ========================================================= */

.chat-rating-home{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:4px !important;
  padding:9px 11px !important;
  margin-bottom:9px !important;
  text-align:left !important;
}
.chat-rating-home-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-width:0;
}
.chat-rating-home-head span{
  min-width:0;
  font-size:11px !important;
  font-weight:800;
  white-space:nowrap;
}
.chat-rating-home-head strong{
  position:static !important;
  grid-row:auto !important;
  grid-column:auto !important;
  flex:0 0 auto;
  font-size:18px !important;
  line-height:1;
}
.chat-rating-home>small{
  display:block;
  width:100%;
  min-width:0;
  color:var(--hint);
  font-size:10px;
  line-height:1.25;
  white-space:normal !important;
  overflow-wrap:anywhere;
}

/* Member rating is no longer a big 3-column control. */
.member-chat-rating-card{
  display:grid !important;
  gap:9px !important;
  padding:10px !important;
}
.member-chat-rating-top{
  display:flex;
  align-items:baseline;
  gap:2px;
  min-width:0;
}
.member-chat-rating-top>strong{
  font-size:28px;
  line-height:1;
}
.member-chat-rating-top>span{
  color:var(--hint);
  font-size:13px;
  font-weight:700;
}
.member-chat-rating-top>#member-rating-details{
  margin-left:auto;
  min-height:30px;
  padding:5px 10px;
  border:1px solid rgba(128,104,255,.18);
  border-radius:9px;
  background:rgba(128,104,255,.07);
  color:#d8d1ff;
  font-size:10px;
  font-weight:800;
}

.member-rating-limit-list{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  min-width:0;
}
.member-rating-limit-list .rating-limit-chip{
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}
.member-rating-limit-list .rating-limit-empty{
  font-size:10px;
}

.member-chat-rating-vote{
  display:grid;
  grid-template-columns:36px minmax(0,1fr) 36px;
  gap:7px;
  align-items:center;
}
.member-chat-rating-vote>button{
  width:36px;
  height:34px;
  min-height:34px !important;
  padding:0 !important;
  border:1px solid rgba(128,104,255,.18);
  border-radius:10px;
  background:rgba(128,104,255,.07);
  color:#a992ff;
  font-size:20px;
  font-weight:700;
  line-height:1;
}
.member-chat-rating-vote>span{
  min-width:0;
  color:var(--hint);
  font-size:9px;
  line-height:1.2;
  text-align:center;
  white-space:normal;
}
.member-chat-rating-vote>button:disabled{
  opacity:.28;
}

/* Remove old layout rules from influencing the new structure. */
.member-chat-rating-main,
.member-chat-rating-actions{
  display:none !important;
}

/* Personal restriction chips: more readable and less cramped. */
.personal-restriction-chips{
  gap:6px !important;
}
.personal-restriction-chips span{
  padding:6px 8px !important;
  font-size:10px !important;
  line-height:1.15 !important;
}
.personal-restriction-meta,
.personal-restriction-reason{
  font-size:10px !important;
  line-height:1.4 !important;
}

/* =========================================================
   v3.7.0 — compact mobile UI redesign
   ========================================================= */

/* General density */
#home-page,
#member-page{
  padding-bottom:10px;
}
#home-page .section,
#member-page .section{
  margin-top:10px;
}
#home-page .section-heading,
#member-page .section-heading{
  margin-bottom:7px;
}
#home-page .section-heading h2,
#member-page .section-heading h2{
  font-size:16px;
}
#home-page .eyebrow,
#member-page .eyebrow{
  margin-bottom:2px;
  font-size:9px;
}

/* ---------------- HOME / PERSONAL CABINET ---------------- */

/* Smaller identity card */
#home-page .profile-card{
  gap:10px;
  padding:11px 12px;
  border-radius:16px;
}
#home-page .profile-card .avatar{
  width:54px;
  height:54px;
  flex:0 0 54px;
  border-radius:16px;
}
#home-page .profile-copy h2{
  margin:1px 0 1px;
  font-size:18px;
  line-height:1.08;
}
#home-page .profile-copy p{
  margin:0 0 5px;
  font-size:11px;
}
#home-page .role-badge{
  padding:4px 7px;
  font-size:9px;
}
#home-page .staff-rating-inline{
  padding:4px 7px;
  font-size:9px;
}

/* Rating becomes a thin status row */
#home-page .chat-rating-home{
  padding:8px 10px !important;
  margin:7px 0 !important;
  border-radius:14px !important;
  gap:2px !important;
}
#home-page .chat-rating-home-head span{
  font-size:10px !important;
}
#home-page .chat-rating-home-head strong{
  font-size:16px !important;
}
#home-page .chat-rating-home>small{
  font-size:9px !important;
}

/* Four huge cards -> compact 2x2 status tiles */
#home-page .quick-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin-top:7px;
}
#home-page .quick-card{
  display:flex !important;
  align-items:center;
  gap:8px !important;
  min-height:58px !important;
  padding:9px 10px !important;
  border-radius:14px;
}
#home-page .quick-card .quick-icon{
  display:grid;
  place-items:center;
  flex:0 0 30px;
  width:30px;
  height:30px;
  border-radius:10px;
  background:rgba(128,104,255,.08);
  font-size:16px;
}
#home-page .quick-copy{
  display:grid;
  min-width:0;
  gap:2px;
  text-align:left;
}
#home-page .quick-copy small{
  font-size:9px !important;
  line-height:1.1;
}
#home-page .quick-copy strong{
  min-width:0;
  overflow:hidden;
  font-size:12px;
  line-height:1.15;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Communities start sooner */
#home-page .community-list{
  gap:6px;
}
#home-page .community{
  padding:11px 12px;
  border-radius:14px;
}

/* ---------------- MEMBER CARD / MODERATION ---------------- */

#member-page #back-community{
  margin-bottom:3px;
  font-size:11px;
}
#member-page .member-profile-card{
  gap:10px;
  padding:10px 11px;
  border-radius:16px;
}
#member-page .avatar-lg{
  width:56px;
  height:56px;
  flex:0 0 56px;
  border-radius:17px;
}
#member-page .member-profile-copy h2{
  margin:1px 0;
  font-size:17px;
  line-height:1.1;
}
#member-page .member-profile-copy p{
  margin:0 0 4px;
  font-size:10px;
}
#member-page .member-profile-role,
#member-page .role-badge{
  padding:4px 7px;
  font-size:9px;
}

/* Member metadata is informative, not a collection of giant cards */
#member-page .detail-grid{
  gap:6px;
  margin-top:7px;
}
#member-page .detail-card{
  min-height:48px !important;
  padding:7px 9px !important;
  gap:2px !important;
  border-radius:12px;
}
#member-page .detail-card span{
  font-size:8px !important;
  line-height:1.1;
}
#member-page .detail-card strong{
  font-size:10px;
  line-height:1.15;
}
#member-page .member-summary-grid{
  margin-top:6px;
}
#member-page .member-summary-grid .detail-card{
  min-height:42px !important;
}

/* Rating panel is now an information strip, not a large standalone card */
#member-page #chat-rating-section{
  margin-top:9px;
}
#member-page #chat-rating-section .section-heading{
  margin-bottom:5px;
}
#member-page .member-chat-rating-card{
  gap:6px !important;
  padding:8px 9px !important;
  border-radius:14px;
}
#member-page .member-chat-rating-top>strong{
  font-size:22px !important;
}
#member-page .member-chat-rating-top>span{
  font-size:10px !important;
}
#member-page .member-chat-rating-top>#member-rating-details{
  min-height:26px !important;
  padding:4px 8px !important;
  font-size:9px !important;
}
#member-page .member-rating-limit-list{
  gap:4px;
}
#member-page .rating-limit-chip{
  padding:4px 6px;
  font-size:8px;
}
#member-page .member-chat-rating-vote{
  grid-template-columns:30px minmax(0,1fr) 30px !important;
  gap:5px !important;
}
#member-page .member-chat-rating-vote>button{
  width:30px !important;
  height:28px !important;
  min-height:28px !important;
  border-radius:8px !important;
  font-size:17px !important;
}
#member-page .member-chat-rating-vote>span{
  font-size:8px !important;
}

/* Personal restrictions: readable but short */
#member-page .personal-restriction-status{
  padding:8px 9px;
  border-radius:14px;
  gap:6px !important;
}
#member-page .personal-restriction-chips{
  gap:4px !important;
}
#member-page .personal-restriction-chips span{
  padding:4px 6px !important;
  font-size:8px !important;
}
#member-page .personal-restriction-meta,
#member-page .personal-restriction-reason{
  font-size:8px !important;
}

/* Moderator actions: 5 huge buttons -> small control panel */
#member-page #management-section{
  margin-top:9px;
}
#member-page #management-section .section-heading{
  margin-bottom:5px;
}
#member-page .action-grid{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:6px !important;
}
#member-page .action-card{
  display:flex !important;
  align-items:center;
  justify-content:center;
  gap:5px !important;
  min-height:40px !important;
  padding:6px 5px !important;
  border:1px solid rgba(255,255,255,.06);
  border-radius:11px !important;
  background:rgba(255,255,255,.035);
  font-size:10px !important;
  line-height:1 !important;
}
#member-page .action-card>span{
  font-size:12px;
}
#member-page .action-card>strong{
  min-width:0;
  font-size:9px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#member-page #personal-restrictions-button{
  grid-column:span 2 !important;
}

/* History items fit more per screen */
#member-page .history-list{
  gap:6px;
}
#member-page .history-item{
  padding:9px 10px;
  border-radius:12px;
}
#member-page .history-item p{
  margin:2px 0;
  font-size:9px;
}
#member-page .history-item strong{
  font-size:10px;
}
#member-page .history-item small{
  font-size:8px;
}

/* ---------------- RATING SHEET ---------------- */

.chat-rating-sheet{
  max-height:90vh !important;
  padding:8px 10px 14px !important;
}
.chat-rating-sheet .sheet-handle{
  margin-bottom:8px;
}
.chat-rating-sheet .sheet-heading{
  align-items:center;
}
.chat-rating-sheet .sheet-heading h2{
  font-size:18px;
}
.chat-rating-sheet .icon-button{
  width:32px;
  height:32px;
  font-size:20px;
}
.chat-rating-big{
  padding:9px 10px !important;
  gap:6px !important;
  border-radius:13px !important;
}
.chat-rating-big>strong{
  font-size:25px !important;
}
.chat-rating-sheet .rating-limit-list{
  gap:4px;
}
.chat-rating-sheet .rating-limit-chip{
  padding:4px 6px;
  font-size:8px;
}

/* Admin edit is a compact utility panel */
.chat-rating-admin-editor{
  grid-template-columns:88px minmax(0,1fr);
  gap:6px 7px !important;
  padding:8px !important;
  border-radius:13px;
}
.chat-rating-admin-editor>.eyebrow{
  grid-column:1 / -1;
  margin-bottom:0;
}
.chat-rating-admin-editor .settings-field{
  gap:3px;
}
.chat-rating-admin-editor .settings-field>span{
  font-size:8px;
}
.chat-rating-admin-editor input{
  min-height:34px;
  padding:7px 8px;
  font-size:11px;
}
#save-chat-rating-manual{
  grid-column:1 / -1;
  padding:9px 10px;
  border-radius:10px;
  font-size:11px;
}

.chat-rating-sheet>.section-heading{
  margin-top:9px;
  margin-bottom:5px;
}
.chat-rating-sheet>.section-heading h2{
  font-size:15px;
}
.rating-history-item{
  gap:3px !important;
  padding:8px 9px !important;
  border-radius:12px;
}
.rating-history-head strong{
  font-size:11px !important;
}
.rating-history-head span{
  font-size:8px !important;
}
.rating-history-item p{
  font-size:9px !important;
}
.rating-history-item small{
  font-size:8px !important;
  line-height:1.2;
}

/* Extra narrow phones */
@media(max-width:360px){
  #member-page .action-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  #member-page #personal-restrictions-button{
    grid-column:1 / -1 !important;
  }
  .chat-rating-admin-editor{
    grid-template-columns:1fr;
  }
  .chat-rating-admin-editor>.eyebrow,
  #save-chat-rating-manual{
    grid-column:auto;
  }
}

/* v3.7.1 — action icon cleanup + golden rating */
#member-page .action-card>strong{
  font-size:10px !important;
}
#member-page .action-card>span{
  display:none !important;
}

.golden-rating-row{
  grid-column:1 / -1;
  padding:8px 9px;
  border:1px solid rgba(255,196,61,.25);
  border-radius:11px;
  background:rgba(255,196,61,.07);
}
.golden-rating-row>span{
  display:grid;
  gap:2px;
}
.golden-rating-row strong{
  color:#ffd86a;
  font-size:10px;
}
.golden-rating-row small{
  color:var(--hint);
  font-size:8px;
  line-height:1.3;
}

/* v3.8.0 — personal restriction indicator in member list */
.restriction-personal{
  background:rgba(116,96,255,.14) !important;
  color:#c6bcff !important;
}

/* v3.9.0 — member description */
.member-description-card{
  margin-top:7px;
  padding:8px 10px;
  border-radius:13px;
}
.member-description-card p{
  margin:3px 0 0;
  color:var(--text);
  font-size:10px;
  line-height:1.4;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

/* v3.9.1 — home punishment status */
#home-page .quick-card:nth-child(4) .quick-copy strong{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  line-height:1.18 !important;
  overflow-wrap:anywhere;
}

/* =========================================================
   v4.0.0 — Awards
   ========================================================= */
.compact-section-button{
  min-width:54px;
  min-height:30px;
  padding:5px 9px;
  border:1px solid rgba(128,104,255,.18);
  border-radius:10px;
  background:rgba(128,104,255,.08);
  color:#d9d2ff;
  font-size:10px;
  font-weight:800;
}
.awards-sheet,
.award-create-sheet{
  max-height:92vh;
  overflow-y:auto;
}
.awards-list{
  display:grid;
  gap:7px;
}
.award-card{
  position:relative;
  display:grid;
  grid-template-columns:62px minmax(0,1fr) 28px;
  gap:9px;
  align-items:center;
  padding:9px;
  border-radius:14px;
}
.award-card-trophy{
  width:62px;
  height:62px;
  object-fit:contain;
}
.award-card-copy{
  display:grid;
  min-width:0;
  gap:3px;
}
.award-card-copy strong{
  font-size:12px;
  line-height:1.2;
}
.award-card-copy p{
  margin:0;
  font-size:9px;
  line-height:1.35;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.award-card-copy small{
  color:var(--hint);
  font-size:8px;
}
.award-delete{
  align-self:start;
  width:28px;
  height:28px;
  border:1px solid rgba(255,89,89,.2);
  border-radius:9px;
  background:rgba(255,89,89,.08);
  color:#ff8585;
  font-size:16px;
}
.award-trophy-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
}
.award-trophy-grid button{
  display:grid;
  place-items:center;
  aspect-ratio:1;
  min-width:0;
  padding:5px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:12px;
  background:rgba(255,255,255,.025);
}
.award-trophy-grid button.selected{
  border-color:#8f78ff;
  background:rgba(128,104,255,.16);
  box-shadow:0 0 0 1px rgba(128,104,255,.22) inset;
}
.award-trophy-grid img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
}
.award-create-sheet textarea{
  min-height:90px;
}

/* =========================================================
   v4.0.1 — Compact awards + rating UI
   ========================================================= */

.member-achievements-section{
  margin-top:10px;
}

.member-achievement-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.member-achievement-card{
  position:relative;
  min-width:0;
  min-height:82px;
  padding:10px;
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 14px;
  align-items:center;
  gap:7px;
  text-align:left;
  border-radius:15px;
}

.member-achievement-icon{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:11px;
  background:rgba(128,104,255,.12);
  font-size:17px;
}

.member-achievement-copy{
  min-width:0;
  display:grid;
  gap:2px;
}

.member-achievement-copy small{
  color:var(--hint);
  font-size:8px;
  line-height:1.1;
}

.member-achievement-copy strong{
  display:flex;
  align-items:baseline;
  gap:2px;
  font-size:20px;
  line-height:1;
  white-space:nowrap;
}

.member-achievement-copy strong b{
  font-size:9px;
  color:var(--hint);
  font-weight:700;
}

.member-achievement-copy em{
  min-width:0;
  font-style:normal;
  color:#bcb4dc;
  font-size:7.5px;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.member-achievement-arrow{
  color:#8f78ff;
  font-size:22px;
  line-height:1;
}

.member-chat-rating-compact{
  margin-top:8px;
  padding:7px 9px;
  border-radius:13px;
}

.member-chat-rating-compact .member-rating-limit-list{
  min-height:0;
  margin:0 0 6px;
  padding:0;
  font-size:8px;
}

.compact-rating-vote{
  display:grid !important;
  grid-template-columns:34px 1fr 34px;
  gap:7px;
  align-items:center;
  margin:0 !important;
}

.compact-rating-vote button{
  width:34px !important;
  height:28px !important;
  min-width:34px !important;
  min-height:28px !important;
  padding:0 !important;
  border-radius:9px !important;
  font-size:15px !important;
}

.compact-rating-vote span{
  font-size:7.5px !important;
  text-align:center;
  white-space:nowrap;
}

.award-create-sheet{
  padding-bottom:max(16px, env(safe-area-inset-bottom));
}

.award-create-sheet .form-group,
.award-create-sheet .settings-field{
  margin-bottom:10px;
}

.award-submit-button{
  width:100% !important;
  min-width:100% !important;
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  margin-top:12px !important;
  min-height:46px !important;
  border-radius:14px !important;
  font-size:13px !important;
  font-weight:900 !important;
}

.award-trophy-grid{
  gap:7px;
}

.award-trophy-grid button{
  padding:7px;
  border-radius:13px;
}

@media (max-width:380px){
  .member-achievement-card{
    grid-template-columns:30px minmax(0,1fr) 12px;
    min-height:76px;
    padding:8px;
  }
  .member-achievement-icon{
    width:30px;
    height:30px;
    font-size:15px;
  }
  .member-achievement-copy strong{
    font-size:17px;
  }
}


/* RP commands */
.rp-toolbar{display:flex;align-items:center;justify-content:space-between;margin:12px 0 8px}
.rp-command-list{display:flex;flex-direction:column;gap:7px}
.rp-command-row{display:grid;grid-template-columns:minmax(0,1fr) 42px 36px;gap:7px;align-items:center;background:#0b0b0d;border:1px solid rgba(255,255,255,.07);border-radius:14px;padding:6px}
.rp-command-main{min-width:0;display:flex;align-items:center;gap:9px;background:transparent;border:0;color:inherit;text-align:left;padding:4px;cursor:pointer}
.rp-command-icon{width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:rgba(126,91,239,.14)}
.rp-command-copy{min-width:0;display:flex;flex-direction:column;gap:2px}
.rp-command-copy strong{font-size:13px}
.rp-command-copy small{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rp-row-switch{justify-self:center}
.rp-delete{width:32px;height:32px;border:0;border-radius:9px;background:rgba(255,71,87,.12);color:#ff6675;font-size:19px}
.rp-enabled-row{display:flex;align-items:center;justify-content:space-between}
.rp-image-preview{min-height:0;margin:8px 0}
.rp-image-preview img{display:block;max-width:150px;max-height:110px;object-fit:cover;border-radius:12px;border:1px solid rgba(255,255,255,.08)}

/* v4.1.1 — RP built-in commands */
.rp-command-copy strong{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.rp-base-badge{
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
  padding:2px 5px;
  border-radius:6px;
  background:rgba(126,91,239,.13);
  color:#b7a7ff;
  font-size:7px;
  line-height:1.1;
  font-style:normal;
  font-weight:800;
  text-transform:uppercase;
}
.rp-base-help{
  padding:7px 9px;
  border-radius:9px;
  background:rgba(126,91,239,.08);
  color:#c8bfff;
}

/* v4.1.2 — RP command list visibility */
#settings-panel-rp .rp-command-list{
  display:flex !important;
  flex-direction:column !important;
  gap:7px !important;
  width:100%;
  max-height:430px;
  overflow-y:auto;
  overflow-x:hidden;
  margin-top:8px;
  padding-right:2px;
}
#settings-panel-rp .rp-command-row{
  display:grid !important;
  visibility:visible !important;
  opacity:1 !important;
  flex:0 0 auto;
  min-height:48px;
}
.rp-command-empty{
  padding:14px 10px;
  text-align:center;
  color:var(--muted);
  font-size:11px;
}

/* v4.2.0 — member controls near profile header */
#member-page #management-section{
  margin-top:8px !important;
  margin-bottom:10px !important;
}
#member-page #management-section .section-heading{
  margin-bottom:6px !important;
}
#member-page #management-section .action-grid{
  gap:6px !important;
}
#member-page #management-section .action-card{
  min-height:42px !important;
  padding:8px 9px !important;
}

/* v4.2.1 — subscription grace period */
.subscription-grace-settings{
  display:grid;
  gap:7px;
}
.subscription-grace-duration{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:6px !important;
}
.subscription-grace-duration label{
  display:grid;
  gap:4px;
  min-width:0;
}
.subscription-grace-duration small{
  color:var(--hint);
  font-size:8px;
}
.subscription-grace-duration input{
  width:100%;
  min-width:0;
  height:38px;
  padding:6px 7px;
  text-align:center;
}
@media(max-width:370px){
  .subscription-grace-duration{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}

/* =========================================================
   v4.3.0 — Promo codes
   ========================================================= */
.promo-redeem-card{
  display:grid;
  gap:7px;
  padding:13px;
}
.promo-redeem-card h3{
  margin:0;
}
.promo-redeem-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:7px;
}
.promo-redeem-row input{
  min-width:0;
  height:42px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:0 11px;
  color:var(--text);
  background:rgba(255,255,255,.035);
  text-transform:uppercase;
}
.promo-redeem-row .button{
  width:auto;
  min-width:96px;
  margin:0;
}
.promo-result{
  display:grid;
  gap:3px;
  padding:9px 10px;
  border-radius:11px;
  color:#cfc7ff;
  background:rgba(123,92,255,.1);
}
.promo-result strong{
  font-size:12px;
}
.promo-result span{
  font-size:9px;
}
.promo-history-list,
.promo-admin-list{
  display:grid;
  gap:7px;
}
.promo-history-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  padding:10px;
}
.promo-history-item > div{
  min-width:0;
  display:grid;
  gap:2px;
}
.promo-history-item strong{
  font-size:11px;
}
.promo-history-item small{
  min-width:0;
  color:var(--hint);
  font-size:8px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.promo-history-item > span{
  flex:0 0 auto;
  color:var(--hint);
  font-size:8px;
}
.promo-admin-item{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 11px;
  text-align:left;
}
.promo-admin-main{
  min-width:0;
  display:grid;
  gap:2px;
}
.promo-admin-main strong{
  color:#cfc7ff;
  font-size:12px;
  letter-spacing:.04em;
}
.promo-admin-main small{
  min-width:0;
  font-size:8px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.promo-admin-effects{
  color:var(--hint);
}
.promo-admin-side{
  flex:0 0 auto;
  display:grid;
  justify-items:end;
  gap:4px;
}
.promo-status{
  padding:3px 6px;
  border-radius:999px;
  color:#8ee7aa;
  background:rgba(65,190,105,.11);
  font-size:7px;
  font-weight:900;
}
.promo-status.off{
  color:#aeb4bf;
  background:rgba(143,150,163,.12);
}
.promo-admin-side small{
  color:var(--hint);
  font-size:7px;
}
.promo-editor-sheet{
  max-height:92vh;
  overflow-y:auto;
}
.promo-code-create-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:7px;
  align-items:end;
}
.promo-generate-button{
  width:auto !important;
  min-width:120px;
  height:42px;
  margin:0 0 10px !important;
  padding:0 10px !important;
  font-size:10px !important;
}
.promo-toggle-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.025);
}
.promo-toggle-row > span{
  display:grid;
  gap:2px;
}
.promo-toggle-row strong{
  font-size:10px;
}
.promo-toggle-row small{
  color:var(--hint);
  font-size:8px;
}
.promo-two-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
}
.promo-effects-head{
  margin-top:7px;
}
.promo-effects-head h3{
  margin:2px 0;
}
.promo-effects-head > small{
  color:var(--hint);
  font-size:8px;
}
.promo-duration-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
}
.promo-duration-grid label{
  display:grid;
  gap:3px;
}
.promo-duration-grid small{
  color:var(--hint);
  font-size:7px;
}
.promo-duration-grid input{
  width:100%;
  min-width:0;
  height:36px;
  text-align:center;
}
.promo-editor-actions{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:7px;
  margin-top:12px;
}
.promo-editor-actions .button{
  margin:0 !important;
}
.promo-delete-button{
  width:auto !important;
  color:#ff8f99 !important;
  background:rgba(217,75,93,.12) !important;
}
@media(max-width:390px){
  .promo-redeem-row{
    grid-template-columns:1fr;
  }
  .promo-redeem-row .button{
    width:100%;
  }
  .promo-two-grid{
    grid-template-columns:1fr;
  }
  .promo-code-create-row{
    grid-template-columns:1fr;
  }
  .promo-generate-button{
    width:100% !important;
    margin-top:-4px !important;
  }
}


/* v4.4.0 — fallback X for stale Telegram ticket UI */
.ticket-file-summary{
  position:relative;
}
.ticket-file-fallback-remove{
  position:absolute !important;
  top:50% !important;
  right:4px !important;
  transform:translateY(-50%) !important;
  display:grid !important;
  place-items:center !important;
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  padding:0 !important;
  border:0 !important;
  border-radius:8px !important;
  background:rgba(255,72,86,.20) !important;
  color:#ff7180 !important;
  font-size:19px !important;
  line-height:1 !important;
  z-index:5 !important;
}
.ticket-file-summary:has(.ticket-file-fallback-remove){
  padding-right:38px !important;
}

.rp-context-field{
  padding:8px;
  border:1px solid rgba(126,91,239,.14);
  border-radius:11px;
  background:rgba(126,91,239,.045);
}


/* v4.6.1 — owner-only frontend diagnostics */
.frontend-debug-card{
  margin:12px 0 4px;
  padding:9px 10px;
  border:1px dashed rgba(140,116,255,.32);
  border-radius:13px;
  background:rgba(126,91,239,.055);
}
.frontend-debug-card.hidden{display:none !important}
.frontend-debug-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:7px;
  color:#b9abff;
  font-size:9px;
  font-weight:850;
}
.frontend-debug-head strong{
  padding:3px 6px;
  border-radius:7px;
  background:rgba(126,91,239,.12);
  color:#d1c8ff;
  font-size:8px;
}
.frontend-debug-grid{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:5px 8px;
  align-items:center;
  font-size:8px;
}
.frontend-debug-grid>span{
  color:var(--hint);
}
.frontend-debug-grid code{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#ece9ff;
  font-size:8px;
  text-align:right;
}
