

.pt-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
}

.pt-btn {

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: var(--pt-btn-h, 30px);
  box-sizing: border-box;
  padding: 0 10px;
  font-family: inherit;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.16em;

  text-indent: 0.16em;
  line-height: 1;
  color: var(--text-secondary);
  background: #f4f5f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--glass-radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.pt-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

.pt-btn:active { transform: scale(0.97); }
.pt-btn:disabled { opacity: 0.6; cursor: default; }

.pt-btn-open {
  color: var(--brand-color);
  background: var(--brand-color-dim);
  border-color: var(--brand-color-dim-hover);
}

.pt-btn.pt-has-alert::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e8590c;
  box-shadow: 0 0 0 2px #fff;
}

.pt-btn.pt-busy { opacity: 0.7; }
.pt-btn.pt-busy::before {
  content: '';
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: pt-spin 0.8s linear infinite;
}

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

.pt-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  min-width: 268px;
  padding: 6px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.pt-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 4px;
}

.pt-head-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a8a8e;
  white-space: nowrap;
}

.pt-head-root .pt-head-title { color: #a0a0a5; }

.pt-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: -4px;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.pt-back:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-primary); }

.pt-list { display: flex; flex-direction: column; }

.pt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-primary);
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.pt-item:hover { background: var(--brand-color-dim); color: var(--brand-color); }

.pt-item-off,
.pt-item:disabled { opacity: 0.55; cursor: default; }
.pt-item-off:hover { background: none; color: var(--text-primary); }

.pt-label { flex: 1; white-space: nowrap; }

.pt-switch {
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  padding: 2px;
  box-sizing: border-box;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.pt-switch::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(33, 30, 27, 0.28);
  transition: transform var(--transition-fast);
}

.pt-switch-on {
  background: var(--brand-color);
  border-color: var(--brand-color);
  box-shadow: none;
}

.pt-switch-on::after { transform: translateX(16px); }

.pt-item-toggle:hover .pt-switch { border-color: rgba(0, 0, 0, 0.26); }
.pt-item-toggle:hover .pt-switch-on { border-color: var(--brand-color); }

.pt-panel-tight .pt-label { white-space: normal; }

.pt-note {
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.pt-tone-mute { color: #9a9aa0; }
.pt-tone-warn { color: #e8590c; }
.pt-tone-ok { color: var(--brand-color); }

.pt-arrow {
  font-size: 1rem;
  line-height: 1;
  color: #b5b5ba;
  margin-right: -2px;
}

.pt-empty {
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #9a9aa0;
}

@media (max-width: 700px) {
  .pt-panel {
    min-width: 0;
    width: max-content;
    max-width: calc(100vw - 24px);
  }
  .pt-label { white-space: normal; }
}
