.tree-vote-poller-panel {
  --vote-green: #42d88e;
  --vote-cyan: #55cbd2;
  --vote-gold: #e6ac38;
  --vote-panel: rgba(15, 24, 26, .96);
  --vote-line: rgba(255, 255, 255, .09);
}

.tree-vote-heading .tree-admin-schedule-chip[data-state="waiting"],
.tree-vote-heading .tree-admin-schedule-chip[data-state="polling"] {
  color: #a7f0ce;
  border-color: rgba(66, 216, 142, .32);
  background: rgba(34, 137, 87, .16);
}

.tree-vote-heading .tree-admin-schedule-chip[data-state="disabled"] {
  color: #bdc7c5;
  border-color: rgba(190, 201, 199, .22);
  background: rgba(110, 122, 120, .12);
}

.tree-vote-heading .tree-admin-schedule-chip[data-state="error"] {
  color: #ffb3b7;
  border-color: rgba(220, 82, 89, .34);
  background: rgba(159, 38, 45, .17);
}

.tree-vote-runtime {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.tree-vote-runtime > div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--vote-line);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(27, 41, 43, .98), rgba(16, 25, 27, .98));
}

.tree-vote-runtime > div > span {
  display: block;
  margin-bottom: 5px;
  color: #859894;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tree-vote-runtime > div > strong {
  display: block;
  overflow: hidden;
  color: #eff7f4;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-vote-phase {
  display: flex !important;
  align-items: center;
  gap: 7px;
}

.tree-vote-phase i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8b9997;
}

.tree-vote-phase.is-waiting i,
.tree-vote-phase.is-polling i {
  background: var(--vote-green);
  box-shadow: 0 0 10px rgba(66, 216, 142, .78);
}

.tree-vote-phase.is-polling i { animation: tree-vote-pulse 1s ease-in-out infinite; }
.tree-vote-phase.is-error i { background: #e66167; box-shadow: 0 0 9px rgba(230, 97, 103, .72); }

@keyframes tree-vote-pulse {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.tree-vote-runtime-detail {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 13px;
  border-left: 3px solid rgba(85, 203, 210, .65);
  border-radius: 7px;
  color: #aebfbc;
  background: rgba(20, 73, 77, .15);
  font-size: 12px;
}

.tree-vote-runtime-detail.is-error {
  border-left-color: #db5b62;
  color: #ffb9bd;
  background: rgba(139, 37, 43, .15);
}

.tree-vote-card {
  margin-top: 14px;
  overflow: hidden;
}

.tree-vote-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 14px;
}

.tree-vote-card-head .tree-admin-card-title { margin-bottom: 3px; }
.tree-vote-card-head p { margin: 0; color: #829491; font-size: 12px; line-height: 1.45; }

.tree-vote-unlock {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(230, 172, 56, .32) !important;
  color: #f1cd7d !important;
  background: rgba(125, 83, 19, .15) !important;
}

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

.tree-vote-unlock:disabled {
  border-color: rgba(66, 216, 142, .27) !important;
  color: #8fe1b7 !important;
  background: rgba(30, 126, 78, .14) !important;
  cursor: default;
  opacity: 1;
}

.tree-vote-core-card,
.tree-vote-advanced {
  position: relative;
  border-color: rgba(230, 172, 56, .14);
  background:
    radial-gradient(circle at 100% 0, rgba(230, 172, 56, .055), transparent 30%),
    var(--vote-panel);
}

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

.tree-vote-core-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tree-vote-core-field {
  display: block;
  min-width: 0;
}

.tree-vote-core-field:last-child { grid-column: 1 / -1; }

.tree-vote-core-field > span {
  display: block;
  margin-bottom: 6px;
  color: #c2d0cd;
  font-size: 12px;
  font-weight: 850;
}

.tree-vote-core-field input,
.tree-vote-core-field textarea,
.tree-vote-env-row input,
.tree-vote-env-row select {
  width: 100%;
  border: 1px solid #35474a;
  border-radius: 9px;
  color: #edf4f2;
  background: #0f1719;
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.tree-vote-core-field input,
.tree-vote-env-row input,
.tree-vote-env-row select {
  height: 42px;
  padding: 0 12px;
}

.tree-vote-core-field textarea {
  min-height: 104px;
  padding: 11px 12px;
  line-height: 1.5;
  resize: vertical;
}

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

.tree-vote-core-field small,
.tree-vote-env-control small {
  display: block;
  margin-top: 5px;
  color: #687b78;
  font-size: 10px;
  line-height: 1.35;
}

.tree-vote-core-field .is-locked,
.tree-vote-env-row .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: pointer;
}

.tree-vote-core-field .is-locked:hover,
.tree-vote-env-row .is-locked:hover {
  border-color: rgba(230, 172, 56, .32);
}

.tree-vote-advanced {
  padding: 0 !important;
}

.tree-vote-advanced > summary {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tree-vote-advanced > summary::-webkit-details-marker { display: none; }

.tree-vote-advanced > summary::after {
  content: "⌄";
  order: 3;
  color: #8ca09c;
  font-size: 21px;
  line-height: 1;
  transition: transform .18s ease;
}

.tree-vote-advanced[open] > summary::after { transform: rotate(180deg); }
.tree-vote-advanced > summary:hover { background: rgba(255, 255, 255, .018); }

.tree-vote-advanced > summary > span:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tree-vote-advanced > summary strong { color: #e8f0ee; font-size: 14px; }
.tree-vote-advanced > summary small { color: #748783; font-size: 11px; font-weight: 500; }

.tree-vote-summary-state {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid rgba(230, 172, 56, .24);
  border-radius: 999px;
  color: #ddbd78;
  background: rgba(121, 82, 23, .12);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tree-vote-advanced.is-unlocked .tree-vote-summary-state {
  border-color: rgba(66, 216, 142, .26);
  color: #94e1ba;
  background: rgba(30, 126, 78, .14);
}

.tree-vote-advanced-body {
  padding: 0 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, .065);
}

.tree-vote-advanced-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
}

.tree-vote-advanced-head p { margin: 0; color: #879995; font-size: 11px; line-height: 1.45; }
.tree-vote-advanced-head .tree-vote-current-reset { margin-top: 4px; }
.tree-vote-current-reset strong { color: #cbd7d4; }

.tree-vote-env-list {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 11px;
  background: rgba(4, 10, 11, .35);
}

.tree-vote-env-row {
  display: grid;
  grid-template-columns: minmax(230px, .7fr) minmax(280px, 1.3fr);
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
}

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

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

.tree-vote-env-control { display: block; min-width: 0; }
.tree-vote-env-row input,
.tree-vote-env-row select { height: 37px; border-radius: 7px; font: 12px Consolas, "Courier New", monospace; }
.tree-vote-env-row select { appearance: auto; }

.tree-vote-api-preview {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}

.tree-vote-api-preview > div {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(85, 203, 210, .12);
  border-radius: 8px;
  background: rgba(15, 62, 66, .09);
}

.tree-vote-api-preview span {
  color: #75aeb3;
  font: 700 10px/1.4 Consolas, "Courier New", monospace;
}

.tree-vote-api-preview code {
  overflow-wrap: anywhere;
  color: #b7d8d7;
  font: 10px/1.45 Consolas, "Courier New", monospace;
}

.tree-vote-path-block {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, .065);
}

.tree-vote-path-block > .tree-admin-card-title { margin-bottom: 9px; }
.tree-vote-paths { display: grid; gap: 6px; }

.tree-vote-paths > div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(5, 11, 12, .38);
}

.tree-vote-paths code { color: #719fa1; font: 700 10px/1.4 Consolas, monospace; }
.tree-vote-paths span { overflow-wrap: anywhere; color: #aebfbc; font: 10px/1.4 Consolas, monospace; }

.tree-vote-savebar {
  position: sticky;
  bottom: -24px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin: 14px -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-vote-savebar > span {
  margin-right: auto;
  color: #81938f;
  font-size: 11px;
  font-weight: 700;
}

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

.tree-vote-events-card { margin-bottom: 0; }
.tree-vote-events { display: grid; gap: 8px; }

.tree-vote-event {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  background: rgba(6, 13, 14, .47);
}

.tree-vote-event.is-item { border-left: 3px solid rgba(230, 172, 56, .72); }
.tree-vote-event.is-vote { border-left: 3px solid rgba(66, 216, 142, .64); }

.tree-vote-event-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #151008;
  background: linear-gradient(145deg, #f0c25f, #b8761c);
  font-size: 15px;
  font-weight: 900;
}

.tree-vote-event.is-vote .tree-vote-event-icon { background: linear-gradient(145deg, #74e4ae, #22845c); }
.tree-vote-event-body { min-width: 0; }
.tree-vote-event-body > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tree-vote-event-body strong { overflow: hidden; color: #eef5f3; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.tree-vote-event-body p { margin: 2px 0 0; color: #a2b2af; font-size: 11px; }
.tree-vote-event-body small { display: block; margin-top: 3px; color: #687b77; font: 9px/1.3 Consolas, monospace; overflow-wrap: anywhere; }
.tree-vote-event-body .tree-vote-event-detail { color: #849995; font-family: Arial, sans-serif; }
.tree-vote-event-badge { padding: 3px 6px; border-radius: 999px; color: #f5ce78; background: rgba(166, 108, 24, .19); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.tree-vote-event.is-vote .tree-vote-event-badge { color: #91e1ba; background: rgba(32, 134, 88, .2); }
.tree-vote-event > time { color: #748682; font-size: 10px; white-space: nowrap; }

@media (max-width: 820px) {
  .tree-vote-core-grid { grid-template-columns: 1fr; }
  .tree-vote-core-field:last-child { grid-column: auto; }
  .tree-vote-env-row { grid-template-columns: 1fr; gap: 6px; }
  .tree-vote-api-preview > div,
  .tree-vote-paths > div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 780px) {
  .tree-vote-runtime { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree-vote-card-head,
  .tree-vote-advanced-head { align-items: stretch; flex-direction: column; }
  .tree-vote-unlock { justify-content: center; width: 100%; }
  .tree-vote-savebar { bottom: -18px; flex-wrap: wrap; }
  .tree-vote-savebar > span { flex: 1 0 100%; }
  .tree-vote-savebar .tree-admin-btn { flex: 1 1 150px; }
  .tree-vote-event { grid-template-columns: 35px minmax(0, 1fr); }
  .tree-vote-event > time { grid-column: 2; }
}

@media (max-width: 480px) {
  .tree-vote-runtime { grid-template-columns: 1fr; }
  .tree-vote-advanced > summary { align-items: flex-start; gap: 9px; padding: 14px; }
  .tree-vote-advanced > summary::after { font-size: 18px; }
  .tree-vote-summary-state { display: none; }
  .tree-vote-advanced-body { padding: 0 12px 13px; }
  .tree-vote-env-row { padding: 9px; }
  .tree-vote-event-body > div { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .tree-vote-phase.is-polling i { animation: none; }
}
