.panel-veil {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(10, 10, 12, .45);
  backdrop-filter: blur(2px);
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(360px, 92vw);
  height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .25);
  overscroll-behavior: contain;
}

.panel[hidden] { display: none; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line);
}

.panel-head b {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel-head button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px));
}

.p-sec { padding: 14px 0; border-bottom: 1px solid var(--line); }
.p-sec:last-child { border-bottom: 0; }

.p-sec h3 {
  margin: 0 0 10px;
  font-family: var(--body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--soft);
}

.p-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.p-tabs:has(button:nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }

.p-tabs button {
  padding: 10px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--body);
  font-size: 11px;
  cursor: pointer;
}

.p-tabs button.is-active { border-color: var(--accent); color: var(--accent); }

.p-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--ink);
}

.p-field { display: grid; gap: 5px; margin-bottom: 10px; }

.p-field > span {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--soft);
}

.p-field input, .p-field textarea { padding: 9px 10px; font-size: 14px; }

.p-hint { margin: 6px 0 10px; font-size: 11px; color: var(--soft); line-height: 1.5; }

.p-blocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.p-blocks li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--card);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.p-blocks li.is-drag {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}

.p-blocks.is-dragging li:not(.is-drag) { opacity: .55; transition: opacity .2s ease; }

.p-grip {
  flex: 0 0 auto;
  width: 12px;
  height: 16px;
  opacity: .5;
  background-image: radial-gradient(currentColor 1px, transparent 1.2px);
  background-size: 6px 5px;
}

.p-blocks label { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }

.p-actions { display: grid; gap: 8px; }
.p-actions .btn { margin-top: 0; text-align: center; }
