.legal-editable {
  position: relative;
}

.legal-edit-pencil {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(210, 87, 74, 0.35);
  background: linear-gradient(135deg, rgba(210, 87, 74, 0.12), rgba(210, 87, 74, 0.04));
  color: var(--brand-accent-strong, #d2574a);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(210, 87, 74, 0.16);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.legal-edit-pencil svg {
  width: 18px;
  height: 18px;
}

.legal-edit-pencil:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 12px 24px rgba(210, 87, 74, 0.22);
  background: linear-gradient(135deg, rgba(210, 87, 74, 0.18), rgba(210, 87, 74, 0.06));
}

.legal-edit-panel {
  margin-bottom: 1.4rem;
}

.legal-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.legal-cancel-btn,
.legal-save-btn {
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.legal-cancel-btn {
  background: rgba(15, 23, 42, 0.06);
  color: #45536b;
}

.legal-cancel-btn:hover {
  background: rgba(15, 23, 42, 0.1);
}

.legal-save-btn {
  background: linear-gradient(135deg, var(--brand-accent, #e0765f), var(--brand-accent-strong, #d2574a));
  color: #fff6ef;
  box-shadow: 0 12px 22px rgba(210, 87, 74, 0.28);
}

.legal-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(210, 87, 74, 0.34);
}

.legal-save-btn:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

@media (max-width: 640px) {
  .legal-edit-pencil {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
  }
}
