.tree-admin-panel.tree-discord-panel { max-width: 1040px; }

.tree-discord-heading { margin-bottom: 14px; }

.tree-discord-tabs {
  position: sticky;
  top: -24px;
  z-index: 4;
  display: flex;
  gap: 6px;
  margin: 0 -3px 12px;
  padding: 9px 3px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(12, 18, 20, .96);
  scrollbar-width: thin;
}

.tree-discord-tabs button {
  min-width: max-content;
  min-height: 35px;
  padding: 0 12px;
  border: 1px solid #344548;
  border-radius: 8px;
  color: #98aaa7;
  background: #172124;
  font: 800 11px/1 Arial, sans-serif;
  cursor: pointer;
}

.tree-discord-tabs button:hover { color: #fff; border-color: #586c69; }
.tree-discord-tabs button.is-active {
  color: #171207;
  border-color: #e9b447;
  background: linear-gradient(135deg, #efc45e, #c98216);
}

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

.tree-discord-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 9px;
}

.tree-discord-summary-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-top: 3px solid #687876;
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(28, 40, 43, .96), rgba(14, 22, 24, .96));
}

.tree-discord-summary-card.is-ready { border-top-color: #2ccf91; }
.tree-discord-summary-card.is-warning { border-top-color: #e2a535; }
.tree-discord-summary-card span,
.tree-discord-summary-card small { display: block; color: #82938f; font-size: 10px; }
.tree-discord-summary-card span { font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.tree-discord-summary-card strong {
  display: block;
  margin: 5px 0 3px;
  overflow: hidden;
  color: #f3f7f6;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-discord-form { display: grid; gap: 14px; }

.tree-discord-fields { display: grid; gap: 11px; }
.tree-discord-fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.tree-discord-field { min-width: 0; }
.tree-discord-field > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: #abbab8;
  font-size: 12px;
  font-weight: 800;
}

.tree-admin .tree-discord-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #35474a;
  border-radius: 9px;
  color: #edf4f2;
  background: #0f1719;
  font: inherit;
}

.tree-admin .tree-discord-field input[type="password"] { font-family: Consolas, monospace; }
.tree-admin .tree-discord-field input::placeholder { color: #60716e; }

.tree-discord-field-note {
  display: block;
  margin-top: 6px;
  color: #758784;
  font-size: 10px;
  line-height: 1.45;
}

.tree-discord-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(39, 187, 164, .22);
  border-radius: 10px;
  background: rgba(15, 65, 59, .18);
}

.tree-discord-toggle-row > span:first-child { min-width: 0; }
.tree-discord-toggle-row strong { display: block; color: #e9f3f0; font-size: 13px; }
.tree-discord-toggle-row small { display: block; margin-top: 3px; color: #829693; font-size: 10px; }

.tree-discord-feature-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 1px;
}

.tree-discord-feature-head h4 { margin: 0; color: #fff; font-size: 20px; overflow-wrap: anywhere; }
.tree-discord-feature-head p { max-width: 720px; margin: 5px 0 0; color: #8fa19e; }

.tree-discord-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: #aab9b7;
  background: rgba(255, 255, 255, .045);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.tree-discord-badge i { width: 7px; height: 7px; border-radius: 50%; background: #75817f; }
.tree-discord-badge.is-live { color: #9ff2ce; border-color: rgba(45, 209, 145, .32); background: rgba(25, 132, 91, .15); }
.tree-discord-badge.is-live i { background: #32d996; box-shadow: 0 0 9px rgba(50, 217, 150, .8); }
.tree-discord-badge.is-working { color: #f5d891; border-color: rgba(230, 172, 56, .32); background: rgba(137, 94, 17, .16); }
.tree-discord-badge.is-working i { background: #e8ae3b; animation: tree-discord-pulse 1.2s infinite; }
.tree-discord-badge.is-error { color: #ffb5b8; border-color: rgba(226, 84, 91, .34); background: rgba(149, 36, 43, .17); }
.tree-discord-badge.is-error i { background: #e85e64; }

@keyframes tree-discord-pulse {
  50% { opacity: .35; transform: scale(.78); }
}

.tree-discord-runtime-detail,
.tree-discord-error {
  margin-top: -5px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #81938f;
  background: rgba(0, 0, 0, .16);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.tree-discord-error { color: #ffacad; border: 1px solid rgba(225, 83, 89, .24); background: rgba(128, 31, 36, .16); }

.tree-discord-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tree-discord-help { margin: -3px 0 0; color: #748683; font-size: 10px; line-height: 1.5; }
.tree-discord-help code { color: #ebc46f; font-family: Consolas, monospace; overflow-wrap: anywhere; }

.tree-discord-clear { display: flex; align-items: center; gap: 8px; width: max-content; max-width: 100%; color: #8d9d9a; font-size: 11px; }
.tree-discord-clear input { accent-color: #d95e62; }

.tree-discord-previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tree-discord-previews figure { min-width: 0; margin: 0; }
.tree-discord-previews figure:last-child { grid-column: 1 / -1; width: min(240px, 100%); }
.tree-discord-previews figure > div {
  display: grid;
  min-height: 140px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  background: #0a1012;
}
.tree-discord-previews img { display: block; width: 100%; max-height: 230px; object-fit: contain; }
.tree-discord-previews figcaption { margin-top: 6px; color: #81928f; font-size: 10px; font-weight: 800; }

.tree-discord-geo-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tree-discord-geo-stats > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 9px;
  background: rgba(8, 14, 16, .56);
}

.tree-discord-geo-stats span { display: block; color: #728481; font-size: 9px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.tree-discord-geo-stats strong { display: block; margin-top: 4px; overflow: hidden; color: #eef4f2; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

@media screen and (max-width: 1000px) {
  .tree-discord-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 860px) {
  .tree-discord-tabs { top: -16px; }
}

@media screen and (max-width: 620px) {
  .tree-discord-heading { display: flex; }
  .tree-discord-heading > div { min-width: 0; }
  .tree-discord-overview-grid,
  .tree-discord-fields.two,
  .tree-discord-previews,
  .tree-discord-geo-stats { grid-template-columns: 1fr; }
  .tree-discord-previews figure:last-child { grid-column: auto; width: 100%; }
  .tree-discord-feature-head { align-items: stretch; flex-direction: column; }
  .tree-discord-badge { align-self: flex-start; }
  .tree-discord-actions .tree-admin-btn { flex: 1 1 170px; min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .tree-discord-badge.is-working i { animation: none; }
}
