.community {
  --cm-border: #2c2939;
  --cm-muted: #a3a0b5;
  max-width: 1400px;
  margin: auto;
  font-size: 16px;
  line-height: 1.5;
}
.community h1 {
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.8px;
}
.community h2 {
  font-size: 16px;
}
.community p {
  color: var(--cm-muted);
  line-height: 1.6;
}
.cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 24px;
}
.cm-header p {
  margin: 8px 0;
}
.cm-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #a180ff14;
  border: 1px solid #a180ff44;
  color: #bca2ff;
  border-radius: 30px;
  padding: 7px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.cm-badge.off {
  color: #aaa6bb;
  border-color: #454151;
  background: #45415120;
}
.cm-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--cm-border);
  padding-bottom: 12px;
  margin-bottom: 22px;
  overflow-x: auto;
}
.cm-tabs button {
  border: 0;
  background: transparent;
  color: var(--cm-muted);
  padding: 10px 15px;
  border-radius: 8px;
  font: inherit;
  white-space: nowrap;
}
.cm-tabs button[aria-selected="true"] {
  background: #a180ff1b;
  color: #c0aaff;
}
.cm-panel {
  background: #15151e;
  border: 1px solid var(--cm-border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.cm-panel h2 {
  margin: 0 0 8px;
}
.cm-panel > p {
  font-size: 14px;
  margin-top: 0;
}
.cm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.cm-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  color: #d5d0e5;
  font-size: 14px;
  font-weight: 500;
}
.cm-field input,
.cm-field select,
.cm-field textarea,
.cm-toolbar input,
.cm-toolbar select {
  background: #0f0f17;
  border: 1px solid #363242;
  border-radius: 8px;
  color: #e3deef;
  font: inherit;
  min-height: 43px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
}
.cm-field textarea {
  resize: vertical;
  min-height: 100px;
}
.cm-field small {
  font-size: 12px;
  color: var(--cm-muted);
  font-weight: 400;
  line-height: 1.5;
}
.cm-check {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: #d5d0e5;
  cursor: pointer;
}
.cm-check input {
  accent-color: #ab85ff;
  flex: none;
  width: 18px;
  height: 18px;
}
.cm-toggle {
  justify-content: space-between;
  padding: 16px;
  border: 1px solid #3e3455;
  border-radius: 10px;
  background: #9675ff0b;
}
.cm-toggle input {
  appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 30px;
  background: #393447;
  position: relative;
  transition: background 0.2s;
}
.cm-toggle input:after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.cm-toggle input:checked {
  background: #9d77ed;
}
.cm-toggle input:checked:after {
  transform: translateX(16px);
}
.cm-toggle strong {
  display: block;
  margin-bottom: 5px;
}
.cm-toggle small {
  color: var(--cm-muted);
  font-weight: 400;
}
.cm-wide {
  grid-column: 1/-1;
}
.cm-repeat {
  padding: 16px;
  border: 1px solid #342e44;
  background: #111118;
  border-radius: 10px;
  margin-bottom: 12px;
  position: relative;
}
.cm-repeat .cm-grid {
  gap: 12px;
}
.cm-repeat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cm-repeat-header b {
  font-size: 12px;
  color: #b3a2d7;
}
.cm-picker {
  border: 1px solid #363242;
  border-radius: 8px;
  background: #0f0f17;
  font-weight: 400;
}
.cm-picker summary {
  padding: 13px;
  cursor: pointer;
  color: #b9b3cc;
}
.cm-picker > div {
  padding: 0 12px 12px;
}
.cm-picker input[type="search"] {
  margin-bottom: 10px;
}
.cm-picker-list {
  max-height: 190px;
  overflow: auto;
}
.cm-picker .cm-check {
  min-height: 32px;
  overflow-wrap: anywhere;
}
.cm-picker .cm-check input {
  min-height: 16px;
  width: 16px;
  padding: 0;
}
.cm-btn {
  border: 1px solid #40364e;
  border-radius: 8px;
  background: #24202f;
  color: #dfd6ed;
  padding: 10px 15px;
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.18s,
    background 0.18s,
    box-shadow 0.18s;
}
.cm-btn.primary {
  background: #9a71e7;
  color: #fff;
  border-color: #a883ef;
}
.cm-btn.danger {
  color: #ffacbe;
  background: #e35e7c12;
  border-color: #a34f6255;
}
.community button:hover:not(:disabled),
.cm-dialog button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px #8d5fe520;
  filter: brightness(1.12);
}
.community button:active:not(:disabled),
.cm-dialog button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}
.community :focus-visible,
.cm-dialog :focus-visible {
  outline: 2px solid #bf9aff;
  outline-offset: 3px;
}
.community button:disabled,
.cm-dialog button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cm-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  bottom: 14px;
  padding: 16px 20px;
  background: #201a2af5;
  backdrop-filter: blur(14px);
  border: 1px solid #624986;
  border-radius: 12px;
  box-shadow: 0 8px 26px #0005;
  z-index: 4;
}
.cm-save span {
  font-size: 13px;
  color: #c4b6da;
}
.cm-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.cm-toolbar input {
  max-width: 310px;
}
.cm-toolbar select {
  max-width: 180px;
}
.cm-toolbar .cm-btn:first-of-type {
  margin-left: auto;
}
.cm-table {
  overflow-x: auto;
  border: 1px solid var(--cm-border);
  border-radius: 12px;
}
.cm-table table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 14px;
}
.cm-table th {
  background: #181620;
  color: #9690a9;
  font-size: 12px;
  letter-spacing: 1px;
  text-align: left;
  padding: 15px;
  text-transform: uppercase;
}
.cm-table td {
  border-top: 1px solid #2a2635;
  padding: 15px;
  vertical-align: middle;
  max-width: 300px;
  overflow-wrap: anywhere;
  color: #cec8df;
}
.cm-table tr:hover td {
  background: #9e77e909;
}
.cm-table td small {
  display: block;
  color: var(--cm-muted);
  margin-top: 5px;
}
.cm-table .cm-btn {
  padding: 7px 9px;
  font-size: 12px;
  margin: 3px;
}
.cm-table pre {
  white-space: pre-wrap;
  font-size: 12px;
  max-width: 420px;
  max-height: 200px;
  overflow: auto;
}
.cm-actions {
  white-space: nowrap;
}
.cm-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--cm-muted);
}
.cm-empty {
  padding: 54px 25px;
  text-align: center;
  border: 1px dashed #3d334e;
  border-radius: 14px;
  background: radial-gradient(ellipse at top, #8c61d911, transparent 75%);
}
.cm-empty svg {
  width: 36px;
  height: 36px;
  stroke: #b490f3;
  fill: none;
  stroke-width: 1.5;
  margin-bottom: 12px;
}
.cm-empty h2 {
  font-size: 18px;
}
.cm-empty p {
  max-width: 480px;
  margin: 10px auto 22px;
  font-size: 16px;
}
.cm-error {
  color: #ffc1cd !important;
  background: #ad3e5b14;
  border: 1px solid #ac516644;
  border-radius: 9px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.cm-success {
  color: #9fe6c3;
  font-size: 13px;
}
.cm-loading {
  padding: 50px;
  text-align: center;
  color: #b6a3d1;
}
.cm-loading:before {
  content: "";
  display: block;
  margin: 0 auto 20px;
  border: 2px solid #40314f;
  border-top-color: #b68aec;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  animation: cm-spin 0.8s linear infinite;
}
@keyframes cm-spin {
  to {
    transform: rotate(360deg);
  }
}
.cm-dialog {
  --cm-muted: #aaa2bb;
  font-size: 16px;
  line-height: 1.5;
  color: #e9e2f5;
  background: #15131c;
  border: 1px solid #544168;
  border-radius: 16px;
  width: min(720px, calc(100vw - 30px));
  max-height: 88vh;
  padding: 0;
  box-shadow: 0 24px 100px #0009;
}
.cm-dialog::backdrop {
  background: #05050bbf;
  backdrop-filter: blur(4px);
}
.cm-dialog form {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}
.cm-dialog header {
  padding: 24px;
  border-bottom: 1px solid #32293d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cm-dialog h2 {
  margin: 0;
  font-size: 20px;
}
.cm-dialog main {
  padding: 24px;
  overflow: auto;
  margin: 0 !important;
  width: auto !important;
  min-height: 0 !important;
}
.cm-dialog footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid #32293d;
}
.cm-dialog .cm-grid {
  gap: 18px;
}
.cm-notice {
  padding: 14px 18px;
  border-left: 3px solid #9c79de;
  background: #9370d510;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #b6aac9;
}
.cm-command-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.cm-command-list code {
  background: #231d30;
  border: 1px solid #382c49;
  color: #c9acf6;
  border-radius: 5px;
  padding: 7px 9px;
  font-size: 12px;
}
.cm-dialog .cm-field {
  font-size: 14px;
}
.cm-save > div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cm-disabled-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.cm-disabled-notice p {
  margin: 4px 0 0;
  font-size: 14px;
}
.cm-disabled-notice .cm-btn {
  flex-shrink: 0;
}
.cm-dialog [hidden] {
  display: none !important;
}
.cm-dialog input:disabled,
.community input:disabled,
.cm-dialog select:disabled,
.community select:disabled {
  opacity: 0.65;
  cursor: wait;
}
.community [aria-busy="true"],
.cm-dialog [aria-busy="true"] {
  cursor: progress;
}
.cm-field input,
.cm-field select,
.cm-field textarea {
  scroll-margin-top: 100px;
}
.cm-check:has(input:focus-visible),
.cm-picker:hover {
  border-color: #9773c4;
}
.cm-table small {
  font-size: 12px;
}
.cm-table summary {
  cursor: pointer;
  min-height: 36px;
  align-content: center;
}
.cm-tabs button {
  cursor: pointer;
  min-height: 44px;
  font-size: 14px;
}
.cm-count {
  font-variant-numeric: tabular-nums;
}
.cm-nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#sidebar nav {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
}
#sidebar {
  display: flex;
  flex-direction: column;
}
#sidebar .sidebar-footer {
  margin-top: auto;
  flex-shrink: 0;
}
.cm-check input {
  min-height: 18px;
  padding: 0;
}
.cm-toggle input {
  min-height: 22px;
  max-height: 22px;
  padding: 0;
}
.cm-repeat [hidden],
.cm-picker [hidden] {
  display: none !important;
}
.community,
.cm-dialog,
#sidebar nav {
  color-scheme: dark;
}
.cm-table td {
  display: table-cell !important;
  word-break: normal;
  white-space: normal;
}
.cm-table td.cm-actions {
  white-space: nowrap;
}
.cm-table th {
  min-width: 90px;
}
.cm-table td:first-child {
  min-width: 175px;
}
.cm-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  float: left;
  margin-right: 10px;
}
@media (max-width: 800px) {
  .cm-grid {
    grid-template-columns: 1fr;
  }
  .cm-header {
    align-items: flex-start;
  }
  .cm-panel {
    padding: 18px;
  }
  .cm-toolbar input {
    max-width: none;
    flex: 1;
    min-width: 160px;
  }
  .cm-toolbar .cm-btn:first-of-type {
    margin-left: 0;
  }
  .cm-dialog header,
  .cm-dialog main {
    padding: 18px;
  }
  .cm-save {
    bottom: 7px;
    padding: 12px;
    flex-wrap: wrap;
  }
  .cm-save span {
    max-width: 100%;
  }
  .cm-tabs button {
    padding: 9px 11px;
  }
  .cm-header h1 {
    font-size: 26px;
  }
}
@media (max-width: 480px) {
  .cm-disabled-notice {
    flex-direction: column;
    align-items: stretch;
  }
  .cm-save > div {
    width: 100%;
  }
  .cm-save .cm-btn {
    flex: 1;
  }
  .cm-header {
    gap: 10px;
    flex-wrap: wrap;
  }
  .cm-toolbar .cm-btn {
    flex: 1;
  }
  .cm-field input,
  .cm-field textarea,
  .cm-field select,
  .cm-toolbar input,
  .cm-toolbar select {
    font-size: 16px;
  }
  .cm-dialog footer {
    padding: 14px 18px;
  }
  .cm-dialog footer .cm-btn {
    flex: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .community *,
  .cm-dialog * {
    transition: none !important;
    animation: none !important;
  }
}
