.tree-discord-services-panel {
  --ds-green: #42d88e;
  --ds-cyan: #55cbd2;
  --ds-gold: #e6ac38;
  --ds-red: #e66167;
  --ds-panel: rgba(15, 24, 26, .97);
  --ds-line: rgba(255, 255, 255, .085);
}

.tree-ds-heading {
  align-items: flex-start;
  gap: 16px;
}

.tree-ds-unlock {
  flex: 0 0 auto;
  border-color: rgba(230, 172, 56, .34) !important;
  color: #f2ce7d !important;
  background: rgba(125, 83, 19, .16) !important;
}

.tree-ds-unlock:hover {
  border-color: rgba(230, 172, 56, .6) !important;
  background: rgba(145, 96, 21, .25) !important;
}

.tree-ds-unlock:disabled {
  border-color: rgba(66, 216, 142, .28) !important;
  color: #95e5bd !important;
  background: rgba(30, 126, 78, .15) !important;
  cursor: default;
  opacity: 1;
}

.tree-ds-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.tree-ds-service {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--ds-line);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(27, 41, 43, .98), rgba(16, 25, 27, .98));
}

.tree-ds-service > i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7d8b89;
}

.tree-ds-service.is-running > i {
  background: var(--ds-green);
  box-shadow: 0 0 9px rgba(66, 216, 142, .72);
}

.tree-ds-service.is-error > i {
  background: var(--ds-red);
  box-shadow: 0 0 9px rgba(230, 97, 103, .58);
}

.tree-ds-service.is-locked > i {
  background: var(--ds-gold);
  box-shadow: 0 0 9px rgba(230, 172, 56, .58);
}

.tree-ds-service > div {
  min-width: 0;
}

.tree-ds-service strong,
.tree-ds-service small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-ds-service strong {
  color: #edf6f3;
  font-size: 12px;
}

.tree-ds-service small {
  margin-top: 3px;
  color: #7f918e;
  font-size: 10px;
}

.tree-ds-service > span {
  margin-left: auto;
  color: #ffb5ba;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.tree-ds-service.is-locked > span { color: #f0cb7b; }

.tree-ds-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
  padding: 10px 12px;
  border: 1px solid rgba(85, 203, 210, .13);
  border-radius: 9px;
  background: rgba(15, 62, 66, .1);
}

.tree-ds-queue span {
  color: #809692;
  font-size: 10px;
}

.tree-ds-queue span + span::before {
  margin-right: 8px;
  color: #3e5a58;
  content: "•";
}

.tree-ds-queue strong {
  margin-left: 4px;
  color: #c7ded9;
}

.tree-ds-machine-guard {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 13px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  background: rgba(18, 29, 31, .92);
}

.tree-ds-machine-guard.is-authorized { border-color: rgba(66, 216, 142, .28); }
.tree-ds-machine-guard.is-pending { border-color: rgba(230, 172, 56, .38); }
.tree-ds-machine-guard.is-blocked { border-color: rgba(230, 97, 103, .4); }

.tree-ds-machine-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #09130f;
  background: var(--ds-green);
  font-size: 20px;
  font-weight: 900;
}

.is-pending .tree-ds-machine-icon { background: var(--ds-gold); }
.is-blocked .tree-ds-machine-icon { color: #fff; background: var(--ds-red); }

.tree-ds-machine-guard strong,
.tree-ds-machine-guard span { display: block; }
.tree-ds-machine-guard strong { color: #edf6f3; font-size: 12px; }
.tree-ds-machine-guard div > span { margin-top: 3px; color: #8ca09c; font-size: 10px; line-height: 1.45; }

.tree-ds-machine-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.tree-ds-machine-values > div {
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 8px;
  background: rgba(5, 12, 13, .32);
}

.tree-ds-machine-values span,
.tree-ds-machine-values strong { display: block; }
.tree-ds-machine-values span { color: #738783; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.tree-ds-machine-values strong { margin-top: 5px; color: #d7e5e2; font-size: 11px; overflow-wrap: anywhere; }

.tree-ds-detected {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(85, 203, 210, .14);
  border-radius: 8px;
  background: rgba(20, 73, 77, .1);
}

.tree-ds-detected > span { color: #8bc9cf; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.tree-ds-detected > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.tree-ds-detected small { display: block; margin-top: 7px; color: #6f817e; font-size: 10px; }
.tree-ds-detected button:disabled { cursor: not-allowed; opacity: .45; }
.tree-ds-detected code { color: inherit; }

.tree-ds-details {
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid rgba(230, 172, 56, .14);
  border-radius: 11px;
  background: radial-gradient(circle at 100% 0, rgba(230, 172, 56, .05), transparent 28%), var(--ds-panel);
}

.tree-ds-details.is-unlocked {
  border-color: rgba(66, 216, 142, .28);
  box-shadow: inset 0 0 0 1px rgba(66, 216, 142, .035);
}

.tree-ds-details > summary {
  display: flex;
  align-items: center;
  min-height: 69px;
  gap: 16px;
  padding: 14px 17px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tree-ds-details > summary::-webkit-details-marker { display: none; }
.tree-ds-details > summary:hover { background: rgba(255, 255, 255, .018); }

.tree-ds-details > summary::after {
  color: #8ca09c;
  content: "⌄";
  font-size: 20px;
  line-height: 1;
  transition: transform .18s ease;
}

.tree-ds-details[open] > summary::after { transform: rotate(180deg); }

.tree-ds-details > summary > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.tree-ds-details > summary strong {
  color: #e8f0ee;
  font-size: 14px;
}

.tree-ds-details > summary small {
  color: #748783;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.tree-ds-details > summary em {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid rgba(230, 172, 56, .25);
  border-radius: 999px;
  color: #ddbd78;
  background: rgba(121, 82, 23, .12);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
}

.tree-ds-details.is-unlocked > summary em {
  border-color: rgba(66, 216, 142, .27);
  color: #95e2ba;
  background: rgba(30, 126, 78, .14);
}

.tree-ds-details-body {
  padding: 0 17px 17px;
  border-top: 1px solid rgba(255, 255, 255, .065);
}

.tree-ds-list {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 10px;
  background: rgba(4, 10, 11, .34);
}

.tree-ds-row {
  display: grid;
  grid-template-columns: minmax(230px, .72fr) minmax(300px, 1.28fr);
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
}

.tree-ds-row:last-child { border-bottom: 0; }
.tree-ds-row:hover { background: rgba(255, 255, 255, .014); }

.tree-ds-row > code {
  overflow-wrap: anywhere;
  color: #8bc9cf;
  font: 700 11px/1.4 Consolas, "Courier New", monospace;
}

.tree-ds-control {
  display: block;
  min-width: 0;
}

.tree-ds-control input,
.tree-ds-control select,
.tree-ds-control textarea {
  width: 100%;
  border: 1px solid #35474a;
  border-radius: 7px;
  color: #edf4f2;
  background: #0f1719;
  font: 12px Consolas, "Courier New", monospace;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.tree-ds-control input,
.tree-ds-control select {
  height: 38px;
  padding: 0 11px;
}

.tree-ds-control textarea {
  min-height: 78px;
  padding: 10px 11px;
  line-height: 1.45;
  resize: vertical;
}

.tree-ds-control input:focus,
.tree-ds-control select:focus,
.tree-ds-control textarea:focus {
  border-color: rgba(230, 172, 56, .72);
  box-shadow: 0 0 0 3px rgba(230, 172, 56, .1);
  outline: 0;
}

.tree-ds-control small {
  display: block;
  margin-top: 5px;
  color: #687b78;
  font: 10px/1.38 Arial, sans-serif;
}

.tree-ds-control .is-locked {
  border-color: rgba(255, 255, 255, .07);
  color: #c5d1cf;
  background: linear-gradient(90deg, rgba(230, 172, 56, .035), transparent 25%), #11191b;
  box-shadow: inset 3px 0 rgba(230, 172, 56, .32);
  cursor: not-allowed;
  opacity: 1;
}

.tree-ds-note,
.tree-ds-warning {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(85, 203, 210, .62);
  border-radius: 7px;
  color: #aebfbc;
  background: rgba(20, 73, 77, .14);
  font-size: 11px;
  line-height: 1.48;
}

.tree-ds-warning {
  border-left-color: var(--ds-red);
  color: #ffc1c5;
  background: rgba(139, 37, 43, .14);
}

.tree-ds-savebar {
  position: sticky;
  bottom: -24px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin: 15px -4px 0;
  padding: 13px 8px;
  border-top: 1px solid rgba(230, 172, 56, .18);
  background: linear-gradient(180deg, rgba(12, 18, 20, .82), rgba(12, 18, 20, .98) 30%);
  backdrop-filter: blur(7px);
}

.tree-ds-savebar > span {
  margin-right: auto;
  color: #81938f;
  font-size: 11px;
  font-weight: 700;
}

.tree-ds-savebar .tree-admin-btn:disabled {
  cursor: not-allowed;
  opacity: .48;
}

@media (max-width: 820px) {
  .tree-ds-heading { display: grid; }
  .tree-ds-unlock { width: 100%; justify-content: center; }
  .tree-ds-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree-ds-machine-values { grid-template-columns: 1fr; }
  .tree-ds-row { grid-template-columns: 1fr; gap: 7px; }
  .tree-ds-details > summary { align-items: flex-start; gap: 9px; padding: 13px; }
  .tree-ds-details > summary em { margin-left: auto; }
  .tree-ds-details-body { padding: 0 12px 13px; }
  .tree-ds-savebar { flex-wrap: wrap; bottom: -16px; }
  .tree-ds-savebar > span { width: 100%; margin: 0; }
  .tree-ds-savebar .tree-admin-btn { flex: 1 1 145px; }
}

@media (max-width: 520px) {
  .tree-ds-service-grid { grid-template-columns: 1fr; }
  .tree-ds-queue { display: grid; }
  .tree-ds-queue span + span::before { display: none; }
  .tree-ds-details > summary small { font-size: 10px; }
  .tree-ds-details > summary em { display: none; }
}
